From f6fec278d67e31328e58d51f04f4bbce085189c0 Mon Sep 17 00:00:00 2001 From: markitosha Date: Wed, 29 Jul 2026 11:33:30 +0200 Subject: [PATCH 01/18] feat(agents): update agent card URL for Agents v2 --- src/custom/agents/CustomAgents.ts | 2 +- tests/custom/agents.create.integration.ts | 196 ------- tests/custom/agents.delete.integration.ts | 55 -- .../agents.deleteContext.integration.ts | 94 ---- tests/custom/agents.get.integration.ts | 55 -- tests/custom/agents.getCard.integration.ts | 55 -- tests/custom/agents.getCardUrl.integration.ts | 63 --- tests/custom/agents.getContext.integration.ts | 166 ------ .../agents.getRegistryExperts.integration.ts | 67 --- tests/custom/agents.getTask.integration.ts | 124 ----- tests/custom/agents.list.integration.ts | 92 --- .../custom/agents.messageSend.integration.ts | 523 ------------------ tests/custom/agents.update.integration.ts | 131 ----- 13 files changed, 1 insertion(+), 1622 deletions(-) delete mode 100644 tests/custom/agents.create.integration.ts delete mode 100644 tests/custom/agents.delete.integration.ts delete mode 100644 tests/custom/agents.deleteContext.integration.ts delete mode 100644 tests/custom/agents.get.integration.ts delete mode 100644 tests/custom/agents.getCard.integration.ts delete mode 100644 tests/custom/agents.getCardUrl.integration.ts delete mode 100644 tests/custom/agents.getContext.integration.ts delete mode 100644 tests/custom/agents.getRegistryExperts.integration.ts delete mode 100644 tests/custom/agents.getTask.integration.ts delete mode 100644 tests/custom/agents.list.integration.ts delete mode 100644 tests/custom/agents.messageSend.integration.ts delete mode 100644 tests/custom/agents.update.integration.ts diff --git a/src/custom/agents/CustomAgents.ts b/src/custom/agents/CustomAgents.ts index 825fe058..34c07856 100644 --- a/src/custom/agents/CustomAgents.ts +++ b/src/custom/agents/CustomAgents.ts @@ -22,7 +22,7 @@ export class CustomAgents extends AgentsClient { public getCardUrl = async (agentId: string): Promise => { const encodedAgentId = encodeURIComponent(agentId); return new URL( - `/agents/${encodedAgentId}/agent-card.json`, + `/v2/agentic/agents/${encodedAgentId}/.well-known/agent-card.json`, (await core.Supplier.get(this._options.environment)).agents, ); }; diff --git a/tests/custom/agents.create.integration.ts b/tests/custom/agents.create.integration.ts deleted file mode 100644 index a54fd497..00000000 --- a/tests/custom/agents.create.integration.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.create", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should create agent with only required values", () => { - it("should create agent with only name and description without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should create agent with all optional values", () => { - it("should create agent with systemPrompt without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - systemPrompt: faker.lorem.paragraph(), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should create agent with ephemeral set to true without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - ephemeral: true, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should create agent with all optional parameters without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - systemPrompt: faker.lorem.paragraph(), - ephemeral: false, - agentType: "orchestrator", - experts: [], - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should create agent with all agentType enum values", () => { - it("should create agent with agentType expert without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - agentType: "expert", - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should create agent with agentType orchestrator without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - agentType: "orchestrator", - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should create agent with agentType interviewing-expert without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - agentType: "interviewing-expert", - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should create agent with experts", () => { - it("should create agent with an expert reference by name without errors or warnings", async () => { - const registry = await cortiClient.agents.getRegistryExperts({ limit: 1 }); - const expertName = registry.experts?.[0]?.name; - if (!expertName) { - console.warn("Skipping: no registry experts available"); - return; - } - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - experts: [{ type: "reference", name: expertName }], - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should create agent with a new inline expert without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - experts: [ - { - type: "new", - name: faker.string.alphanumeric(10), - description: faker.lorem.sentence(), - systemPrompt: faker.lorem.paragraph(), - }, - ], - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when expert reference name does not exist in registry", async () => { - expect.assertions(1); - - await expect( - cortiClient.agents.create({ - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - experts: [{ type: "reference", name: faker.string.alphanumeric(10) }], - }), - ).rejects.toThrow("Status code: 400"); - }); - }); - - describe("should handle errors when required parameters are missing", () => { - it("should throw error when name is missing", async () => { - expect.assertions(1); - - await expect( - cortiClient.agents.create({ - description: faker.lorem.sentence(), - } as any), - ).rejects.toThrow('Missing required key "name"'); - }); - - it("should throw error when description is missing", async () => { - expect.assertions(1); - - await expect( - cortiClient.agents.create({ - name: faker.lorem.words(3), - } as any), - ).rejects.toThrow('Missing required key "description"'); - }); - }); -}); diff --git a/tests/custom/agents.delete.integration.ts b/tests/custom/agents.delete.integration.ts deleted file mode 100644 index 1fb63829..00000000 --- a/tests/custom/agents.delete.integration.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.delete", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should delete agent with only required values", () => { - it("should successfully delete an existing agent without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.delete(agent.id); - - expect(result).toBeUndefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when required parameters are missing", () => { - it("should throw error when agent ID is missing", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.delete(undefined as any)).rejects.toThrow(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when agent ID is invalid format", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.delete("invalid-uuid")).rejects.toThrow("Status code: 400"); - }); - - it("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.delete(faker.string.uuid())).rejects.toThrow("Status code: 404"); - }); - }); -}); diff --git a/tests/custom/agents.deleteContext.integration.ts b/tests/custom/agents.deleteContext.integration.ts deleted file mode 100644 index eb55ac3a..00000000 --- a/tests/custom/agents.deleteContext.integration.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, sendTestMessage, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.deleteContext", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should delete context with only required values", () => { - it("should successfully delete an existing context without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - const result = await cortiClient.agents.deleteContext(agent.id, contextId); - - expect(result).toBeUndefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when agent ID is invalid format", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - await expect(cortiClient.agents.deleteContext("invalid-uuid", contextId)).rejects.toThrow( - "Status code: 400", - ); - }); - - it("should throw error when context ID is invalid format", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.deleteContext(agent.id, "invalid-uuid")).rejects.toThrow( - "Status code: 400", - ); - }); - - // FIXME: re-enable when agents team fixes the regression where the endpoint stopped validating the agent ID - it.skip("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - await expect(cortiClient.agents.deleteContext(faker.string.uuid(), contextId)).rejects.toThrow( - "Status code: 404", - ); - }); - - it("should throw error when context ID does not exist", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.deleteContext(agent.id, faker.string.uuid())).rejects.toThrow( - "Status code: 404", - ); - }); - }); -}); diff --git a/tests/custom/agents.get.integration.ts b/tests/custom/agents.get.integration.ts deleted file mode 100644 index 6f2fec7d..00000000 --- a/tests/custom/agents.get.integration.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.get", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should retrieve agent with only required values", () => { - it("should successfully retrieve an existing agent without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.get(agent.id); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when required parameters are missing", () => { - it("should throw error when agent ID is missing", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.get(undefined as any)).rejects.toThrow(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when agent ID is invalid format", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.get("invalid-uuid")).rejects.toThrow("Status code: 400"); - }); - - it("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.get(faker.string.uuid())).rejects.toThrow("Status code: 404"); - }); - }); -}); diff --git a/tests/custom/agents.getCard.integration.ts b/tests/custom/agents.getCard.integration.ts deleted file mode 100644 index df9b53a3..00000000 --- a/tests/custom/agents.getCard.integration.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.getCard", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should retrieve agent card with only required values", () => { - it("should successfully retrieve an agent card without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.getCard(agent.id); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when required parameters are missing", () => { - it("should throw error when agent ID is missing", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.getCard(undefined as any)).rejects.toThrow(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when agent ID is invalid format", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.getCard("invalid-uuid")).rejects.toThrow("Status code: 400"); - }); - - it("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.getCard(faker.string.uuid())).rejects.toThrow("Status code: 404"); - }); - }); -}); diff --git a/tests/custom/agents.getCardUrl.integration.ts b/tests/custom/agents.getCardUrl.integration.ts deleted file mode 100644 index 2fffde5e..00000000 --- a/tests/custom/agents.getCardUrl.integration.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { CortiClient } from "../../src"; -import { createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.getCardUrl", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should return correct URL for agent card", () => { - it("should return a valid URL instance without errors or warnings", async () => { - expect.assertions(4); - - const agentId = "test-agent-123"; - - const url = await cortiClient.agents.getCardUrl(agentId); - - expect(url).toBeInstanceOf(URL); - expect(url.toString()).toContain(`/agents/${agentId}/agent-card.json`); - expect(url.toString()).toContain(process.env.CORTI_ENVIRONMENT); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should handle different agent IDs correctly", async () => { - expect.assertions(7); - - const agentIds = ["agent-1", "550e8400-e29b-41d4-a716-446655440000", "my-custom-agent"]; - - for (const agentId of agentIds) { - const url = await cortiClient.agents.getCardUrl(agentId); - - expect(url).toBeInstanceOf(URL); - expect(url.toString()).toContain(`/agents/${agentId}/agent-card.json`); - } - - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("URL structure", () => { - it("should return URL with correct path structure", async () => { - expect.assertions(3); - - const agentId = "test-agent"; - - const url = await cortiClient.agents.getCardUrl(agentId); - - expect(url).toBeInstanceOf(URL); - expect(url.pathname).toBe(`/agents/${agentId}/agent-card.json`); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); -}); diff --git a/tests/custom/agents.getContext.integration.ts b/tests/custom/agents.getContext.integration.ts deleted file mode 100644 index c508af3d..00000000 --- a/tests/custom/agents.getContext.integration.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, sendTestMessage, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.getContext", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should retrieve context with only required values", () => { - it("should successfully retrieve a context without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - const result = await cortiClient.agents.getContext(agent.id, contextId); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should retrieve context with optional parameters", () => { - it("should retrieve context with limit parameter without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - const result = await cortiClient.agents.getContext(agent.id, contextId, { - limit: faker.number.int({ min: 1, max: 100 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should retrieve context with offset parameter without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - const result = await cortiClient.agents.getContext(agent.id, contextId, { - offset: faker.number.int({ min: 0, max: 100 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should retrieve context with all optional parameters without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - const result = await cortiClient.agents.getContext(agent.id, contextId, { - limit: faker.number.int({ min: 1, max: 100 }), - offset: faker.number.int({ min: 0, max: 100 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when required parameters are missing", () => { - it("should throw error when agent ID is missing", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.getContext(undefined as any, faker.string.uuid())).rejects.toThrow(); - }); - - it("should throw error when context ID is missing", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.getContext(agent.id, undefined as any)).rejects.toThrow(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when agent ID is invalid format", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - await expect(cortiClient.agents.getContext("invalid-uuid", contextId)).rejects.toThrow("Status code: 400"); - }); - - it("should throw error when context ID is invalid format", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.getContext(agent.id, "invalid-uuid")).rejects.toThrow("Status code: 400"); - }); - - // FIXME: re-enable when agents team fixes the regression where the endpoint stopped validating the agent ID - it.skip("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const contextId = messageResponse.task?.contextId; - - if (!contextId) { - throw new Error("No context ID returned from message send"); - } - - await expect(cortiClient.agents.getContext(faker.string.uuid(), contextId)).rejects.toThrow( - "Status code: 404", - ); - }); - - it("should throw error when context ID does not exist", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.getContext(agent.id, faker.string.uuid())).rejects.toThrow( - "Status code: 404", - ); - }); - }); -}); diff --git a/tests/custom/agents.getRegistryExperts.integration.ts b/tests/custom/agents.getRegistryExperts.integration.ts deleted file mode 100644 index fdcc4f99..00000000 --- a/tests/custom/agents.getRegistryExperts.integration.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.getRegistryExperts", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should retrieve registry experts with only required values", () => { - it("should return registry experts without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.getRegistryExperts(); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should retrieve registry experts with optional parameters", () => { - it("should return registry experts with limit parameter without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.getRegistryExperts({ - limit: faker.number.int({ min: 1, max: 100 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should return registry experts with offset parameter without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.getRegistryExperts({ - offset: faker.number.int({ min: 0, max: 100 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should return registry experts with all optional parameters without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.getRegistryExperts({ - limit: faker.number.int({ min: 1, max: 100 }), - offset: faker.number.int({ min: 0, max: 100 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); -}); diff --git a/tests/custom/agents.getTask.integration.ts b/tests/custom/agents.getTask.integration.ts deleted file mode 100644 index 602afb68..00000000 --- a/tests/custom/agents.getTask.integration.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, sendTestMessage, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.getTask", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should retrieve task with only required values", () => { - it("should successfully retrieve a task without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const taskId = messageResponse.task?.id; - - if (!taskId) { - throw new Error("No task ID returned from message send"); - } - - const result = await cortiClient.agents.getTask(agent.id, taskId); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should retrieve task with optional parameters", () => { - it("should retrieve task with historyLength parameter without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const taskId = messageResponse.task?.id; - - if (!taskId) { - throw new Error("No task ID returned from message send"); - } - - const result = await cortiClient.agents.getTask(agent.id, taskId, { - historyLength: faker.number.int({ min: 1, max: 100 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when required parameters are missing", () => { - it("should throw error when agent ID is missing", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.getTask(undefined as any, faker.string.uuid())).rejects.toThrow(); - }); - - it("should throw error when task ID is missing", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.getTask(agent.id, undefined as any)).rejects.toThrow(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - // FIXME: re-enable when validation is implemented - it.skip("should throw error when agent ID is invalid format", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const taskId = messageResponse.task?.id; - - if (!taskId) { - throw new Error("No task ID returned from message send"); - } - - await expect(cortiClient.agents.getTask("invalid-uuid", taskId)).rejects.toThrow("Status code: 400"); - }); - - it("should throw error when task ID is invalid format", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.getTask(agent.id, "invalid-uuid")).rejects.toThrow("Status code: 400"); - }); - - // FIXME: re-enable when proper error handling is implemented - it.skip("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - const messageResponse = await sendTestMessage(cortiClient, agent.id); - const taskId = messageResponse.task?.id; - - if (!taskId) { - throw new Error("No task ID returned from message send"); - } - - await expect(cortiClient.agents.getTask(faker.string.uuid(), taskId)).rejects.toThrow("Status code: 404"); - }); - - it("should throw error when task ID does not exist", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.getTask(agent.id, faker.string.uuid())).rejects.toThrow("Status code: 404"); - }); - }); -}); diff --git a/tests/custom/agents.list.integration.ts b/tests/custom/agents.list.integration.ts deleted file mode 100644 index d66a307f..00000000 --- a/tests/custom/agents.list.integration.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.list", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should list agents with only required values", () => { - it("should return created agent in list without errors or warnings", async () => { - expect.assertions(2); - - await createTestAgent(cortiClient); - - const result = await cortiClient.agents.list(); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should return list with optional parameters", () => { - it("should return list with limit parameter without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.list({ - limit: faker.number.int({ min: 1, max: 10 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should return list with offset parameter without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.list({ - offset: faker.number.int({ min: 0, max: 10 }), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should return list with ephemeral false without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.list({ - ephemeral: false, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should return list with ephemeral true without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.list({ - ephemeral: true, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should return list with all optional parameters without errors or warnings", async () => { - expect.assertions(2); - - const result = await cortiClient.agents.list({ - limit: faker.number.int({ min: 1, max: 10 }), - offset: faker.number.int({ min: 0, max: 10 }), - ephemeral: false, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); -}); diff --git a/tests/custom/agents.messageSend.integration.ts b/tests/custom/agents.messageSend.integration.ts deleted file mode 100644 index f3088994..00000000 --- a/tests/custom/agents.messageSend.integration.ts +++ /dev/null @@ -1,523 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.messageSend", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should send message with minimal fields", () => { - it("should send message with only required fields without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should send message with agent role without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "agent", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should send message with all optional fields", () => { - it("should send message with metadata without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - metadata: { - testKey: faker.lorem.word(), - }, - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should send message with extensions without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - extensions: [faker.lorem.word()], - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - // FIXME: We need to be able to get a task in not final state, otherwise error is valid - it.skip("should send message with taskId and contextId without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const firstMessage = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }); - - const taskId = firstMessage.task?.id; - const contextId = firstMessage.task?.contextId; - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - taskId: taskId, - contextId: contextId, - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should send message with referenceTaskIds without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - referenceTaskIds: [faker.string.uuid()], - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - // FIXME: We need to be able to get a task in not final state, otherwise error is valid - it.skip("should send message with all optional parameters without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const firstMessage = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }); - - const taskId = firstMessage.task?.id; - const contextId = firstMessage.task?.contextId; - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - metadata: { - testKey: faker.lorem.word(), - }, - extensions: [faker.lorem.word()], - taskId: taskId, - contextId: contextId, - referenceTaskIds: [faker.string.uuid()], - }, - configuration: { - blocking: true, - }, - metadata: { - testMetadata: faker.lorem.word(), - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should send message with all part kinds", () => { - it("should send message with file part (uri) without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "file", - file: { uri: "https://example.com/file.pdf", mimeType: "application/pdf" }, - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should send message with data part without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "data", - data: { key: faker.lorem.word() }, - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should send message with configuration fields", () => { - it("should send message with configuration.acceptedOutputModes without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [{ kind: "text", text: faker.lorem.sentence() }], - messageId: faker.string.uuid(), - kind: "message", - }, - configuration: { acceptedOutputModes: ["text/plain"] }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should send message with configuration.historyLength without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [{ kind: "text", text: faker.lorem.sentence() }], - messageId: faker.string.uuid(), - kind: "message", - }, - configuration: { historyLength: faker.number.int({ min: 1, max: 10 }) }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should send message with configuration.blocking false without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [{ kind: "text", text: faker.lorem.sentence() }], - messageId: faker.string.uuid(), - kind: "message", - }, - configuration: { blocking: false }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should send message with top-level metadata", () => { - it("should send message with metadata without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [{ kind: "text", text: faker.lorem.sentence() }], - messageId: faker.string.uuid(), - kind: "message", - }, - metadata: { testKey: faker.lorem.word() }, - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when required parameters are missing", () => { - it("should throw error when message is missing", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect(cortiClient.agents.messageSend(agent.id, {} as any)).rejects.toThrow( - 'Missing required key "message"', - ); - }); - - it("should throw error when role is missing", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect( - cortiClient.agents.messageSend(agent.id, { - message: { - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - } as any, - }), - ).rejects.toThrow('Missing required key "role"'); - }); - - it("should throw error when parts is missing", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect( - cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - messageId: faker.string.uuid(), - kind: "message", - } as any, - }), - ).rejects.toThrow('Missing required key "parts"'); - }); - - it("should throw error when messageId is missing", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect( - cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - kind: "message", - } as any, - }), - ).rejects.toThrow('Missing required key "messageId"'); - }); - - it("should throw error when kind is missing", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect( - cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - } as any, - }), - ).rejects.toThrow('Missing required key "kind"'); - }); - - it("should throw error when text is missing in text part", async () => { - expect.assertions(1); - - const agent = await createTestAgent(cortiClient); - - await expect( - cortiClient.agents.messageSend(agent.id, { - message: { - role: "user", - parts: [ - { - kind: "text", - } as any, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }), - ).rejects.toThrow('Missing required key "text"'); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when agent ID is invalid format", async () => { - expect.assertions(1); - - await expect( - cortiClient.agents.messageSend("invalid-uuid", { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }), - ).rejects.toThrow("Status code: 400"); - }); - - it("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - await expect( - cortiClient.agents.messageSend(faker.string.uuid(), { - message: { - role: "user", - parts: [ - { - kind: "text", - text: faker.lorem.sentence(), - }, - ], - messageId: faker.string.uuid(), - kind: "message", - }, - }), - ).rejects.toThrow("Status code: 404"); - }); - }); -}); diff --git a/tests/custom/agents.update.integration.ts b/tests/custom/agents.update.integration.ts deleted file mode 100644 index b70e4d69..00000000 --- a/tests/custom/agents.update.integration.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { faker } from "@faker-js/faker"; -import type { CortiClient } from "../../src"; -import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; - -describe("cortiClient.agents.update", () => { - let cortiClient: CortiClient; - let consoleWarnSpy: ReturnType; - - beforeAll(() => { - cortiClient = createTestCortiClient(); - }); - - beforeEach(() => { - consoleWarnSpy = setupConsoleWarnSpy(); - }); - - afterEach(() => { - consoleWarnSpy.mockRestore(); - }); - - describe("should update agent with only required values", () => { - it("should update agent with empty body without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.update(agent.id, {}); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should update agent with all optional values", () => { - it("should update agent with name without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.update(agent.id, { - name: faker.lorem.words(3), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should update agent with description without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.update(agent.id, { - description: faker.lorem.sentence(), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should update agent with systemPrompt without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.update(agent.id, { - systemPrompt: faker.lorem.paragraph(), - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should update agent with inline expert without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.update(agent.id, { - experts: [ - { - type: "new", - name: faker.string.alphanumeric(10), - description: faker.lorem.sentence(), - }, - ], - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - - it("should update agent with all optional parameters without errors or warnings", async () => { - expect.assertions(2); - - const agent = await createTestAgent(cortiClient); - - const result = await cortiClient.agents.update(agent.id, { - name: faker.lorem.words(3), - description: faker.lorem.sentence(), - systemPrompt: faker.lorem.paragraph(), - experts: [], - }); - - expect(result).toBeDefined(); - expect(consoleWarnSpy).not.toHaveBeenCalled(); - }); - }); - - describe("should throw error when required parameters are missing", () => { - it("should throw error when agent ID is missing", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.update(undefined as any, {})).rejects.toThrow(); - }); - }); - - describe("should throw error when invalid parameters are provided", () => { - it("should throw error when agent ID is invalid", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.update("invalid-uuid", {})).rejects.toThrow("Status code: 400"); - }); - - it("should throw error when agent ID does not exist", async () => { - expect.assertions(1); - - await expect(cortiClient.agents.update(faker.string.uuid(), {})).rejects.toThrow("Status code: 404"); - }); - }); -}); From 827362158bbe8e687c3961da58d7c32fff2fdad9 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 11:49:24 +0000 Subject: [PATCH 02/18] SDK regeneration --- .fern/metadata.json | 4 +- src/BaseClient.ts | 5 - src/api/errors/ConflictError.ts | 3 +- src/api/resources/agents/client/Client.ts | 883 +++----- .../client/requests/AgentsCreateAgent.ts | 26 - .../client/requests/AgentsCreateRequest.ts | 69 + .../requests/AgentsGetContextRequest.ts | 12 - .../AgentsGetRegistryExpertsRequest.ts | 15 - .../client/requests/AgentsGetTaskRequest.ts | 10 - .../client/requests/AgentsListRequest.ts | 14 - .../requests/AgentsMessageSendParams.ts | 24 - .../client/requests/AgentsPatchRequest.ts | 30 + .../client/requests/AgentsUpdateAgent.ts | 19 - .../client/requests/ListAgentsRequest.ts | 25 + .../resources/agents/client/requests/index.ts | 10 +- src/api/resources/agents/index.ts | 2 +- .../agents/resources/a2A/client/Client.ts | 336 +++ .../agents/resources/a2A/client/index.ts | 1 + .../a2A/client/requests/A2AjsonrpcRequest.ts | 29 + .../resources/a2A/client/requests/index.ts | 1 + .../resources/agents/resources/a2A/index.ts | 3 + .../agents/resources/a2A/resources/index.ts | 2 + .../a2A/resources/tasks/client/Client.ts | 357 +++ .../a2A/resources/tasks/client/index.ts | 1 + .../tasks/client/requests/GetTasksRequest.ts | 10 + .../tasks/client/requests/ListTasksRequest.ts | 14 + .../resources/tasks/client/requests/index.ts | 2 + .../resources/a2A/resources/tasks/index.ts | 1 + .../a2A/types/A2AjsonrpcRequestId.ts | 3 + .../a2A/types/A2AjsonrpcRequestMethod.ts | 12 + .../agents/resources/a2A/types/index.ts | 2 + .../resources/artifacts/client/Client.ts | 114 + .../resources/artifacts/client/index.ts | 1 + .../agents/resources/artifacts/index.ts | 1 + .../resources/connectors/client/Client.ts | 351 +++ .../resources/connectors/client/index.ts | 1 + .../agents/resources/connectors/index.ts | 1 + .../resources/contexts/client/Client.ts | 291 +++ .../agents/resources/contexts/client/index.ts | 1 + .../client/requests/GetContextsRequest.ts | 10 + .../requests/GetTraceContextsRequest.ts | 12 + .../contexts/client/requests/index.ts | 2 + .../agents/resources/contexts/index.ts | 2 + .../resources/contexts/resources/index.ts | 2 + .../contexts/resources/tasks/client/Client.ts | 202 ++ .../contexts/resources/tasks/client/index.ts | 1 + .../tasks/client/requests/ListTasksRequest.ts | 12 + .../resources/tasks/client/requests/index.ts | 1 + .../contexts/resources/tasks/index.ts | 1 + .../resources/feedback/client/Client.ts | 307 +++ .../agents/resources/feedback/client/index.ts | 1 + .../client/requests/FeedbackCreateRequest.ts | 49 + .../feedback/client/requests/index.ts | 1 + .../agents/resources/feedback/index.ts | 1 + src/api/resources/agents/resources/index.ts | 13 + .../resources/registry/client/Client.ts | 192 ++ .../agents/resources/registry/client/index.ts | 1 + .../client/requests/ListRegistryRequest.ts | 17 + .../registry/client/requests/index.ts | 1 + .../agents/resources/registry/index.ts | 1 + .../agents/resources/usage/client/Client.ts | 130 ++ .../agents/resources/usage/client/index.ts | 1 + .../usage/client/requests/GetUsageRequest.ts | 25 + .../resources/usage/client/requests/index.ts | 1 + .../resources/agents/resources/usage/index.ts | 1 + .../types/AgentsCreateAgentAgentType.ts | 9 - .../types/AgentsCreateAgentExpertsItem.ts | 5 - .../agents/types/AgentsMessageSendResponse.ts | 8 - .../types/AgentsUpdateAgentExpertsItem.ts | 5 - src/api/resources/agents/types/index.ts | 4 - src/api/resources/auth/client/Client.ts | 17 +- ...okenRequestBody.ts => AuthTokenRequest.ts} | 2 +- src/api/resources/auth/types/index.ts | 2 +- src/api/resources/codes/client/Client.ts | 7 +- .../requests/CodesGeneralPredictRequest.ts | 4 + src/api/resources/documents/client/Client.ts | 99 +- .../client/requests/CreateDocumentsRequest.ts | 25 + .../client/requests/DeleteDocumentsRequest.ts | 12 + .../client/requests/DocumentsUpdateRequest.ts | 6 +- .../requests/GenerateDocumentsRequest.ts | 21 + .../client/requests/GetDocumentsRequest.ts | 12 + .../client/requests/ListDocumentsRequest.ts | 12 + .../documents/client/requests/index.ts | 5 + .../resources/sections/client/Client.ts | 83 +- .../client/requests/CreateSectionsRequest.ts | 19 + .../client/requests/DeleteSectionsRequest.ts | 12 + .../client/requests/GetSectionsRequest.ts | 12 + .../requests/GuidedSectionsListRequest.ts | 6 +- .../requests/GuidedSectionsUpdateRequest.ts | 6 +- .../sections/client/requests/index.ts | 3 + .../resources/versions/client/Client.ts | 54 +- .../client/requests/DeleteVersionsRequest.ts | 12 + .../client/requests/GetVersionsRequest.ts | 12 + .../GuidedSectionsCreateVersionRequest.ts | 3 + .../client/requests/ListVersionsRequest.ts | 12 + .../client/requests/PublishVersionsRequest.ts | 12 + .../versions/client/requests/index.ts | 4 + .../resources/templates/client/Client.ts | 83 +- .../client/requests/CreateTemplatesRequest.ts | 19 + .../client/requests/DeleteTemplatesRequest.ts | 12 + .../client/requests/GetTemplatesRequest.ts | 12 + .../requests/GuidedTemplatesListRequest.ts | 6 +- .../requests/GuidedTemplatesUpdateRequest.ts | 6 +- .../templates/client/requests/index.ts | 3 + .../resources/versions/client/Client.ts | 54 +- .../client/requests/DeleteVersionsRequest.ts | 12 + .../client/requests/GetVersionsRequest.ts | 12 + .../GuidedTemplatesCreateVersionRequest.ts | 3 + .../client/requests/ListVersionsRequest.ts | 12 + .../client/requests/PublishVersionsRequest.ts | 12 + .../versions/client/requests/index.ts | 4 + src/api/resources/facts/client/Client.ts | 55 +- .../requests/FactsBatchUpdateRequest.ts | 3 + .../client/requests/FactsCreateRequest.ts | 3 + .../client/requests/FactsExtractRequest.ts | 3 + .../requests/FactsFactGroupsListRequest.ts | 12 + .../facts/client/requests/FactsListRequest.ts | 12 + .../client/requests/FactsUpdateRequest.ts | 6 +- .../resources/facts/client/requests/index.ts | 2 + src/api/resources/index.ts | 2 +- .../resources/interactions/client/Client.ts | 58 +- .../requests/InteractionsCreateRequest.ts | 3 + .../requests/InteractionsDeleteRequest.ts | 12 + .../client/requests/InteractionsGetRequest.ts | 12 + .../requests/InteractionsListRequest.ts | 6 +- .../requests/InteractionsUpdateRequest.ts | 6 +- .../interactions/client/requests/index.ts | 2 + src/api/resources/languages/client/Client.ts | 12 +- .../client/requests/LanguagesListRequest.ts | 6 +- src/api/resources/recordings/client/Client.ts | 32 +- src/api/resources/recordings/client/index.ts | 2 +- .../requests/RecordingsDeleteRequest.ts | 12 + .../client/requests/RecordingsGetRequest.ts | 12 + .../client/requests/RecordingsListRequest.ts | 12 + .../recordings/client/requests/index.ts | 3 + src/api/resources/templates/client/Client.ts | 36 +- .../client/requests/GetTemplatesRequest.ts | 12 + .../client/requests/TemplatesListRequest.ts | 6 +- .../requests/TemplatesSectionListRequest.ts | 6 +- .../templates/client/requests/index.ts | 1 + .../resources/transcripts/client/Client.ts | 54 +- .../requests/TranscriptsCreateRequest.ts | 3 + .../requests/TranscriptsDeleteRequest.ts | 12 + .../client/requests/TranscriptsGetRequest.ts | 12 + .../requests/TranscriptsGetStatusRequest.ts | 12 + .../client/requests/TranscriptsListRequest.ts | 6 +- .../transcripts/client/requests/index.ts | 3 + src/api/types/A2ASendMessageConfiguration.ts | 13 + src/api/types/A2ASendMessageRequest.ts | 15 + src/api/types/A2ASendMessageResponse.ts | 6 + src/api/types/A2AStreamEventResponse.ts | 18 + src/api/types/A2AjsonrpcResponse.ts | 16 + src/api/types/A2AjsonrpcResponseError.ts | 13 + src/api/types/A2AjsonrpcResponseId.ts | 3 + src/api/types/AgentCardResponse.ts | 37 + .../types/AgentCardResponseCapabilities.ts | 14 + src/api/types/AgentCardResponseProvider.ts | 11 + .../types/AgentCardResponseSignaturesItem.ts | 10 + src/api/types/AgentCardResponseSkillsItem.ts | 12 + ...gentCardResponseSupportedInterfacesItem.ts | 12 + ...eSupportedInterfacesItemProtocolBinding.ts | 9 + src/api/types/AgentsAgent.ts | 17 - src/api/types/AgentsAgentCapabilities.ts | 14 - src/api/types/AgentsAgentCard.ts | 39 - src/api/types/AgentsAgentCardSignature.ts | 10 - src/api/types/AgentsAgentExpertsItem.ts | 5 - src/api/types/AgentsAgentExtension.ts | 12 - src/api/types/AgentsAgentInterface.ts | 7 - src/api/types/AgentsAgentProvider.ts | 8 - src/api/types/AgentsAgentReference.ts | 14 - src/api/types/AgentsAgentReferenceType.ts | 6 - src/api/types/AgentsAgentResponse.ts | 5 - src/api/types/AgentsAgentSkill.ts | 22 - src/api/types/AgentsArtifact.ts | 18 - src/api/types/AgentsContext.ts | 9 - src/api/types/AgentsContextItemsItem.ts | 5 - src/api/types/AgentsCreateExpert.ts | 15 - src/api/types/AgentsCreateExpertReference.ts | 18 - .../types/AgentsCreateExpertReferenceType.ts | 7 - src/api/types/AgentsCreateExpertType.ts | 6 - src/api/types/AgentsCreateMcpServer.ts | 22 - .../AgentsCreateMcpServerAuthorizationType.ts | 11 - .../AgentsCreateMcpServerTransportType.ts | 10 - src/api/types/AgentsDataPart.ts | 12 - src/api/types/AgentsDataPartKind.ts | 7 - src/api/types/AgentsExpert.ts | 17 - src/api/types/AgentsExpertReference.ts | 18 - src/api/types/AgentsExpertReferenceType.ts | 6 - src/api/types/AgentsExpertType.ts | 6 - src/api/types/AgentsFilePart.ts | 11 - src/api/types/AgentsFilePartFile.ts | 5 - src/api/types/AgentsFilePartKind.ts | 7 - src/api/types/AgentsFileWithBytes.ts | 10 - src/api/types/AgentsFileWithUri.ts | 10 - src/api/types/AgentsLabels.ts | 6 + src/api/types/AgentsLifecycle.ts | 11 + src/api/types/AgentsListResponse.ts | 13 + src/api/types/AgentsMcpServer.ts | 20 - .../types/AgentsMcpServerAuthorizationType.ts | 11 - src/api/types/AgentsMcpServerTransportType.ts | 10 - src/api/types/AgentsMessage.ts | 24 - src/api/types/AgentsMessageKind.ts | 7 - src/api/types/AgentsMessageRole.ts | 8 - .../types/AgentsMessageSendConfiguration.ts | 13 - src/api/types/AgentsPart.ts | 5 - ...gentsPushNotificationAuthenticationInfo.ts | 8 - src/api/types/AgentsPushNotificationConfig.ts | 13 - src/api/types/AgentsRegistryExpert.ts | 18 - .../types/AgentsRegistryExpertsResponse.ts | 8 - src/api/types/AgentsRegistryMcpServer.ts | 10 - ...gentsRegistryMcpServerAuthorizationType.ts | 11 - src/api/types/AgentsResponse.ts | 32 + src/api/types/AgentsTask.ts | 19 - src/api/types/AgentsTaskKind.ts | 7 - src/api/types/AgentsTaskStatus.ts | 12 - src/api/types/AgentsTaskStatusState.ts | 15 - src/api/types/AgentsTextPart.ts | 12 - src/api/types/AgentsTextPartKind.ts | 7 - src/api/types/AgentsUpdateExpertReference.ts | 8 - src/api/types/AgentsUserIdValue.ts | 6 + src/api/types/AgentsVisibility.ts | 13 + src/api/types/CommonA2AConnector.ts | 22 + src/api/types/CommonA2AConnectorCreate.ts | 14 + src/api/types/CommonAgentConnector.ts | 19 + src/api/types/CommonAgentConnectorCreate.ts | 13 + src/api/types/CommonAgentIdValue.ts | 6 + src/api/types/CommonArtifactIdValue.ts | 6 + src/api/types/CommonArtifactResponse.ts | 20 + src/api/types/CommonConnectorAuth.ts | 17 + src/api/types/CommonConnectorAuthType.ts | 10 + src/api/types/CommonConnectorCreateRequest.ts | 13 + src/api/types/CommonConnectorIdValue.ts | 6 + src/api/types/CommonConnectorResponse.ts | 13 + src/api/types/CommonConnectorType.ts | 15 + src/api/types/CommonContextIdValue.ts | 6 + src/api/types/CommonMcpConnector.ts | 23 + src/api/types/CommonMcpConnectorCreate.ts | 17 + src/api/types/CommonMessage.ts | 27 + src/api/types/CommonMessageIdValue.ts | 6 + src/api/types/CommonNextPageToken.ts | 6 + src/api/types/CommonPart.ts | 23 + .../types/CommonRegistryConnectorCreate.ts | 14 + .../CommonRegistryConnectorProvisioned.ts | 22 + src/api/types/CommonRole.ts | 8 + src/api/types/CommonSchemaConnector.ts | 26 + src/api/types/CommonSchemaConnectorCreate.ts | 20 + .../CommonSchemaConnectorCreateTransition.ts | 9 + .../types/CommonSchemaConnectorTransition.ts | 9 + src/api/types/CommonTaskIdValue.ts | 6 + src/api/types/CommonTaskListResponse.ts | 15 + src/api/types/CommonTaskMetadata.ts | 15 + src/api/types/CommonTaskResponse.ts | 18 + src/api/types/CommonTaskState.ts | 14 + src/api/types/CommonTaskStatus.ts | 13 + src/api/types/CommonTotalSize.ts | 6 + src/api/types/CommonUsage.ts | 27 + src/api/types/ConnectorsListResponse.ts | 11 + src/api/types/Contexts.ts | 19 + src/api/types/ContextsDetailResponse.ts | 14 + src/api/types/ContextsOpenInferenceSpan.ts | 19 + src/api/types/ContextsTraceItem.ts | 13 + src/api/types/ContextsTraceItemTrace.ts | 25 + src/api/types/ContextsTraceResponse.ts | 14 + src/api/types/FeedbackActor.ts | 14 + src/api/types/FeedbackIdValue.ts | 6 + src/api/types/FeedbackLabel.ts | 37 + src/api/types/FeedbackListResponse.ts | 11 + src/api/types/FeedbackMetadata.ts | 18 + src/api/types/FeedbackRating.ts | 12 + src/api/types/FeedbackRatingScale.ts | 12 + src/api/types/FeedbackResponse.ts | 25 + src/api/types/FeedbackTarget.ts | 11 + .../types/RegistryConnectorCapabilities.ts | 15 + .../types/RegistryConnectorListResponse.ts | 13 + src/api/types/RegistryConnectorResponse.ts | 35 + src/api/types/RegistryIcon.ts | 13 + src/api/types/UsageBucket.ts | 13 + src/api/types/UsageGranularity.ts | 10 + src/api/types/UsageMetrics.ts | 11 + src/api/types/UsageReportResponse.ts | 18 + src/api/types/index.ts | 133 +- src/core/index.ts | 1 + src/core/stream/Stream.ts | 235 ++ src/core/stream/index.ts | 1 + .../resources/agents/client/index.ts | 1 - .../resources/agents/client/list.ts | 13 - .../client/requests/AgentsCreateAgent.ts | 31 - .../client/requests/AgentsCreateRequest.ts | 36 + .../requests/AgentsMessageSendParams.ts | 24 - .../client/requests/AgentsPatchRequest.ts | 37 + .../client/requests/AgentsUpdateAgent.ts | 26 - .../resources/agents/client/requests/index.ts | 5 +- src/serialization/resources/agents/index.ts | 2 +- .../agents/resources/a2A/client/index.ts | 1 + .../a2A/client/requests/A2AjsonrpcRequest.ts | 24 + .../resources/a2A/client/requests/index.ts | 1 + .../resources/agents/resources/a2A/index.ts | 2 + .../a2A/types/A2AjsonrpcRequestId.ts | 14 + .../a2A/types/A2AjsonrpcRequestMethod.ts | 27 + .../agents/resources/a2A/types/index.ts | 2 + .../agents/resources/feedback/client/index.ts | 1 + .../client/requests/FeedbackCreateRequest.ts | 30 + .../feedback/client/requests/index.ts | 1 + .../agents/resources/feedback/index.ts | 1 + .../resources/agents/resources/index.ts | 5 + .../types/AgentsCreateAgentAgentType.ts | 14 - .../types/AgentsCreateAgentExpertsItem.ts | 16 - .../agents/types/AgentsMessageSendResponse.ts | 22 - .../types/AgentsUpdateAgentExpertsItem.ts | 16 - .../resources/agents/types/index.ts | 4 - ...okenRequestBody.ts => AuthTokenRequest.ts} | 20 +- .../resources/auth/types/index.ts | 2 +- .../requests/CodesGeneralPredictRequest.ts | 2 +- .../client/requests/DocumentsUpdateRequest.ts | 2 +- .../requests/GuidedSectionsUpdateRequest.ts | 2 +- .../GuidedSectionsCreateVersionRequest.ts | 2 +- .../requests/GuidedTemplatesUpdateRequest.ts | 2 +- .../GuidedTemplatesCreateVersionRequest.ts | 2 +- .../requests/FactsBatchUpdateRequest.ts | 2 +- .../client/requests/FactsCreateRequest.ts | 2 +- .../client/requests/FactsExtractRequest.ts | 2 +- .../client/requests/FactsUpdateRequest.ts | 2 +- src/serialization/resources/index.ts | 1 - .../requests/InteractionsCreateRequest.ts | 2 +- .../requests/InteractionsUpdateRequest.ts | 2 +- .../requests/TranscriptsCreateRequest.ts | 2 +- .../types/A2ASendMessageConfiguration.ts | 22 + .../types/A2ASendMessageRequest.ts | 26 + .../types/A2ASendMessageResponse.ts | 14 + .../types/A2AStreamEventResponse.ts | 24 + src/serialization/types/A2AjsonrpcResponse.ts | 26 + .../types/A2AjsonrpcResponseError.ts | 22 + .../types/A2AjsonrpcResponseId.ts | 14 + src/serialization/types/AgentCardResponse.ts | 51 + .../types/AgentCardResponseCapabilities.ts | 20 + .../types/AgentCardResponseProvider.ts | 20 + ....ts => AgentCardResponseSignaturesItem.ts} | 12 +- .../types/AgentCardResponseSkillsItem.ts | 24 + ...gentCardResponseSupportedInterfacesItem.ts | 23 + ...eSupportedInterfacesItemProtocolBinding.ts | 14 + src/serialization/types/AgentsAgent.ts | 28 - .../types/AgentsAgentCapabilities.ts | 25 - src/serialization/types/AgentsAgentCard.ts | 59 - .../types/AgentsAgentExpertsItem.ts | 16 - .../types/AgentsAgentExtension.ts | 24 - .../types/AgentsAgentInterface.ts | 20 - .../types/AgentsAgentProvider.ts | 20 - .../types/AgentsAgentReference.ts | 23 - .../types/AgentsAgentReferenceType.ts | 14 - .../types/AgentsAgentResponse.ts | 16 - src/serialization/types/AgentsAgentSkill.ts | 33 - src/serialization/types/AgentsArtifact.ts | 27 - src/serialization/types/AgentsContext.ts | 19 - .../types/AgentsContextItemsItem.ts | 16 - src/serialization/types/AgentsCreateExpert.ts | 28 - .../types/AgentsCreateExpertReference.ts | 27 - .../types/AgentsCreateExpertReferenceType.ts | 14 - .../types/AgentsCreateExpertType.ts | 14 - .../types/AgentsCreateMcpServer.ts | 34 - .../AgentsCreateMcpServerAuthorizationType.ts | 14 - .../AgentsCreateMcpServerTransportType.ts | 14 - src/serialization/types/AgentsDataPart.ts | 21 - src/serialization/types/AgentsDataPartKind.ts | 14 - src/serialization/types/AgentsExpert.ts | 28 - .../types/AgentsExpertReference.ts | 27 - .../types/AgentsExpertReferenceType.ts | 14 - src/serialization/types/AgentsExpertType.ts | 12 - src/serialization/types/AgentsFilePart.ts | 22 - src/serialization/types/AgentsFilePartFile.ts | 16 - src/serialization/types/AgentsFilePartKind.ts | 14 - .../types/AgentsFileWithBytes.ts | 22 - src/serialization/types/AgentsFileWithUri.ts | 22 - src/serialization/types/AgentsLabels.ts | 12 + src/serialization/types/AgentsLifecycle.ts | 12 + src/serialization/types/AgentsListResponse.ts | 25 + src/serialization/types/AgentsMcpServer.ts | 30 - .../types/AgentsMcpServerAuthorizationType.ts | 14 - .../types/AgentsMcpServerTransportType.ts | 14 - src/serialization/types/AgentsMessage.ts | 35 - src/serialization/types/AgentsMessageRole.ts | 12 - .../types/AgentsMessageSendConfiguration.ts | 25 - src/serialization/types/AgentsPart.ts | 15 - ...gentsPushNotificationAuthenticationInfo.ts | 20 - .../types/AgentsPushNotificationConfig.ts | 25 - .../types/AgentsRegistryExpert.ts | 29 - .../types/AgentsRegistryExpertsResponse.ts | 19 - .../types/AgentsRegistryMcpServer.ts | 21 - ...gentsRegistryMcpServerAuthorizationType.ts | 14 - src/serialization/types/AgentsResponse.ts | 44 + src/serialization/types/AgentsTask.ts | 32 - src/serialization/types/AgentsTaskKind.ts | 12 - src/serialization/types/AgentsTaskStatus.ts | 24 - .../types/AgentsTaskStatusState.ts | 33 - src/serialization/types/AgentsTextPart.ts | 21 - src/serialization/types/AgentsTextPartKind.ts | 14 - .../types/AgentsUpdateExpertReference.ts | 15 - src/serialization/types/AgentsUserIdValue.ts | 12 + src/serialization/types/AgentsVisibility.ts | 12 + src/serialization/types/CommonA2AConnector.ts | 27 + .../types/CommonA2AConnectorCreate.ts | 24 + .../types/CommonAgentConnector.ts | 26 + .../types/CommonAgentConnectorCreate.ts | 23 + src/serialization/types/CommonAgentIdValue.ts | 14 + .../types/CommonArtifactIdValue.ts | 14 + .../types/CommonArtifactResponse.ts | 30 + .../types/CommonConnectorAuth.ts | 25 + .../types/CommonConnectorAuthType.ts | 14 + .../types/CommonConnectorCreateRequest.ts | 30 + .../types/CommonConnectorIdValue.ts | 14 + .../types/CommonConnectorResponse.ts | 30 + .../types/CommonConnectorType.ts | 14 + .../types/CommonContextIdValue.ts | 14 + src/serialization/types/CommonMcpConnector.ts | 30 + .../types/CommonMcpConnectorCreate.ts | 27 + src/serialization/types/CommonMessage.ts | 35 + .../types/CommonMessageIdValue.ts | 14 + .../types/CommonNextPageToken.ts | 14 + src/serialization/types/CommonPart.ts | 31 + .../types/CommonRegistryConnectorCreate.ts | 24 + .../CommonRegistryConnectorProvisioned.ts | 27 + src/serialization/types/CommonRole.ts | 12 + .../types/CommonSchemaConnector.ts | 32 + .../types/CommonSchemaConnectorCreate.ts | 29 + .../CommonSchemaConnectorCreateTransition.ts | 14 + .../types/CommonSchemaConnectorTransition.ts | 14 + ...ntsMessageKind.ts => CommonTaskIdValue.ts} | 8 +- .../types/CommonTaskListResponse.ts | 27 + src/serialization/types/CommonTaskMetadata.ts | 22 + src/serialization/types/CommonTaskResponse.ts | 34 + src/serialization/types/CommonTaskState.ts | 29 + src/serialization/types/CommonTaskStatus.ts | 24 + src/serialization/types/CommonTotalSize.ts | 12 + src/serialization/types/CommonUsage.ts | 28 + .../types/ConnectorsListResponse.ts | 19 + src/serialization/types/Contexts.ts | 28 + .../types/ContextsDetailResponse.ts | 22 + .../types/ContextsOpenInferenceSpan.ts | 28 + src/serialization/types/ContextsTraceItem.ts | 22 + .../types/ContextsTraceItemTrace.ts | 34 + .../types/ContextsTraceResponse.ts | 25 + src/serialization/types/FeedbackActor.ts | 16 + src/serialization/types/FeedbackIdValue.ts | 12 + src/serialization/types/FeedbackLabel.ts | 41 + .../types/FeedbackListResponse.ts | 19 + src/serialization/types/FeedbackMetadata.ts | 23 + src/serialization/types/FeedbackRating.ts | 19 + .../types/FeedbackRatingScale.ts | 14 + src/serialization/types/FeedbackResponse.ts | 40 + src/serialization/types/FeedbackTarget.ts | 17 + .../types/RegistryConnectorCapabilities.ts | 24 + .../types/RegistryConnectorListResponse.ts | 25 + .../types/RegistryConnectorResponse.ts | 45 + src/serialization/types/RegistryIcon.ts | 20 + src/serialization/types/UsageBucket.ts | 21 + src/serialization/types/UsageGranularity.ts | 12 + src/serialization/types/UsageMetrics.ts | 18 + .../types/UsageReportResponse.ts | 29 + src/serialization/types/index.ts | 133 +- tests/unit/stream/Stream.test.ts | 563 +++++ tests/wire/agents.test.ts | 1965 +++++------------ tests/wire/agents/a2A.test.ts | 517 +++++ tests/wire/agents/a2A/tasks.test.ts | 625 ++++++ tests/wire/agents/artifacts.test.ts | 157 ++ tests/wire/agents/connectors.test.ts | 445 ++++ tests/wire/agents/contexts.test.ts | 439 ++++ tests/wire/agents/contexts/tasks.test.ts | 392 ++++ tests/wire/agents/feedback.test.ts | 498 +++++ tests/wire/agents/registry.test.ts | 239 ++ tests/wire/agents/usage.test.ts | 155 ++ tests/wire/auth.test.ts | 4 - tests/wire/codes.test.ts | 21 +- tests/wire/documents.test.ts | 429 ++-- tests/wire/documents/sections.test.ts | 81 +- .../wire/documents/sections/versions.test.ts | 57 +- tests/wire/documents/templates.test.ts | 81 +- .../wire/documents/templates/versions.test.ts | 57 +- tests/wire/facts.test.ts | 69 +- tests/wire/interactions.test.ts | 103 +- tests/wire/languages.test.ts | 44 +- tests/wire/recordings.test.ts | 59 +- tests/wire/templates.test.ts | 132 +- tests/wire/transcripts.test.ts | 135 +- 482 files changed, 12793 insertions(+), 4968 deletions(-) delete mode 100644 src/api/resources/agents/client/requests/AgentsCreateAgent.ts create mode 100644 src/api/resources/agents/client/requests/AgentsCreateRequest.ts delete mode 100644 src/api/resources/agents/client/requests/AgentsGetContextRequest.ts delete mode 100644 src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts delete mode 100644 src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts delete mode 100644 src/api/resources/agents/client/requests/AgentsListRequest.ts delete mode 100644 src/api/resources/agents/client/requests/AgentsMessageSendParams.ts create mode 100644 src/api/resources/agents/client/requests/AgentsPatchRequest.ts delete mode 100644 src/api/resources/agents/client/requests/AgentsUpdateAgent.ts create mode 100644 src/api/resources/agents/client/requests/ListAgentsRequest.ts create mode 100644 src/api/resources/agents/resources/a2A/client/Client.ts create mode 100644 src/api/resources/agents/resources/a2A/client/index.ts create mode 100644 src/api/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts create mode 100644 src/api/resources/agents/resources/a2A/client/requests/index.ts create mode 100644 src/api/resources/agents/resources/a2A/index.ts create mode 100644 src/api/resources/agents/resources/a2A/resources/index.ts create mode 100644 src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts create mode 100644 src/api/resources/agents/resources/a2A/resources/tasks/client/index.ts create mode 100644 src/api/resources/agents/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts create mode 100644 src/api/resources/agents/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts create mode 100644 src/api/resources/agents/resources/a2A/resources/tasks/client/requests/index.ts create mode 100644 src/api/resources/agents/resources/a2A/resources/tasks/index.ts create mode 100644 src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts create mode 100644 src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts create mode 100644 src/api/resources/agents/resources/a2A/types/index.ts create mode 100644 src/api/resources/agents/resources/artifacts/client/Client.ts create mode 100644 src/api/resources/agents/resources/artifacts/client/index.ts create mode 100644 src/api/resources/agents/resources/artifacts/index.ts create mode 100644 src/api/resources/agents/resources/connectors/client/Client.ts create mode 100644 src/api/resources/agents/resources/connectors/client/index.ts create mode 100644 src/api/resources/agents/resources/connectors/index.ts create mode 100644 src/api/resources/agents/resources/contexts/client/Client.ts create mode 100644 src/api/resources/agents/resources/contexts/client/index.ts create mode 100644 src/api/resources/agents/resources/contexts/client/requests/GetContextsRequest.ts create mode 100644 src/api/resources/agents/resources/contexts/client/requests/GetTraceContextsRequest.ts create mode 100644 src/api/resources/agents/resources/contexts/client/requests/index.ts create mode 100644 src/api/resources/agents/resources/contexts/index.ts create mode 100644 src/api/resources/agents/resources/contexts/resources/index.ts create mode 100644 src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts create mode 100644 src/api/resources/agents/resources/contexts/resources/tasks/client/index.ts create mode 100644 src/api/resources/agents/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts create mode 100644 src/api/resources/agents/resources/contexts/resources/tasks/client/requests/index.ts create mode 100644 src/api/resources/agents/resources/contexts/resources/tasks/index.ts create mode 100644 src/api/resources/agents/resources/feedback/client/Client.ts create mode 100644 src/api/resources/agents/resources/feedback/client/index.ts create mode 100644 src/api/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts create mode 100644 src/api/resources/agents/resources/feedback/client/requests/index.ts create mode 100644 src/api/resources/agents/resources/feedback/index.ts create mode 100644 src/api/resources/agents/resources/index.ts create mode 100644 src/api/resources/agents/resources/registry/client/Client.ts create mode 100644 src/api/resources/agents/resources/registry/client/index.ts create mode 100644 src/api/resources/agents/resources/registry/client/requests/ListRegistryRequest.ts create mode 100644 src/api/resources/agents/resources/registry/client/requests/index.ts create mode 100644 src/api/resources/agents/resources/registry/index.ts create mode 100644 src/api/resources/agents/resources/usage/client/Client.ts create mode 100644 src/api/resources/agents/resources/usage/client/index.ts create mode 100644 src/api/resources/agents/resources/usage/client/requests/GetUsageRequest.ts create mode 100644 src/api/resources/agents/resources/usage/client/requests/index.ts create mode 100644 src/api/resources/agents/resources/usage/index.ts delete mode 100644 src/api/resources/agents/types/AgentsCreateAgentAgentType.ts delete mode 100644 src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts delete mode 100644 src/api/resources/agents/types/AgentsMessageSendResponse.ts delete mode 100644 src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts delete mode 100644 src/api/resources/agents/types/index.ts rename src/api/resources/auth/types/{AuthTokenRequestBody.ts => AuthTokenRequest.ts} (90%) create mode 100644 src/api/resources/documents/client/requests/CreateDocumentsRequest.ts create mode 100644 src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts create mode 100644 src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts create mode 100644 src/api/resources/documents/client/requests/GetDocumentsRequest.ts create mode 100644 src/api/resources/documents/client/requests/ListDocumentsRequest.ts create mode 100644 src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts create mode 100644 src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts create mode 100644 src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts create mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts create mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts create mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts create mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts create mode 100644 src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts create mode 100644 src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts create mode 100644 src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts create mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts create mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts create mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts create mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts create mode 100644 src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts create mode 100644 src/api/resources/facts/client/requests/FactsListRequest.ts create mode 100644 src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts create mode 100644 src/api/resources/interactions/client/requests/InteractionsGetRequest.ts create mode 100644 src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts create mode 100644 src/api/resources/recordings/client/requests/RecordingsGetRequest.ts create mode 100644 src/api/resources/recordings/client/requests/RecordingsListRequest.ts create mode 100644 src/api/resources/recordings/client/requests/index.ts create mode 100644 src/api/resources/templates/client/requests/GetTemplatesRequest.ts create mode 100644 src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts create mode 100644 src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts create mode 100644 src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts create mode 100644 src/api/types/A2ASendMessageConfiguration.ts create mode 100644 src/api/types/A2ASendMessageRequest.ts create mode 100644 src/api/types/A2ASendMessageResponse.ts create mode 100644 src/api/types/A2AStreamEventResponse.ts create mode 100644 src/api/types/A2AjsonrpcResponse.ts create mode 100644 src/api/types/A2AjsonrpcResponseError.ts create mode 100644 src/api/types/A2AjsonrpcResponseId.ts create mode 100644 src/api/types/AgentCardResponse.ts create mode 100644 src/api/types/AgentCardResponseCapabilities.ts create mode 100644 src/api/types/AgentCardResponseProvider.ts create mode 100644 src/api/types/AgentCardResponseSignaturesItem.ts create mode 100644 src/api/types/AgentCardResponseSkillsItem.ts create mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItem.ts create mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts delete mode 100644 src/api/types/AgentsAgent.ts delete mode 100644 src/api/types/AgentsAgentCapabilities.ts delete mode 100644 src/api/types/AgentsAgentCard.ts delete mode 100644 src/api/types/AgentsAgentCardSignature.ts delete mode 100644 src/api/types/AgentsAgentExpertsItem.ts delete mode 100644 src/api/types/AgentsAgentExtension.ts delete mode 100644 src/api/types/AgentsAgentInterface.ts delete mode 100644 src/api/types/AgentsAgentProvider.ts delete mode 100644 src/api/types/AgentsAgentReference.ts delete mode 100644 src/api/types/AgentsAgentReferenceType.ts delete mode 100644 src/api/types/AgentsAgentResponse.ts delete mode 100644 src/api/types/AgentsAgentSkill.ts delete mode 100644 src/api/types/AgentsArtifact.ts delete mode 100644 src/api/types/AgentsContext.ts delete mode 100644 src/api/types/AgentsContextItemsItem.ts delete mode 100644 src/api/types/AgentsCreateExpert.ts delete mode 100644 src/api/types/AgentsCreateExpertReference.ts delete mode 100644 src/api/types/AgentsCreateExpertReferenceType.ts delete mode 100644 src/api/types/AgentsCreateExpertType.ts delete mode 100644 src/api/types/AgentsCreateMcpServer.ts delete mode 100644 src/api/types/AgentsCreateMcpServerAuthorizationType.ts delete mode 100644 src/api/types/AgentsCreateMcpServerTransportType.ts delete mode 100644 src/api/types/AgentsDataPart.ts delete mode 100644 src/api/types/AgentsDataPartKind.ts delete mode 100644 src/api/types/AgentsExpert.ts delete mode 100644 src/api/types/AgentsExpertReference.ts delete mode 100644 src/api/types/AgentsExpertReferenceType.ts delete mode 100644 src/api/types/AgentsExpertType.ts delete mode 100644 src/api/types/AgentsFilePart.ts delete mode 100644 src/api/types/AgentsFilePartFile.ts delete mode 100644 src/api/types/AgentsFilePartKind.ts delete mode 100644 src/api/types/AgentsFileWithBytes.ts delete mode 100644 src/api/types/AgentsFileWithUri.ts create mode 100644 src/api/types/AgentsLabels.ts create mode 100644 src/api/types/AgentsLifecycle.ts create mode 100644 src/api/types/AgentsListResponse.ts delete mode 100644 src/api/types/AgentsMcpServer.ts delete mode 100644 src/api/types/AgentsMcpServerAuthorizationType.ts delete mode 100644 src/api/types/AgentsMcpServerTransportType.ts delete mode 100644 src/api/types/AgentsMessage.ts delete mode 100644 src/api/types/AgentsMessageKind.ts delete mode 100644 src/api/types/AgentsMessageRole.ts delete mode 100644 src/api/types/AgentsMessageSendConfiguration.ts delete mode 100644 src/api/types/AgentsPart.ts delete mode 100644 src/api/types/AgentsPushNotificationAuthenticationInfo.ts delete mode 100644 src/api/types/AgentsPushNotificationConfig.ts delete mode 100644 src/api/types/AgentsRegistryExpert.ts delete mode 100644 src/api/types/AgentsRegistryExpertsResponse.ts delete mode 100644 src/api/types/AgentsRegistryMcpServer.ts delete mode 100644 src/api/types/AgentsRegistryMcpServerAuthorizationType.ts create mode 100644 src/api/types/AgentsResponse.ts delete mode 100644 src/api/types/AgentsTask.ts delete mode 100644 src/api/types/AgentsTaskKind.ts delete mode 100644 src/api/types/AgentsTaskStatus.ts delete mode 100644 src/api/types/AgentsTaskStatusState.ts delete mode 100644 src/api/types/AgentsTextPart.ts delete mode 100644 src/api/types/AgentsTextPartKind.ts delete mode 100644 src/api/types/AgentsUpdateExpertReference.ts create mode 100644 src/api/types/AgentsUserIdValue.ts create mode 100644 src/api/types/AgentsVisibility.ts create mode 100644 src/api/types/CommonA2AConnector.ts create mode 100644 src/api/types/CommonA2AConnectorCreate.ts create mode 100644 src/api/types/CommonAgentConnector.ts create mode 100644 src/api/types/CommonAgentConnectorCreate.ts create mode 100644 src/api/types/CommonAgentIdValue.ts create mode 100644 src/api/types/CommonArtifactIdValue.ts create mode 100644 src/api/types/CommonArtifactResponse.ts create mode 100644 src/api/types/CommonConnectorAuth.ts create mode 100644 src/api/types/CommonConnectorAuthType.ts create mode 100644 src/api/types/CommonConnectorCreateRequest.ts create mode 100644 src/api/types/CommonConnectorIdValue.ts create mode 100644 src/api/types/CommonConnectorResponse.ts create mode 100644 src/api/types/CommonConnectorType.ts create mode 100644 src/api/types/CommonContextIdValue.ts create mode 100644 src/api/types/CommonMcpConnector.ts create mode 100644 src/api/types/CommonMcpConnectorCreate.ts create mode 100644 src/api/types/CommonMessage.ts create mode 100644 src/api/types/CommonMessageIdValue.ts create mode 100644 src/api/types/CommonNextPageToken.ts create mode 100644 src/api/types/CommonPart.ts create mode 100644 src/api/types/CommonRegistryConnectorCreate.ts create mode 100644 src/api/types/CommonRegistryConnectorProvisioned.ts create mode 100644 src/api/types/CommonRole.ts create mode 100644 src/api/types/CommonSchemaConnector.ts create mode 100644 src/api/types/CommonSchemaConnectorCreate.ts create mode 100644 src/api/types/CommonSchemaConnectorCreateTransition.ts create mode 100644 src/api/types/CommonSchemaConnectorTransition.ts create mode 100644 src/api/types/CommonTaskIdValue.ts create mode 100644 src/api/types/CommonTaskListResponse.ts create mode 100644 src/api/types/CommonTaskMetadata.ts create mode 100644 src/api/types/CommonTaskResponse.ts create mode 100644 src/api/types/CommonTaskState.ts create mode 100644 src/api/types/CommonTaskStatus.ts create mode 100644 src/api/types/CommonTotalSize.ts create mode 100644 src/api/types/CommonUsage.ts create mode 100644 src/api/types/ConnectorsListResponse.ts create mode 100644 src/api/types/Contexts.ts create mode 100644 src/api/types/ContextsDetailResponse.ts create mode 100644 src/api/types/ContextsOpenInferenceSpan.ts create mode 100644 src/api/types/ContextsTraceItem.ts create mode 100644 src/api/types/ContextsTraceItemTrace.ts create mode 100644 src/api/types/ContextsTraceResponse.ts create mode 100644 src/api/types/FeedbackActor.ts create mode 100644 src/api/types/FeedbackIdValue.ts create mode 100644 src/api/types/FeedbackLabel.ts create mode 100644 src/api/types/FeedbackListResponse.ts create mode 100644 src/api/types/FeedbackMetadata.ts create mode 100644 src/api/types/FeedbackRating.ts create mode 100644 src/api/types/FeedbackRatingScale.ts create mode 100644 src/api/types/FeedbackResponse.ts create mode 100644 src/api/types/FeedbackTarget.ts create mode 100644 src/api/types/RegistryConnectorCapabilities.ts create mode 100644 src/api/types/RegistryConnectorListResponse.ts create mode 100644 src/api/types/RegistryConnectorResponse.ts create mode 100644 src/api/types/RegistryIcon.ts create mode 100644 src/api/types/UsageBucket.ts create mode 100644 src/api/types/UsageGranularity.ts create mode 100644 src/api/types/UsageMetrics.ts create mode 100644 src/api/types/UsageReportResponse.ts create mode 100644 src/core/stream/Stream.ts create mode 100644 src/core/stream/index.ts delete mode 100644 src/serialization/resources/agents/client/list.ts delete mode 100644 src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts create mode 100644 src/serialization/resources/agents/client/requests/AgentsCreateRequest.ts delete mode 100644 src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts create mode 100644 src/serialization/resources/agents/client/requests/AgentsPatchRequest.ts delete mode 100644 src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts create mode 100644 src/serialization/resources/agents/resources/a2A/client/index.ts create mode 100644 src/serialization/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts create mode 100644 src/serialization/resources/agents/resources/a2A/client/requests/index.ts create mode 100644 src/serialization/resources/agents/resources/a2A/index.ts create mode 100644 src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts create mode 100644 src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts create mode 100644 src/serialization/resources/agents/resources/a2A/types/index.ts create mode 100644 src/serialization/resources/agents/resources/feedback/client/index.ts create mode 100644 src/serialization/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts create mode 100644 src/serialization/resources/agents/resources/feedback/client/requests/index.ts create mode 100644 src/serialization/resources/agents/resources/feedback/index.ts create mode 100644 src/serialization/resources/agents/resources/index.ts delete mode 100644 src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts delete mode 100644 src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts delete mode 100644 src/serialization/resources/agents/types/AgentsMessageSendResponse.ts delete mode 100644 src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts delete mode 100644 src/serialization/resources/agents/types/index.ts rename src/serialization/resources/auth/types/{AuthTokenRequestBody.ts => AuthTokenRequest.ts} (70%) create mode 100644 src/serialization/types/A2ASendMessageConfiguration.ts create mode 100644 src/serialization/types/A2ASendMessageRequest.ts create mode 100644 src/serialization/types/A2ASendMessageResponse.ts create mode 100644 src/serialization/types/A2AStreamEventResponse.ts create mode 100644 src/serialization/types/A2AjsonrpcResponse.ts create mode 100644 src/serialization/types/A2AjsonrpcResponseError.ts create mode 100644 src/serialization/types/A2AjsonrpcResponseId.ts create mode 100644 src/serialization/types/AgentCardResponse.ts create mode 100644 src/serialization/types/AgentCardResponseCapabilities.ts create mode 100644 src/serialization/types/AgentCardResponseProvider.ts rename src/serialization/types/{AgentsAgentCardSignature.ts => AgentCardResponseSignaturesItem.ts} (71%) create mode 100644 src/serialization/types/AgentCardResponseSkillsItem.ts create mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts create mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts delete mode 100644 src/serialization/types/AgentsAgent.ts delete mode 100644 src/serialization/types/AgentsAgentCapabilities.ts delete mode 100644 src/serialization/types/AgentsAgentCard.ts delete mode 100644 src/serialization/types/AgentsAgentExpertsItem.ts delete mode 100644 src/serialization/types/AgentsAgentExtension.ts delete mode 100644 src/serialization/types/AgentsAgentInterface.ts delete mode 100644 src/serialization/types/AgentsAgentProvider.ts delete mode 100644 src/serialization/types/AgentsAgentReference.ts delete mode 100644 src/serialization/types/AgentsAgentReferenceType.ts delete mode 100644 src/serialization/types/AgentsAgentResponse.ts delete mode 100644 src/serialization/types/AgentsAgentSkill.ts delete mode 100644 src/serialization/types/AgentsArtifact.ts delete mode 100644 src/serialization/types/AgentsContext.ts delete mode 100644 src/serialization/types/AgentsContextItemsItem.ts delete mode 100644 src/serialization/types/AgentsCreateExpert.ts delete mode 100644 src/serialization/types/AgentsCreateExpertReference.ts delete mode 100644 src/serialization/types/AgentsCreateExpertReferenceType.ts delete mode 100644 src/serialization/types/AgentsCreateExpertType.ts delete mode 100644 src/serialization/types/AgentsCreateMcpServer.ts delete mode 100644 src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts delete mode 100644 src/serialization/types/AgentsCreateMcpServerTransportType.ts delete mode 100644 src/serialization/types/AgentsDataPart.ts delete mode 100644 src/serialization/types/AgentsDataPartKind.ts delete mode 100644 src/serialization/types/AgentsExpert.ts delete mode 100644 src/serialization/types/AgentsExpertReference.ts delete mode 100644 src/serialization/types/AgentsExpertReferenceType.ts delete mode 100644 src/serialization/types/AgentsExpertType.ts delete mode 100644 src/serialization/types/AgentsFilePart.ts delete mode 100644 src/serialization/types/AgentsFilePartFile.ts delete mode 100644 src/serialization/types/AgentsFilePartKind.ts delete mode 100644 src/serialization/types/AgentsFileWithBytes.ts delete mode 100644 src/serialization/types/AgentsFileWithUri.ts create mode 100644 src/serialization/types/AgentsLabels.ts create mode 100644 src/serialization/types/AgentsLifecycle.ts create mode 100644 src/serialization/types/AgentsListResponse.ts delete mode 100644 src/serialization/types/AgentsMcpServer.ts delete mode 100644 src/serialization/types/AgentsMcpServerAuthorizationType.ts delete mode 100644 src/serialization/types/AgentsMcpServerTransportType.ts delete mode 100644 src/serialization/types/AgentsMessage.ts delete mode 100644 src/serialization/types/AgentsMessageRole.ts delete mode 100644 src/serialization/types/AgentsMessageSendConfiguration.ts delete mode 100644 src/serialization/types/AgentsPart.ts delete mode 100644 src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts delete mode 100644 src/serialization/types/AgentsPushNotificationConfig.ts delete mode 100644 src/serialization/types/AgentsRegistryExpert.ts delete mode 100644 src/serialization/types/AgentsRegistryExpertsResponse.ts delete mode 100644 src/serialization/types/AgentsRegistryMcpServer.ts delete mode 100644 src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts create mode 100644 src/serialization/types/AgentsResponse.ts delete mode 100644 src/serialization/types/AgentsTask.ts delete mode 100644 src/serialization/types/AgentsTaskKind.ts delete mode 100644 src/serialization/types/AgentsTaskStatus.ts delete mode 100644 src/serialization/types/AgentsTaskStatusState.ts delete mode 100644 src/serialization/types/AgentsTextPart.ts delete mode 100644 src/serialization/types/AgentsTextPartKind.ts delete mode 100644 src/serialization/types/AgentsUpdateExpertReference.ts create mode 100644 src/serialization/types/AgentsUserIdValue.ts create mode 100644 src/serialization/types/AgentsVisibility.ts create mode 100644 src/serialization/types/CommonA2AConnector.ts create mode 100644 src/serialization/types/CommonA2AConnectorCreate.ts create mode 100644 src/serialization/types/CommonAgentConnector.ts create mode 100644 src/serialization/types/CommonAgentConnectorCreate.ts create mode 100644 src/serialization/types/CommonAgentIdValue.ts create mode 100644 src/serialization/types/CommonArtifactIdValue.ts create mode 100644 src/serialization/types/CommonArtifactResponse.ts create mode 100644 src/serialization/types/CommonConnectorAuth.ts create mode 100644 src/serialization/types/CommonConnectorAuthType.ts create mode 100644 src/serialization/types/CommonConnectorCreateRequest.ts create mode 100644 src/serialization/types/CommonConnectorIdValue.ts create mode 100644 src/serialization/types/CommonConnectorResponse.ts create mode 100644 src/serialization/types/CommonConnectorType.ts create mode 100644 src/serialization/types/CommonContextIdValue.ts create mode 100644 src/serialization/types/CommonMcpConnector.ts create mode 100644 src/serialization/types/CommonMcpConnectorCreate.ts create mode 100644 src/serialization/types/CommonMessage.ts create mode 100644 src/serialization/types/CommonMessageIdValue.ts create mode 100644 src/serialization/types/CommonNextPageToken.ts create mode 100644 src/serialization/types/CommonPart.ts create mode 100644 src/serialization/types/CommonRegistryConnectorCreate.ts create mode 100644 src/serialization/types/CommonRegistryConnectorProvisioned.ts create mode 100644 src/serialization/types/CommonRole.ts create mode 100644 src/serialization/types/CommonSchemaConnector.ts create mode 100644 src/serialization/types/CommonSchemaConnectorCreate.ts create mode 100644 src/serialization/types/CommonSchemaConnectorCreateTransition.ts create mode 100644 src/serialization/types/CommonSchemaConnectorTransition.ts rename src/serialization/types/{AgentsMessageKind.ts => CommonTaskIdValue.ts} (56%) create mode 100644 src/serialization/types/CommonTaskListResponse.ts create mode 100644 src/serialization/types/CommonTaskMetadata.ts create mode 100644 src/serialization/types/CommonTaskResponse.ts create mode 100644 src/serialization/types/CommonTaskState.ts create mode 100644 src/serialization/types/CommonTaskStatus.ts create mode 100644 src/serialization/types/CommonTotalSize.ts create mode 100644 src/serialization/types/CommonUsage.ts create mode 100644 src/serialization/types/ConnectorsListResponse.ts create mode 100644 src/serialization/types/Contexts.ts create mode 100644 src/serialization/types/ContextsDetailResponse.ts create mode 100644 src/serialization/types/ContextsOpenInferenceSpan.ts create mode 100644 src/serialization/types/ContextsTraceItem.ts create mode 100644 src/serialization/types/ContextsTraceItemTrace.ts create mode 100644 src/serialization/types/ContextsTraceResponse.ts create mode 100644 src/serialization/types/FeedbackActor.ts create mode 100644 src/serialization/types/FeedbackIdValue.ts create mode 100644 src/serialization/types/FeedbackLabel.ts create mode 100644 src/serialization/types/FeedbackListResponse.ts create mode 100644 src/serialization/types/FeedbackMetadata.ts create mode 100644 src/serialization/types/FeedbackRating.ts create mode 100644 src/serialization/types/FeedbackRatingScale.ts create mode 100644 src/serialization/types/FeedbackResponse.ts create mode 100644 src/serialization/types/FeedbackTarget.ts create mode 100644 src/serialization/types/RegistryConnectorCapabilities.ts create mode 100644 src/serialization/types/RegistryConnectorListResponse.ts create mode 100644 src/serialization/types/RegistryConnectorResponse.ts create mode 100644 src/serialization/types/RegistryIcon.ts create mode 100644 src/serialization/types/UsageBucket.ts create mode 100644 src/serialization/types/UsageGranularity.ts create mode 100644 src/serialization/types/UsageMetrics.ts create mode 100644 src/serialization/types/UsageReportResponse.ts create mode 100644 tests/unit/stream/Stream.test.ts create mode 100644 tests/wire/agents/a2A.test.ts create mode 100644 tests/wire/agents/a2A/tasks.test.ts create mode 100644 tests/wire/agents/artifacts.test.ts create mode 100644 tests/wire/agents/connectors.test.ts create mode 100644 tests/wire/agents/contexts.test.ts create mode 100644 tests/wire/agents/contexts/tasks.test.ts create mode 100644 tests/wire/agents/feedback.test.ts create mode 100644 tests/wire/agents/registry.test.ts create mode 100644 tests/wire/agents/usage.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index ebb0cb8b..86e2a4c5 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "5.75.1", + "cliVersion": "5.76.0", "generatorName": "fernapi/fern-typescript-node-sdk", "generatorVersion": "3.54.0", "generatorConfig": { @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "94a714862b705ee097af1b7ef3c5d9affa7fc382", + "originGitCommit": "494ce65f402ea1511484a96e17fc38f6e5de1eff", "sdkVersion": "0.0.0-dev" } diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 1b76cbaa..50d2b1af 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -9,8 +9,6 @@ export type BaseClientOptions = { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - /** Override the Tenant-Name header */ - tenantName: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | null | undefined>; /** The default maximum time to wait for a response in seconds. */ @@ -30,8 +28,6 @@ export interface BaseRequestOptions { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; - /** Override the Tenant-Name header */ - tenantName?: string; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ @@ -59,7 +55,6 @@ export function normalizeClientOptions; + protected _a2A: A2AClient | undefined; + protected _usage: UsageClient | undefined; + protected _connectors: ConnectorsClient | undefined; + protected _contexts: ContextsClient | undefined; + protected _artifacts: ArtifactsClient | undefined; + protected _registry: RegistryClient | undefined; + protected _feedback: FeedbackClient | undefined; constructor(options: AgentsClient.Options) { this._options = normalizeClientOptionsWithAuth(options); } + public get a2A(): A2AClient { + return (this._a2A ??= new A2AClient(this._options)); + } + + public get usage(): UsageClient { + return (this._usage ??= new UsageClient(this._options)); + } + + public get connectors(): ConnectorsClient { + return (this._connectors ??= new ConnectorsClient(this._options)); + } + + public get contexts(): ContextsClient { + return (this._contexts ??= new ContextsClient(this._options)); + } + + public get artifacts(): ArtifactsClient { + return (this._artifacts ??= new ArtifactsClient(this._options)); + } + + public get registry(): RegistryClient { + return (this._registry ??= new RegistryClient(this._options)); + } + + public get feedback(): FeedbackClient { + return (this._feedback ??= new FeedbackClient(this._options)); + } + /** - * This endpoint retrieves a list of all agents that can be called by the Corti Agent Framework. + * Lists agents visible to the caller. `private` agents are visible only to + * their creator/service principal; `unlisted` agents are omitted (fetch by + * ID instead); `public` agents are listed tenant-wide. + * The `visibility`, `lifecycle`, `label`, and `q` filter parameters are accepted but not yet honored by the server; the response is unfiltered. * - * @param {Corti.AgentsListRequest} request + * @param {Corti.ListAgentsRequest} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} * * @example - * await client.agents.list() + * await client.agents.list({ + * label: ["team=coding"], + * q: "coder" + * }) */ - public list( - request: Corti.AgentsListRequest = {}, - requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - - private async __list( - request: Corti.AgentsListRequest = {}, + public async list( + request: Corti.ListAgentsRequest = {}, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const { limit, offset, ephemeral } = request; - const _queryParams: Record = { - limit, - offset, - ephemeral, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async (request: Corti.ListAgentsRequest): Promise> => { + const { pageSize, pageToken, visibility, lifecycle, label, q } = request; + const _queryParams: Record = { + pageSize, + pageToken, + visibility: Array.isArray(visibility) + ? visibility.map((item) => + serializers.AgentsVisibility.jsonOrThrow(item, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + ) + : visibility != null + ? serializers.AgentsVisibility.jsonOrThrow(visibility, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + lifecycle: + lifecycle != null + ? serializers.AgentsLifecycle.jsonOrThrow(lifecycle, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + label, + q, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/agents", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents"); + }, ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "agents", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.agents ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, }); - if (_response.ok) { - return { - data: serializers.agents.list.Response.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents"); } /** - * This endpoint allows the creation of a new agent that can be utilized in the `POST /agents/{id}/v1/message:send` endpoint. + * Creates a new agent. The server assigns the UUIDv7 `id`. * - * @param {Corti.AgentsCreateAgent} request + * @param {Corti.AgentsCreateRequest} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.ConflictError} * @throws {@link Corti.UnprocessableEntityError} * * @example * await client.agents.create({ - * name: "name", - * description: "description" + * name: "coder", + * description: "Returns ICD-10 codes for a clinical encounter.", + * systemPrompt: "Respond with only the ICD-10 code.", + * model: "corti-default", + * visibility: "private", + * lifecycle: "persistent", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }, { + * type: "mcp", + * name: "policybot", + * url: "https://mcp.example.com", + * auth: { + * type: "oauth2", + * scope: "read:policies", + * redirectUrl: "https://app.corti.ai/oauth/callback" + * } + * }, { + * type: "schema", + * name: "submit_code", + * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + * schema: { + * "type": "object", + * "properties": { + * "code": { + * "type": "string", + * "description": "The selected ICD-10 code." + * }, + * "confidence": { + * "type": "number", + * "minimum": 0, + * "maximum": 1 + * } + * }, + * "required": [ + * "code" + * ] + * }, + * transition: "complete" + * }], + * labels: { + * "team": "coding", + * "env": "prod" + * } * }) */ public create( - request: Corti.AgentsCreateAgent, + request: Corti.AgentsCreateRequest, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( - request: Corti.AgentsCreateAgent, + request: Corti.AgentsCreateRequest, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const { ephemeral, ..._body } = request; - const _queryParams: Record = { - ephemeral, - }; + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - "agents", + "v2/agentic/agents", ), method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.AgentsCreateAgent.jsonOrThrow(_body, { + body: serializers.AgentsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -165,7 +283,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentsAgent.parseOrThrow(_response.body, { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -182,6 +300,10 @@ export class AgentsClient { throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 409: + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); case 422: throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); default: @@ -193,45 +315,42 @@ export class AgentsClient { } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/agents"); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/agentic/agents"); } /** - * This endpoint retrieves an agent by its identifier. The agent contains information about its capabilities and the experts it can call. - * - * @param {string} id - The identifier of the agent associated with the context. + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.get("12345678-90ab-cdef-gh12-34567890abc") + * await client.agents.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") */ public get( - id: string, + agentId: Corti.CommonAgentIdValue, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, requestOptions)); } private async __get( - id: string, + agentId: Corti.CommonAgentIdValue, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}`, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, ), method: "GET", headers: _headers, @@ -244,7 +363,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentsAgentResponse.parseOrThrow(_response.body, { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -257,10 +376,10 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); case 404: throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); default: @@ -272,42 +391,45 @@ export class AgentsClient { } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents/{id}"); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents/{agentId}"); } /** - * This endpoint deletes an agent by its identifier. Once deleted, the agent can no longer be used in threads. + * Deletes a `persistent` agent. `ephemeral` agents are expired in place. + * Idempotent: deleting an already-deleted agent returns `204`. * - * @param {string} id - The identifier of the agent associated with the context. + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.delete("12345678-90ab-cdef-gh12-34567890abc") + * await client.agents.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") */ - public delete(id: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + public delete( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(agentId, requestOptions)); } private async __delete( - id: string, + agentId: Corti.CommonAgentIdValue, requestOptions?: AgentsClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}`, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, ), method: "DELETE", headers: _headers, @@ -324,10 +446,10 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); case 404: throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); default: @@ -339,184 +461,20 @@ export class AgentsClient { } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/agents/{id}"); - } - - /** - * This endpoint updates an existing agent. Only the fields provided in the request body will be updated; other fields will remain unchanged. - * - * @param {string} id - The identifier of the agent associated with the context. - * @param {Corti.AgentsUpdateAgent} request - * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agents.update("12345678-90ab-cdef-gh12-34567890abc") - */ - public update( - id: string, - request: Corti.AgentsUpdateAgent = {}, - requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions)); - } - - private async __update( - id: string, - request: Corti.AgentsUpdateAgent = {}, - requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/agents/{agentId}", ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}`, - ), - method: "PATCH", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.AgentsUpdateAgent.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsAgent.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/agents/{id}"); } /** - * This endpoint retrieves the agent card in JSON format, which provides metadata about the agent, including its name, description, and the experts it can call. + * Partially updates an agent using JSON Merge Patch (RFC 7386). + * Omitted fields are unchanged; `null` clears a field; arrays replace. * - * @param {string} id - The identifier of the agent associated with the context. - * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agents.getCard("12345678-90ab-cdef-gh12-34567890abc") - */ - public getCard( - id: string, - requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getCard(id, requestOptions)); - } - - private async __getCard( - id: string, - requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}/agent-card.json`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsAgentCard.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents/{id}/agent-card.json"); - } - - /** - * This endpoint sends a message to the specified agent to start or continue a task. The agent processes the message and returns a response. If the message contains a task ID that matches an ongoing task, the agent will continue that task; otherwise, it will start a new task. - * - * @param {string} id - The identifier of the agent associated with the context. - * @param {Corti.AgentsMessageSendParams} request + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.AgentsPatchRequest} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -526,50 +484,45 @@ export class AgentsClient { * @throws {@link Corti.UnprocessableEntityError} * * @example - * await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", { - * message: { - * role: "user", - * parts: [{ - * kind: "text", - * text: "text" - * }], - * messageId: "messageId", - * kind: "message" - * } + * await client.agents.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * name: "coder-v2", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }] * }) */ - public messageSend( - id: string, - request: Corti.AgentsMessageSendParams, + public update( + agentId: Corti.CommonAgentIdValue, + request: Corti.AgentsPatchRequest = {}, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__messageSend(id, request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(agentId, request, requestOptions)); } - private async __messageSend( - id: string, - request: Corti.AgentsMessageSendParams, + private async __update( + agentId: Corti.CommonAgentIdValue, + request: Corti.AgentsPatchRequest = {}, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}/v1/message:send`, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, ), - method: "POST", + method: "PATCH", headers: _headers, - contentType: "application/json", + contentType: "application/merge-patch+json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.AgentsMessageSendParams.jsonOrThrow(request, { + body: serializers.AgentsPatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -581,7 +534,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentsMessageSendResponse.parseOrThrow(_response.body, { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -613,157 +566,54 @@ export class AgentsClient { } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/agents/{id}/v1/message:send"); - } - - /** - * This endpoint retrieves the status and details of a specific task associated with the given agent. It provides information about the task's current state, history, and any artifacts produced during its execution. - * - * @param {string} id - The identifier of the agent associated with the context. - * @param {string} taskId - The identifier of the task to retrieve. - * @param {Corti.AgentsGetTaskRequest} request - * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agents.getTask("12345678-90ab-cdef-gh12-34567890abc", "taskId") - */ - public getTask( - id: string, - taskId: string, - request: Corti.AgentsGetTaskRequest = {}, - requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getTask(id, taskId, request, requestOptions)); - } - - private async __getTask( - id: string, - taskId: string, - request: Corti.AgentsGetTaskRequest = {}, - requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const { historyLength } = request; - const _queryParams: Record = { - historyLength, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}/v1/tasks/${core.url.encodePathParam(taskId)}`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsTask.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError( _response.error, _response.rawResponse, - "GET", - "/agents/{id}/v1/tasks/{taskId}", + "PATCH", + "/v2/agentic/agents/{agentId}", ); } /** - * This endpoint retrieves all tasks and top-level messages associated with a specific context for the given agent. + * Returns the A2A v1.0 agent card describing the agent's capabilities, + * skills, and supported protocol interfaces. Served at the standard + * `.well-known` location for agent discovery. * - * @param {string} id - The identifier of the agent associated with the context. - * @param {string} contextId - The identifier of the context (thread) to retrieve tasks for. - * @param {Corti.AgentsGetContextRequest} request + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.getContext("12345678-90ab-cdef-gh12-34567890abc", "contextId") + * await client.agents.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") */ - public getContext( - id: string, - contextId: string, - request: Corti.AgentsGetContextRequest = {}, + public getCard( + agentId: Corti.CommonAgentIdValue, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getContext(id, contextId, request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCard(agentId, requestOptions)); } - private async __getContext( - id: string, - contextId: string, - request: Corti.AgentsGetContextRequest = {}, + private async __getCard( + agentId: Corti.CommonAgentIdValue, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const { limit, offset } = request; - const _queryParams: Record = { - limit, - offset, - }; + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}/v1/contexts/${core.url.encodePathParam(contextId)}`, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/.well-known/agent-card.json`, ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -772,7 +622,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentsContext.parseOrThrow(_response.body, { + data: serializers.AgentCardResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -785,8 +635,6 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); case 404: @@ -804,172 +652,7 @@ export class AgentsClient { _response.error, _response.rawResponse, "GET", - "/agents/{id}/v1/contexts/{contextId}", - ); - } - - /** - * This endpoint deletes a context (thread) and scrubs all associated data including messages, memories, and memory chunks for the given agent. Thread and task metadata is soft-deleted for audit purposes, while content columns are irreversibly overwritten. - * - * @param {string} id - The identifier of the agent associated with the context. - * @param {string} contextId - The identifier of the context (thread) to delete. - * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agents.deleteContext("12345678-90ab-cdef-gh12-34567890abc", "contextId") - */ - public deleteContext( - id: string, - contextId: string, - requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__deleteContext(id, contextId, requestOptions)); - } - - private async __deleteContext( - id: string, - contextId: string, - requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, + "/v2/agentic/agents/{agentId}/.well-known/agent-card.json", ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `agents/${core.url.encodePathParam(id)}/v1/contexts/${core.url.encodePathParam(contextId)}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/agents/{id}/v1/contexts/{contextId}", - ); - } - - /** - * This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema. - * - * @param {Corti.AgentsGetRegistryExpertsRequest} request - * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agents.getRegistryExperts({ - * limit: 100, - * offset: 0 - * }) - */ - public getRegistryExperts( - request: Corti.AgentsGetRegistryExpertsRequest = {}, - requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getRegistryExperts(request, requestOptions)); - } - - private async __getRegistryExperts( - request: Corti.AgentsGetRegistryExpertsRequest = {}, - requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const { limit, offset } = request; - const _queryParams: Record = { - limit, - offset, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "agents/registry/experts", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsRegistryExpertsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents/registry/experts"); } } diff --git a/src/api/resources/agents/client/requests/AgentsCreateAgent.ts b/src/api/resources/agents/client/requests/AgentsCreateAgent.ts deleted file mode 100644 index ab4a1e7e..00000000 --- a/src/api/resources/agents/client/requests/AgentsCreateAgent.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * name: "name", - * description: "description" - * } - */ -export interface AgentsCreateAgent { - /** If set to true, the agent will be created as ephemeral, it won't be listed in the agents_list but can still be fetched by ID. Ephemeral agents will be deleted periodically. */ - ephemeral?: boolean; - /** The name of the agent. */ - name: string; - /** Optional type of agent. */ - agentType?: Corti.AgentsCreateAgentAgentType; - /** The system prompt that defines the overall agents behavior and expectations. This field is optional as there is a default system orchestrator. */ - systemPrompt?: string; - /** A brief description of the agent's capabilities. */ - description: string; - experts?: Corti.AgentsCreateAgentExpertsItem[]; - /** A list of MCP servers that the agent can call. If omitted, the agent can't call any MCP servers. */ - mcpServers?: Corti.AgentsCreateMcpServer[]; -} diff --git a/src/api/resources/agents/client/requests/AgentsCreateRequest.ts b/src/api/resources/agents/client/requests/AgentsCreateRequest.ts new file mode 100644 index 00000000..76267264 --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsCreateRequest.ts @@ -0,0 +1,69 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * name: "coder", + * description: "Returns ICD-10 codes for a clinical encounter.", + * systemPrompt: "Respond with only the ICD-10 code.", + * model: "corti-default", + * visibility: "private", + * lifecycle: "persistent", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }, { + * type: "mcp", + * name: "policybot", + * url: "https://mcp.example.com", + * auth: { + * type: "oauth2", + * scope: "read:policies", + * redirectUrl: "https://app.corti.ai/oauth/callback" + * } + * }, { + * type: "schema", + * name: "submit_code", + * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + * schema: { + * "type": "object", + * "properties": { + * "code": { + * "type": "string", + * "description": "The selected ICD-10 code." + * }, + * "confidence": { + * "type": "number", + * "minimum": 0, + * "maximum": 1 + * } + * }, + * "required": [ + * "code" + * ] + * }, + * transition: "complete" + * }], + * labels: { + * "team": "coding", + * "env": "prod" + * } + * } + */ +export interface AgentsCreateRequest { + /** Human-readable, unique-per-tenant agent name. */ + name: string; + /** Free-form agent description. */ + description?: string; + /** System prompt prepended to every invocation. */ + systemPrompt?: string; + /** Tenant default if omitted. */ + model?: string; + visibility?: Corti.AgentsVisibility; + lifecycle?: Corti.AgentsLifecycle; + /** Connectors to attach at creation. Defaults to an empty array. */ + connectors?: Corti.CommonConnectorCreateRequest[]; + labels?: Corti.AgentsLabels; +} diff --git a/src/api/resources/agents/client/requests/AgentsGetContextRequest.ts b/src/api/resources/agents/client/requests/AgentsGetContextRequest.ts deleted file mode 100644 index aa60df6e..00000000 --- a/src/api/resources/agents/client/requests/AgentsGetContextRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface AgentsGetContextRequest { - /** The maximum number of tasks and messages to return. If not specified all history is returned. */ - limit?: number; - /** The number of tasks and messages to skip before starting to collect the result set. Default is 0. */ - offset?: number; -} diff --git a/src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts b/src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts deleted file mode 100644 index 8fcaf74f..00000000 --- a/src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * limit: 100, - * offset: 0 - * } - */ -export interface AgentsGetRegistryExpertsRequest { - /** The maximum number of items to return. If not specified, a default number of items will be returned. */ - limit?: number; - /** The number of items to skip before starting to collect the result set. Default is 0. */ - offset?: number; -} diff --git a/src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts b/src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts deleted file mode 100644 index 0d3dee98..00000000 --- a/src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface AgentsGetTaskRequest { - /** The number of previous messages to include in the context for the agent when retrieving this task. Default is all messages. */ - historyLength?: number; -} diff --git a/src/api/resources/agents/client/requests/AgentsListRequest.ts b/src/api/resources/agents/client/requests/AgentsListRequest.ts deleted file mode 100644 index efafb427..00000000 --- a/src/api/resources/agents/client/requests/AgentsListRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface AgentsListRequest { - /** The maximum number of agents to return. If not specified, all agents will be returned. */ - limit?: number; - /** The number of agents to skip before starting to collect the result set. Default is 0. */ - offset?: number; - /** If set to true, ephemeral agents will be included in the response. Default is false. */ - ephemeral?: boolean; -} diff --git a/src/api/resources/agents/client/requests/AgentsMessageSendParams.ts b/src/api/resources/agents/client/requests/AgentsMessageSendParams.ts deleted file mode 100644 index 53f9cf2e..00000000 --- a/src/api/resources/agents/client/requests/AgentsMessageSendParams.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * message: { - * role: "user", - * parts: [{ - * kind: "text", - * text: "text" - * }], - * messageId: "messageId", - * kind: "message" - * } - * } - */ -export interface AgentsMessageSendParams { - message: Corti.AgentsMessage; - configuration?: Corti.AgentsMessageSendConfiguration; - /** Optional metadata that will be associated with the message. */ - metadata?: Record; -} diff --git a/src/api/resources/agents/client/requests/AgentsPatchRequest.ts b/src/api/resources/agents/client/requests/AgentsPatchRequest.ts new file mode 100644 index 00000000..30cfd750 --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsPatchRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * name: "coder-v2", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }] + * } + */ +export interface AgentsPatchRequest { + /** New agent name. */ + name?: string; + /** New description; `null` clears it. */ + description?: string | null; + /** New system prompt; `null` clears it. */ + systemPrompt?: string | null; + /** New model identifier; `null` falls back to the tenant default. */ + model?: string | null; + visibility?: Corti.AgentsVisibility; + lifecycle?: Corti.AgentsLifecycle; + /** Replacement connector list; `null` clears connectors. */ + connectors?: Corti.CommonConnectorCreateRequest[] | null; + /** Replacement labels; `null` clears labels. */ + labels?: Record | null; +} diff --git a/src/api/resources/agents/client/requests/AgentsUpdateAgent.ts b/src/api/resources/agents/client/requests/AgentsUpdateAgent.ts deleted file mode 100644 index 2ec6d0a2..00000000 --- a/src/api/resources/agents/client/requests/AgentsUpdateAgent.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * {} - */ -export interface AgentsUpdateAgent { - /** The name of the agent. */ - name?: string; - /** The system prompt that defines the overall agents behavior and expectations. This field is optional as there is a default system orchestrator. */ - systemPrompt?: string; - /** A brief description of the agent's capabilities. */ - description?: string; - experts?: Corti.AgentsUpdateAgentExpertsItem[]; - /** A list of MCP servers that the agent can call. If omitted, the agent can't call any MCP servers. */ - mcpServers?: Corti.AgentsCreateMcpServer[]; -} diff --git a/src/api/resources/agents/client/requests/ListAgentsRequest.ts b/src/api/resources/agents/client/requests/ListAgentsRequest.ts new file mode 100644 index 00000000..d11a9c83 --- /dev/null +++ b/src/api/resources/agents/client/requests/ListAgentsRequest.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * label: ["team=coding"], + * q: "coder" + * } + */ +export interface ListAgentsRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; + /** Filter by one or more visibility levels. */ + visibility?: Corti.AgentsVisibility | Corti.AgentsVisibility[]; + /** Filter by lifecycle. */ + lifecycle?: Corti.AgentsLifecycle; + /** Filter by label equality, repeated `key=value` pairs (AND-combined). */ + label?: string | string[]; + /** Free-text search over `name` and `description`. */ + q?: string; +} diff --git a/src/api/resources/agents/client/requests/index.ts b/src/api/resources/agents/client/requests/index.ts index e43b0bbc..56393a4a 100644 --- a/src/api/resources/agents/client/requests/index.ts +++ b/src/api/resources/agents/client/requests/index.ts @@ -1,7 +1,3 @@ -export type { AgentsCreateAgent } from "./AgentsCreateAgent.js"; -export type { AgentsGetContextRequest } from "./AgentsGetContextRequest.js"; -export type { AgentsGetRegistryExpertsRequest } from "./AgentsGetRegistryExpertsRequest.js"; -export type { AgentsGetTaskRequest } from "./AgentsGetTaskRequest.js"; -export type { AgentsListRequest } from "./AgentsListRequest.js"; -export type { AgentsMessageSendParams } from "./AgentsMessageSendParams.js"; -export type { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; +export type { AgentsCreateRequest } from "./AgentsCreateRequest.js"; +export type { AgentsPatchRequest } from "./AgentsPatchRequest.js"; +export type { ListAgentsRequest } from "./ListAgentsRequest.js"; diff --git a/src/api/resources/agents/index.ts b/src/api/resources/agents/index.ts index d9adb1af..9eb1192d 100644 --- a/src/api/resources/agents/index.ts +++ b/src/api/resources/agents/index.ts @@ -1,2 +1,2 @@ export * from "./client/index.js"; -export * from "./types/index.js"; +export * from "./resources/index.js"; diff --git a/src/api/resources/agents/resources/a2A/client/Client.ts b/src/api/resources/agents/resources/a2A/client/Client.ts new file mode 100644 index 00000000..fe9526fd --- /dev/null +++ b/src/api/resources/agents/resources/a2A/client/Client.ts @@ -0,0 +1,336 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; +import { TasksClient } from "../resources/tasks/client/Client.js"; + +export declare namespace A2AClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class A2AClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + protected _tasks: TasksClient | undefined; + + constructor(options: A2AClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + public get tasks(): TasksClient { + return (this._tasks ??= new TasksClient(this._options)); + } + + /** + * The `JSONRPC` protocol binding for A2A v1.0. Accepts a single JSON-RPC 2.0 + * request whose `method` is one of `SendMessage`, `SendStreamingMessage`, + * `GetTask`, `ListTasks`, `CancelTask`, or `SubscribeToTask`. + * + * Streaming methods (`SendStreamingMessage`, `SubscribeToTask`) respond with + * `text/event-stream`; all others respond with a single JSON-RPC response. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.agents.A2AjsonrpcRequest} request + * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * id: "1", + * method: "SendMessage", + * params: { + * "message": { + * "role": "ROLE_USER", + * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + * "parts": [ + * { + * "text": "Code this encounter." + * } + * ] + * } + * } + * }) + */ + public jsonRpc( + agentId: Corti.CommonAgentIdValue, + request: Corti.agents.A2AjsonrpcRequest, + requestOptions?: A2AClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__jsonRpc(agentId, request, requestOptions)); + } + + private async __jsonRpc( + agentId: Corti.CommonAgentIdValue, + request: Corti.agents.A2AjsonrpcRequest, + requestOptions?: A2AClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: { + ...serializers.agents.A2AjsonrpcRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + jsonrpc: "2.0", + }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.A2AjsonrpcResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a", + ); + } + + /** + * The `HTTP+JSON` binding of A2A `SendMessage`. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.A2ASendMessageRequest} request + * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * message: { + * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + * role: "ROLE_USER", + * parts: [{ + * text: "What is the ICD-10 code for asthma?" + * }] + * } + * }) + */ + public sendMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendMessage(agentId, request, requestOptions)); + } + + private async __sendMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:send`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.A2ASendMessageResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a/message:send", + ); + } + + /** + * The `HTTP+JSON` binding of A2A `SendStreamingMessage`. Responds with a + * `text/event-stream` of `Task`, `statusUpdate`, and `artifactUpdate` events. + */ + public streamMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): core.HttpResponsePromise> { + return core.HttpResponsePromise.fromPromise(this.__streamMessage(agentId, request, requestOptions)); + } + + private async __streamMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): Promise>> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:stream`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + responseType: "sse", + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: new core.Stream({ + stream: _response.body, + parse: async (data) => { + return serializers.A2AStreamEventResponse.parseOrThrow(data, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + }, + signal: requestOptions?.abortSignal, + eventShape: { + type: "sse", + }, + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a/message:stream", + ); + } +} diff --git a/src/api/resources/agents/resources/a2A/client/index.ts b/src/api/resources/agents/resources/a2A/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/api/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts new file mode 100644 index 00000000..7f8b2619 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * id: "1", + * method: "SendMessage", + * params: { + * "message": { + * "role": "ROLE_USER", + * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + * "parts": [ + * { + * "text": "Code this encounter." + * } + * ] + * } + * } + * } + */ +export interface A2AjsonrpcRequest { + id: Corti.agents.A2AjsonrpcRequestId; + /** JSON-RPC method name (PascalCase on the wire). */ + method: Corti.agents.A2AjsonrpcRequestMethod; + /** JSON-RPC params object. */ + params?: Record; +} diff --git a/src/api/resources/agents/resources/a2A/client/requests/index.ts b/src/api/resources/agents/resources/a2A/client/requests/index.ts new file mode 100644 index 00000000..23999406 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/client/requests/index.ts @@ -0,0 +1 @@ +export type { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/api/resources/agents/resources/a2A/index.ts b/src/api/resources/agents/resources/a2A/index.ts new file mode 100644 index 00000000..0ef16e76 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/index.ts @@ -0,0 +1,3 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/agents/resources/a2A/resources/index.ts b/src/api/resources/agents/resources/a2A/resources/index.ts new file mode 100644 index 00000000..a371e105 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/resources/index.ts @@ -0,0 +1,2 @@ +export * from "./tasks/client/requests/index.js"; +export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts b/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts new file mode 100644 index 00000000..9b497b24 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts @@ -0,0 +1,357 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; +import { + type NormalizedClientOptionsWithAuth, + normalizeClientOptionsWithAuth, +} from "../../../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; +import * as core from "../../../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../../../errors/index.js"; +import * as serializers from "../../../../../../../../serialization/index.js"; +import * as Corti from "../../../../../../../index.js"; + +export declare namespace TasksClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TasksClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TasksClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.agents.a2A.ListTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agents.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public async list( + agentId: Corti.CommonAgentIdValue, + request: Corti.agents.a2A.ListTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Corti.agents.a2A.ListTasksRequest, + ): Promise> => { + const { pageSize, pageToken, contextId } = request; + const _queryParams: Record = { + pageSize, + pageToken, + contextId, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/a2a/tasks", + ); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.tasks ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, + }); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {Corti.agents.a2A.GetTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.a2A.tasks.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public get( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agents.a2A.GetTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, taskId, request, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agents.a2A.GetTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { historyLength } = request; + const _queryParams: Record = { + historyLength, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.ConflictError} + * + * @example + * await client.agents.a2A.tasks.cancel("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public cancel( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__cancel(agentId, taskId, requestOptions)); + } + + private async __cancel( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:cancel`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:cancel", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.agents.a2A.tasks.subscribe("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public subscribe( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__subscribe(agentId, taskId, requestOptions)); + } + + private async __subscribe( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:subscribe`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:subscribe", + ); + } +} diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/index.ts b/src/api/resources/agents/resources/a2A/resources/tasks/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/resources/tasks/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts b/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts new file mode 100644 index 00000000..ea6be9c2 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetTasksRequest { + /** Cap the number of history messages returned. */ + historyLength?: number; +} diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts new file mode 100644 index 00000000..c784ca5d --- /dev/null +++ b/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListTasksRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; + /** Restrict to tasks within this context. */ + contextId?: string; +} diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/index.ts b/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/index.ts new file mode 100644 index 00000000..508b914d --- /dev/null +++ b/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/index.ts @@ -0,0 +1,2 @@ +export type { GetTasksRequest } from "./GetTasksRequest.js"; +export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/index.ts b/src/api/resources/agents/resources/a2A/resources/tasks/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agents/resources/a2A/resources/tasks/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts new file mode 100644 index 00000000..579038a0 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type A2AjsonrpcRequestId = string | number; diff --git a/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts new file mode 100644 index 00000000..d6b216bb --- /dev/null +++ b/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** JSON-RPC method name (PascalCase on the wire). */ +export const A2AjsonrpcRequestMethod = { + SendMessage: "SendMessage", + SendStreamingMessage: "SendStreamingMessage", + GetTask: "GetTask", + ListTasks: "ListTasks", + CancelTask: "CancelTask", + SubscribeToTask: "SubscribeToTask", +} as const; +export type A2AjsonrpcRequestMethod = (typeof A2AjsonrpcRequestMethod)[keyof typeof A2AjsonrpcRequestMethod]; diff --git a/src/api/resources/agents/resources/a2A/types/index.ts b/src/api/resources/agents/resources/a2A/types/index.ts new file mode 100644 index 00000000..d506c662 --- /dev/null +++ b/src/api/resources/agents/resources/a2A/types/index.ts @@ -0,0 +1,2 @@ +export * from "./A2AjsonrpcRequestId.js"; +export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/api/resources/agents/resources/artifacts/client/Client.ts b/src/api/resources/agents/resources/artifacts/client/Client.ts new file mode 100644 index 00000000..bac817fa --- /dev/null +++ b/src/api/resources/agents/resources/artifacts/client/Client.ts @@ -0,0 +1,114 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace ArtifactsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ArtifactsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ArtifactsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns an artifact produced by a task within a context. File parts may + * carry inline `bytes` or a `uri` to fetch the content out of band. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {Corti.CommonArtifactIdValue} artifactId - Artifact identifier (prefixed UUIDv7). + * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.artifacts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84") + */ + public get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + artifactId: Corti.CommonArtifactIdValue, + requestOptions?: ArtifactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, artifactId, requestOptions)); + } + + private async __get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + artifactId: Corti.CommonArtifactIdValue, + requestOptions?: ArtifactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/artifacts/${core.url.encodePathParam(serializers.CommonArtifactIdValue.jsonOrThrow(artifactId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonArtifactResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/artifacts/{artifactId}", + ); + } +} diff --git a/src/api/resources/agents/resources/artifacts/client/index.ts b/src/api/resources/agents/resources/artifacts/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/agents/resources/artifacts/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/agents/resources/artifacts/index.ts b/src/api/resources/agents/resources/artifacts/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agents/resources/artifacts/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agents/resources/connectors/client/Client.ts b/src/api/resources/agents/resources/connectors/client/Client.ts new file mode 100644 index 00000000..80b7b601 --- /dev/null +++ b/src/api/resources/agents/resources/connectors/client/Client.ts @@ -0,0 +1,351 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace ConnectorsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ConnectorsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ConnectorsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public list( + agentId: Corti.CommonAgentIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions)); + } + + private async __list( + agentId: Corti.CommonAgentIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ConnectorsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/connectors", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorCreateRequest} request + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.ConflictError} + * + * @example + * await client.agents.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * type: "registry", + * name: "@dedalus/coding-expert" + * }) + */ + public attach( + agentId: Corti.CommonAgentIdValue, + request: Corti.CommonConnectorCreateRequest, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__attach(agentId, request, requestOptions)); + } + + private async __attach( + agentId: Corti.CommonAgentIdValue, + request: Corti.CommonConnectorCreateRequest, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.CommonConnectorCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/connectors", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.connectors.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") + */ + public get( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, agentConnectorId, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.connectors.remove("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") + */ + public remove( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__remove(agentId, agentConnectorId, requestOptions)); + } + + private async __remove( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", + ); + } +} diff --git a/src/api/resources/agents/resources/connectors/client/index.ts b/src/api/resources/agents/resources/connectors/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/agents/resources/connectors/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/agents/resources/connectors/index.ts b/src/api/resources/agents/resources/connectors/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agents/resources/connectors/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agents/resources/contexts/client/Client.ts b/src/api/resources/agents/resources/contexts/client/Client.ts new file mode 100644 index 00000000..c33c5e75 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/client/Client.ts @@ -0,0 +1,291 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; +import { TasksClient } from "../resources/tasks/client/Client.js"; + +export declare namespace ContextsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ContextsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + protected _tasks: TasksClient | undefined; + + constructor(options: ContextsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + public get tasks(): TasksClient { + return (this._tasks ??= new TasksClient(this._options)); + } + + /** + * Returns the context's metadata together with its `tasks`, oldest first. + * Each task carries its full message `history`; the user's prompt for a + * task is the `ROLE_USER` message within that task's history (there is no + * separate top-level message list). + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.agents.GetContextsRequest} request + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public get( + contextId: Corti.CommonContextIdValue, + request: Corti.agents.GetContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(contextId, request, requestOptions)); + } + + private async __get( + contextId: Corti.CommonContextIdValue, + request: Corti.agents.GetContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const { historyLength } = request; + const _queryParams: Record = { + historyLength, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ContextsDetailResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}", + ); + } + + /** + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public delete( + contextId: Corti.CommonContextIdValue, + requestOptions?: ContextsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(contextId, requestOptions)); + } + + private async __delete( + contextId: Corti.CommonContextIdValue, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/contexts/{contextId}", + ); + } + + /** + * Returns the execution traces for the context — LLM calls, tool + * executions, and token usage — in OpenInference format. Traces are + * ordered newest-first and paginated; each page returns up to `pageSize` + * traces with their spans inlined. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.agents.GetTraceContextsRequest} request + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public async getTrace( + contextId: Corti.CommonContextIdValue, + request: Corti.agents.GetTraceContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Corti.agents.GetTraceContextsRequest, + ): Promise> => { + const { pageSize, pageToken } = request; + const _queryParams: Record = { + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/trace`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ContextsTraceResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/trace", + ); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.traces ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, + }); + } +} diff --git a/src/api/resources/agents/resources/contexts/client/index.ts b/src/api/resources/agents/resources/contexts/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agents/resources/contexts/client/requests/GetContextsRequest.ts b/src/api/resources/agents/resources/contexts/client/requests/GetContextsRequest.ts new file mode 100644 index 00000000..ac1ae3a8 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/client/requests/GetContextsRequest.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetContextsRequest { + /** Cap the number of history messages returned per task. */ + historyLength?: number; +} diff --git a/src/api/resources/agents/resources/contexts/client/requests/GetTraceContextsRequest.ts b/src/api/resources/agents/resources/contexts/client/requests/GetTraceContextsRequest.ts new file mode 100644 index 00000000..e85c8b41 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/client/requests/GetTraceContextsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetTraceContextsRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agents/resources/contexts/client/requests/index.ts b/src/api/resources/agents/resources/contexts/client/requests/index.ts new file mode 100644 index 00000000..3965334a --- /dev/null +++ b/src/api/resources/agents/resources/contexts/client/requests/index.ts @@ -0,0 +1,2 @@ +export type { GetContextsRequest } from "./GetContextsRequest.js"; +export type { GetTraceContextsRequest } from "./GetTraceContextsRequest.js"; diff --git a/src/api/resources/agents/resources/contexts/index.ts b/src/api/resources/agents/resources/contexts/index.ts new file mode 100644 index 00000000..9eb1192d --- /dev/null +++ b/src/api/resources/agents/resources/contexts/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/api/resources/agents/resources/contexts/resources/index.ts b/src/api/resources/agents/resources/contexts/resources/index.ts new file mode 100644 index 00000000..a371e105 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/resources/index.ts @@ -0,0 +1,2 @@ +export * from "./tasks/client/requests/index.js"; +export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts b/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts new file mode 100644 index 00000000..86a772d3 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts @@ -0,0 +1,202 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; +import { + type NormalizedClientOptionsWithAuth, + normalizeClientOptionsWithAuth, +} from "../../../../../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../../../../../core/headers.js"; +import * as core from "../../../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../../../errors/index.js"; +import * as serializers from "../../../../../../../../serialization/index.js"; +import * as Corti from "../../../../../../../index.js"; + +export declare namespace TasksClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TasksClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TasksClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.agents.contexts.ListTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public async list( + contextId: Corti.CommonContextIdValue, + request: Corti.agents.contexts.ListTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Corti.agents.contexts.ListTasksRequest, + ): Promise> => { + const { pageSize, pageToken } = request; + const _queryParams: Record = { + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks", + ); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.tasks ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, + }); + } + + /** + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.contexts.tasks.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, requestOptions)); + } + + private async __get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}", + ); + } +} diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/index.ts b/src/api/resources/agents/resources/contexts/resources/tasks/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/resources/tasks/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts new file mode 100644 index 00000000..05240c95 --- /dev/null +++ b/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListTasksRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/index.ts b/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/index.ts new file mode 100644 index 00000000..0e50f63c --- /dev/null +++ b/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/index.ts @@ -0,0 +1 @@ +export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/index.ts b/src/api/resources/agents/resources/contexts/resources/tasks/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agents/resources/contexts/resources/tasks/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agents/resources/feedback/client/Client.ts b/src/api/resources/agents/resources/feedback/client/Client.ts new file mode 100644 index 00000000..cf07ff8a --- /dev/null +++ b/src/api/resources/agents/resources/feedback/client/Client.ts @@ -0,0 +1,307 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace FeedbackClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class FeedbackClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: FeedbackClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns all feedback resources submitted for the task by the authenticated user, newest-first. The task must exist, belong to the supplied context, and belong to the authenticated customer. Feedback is scoped to the calling user via row-level security, so the response contains only that user's feedback. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.feedback.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public list( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(contextId, taskId, requestOptions)); + } + + private async __list( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.FeedbackListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", + ); + } + + /** + * Submits feedback about a task as a whole or about a specific user-visible + * message within the task. The task must exist, belong to the supplied + * context, and belong to the authenticated customer. Multiple feedback + * resources may be submitted for the same task or message. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {Corti.agents.FeedbackCreateRequest} request + * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agents.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { + * rating: { + * scale: "binary", + * value: 1 + * } + * }) + * + * @example + * await client.agents.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { + * rating: { + * scale: "binary", + * value: 0 + * }, + * labels: ["unsupportedClaim"], + * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + * target: { + * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" + * }, + * metadata: { + * collectionMethod: "caseReview", + * clientReference: "case-review-728193", + * actor: { + * externalId: "clinician_4182" + * } + * } + * }) + */ + public create( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agents.FeedbackCreateRequest, + requestOptions?: FeedbackClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__create(contextId, taskId, request, requestOptions)); + } + + private async __create( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agents.FeedbackCreateRequest, + requestOptions?: FeedbackClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.agents.FeedbackCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.FeedbackResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", + ); + } + + /** + * Soft-deletes every feedback resource the authenticated user submitted for the task. The task must exist, belong to the supplied context, and belong to the authenticated customer. Idempotent: deleting when there is no feedback returns `204`. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.feedback.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public delete( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(contextId, taskId, requestOptions)); + } + + private async __delete( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", + ); + } +} diff --git a/src/api/resources/agents/resources/feedback/client/index.ts b/src/api/resources/agents/resources/feedback/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agents/resources/feedback/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/api/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts new file mode 100644 index 00000000..e427a0df --- /dev/null +++ b/src/api/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts @@ -0,0 +1,49 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * rating: { + * scale: "binary", + * value: 1 + * } + * } + * + * @example + * { + * rating: { + * scale: "binary", + * value: 0 + * }, + * labels: ["unsupportedClaim"], + * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + * target: { + * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" + * }, + * metadata: { + * collectionMethod: "caseReview", + * clientReference: "case-review-728193", + * actor: { + * externalId: "clinician_4182" + * } + * } + * } + */ +export interface FeedbackCreateRequest { + rating: Corti.FeedbackRating; + /** + * Structured observations about the result. Defaults to an empty array. + * Positive and negative labels may be combined. Duplicate labels are + * rejected. A maximum of five labels may be submitted. + */ + labels?: Corti.FeedbackLabel[]; + /** + * The user's explanation of the rating or labels. Required when `labels` + * contains `other`. + */ + reason?: string; + target?: Corti.FeedbackTarget; + metadata?: Corti.FeedbackMetadata; +} diff --git a/src/api/resources/agents/resources/feedback/client/requests/index.ts b/src/api/resources/agents/resources/feedback/client/requests/index.ts new file mode 100644 index 00000000..06c3ce4e --- /dev/null +++ b/src/api/resources/agents/resources/feedback/client/requests/index.ts @@ -0,0 +1 @@ +export type { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/api/resources/agents/resources/feedback/index.ts b/src/api/resources/agents/resources/feedback/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agents/resources/feedback/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agents/resources/index.ts b/src/api/resources/agents/resources/index.ts new file mode 100644 index 00000000..c5b3b597 --- /dev/null +++ b/src/api/resources/agents/resources/index.ts @@ -0,0 +1,13 @@ +export * from "./a2A/client/requests/index.js"; +export * as a2A from "./a2A/index.js"; +export * from "./a2A/types/index.js"; +export * as artifacts from "./artifacts/index.js"; +export * as connectors from "./connectors/index.js"; +export * from "./contexts/client/requests/index.js"; +export * as contexts from "./contexts/index.js"; +export * from "./feedback/client/requests/index.js"; +export * as feedback from "./feedback/index.js"; +export * from "./registry/client/requests/index.js"; +export * as registry from "./registry/index.js"; +export * from "./usage/client/requests/index.js"; +export * as usage from "./usage/index.js"; diff --git a/src/api/resources/agents/resources/registry/client/Client.ts b/src/api/resources/agents/resources/registry/client/Client.ts new file mode 100644 index 00000000..f6733871 --- /dev/null +++ b/src/api/resources/agents/resources/registry/client/Client.ts @@ -0,0 +1,192 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace RegistryClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class RegistryClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: RegistryClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.agents.ListRegistryRequest} request + * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agents.registry.list() + */ + public async list( + request: Corti.agents.ListRegistryRequest = {}, + requestOptions?: RegistryClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Corti.agents.ListRegistryRequest, + ): Promise> => { + const { q, pageSize, pageToken } = request; + const _queryParams: Record = { + q, + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/registry/connectors", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.RegistryConnectorListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/registry/connectors", + ); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.connectors ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, + }); + } + + /** + * @param {string} connectorId - Registry connector identifier (e.g. `@dedalus/coding-expert`). + * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.registry.get("connectorId") + */ + public get( + connectorId: string, + requestOptions?: RegistryClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(connectorId, requestOptions)); + } + + private async __get( + connectorId: string, + requestOptions?: RegistryClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/registry/connectors/${core.url.encodePathParam(connectorId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.RegistryConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/registry/connectors/{connectorId}", + ); + } +} diff --git a/src/api/resources/agents/resources/registry/client/index.ts b/src/api/resources/agents/resources/registry/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agents/resources/registry/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agents/resources/registry/client/requests/ListRegistryRequest.ts b/src/api/resources/agents/resources/registry/client/requests/ListRegistryRequest.ts new file mode 100644 index 00000000..8fb6c858 --- /dev/null +++ b/src/api/resources/agents/resources/registry/client/requests/ListRegistryRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListRegistryRequest { + /** + * Free-text search over name and description. + * **Future scope**: not yet implemented; the server ignores this parameter and returns the unfiltered page. + */ + q?: string; + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agents/resources/registry/client/requests/index.ts b/src/api/resources/agents/resources/registry/client/requests/index.ts new file mode 100644 index 00000000..763983d1 --- /dev/null +++ b/src/api/resources/agents/resources/registry/client/requests/index.ts @@ -0,0 +1 @@ +export type { ListRegistryRequest } from "./ListRegistryRequest.js"; diff --git a/src/api/resources/agents/resources/registry/index.ts b/src/api/resources/agents/resources/registry/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agents/resources/registry/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agents/resources/usage/client/Client.ts b/src/api/resources/agents/resources/usage/client/Client.ts new file mode 100644 index 00000000..d1fe3072 --- /dev/null +++ b/src/api/resources/agents/resources/usage/client/Client.ts @@ -0,0 +1,130 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace UsageClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class UsageClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: UsageClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns invocation metrics for the agent over the half-open `[from, to)` + * time range (UTC), bucketed at the requested `granularity`. The response + * echoes the resolved range and granularity, a `totals` summary across the + * whole range, and one `buckets` entry per period that had activity (the + * array is empty when there was none). When `from`/`to` are omitted, the + * range defaults to the last 30 days. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.agents.GetUsageRequest} request + * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * from: new Date("2026-05-19T00:00:00.000Z"), + * to: new Date("2026-05-20T00:00:00.000Z") + * }) + */ + public get( + agentId: Corti.CommonAgentIdValue, + request: Corti.agents.GetUsageRequest = {}, + requestOptions?: UsageClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, request, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + request: Corti.agents.GetUsageRequest = {}, + requestOptions?: UsageClient.RequestOptions, + ): Promise> { + const { from: from_, to, granularity } = request; + const _queryParams: Record = { + from: from_ != null ? from_?.toISOString() : undefined, + to: to != null ? to?.toISOString() : undefined, + granularity: + granularity != null + ? serializers.UsageGranularity.jsonOrThrow(granularity, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/usage`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.UsageReportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/usage", + ); + } +} diff --git a/src/api/resources/agents/resources/usage/client/index.ts b/src/api/resources/agents/resources/usage/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agents/resources/usage/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agents/resources/usage/client/requests/GetUsageRequest.ts b/src/api/resources/agents/resources/usage/client/requests/GetUsageRequest.ts new file mode 100644 index 00000000..c6f0d3f7 --- /dev/null +++ b/src/api/resources/agents/resources/usage/client/requests/GetUsageRequest.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * from: new Date("2026-05-19T00:00:00.000Z"), + * to: new Date("2026-05-20T00:00:00.000Z") + * } + */ +export interface GetUsageRequest { + /** + * Inclusive start of the range, as an RFC 3339 timestamp (UTC). + * Defaults to 30 days before `to`. Must not be after `to`. + */ + from?: Date; + /** + * Exclusive end of the range, as an RFC 3339 timestamp (UTC). + * Defaults to the current time. + */ + to?: Date; + /** Size of each reporting bucket. Defaults to `day`. */ + granularity?: Corti.UsageGranularity; +} diff --git a/src/api/resources/agents/resources/usage/client/requests/index.ts b/src/api/resources/agents/resources/usage/client/requests/index.ts new file mode 100644 index 00000000..6e62640f --- /dev/null +++ b/src/api/resources/agents/resources/usage/client/requests/index.ts @@ -0,0 +1 @@ +export type { GetUsageRequest } from "./GetUsageRequest.js"; diff --git a/src/api/resources/agents/resources/usage/index.ts b/src/api/resources/agents/resources/usage/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agents/resources/usage/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agents/types/AgentsCreateAgentAgentType.ts b/src/api/resources/agents/types/AgentsCreateAgentAgentType.ts deleted file mode 100644 index 745a52e8..00000000 --- a/src/api/resources/agents/types/AgentsCreateAgentAgentType.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Optional type of agent. */ -export const AgentsCreateAgentAgentType = { - Expert: "expert", - Orchestrator: "orchestrator", - InterviewingExpert: "interviewing-expert", -} as const; -export type AgentsCreateAgentAgentType = (typeof AgentsCreateAgentAgentType)[keyof typeof AgentsCreateAgentAgentType]; diff --git a/src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts b/src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts deleted file mode 100644 index 9a1278ed..00000000 --- a/src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../index.js"; - -export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsCreateExpertReference; diff --git a/src/api/resources/agents/types/AgentsMessageSendResponse.ts b/src/api/resources/agents/types/AgentsMessageSendResponse.ts deleted file mode 100644 index daa55406..00000000 --- a/src/api/resources/agents/types/AgentsMessageSendResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../index.js"; - -export interface AgentsMessageSendResponse { - message?: Corti.AgentsMessage; - task?: Corti.AgentsTask; -} diff --git a/src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts b/src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts deleted file mode 100644 index ff5a5c08..00000000 --- a/src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../index.js"; - -export type AgentsUpdateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsUpdateExpertReference; diff --git a/src/api/resources/agents/types/index.ts b/src/api/resources/agents/types/index.ts deleted file mode 100644 index 50610a88..00000000 --- a/src/api/resources/agents/types/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./AgentsCreateAgentAgentType.js"; -export * from "./AgentsCreateAgentExpertsItem.js"; -export * from "./AgentsMessageSendResponse.js"; -export * from "./AgentsUpdateAgentExpertsItem.js"; diff --git a/src/api/resources/auth/client/Client.ts b/src/api/resources/auth/client/Client.ts index 61085918..0515c88b 100644 --- a/src/api/resources/auth/client/Client.ts +++ b/src/api/resources/auth/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -43,11 +43,7 @@ export class AuthClient { request: Corti.OAuthTokenRequest, requestOptions?: AuthClient.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -98,7 +94,7 @@ export class AuthClient { * authorization_code (with client_secret), authorization_code with PKCE (code_verifier), password (ROPC), or refresh_token. Use the returned access_token in the Authorization header when calling the Corti API. * * @param {string} tenantName - * @param {Corti.AuthTokenRequestBody} request + * @param {Corti.AuthTokenRequest} request * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -113,7 +109,7 @@ export class AuthClient { */ public token( tenantName: string, - request: Corti.AuthTokenRequestBody, + request: Corti.AuthTokenRequest, requestOptions?: AuthClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__token(tenantName, request, requestOptions)); @@ -121,14 +117,13 @@ export class AuthClient { private async __token( tenantName: string, - request: Corti.AuthTokenRequestBody, + request: Corti.AuthTokenRequest, requestOptions?: AuthClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -142,7 +137,7 @@ export class AuthClient { contentType: "application/x-www-form-urlencoded", queryParameters: requestOptions?.queryParams, requestType: "form", - body: serializers.AuthTokenRequestBody.jsonOrThrow(request, { + body: serializers.AuthTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/auth/types/AuthTokenRequestBody.ts b/src/api/resources/auth/types/AuthTokenRequest.ts similarity index 90% rename from src/api/resources/auth/types/AuthTokenRequestBody.ts rename to src/api/resources/auth/types/AuthTokenRequest.ts index 17aeb485..62bc3cad 100644 --- a/src/api/resources/auth/types/AuthTokenRequestBody.ts +++ b/src/api/resources/auth/types/AuthTokenRequest.ts @@ -2,7 +2,7 @@ import type * as Corti from "../../../index.js"; -export type AuthTokenRequestBody = +export type AuthTokenRequest = | Corti.AuthTokenRequestClientCredentials | Corti.AuthTokenRequestAuthorizationCode | Corti.AuthTokenRequestAuthorizationPkce diff --git a/src/api/resources/auth/types/index.ts b/src/api/resources/auth/types/index.ts index 536709bd..c07e19c2 100644 --- a/src/api/resources/auth/types/index.ts +++ b/src/api/resources/auth/types/index.ts @@ -1 +1 @@ -export * from "./AuthTokenRequestBody.js"; +export * from "./AuthTokenRequest.js"; diff --git a/src/api/resources/codes/client/Client.ts b/src/api/resources/codes/client/Client.ts index fc372036..e4d18134 100644 --- a/src/api/resources/codes/client/Client.ts +++ b/src/api/resources/codes/client/Client.ts @@ -36,6 +36,7 @@ export class CodesClient { * * @example * await client.codes.predict({ + * tenantName: "base", * system: ["icd10cm-outpatient", "cpt"], * context: [{ * type: "text", @@ -45,6 +46,7 @@ export class CodesClient { * * @example * await client.codes.predict({ + * tenantName: "base", * system: ["icd10cm-outpatient"], * context: [{ * type: "text", @@ -67,11 +69,12 @@ export class CodesClient { request: Corti.CodesGeneralPredictRequest, requestOptions?: CodesClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -85,7 +88,7 @@ export class CodesClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.CodesGeneralPredictRequest.jsonOrThrow(request, { + body: serializers.CodesGeneralPredictRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts b/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts index 26464004..e4bb20fc 100644 --- a/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts +++ b/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts @@ -5,6 +5,7 @@ import type * as Corti from "../../../../index.js"; /** * @example * { + * tenantName: "base", * system: ["icd10cm-outpatient", "cpt"], * context: [{ * type: "text", @@ -14,6 +15,7 @@ import type * as Corti from "../../../../index.js"; * * @example * { + * tenantName: "base", * system: ["icd10cm-outpatient"], * context: [{ * type: "text", @@ -26,6 +28,8 @@ import type * as Corti from "../../../../index.js"; * } */ export interface CodesGeneralPredictRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** List of coding systems for prediction */ system: Corti.CommonCodingSystemEnum[]; /** Select either `text` or `documentId` as input context to the model for code prediction. Evidence indices in the response map to this array. */ diff --git a/src/api/resources/documents/client/Client.ts b/src/api/resources/documents/client/Client.ts index ed2310bb..a71e2dc2 100644 --- a/src/api/resources/documents/client/Client.ts +++ b/src/api/resources/documents/client/Client.ts @@ -40,6 +40,7 @@ export class DocumentsClient { * List Documents * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. + * @param {Corti.ListDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -48,24 +49,29 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public list( id: Corti.Uuid, + request: Corti.ListDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(id, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); } private async __list( id: Corti.Uuid, + request: Corti.ListDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -142,7 +148,7 @@ export class DocumentsClient { * This endpoint offers different ways to generate a document. Find guides to document generation [here](/textgen/documents-standard). * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.DocumentsCreateRequest} request + * @param {Corti.CreateDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -152,19 +158,22 @@ export class DocumentsClient { * * @example * await client.documents.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * context: [{ - * type: "facts", - * data: [{ - * text: "text" - * }] - * }], - * templateKey: "templateKey", - * outputLanguage: "outputLanguage" + * tenantName: "base", + * body: { + * context: [{ + * type: "facts", + * data: [{ + * text: "text" + * }] + * }], + * templateKey: "templateKey", + * outputLanguage: "outputLanguage" + * } * }) */ public create( id: Corti.Uuid, - request: Corti.DocumentsCreateRequest, + request: Corti.CreateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(id, request, requestOptions)); @@ -172,14 +181,15 @@ export class DocumentsClient { private async __create( id: Corti.Uuid, - request: Corti.DocumentsCreateRequest, + request: Corti.CreateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -193,7 +203,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.DocumentsCreateRequest.jsonOrThrow(request, { + body: serializers.DocumentsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -268,6 +278,7 @@ export class DocumentsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} documentId - The document ID representing the context for the request. Must be a valid UUID. + * @param {Corti.GetDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -276,26 +287,31 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.documents.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public get( id: Corti.Uuid, documentId: Corti.Uuid, + request: Corti.GetDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, documentId, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, documentId, request, requestOptions)); } private async __get( id: Corti.Uuid, documentId: Corti.Uuid, + request: Corti.GetDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -376,6 +392,7 @@ export class DocumentsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} documentId - The document ID representing the context for the request. Must be a valid UUID. + * @param {Corti.DeleteDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} @@ -384,26 +401,31 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.documents.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public delete( id: Corti.Uuid, documentId: Corti.Uuid, + request: Corti.DeleteDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, documentId, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(id, documentId, request, requestOptions)); } private async __delete( id: Corti.Uuid, documentId: Corti.Uuid, + request: Corti.DeleteDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -484,12 +506,14 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.documents.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public update( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.DocumentsUpdateRequest = {}, + request: Corti.DocumentsUpdateRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, documentId, request, requestOptions)); @@ -498,14 +522,15 @@ export class DocumentsClient { private async __update( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.DocumentsUpdateRequest = {}, + request: Corti.DocumentsUpdateRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -519,7 +544,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.DocumentsUpdateRequest.jsonOrThrow(request, { + body: serializers.DocumentsUpdateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -592,7 +617,7 @@ export class DocumentsClient { * Context can combine different types or reference an interactionId to automatically fetch existing context to pass to the LLM. Note that discarded facts are not passed to the LLM. * With the exception of the plain `templateRef` path (no overrides), every call creates a new auto-generated template aggregate that snapshots the resolved prompts as a drift-proof receipt, persisted for 30 days. * - * @param {Corti.GuidedDocumentsGenerateRequest} request + * @param {Corti.GenerateDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -602,28 +627,32 @@ export class DocumentsClient { * * @example * await client.documents.generate({ - * outputLanguage: "outputLanguage", - * templateRef: { - * templateId: "templateId" + * tenantName: "base", + * body: { + * outputLanguage: "outputLanguage", + * templateRef: { + * templateId: "templateId" + * } * } * }) */ public generate( - request: Corti.GuidedDocumentsGenerateRequest, + request: Corti.GenerateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__generate(request, requestOptions)); } private async __generate( - request: Corti.GuidedDocumentsGenerateRequest, + request: Corti.GenerateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -637,7 +666,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.GuidedDocumentsGenerateRequest.jsonOrThrow(request, { + body: serializers.GuidedDocumentsGenerateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts b/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts new file mode 100644 index 00000000..46d72681 --- /dev/null +++ b/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * tenantName: "base", + * body: { + * context: [{ + * type: "facts", + * data: [{ + * text: "text" + * }] + * }], + * templateKey: "templateKey", + * outputLanguage: "outputLanguage" + * } + * } + */ +export interface CreateDocumentsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; + body: Corti.DocumentsCreateRequest; +} diff --git a/src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts b/src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts new file mode 100644 index 00000000..f2c6bc05 --- /dev/null +++ b/src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface DeleteDocumentsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts b/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts index 20c1b75e..b0b485a0 100644 --- a/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts +++ b/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts @@ -4,9 +4,13 @@ import type * as Corti from "../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface DocumentsUpdateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** An optional name for the document. */ name?: string; sections?: Corti.DocumentsSectionInput[]; diff --git a/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts b/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts new file mode 100644 index 00000000..aa733f64 --- /dev/null +++ b/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * tenantName: "base", + * body: { + * outputLanguage: "outputLanguage", + * templateRef: { + * templateId: "templateId" + * } + * } + * } + */ +export interface GenerateDocumentsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; + body: Corti.GuidedDocumentsGenerateRequest; +} diff --git a/src/api/resources/documents/client/requests/GetDocumentsRequest.ts b/src/api/resources/documents/client/requests/GetDocumentsRequest.ts new file mode 100644 index 00000000..1460fdca --- /dev/null +++ b/src/api/resources/documents/client/requests/GetDocumentsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface GetDocumentsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/client/requests/ListDocumentsRequest.ts b/src/api/resources/documents/client/requests/ListDocumentsRequest.ts new file mode 100644 index 00000000..89f2adef --- /dev/null +++ b/src/api/resources/documents/client/requests/ListDocumentsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface ListDocumentsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/client/requests/index.ts b/src/api/resources/documents/client/requests/index.ts index d86bd2d7..a2eb647c 100644 --- a/src/api/resources/documents/client/requests/index.ts +++ b/src/api/resources/documents/client/requests/index.ts @@ -1 +1,6 @@ +export type { CreateDocumentsRequest } from "./CreateDocumentsRequest.js"; +export type { DeleteDocumentsRequest } from "./DeleteDocumentsRequest.js"; export type { DocumentsUpdateRequest } from "./DocumentsUpdateRequest.js"; +export type { GenerateDocumentsRequest } from "./GenerateDocumentsRequest.js"; +export type { GetDocumentsRequest } from "./GetDocumentsRequest.js"; +export type { ListDocumentsRequest } from "./ListDocumentsRequest.js"; diff --git a/src/api/resources/documents/resources/sections/client/Client.ts b/src/api/resources/documents/resources/sections/client/Client.ts index c1d6d6f3..4bdddc28 100644 --- a/src/api/resources/documents/resources/sections/client/Client.ts +++ b/src/api/resources/documents/resources/sections/client/Client.ts @@ -36,20 +36,22 @@ export class SectionsClient { * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.documents.sections.list() + * await client.documents.sections.list({ + * tenantName: "base" + * }) */ public list( - request: Corti.documents.GuidedSectionsListRequest = {}, + request: Corti.documents.GuidedSectionsListRequest, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.documents.GuidedSectionsListRequest = {}, + request: Corti.documents.GuidedSectionsListRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { - const { lang, region, specialty, label, published, source } = request; + const { lang, region, specialty, label, published, source, tenantName } = request; const _queryParams: Record = { lang, region, @@ -68,7 +70,7 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -115,33 +117,37 @@ export class SectionsClient { * the response includes the published version with full inheritance resolution applied * (section inheritance chain walked to fill missing fields). * - * @param {Corti.GuidedSectionsCreateRequest} request + * @param {Corti.documents.CreateSectionsRequest} request * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * * @example * await client.documents.sections.create({ - * name: "name", - * inheritFromId: "inheritFromId" + * tenantName: "base", + * body: { + * name: "name", + * inheritFromId: "inheritFromId" + * } * }) */ public create( - request: Corti.GuidedSectionsCreateRequest, + request: Corti.documents.CreateSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( - request: Corti.GuidedSectionsCreateRequest, + request: Corti.documents.CreateSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { + const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -155,7 +161,7 @@ export class SectionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.GuidedSectionsCreateRequest.jsonOrThrow(request, { + body: serializers.GuidedSectionsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -200,29 +206,35 @@ export class SectionsClient { * GET /documents/sections/{sectionID}/versions/{versionID}. * * @param {string} sectionID + * @param {Corti.documents.GetSectionsRequest} request * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.get("sectionID") + * await client.documents.sections.get("sectionID", { + * tenantName: "base" + * }) */ public get( sectionID: string, + request: Corti.documents.GetSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(sectionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(sectionID, request, requestOptions)); } private async __get( sectionID: string, + request: Corti.documents.GetSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -278,27 +290,36 @@ export class SectionsClient { * Deletes a section and its versions. Returns 409 if other sections inherit from this section. * * @param {string} sectionID + * @param {Corti.documents.DeleteSectionsRequest} request * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * @throws {@link Corti.ConflictError} * * @example - * await client.documents.sections.delete("sectionID") + * await client.documents.sections.delete("sectionID", { + * tenantName: "base" + * }) */ - public delete(sectionID: string, requestOptions?: SectionsClient.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, requestOptions)); + public delete( + sectionID: string, + request: Corti.documents.DeleteSectionsRequest, + requestOptions?: SectionsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, request, requestOptions)); } private async __delete( sectionID: string, + request: Corti.documents.DeleteSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -325,16 +346,7 @@ export class SectionsClient { case 404: throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); case 409: - throw new Corti.ConflictError( - serializers.ErrorResponse.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); default: throw new errors.CortiError({ statusCode: _response.error.statusCode, @@ -364,11 +376,13 @@ export class SectionsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.update("sectionID") + * await client.documents.sections.update("sectionID", { + * tenantName: "base" + * }) */ public update( sectionID: string, - request: Corti.documents.GuidedSectionsUpdateRequest = {}, + request: Corti.documents.GuidedSectionsUpdateRequest, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(sectionID, request, requestOptions)); @@ -376,14 +390,15 @@ export class SectionsClient { private async __update( sectionID: string, - request: Corti.documents.GuidedSectionsUpdateRequest = {}, + request: Corti.documents.GuidedSectionsUpdateRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -397,7 +412,7 @@ export class SectionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.GuidedSectionsUpdateRequest.jsonOrThrow(request, { + body: serializers.documents.GuidedSectionsUpdateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts b/src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts new file mode 100644 index 00000000..a44561a1 --- /dev/null +++ b/src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * tenantName: "base", + * body: { + * name: "name", + * inheritFromId: "inheritFromId" + * } + * } + */ +export interface CreateSectionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; + body: Corti.GuidedSectionsCreateRequest; +} diff --git a/src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts b/src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts new file mode 100644 index 00000000..97f23474 --- /dev/null +++ b/src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface DeleteSectionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts b/src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts new file mode 100644 index 00000000..7a00fd1f --- /dev/null +++ b/src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface GetSectionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts index eceffddf..a2f2516b 100644 --- a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts +++ b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts @@ -4,7 +4,9 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface GuidedSectionsListRequest { /** Filter sections by BCP 47 language tag (e.g. `fr`, `de`, or `en-GB`). Repeatable. */ @@ -19,4 +21,6 @@ export interface GuidedSectionsListRequest { published?: boolean; /** Filter by source. Omit to return both. `user` returns only user-created sections; `corti` returns only Corti standard sections. */ source?: Corti.GuidedSourceFilter; + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; } diff --git a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts index 958f4777..37346c95 100644 --- a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts +++ b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts @@ -4,9 +4,13 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface GuidedSectionsUpdateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** A human-readable identifier for this section. Not passed to the LLM. */ name?: string; /** A description for this section. Not passed to the LLM. */ diff --git a/src/api/resources/documents/resources/sections/client/requests/index.ts b/src/api/resources/documents/resources/sections/client/requests/index.ts index 0c305d8c..b9a8c04a 100644 --- a/src/api/resources/documents/resources/sections/client/requests/index.ts +++ b/src/api/resources/documents/resources/sections/client/requests/index.ts @@ -1,2 +1,5 @@ +export type { CreateSectionsRequest } from "./CreateSectionsRequest.js"; +export type { DeleteSectionsRequest } from "./DeleteSectionsRequest.js"; +export type { GetSectionsRequest } from "./GetSectionsRequest.js"; export type { GuidedSectionsListRequest } from "./GuidedSectionsListRequest.js"; export type { GuidedSectionsUpdateRequest } from "./GuidedSectionsUpdateRequest.js"; diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts index 447c2d53..6dc7de5a 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts @@ -29,29 +29,35 @@ export class VersionsClient { * Returns raw authored section versions without inheritance resolution. To see resolved content, use GET /sections/{sectionID} instead. * * @param {string} sectionID + * @param {Corti.documents.sections.ListVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.list("sectionID") + * await client.documents.sections.versions.list("sectionID", { + * tenantName: "base" + * }) */ public list( sectionID: string, + request: Corti.documents.sections.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(sectionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(sectionID, request, requestOptions)); } private async __list( sectionID: string, + request: Corti.documents.sections.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -115,6 +121,7 @@ export class VersionsClient { * * @example * await client.documents.sections.versions.create("sectionID", { + * tenantName: "base", * generation: {} * }) */ @@ -131,11 +138,12 @@ export class VersionsClient { request: Corti.documents.sections.GuidedSectionsCreateVersionRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -149,7 +157,7 @@ export class VersionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.sections.GuidedSectionsCreateVersionRequest.jsonOrThrow(request, { + body: serializers.documents.sections.GuidedSectionsCreateVersionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -200,31 +208,37 @@ export class VersionsClient { * * @param {string} sectionID * @param {string} versionID + * @param {Corti.documents.sections.GetVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.get("sectionID", "versionID") + * await client.documents.sections.versions.get("sectionID", "versionID", { + * tenantName: "base" + * }) */ public get( sectionID: string, versionID: string, + request: Corti.documents.sections.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(sectionID, versionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(sectionID, versionID, request, requestOptions)); } private async __get( sectionID: string, versionID: string, + request: Corti.documents.sections.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -281,31 +295,37 @@ export class VersionsClient { * * @param {string} sectionID * @param {string} versionID + * @param {Corti.documents.sections.DeleteVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.delete("sectionID", "versionID") + * await client.documents.sections.versions.delete("sectionID", "versionID", { + * tenantName: "base" + * }) */ public delete( sectionID: string, versionID: string, + request: Corti.documents.sections.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, versionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, versionID, request, requestOptions)); } private async __delete( sectionID: string, versionID: string, + request: Corti.documents.sections.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -353,31 +373,37 @@ export class VersionsClient { * * @param {string} sectionID * @param {string} versionID + * @param {Corti.documents.sections.PublishVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.publish("sectionID", "versionID") + * await client.documents.sections.versions.publish("sectionID", "versionID", { + * tenantName: "base" + * }) */ public publish( sectionID: string, versionID: string, + request: Corti.documents.sections.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__publish(sectionID, versionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__publish(sectionID, versionID, request, requestOptions)); } private async __publish( sectionID: string, versionID: string, + request: Corti.documents.sections.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts new file mode 100644 index 00000000..7fba5afa --- /dev/null +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface DeleteVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts new file mode 100644 index 00000000..772e504d --- /dev/null +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface GetVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts index 7732d79c..d77940f6 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts @@ -5,9 +5,12 @@ import type * as Corti from "../../../../../../../../index.js"; /** * @example * { + * tenantName: "base", * generation: {} * } */ export interface GuidedSectionsCreateVersionRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; generation: Corti.GuidedSectionGenerationPartial; } diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts new file mode 100644 index 00000000..e1f02cd3 --- /dev/null +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface ListVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts new file mode 100644 index 00000000..e2d2946a --- /dev/null +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface PublishVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts index 2e8efdd9..275f5a14 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts @@ -1 +1,5 @@ +export type { DeleteVersionsRequest } from "./DeleteVersionsRequest.js"; +export type { GetVersionsRequest } from "./GetVersionsRequest.js"; export type { GuidedSectionsCreateVersionRequest } from "./GuidedSectionsCreateVersionRequest.js"; +export type { ListVersionsRequest } from "./ListVersionsRequest.js"; +export type { PublishVersionsRequest } from "./PublishVersionsRequest.js"; diff --git a/src/api/resources/documents/resources/templates/client/Client.ts b/src/api/resources/documents/resources/templates/client/Client.ts index 43fecf7f..3e67a183 100644 --- a/src/api/resources/documents/resources/templates/client/Client.ts +++ b/src/api/resources/documents/resources/templates/client/Client.ts @@ -36,20 +36,22 @@ export class TemplatesClient { * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.documents.templates.list() + * await client.documents.templates.list({ + * tenantName: "base" + * }) */ public list( - request: Corti.documents.GuidedTemplatesListRequest = {}, + request: Corti.documents.GuidedTemplatesListRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.documents.GuidedTemplatesListRequest = {}, + request: Corti.documents.GuidedTemplatesListRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { lang, region, specialty, label, published, source } = request; + const { lang, region, specialty, label, published, source, tenantName } = request; const _queryParams: Record = { lang, region, @@ -68,7 +70,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -115,33 +117,37 @@ export class TemplatesClient { * the response includes the published version with full inheritance resolution applied * (template-level and section-level inheritance walked). * - * @param {Corti.GuidedTemplatesCreateRequest} request + * @param {Corti.documents.CreateTemplatesRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * * @example * await client.documents.templates.create({ - * name: "name", - * inheritFromId: "inheritFromId" + * tenantName: "base", + * body: { + * name: "name", + * inheritFromId: "inheritFromId" + * } * }) */ public create( - request: Corti.GuidedTemplatesCreateRequest, + request: Corti.documents.CreateTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( - request: Corti.GuidedTemplatesCreateRequest, + request: Corti.documents.CreateTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { + const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -155,7 +161,7 @@ export class TemplatesClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.GuidedTemplatesCreateRequest.jsonOrThrow(request, { + body: serializers.GuidedTemplatesCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -200,29 +206,35 @@ export class TemplatesClient { * values without inheritance, use GET /documents/templates/{templateID}/versions/{versionID}. * * @param {string} templateID + * @param {Corti.documents.GetTemplatesRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.get("templateID") + * await client.documents.templates.get("templateID", { + * tenantName: "base" + * }) */ public get( templateID: string, + request: Corti.documents.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(templateID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(templateID, request, requestOptions)); } private async __get( templateID: string, + request: Corti.documents.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -278,27 +290,36 @@ export class TemplatesClient { * Deletes a template and its versions. Returns 409 if other templates or sections inherit from this template. * * @param {string} templateID + * @param {Corti.documents.DeleteTemplatesRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * @throws {@link Corti.ConflictError} * * @example - * await client.documents.templates.delete("templateID") + * await client.documents.templates.delete("templateID", { + * tenantName: "base" + * }) */ - public delete(templateID: string, requestOptions?: TemplatesClient.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(templateID, requestOptions)); + public delete( + templateID: string, + request: Corti.documents.DeleteTemplatesRequest, + requestOptions?: TemplatesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(templateID, request, requestOptions)); } private async __delete( templateID: string, + request: Corti.documents.DeleteTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -325,16 +346,7 @@ export class TemplatesClient { case 404: throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); case 409: - throw new Corti.ConflictError( - serializers.ErrorResponse.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); default: throw new errors.CortiError({ statusCode: _response.error.statusCode, @@ -365,11 +377,13 @@ export class TemplatesClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.update("templateID") + * await client.documents.templates.update("templateID", { + * tenantName: "base" + * }) */ public update( templateID: string, - request: Corti.documents.GuidedTemplatesUpdateRequest = {}, + request: Corti.documents.GuidedTemplatesUpdateRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(templateID, request, requestOptions)); @@ -377,14 +391,15 @@ export class TemplatesClient { private async __update( templateID: string, - request: Corti.documents.GuidedTemplatesUpdateRequest = {}, + request: Corti.documents.GuidedTemplatesUpdateRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -398,7 +413,7 @@ export class TemplatesClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.GuidedTemplatesUpdateRequest.jsonOrThrow(request, { + body: serializers.documents.GuidedTemplatesUpdateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts b/src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts new file mode 100644 index 00000000..6dc90aae --- /dev/null +++ b/src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * tenantName: "base", + * body: { + * name: "name", + * inheritFromId: "inheritFromId" + * } + * } + */ +export interface CreateTemplatesRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; + body: Corti.GuidedTemplatesCreateRequest; +} diff --git a/src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts b/src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts new file mode 100644 index 00000000..30ce4a82 --- /dev/null +++ b/src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface DeleteTemplatesRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts b/src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts new file mode 100644 index 00000000..6a7ecc5b --- /dev/null +++ b/src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface GetTemplatesRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts index a0f6bf28..e56248c5 100644 --- a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts +++ b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts @@ -4,7 +4,9 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface GuidedTemplatesListRequest { /** Filter templates by BCP 47 language tag (e.g. `fr`, `de`, or `en-GB`). Repeatable. */ @@ -19,4 +21,6 @@ export interface GuidedTemplatesListRequest { published?: boolean; /** Filter by source. Omit to return both. `user` returns only user/client-created templates; `corti` returns only Corti standard templates. */ source?: Corti.GuidedSourceFilter; + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; } diff --git a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts index 3c9bda6b..f72637ff 100644 --- a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts +++ b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts @@ -4,9 +4,13 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface GuidedTemplatesUpdateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** The name of this template. Not passed to the LLM. */ name?: string; /** A description for this template. Not passed to the LLM. */ diff --git a/src/api/resources/documents/resources/templates/client/requests/index.ts b/src/api/resources/documents/resources/templates/client/requests/index.ts index 8f1750b0..aa0125de 100644 --- a/src/api/resources/documents/resources/templates/client/requests/index.ts +++ b/src/api/resources/documents/resources/templates/client/requests/index.ts @@ -1,2 +1,5 @@ +export type { CreateTemplatesRequest } from "./CreateTemplatesRequest.js"; +export type { DeleteTemplatesRequest } from "./DeleteTemplatesRequest.js"; +export type { GetTemplatesRequest } from "./GetTemplatesRequest.js"; export type { GuidedTemplatesListRequest } from "./GuidedTemplatesListRequest.js"; export type { GuidedTemplatesUpdateRequest } from "./GuidedTemplatesUpdateRequest.js"; diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts index 305583a4..2176ca55 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts @@ -30,29 +30,35 @@ export class VersionsClient { * To see resolved content, use GET /documents/templates/{templateID} instead. * * @param {string} templateID + * @param {Corti.documents.templates.ListVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.list("templateID") + * await client.documents.templates.versions.list("templateID", { + * tenantName: "base" + * }) */ public list( templateID: string, + request: Corti.documents.templates.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(templateID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(templateID, request, requestOptions)); } private async __list( templateID: string, + request: Corti.documents.templates.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -116,6 +122,7 @@ export class VersionsClient { * * @example * await client.documents.templates.versions.create("templateID", { + * tenantName: "base", * generation: {} * }) */ @@ -132,11 +139,12 @@ export class VersionsClient { request: Corti.documents.templates.GuidedTemplatesCreateVersionRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -150,7 +158,7 @@ export class VersionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.templates.GuidedTemplatesCreateVersionRequest.jsonOrThrow(request, { + body: serializers.documents.templates.GuidedTemplatesCreateVersionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -202,31 +210,37 @@ export class VersionsClient { * * @param {string} templateID * @param {string} versionID + * @param {Corti.documents.templates.GetVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.get("templateID", "versionID") + * await client.documents.templates.versions.get("templateID", "versionID", { + * tenantName: "base" + * }) */ public get( templateID: string, versionID: string, + request: Corti.documents.templates.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(templateID, versionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(templateID, versionID, request, requestOptions)); } private async __get( templateID: string, versionID: string, + request: Corti.documents.templates.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -283,31 +297,37 @@ export class VersionsClient { * * @param {string} templateID * @param {string} versionID + * @param {Corti.documents.templates.DeleteVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.delete("templateID", "versionID") + * await client.documents.templates.versions.delete("templateID", "versionID", { + * tenantName: "base" + * }) */ public delete( templateID: string, versionID: string, + request: Corti.documents.templates.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(templateID, versionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(templateID, versionID, request, requestOptions)); } private async __delete( templateID: string, versionID: string, + request: Corti.documents.templates.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -355,31 +375,37 @@ export class VersionsClient { * * @param {string} templateID * @param {string} versionID + * @param {Corti.documents.templates.PublishVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.publish("templateID", "versionID") + * await client.documents.templates.versions.publish("templateID", "versionID", { + * tenantName: "base" + * }) */ public publish( templateID: string, versionID: string, + request: Corti.documents.templates.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__publish(templateID, versionID, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__publish(templateID, versionID, request, requestOptions)); } private async __publish( templateID: string, versionID: string, + request: Corti.documents.templates.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts new file mode 100644 index 00000000..7fba5afa --- /dev/null +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface DeleteVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts new file mode 100644 index 00000000..772e504d --- /dev/null +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface GetVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts index 20fe9683..21ba34fd 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts @@ -5,9 +5,12 @@ import type * as Corti from "../../../../../../../../index.js"; /** * @example * { + * tenantName: "base", * generation: {} * } */ export interface GuidedTemplatesCreateVersionRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; generation: Corti.GuidedTemplatesVersionGeneration; } diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts new file mode 100644 index 00000000..e1f02cd3 --- /dev/null +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface ListVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts new file mode 100644 index 00000000..e2d2946a --- /dev/null +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface PublishVersionsRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts index e1b33267..c119313a 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts @@ -1 +1,5 @@ +export type { DeleteVersionsRequest } from "./DeleteVersionsRequest.js"; +export type { GetVersionsRequest } from "./GetVersionsRequest.js"; export type { GuidedTemplatesCreateVersionRequest } from "./GuidedTemplatesCreateVersionRequest.js"; +export type { ListVersionsRequest } from "./ListVersionsRequest.js"; +export type { PublishVersionsRequest } from "./PublishVersionsRequest.js"; diff --git a/src/api/resources/facts/client/Client.ts b/src/api/resources/facts/client/Client.ts index 684f256e..ee4f94c1 100644 --- a/src/api/resources/facts/client/Client.ts +++ b/src/api/resources/facts/client/Client.ts @@ -25,27 +25,33 @@ export class FactsClient { /** * Returns a list of available fact groups, used to categorize facts associated with an interaction. * + * @param {Corti.FactsFactGroupsListRequest} request * @param {FactsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.InternalServerError} * * @example - * await client.facts.factGroupsList() + * await client.facts.factGroupsList({ + * tenantName: "base" + * }) */ public factGroupsList( + request: Corti.FactsFactGroupsListRequest, requestOptions?: FactsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__factGroupsList(requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__factGroupsList(request, requestOptions)); } private async __factGroupsList( + request: Corti.FactsFactGroupsListRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -105,29 +111,35 @@ export class FactsClient { * Retrieves a list of facts for a given interaction. * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. + * @param {Corti.FactsListRequest} request * @param {FactsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public list( id: Corti.Uuid, + request: Corti.FactsListRequest, requestOptions?: FactsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(id, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); } private async __list( id: Corti.Uuid, + request: Corti.FactsListRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -194,6 +206,7 @@ export class FactsClient { * * @example * await client.facts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base", * facts: [{ * text: "text", * group: "other" @@ -213,11 +226,12 @@ export class FactsClient { request: Corti.FactsCreateRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -231,7 +245,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsCreateRequest.jsonOrThrow(request, { + body: serializers.FactsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -290,6 +304,7 @@ export class FactsClient { * * @example * await client.facts.batchUpdate("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base", * facts: [{ * factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" * }] @@ -308,11 +323,12 @@ export class FactsClient { request: Corti.FactsBatchUpdateRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -326,7 +342,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsBatchUpdateRequest.jsonOrThrow(request, { + body: serializers.FactsBatchUpdateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -385,12 +401,14 @@ export class FactsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.facts.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08") + * await client.facts.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", { + * tenantName: "base" + * }) */ public update( id: Corti.Uuid, factId: string, - request: Corti.FactsUpdateRequest = {}, + request: Corti.FactsUpdateRequest, requestOptions?: FactsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, factId, request, requestOptions)); @@ -399,14 +417,15 @@ export class FactsClient { private async __update( id: Corti.Uuid, factId: string, - request: Corti.FactsUpdateRequest = {}, + request: Corti.FactsUpdateRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -420,7 +439,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsUpdateRequest.jsonOrThrow(request, { + body: serializers.FactsUpdateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -483,6 +502,7 @@ export class FactsClient { * * @example * await client.facts.extract({ + * tenantName: "base", * context: [{ * type: "text", * text: "text" @@ -501,11 +521,12 @@ export class FactsClient { request: Corti.FactsExtractRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -519,7 +540,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsExtractRequest.jsonOrThrow(request, { + body: serializers.FactsExtractRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts b/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts index 30d79bdf..3343870f 100644 --- a/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts +++ b/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts @@ -5,12 +5,15 @@ import type * as Corti from "../../../../index.js"; /** * @example * { + * tenantName: "base", * facts: [{ * factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" * }] * } */ export interface FactsBatchUpdateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** A list of facts to be updated. */ facts: Corti.FactsBatchUpdateInput[]; } diff --git a/src/api/resources/facts/client/requests/FactsCreateRequest.ts b/src/api/resources/facts/client/requests/FactsCreateRequest.ts index 17a9c3a2..8dfb57d7 100644 --- a/src/api/resources/facts/client/requests/FactsCreateRequest.ts +++ b/src/api/resources/facts/client/requests/FactsCreateRequest.ts @@ -5,6 +5,7 @@ import type * as Corti from "../../../../index.js"; /** * @example * { + * tenantName: "base", * facts: [{ * text: "text", * group: "other" @@ -12,6 +13,8 @@ import type * as Corti from "../../../../index.js"; * } */ export interface FactsCreateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** A list of facts to be created. */ facts: Corti.FactsCreateInput[]; } diff --git a/src/api/resources/facts/client/requests/FactsExtractRequest.ts b/src/api/resources/facts/client/requests/FactsExtractRequest.ts index 8107b215..5a24f0a7 100644 --- a/src/api/resources/facts/client/requests/FactsExtractRequest.ts +++ b/src/api/resources/facts/client/requests/FactsExtractRequest.ts @@ -5,6 +5,7 @@ import type * as Corti from "../../../../index.js"; /** * @example * { + * tenantName: "base", * context: [{ * type: "text", * text: "text" @@ -13,6 +14,8 @@ import type * as Corti from "../../../../index.js"; * } */ export interface FactsExtractRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; context: Corti.CommonTextContext[]; /** The desired output language code for extracted facts. Check [languages page](/stt/languages) for more. */ outputLanguage: string; diff --git a/src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts b/src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts new file mode 100644 index 00000000..0dc1b649 --- /dev/null +++ b/src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface FactsFactGroupsListRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/facts/client/requests/FactsListRequest.ts b/src/api/resources/facts/client/requests/FactsListRequest.ts new file mode 100644 index 00000000..303a92b7 --- /dev/null +++ b/src/api/resources/facts/client/requests/FactsListRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface FactsListRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/facts/client/requests/FactsUpdateRequest.ts b/src/api/resources/facts/client/requests/FactsUpdateRequest.ts index 3dff4961..27ed0758 100644 --- a/src/api/resources/facts/client/requests/FactsUpdateRequest.ts +++ b/src/api/resources/facts/client/requests/FactsUpdateRequest.ts @@ -4,9 +4,13 @@ import type * as Corti from "../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface FactsUpdateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** The updated text of the fact. */ text?: string; /** The updated group key for the fact. */ diff --git a/src/api/resources/facts/client/requests/index.ts b/src/api/resources/facts/client/requests/index.ts index c5c6a0cb..2d87c617 100644 --- a/src/api/resources/facts/client/requests/index.ts +++ b/src/api/resources/facts/client/requests/index.ts @@ -1,4 +1,6 @@ export type { FactsBatchUpdateRequest } from "./FactsBatchUpdateRequest.js"; export type { FactsCreateRequest } from "./FactsCreateRequest.js"; export type { FactsExtractRequest } from "./FactsExtractRequest.js"; +export type { FactsFactGroupsListRequest } from "./FactsFactGroupsListRequest.js"; +export type { FactsListRequest } from "./FactsListRequest.js"; export type { FactsUpdateRequest } from "./FactsUpdateRequest.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 2e1d98c8..8075b185 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,6 +1,5 @@ export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; -export * from "./agents/types/index.js"; export * as auth from "./auth/index.js"; export * from "./auth/types/index.js"; export * from "./codes/client/requests/index.js"; @@ -15,6 +14,7 @@ export * from "./interactions/types/index.js"; export * from "./languages/client/requests/index.js"; export * as languages from "./languages/index.js"; export * from "./languages/types/index.js"; +export * from "./recordings/client/requests/index.js"; export * as recordings from "./recordings/index.js"; export * as stream from "./stream/index.js"; export * from "./templates/client/requests/index.js"; diff --git a/src/api/resources/interactions/client/Client.ts b/src/api/resources/interactions/client/Client.ts index 4c5256ac..4a37f104 100644 --- a/src/api/resources/interactions/client/Client.ts +++ b/src/api/resources/interactions/client/Client.ts @@ -32,17 +32,19 @@ export class InteractionsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.list() + * await client.interactions.list({ + * tenantName: "base" + * }) */ public async list( - request: Corti.InteractionsListRequest = {}, + request: Corti.InteractionsListRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Corti.InteractionsListRequest, ): Promise> => { - const { sort, direction, pageSize, index, encounterStatus, patient } = request; + const { sort, direction, pageSize, index, encounterStatus, patient, tenantName } = request; const _queryParams: Record = { sort: sort != null @@ -79,7 +81,7 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -162,6 +164,7 @@ export class InteractionsClient { * * @example * await client.interactions.create({ + * tenantName: "base", * encounter: { * identifier: "identifier", * status: "planned", @@ -180,11 +183,12 @@ export class InteractionsClient { request: Corti.InteractionsCreateRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -198,7 +202,7 @@ export class InteractionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.InteractionsCreateRequest.jsonOrThrow(request, { + body: serializers.InteractionsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -265,30 +269,36 @@ export class InteractionsClient { * Retrieves a previously recorded interaction by its unique identifier (interaction ID). * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. + * @param {Corti.InteractionsGetRequest} request * @param {InteractionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public get( id: Corti.Uuid, + request: Corti.InteractionsGetRequest, requestOptions?: InteractionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, request, requestOptions)); } private async __get( id: Corti.Uuid, + request: Corti.InteractionsGetRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -350,27 +360,36 @@ export class InteractionsClient { * Deletes an existing interaction. * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. + * @param {Corti.InteractionsDeleteRequest} request * @param {InteractionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ - public delete(id: Corti.Uuid, requestOptions?: InteractionsClient.RequestOptions): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + public delete( + id: Corti.Uuid, + request: Corti.InteractionsDeleteRequest, + requestOptions?: InteractionsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(id, request, requestOptions)); } private async __delete( id: Corti.Uuid, + request: Corti.InteractionsDeleteRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -430,11 +449,13 @@ export class InteractionsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public update( id: Corti.Uuid, - request: Corti.InteractionsUpdateRequest = {}, + request: Corti.InteractionsUpdateRequest, requestOptions?: InteractionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions)); @@ -442,14 +463,15 @@ export class InteractionsClient { private async __update( id: Corti.Uuid, - request: Corti.InteractionsUpdateRequest = {}, + request: Corti.InteractionsUpdateRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -463,7 +485,7 @@ export class InteractionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.InteractionsUpdateRequest.jsonOrThrow(request, { + body: serializers.InteractionsUpdateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts b/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts index 4840bd7f..90f27b67 100644 --- a/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts +++ b/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts @@ -5,6 +5,7 @@ import type * as Corti from "../../../../index.js"; /** * @example * { + * tenantName: "base", * encounter: { * identifier: "identifier", * status: "planned", @@ -13,6 +14,8 @@ import type * as Corti from "../../../../index.js"; * } */ export interface InteractionsCreateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** A unique identifier for the medical professional responsible for this interaction. If nulled, automatically set to a uuid. */ assignedUserId?: Corti.Uuid; /** Details about the encounter. */ diff --git a/src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts b/src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts new file mode 100644 index 00000000..681796ef --- /dev/null +++ b/src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface InteractionsDeleteRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/interactions/client/requests/InteractionsGetRequest.ts b/src/api/resources/interactions/client/requests/InteractionsGetRequest.ts new file mode 100644 index 00000000..31219baa --- /dev/null +++ b/src/api/resources/interactions/client/requests/InteractionsGetRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface InteractionsGetRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/interactions/client/requests/InteractionsListRequest.ts b/src/api/resources/interactions/client/requests/InteractionsListRequest.ts index d91d520e..4cec84bd 100644 --- a/src/api/resources/interactions/client/requests/InteractionsListRequest.ts +++ b/src/api/resources/interactions/client/requests/InteractionsListRequest.ts @@ -4,7 +4,9 @@ import type * as Corti from "../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface InteractionsListRequest { /** Field used to sort interactions. Default is createdAt. */ @@ -19,4 +21,6 @@ export interface InteractionsListRequest { encounterStatus?: Corti.InteractionsEncounterStatusEnum | Corti.InteractionsEncounterStatusEnum[]; /** A unique identifier for the patient. */ patient?: string; + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; } diff --git a/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts b/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts index 59433ec3..164e5798 100644 --- a/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts +++ b/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts @@ -4,9 +4,13 @@ import type * as Corti from "../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface InteractionsUpdateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** The unique identifier of the medical professional responsible for this interaction. If nulled, automatically set to a uuid. */ assignedUserId?: Corti.Uuid; /** Details of the encounter being updated. */ diff --git a/src/api/resources/interactions/client/requests/index.ts b/src/api/resources/interactions/client/requests/index.ts index 83043afc..6b6ba9fe 100644 --- a/src/api/resources/interactions/client/requests/index.ts +++ b/src/api/resources/interactions/client/requests/index.ts @@ -1,3 +1,5 @@ export type { InteractionsCreateRequest } from "./InteractionsCreateRequest.js"; +export type { InteractionsDeleteRequest } from "./InteractionsDeleteRequest.js"; +export type { InteractionsGetRequest } from "./InteractionsGetRequest.js"; export type { InteractionsListRequest } from "./InteractionsListRequest.js"; export type { InteractionsUpdateRequest } from "./InteractionsUpdateRequest.js"; diff --git a/src/api/resources/languages/client/Client.ts b/src/api/resources/languages/client/Client.ts index 08ecca82..28b1453b 100644 --- a/src/api/resources/languages/client/Client.ts +++ b/src/api/resources/languages/client/Client.ts @@ -32,20 +32,22 @@ export class LanguagesClient { * @throws {@link Corti.InternalServerError} * * @example - * await client.languages.list() + * await client.languages.list({ + * tenantName: "base" + * }) */ public list( - request: Corti.LanguagesListRequest = {}, + request: Corti.LanguagesListRequest, requestOptions?: LanguagesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.LanguagesListRequest = {}, + request: Corti.LanguagesListRequest, requestOptions?: LanguagesClient.RequestOptions, ): Promise> { - const { endpoint } = request; + const { endpoint, tenantName } = request; const _queryParams: Record = { endpoint: endpoint != null @@ -59,7 +61,7 @@ export class LanguagesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/languages/client/requests/LanguagesListRequest.ts b/src/api/resources/languages/client/requests/LanguagesListRequest.ts index 9d25dcbc..241dab3c 100644 --- a/src/api/resources/languages/client/requests/LanguagesListRequest.ts +++ b/src/api/resources/languages/client/requests/LanguagesListRequest.ts @@ -4,9 +4,13 @@ import type * as Corti from "../../../../index.js"; /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface LanguagesListRequest { /** Field used to filter languages that supported specific endpoint. */ endpoint?: Corti.LanguagesListRequestEndpoint; + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; } diff --git a/src/api/resources/recordings/client/Client.ts b/src/api/resources/recordings/client/Client.ts index 92364ec0..656bab3e 100644 --- a/src/api/resources/recordings/client/Client.ts +++ b/src/api/resources/recordings/client/Client.ts @@ -26,6 +26,7 @@ export class RecordingsClient { * Retrieve a list of recordings for a given interaction. * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. + * @param {Corti.RecordingsListRequest} request * @param {RecordingsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -34,24 +35,29 @@ export class RecordingsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public list( id: Corti.Uuid, + request: Corti.RecordingsListRequest, requestOptions?: RecordingsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(id, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); } private async __list( id: Corti.Uuid, + request: Corti.RecordingsListRequest, requestOptions?: RecordingsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -157,7 +163,6 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), _binaryUploadRequest.headers, requestOptions?.headers, ); @@ -250,21 +255,24 @@ export class RecordingsClient { public get( id: Corti.Uuid, recordingId: Corti.Uuid, + request: Corti.RecordingsGetRequest, requestOptions?: RecordingsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, recordingId, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, recordingId, request, requestOptions)); } private async __get( id: Corti.Uuid, recordingId: Corti.Uuid, + request: Corti.RecordingsGetRequest, requestOptions?: RecordingsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -339,6 +347,7 @@ export class RecordingsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} recordingId - The unique identifier of the recording. Must be a valid UUID. + * @param {Corti.RecordingsDeleteRequest} request * @param {RecordingsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} @@ -347,26 +356,31 @@ export class RecordingsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.recordings.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.recordings.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public delete( id: Corti.Uuid, recordingId: Corti.Uuid, + request: Corti.RecordingsDeleteRequest, requestOptions?: RecordingsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, recordingId, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(id, recordingId, request, requestOptions)); } private async __delete( id: Corti.Uuid, recordingId: Corti.Uuid, + request: Corti.RecordingsDeleteRequest, requestOptions?: RecordingsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/recordings/client/index.ts b/src/api/resources/recordings/client/index.ts index cb0ff5c3..195f9aa8 100644 --- a/src/api/resources/recordings/client/index.ts +++ b/src/api/resources/recordings/client/index.ts @@ -1 +1 @@ -export {}; +export * from "./requests/index.js"; diff --git a/src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts b/src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts new file mode 100644 index 00000000..a6074519 --- /dev/null +++ b/src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface RecordingsDeleteRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/recordings/client/requests/RecordingsGetRequest.ts b/src/api/resources/recordings/client/requests/RecordingsGetRequest.ts new file mode 100644 index 00000000..d71d0f33 --- /dev/null +++ b/src/api/resources/recordings/client/requests/RecordingsGetRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "tenantName" + * } + */ +export interface RecordingsGetRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/recordings/client/requests/RecordingsListRequest.ts b/src/api/resources/recordings/client/requests/RecordingsListRequest.ts new file mode 100644 index 00000000..d46c38dc --- /dev/null +++ b/src/api/resources/recordings/client/requests/RecordingsListRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface RecordingsListRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/recordings/client/requests/index.ts b/src/api/resources/recordings/client/requests/index.ts new file mode 100644 index 00000000..4252facd --- /dev/null +++ b/src/api/resources/recordings/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { RecordingsDeleteRequest } from "./RecordingsDeleteRequest.js"; +export type { RecordingsGetRequest } from "./RecordingsGetRequest.js"; +export type { RecordingsListRequest } from "./RecordingsListRequest.js"; diff --git a/src/api/resources/templates/client/Client.ts b/src/api/resources/templates/client/Client.ts index 3a109232..a1dd06af 100644 --- a/src/api/resources/templates/client/Client.ts +++ b/src/api/resources/templates/client/Client.ts @@ -32,20 +32,22 @@ export class TemplatesClient { * @throws {@link Corti.InternalServerError} * * @example - * await client.templates.sectionList() + * await client.templates.sectionList({ + * tenantName: "base" + * }) */ public sectionList( - request: Corti.TemplatesSectionListRequest = {}, + request: Corti.TemplatesSectionListRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__sectionList(request, requestOptions)); } private async __sectionList( - request: Corti.TemplatesSectionListRequest = {}, + request: Corti.TemplatesSectionListRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { org, lang } = request; + const { org, lang, tenantName } = request; const _queryParams: Record = { org, lang, @@ -54,7 +56,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -122,20 +124,22 @@ export class TemplatesClient { * @throws {@link Corti.InternalServerError} * * @example - * await client.templates.list() + * await client.templates.list({ + * tenantName: "base" + * }) */ public list( - request: Corti.TemplatesListRequest = {}, + request: Corti.TemplatesListRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.TemplatesListRequest = {}, + request: Corti.TemplatesListRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { org, lang, status } = request; + const { org, lang, status, tenantName } = request; const _queryParams: Record = { org, lang, @@ -145,7 +149,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -207,30 +211,36 @@ export class TemplatesClient { * Retrieves template by key. * * @param {string} key - The key of the template + * @param {Corti.GetTemplatesRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.InternalServerError} * * @example - * await client.templates.get("key") + * await client.templates.get("key", { + * tenantName: "base" + * }) */ public get( key: string, + request: Corti.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(key, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(key, request, requestOptions)); } private async __get( key: string, + request: Corti.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/templates/client/requests/GetTemplatesRequest.ts b/src/api/resources/templates/client/requests/GetTemplatesRequest.ts new file mode 100644 index 00000000..6a7ecc5b --- /dev/null +++ b/src/api/resources/templates/client/requests/GetTemplatesRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface GetTemplatesRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/templates/client/requests/TemplatesListRequest.ts b/src/api/resources/templates/client/requests/TemplatesListRequest.ts index abc1c28c..d3859753 100644 --- a/src/api/resources/templates/client/requests/TemplatesListRequest.ts +++ b/src/api/resources/templates/client/requests/TemplatesListRequest.ts @@ -2,7 +2,9 @@ /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface TemplatesListRequest { /** Filter templates by organization. */ @@ -11,4 +13,6 @@ export interface TemplatesListRequest { lang?: string | string[]; /** Filter templates by their status. */ status?: string | string[]; + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; } diff --git a/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts b/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts index d0768d63..2435f7ef 100644 --- a/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts +++ b/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts @@ -2,11 +2,15 @@ /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface TemplatesSectionListRequest { /** Filter template sections by organization. */ org?: string | string[]; /** Filter template sections by language. */ lang?: string | string[]; + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; } diff --git a/src/api/resources/templates/client/requests/index.ts b/src/api/resources/templates/client/requests/index.ts index d2764071..fed7cf59 100644 --- a/src/api/resources/templates/client/requests/index.ts +++ b/src/api/resources/templates/client/requests/index.ts @@ -1,2 +1,3 @@ +export type { GetTemplatesRequest } from "./GetTemplatesRequest.js"; export type { TemplatesListRequest } from "./TemplatesListRequest.js"; export type { TemplatesSectionListRequest } from "./TemplatesSectionListRequest.js"; diff --git a/src/api/resources/transcripts/client/Client.ts b/src/api/resources/transcripts/client/Client.ts index 1c3f7c1d..62a618a8 100644 --- a/src/api/resources/transcripts/client/Client.ts +++ b/src/api/resources/transcripts/client/Client.ts @@ -36,11 +36,13 @@ export class TranscriptsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public list( id: Corti.Uuid, - request: Corti.TranscriptsListRequest = {}, + request: Corti.TranscriptsListRequest, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); @@ -48,10 +50,10 @@ export class TranscriptsClient { private async __list( id: Corti.Uuid, - request: Corti.TranscriptsListRequest = {}, + request: Corti.TranscriptsListRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { - const { full } = request; + const { full, tenantName } = request; const _queryParams: Record = { full, }; @@ -59,7 +61,7 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -152,6 +154,7 @@ export class TranscriptsClient { * * @example * await client.transcripts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base", * recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", * primaryLanguage: "en" * }) @@ -169,11 +172,12 @@ export class TranscriptsClient { request: Corti.TranscriptsCreateRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { + const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -187,7 +191,7 @@ export class TranscriptsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.TranscriptsCreateRequest.jsonOrThrow(request, { + body: serializers.TranscriptsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -262,6 +266,7 @@ export class TranscriptsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID. + * @param {Corti.TranscriptsGetRequest} request * @param {TranscriptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -271,26 +276,31 @@ export class TranscriptsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.transcripts.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.transcripts.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public get( id: Corti.Uuid, transcriptId: Corti.Uuid, + request: Corti.TranscriptsGetRequest, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, transcriptId, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, transcriptId, request, requestOptions)); } private async __get( id: Corti.Uuid, transcriptId: Corti.Uuid, + request: Corti.TranscriptsGetRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -373,6 +383,7 @@ export class TranscriptsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID. + * @param {Corti.TranscriptsDeleteRequest} request * @param {TranscriptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -382,26 +393,31 @@ export class TranscriptsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.transcripts.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.transcripts.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public delete( id: Corti.Uuid, transcriptId: Corti.Uuid, + request: Corti.TranscriptsDeleteRequest, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, transcriptId, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(id, transcriptId, request, requestOptions)); } private async __delete( id: Corti.Uuid, transcriptId: Corti.Uuid, + request: Corti.TranscriptsDeleteRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -475,31 +491,37 @@ export class TranscriptsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID. + * @param {Corti.TranscriptsGetStatusRequest} request * @param {TranscriptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.transcripts.getStatus("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") + * await client.transcripts.getStatus("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { + * tenantName: "base" + * }) */ public getStatus( id: Corti.Uuid, transcriptId: Corti.Uuid, + request: Corti.TranscriptsGetStatusRequest, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getStatus(id, transcriptId, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__getStatus(id, transcriptId, request, requestOptions)); } private async __getStatus( id: Corti.Uuid, transcriptId: Corti.Uuid, + request: Corti.TranscriptsGetStatusRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { + const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts index b1f96a29..5317bf34 100644 --- a/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts +++ b/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts @@ -5,11 +5,14 @@ import type * as Corti from "../../../../index.js"; /** * @example * { + * tenantName: "base", * recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", * primaryLanguage: "en" * } */ export interface TranscriptsCreateRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; /** The unique identifier for the recording. */ recordingId: Corti.Uuid; /** The primary spoken language of the recording. Check https://docs.corti.ai/stt/languages for more. */ diff --git a/src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts new file mode 100644 index 00000000..52cceca1 --- /dev/null +++ b/src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface TranscriptsDeleteRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts new file mode 100644 index 00000000..bd26e380 --- /dev/null +++ b/src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface TranscriptsGetRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts new file mode 100644 index 00000000..c5ec0903 --- /dev/null +++ b/src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * tenantName: "base" + * } + */ +export interface TranscriptsGetStatusRequest { + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; +} diff --git a/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts index 30294927..325849d3 100644 --- a/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts +++ b/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts @@ -2,9 +2,13 @@ /** * @example - * {} + * { + * tenantName: "base" + * } */ export interface TranscriptsListRequest { /** Display full transcripts in listing */ full?: boolean; + /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ + tenantName: string; } diff --git a/src/api/resources/transcripts/client/requests/index.ts b/src/api/resources/transcripts/client/requests/index.ts index f3082818..a337b7ac 100644 --- a/src/api/resources/transcripts/client/requests/index.ts +++ b/src/api/resources/transcripts/client/requests/index.ts @@ -1,2 +1,5 @@ export type { TranscriptsCreateRequest } from "./TranscriptsCreateRequest.js"; +export type { TranscriptsDeleteRequest } from "./TranscriptsDeleteRequest.js"; +export type { TranscriptsGetRequest } from "./TranscriptsGetRequest.js"; +export type { TranscriptsGetStatusRequest } from "./TranscriptsGetStatusRequest.js"; export type { TranscriptsListRequest } from "./TranscriptsListRequest.js"; diff --git a/src/api/types/A2ASendMessageConfiguration.ts b/src/api/types/A2ASendMessageConfiguration.ts new file mode 100644 index 00000000..b1fc30ed --- /dev/null +++ b/src/api/types/A2ASendMessageConfiguration.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Per-request options controlling how a message is processed. + */ +export interface A2ASendMessageConfiguration { + /** If `true`, return as soon as the task is submitted, even if processing is still in progress. If `false` (default), wait until the task reaches a terminal (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`) or interrupted (`INPUT_REQUIRED`, `AUTH_REQUIRED`) state. */ + returnImmediately?: boolean; + /** Maximum number of prior messages to include as context. */ + historyLength?: number; + /** Output media types the caller accepts. */ + acceptedOutputModes?: string[]; +} diff --git a/src/api/types/A2ASendMessageRequest.ts b/src/api/types/A2ASendMessageRequest.ts new file mode 100644 index 00000000..0b8fcc65 --- /dev/null +++ b/src/api/types/A2ASendMessageRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for sending a message to an agent. + */ +export interface A2ASendMessageRequest { + message: Corti.CommonMessage; + configuration?: Corti.A2ASendMessageConfiguration; + /** Free-form request metadata. */ + metadata?: Record; + /** Optional. Opaque routing identifier. Must match the `tenant` value from the selected `AgentInterface` in the Agent Card when that field is set. */ + tenant?: string; +} diff --git a/src/api/types/A2ASendMessageResponse.ts b/src/api/types/A2ASendMessageResponse.ts new file mode 100644 index 00000000..4b03d590 --- /dev/null +++ b/src/api/types/A2ASendMessageResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Exactly one of `task` or `message` is present. + */ +export type A2ASendMessageResponse = unknown; diff --git a/src/api/types/A2AStreamEventResponse.ts b/src/api/types/A2AStreamEventResponse.ts new file mode 100644 index 00000000..36e6af48 --- /dev/null +++ b/src/api/types/A2AStreamEventResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * An SSE event carrying an A2A `HTTP+JSON` streaming response. + */ +export interface A2AStreamEventResponse { + /** SSE payload: an A2A HTTP+JSON streaming response. */ + data?: string; + /** Event type. Absent for the default `message` event. */ + event?: string; + /** + * Opaque event id. Clients echo the most recent value in the + * `Last-Event-ID` header to resume a dropped stream. + */ + id?: string; + /** Reconnection time in milliseconds the client should use. */ + retry?: number; +} diff --git a/src/api/types/A2AjsonrpcResponse.ts b/src/api/types/A2AjsonrpcResponse.ts new file mode 100644 index 00000000..431728b4 --- /dev/null +++ b/src/api/types/A2AjsonrpcResponse.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A JSON-RPC 2.0 response envelope. + */ +export interface A2AjsonrpcResponse { + /** JSON-RPC protocol version; always `2.0`. */ + jsonrpc: "2.0"; + id: Corti.A2AjsonrpcResponseId | null; + /** JSON-RPC result object (present on success). */ + result?: Record; + /** JSON-RPC error object (present on failure). */ + error?: Corti.A2AjsonrpcResponseError; +} diff --git a/src/api/types/A2AjsonrpcResponseError.ts b/src/api/types/A2AjsonrpcResponseError.ts new file mode 100644 index 00000000..f649367d --- /dev/null +++ b/src/api/types/A2AjsonrpcResponseError.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * JSON-RPC error object (present on failure). + */ +export interface A2AjsonrpcResponseError { + /** JSON-RPC error code. */ + code: number; + /** Human-readable error message. */ + message: string; + /** Additional error details. */ + data?: Record; +} diff --git a/src/api/types/A2AjsonrpcResponseId.ts b/src/api/types/A2AjsonrpcResponseId.ts new file mode 100644 index 00000000..ef652a55 --- /dev/null +++ b/src/api/types/A2AjsonrpcResponseId.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type A2AjsonrpcResponseId = string | number; diff --git a/src/api/types/AgentCardResponse.ts b/src/api/types/AgentCardResponse.ts new file mode 100644 index 00000000..ecf4d1d7 --- /dev/null +++ b/src/api/types/AgentCardResponse.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An A2A agent card describing capabilities, skills, and supported interfaces. + */ +export interface AgentCardResponse { + /** Agent display name. */ + name: string; + /** Agent description. */ + description?: string; + /** A URL providing additional documentation about the agent. */ + documentationUrl?: string; + /** Optional URL to an icon for the agent. */ + iconUrl?: string; + /** Agent card version (SemVer). */ + version: string; + /** Agent capability flags (streaming, push notifications). */ + capabilities: Corti.AgentCardResponseCapabilities; + /** Default input media types. */ + defaultInputModes?: string[]; + /** Default output media types. */ + defaultOutputModes?: string[]; + /** Publishing organization and URL. */ + provider?: Corti.AgentCardResponseProvider; + /** Security requirements for contacting the agent. */ + securityRequirements?: Record[]; + /** The security scheme details used for authenticating with this agent. */ + securitySchemes?: Record; + /** JSON Web Signatures (JWS, RFC 7515) computed for this agent card. */ + signatures?: Corti.AgentCardResponseSignaturesItem[]; + /** Skills the agent exposes. */ + skills?: Corti.AgentCardResponseSkillsItem[]; + /** A2A protocol bindings. v2 advertises protocolVersion `1.0` only. */ + supportedInterfaces: Corti.AgentCardResponseSupportedInterfacesItem[]; +} diff --git a/src/api/types/AgentCardResponseCapabilities.ts b/src/api/types/AgentCardResponseCapabilities.ts new file mode 100644 index 00000000..a28f56e0 --- /dev/null +++ b/src/api/types/AgentCardResponseCapabilities.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Agent capability flags (streaming, push notifications). + */ +export interface AgentCardResponseCapabilities { + /** Whether the agent supports streaming responses. */ + streaming?: boolean; + /** + * Whether the agent can push task updates to a client-supplied webhook. + * **Future scope**: the `tasks/pushNotificationConfig/*` management endpoints are not yet implemented. Expect this to be `false` until they ship. + */ + pushNotifications?: boolean; +} diff --git a/src/api/types/AgentCardResponseProvider.ts b/src/api/types/AgentCardResponseProvider.ts new file mode 100644 index 00000000..4ddb0ec9 --- /dev/null +++ b/src/api/types/AgentCardResponseProvider.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Publishing organization and URL. + */ +export interface AgentCardResponseProvider { + /** Publishing organization name. */ + organization?: string; + /** Publishing organization URL. */ + url?: string; +} diff --git a/src/api/types/AgentCardResponseSignaturesItem.ts b/src/api/types/AgentCardResponseSignaturesItem.ts new file mode 100644 index 00000000..1e9cfd7e --- /dev/null +++ b/src/api/types/AgentCardResponseSignaturesItem.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentCardResponseSignaturesItem { + /** Base64url-encoded protected JWS header. */ + protected: string; + /** Unprotected JWS header values. */ + header?: Record; + /** Base64url-encoded signature. */ + signature: string; +} diff --git a/src/api/types/AgentCardResponseSkillsItem.ts b/src/api/types/AgentCardResponseSkillsItem.ts new file mode 100644 index 00000000..766ce4ce --- /dev/null +++ b/src/api/types/AgentCardResponseSkillsItem.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentCardResponseSkillsItem { + /** Skill identifier. */ + id: string; + /** Skill display name. */ + name: string; + /** Skill description. */ + description?: string; + /** Keywords for search and filtering. */ + tags?: string[]; +} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItem.ts b/src/api/types/AgentCardResponseSupportedInterfacesItem.ts new file mode 100644 index 00000000..345f16d8 --- /dev/null +++ b/src/api/types/AgentCardResponseSupportedInterfacesItem.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentCardResponseSupportedInterfacesItem { + /** A2A protocol binding type. */ + protocolBinding: Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding; + /** A2A protocol version; always `1.0`. */ + protocolVersion: "1.0"; + /** Endpoint URL for this protocol binding. */ + url: string; +} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts new file mode 100644 index 00000000..658ead3f --- /dev/null +++ b/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** A2A protocol binding type. */ +export const AgentCardResponseSupportedInterfacesItemProtocolBinding = { + Jsonrpc: "JSONRPC", + HttpJson: "HTTP+JSON", +} as const; +export type AgentCardResponseSupportedInterfacesItemProtocolBinding = + (typeof AgentCardResponseSupportedInterfacesItemProtocolBinding)[keyof typeof AgentCardResponseSupportedInterfacesItemProtocolBinding]; diff --git a/src/api/types/AgentsAgent.ts b/src/api/types/AgentsAgent.ts deleted file mode 100644 index 53974d59..00000000 --- a/src/api/types/AgentsAgent.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsAgent { - /** The unique identifier of the agent. */ - id: string; - /** The name of the agent. */ - name: string; - /** A brief description of the agent's capabilities. */ - description: string; - /** The system prompt that defines the overall agents behavior and expectations. */ - systemPrompt: string; - experts?: Corti.AgentsAgentExpertsItem[]; - /** A list of MCP servers that the agent can call. If omitted, the agent can't call any MCP servers. */ - mcpServers?: Corti.AgentsMcpServer[]; -} diff --git a/src/api/types/AgentsAgentCapabilities.ts b/src/api/types/AgentsAgentCapabilities.ts deleted file mode 100644 index 1421c537..00000000 --- a/src/api/types/AgentsAgentCapabilities.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsAgentCapabilities { - /** Indicates whether the agent supports streaming responses. */ - streaming?: boolean; - /** Indicates whether the agent supports push notifications for task status updates. */ - pushNotifications?: boolean; - /** Indicates whether the agent maintains a history of state transitions for tasks. */ - stateTransitionHistory?: boolean; - /** A list of protocol extensions supported by the agent. */ - extensions?: Corti.AgentsAgentExtension[] | null; -} diff --git a/src/api/types/AgentsAgentCard.ts b/src/api/types/AgentsAgentCard.ts deleted file mode 100644 index 98f9ec9a..00000000 --- a/src/api/types/AgentsAgentCard.ts +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsAgentCard { - /** The version of the A2A protocol this agents supports. */ - protocolVersion: string; - /** The name of the agent. */ - name: string; - /** A human readable description of the agent. */ - description: string; - /** The URL where the agent can be reached to process messages. */ - url: string; - preferredTransport?: string | null; - /** A list of additional transport protocols and URL combinations the agent supports. */ - additionalInterfaces?: Corti.AgentsAgentInterface[] | null; - /** A URL to an icon representing the agent. */ - iconUrl?: string | null; - /** A URL to documentation describing how to interact with the agent. */ - documentationUrl?: string | null; - provider?: Corti.AgentsAgentProvider | null; - /** The version of the agent. */ - version: string; - capabilities: Corti.AgentsAgentCapabilities | null; - /** A declaration of the security schemes available to authorize requests. The key is the scheme name. Follows the OpenAPI 3.0 Security Scheme Object. */ - securitySchemes?: Record | null; - /** A list of security requirement objects that apply to all agent interactions. Each object lists security schemes that can be used. Follows the OpenAPI 3.0 Security Requirement Object. This list can be seen as an OR of ANDs. Each object in the list describes one possible set of security requirements that must be present on a request. This allows specifying, for example, "callers must either use OAuth OR an API Key AND mTLS." */ - security?: Record | null; - /** Default set of supported input MIME types for all skills, which can be overridden on a per-skill basis. */ - defaultInputModes: string[]; - /** Default set of supported output MIME types for all skills, which can be overridden on a per-skill basis. */ - defaultOutputModes: string[]; - /** The set of skills, or distinct capabilities, that the agent can perform. */ - skills: Corti.AgentsAgentSkill[]; - /** Indicates whether the agent supports returning an extended agent card when called with authentication. */ - supportsAuthenticatedExtendedCard?: boolean | null; - /** JSON Web Signatures computed for this AgentCard. */ - signatures?: Corti.AgentsAgentCardSignature[] | null; -} diff --git a/src/api/types/AgentsAgentCardSignature.ts b/src/api/types/AgentsAgentCardSignature.ts deleted file mode 100644 index d80738a0..00000000 --- a/src/api/types/AgentsAgentCardSignature.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentsAgentCardSignature { - /** The protected header of the JWS, base64url-encoded. */ - protected: string; - /** The JWS signature, base64url-encoded. */ - signature: string; - /** The unprotected header of the JWS, if any. */ - header?: Record; -} diff --git a/src/api/types/AgentsAgentExpertsItem.ts b/src/api/types/AgentsAgentExpertsItem.ts deleted file mode 100644 index f8a9a698..00000000 --- a/src/api/types/AgentsAgentExpertsItem.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export type AgentsAgentExpertsItem = Corti.AgentsExpert | Corti.AgentsExpertReference; diff --git a/src/api/types/AgentsAgentExtension.ts b/src/api/types/AgentsAgentExtension.ts deleted file mode 100644 index 05d29ff3..00000000 --- a/src/api/types/AgentsAgentExtension.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentsAgentExtension { - /** The URI that identifies the extension. */ - uri: string; - /** A brief description of the extension. */ - description?: string; - /** If true, the client must understand and comply with the extension's requirements to interact with the agent. */ - required?: boolean; - /** Optional, extension-specific configuration parameters. */ - params?: Record; -} diff --git a/src/api/types/AgentsAgentInterface.ts b/src/api/types/AgentsAgentInterface.ts deleted file mode 100644 index 0dcf9151..00000000 --- a/src/api/types/AgentsAgentInterface.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentsAgentInterface { - /** The URL where the agent can be reached using the specified protocol. */ - url: string; - transport: string; -} diff --git a/src/api/types/AgentsAgentProvider.ts b/src/api/types/AgentsAgentProvider.ts deleted file mode 100644 index 2359af07..00000000 --- a/src/api/types/AgentsAgentProvider.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentsAgentProvider { - /** The name of the organization providing the agent. */ - organization: string; - /** The URL of the organization providing the agent. */ - url: string; -} diff --git a/src/api/types/AgentsAgentReference.ts b/src/api/types/AgentsAgentReference.ts deleted file mode 100644 index d00c8c29..00000000 --- a/src/api/types/AgentsAgentReference.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A reference to an agent, either id or name must be provided. If both are passed, the id will be used. - */ -export interface AgentsAgentReference { - type: Corti.AgentsAgentReferenceType; - /** The unique identifier of the agent. */ - id?: string; - /** The name of the agent. */ - name?: string; -} diff --git a/src/api/types/AgentsAgentReferenceType.ts b/src/api/types/AgentsAgentReferenceType.ts deleted file mode 100644 index 0f7dc386..00000000 --- a/src/api/types/AgentsAgentReferenceType.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const AgentsAgentReferenceType = { - Reference: "reference", -} as const; -export type AgentsAgentReferenceType = (typeof AgentsAgentReferenceType)[keyof typeof AgentsAgentReferenceType]; diff --git a/src/api/types/AgentsAgentResponse.ts b/src/api/types/AgentsAgentResponse.ts deleted file mode 100644 index 6cdfbabc..00000000 --- a/src/api/types/AgentsAgentResponse.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export type AgentsAgentResponse = Corti.AgentsAgent | Corti.AgentsAgentReference; diff --git a/src/api/types/AgentsAgentSkill.ts b/src/api/types/AgentsAgentSkill.ts deleted file mode 100644 index f7cc0579..00000000 --- a/src/api/types/AgentsAgentSkill.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsAgentSkill { - /** Unique identifier for the skill. */ - id: string; - /** The name of the skill. */ - name: string; - /** A brief description of the skill's capabilities. */ - description: string; - /** A list of tags or keywords associated with the skill, useful for categorization and search. */ - tags: string[]; - /** A list of example messages that demonstrate how to use this skill. */ - examples?: Corti.AgentsMessage[] | null; - /** A list of supported input MIME types for this skill. If omitted, the agent's default input modes apply. */ - inputModes?: string[] | null; - /** A list of supported output MIME types for this skill. If omitted, the agent's default output modes apply. */ - outputModes?: string[] | null; - /** Security schemes necessary for the agent to leverage this skill. As in the overall AgentCard.security, this list represents a logical OR of security requirement objects. Each object is a set of security schemes that must be used together (a logical AND). */ - security?: Record | null; -} diff --git a/src/api/types/AgentsArtifact.ts b/src/api/types/AgentsArtifact.ts deleted file mode 100644 index f04e2c8f..00000000 --- a/src/api/types/AgentsArtifact.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsArtifact { - /** Unique identifier for the artifact. */ - artifactId: string; - /** Name of the artifact. */ - name?: string; - /** Description of the artifact. */ - description?: string; - /** The content of the artifact. */ - parts: Corti.AgentsPart[]; - /** Additional metadata for the artifact. */ - metadata?: Record; - /** Extensions for the artifact. */ - extensions?: string[]; -} diff --git a/src/api/types/AgentsContext.ts b/src/api/types/AgentsContext.ts deleted file mode 100644 index f3daeff2..00000000 --- a/src/api/types/AgentsContext.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsContext { - /** The context ID. */ - id?: string; - items?: Corti.AgentsContextItemsItem[]; -} diff --git a/src/api/types/AgentsContextItemsItem.ts b/src/api/types/AgentsContextItemsItem.ts deleted file mode 100644 index 2a2affbe..00000000 --- a/src/api/types/AgentsContextItemsItem.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export type AgentsContextItemsItem = Corti.AgentsTask | Corti.AgentsMessage; diff --git a/src/api/types/AgentsCreateExpert.ts b/src/api/types/AgentsCreateExpert.ts deleted file mode 100644 index 0ee8760a..00000000 --- a/src/api/types/AgentsCreateExpert.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsCreateExpert { - type: Corti.AgentsCreateExpertType; - /** The name of the expert. Must be unique. */ - name: string; - /** A brief description of the expert's capabilities. */ - description: string; - /** Optional system prompt that defines the expert's behavior and expectations. */ - systemPrompt?: string; - /** A list of MCP servers that the expert can call. If omitted, the expert can't call any MCP Servers. */ - mcpServers?: Corti.AgentsCreateMcpServer[]; -} diff --git a/src/api/types/AgentsCreateExpertReference.ts b/src/api/types/AgentsCreateExpertReference.ts deleted file mode 100644 index faa939f2..00000000 --- a/src/api/types/AgentsCreateExpertReference.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A reference to a registry expert when creating an agent, either id or name must be provided. If both are passed, the id will be used. - */ -export interface AgentsCreateExpertReference { - type: Corti.AgentsCreateExpertReferenceType; - /** The unique identifier of the expert. */ - id?: string; - /** The name of the expert. */ - name?: string; - /** Optional. Additional system instructions appended to the default system prompt when creating an expert from the registry, extending the expert's behavior. */ - systemPrompt?: string; - /** Optional configuration override for the registry expert. Values provided here are deep-merged with the schema defaults declared on the registry expert and validated against its `configSchema`. Ignored when the registry expert has no schema. */ - config?: Record; -} diff --git a/src/api/types/AgentsCreateExpertReferenceType.ts b/src/api/types/AgentsCreateExpertReferenceType.ts deleted file mode 100644 index 5b760a87..00000000 --- a/src/api/types/AgentsCreateExpertReferenceType.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const AgentsCreateExpertReferenceType = { - Reference: "reference", -} as const; -export type AgentsCreateExpertReferenceType = - (typeof AgentsCreateExpertReferenceType)[keyof typeof AgentsCreateExpertReferenceType]; diff --git a/src/api/types/AgentsCreateExpertType.ts b/src/api/types/AgentsCreateExpertType.ts deleted file mode 100644 index 0e984eb3..00000000 --- a/src/api/types/AgentsCreateExpertType.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const AgentsCreateExpertType = { - New: "new", -} as const; -export type AgentsCreateExpertType = (typeof AgentsCreateExpertType)[keyof typeof AgentsCreateExpertType]; diff --git a/src/api/types/AgentsCreateMcpServer.ts b/src/api/types/AgentsCreateMcpServer.ts deleted file mode 100644 index 1ec5d267..00000000 --- a/src/api/types/AgentsCreateMcpServer.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsCreateMcpServer { - /** Name of the MCP server. */ - name: string; - /** A brief description of the MCP server's capabilities. */ - description?: string; - /** Type of transport used by the MCP server. */ - transportType: Corti.AgentsCreateMcpServerTransportType; - /** Type of authorization used by the MCP server. */ - authorizationType: Corti.AgentsCreateMcpServerAuthorizationType; - /** OAuth2.0 authorization scope to request. */ - authorizationScope?: string; - /** URL of the MCP server. */ - url: string; - /** Redirect URI for OAuth2.0 authorization. */ - redirectUrl?: string; - /** Bearer token to be used in MCP client. */ - token?: string; -} diff --git a/src/api/types/AgentsCreateMcpServerAuthorizationType.ts b/src/api/types/AgentsCreateMcpServerAuthorizationType.ts deleted file mode 100644 index ca4518e9..00000000 --- a/src/api/types/AgentsCreateMcpServerAuthorizationType.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Type of authorization used by the MCP server. */ -export const AgentsCreateMcpServerAuthorizationType = { - None: "none", - Bearer: "bearer", - Inherit: "inherit", - Oauth20: "oauth2.0", -} as const; -export type AgentsCreateMcpServerAuthorizationType = - (typeof AgentsCreateMcpServerAuthorizationType)[keyof typeof AgentsCreateMcpServerAuthorizationType]; diff --git a/src/api/types/AgentsCreateMcpServerTransportType.ts b/src/api/types/AgentsCreateMcpServerTransportType.ts deleted file mode 100644 index 37aef0b9..00000000 --- a/src/api/types/AgentsCreateMcpServerTransportType.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Type of transport used by the MCP server. */ -export const AgentsCreateMcpServerTransportType = { - Stdio: "stdio", - StreamableHttp: "streamable_http", - Sse: "sse", -} as const; -export type AgentsCreateMcpServerTransportType = - (typeof AgentsCreateMcpServerTransportType)[keyof typeof AgentsCreateMcpServerTransportType]; diff --git a/src/api/types/AgentsDataPart.ts b/src/api/types/AgentsDataPart.ts deleted file mode 100644 index 1223b959..00000000 --- a/src/api/types/AgentsDataPart.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsDataPart { - /** The kind of the part, always "data". */ - kind: Corti.AgentsDataPartKind; - /** JSON data payload. */ - data: Record; - /** Additional metadata for the data part. */ - metadata?: Record; -} diff --git a/src/api/types/AgentsDataPartKind.ts b/src/api/types/AgentsDataPartKind.ts deleted file mode 100644 index 7713b079..00000000 --- a/src/api/types/AgentsDataPartKind.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The kind of the part, always "data". */ -export const AgentsDataPartKind = { - Data: "data", -} as const; -export type AgentsDataPartKind = (typeof AgentsDataPartKind)[keyof typeof AgentsDataPartKind]; diff --git a/src/api/types/AgentsExpert.ts b/src/api/types/AgentsExpert.ts deleted file mode 100644 index 7117e0c9..00000000 --- a/src/api/types/AgentsExpert.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsExpert { - type: Corti.AgentsExpertType; - /** The unique identifier of the expert. */ - id: string; - /** The name of the expert. Must be unique. */ - name: string; - /** A brief description of the expert's capabilities. */ - description: string; - /** The system prompt that defines the expert's behavior and expectations. */ - systemPrompt: string; - /** A list of MCP servers that the expert can call. If omitted, the expert can't call any MCP Servers. */ - mcpServers?: Corti.AgentsMcpServer[]; -} diff --git a/src/api/types/AgentsExpertReference.ts b/src/api/types/AgentsExpertReference.ts deleted file mode 100644 index 09c21b14..00000000 --- a/src/api/types/AgentsExpertReference.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A reference to an expert returned by the API. The expert's id and name are always provided. systemPrompt is included only when a registry expert was created with a custom system prompt. - */ -export interface AgentsExpertReference { - type: Corti.AgentsExpertReferenceType; - /** The unique identifier of the expert. */ - id: string; - /** The name of the expert. */ - name: string; - /** Optional. Additional system instructions appended to the default system prompt when creating an expert from the registry, extending the expert's behavior. */ - systemPrompt?: string; - /** The fully resolved configuration for this expert: schema defaults from the registry expert deep-merged with any `config` override supplied at creation. Present only when the source registry expert defined a `configSchema`. */ - resolvedConfig?: Record; -} diff --git a/src/api/types/AgentsExpertReferenceType.ts b/src/api/types/AgentsExpertReferenceType.ts deleted file mode 100644 index f9677db7..00000000 --- a/src/api/types/AgentsExpertReferenceType.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const AgentsExpertReferenceType = { - Reference: "reference", -} as const; -export type AgentsExpertReferenceType = (typeof AgentsExpertReferenceType)[keyof typeof AgentsExpertReferenceType]; diff --git a/src/api/types/AgentsExpertType.ts b/src/api/types/AgentsExpertType.ts deleted file mode 100644 index cef31a43..00000000 --- a/src/api/types/AgentsExpertType.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const AgentsExpertType = { - Expert: "expert", -} as const; -export type AgentsExpertType = (typeof AgentsExpertType)[keyof typeof AgentsExpertType]; diff --git a/src/api/types/AgentsFilePart.ts b/src/api/types/AgentsFilePart.ts deleted file mode 100644 index 64794dfc..00000000 --- a/src/api/types/AgentsFilePart.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsFilePart { - /** The kind of the part, always "file". */ - kind: Corti.AgentsFilePartKind; - file?: Corti.AgentsFilePartFile; - /** Additional metadata for the file part. */ - metadata?: Record; -} diff --git a/src/api/types/AgentsFilePartFile.ts b/src/api/types/AgentsFilePartFile.ts deleted file mode 100644 index 8ab63935..00000000 --- a/src/api/types/AgentsFilePartFile.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export type AgentsFilePartFile = Corti.AgentsFileWithUri | Corti.AgentsFileWithBytes; diff --git a/src/api/types/AgentsFilePartKind.ts b/src/api/types/AgentsFilePartKind.ts deleted file mode 100644 index 0bb2ac0e..00000000 --- a/src/api/types/AgentsFilePartKind.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The kind of the part, always "file". */ -export const AgentsFilePartKind = { - File: "file", -} as const; -export type AgentsFilePartKind = (typeof AgentsFilePartKind)[keyof typeof AgentsFilePartKind]; diff --git a/src/api/types/AgentsFileWithBytes.ts b/src/api/types/AgentsFileWithBytes.ts deleted file mode 100644 index b58af3f6..00000000 --- a/src/api/types/AgentsFileWithBytes.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentsFileWithBytes { - /** The byte content of the file. */ - bytes: string; - /** The name of the file. */ - name?: string; - /** The MIME type of the file. */ - mimeType?: string; -} diff --git a/src/api/types/AgentsFileWithUri.ts b/src/api/types/AgentsFileWithUri.ts deleted file mode 100644 index 9919157a..00000000 --- a/src/api/types/AgentsFileWithUri.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentsFileWithUri { - /** The URI of the file. */ - uri: string; - /** The name of the file. */ - name?: string; - /** The MIME type of the file. */ - mimeType?: string; -} diff --git a/src/api/types/AgentsLabels.ts b/src/api/types/AgentsLabels.ts new file mode 100644 index 00000000..f7a70f75 --- /dev/null +++ b/src/api/types/AgentsLabels.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Free-form `string → string` metadata for filtering and organisation. Not used for routing or auth. + */ +export type AgentsLabels = Record; diff --git a/src/api/types/AgentsLifecycle.ts b/src/api/types/AgentsLifecycle.ts new file mode 100644 index 00000000..479e335b --- /dev/null +++ b/src/api/types/AgentsLifecycle.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * - `ephemeral` — short-lived; expired automatically. + * - `persistent` — retained until explicitly deleted. + */ +export const AgentsLifecycle = { + Ephemeral: "ephemeral", + Persistent: "persistent", +} as const; +export type AgentsLifecycle = (typeof AgentsLifecycle)[keyof typeof AgentsLifecycle]; diff --git a/src/api/types/AgentsListResponse.ts b/src/api/types/AgentsListResponse.ts new file mode 100644 index 00000000..3e2ede49 --- /dev/null +++ b/src/api/types/AgentsListResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of agents. + */ +export interface AgentsListResponse { + /** Agents on the current page. */ + agents: Corti.AgentsResponse[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/AgentsMcpServer.ts b/src/api/types/AgentsMcpServer.ts deleted file mode 100644 index 57fabed5..00000000 --- a/src/api/types/AgentsMcpServer.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsMcpServer { - /** Unique identifier for the MCP server. */ - id: string; - /** Name of the MCP server. */ - name: string; - /** Type of transport used by the MCP server. */ - transportType: Corti.AgentsMcpServerTransportType; - /** Type of authorization used by the MCP server. */ - authorizationType: Corti.AgentsMcpServerAuthorizationType; - /** OAuth2.0 authorization scope to request. */ - authorizationScope?: string; - /** URL of the MCP server. */ - url: string; - /** Redirect URI for OAuth2.0 authorization. */ - redirectUrl?: string | null; -} diff --git a/src/api/types/AgentsMcpServerAuthorizationType.ts b/src/api/types/AgentsMcpServerAuthorizationType.ts deleted file mode 100644 index 36d6daef..00000000 --- a/src/api/types/AgentsMcpServerAuthorizationType.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Type of authorization used by the MCP server. */ -export const AgentsMcpServerAuthorizationType = { - None: "none", - Bearer: "bearer", - Inherit: "inherit", - Oauth20: "oauth2.0", -} as const; -export type AgentsMcpServerAuthorizationType = - (typeof AgentsMcpServerAuthorizationType)[keyof typeof AgentsMcpServerAuthorizationType]; diff --git a/src/api/types/AgentsMcpServerTransportType.ts b/src/api/types/AgentsMcpServerTransportType.ts deleted file mode 100644 index 39595cae..00000000 --- a/src/api/types/AgentsMcpServerTransportType.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Type of transport used by the MCP server. */ -export const AgentsMcpServerTransportType = { - Stdio: "stdio", - StreamableHttp: "streamable_http", - Sse: "sse", -} as const; -export type AgentsMcpServerTransportType = - (typeof AgentsMcpServerTransportType)[keyof typeof AgentsMcpServerTransportType]; diff --git a/src/api/types/AgentsMessage.ts b/src/api/types/AgentsMessage.ts deleted file mode 100644 index 08b1d045..00000000 --- a/src/api/types/AgentsMessage.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsMessage { - /** The role of the message sender. */ - role: Corti.AgentsMessageRole; - /** The content of the message. */ - parts: Corti.AgentsPart[]; - /** Additional metadata for the message. */ - metadata?: Record; - /** Extensions for the message. */ - extensions?: string[]; - /** Task IDs that this message references for additional context. */ - referenceTaskIds?: string[]; - /** Unique identifier for the message. */ - messageId: string; - /** Unique identifier for the task associated with the message. */ - taskId?: string; - /** Identifier for the context (thread) in which the message is sent. */ - contextId?: string; - /** The kind of the object, always "message". */ - kind: Corti.AgentsMessageKind; -} diff --git a/src/api/types/AgentsMessageKind.ts b/src/api/types/AgentsMessageKind.ts deleted file mode 100644 index 33024a17..00000000 --- a/src/api/types/AgentsMessageKind.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The kind of the object, always "message". */ -export const AgentsMessageKind = { - Message: "message", -} as const; -export type AgentsMessageKind = (typeof AgentsMessageKind)[keyof typeof AgentsMessageKind]; diff --git a/src/api/types/AgentsMessageRole.ts b/src/api/types/AgentsMessageRole.ts deleted file mode 100644 index c2e2164f..00000000 --- a/src/api/types/AgentsMessageRole.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The role of the message sender. */ -export const AgentsMessageRole = { - User: "user", - Agent: "agent", -} as const; -export type AgentsMessageRole = (typeof AgentsMessageRole)[keyof typeof AgentsMessageRole]; diff --git a/src/api/types/AgentsMessageSendConfiguration.ts b/src/api/types/AgentsMessageSendConfiguration.ts deleted file mode 100644 index f85cc4fd..00000000 --- a/src/api/types/AgentsMessageSendConfiguration.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsMessageSendConfiguration { - /** A list of output MIME types the client is prepared to accept in the response. */ - acceptedOutputModes?: string[]; - /** The number of previous messages to include in the context for the agent when processing this message. */ - historyLength?: number; - pushNotificationConfig?: Corti.AgentsPushNotificationConfig; - /** If true, the client will wait for the task to complete. The server may reject this if the task is long-running. */ - blocking?: boolean; -} diff --git a/src/api/types/AgentsPart.ts b/src/api/types/AgentsPart.ts deleted file mode 100644 index dbde9135..00000000 --- a/src/api/types/AgentsPart.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export type AgentsPart = Corti.AgentsTextPart | Corti.AgentsFilePart | Corti.AgentsDataPart; diff --git a/src/api/types/AgentsPushNotificationAuthenticationInfo.ts b/src/api/types/AgentsPushNotificationAuthenticationInfo.ts deleted file mode 100644 index 5769026a..00000000 --- a/src/api/types/AgentsPushNotificationAuthenticationInfo.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentsPushNotificationAuthenticationInfo { - /** A list of supported authentication schemes (e.g. 'Basic', 'Bearer'). */ - schemes: string[]; - /** Optional credentials or tokens required for authentication. */ - credentials?: string; -} diff --git a/src/api/types/AgentsPushNotificationConfig.ts b/src/api/types/AgentsPushNotificationConfig.ts deleted file mode 100644 index 9c5f9cc4..00000000 --- a/src/api/types/AgentsPushNotificationConfig.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsPushNotificationConfig { - /** Unique identifier for the push notification configuration. */ - id?: string; - /** The URL to which push notifications will be sent when the task status changes. */ - url: string; - /** An optional bearer token to include in the Authorization header when sending push notifications. */ - token?: string; - authentication?: Corti.AgentsPushNotificationAuthenticationInfo; -} diff --git a/src/api/types/AgentsRegistryExpert.ts b/src/api/types/AgentsRegistryExpert.ts deleted file mode 100644 index 6bb800f1..00000000 --- a/src/api/types/AgentsRegistryExpert.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsRegistryExpert { - /** The name of the expert. */ - name: string; - /** An optional human-readable display name for the expert. */ - displayName?: string; - /** An optional human-readable display description for the expert. */ - displayDescription?: string; - /** A brief description of the expert's capabilities. */ - description: string; - /** A list of MCP servers the expert can call, including their authorization types. */ - mcpServers?: Corti.AgentsRegistryMcpServer[]; - /** Optional JSON Schema describing the configuration this expert accepts. When present, callers may supply a matching `config` object on `AgentsCreateExpertReference`; values are deep-merged with schema defaults and validated against this schema. */ - configSchema?: Record; -} diff --git a/src/api/types/AgentsRegistryExpertsResponse.ts b/src/api/types/AgentsRegistryExpertsResponse.ts deleted file mode 100644 index f923bb1d..00000000 --- a/src/api/types/AgentsRegistryExpertsResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsRegistryExpertsResponse { - /** A list of all available experts in the experts registry. */ - experts?: Corti.AgentsRegistryExpert[]; -} diff --git a/src/api/types/AgentsRegistryMcpServer.ts b/src/api/types/AgentsRegistryMcpServer.ts deleted file mode 100644 index 0236f42b..00000000 --- a/src/api/types/AgentsRegistryMcpServer.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsRegistryMcpServer { - /** Name of the MCP server. */ - name: string; - /** Type of authorization used by the MCP server. */ - authorizationType: Corti.AgentsRegistryMcpServerAuthorizationType; -} diff --git a/src/api/types/AgentsRegistryMcpServerAuthorizationType.ts b/src/api/types/AgentsRegistryMcpServerAuthorizationType.ts deleted file mode 100644 index e2764042..00000000 --- a/src/api/types/AgentsRegistryMcpServerAuthorizationType.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Type of authorization used by the MCP server. */ -export const AgentsRegistryMcpServerAuthorizationType = { - None: "none", - Bearer: "bearer", - Inherit: "inherit", - Oauth20: "oauth2.0", -} as const; -export type AgentsRegistryMcpServerAuthorizationType = - (typeof AgentsRegistryMcpServerAuthorizationType)[keyof typeof AgentsRegistryMcpServerAuthorizationType]; diff --git a/src/api/types/AgentsResponse.ts b/src/api/types/AgentsResponse.ts new file mode 100644 index 00000000..ff04c554 --- /dev/null +++ b/src/api/types/AgentsResponse.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A configured agent — its metadata, model, and attached connectors. + */ +export interface AgentsResponse { + id: Corti.CommonAgentIdValue; + /** Human-readable, unique-per-tenant agent name. */ + name: string; + /** Free-form agent description shown to users and in tooling. */ + description?: string | null; + /** System prompt prepended to every invocation. */ + systemPrompt?: string | null; + /** + * Model identifier. Tenant default if omitted or `null`. + * **Open question** — in the current implementation a model is configured per *expert*, not per *agent* (`Expert.modelName`), and an `Agent` has no model field at all. The desired end state is that there is **no distinction between an expert and an agent**, so `model` lives uniformly on this resource. Until that convergence lands, the precedence of an agent-level `model` over a connector/expert-level override is undecided and MUST be resolved before this field ships. + */ + model?: string | null; + visibility: Corti.AgentsVisibility; + lifecycle: Corti.AgentsLifecycle; + /** Connectors attached to the agent, discriminated by `type`. */ + connectors: Corti.CommonConnectorResponse[]; + labels?: Corti.AgentsLabels; + /** When the agent was created. */ + createdAt?: Date; + /** When the agent was last updated. */ + updatedAt?: Date; + /** Principal (user or service principal) that created the agent. */ + createdBy?: Corti.AgentsUserIdValue; +} diff --git a/src/api/types/AgentsTask.ts b/src/api/types/AgentsTask.ts deleted file mode 100644 index 2bd6389f..00000000 --- a/src/api/types/AgentsTask.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsTask { - /** Unique identifier for the task. */ - id: string; - /** Identifier for the context (thread) in which the task is created. */ - contextId: string; - status: Corti.AgentsTaskStatus; - /** The history of messages associated with the task. */ - history?: Corti.AgentsMessage[]; - /** The artifacts associated with the task. */ - artifacts?: Corti.AgentsArtifact[]; - /** Additional metadata for the task. */ - metadata?: Record; - /** The kind of the object, always "task". */ - kind: Corti.AgentsTaskKind; -} diff --git a/src/api/types/AgentsTaskKind.ts b/src/api/types/AgentsTaskKind.ts deleted file mode 100644 index 51fc3dda..00000000 --- a/src/api/types/AgentsTaskKind.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The kind of the object, always "task". */ -export const AgentsTaskKind = { - Task: "task", -} as const; -export type AgentsTaskKind = (typeof AgentsTaskKind)[keyof typeof AgentsTaskKind]; diff --git a/src/api/types/AgentsTaskStatus.ts b/src/api/types/AgentsTaskStatus.ts deleted file mode 100644 index c9f055ed..00000000 --- a/src/api/types/AgentsTaskStatus.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsTaskStatus { - /** The current state of the task. */ - state: Corti.AgentsTaskStatusState; - /** Additional message or details about the task status. */ - message?: Corti.AgentsMessage; - /** The timestamp when this status was recorded. */ - timestamp?: Date; -} diff --git a/src/api/types/AgentsTaskStatusState.ts b/src/api/types/AgentsTaskStatusState.ts deleted file mode 100644 index 7e186848..00000000 --- a/src/api/types/AgentsTaskStatusState.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The current state of the task. */ -export const AgentsTaskStatusState = { - Submitted: "submitted", - Working: "working", - InputRequired: "input-required", - Completed: "completed", - Canceled: "canceled", - Failed: "failed", - Rejected: "rejected", - AuthRequired: "auth-required", - Unknown: "unknown", -} as const; -export type AgentsTaskStatusState = (typeof AgentsTaskStatusState)[keyof typeof AgentsTaskStatusState]; diff --git a/src/api/types/AgentsTextPart.ts b/src/api/types/AgentsTextPart.ts deleted file mode 100644 index b0fda0cf..00000000 --- a/src/api/types/AgentsTextPart.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentsTextPart { - /** The kind of the part, always "text". */ - kind: Corti.AgentsTextPartKind; - /** The text content of the part. */ - text: string; - /** Additional metadata for the text part. */ - metadata?: Record; -} diff --git a/src/api/types/AgentsTextPartKind.ts b/src/api/types/AgentsTextPartKind.ts deleted file mode 100644 index 3366f180..00000000 --- a/src/api/types/AgentsTextPartKind.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The kind of the part, always "text". */ -export const AgentsTextPartKind = { - Text: "text", -} as const; -export type AgentsTextPartKind = (typeof AgentsTextPartKind)[keyof typeof AgentsTextPartKind]; diff --git a/src/api/types/AgentsUpdateExpertReference.ts b/src/api/types/AgentsUpdateExpertReference.ts deleted file mode 100644 index 96a03aa7..00000000 --- a/src/api/types/AgentsUpdateExpertReference.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An expert reference when updating an agent. The id is required to identify which expert to update, or reference. The expert must already exist. - */ -export type AgentsUpdateExpertReference = Corti.AgentsCreateExpertReference; diff --git a/src/api/types/AgentsUserIdValue.ts b/src/api/types/AgentsUserIdValue.ts new file mode 100644 index 00000000..1b1123af --- /dev/null +++ b/src/api/types/AgentsUserIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Principal identifier. Accepts `usr.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type AgentsUserIdValue = string; diff --git a/src/api/types/AgentsVisibility.ts b/src/api/types/AgentsVisibility.ts new file mode 100644 index 00000000..47ee0338 --- /dev/null +++ b/src/api/types/AgentsVisibility.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * - `private` — creator / service principal only. + * - `unlisted` — usable by ID, hidden from list results. + * - `public` — listed tenant-wide. + */ +export const AgentsVisibility = { + Private: "private", + Unlisted: "unlisted", + Public: "public", +} as const; +export type AgentsVisibility = (typeof AgentsVisibility)[keyof typeof AgentsVisibility]; diff --git a/src/api/types/CommonA2AConnector.ts b/src/api/types/CommonA2AConnector.ts new file mode 100644 index 00000000..66820c78 --- /dev/null +++ b/src/api/types/CommonA2AConnector.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector that delegates to a remote A2A agent by endpoint URL. + */ +export interface CommonA2AConnector { + type: "a2a"; + /** Optional display name for the remote A2A agent. */ + name?: string; + /** The remote agent's A2A endpoint (typically a `.well-known/agent-card.json`). */ + url: string; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonA2AConnectorCreate.ts b/src/api/types/CommonA2AConnectorCreate.ts new file mode 100644 index 00000000..206c2513 --- /dev/null +++ b/src/api/types/CommonA2AConnectorCreate.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Request body for attaching a remote A2A agent connector. + */ +export interface CommonA2AConnectorCreate { + type: "a2a"; + /** Optional display name for the remote A2A agent. */ + name?: string; + /** Remote agent A2A endpoint URL. */ + url: string; + /** Whether the connector is active for invocations. */ + enabled?: boolean; +} diff --git a/src/api/types/CommonAgentConnector.ts b/src/api/types/CommonAgentConnector.ts new file mode 100644 index 00000000..a07da86b --- /dev/null +++ b/src/api/types/CommonAgentConnector.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector that delegates to another agent. + */ +export interface CommonAgentConnector { + type: "agent"; + agentId: Corti.CommonAgentIdValue; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonAgentConnectorCreate.ts b/src/api/types/CommonAgentConnectorCreate.ts new file mode 100644 index 00000000..b88662df --- /dev/null +++ b/src/api/types/CommonAgentConnectorCreate.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for attaching an agent connector. + */ +export interface CommonAgentConnectorCreate { + type: "agent"; + agentId: Corti.CommonAgentIdValue; + /** Whether the connector is active for invocations. */ + enabled?: boolean; +} diff --git a/src/api/types/CommonAgentIdValue.ts b/src/api/types/CommonAgentIdValue.ts new file mode 100644 index 00000000..6a47de42 --- /dev/null +++ b/src/api/types/CommonAgentIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Agent identifier. Accepts `agt.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonAgentIdValue = string; diff --git a/src/api/types/CommonArtifactIdValue.ts b/src/api/types/CommonArtifactIdValue.ts new file mode 100644 index 00000000..c77bf933 --- /dev/null +++ b/src/api/types/CommonArtifactIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Artifact identifier. Accepts `art.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonArtifactIdValue = string; diff --git a/src/api/types/CommonArtifactResponse.ts b/src/api/types/CommonArtifactResponse.ts new file mode 100644 index 00000000..675a5c94 --- /dev/null +++ b/src/api/types/CommonArtifactResponse.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A named output produced by a task. + */ +export interface CommonArtifactResponse { + artifactId: Corti.CommonArtifactIdValue; + /** Optional artifact name. */ + name?: string; + /** A human-readable description of the artifact. */ + description?: string; + /** URIs of extensions that contributed to this artifact. */ + extensions?: string[]; + /** Optional metadata included with the artifact. */ + metadata?: Record; + /** Content parts of the artifact. */ + parts: Corti.CommonPart[]; +} diff --git a/src/api/types/CommonConnectorAuth.ts b/src/api/types/CommonConnectorAuth.ts new file mode 100644 index 00000000..74a0e61a --- /dev/null +++ b/src/api/types/CommonConnectorAuth.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Authentication configuration for an outbound connector. + */ +export interface CommonConnectorAuth { + /** Authentication mechanism. */ + type: Corti.CommonConnectorAuthType; + /** OAuth2 scope requested. */ + scope?: string; + /** OAuth2 redirect URL. */ + redirectUrl?: string; + /** Reference to a server-side stored secret. Mutually exclusive with inline credentials passed at call time. */ + ref?: string; +} diff --git a/src/api/types/CommonConnectorAuthType.ts b/src/api/types/CommonConnectorAuthType.ts new file mode 100644 index 00000000..2a11f3ff --- /dev/null +++ b/src/api/types/CommonConnectorAuthType.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Authentication mechanism. */ +export const CommonConnectorAuthType = { + None: "none", + Bearer: "bearer", + ApiKey: "apiKey", + Oauth2: "oauth2", +} as const; +export type CommonConnectorAuthType = (typeof CommonConnectorAuthType)[keyof typeof CommonConnectorAuthType]; diff --git a/src/api/types/CommonConnectorCreateRequest.ts b/src/api/types/CommonConnectorCreateRequest.ts new file mode 100644 index 00000000..bff44d16 --- /dev/null +++ b/src/api/types/CommonConnectorCreateRequest.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Same envelope as `Connector` but without the server-generated `id`. + */ +export type CommonConnectorCreateRequest = + | Corti.CommonRegistryConnectorCreate + | Corti.CommonMcpConnectorCreate + | Corti.CommonAgentConnectorCreate + | Corti.CommonA2AConnectorCreate + | Corti.CommonSchemaConnectorCreate; diff --git a/src/api/types/CommonConnectorIdValue.ts b/src/api/types/CommonConnectorIdValue.ts new file mode 100644 index 00000000..a4170444 --- /dev/null +++ b/src/api/types/CommonConnectorIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Connector identifier. Accepts `con.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonConnectorIdValue = string; diff --git a/src/api/types/CommonConnectorResponse.ts b/src/api/types/CommonConnectorResponse.ts new file mode 100644 index 00000000..05a8410f --- /dev/null +++ b/src/api/types/CommonConnectorResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector attached to an agent, discriminated by `type`. + */ +export type CommonConnectorResponse = + | Corti.CommonRegistryConnectorProvisioned + | Corti.CommonMcpConnector + | Corti.CommonAgentConnector + | Corti.CommonA2AConnector + | Corti.CommonSchemaConnector; diff --git a/src/api/types/CommonConnectorType.ts b/src/api/types/CommonConnectorType.ts new file mode 100644 index 00000000..88d075cd --- /dev/null +++ b/src/api/types/CommonConnectorType.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The connector discriminator. v2 ships `registry`, `mcp`, `agent`, + * `a2a`, and `schema`; `openapi` and `custom` are reserved for future + * minor versions. + */ +export const CommonConnectorType = { + Registry: "registry", + Mcp: "mcp", + Agent: "agent", + A2A: "a2a", + Schema: "schema", +} as const; +export type CommonConnectorType = (typeof CommonConnectorType)[keyof typeof CommonConnectorType]; diff --git a/src/api/types/CommonContextIdValue.ts b/src/api/types/CommonContextIdValue.ts new file mode 100644 index 00000000..c5ea5a8e --- /dev/null +++ b/src/api/types/CommonContextIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Context identifier. Accepts `ctx.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonContextIdValue = string; diff --git a/src/api/types/CommonMcpConnector.ts b/src/api/types/CommonMcpConnector.ts new file mode 100644 index 00000000..d64b84ef --- /dev/null +++ b/src/api/types/CommonMcpConnector.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector backed by a remote MCP server. + */ +export interface CommonMcpConnector { + type: "mcp"; + /** Display name for the MCP connector. */ + name: string; + /** MCP server endpoint URL. */ + url: string; + auth?: Corti.CommonConnectorAuth; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonMcpConnectorCreate.ts b/src/api/types/CommonMcpConnectorCreate.ts new file mode 100644 index 00000000..d553e5b5 --- /dev/null +++ b/src/api/types/CommonMcpConnectorCreate.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for attaching an MCP connector. + */ +export interface CommonMcpConnectorCreate { + type: "mcp"; + /** Display name for the MCP connector. */ + name: string; + /** MCP server endpoint URL. */ + url: string; + /** Whether the connector is active for invocations. */ + enabled?: boolean; + auth?: Corti.CommonConnectorAuth; +} diff --git a/src/api/types/CommonMessage.ts b/src/api/types/CommonMessage.ts new file mode 100644 index 00000000..444606cc --- /dev/null +++ b/src/api/types/CommonMessage.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An A2A message — an ordered list of content parts with a role. + */ +export interface CommonMessage { + messageId?: Corti.CommonMessageIdValue; + contextId?: Corti.CommonContextIdValue; + taskId?: Corti.CommonTaskIdValue; + role: Corti.CommonRole; + /** Ordered content parts of the message. */ + parts: Corti.CommonPart[]; + /** Task ids this message references (A2A v1.0 `Message.referenceTaskIds`). */ + referenceTaskIds?: Corti.CommonTaskIdValue[]; + /** URIs of A2A extensions that contributed to this message (A2A v1.0 `Message.extensions`). */ + extensions?: string[]; + /** + * Free-form A2A metadata. Corti's own first-party keys are prefixed + * with `$` (à la Mixpanel) to set them apart from caller-supplied keys. + * A2A defines no message-level timestamp, so Corti carries one as + * `$timestamp` (RFC 3339 / ISO 8601) — useful for timing *user* + * messages, which `TaskStatus.timestamp` cannot. + */ + metadata?: Record; +} diff --git a/src/api/types/CommonMessageIdValue.ts b/src/api/types/CommonMessageIdValue.ts new file mode 100644 index 00000000..698241f0 --- /dev/null +++ b/src/api/types/CommonMessageIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Message identifier. Accepts `msg.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonMessageIdValue = string; diff --git a/src/api/types/CommonNextPageToken.ts b/src/api/types/CommonNextPageToken.ts new file mode 100644 index 00000000..d6b4861e --- /dev/null +++ b/src/api/types/CommonNextPageToken.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Opaque cursor to request the next page, or `null` if there are no more pages. + */ +export type CommonNextPageToken = string | null; diff --git a/src/api/types/CommonPart.ts b/src/api/types/CommonPart.ts new file mode 100644 index 00000000..aef7692d --- /dev/null +++ b/src/api/types/CommonPart.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * A single content part of a message or artifact. + */ +export interface CommonPart { + /** The string content of the `text` part. */ + text?: string; + /** Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null). */ + data?: Record; + /** An optional `filename` for the file (e.g., `document.pdf`). */ + filename?: string; + /** The `media_type` (MIME type) of the part content (e.g., `text/plain`, `application/json`, `image/png`). */ + mediaType?: string; + /** The `raw` byte content of a file. Encoded as a base64 string. */ + raw?: string; + /** A `url` pointing to the file's content. */ + url?: string; + /** Optional metadata associated with this part. */ + metadata?: Record; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/types/CommonRegistryConnectorCreate.ts b/src/api/types/CommonRegistryConnectorCreate.ts new file mode 100644 index 00000000..a8442138 --- /dev/null +++ b/src/api/types/CommonRegistryConnectorCreate.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Request body for attaching a registry connector. + */ +export interface CommonRegistryConnectorCreate { + type: "registry"; + /** Registry connector name. */ + name: string; + /** Whether the connector is active for invocations. */ + enabled?: boolean; + /** Connector-specific configuration validated against the registry schema. Not yet persisted — the server currently drops `config` for registry connectors on create. */ + config?: Record; +} diff --git a/src/api/types/CommonRegistryConnectorProvisioned.ts b/src/api/types/CommonRegistryConnectorProvisioned.ts new file mode 100644 index 00000000..4b13e427 --- /dev/null +++ b/src/api/types/CommonRegistryConnectorProvisioned.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector provisioned from a registry entry. + */ +export interface CommonRegistryConnectorProvisioned { + type: "registry"; + /** Registry connector name. */ + name: string; + /** Connector-specific configuration validated against the registry schema. */ + config?: Record; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonRole.ts b/src/api/types/CommonRole.ts new file mode 100644 index 00000000..e3947086 --- /dev/null +++ b/src/api/types/CommonRole.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The author of a message. */ +export const CommonRole = { + RoleUser: "ROLE_USER", + RoleAgent: "ROLE_AGENT", +} as const; +export type CommonRole = (typeof CommonRole)[keyof typeof CommonRole]; diff --git a/src/api/types/CommonSchemaConnector.ts b/src/api/types/CommonSchemaConnector.ts new file mode 100644 index 00000000..2cae8b20 --- /dev/null +++ b/src/api/types/CommonSchemaConnector.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector backed by a schema definition. + */ +export interface CommonSchemaConnector { + type: "schema"; + /** Schema connector name. Used as the tool name the LLM calls. */ + name: string; + /** What the tool does. Read by the LLM to decide when to call it. */ + description?: string; + /** JSON Schema defining the tool's output shape. */ + schema: Record; + /** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ + transition?: Corti.CommonSchemaConnectorTransition; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonSchemaConnectorCreate.ts b/src/api/types/CommonSchemaConnectorCreate.ts new file mode 100644 index 00000000..5de599c1 --- /dev/null +++ b/src/api/types/CommonSchemaConnectorCreate.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for attaching a schema connector. + */ +export interface CommonSchemaConnectorCreate { + type: "schema"; + /** Schema connector name. */ + name: string; + /** What the tool does. Read by the LLM to decide when to call it. */ + description?: string; + /** JSON Schema defining the tool's output shape. */ + schema: Record; + /** If set, calling this tool terminates the loop in the given state. */ + transition?: Corti.CommonSchemaConnectorCreateTransition; + /** Whether the connector is active for invocations. */ + enabled?: boolean; +} diff --git a/src/api/types/CommonSchemaConnectorCreateTransition.ts b/src/api/types/CommonSchemaConnectorCreateTransition.ts new file mode 100644 index 00000000..103aba0a --- /dev/null +++ b/src/api/types/CommonSchemaConnectorCreateTransition.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** If set, calling this tool terminates the loop in the given state. */ +export const CommonSchemaConnectorCreateTransition = { + Complete: "complete", + InputRequired: "input_required", +} as const; +export type CommonSchemaConnectorCreateTransition = + (typeof CommonSchemaConnectorCreateTransition)[keyof typeof CommonSchemaConnectorCreateTransition]; diff --git a/src/api/types/CommonSchemaConnectorTransition.ts b/src/api/types/CommonSchemaConnectorTransition.ts new file mode 100644 index 00000000..a169a64a --- /dev/null +++ b/src/api/types/CommonSchemaConnectorTransition.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ +export const CommonSchemaConnectorTransition = { + Complete: "complete", + InputRequired: "input_required", +} as const; +export type CommonSchemaConnectorTransition = + (typeof CommonSchemaConnectorTransition)[keyof typeof CommonSchemaConnectorTransition]; diff --git a/src/api/types/CommonTaskIdValue.ts b/src/api/types/CommonTaskIdValue.ts new file mode 100644 index 00000000..1bbf83f3 --- /dev/null +++ b/src/api/types/CommonTaskIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Task identifier. Accepts `task.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonTaskIdValue = string; diff --git a/src/api/types/CommonTaskListResponse.ts b/src/api/types/CommonTaskListResponse.ts new file mode 100644 index 00000000..cd8c0aea --- /dev/null +++ b/src/api/types/CommonTaskListResponse.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of tasks. + */ +export interface CommonTaskListResponse { + /** The page size used for this response. */ + pageSize?: number; + /** Tasks on the current page. */ + tasks: Corti.CommonTaskResponse[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/CommonTaskMetadata.ts b/src/api/types/CommonTaskMetadata.ts new file mode 100644 index 00000000..df32e38b --- /dev/null +++ b/src/api/types/CommonTaskMetadata.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Free-form A2A task metadata. Corti's first-party keys are prefixed with + * `$` (à la Mixpanel) to set them apart from caller-supplied keys. Token and + * credit accounting is carried under `$usage`. Arbitrary additional keys are + * permitted. + */ +export interface CommonTaskMetadata { + usage?: Corti.CommonUsage; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/types/CommonTaskResponse.ts b/src/api/types/CommonTaskResponse.ts new file mode 100644 index 00000000..877dc4c1 --- /dev/null +++ b/src/api/types/CommonTaskResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An A2A task — a unit of agent work with status, history, and artifacts. + */ +export interface CommonTaskResponse { + id: Corti.CommonTaskIdValue; + contextId: Corti.CommonContextIdValue; + status: Corti.CommonTaskStatus; + /** Messages exchanged during the task, oldest first. */ + history?: Corti.CommonMessage[]; + /** Artifacts produced by the task. */ + artifacts?: Corti.CommonArtifactResponse[]; + /** Task metadata, including `$usage` token/credit accounting. Not yet exposed through the REST binding (deferred); only the JSON-RPC binding populates this field. */ + metadata?: Corti.CommonTaskMetadata; +} diff --git a/src/api/types/CommonTaskState.ts b/src/api/types/CommonTaskState.ts new file mode 100644 index 00000000..0ee2d276 --- /dev/null +++ b/src/api/types/CommonTaskState.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The lifecycle state of a task. */ +export const CommonTaskState = { + TaskStateSubmitted: "TASK_STATE_SUBMITTED", + TaskStateWorking: "TASK_STATE_WORKING", + TaskStateCompleted: "TASK_STATE_COMPLETED", + TaskStateFailed: "TASK_STATE_FAILED", + TaskStateCanceled: "TASK_STATE_CANCELED", + TaskStateInputRequired: "TASK_STATE_INPUT_REQUIRED", + TaskStateRejected: "TASK_STATE_REJECTED", + TaskStateAuthRequired: "TASK_STATE_AUTH_REQUIRED", +} as const; +export type CommonTaskState = (typeof CommonTaskState)[keyof typeof CommonTaskState]; diff --git a/src/api/types/CommonTaskStatus.ts b/src/api/types/CommonTaskStatus.ts new file mode 100644 index 00000000..d2d4b371 --- /dev/null +++ b/src/api/types/CommonTaskStatus.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A task's current state, with an optional status message and timestamp. + */ +export interface CommonTaskStatus { + state: Corti.CommonTaskState; + message?: Corti.CommonMessage; + /** When the status was last updated. */ + timestamp?: Date; +} diff --git a/src/api/types/CommonTotalSize.ts b/src/api/types/CommonTotalSize.ts new file mode 100644 index 00000000..8dc035c2 --- /dev/null +++ b/src/api/types/CommonTotalSize.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Total number of items matching the query, when known. Not currently populated by the server; treat as absent. + */ +export type CommonTotalSize = number; diff --git a/src/api/types/CommonUsage.ts b/src/api/types/CommonUsage.ts new file mode 100644 index 00000000..da9f9b51 --- /dev/null +++ b/src/api/types/CommonUsage.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Token and credit accounting for a task, following the conventions used by + * major LLM providers. `inputTokens`/`outputTokens` count the prompt and + * completion respectively; `cachedInputTokens` is the subset of + * `inputTokens` served from the provider's prompt cache (a discount, not an + * addition), and `cacheCreationInputTokens` is the surcharge paid to + * *write* the cache. `totalTokens` is the all-in count. `credits` is the + * Corti billing unit charged for the task. + */ +export interface CommonUsage { + /** The model identifier that served the request. */ + model?: string; + /** Prompt tokens consumed. */ + inputTokens: number; + /** Completion tokens produced. */ + outputTokens: number; + /** Subset of `inputTokens` served from the prompt cache (cache read). */ + cachedInputTokens?: number; + /** Input tokens written to the prompt cache (cache-write surcharge). */ + cacheCreationInputTokens?: number; + /** Total tokens billed (`inputTokens` + `outputTokens`). */ + totalTokens: number; + /** Corti billing credits charged for the task. */ + credits?: number; +} diff --git a/src/api/types/ConnectorsListResponse.ts b/src/api/types/ConnectorsListResponse.ts new file mode 100644 index 00000000..b3974960 --- /dev/null +++ b/src/api/types/ConnectorsListResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An agent's attached connectors. + */ +export interface ConnectorsListResponse { + /** Connectors attached to the agent. */ + connectors: Corti.CommonConnectorResponse[]; +} diff --git a/src/api/types/Contexts.ts b/src/api/types/Contexts.ts new file mode 100644 index 00000000..1a17c5f1 --- /dev/null +++ b/src/api/types/Contexts.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Lightweight context metadata, as returned in list responses. Contexts are not first-class CRUD resources: there is no explicit create or update endpoint — a context is created implicitly on the first message send (or reused by client-supplied contextId), and list is not yet implemented. + */ +export interface Contexts { + id: Corti.CommonContextIdValue; + agentId?: Corti.CommonAgentIdValue; + /** Total number of tasks in the context. */ + taskCount?: number; + /** When the context was created. */ + createdAt?: Date; + /** When the context was last updated. */ + updatedAt?: Date; + /** When the context expires; `null` means it does not expire. Not yet implemented — the server always returns `null` and performs no TTL-based cleanup. */ + expiresAt?: Date | null; +} diff --git a/src/api/types/ContextsDetailResponse.ts b/src/api/types/ContextsDetailResponse.ts new file mode 100644 index 00000000..76b54a75 --- /dev/null +++ b/src/api/types/ContextsDetailResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A context together with its tasks. Returned by `GET /contexts/{id}`. + * Tasks are ordered oldest first and each carries its full message + * `history` — the user's prompt for a task is the `ROLE_USER` message + * within that task's history. + */ +export interface ContextsDetailResponse extends Corti.Contexts { + /** The context's tasks, oldest first, each with full message history. */ + tasks: Corti.CommonTaskResponse[]; +} diff --git a/src/api/types/ContextsOpenInferenceSpan.ts b/src/api/types/ContextsOpenInferenceSpan.ts new file mode 100644 index 00000000..281c1fee --- /dev/null +++ b/src/api/types/ContextsOpenInferenceSpan.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * A single span in an OpenInference trace. + */ +export interface ContextsOpenInferenceSpan { + /** Human-readable span name. */ + name: string; + /** Unique span identifier. */ + spanId: string; + /** Parent span id, omitted for the root span. */ + parentSpanId?: string; + /** When the span started. */ + startTime: Date; + /** When the span ended; `null` if still in progress. */ + endTime?: Date | null; + /** OpenInference span attributes. Key names and structure follow the OpenInference semantic conventions. */ + attributes?: Record; +} diff --git a/src/api/types/ContextsTraceItem.ts b/src/api/types/ContextsTraceItem.ts new file mode 100644 index 00000000..886870a4 --- /dev/null +++ b/src/api/types/ContextsTraceItem.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A single trace with its inlined OpenInference spans. + */ +export interface ContextsTraceItem { + /** The trace-level record. */ + trace: Corti.ContextsTraceItemTrace; + /** Spans in this trace, ordered by start time. */ + spans: Corti.ContextsOpenInferenceSpan[]; +} diff --git a/src/api/types/ContextsTraceItemTrace.ts b/src/api/types/ContextsTraceItemTrace.ts new file mode 100644 index 00000000..cf6a1384 --- /dev/null +++ b/src/api/types/ContextsTraceItemTrace.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The trace-level record. + */ +export interface ContextsTraceItemTrace { + /** Trace identifier (OTel trace ID — 32-char hex). */ + id: string; + /** Human-readable trace name. */ + name: string; + /** When the trace started. */ + startTime: Date; + /** When the trace ended; `null` if still in progress. */ + endTime?: Date | null; + /** Trace-level input payload. */ + input?: Record; + /** Trace-level output payload. */ + output?: Record; + /** Free-form trace metadata. */ + metadata?: Record; + /** Trace tags. */ + tags?: string[]; + /** Thread/context identifier. */ + threadId: string; +} diff --git a/src/api/types/ContextsTraceResponse.ts b/src/api/types/ContextsTraceResponse.ts new file mode 100644 index 00000000..8f4aaef2 --- /dev/null +++ b/src/api/types/ContextsTraceResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of traces for a context in OpenInference format. Traces are + * ordered newest-first. + */ +export interface ContextsTraceResponse { + /** Traces for the context, newest first. */ + traces: Corti.ContextsTraceItem[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/FeedbackActor.ts b/src/api/types/FeedbackActor.ts new file mode 100644 index 00000000..135da226 --- /dev/null +++ b/src/api/types/FeedbackActor.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Customer-defined opaque identifier for the feedback submitter. + */ +export interface FeedbackActor { + /** + * Scoped to the authenticated customer; not globally unique and not + * independently verified. Should preferably be pseudonymous and must + * not contain names, emails, national identifiers, or medical record + * numbers. + */ + externalId: string; +} diff --git a/src/api/types/FeedbackIdValue.ts b/src/api/types/FeedbackIdValue.ts new file mode 100644 index 00000000..0ff14a45 --- /dev/null +++ b/src/api/types/FeedbackIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Feedback identifier. Accepts `fb.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type FeedbackIdValue = string; diff --git a/src/api/types/FeedbackLabel.ts b/src/api/types/FeedbackLabel.ts new file mode 100644 index 00000000..42fd846b --- /dev/null +++ b/src/api/types/FeedbackLabel.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Structured observation about the result. Positive and negative labels + * share one taxonomy so customers can represent mixed feedback. + * - `correct` — factually and contextually correct (positive). + * - `complete` — included the important expected information (positive). + * - `helpful` — materially helped the user complete their task (positive). + * - `wellPresented` — clear, readable, appropriately structured (positive). + * - `efficient` — reached a useful result without unnecessary content (positive). + * - `incorrect` — one or more claims, conclusions, or actions were wrong (negative). + * - `missingInformation` — important or expected information was omitted (negative). + * - `irrelevant` — included content that did not address the request (negative). + * - `misunderstoodRequest` — the system responded to the wrong intent (negative). + * - `unsupportedClaim` — a claim not supported by available information (negative). + * - `unsafeOrInappropriate` — unsafe, disallowed, or unsuitable (negative). + * - `poorlyPresented` — difficult to read or unsuitably structured (negative). + * - `tooVerbose` — substantially more detail than useful (negative). + * - `other` — another observation described in `reason` (both). + */ +export const FeedbackLabel = { + Correct: "correct", + Complete: "complete", + Helpful: "helpful", + WellPresented: "wellPresented", + Efficient: "efficient", + Incorrect: "incorrect", + MissingInformation: "missingInformation", + Irrelevant: "irrelevant", + MisunderstoodRequest: "misunderstoodRequest", + UnsupportedClaim: "unsupportedClaim", + UnsafeOrInappropriate: "unsafeOrInappropriate", + PoorlyPresented: "poorlyPresented", + TooVerbose: "tooVerbose", + Other: "other", +} as const; +export type FeedbackLabel = (typeof FeedbackLabel)[keyof typeof FeedbackLabel]; diff --git a/src/api/types/FeedbackListResponse.ts b/src/api/types/FeedbackListResponse.ts new file mode 100644 index 00000000..54691bf9 --- /dev/null +++ b/src/api/types/FeedbackListResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * All feedback resources for a task, newest-first. Feedback is scoped to the authenticated user via row-level security. + */ +export interface FeedbackListResponse { + /** Feedback resources for the task. */ + feedbacks: Corti.FeedbackResponse[]; +} diff --git a/src/api/types/FeedbackMetadata.ts b/src/api/types/FeedbackMetadata.ts new file mode 100644 index 00000000..9492bd17 --- /dev/null +++ b/src/api/types/FeedbackMetadata.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Customer-provided provenance and correlation information. + */ +export interface FeedbackMetadata { + /** How the customer collected the feedback. Informational only; does not affect rating validation or normalization. */ + collectionMethod?: string; + /** + * Customer-defined reference to correlate the feedback with an object + * in the customer's own system. Not unique and does not provide + * idempotency. Should not contain sensitive information. + */ + clientReference?: string; + actor?: Corti.FeedbackActor; +} diff --git a/src/api/types/FeedbackRating.ts b/src/api/types/FeedbackRating.ts new file mode 100644 index 00000000..3c27151a --- /dev/null +++ b/src/api/types/FeedbackRating.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * The original rating supplied by the customer. + */ +export interface FeedbackRating { + scale: Corti.FeedbackRatingScale; + /** The rating value on the selected scale. */ + value: number; +} diff --git a/src/api/types/FeedbackRatingScale.ts b/src/api/types/FeedbackRatingScale.ts new file mode 100644 index 00000000..3685fe8b --- /dev/null +++ b/src/api/types/FeedbackRatingScale.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The scale on which the rating was collected. + * - `binary` — 0 (negative) or 1 (positive). + * + * Planned (not yet available): `likert5` (integer 1–5), `continuous01` (number 0–1). + */ +export const FeedbackRatingScale = { + Binary: "binary", +} as const; +export type FeedbackRatingScale = (typeof FeedbackRatingScale)[keyof typeof FeedbackRatingScale]; diff --git a/src/api/types/FeedbackResponse.ts b/src/api/types/FeedbackResponse.ts new file mode 100644 index 00000000..a336cc94 --- /dev/null +++ b/src/api/types/FeedbackResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A stored feedback resource. + */ +export interface FeedbackResponse { + id: Corti.FeedbackIdValue; + taskId: Corti.CommonTaskIdValue; + rating: Corti.FeedbackRating; + /** + * Corti-derived internal score between 0 and 1. The original scale and + * value are always retained alongside this score. + */ + normalizedScore: number; + /** Structured observations about the result. */ + labels: Corti.FeedbackLabel[]; + /** Free-text explanation of the rating or labels. */ + reason?: string; + target?: Corti.FeedbackTarget; + metadata?: Corti.FeedbackMetadata; + /** When the feedback was created. */ + createdAt?: Date; +} diff --git a/src/api/types/FeedbackTarget.ts b/src/api/types/FeedbackTarget.ts new file mode 100644 index 00000000..228e9b62 --- /dev/null +++ b/src/api/types/FeedbackTarget.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Identifies the specific user-visible response being evaluated. If + * omitted, the feedback applies to the task as a whole. + */ +export interface FeedbackTarget { + messageId: Corti.CommonMessageIdValue; +} diff --git a/src/api/types/RegistryConnectorCapabilities.ts b/src/api/types/RegistryConnectorCapabilities.ts new file mode 100644 index 00000000..5cc904b6 --- /dev/null +++ b/src/api/types/RegistryConnectorCapabilities.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * What the connector can do once attached. + */ +export interface RegistryConnectorCapabilities { + /** Emits incremental updates during a task. */ + streaming?: boolean; + /** Accepted input media types. */ + inputModes?: string[]; + /** Produced output media types. */ + outputModes?: string[]; + /** Names of tools the connector exposes to the agent. */ + tools?: string[]; +} diff --git a/src/api/types/RegistryConnectorListResponse.ts b/src/api/types/RegistryConnectorListResponse.ts new file mode 100644 index 00000000..05674681 --- /dev/null +++ b/src/api/types/RegistryConnectorListResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of registry connectors. + */ +export interface RegistryConnectorListResponse { + /** Registry connectors on the current page. */ + connectors: Corti.RegistryConnectorResponse[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/RegistryConnectorResponse.ts b/src/api/types/RegistryConnectorResponse.ts new file mode 100644 index 00000000..b4fcbac7 --- /dev/null +++ b/src/api/types/RegistryConnectorResponse.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A discoverable, pre-built connector offered by the platform registry. + * Only `id`, `type`, `name`, `title`, `description`, and `configSchema` are populated by the server today. `version`, `provider`, `capabilities`, `tags`, and `documentationUrl` are declared for forward compatibility but are not yet returned. + */ +export interface RegistryConnectorResponse { + /** Stable, namespaced registry identifier; use as a `registry` connector's `name`. */ + id: string; + /** The connector kind this entry provisions when attached to an agent. */ + type: Corti.CommonConnectorType; + /** Programmatic name (MCP convention). */ + name: string; + /** Human-readable display name (MCP convention). */ + title?: string; + /** Description for list and detail views. May contain CommonMark. */ + description?: string; + /** Latest published version (SemVer recommended). */ + version?: string; + /** Display icons (MCP convention). */ + icons?: Corti.RegistryIcon[]; + /** Name of the publishing organisation. */ + provider?: string; + /** Connector homepage (MCP convention). */ + websiteUrl?: string; + /** Documentation URL for the connector. */ + documentationUrl?: string; + capabilities?: Corti.RegistryConnectorCapabilities; + /** Keywords for search and filtering. */ + tags?: string[]; + /** JSON Schema (draft 2020-12) describing the connector's accepted `config`. */ + configSchema?: Record; +} diff --git a/src/api/types/RegistryIcon.ts b/src/api/types/RegistryIcon.ts new file mode 100644 index 00000000..cfea9234 --- /dev/null +++ b/src/api/types/RegistryIcon.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * An icon resource, following the MCP `Icon` shape. + */ +export interface RegistryIcon { + /** Icon source URL. */ + src: string; + /** MIME type of the icon resource. */ + mimeType?: string; + /** `WxH` size hints (e.g. `48x48`), or `any` for scalable icons. */ + sizes?: string[]; +} diff --git a/src/api/types/UsageBucket.ts b/src/api/types/UsageBucket.ts new file mode 100644 index 00000000..5d9f542a --- /dev/null +++ b/src/api/types/UsageBucket.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Usage metrics for a single time bucket. + */ +export interface UsageBucket extends Corti.UsageMetrics { + /** Inclusive start of the bucket (UTC). */ + periodStart: Date; + /** Exclusive end of the bucket (UTC). */ + periodEnd: Date; +} diff --git a/src/api/types/UsageGranularity.ts b/src/api/types/UsageGranularity.ts new file mode 100644 index 00000000..05c67177 --- /dev/null +++ b/src/api/types/UsageGranularity.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The size of each usage reporting bucket. Only `day` is currently honored; `minute`, `hour`, and `week` are accepted but produce daily buckets (the server always returns `day`). */ +export const UsageGranularity = { + Minute: "minute", + Hour: "hour", + Day: "day", + Week: "week", +} as const; +export type UsageGranularity = (typeof UsageGranularity)[keyof typeof UsageGranularity]; diff --git a/src/api/types/UsageMetrics.ts b/src/api/types/UsageMetrics.ts new file mode 100644 index 00000000..d10a21ac --- /dev/null +++ b/src/api/types/UsageMetrics.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Invocation metrics for a single period. + */ +export interface UsageMetrics { + /** Number of agent invocations in the period. */ + invocations: number; + /** Number of distinct contexts invoked in the period. */ + uniqueContexts: number; +} diff --git a/src/api/types/UsageReportResponse.ts b/src/api/types/UsageReportResponse.ts new file mode 100644 index 00000000..117bfc7b --- /dev/null +++ b/src/api/types/UsageReportResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An agent's bucketed usage over a date range, with range-wide totals. + */ +export interface UsageReportResponse { + granularity: Corti.UsageGranularity; + /** Resolved inclusive start of the range (UTC). */ + from: Date; + /** Resolved exclusive end of the range (UTC). */ + to: Date; + /** Aggregate metrics across the whole range. */ + totals: Corti.UsageMetrics; + /** One entry per period with activity, ordered oldest first. */ + buckets: Corti.UsageBucket[]; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 7ce73b9e..65634424 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,57 +1,23 @@ -export * from "./AgentsAgent.js"; -export * from "./AgentsAgentCapabilities.js"; -export * from "./AgentsAgentCard.js"; -export * from "./AgentsAgentCardSignature.js"; -export * from "./AgentsAgentExpertsItem.js"; -export * from "./AgentsAgentExtension.js"; -export * from "./AgentsAgentInterface.js"; -export * from "./AgentsAgentProvider.js"; -export * from "./AgentsAgentReference.js"; -export * from "./AgentsAgentReferenceType.js"; -export * from "./AgentsAgentResponse.js"; -export * from "./AgentsAgentSkill.js"; -export * from "./AgentsArtifact.js"; -export * from "./AgentsContext.js"; -export * from "./AgentsContextItemsItem.js"; -export * from "./AgentsCreateExpert.js"; -export * from "./AgentsCreateExpertReference.js"; -export * from "./AgentsCreateExpertReferenceType.js"; -export * from "./AgentsCreateExpertType.js"; -export * from "./AgentsCreateMcpServer.js"; -export * from "./AgentsCreateMcpServerAuthorizationType.js"; -export * from "./AgentsCreateMcpServerTransportType.js"; -export * from "./AgentsDataPart.js"; -export * from "./AgentsDataPartKind.js"; -export * from "./AgentsExpert.js"; -export * from "./AgentsExpertReference.js"; -export * from "./AgentsExpertReferenceType.js"; -export * from "./AgentsExpertType.js"; -export * from "./AgentsFilePart.js"; -export * from "./AgentsFilePartFile.js"; -export * from "./AgentsFilePartKind.js"; -export * from "./AgentsFileWithBytes.js"; -export * from "./AgentsFileWithUri.js"; -export * from "./AgentsMcpServer.js"; -export * from "./AgentsMcpServerAuthorizationType.js"; -export * from "./AgentsMcpServerTransportType.js"; -export * from "./AgentsMessage.js"; -export * from "./AgentsMessageKind.js"; -export * from "./AgentsMessageRole.js"; -export * from "./AgentsMessageSendConfiguration.js"; -export * from "./AgentsPart.js"; -export * from "./AgentsPushNotificationAuthenticationInfo.js"; -export * from "./AgentsPushNotificationConfig.js"; -export * from "./AgentsRegistryExpert.js"; -export * from "./AgentsRegistryExpertsResponse.js"; -export * from "./AgentsRegistryMcpServer.js"; -export * from "./AgentsRegistryMcpServerAuthorizationType.js"; -export * from "./AgentsTask.js"; -export * from "./AgentsTaskKind.js"; -export * from "./AgentsTaskStatus.js"; -export * from "./AgentsTaskStatusState.js"; -export * from "./AgentsTextPart.js"; -export * from "./AgentsTextPartKind.js"; -export * from "./AgentsUpdateExpertReference.js"; +export * from "./A2AjsonrpcResponse.js"; +export * from "./A2AjsonrpcResponseError.js"; +export * from "./A2AjsonrpcResponseId.js"; +export * from "./A2ASendMessageConfiguration.js"; +export * from "./A2ASendMessageRequest.js"; +export * from "./A2ASendMessageResponse.js"; +export * from "./A2AStreamEventResponse.js"; +export * from "./AgentCardResponse.js"; +export * from "./AgentCardResponseCapabilities.js"; +export * from "./AgentCardResponseProvider.js"; +export * from "./AgentCardResponseSignaturesItem.js"; +export * from "./AgentCardResponseSkillsItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; +export * from "./AgentsLabels.js"; +export * from "./AgentsLifecycle.js"; +export * from "./AgentsListResponse.js"; +export * from "./AgentsResponse.js"; +export * from "./AgentsUserIdValue.js"; +export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -63,20 +29,62 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; +export * from "./CommonA2AConnector.js"; +export * from "./CommonA2AConnectorCreate.js"; +export * from "./CommonAgentConnector.js"; +export * from "./CommonAgentConnectorCreate.js"; +export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; +export * from "./CommonArtifactIdValue.js"; +export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; +export * from "./CommonConnectorAuth.js"; +export * from "./CommonConnectorAuthType.js"; +export * from "./CommonConnectorCreateRequest.js"; +export * from "./CommonConnectorIdValue.js"; +export * from "./CommonConnectorResponse.js"; +export * from "./CommonConnectorType.js"; +export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; export * from "./CommonFactsContext.js"; +export * from "./CommonMcpConnector.js"; +export * from "./CommonMcpConnectorCreate.js"; +export * from "./CommonMessage.js"; +export * from "./CommonMessageIdValue.js"; +export * from "./CommonNextPageToken.js"; +export * from "./CommonPart.js"; +export * from "./CommonRegistryConnectorCreate.js"; +export * from "./CommonRegistryConnectorProvisioned.js"; +export * from "./CommonRole.js"; +export * from "./CommonSchemaConnector.js"; +export * from "./CommonSchemaConnectorCreate.js"; +export * from "./CommonSchemaConnectorCreateTransition.js"; +export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; +export * from "./CommonTaskIdValue.js"; +export * from "./CommonTaskListResponse.js"; +export * from "./CommonTaskMetadata.js"; +export * from "./CommonTaskResponse.js"; +export * from "./CommonTaskState.js"; +export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; +export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; +export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; +export * from "./ConnectorsListResponse.js"; +export * from "./Contexts.js"; +export * from "./ContextsDetailResponse.js"; +export * from "./ContextsOpenInferenceSpan.js"; +export * from "./ContextsTraceItem.js"; +export * from "./ContextsTraceItemTrace.js"; +export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -112,6 +120,15 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; +export * from "./FeedbackActor.js"; +export * from "./FeedbackIdValue.js"; +export * from "./FeedbackLabel.js"; +export * from "./FeedbackListResponse.js"; +export * from "./FeedbackMetadata.js"; +export * from "./FeedbackRating.js"; +export * from "./FeedbackRatingScale.js"; +export * from "./FeedbackResponse.js"; +export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -187,6 +204,10 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; +export * from "./RegistryConnectorCapabilities.js"; +export * from "./RegistryConnectorListResponse.js"; +export * from "./RegistryConnectorResponse.js"; +export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -273,4 +294,8 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; +export * from "./UsageBucket.js"; +export * from "./UsageGranularity.js"; +export * from "./UsageMetrics.js"; +export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/src/core/index.ts b/src/core/index.ts index e2aca287..ede84012 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -6,6 +6,7 @@ export * as logging from "./logging/index.js"; export * from "./pagination/index.js"; export * from "./runtime/index.js"; export * as serialization from "./schemas/index.js"; +export * from "./stream/index.js"; export * as url from "./url/index.js"; export * from "./utils/index.js"; export * from "./websocket/index.js"; diff --git a/src/core/stream/Stream.ts b/src/core/stream/Stream.ts new file mode 100644 index 00000000..8ccdecf9 --- /dev/null +++ b/src/core/stream/Stream.ts @@ -0,0 +1,235 @@ +import { fromJson } from "../json.js"; +import { RUNTIME } from "../runtime/index.js"; + +export declare namespace Stream { + interface Args { + /** + * The HTTP response stream to read from. + */ + + stream: ReadableStream; + + /** + * The event shape to use for parsing the stream data. + */ + eventShape: JsonEvent | SseEvent; + /** + * An abort signal to stop the stream. + */ + signal?: AbortSignal; + } + + interface JsonEvent { + type: "json"; + messageTerminator: string; + } + + interface SseEvent { + type: "sse"; + streamTerminator?: string; + eventDiscriminator?: string; + } +} + +const DATA_PREFIX = "data:"; +const EVENT_PREFIX = "event:"; + +export class Stream implements AsyncIterable { + private stream: ReadableStream; + + private parse: (val: unknown) => Promise; + /** + * The prefix to use for each message. For example, + * for SSE, the prefix is "data: ". + */ + private prefix: string | undefined; + private messageTerminator: string; + private streamTerminator: string | undefined; + private eventDiscriminator: string | undefined; + private controller: AbortController = new AbortController(); + private decoder: TextDecoder | undefined; + + constructor({ stream, parse, eventShape, signal }: Stream.Args & { parse: (val: unknown) => Promise }) { + this.stream = stream; + this.parse = parse; + if (eventShape.type === "sse") { + this.prefix = DATA_PREFIX; + this.messageTerminator = "\n"; + this.streamTerminator = eventShape.streamTerminator; + this.eventDiscriminator = eventShape.eventDiscriminator; + } else { + this.messageTerminator = eventShape.messageTerminator; + } + signal?.addEventListener("abort", () => this.controller.abort()); + + // Initialize shared TextDecoder + if (typeof TextDecoder !== "undefined") { + this.decoder = new TextDecoder("utf-8"); + } + } + + private async *iterMessages(): AsyncGenerator { + if (this.eventDiscriminator != null) { + yield* this.iterSseEvents(); + } else { + yield* this.iterDataMessages(); + } + } + + private async *iterDataMessages(): AsyncGenerator { + const stream = readableStreamAsyncIterable(this.stream); + let buf = ""; + let prefixSeen = false; + for await (const chunk of stream) { + buf += this.decodeChunk(chunk); + + let terminatorIndex: number; + while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) { + let line = buf.slice(0, terminatorIndex); + buf = buf.slice(terminatorIndex + this.messageTerminator.length); + + if (!line.trim()) { + continue; + } + + if (!prefixSeen && this.prefix != null) { + const prefixIndex = line.indexOf(this.prefix); + if (prefixIndex === -1) { + continue; + } + prefixSeen = true; + line = line.slice(prefixIndex + this.prefix.length); + } + + if (this.streamTerminator != null && line.includes(this.streamTerminator)) { + return; + } + const message = await this.parse(fromJson(line)); + yield message; + prefixSeen = false; + } + } + } + + private async *iterSseEvents(): AsyncGenerator { + const stream = readableStreamAsyncIterable(this.stream); + let buf = ""; + let eventType: string | undefined; + let dataValue: string | undefined; + + for await (const chunk of stream) { + buf += this.decodeChunk(chunk); + + let terminatorIndex: number; + while ((terminatorIndex = buf.indexOf("\n")) >= 0) { + const line = buf.slice(0, terminatorIndex).replace(/\r$/, ""); + buf = buf.slice(terminatorIndex + 1); + + if (!line.trim()) { + if (dataValue != null) { + const message = await this.dispatchSseEvent(dataValue, eventType); + if (message == null) { + return; + } + yield message; + } + eventType = undefined; + dataValue = undefined; + continue; + } + + if (line.startsWith(EVENT_PREFIX)) { + eventType = line.slice(EVENT_PREFIX.length).trim(); + } else if (line.startsWith(DATA_PREFIX)) { + const val = line.slice(DATA_PREFIX.length).trim(); + dataValue = dataValue != null ? `${dataValue}\n${val}` : val; + } + } + } + + if (dataValue != null) { + const message = await this.dispatchSseEvent(dataValue, eventType); + if (message != null) { + yield message; + } + } + } + + /** + * Parses and returns a single SSE event, or returns null if the event is a stream terminator. + */ + private async dispatchSseEvent(dataValue: string, eventType: string | undefined): Promise { + if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) { + return null; + } + return this.parse(this.injectDiscriminator(fromJson(dataValue), eventType)); + } + + private injectDiscriminator(parsed: unknown, eventType: string | undefined): unknown { + if (this.eventDiscriminator == null || eventType == null) { + return parsed; + } + if (parsed == null || typeof parsed !== "object" || Array.isArray(parsed)) { + return parsed; + } + const obj = parsed as Record; + if (this.eventDiscriminator in obj) { + return parsed; + } + return { [this.eventDiscriminator]: eventType, ...obj }; + } + + async *[Symbol.asyncIterator](): AsyncIterator { + for await (const message of this.iterMessages()) { + yield message; + } + } + + private decodeChunk(chunk: any): string { + let decoded = ""; + // If TextDecoder is available, use the streaming decoder instance + if (this.decoder != null) { + decoded += this.decoder.decode(chunk, { stream: true }); + } + // Buffer is present in Node.js environment + else if (RUNTIME.type === "node" && typeof chunk !== "undefined") { + decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); + } + return decoded; + } +} + +/** + * Browser polyfill for ReadableStream + */ +// biome-ignore lint/suspicious/noExplicitAny: allow explicit any +export function readableStreamAsyncIterable(stream: any): AsyncIterableIterator { + if (stream[Symbol.asyncIterator]) { + return stream; + } + + const reader = stream.getReader(); + return { + async next() { + try { + const result = await reader.read(); + if (result?.done) { + reader.releaseLock(); + } // release lock when stream becomes closed + return result; + } catch (e) { + reader.releaseLock(); // release lock when stream becomes errored + throw e; + } + }, + async return() { + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; + return { done: true, value: undefined }; + }, + [Symbol.asyncIterator]() { + return this; + }, + }; +} diff --git a/src/core/stream/index.ts b/src/core/stream/index.ts new file mode 100644 index 00000000..4e28b34b --- /dev/null +++ b/src/core/stream/index.ts @@ -0,0 +1 @@ +export { Stream } from "./Stream.js"; diff --git a/src/serialization/resources/agents/client/index.ts b/src/serialization/resources/agents/client/index.ts index cd155427..195f9aa8 100644 --- a/src/serialization/resources/agents/client/index.ts +++ b/src/serialization/resources/agents/client/index.ts @@ -1,2 +1 @@ -export * as list from "./list.js"; export * from "./requests/index.js"; diff --git a/src/serialization/resources/agents/client/list.ts b/src/serialization/resources/agents/client/list.ts deleted file mode 100644 index 9866ad37..00000000 --- a/src/serialization/resources/agents/client/list.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; -import { AgentsAgentResponse } from "../../../types/AgentsAgentResponse.js"; - -export const Response: core.serialization.Schema = - core.serialization.list(AgentsAgentResponse); - -export declare namespace Response { - export type Raw = AgentsAgentResponse.Raw[]; -} diff --git a/src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts b/src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts deleted file mode 100644 index a88b8561..00000000 --- a/src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import type * as serializers from "../../../../index.js"; -import { AgentsCreateMcpServer } from "../../../../types/AgentsCreateMcpServer.js"; -import { AgentsCreateAgentAgentType } from "../../types/AgentsCreateAgentAgentType.js"; -import { AgentsCreateAgentExpertsItem } from "../../types/AgentsCreateAgentExpertsItem.js"; - -export const AgentsCreateAgent: core.serialization.Schema< - serializers.AgentsCreateAgent.Raw, - Omit -> = core.serialization.object({ - name: core.serialization.string(), - agentType: AgentsCreateAgentAgentType.optional(), - systemPrompt: core.serialization.string().optional(), - description: core.serialization.string(), - experts: core.serialization.list(AgentsCreateAgentExpertsItem).optional(), - mcpServers: core.serialization.list(AgentsCreateMcpServer).optional(), -}); - -export declare namespace AgentsCreateAgent { - export interface Raw { - name: string; - agentType?: AgentsCreateAgentAgentType.Raw | null; - systemPrompt?: string | null; - description: string; - experts?: AgentsCreateAgentExpertsItem.Raw[] | null; - mcpServers?: AgentsCreateMcpServer.Raw[] | null; - } -} diff --git a/src/serialization/resources/agents/client/requests/AgentsCreateRequest.ts b/src/serialization/resources/agents/client/requests/AgentsCreateRequest.ts new file mode 100644 index 00000000..20e0706e --- /dev/null +++ b/src/serialization/resources/agents/client/requests/AgentsCreateRequest.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { AgentsLabels } from "../../../../types/AgentsLabels.js"; +import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; +import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; +import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; + +export const AgentsCreateRequest: core.serialization.Schema< + serializers.AgentsCreateRequest.Raw, + Corti.AgentsCreateRequest +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + systemPrompt: core.serialization.string().optional(), + model: core.serialization.string().optional(), + visibility: AgentsVisibility.optional(), + lifecycle: AgentsLifecycle.optional(), + connectors: core.serialization.list(CommonConnectorCreateRequest).optional(), + labels: AgentsLabels.optional(), +}); + +export declare namespace AgentsCreateRequest { + export interface Raw { + name: string; + description?: string | null; + systemPrompt?: string | null; + model?: string | null; + visibility?: AgentsVisibility.Raw | null; + lifecycle?: AgentsLifecycle.Raw | null; + connectors?: CommonConnectorCreateRequest.Raw[] | null; + labels?: AgentsLabels.Raw | null; + } +} diff --git a/src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts b/src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts deleted file mode 100644 index 24247fb7..00000000 --- a/src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import type * as serializers from "../../../../index.js"; -import { AgentsMessage } from "../../../../types/AgentsMessage.js"; -import { AgentsMessageSendConfiguration } from "../../../../types/AgentsMessageSendConfiguration.js"; - -export const AgentsMessageSendParams: core.serialization.Schema< - serializers.AgentsMessageSendParams.Raw, - Corti.AgentsMessageSendParams -> = core.serialization.object({ - message: AgentsMessage, - configuration: AgentsMessageSendConfiguration.optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace AgentsMessageSendParams { - export interface Raw { - message: AgentsMessage.Raw; - configuration?: AgentsMessageSendConfiguration.Raw | null; - metadata?: Record | null; - } -} diff --git a/src/serialization/resources/agents/client/requests/AgentsPatchRequest.ts b/src/serialization/resources/agents/client/requests/AgentsPatchRequest.ts new file mode 100644 index 00000000..0eb9f11e --- /dev/null +++ b/src/serialization/resources/agents/client/requests/AgentsPatchRequest.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; +import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; +import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; + +export const AgentsPatchRequest: core.serialization.Schema< + serializers.AgentsPatchRequest.Raw, + Corti.AgentsPatchRequest +> = core.serialization.object({ + name: core.serialization.string().optional(), + description: core.serialization.string().optionalNullable(), + systemPrompt: core.serialization.string().optionalNullable(), + model: core.serialization.string().optionalNullable(), + visibility: AgentsVisibility.optional(), + lifecycle: AgentsLifecycle.optional(), + connectors: core.serialization.list(CommonConnectorCreateRequest).optionalNullable(), + labels: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), +}); + +export declare namespace AgentsPatchRequest { + export interface Raw { + name?: string | null; + description?: (string | null | undefined) | null; + systemPrompt?: (string | null | undefined) | null; + model?: (string | null | undefined) | null; + visibility?: AgentsVisibility.Raw | null; + lifecycle?: AgentsLifecycle.Raw | null; + connectors?: (CommonConnectorCreateRequest.Raw[] | null | undefined) | null; + labels?: (Record | null | undefined) | null; + } +} diff --git a/src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts b/src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts deleted file mode 100644 index 236a7dcf..00000000 --- a/src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import type * as serializers from "../../../../index.js"; -import { AgentsCreateMcpServer } from "../../../../types/AgentsCreateMcpServer.js"; -import { AgentsUpdateAgentExpertsItem } from "../../types/AgentsUpdateAgentExpertsItem.js"; - -export const AgentsUpdateAgent: core.serialization.Schema = - core.serialization.object({ - name: core.serialization.string().optional(), - systemPrompt: core.serialization.string().optional(), - description: core.serialization.string().optional(), - experts: core.serialization.list(AgentsUpdateAgentExpertsItem).optional(), - mcpServers: core.serialization.list(AgentsCreateMcpServer).optional(), - }); - -export declare namespace AgentsUpdateAgent { - export interface Raw { - name?: string | null; - systemPrompt?: string | null; - description?: string | null; - experts?: AgentsUpdateAgentExpertsItem.Raw[] | null; - mcpServers?: AgentsCreateMcpServer.Raw[] | null; - } -} diff --git a/src/serialization/resources/agents/client/requests/index.ts b/src/serialization/resources/agents/client/requests/index.ts index 36d03a60..d89fef23 100644 --- a/src/serialization/resources/agents/client/requests/index.ts +++ b/src/serialization/resources/agents/client/requests/index.ts @@ -1,3 +1,2 @@ -export { AgentsCreateAgent } from "./AgentsCreateAgent.js"; -export { AgentsMessageSendParams } from "./AgentsMessageSendParams.js"; -export { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; +export { AgentsCreateRequest } from "./AgentsCreateRequest.js"; +export { AgentsPatchRequest } from "./AgentsPatchRequest.js"; diff --git a/src/serialization/resources/agents/index.ts b/src/serialization/resources/agents/index.ts index d9adb1af..9eb1192d 100644 --- a/src/serialization/resources/agents/index.ts +++ b/src/serialization/resources/agents/index.ts @@ -1,2 +1,2 @@ export * from "./client/index.js"; -export * from "./types/index.js"; +export * from "./resources/index.js"; diff --git a/src/serialization/resources/agents/resources/a2A/client/index.ts b/src/serialization/resources/agents/resources/a2A/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agents/resources/a2A/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/serialization/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts new file mode 100644 index 00000000..2804a374 --- /dev/null +++ b/src/serialization/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../../api/index.js"; +import * as core from "../../../../../../../core/index.js"; +import type * as serializers from "../../../../../../index.js"; +import { A2AjsonrpcRequestId } from "../../types/A2AjsonrpcRequestId.js"; +import { A2AjsonrpcRequestMethod } from "../../types/A2AjsonrpcRequestMethod.js"; + +export const A2AjsonrpcRequest: core.serialization.Schema< + serializers.agents.A2AjsonrpcRequest.Raw, + Corti.agents.A2AjsonrpcRequest +> = core.serialization.object({ + id: A2AjsonrpcRequestId, + method: A2AjsonrpcRequestMethod, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace A2AjsonrpcRequest { + export interface Raw { + id: A2AjsonrpcRequestId.Raw; + method: A2AjsonrpcRequestMethod.Raw; + params?: Record | null; + } +} diff --git a/src/serialization/resources/agents/resources/a2A/client/requests/index.ts b/src/serialization/resources/agents/resources/a2A/client/requests/index.ts new file mode 100644 index 00000000..0d1476bd --- /dev/null +++ b/src/serialization/resources/agents/resources/a2A/client/requests/index.ts @@ -0,0 +1 @@ +export { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/serialization/resources/agents/resources/a2A/index.ts b/src/serialization/resources/agents/resources/a2A/index.ts new file mode 100644 index 00000000..d9adb1af --- /dev/null +++ b/src/serialization/resources/agents/resources/a2A/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts new file mode 100644 index 00000000..d178c54e --- /dev/null +++ b/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../api/index.js"; +import * as core from "../../../../../../core/index.js"; +import type * as serializers from "../../../../../index.js"; + +export const A2AjsonrpcRequestId: core.serialization.Schema< + serializers.agents.A2AjsonrpcRequestId.Raw, + Corti.agents.A2AjsonrpcRequestId +> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); + +export declare namespace A2AjsonrpcRequestId { + export type Raw = string | number; +} diff --git a/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts new file mode 100644 index 00000000..864138a9 --- /dev/null +++ b/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../api/index.js"; +import * as core from "../../../../../../core/index.js"; +import type * as serializers from "../../../../../index.js"; + +export const A2AjsonrpcRequestMethod: core.serialization.Schema< + serializers.agents.A2AjsonrpcRequestMethod.Raw, + Corti.agents.A2AjsonrpcRequestMethod +> = core.serialization.enum_([ + "SendMessage", + "SendStreamingMessage", + "GetTask", + "ListTasks", + "CancelTask", + "SubscribeToTask", +]); + +export declare namespace A2AjsonrpcRequestMethod { + export type Raw = + | "SendMessage" + | "SendStreamingMessage" + | "GetTask" + | "ListTasks" + | "CancelTask" + | "SubscribeToTask"; +} diff --git a/src/serialization/resources/agents/resources/a2A/types/index.ts b/src/serialization/resources/agents/resources/a2A/types/index.ts new file mode 100644 index 00000000..d506c662 --- /dev/null +++ b/src/serialization/resources/agents/resources/a2A/types/index.ts @@ -0,0 +1,2 @@ +export * from "./A2AjsonrpcRequestId.js"; +export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/serialization/resources/agents/resources/feedback/client/index.ts b/src/serialization/resources/agents/resources/feedback/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agents/resources/feedback/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/serialization/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts new file mode 100644 index 00000000..66a94352 --- /dev/null +++ b/src/serialization/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../../api/index.js"; +import * as core from "../../../../../../../core/index.js"; +import type * as serializers from "../../../../../../index.js"; +import { FeedbackLabel } from "../../../../../../types/FeedbackLabel.js"; +import { FeedbackMetadata } from "../../../../../../types/FeedbackMetadata.js"; +import { FeedbackRating } from "../../../../../../types/FeedbackRating.js"; +import { FeedbackTarget } from "../../../../../../types/FeedbackTarget.js"; + +export const FeedbackCreateRequest: core.serialization.Schema< + serializers.agents.FeedbackCreateRequest.Raw, + Corti.agents.FeedbackCreateRequest +> = core.serialization.object({ + rating: FeedbackRating, + labels: core.serialization.list(FeedbackLabel).optional(), + reason: core.serialization.string().optional(), + target: FeedbackTarget.optional(), + metadata: FeedbackMetadata.optional(), +}); + +export declare namespace FeedbackCreateRequest { + export interface Raw { + rating: FeedbackRating.Raw; + labels?: FeedbackLabel.Raw[] | null; + reason?: string | null; + target?: FeedbackTarget.Raw | null; + metadata?: FeedbackMetadata.Raw | null; + } +} diff --git a/src/serialization/resources/agents/resources/feedback/client/requests/index.ts b/src/serialization/resources/agents/resources/feedback/client/requests/index.ts new file mode 100644 index 00000000..f8353681 --- /dev/null +++ b/src/serialization/resources/agents/resources/feedback/client/requests/index.ts @@ -0,0 +1 @@ +export { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/serialization/resources/agents/resources/feedback/index.ts b/src/serialization/resources/agents/resources/feedback/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/serialization/resources/agents/resources/feedback/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/serialization/resources/agents/resources/index.ts b/src/serialization/resources/agents/resources/index.ts new file mode 100644 index 00000000..6ab20411 --- /dev/null +++ b/src/serialization/resources/agents/resources/index.ts @@ -0,0 +1,5 @@ +export * from "./a2A/client/requests/index.js"; +export * as a2A from "./a2A/index.js"; +export * from "./a2A/types/index.js"; +export * from "./feedback/client/requests/index.js"; +export * as feedback from "./feedback/index.js"; diff --git a/src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts b/src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts deleted file mode 100644 index 831b82a0..00000000 --- a/src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; - -export const AgentsCreateAgentAgentType: core.serialization.Schema< - serializers.AgentsCreateAgentAgentType.Raw, - Corti.AgentsCreateAgentAgentType -> = core.serialization.enum_(["expert", "orchestrator", "interviewing-expert"]); - -export declare namespace AgentsCreateAgentAgentType { - export type Raw = "expert" | "orchestrator" | "interviewing-expert"; -} diff --git a/src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts b/src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts deleted file mode 100644 index 8e113572..00000000 --- a/src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; -import { AgentsCreateExpert } from "../../../types/AgentsCreateExpert.js"; -import { AgentsCreateExpertReference } from "../../../types/AgentsCreateExpertReference.js"; - -export const AgentsCreateAgentExpertsItem: core.serialization.Schema< - serializers.AgentsCreateAgentExpertsItem.Raw, - Corti.AgentsCreateAgentExpertsItem -> = core.serialization.undiscriminatedUnion([AgentsCreateExpert, AgentsCreateExpertReference]); - -export declare namespace AgentsCreateAgentExpertsItem { - export type Raw = AgentsCreateExpert.Raw | AgentsCreateExpertReference.Raw; -} diff --git a/src/serialization/resources/agents/types/AgentsMessageSendResponse.ts b/src/serialization/resources/agents/types/AgentsMessageSendResponse.ts deleted file mode 100644 index 9e7b74db..00000000 --- a/src/serialization/resources/agents/types/AgentsMessageSendResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; -import { AgentsMessage } from "../../../types/AgentsMessage.js"; -import { AgentsTask } from "../../../types/AgentsTask.js"; - -export const AgentsMessageSendResponse: core.serialization.ObjectSchema< - serializers.AgentsMessageSendResponse.Raw, - Corti.AgentsMessageSendResponse -> = core.serialization.object({ - message: AgentsMessage.optional(), - task: AgentsTask.optional(), -}); - -export declare namespace AgentsMessageSendResponse { - export interface Raw { - message?: AgentsMessage.Raw | null; - task?: AgentsTask.Raw | null; - } -} diff --git a/src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts b/src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts deleted file mode 100644 index e9c42deb..00000000 --- a/src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; -import { AgentsCreateExpert } from "../../../types/AgentsCreateExpert.js"; -import { AgentsUpdateExpertReference } from "../../../types/AgentsUpdateExpertReference.js"; - -export const AgentsUpdateAgentExpertsItem: core.serialization.Schema< - serializers.AgentsUpdateAgentExpertsItem.Raw, - Corti.AgentsUpdateAgentExpertsItem -> = core.serialization.undiscriminatedUnion([AgentsCreateExpert, AgentsUpdateExpertReference]); - -export declare namespace AgentsUpdateAgentExpertsItem { - export type Raw = AgentsCreateExpert.Raw | AgentsUpdateExpertReference.Raw; -} diff --git a/src/serialization/resources/agents/types/index.ts b/src/serialization/resources/agents/types/index.ts deleted file mode 100644 index 50610a88..00000000 --- a/src/serialization/resources/agents/types/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./AgentsCreateAgentAgentType.js"; -export * from "./AgentsCreateAgentExpertsItem.js"; -export * from "./AgentsMessageSendResponse.js"; -export * from "./AgentsUpdateAgentExpertsItem.js"; diff --git a/src/serialization/resources/auth/types/AuthTokenRequestBody.ts b/src/serialization/resources/auth/types/AuthTokenRequest.ts similarity index 70% rename from src/serialization/resources/auth/types/AuthTokenRequestBody.ts rename to src/serialization/resources/auth/types/AuthTokenRequest.ts index cd65369e..9bb52270 100644 --- a/src/serialization/resources/auth/types/AuthTokenRequestBody.ts +++ b/src/serialization/resources/auth/types/AuthTokenRequest.ts @@ -9,18 +9,16 @@ import { AuthTokenRequestClientCredentials } from "../../../types/AuthTokenReque import { AuthTokenRequestRefresh } from "../../../types/AuthTokenRequestRefresh.js"; import { AuthTokenRequestRopc } from "../../../types/AuthTokenRequestRopc.js"; -export const AuthTokenRequestBody: core.serialization.Schema< - serializers.AuthTokenRequestBody.Raw, - Corti.AuthTokenRequestBody -> = core.serialization.undiscriminatedUnion([ - AuthTokenRequestClientCredentials, - AuthTokenRequestAuthorizationCode, - AuthTokenRequestAuthorizationPkce, - AuthTokenRequestRopc, - AuthTokenRequestRefresh, -]); +export const AuthTokenRequest: core.serialization.Schema = + core.serialization.undiscriminatedUnion([ + AuthTokenRequestClientCredentials, + AuthTokenRequestAuthorizationCode, + AuthTokenRequestAuthorizationPkce, + AuthTokenRequestRopc, + AuthTokenRequestRefresh, + ]); -export declare namespace AuthTokenRequestBody { +export declare namespace AuthTokenRequest { export type Raw = | AuthTokenRequestClientCredentials.Raw | AuthTokenRequestAuthorizationCode.Raw diff --git a/src/serialization/resources/auth/types/index.ts b/src/serialization/resources/auth/types/index.ts index 536709bd..c07e19c2 100644 --- a/src/serialization/resources/auth/types/index.ts +++ b/src/serialization/resources/auth/types/index.ts @@ -1 +1 @@ -export * from "./AuthTokenRequestBody.js"; +export * from "./AuthTokenRequest.js"; diff --git a/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts b/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts index 3470e074..52169fbc 100644 --- a/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts +++ b/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts @@ -9,7 +9,7 @@ import { CommonCodingSystemEnum } from "../../../../types/CommonCodingSystemEnum export const CodesGeneralPredictRequest: core.serialization.Schema< serializers.CodesGeneralPredictRequest.Raw, - Corti.CodesGeneralPredictRequest + Omit > = core.serialization.object({ system: core.serialization.list(CommonCodingSystemEnum), context: core.serialization.list(CommonAiContext), diff --git a/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts b/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts index bf1bf144..03f46c56 100644 --- a/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts +++ b/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts @@ -7,7 +7,7 @@ import { DocumentsSectionInput } from "../../../../types/DocumentsSectionInput.j export const DocumentsUpdateRequest: core.serialization.Schema< serializers.DocumentsUpdateRequest.Raw, - Corti.DocumentsUpdateRequest + Omit > = core.serialization.object({ name: core.serialization.string().optional(), sections: core.serialization.list(DocumentsSectionInput).optional(), diff --git a/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts b/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts index 1a39e5e7..d8f1bb55 100644 --- a/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts +++ b/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts @@ -7,7 +7,7 @@ import { GuidedLabel } from "../../../../../../types/GuidedLabel.js"; export const GuidedSectionsUpdateRequest: core.serialization.Schema< serializers.documents.GuidedSectionsUpdateRequest.Raw, - Corti.documents.GuidedSectionsUpdateRequest + Omit > = core.serialization.object({ name: core.serialization.string().optional(), description: core.serialization.string().optional(), diff --git a/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts b/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts index 64e4fc1c..f87356df 100644 --- a/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts +++ b/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts @@ -7,7 +7,7 @@ import { GuidedSectionGenerationPartial } from "../../../../../../../../types/Gu export const GuidedSectionsCreateVersionRequest: core.serialization.Schema< serializers.documents.sections.GuidedSectionsCreateVersionRequest.Raw, - Corti.documents.sections.GuidedSectionsCreateVersionRequest + Omit > = core.serialization.object({ generation: GuidedSectionGenerationPartial, }); diff --git a/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts b/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts index 458ac07a..8b1bbb17 100644 --- a/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts +++ b/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts @@ -7,7 +7,7 @@ import { GuidedLabel } from "../../../../../../types/GuidedLabel.js"; export const GuidedTemplatesUpdateRequest: core.serialization.Schema< serializers.documents.GuidedTemplatesUpdateRequest.Raw, - Corti.documents.GuidedTemplatesUpdateRequest + Omit > = core.serialization.object({ name: core.serialization.string().optional(), description: core.serialization.string().optional(), diff --git a/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts b/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts index 2e55d23f..6a9c00f7 100644 --- a/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts +++ b/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts @@ -7,7 +7,7 @@ import { GuidedTemplatesVersionGeneration } from "../../../../../../../../types/ export const GuidedTemplatesCreateVersionRequest: core.serialization.Schema< serializers.documents.templates.GuidedTemplatesCreateVersionRequest.Raw, - Corti.documents.templates.GuidedTemplatesCreateVersionRequest + Omit > = core.serialization.object({ generation: GuidedTemplatesVersionGeneration, }); diff --git a/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts b/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts index ca29f0ab..22a8a9db 100644 --- a/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts @@ -7,7 +7,7 @@ import { FactsBatchUpdateInput } from "../../../../types/FactsBatchUpdateInput.j export const FactsBatchUpdateRequest: core.serialization.Schema< serializers.FactsBatchUpdateRequest.Raw, - Corti.FactsBatchUpdateRequest + Omit > = core.serialization.object({ facts: core.serialization.list(FactsBatchUpdateInput), }); diff --git a/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts b/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts index 3ff375df..bef3ee20 100644 --- a/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts @@ -7,7 +7,7 @@ import { FactsCreateInput } from "../../../../types/FactsCreateInput.js"; export const FactsCreateRequest: core.serialization.Schema< serializers.FactsCreateRequest.Raw, - Corti.FactsCreateRequest + Omit > = core.serialization.object({ facts: core.serialization.list(FactsCreateInput), }); diff --git a/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts b/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts index ceb6246c..a6225259 100644 --- a/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts @@ -7,7 +7,7 @@ import { CommonTextContext } from "../../../../types/CommonTextContext.js"; export const FactsExtractRequest: core.serialization.Schema< serializers.FactsExtractRequest.Raw, - Corti.FactsExtractRequest + Omit > = core.serialization.object({ context: core.serialization.list(CommonTextContext), outputLanguage: core.serialization.string(), diff --git a/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts b/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts index 5feb287f..09dc5ba7 100644 --- a/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts @@ -7,7 +7,7 @@ import { CommonSourceEnum } from "../../../../types/CommonSourceEnum.js"; export const FactsUpdateRequest: core.serialization.Schema< serializers.FactsUpdateRequest.Raw, - Corti.FactsUpdateRequest + Omit > = core.serialization.object({ text: core.serialization.string().optional(), group: core.serialization.string().optional(), diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index c2b155f9..cd58cbaa 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,6 +1,5 @@ export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; -export * from "./agents/types/index.js"; export * as auth from "./auth/index.js"; export * from "./auth/types/index.js"; export * from "./codes/client/requests/index.js"; diff --git a/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts b/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts index def31f5f..4c248a2e 100644 --- a/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts +++ b/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts @@ -9,7 +9,7 @@ import { Uuid } from "../../../../types/Uuid.js"; export const InteractionsCreateRequest: core.serialization.Schema< serializers.InteractionsCreateRequest.Raw, - Corti.InteractionsCreateRequest + Omit > = core.serialization.object({ assignedUserId: Uuid.optional(), encounter: InteractionsEncounterCreateRequest, diff --git a/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts b/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts index 19d78173..b0485a56 100644 --- a/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts +++ b/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts @@ -9,7 +9,7 @@ import { Uuid } from "../../../../types/Uuid.js"; export const InteractionsUpdateRequest: core.serialization.Schema< serializers.InteractionsUpdateRequest.Raw, - Corti.InteractionsUpdateRequest + Omit > = core.serialization.object({ assignedUserId: Uuid.optional(), encounter: InteractionsEncounterUpdateRequest.optional(), diff --git a/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts b/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts index ad97965b..242d61c0 100644 --- a/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts +++ b/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts @@ -10,7 +10,7 @@ import { TranscriptsCreateRequestReplacementsItem } from "../../types/Transcript export const TranscriptsCreateRequest: core.serialization.Schema< serializers.TranscriptsCreateRequest.Raw, - Corti.TranscriptsCreateRequest + Omit > = core.serialization.object({ recordingId: Uuid, primaryLanguage: core.serialization.string(), diff --git a/src/serialization/types/A2ASendMessageConfiguration.ts b/src/serialization/types/A2ASendMessageConfiguration.ts new file mode 100644 index 00000000..8ce31b82 --- /dev/null +++ b/src/serialization/types/A2ASendMessageConfiguration.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2ASendMessageConfiguration: core.serialization.ObjectSchema< + serializers.A2ASendMessageConfiguration.Raw, + Corti.A2ASendMessageConfiguration +> = core.serialization.object({ + returnImmediately: core.serialization.boolean().optional(), + historyLength: core.serialization.number().optional(), + acceptedOutputModes: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace A2ASendMessageConfiguration { + export interface Raw { + returnImmediately?: boolean | null; + historyLength?: number | null; + acceptedOutputModes?: string[] | null; + } +} diff --git a/src/serialization/types/A2ASendMessageRequest.ts b/src/serialization/types/A2ASendMessageRequest.ts new file mode 100644 index 00000000..d29c28b3 --- /dev/null +++ b/src/serialization/types/A2ASendMessageRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { A2ASendMessageConfiguration } from "./A2ASendMessageConfiguration.js"; +import { CommonMessage } from "./CommonMessage.js"; + +export const A2ASendMessageRequest: core.serialization.ObjectSchema< + serializers.A2ASendMessageRequest.Raw, + Corti.A2ASendMessageRequest +> = core.serialization.object({ + message: CommonMessage, + configuration: A2ASendMessageConfiguration.optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + tenant: core.serialization.string().optional(), +}); + +export declare namespace A2ASendMessageRequest { + export interface Raw { + message: CommonMessage.Raw; + configuration?: A2ASendMessageConfiguration.Raw | null; + metadata?: Record | null; + tenant?: string | null; + } +} diff --git a/src/serialization/types/A2ASendMessageResponse.ts b/src/serialization/types/A2ASendMessageResponse.ts new file mode 100644 index 00000000..56e39b4a --- /dev/null +++ b/src/serialization/types/A2ASendMessageResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2ASendMessageResponse: core.serialization.Schema< + serializers.A2ASendMessageResponse.Raw, + Corti.A2ASendMessageResponse +> = core.serialization.undiscriminatedUnion([core.serialization.unknown()]); + +export declare namespace A2ASendMessageResponse { + export type Raw = unknown; +} diff --git a/src/serialization/types/A2AStreamEventResponse.ts b/src/serialization/types/A2AStreamEventResponse.ts new file mode 100644 index 00000000..73657388 --- /dev/null +++ b/src/serialization/types/A2AStreamEventResponse.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2AStreamEventResponse: core.serialization.ObjectSchema< + serializers.A2AStreamEventResponse.Raw, + Corti.A2AStreamEventResponse +> = core.serialization.object({ + data: core.serialization.string().optional(), + event: core.serialization.string().optional(), + id: core.serialization.string().optional(), + retry: core.serialization.number().optional(), +}); + +export declare namespace A2AStreamEventResponse { + export interface Raw { + data?: string | null; + event?: string | null; + id?: string | null; + retry?: number | null; + } +} diff --git a/src/serialization/types/A2AjsonrpcResponse.ts b/src/serialization/types/A2AjsonrpcResponse.ts new file mode 100644 index 00000000..1192314a --- /dev/null +++ b/src/serialization/types/A2AjsonrpcResponse.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { A2AjsonrpcResponseError } from "./A2AjsonrpcResponseError.js"; +import { A2AjsonrpcResponseId } from "./A2AjsonrpcResponseId.js"; + +export const A2AjsonrpcResponse: core.serialization.ObjectSchema< + serializers.A2AjsonrpcResponse.Raw, + Corti.A2AjsonrpcResponse +> = core.serialization.object({ + jsonrpc: core.serialization.stringLiteral("2.0"), + id: A2AjsonrpcResponseId.nullable(), + result: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + error: A2AjsonrpcResponseError.optional(), +}); + +export declare namespace A2AjsonrpcResponse { + export interface Raw { + jsonrpc: "2.0"; + id?: A2AjsonrpcResponseId.Raw | null; + result?: Record | null; + error?: A2AjsonrpcResponseError.Raw | null; + } +} diff --git a/src/serialization/types/A2AjsonrpcResponseError.ts b/src/serialization/types/A2AjsonrpcResponseError.ts new file mode 100644 index 00000000..a5c9e8ee --- /dev/null +++ b/src/serialization/types/A2AjsonrpcResponseError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2AjsonrpcResponseError: core.serialization.ObjectSchema< + serializers.A2AjsonrpcResponseError.Raw, + Corti.A2AjsonrpcResponseError +> = core.serialization.object({ + code: core.serialization.number(), + message: core.serialization.string(), + data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace A2AjsonrpcResponseError { + export interface Raw { + code: number; + message: string; + data?: Record | null; + } +} diff --git a/src/serialization/types/A2AjsonrpcResponseId.ts b/src/serialization/types/A2AjsonrpcResponseId.ts new file mode 100644 index 00000000..86944630 --- /dev/null +++ b/src/serialization/types/A2AjsonrpcResponseId.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2AjsonrpcResponseId: core.serialization.Schema< + serializers.A2AjsonrpcResponseId.Raw, + Corti.A2AjsonrpcResponseId +> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); + +export declare namespace A2AjsonrpcResponseId { + export type Raw = string | number; +} diff --git a/src/serialization/types/AgentCardResponse.ts b/src/serialization/types/AgentCardResponse.ts new file mode 100644 index 00000000..febe4c51 --- /dev/null +++ b/src/serialization/types/AgentCardResponse.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentCardResponseCapabilities } from "./AgentCardResponseCapabilities.js"; +import { AgentCardResponseProvider } from "./AgentCardResponseProvider.js"; +import { AgentCardResponseSignaturesItem } from "./AgentCardResponseSignaturesItem.js"; +import { AgentCardResponseSkillsItem } from "./AgentCardResponseSkillsItem.js"; +import { AgentCardResponseSupportedInterfacesItem } from "./AgentCardResponseSupportedInterfacesItem.js"; + +export const AgentCardResponse: core.serialization.ObjectSchema< + serializers.AgentCardResponse.Raw, + Corti.AgentCardResponse +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + documentationUrl: core.serialization.string().optional(), + iconUrl: core.serialization.string().optional(), + version: core.serialization.string(), + capabilities: AgentCardResponseCapabilities, + defaultInputModes: core.serialization.list(core.serialization.string()).optional(), + defaultOutputModes: core.serialization.list(core.serialization.string()).optional(), + provider: AgentCardResponseProvider.optional(), + securityRequirements: core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optional(), + securitySchemes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + signatures: core.serialization.list(AgentCardResponseSignaturesItem).optional(), + skills: core.serialization.list(AgentCardResponseSkillsItem).optional(), + supportedInterfaces: core.serialization.list(AgentCardResponseSupportedInterfacesItem), +}); + +export declare namespace AgentCardResponse { + export interface Raw { + name: string; + description?: string | null; + documentationUrl?: string | null; + iconUrl?: string | null; + version: string; + capabilities: AgentCardResponseCapabilities.Raw; + defaultInputModes?: string[] | null; + defaultOutputModes?: string[] | null; + provider?: AgentCardResponseProvider.Raw | null; + securityRequirements?: Record[] | null; + securitySchemes?: Record | null; + signatures?: AgentCardResponseSignaturesItem.Raw[] | null; + skills?: AgentCardResponseSkillsItem.Raw[] | null; + supportedInterfaces: AgentCardResponseSupportedInterfacesItem.Raw[]; + } +} diff --git a/src/serialization/types/AgentCardResponseCapabilities.ts b/src/serialization/types/AgentCardResponseCapabilities.ts new file mode 100644 index 00000000..cba74d0f --- /dev/null +++ b/src/serialization/types/AgentCardResponseCapabilities.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseCapabilities: core.serialization.ObjectSchema< + serializers.AgentCardResponseCapabilities.Raw, + Corti.AgentCardResponseCapabilities +> = core.serialization.object({ + streaming: core.serialization.boolean().optional(), + pushNotifications: core.serialization.boolean().optional(), +}); + +export declare namespace AgentCardResponseCapabilities { + export interface Raw { + streaming?: boolean | null; + pushNotifications?: boolean | null; + } +} diff --git a/src/serialization/types/AgentCardResponseProvider.ts b/src/serialization/types/AgentCardResponseProvider.ts new file mode 100644 index 00000000..fb0d635e --- /dev/null +++ b/src/serialization/types/AgentCardResponseProvider.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseProvider: core.serialization.ObjectSchema< + serializers.AgentCardResponseProvider.Raw, + Corti.AgentCardResponseProvider +> = core.serialization.object({ + organization: core.serialization.string().optional(), + url: core.serialization.string().optional(), +}); + +export declare namespace AgentCardResponseProvider { + export interface Raw { + organization?: string | null; + url?: string | null; + } +} diff --git a/src/serialization/types/AgentsAgentCardSignature.ts b/src/serialization/types/AgentCardResponseSignaturesItem.ts similarity index 71% rename from src/serialization/types/AgentsAgentCardSignature.ts rename to src/serialization/types/AgentCardResponseSignaturesItem.ts index b9bd1fd0..c86627a0 100644 --- a/src/serialization/types/AgentsAgentCardSignature.ts +++ b/src/serialization/types/AgentCardResponseSignaturesItem.ts @@ -4,19 +4,19 @@ import type * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -export const AgentsAgentCardSignature: core.serialization.ObjectSchema< - serializers.AgentsAgentCardSignature.Raw, - Corti.AgentsAgentCardSignature +export const AgentCardResponseSignaturesItem: core.serialization.ObjectSchema< + serializers.AgentCardResponseSignaturesItem.Raw, + Corti.AgentCardResponseSignaturesItem > = core.serialization.object({ protected: core.serialization.string(), - signature: core.serialization.string(), header: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + signature: core.serialization.string(), }); -export declare namespace AgentsAgentCardSignature { +export declare namespace AgentCardResponseSignaturesItem { export interface Raw { protected: string; - signature: string; header?: Record | null; + signature: string; } } diff --git a/src/serialization/types/AgentCardResponseSkillsItem.ts b/src/serialization/types/AgentCardResponseSkillsItem.ts new file mode 100644 index 00000000..839caaa2 --- /dev/null +++ b/src/serialization/types/AgentCardResponseSkillsItem.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseSkillsItem: core.serialization.ObjectSchema< + serializers.AgentCardResponseSkillsItem.Raw, + Corti.AgentCardResponseSkillsItem +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string().optional(), + tags: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace AgentCardResponseSkillsItem { + export interface Raw { + id: string; + name: string; + description?: string | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts new file mode 100644 index 00000000..b9ce417c --- /dev/null +++ b/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentCardResponseSupportedInterfacesItemProtocolBinding } from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; + +export const AgentCardResponseSupportedInterfacesItem: core.serialization.ObjectSchema< + serializers.AgentCardResponseSupportedInterfacesItem.Raw, + Corti.AgentCardResponseSupportedInterfacesItem +> = core.serialization.object({ + protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding, + protocolVersion: core.serialization.stringLiteral("1.0"), + url: core.serialization.string(), +}); + +export declare namespace AgentCardResponseSupportedInterfacesItem { + export interface Raw { + protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw; + protocolVersion: "1.0"; + url: string; + } +} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts new file mode 100644 index 00000000..cd155f3e --- /dev/null +++ b/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseSupportedInterfacesItemProtocolBinding: core.serialization.Schema< + serializers.AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw, + Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding +> = core.serialization.enum_(["JSONRPC", "HTTP+JSON"]); + +export declare namespace AgentCardResponseSupportedInterfacesItemProtocolBinding { + export type Raw = "JSONRPC" | "HTTP+JSON"; +} diff --git a/src/serialization/types/AgentsAgent.ts b/src/serialization/types/AgentsAgent.ts deleted file mode 100644 index adc5eaf5..00000000 --- a/src/serialization/types/AgentsAgent.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsAgentExpertsItem } from "./AgentsAgentExpertsItem.js"; -import { AgentsMcpServer } from "./AgentsMcpServer.js"; - -export const AgentsAgent: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string(), - name: core.serialization.string(), - description: core.serialization.string(), - systemPrompt: core.serialization.string(), - experts: core.serialization.list(AgentsAgentExpertsItem).optional(), - mcpServers: core.serialization.list(AgentsMcpServer).optional(), - }); - -export declare namespace AgentsAgent { - export interface Raw { - id: string; - name: string; - description: string; - systemPrompt: string; - experts?: AgentsAgentExpertsItem.Raw[] | null; - mcpServers?: AgentsMcpServer.Raw[] | null; - } -} diff --git a/src/serialization/types/AgentsAgentCapabilities.ts b/src/serialization/types/AgentsAgentCapabilities.ts deleted file mode 100644 index 93e62f14..00000000 --- a/src/serialization/types/AgentsAgentCapabilities.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsAgentExtension } from "./AgentsAgentExtension.js"; - -export const AgentsAgentCapabilities: core.serialization.ObjectSchema< - serializers.AgentsAgentCapabilities.Raw, - Corti.AgentsAgentCapabilities -> = core.serialization.object({ - streaming: core.serialization.boolean().optional(), - pushNotifications: core.serialization.boolean().optional(), - stateTransitionHistory: core.serialization.boolean().optional(), - extensions: core.serialization.list(AgentsAgentExtension).optionalNullable(), -}); - -export declare namespace AgentsAgentCapabilities { - export interface Raw { - streaming?: boolean | null; - pushNotifications?: boolean | null; - stateTransitionHistory?: boolean | null; - extensions?: (AgentsAgentExtension.Raw[] | null | undefined) | null; - } -} diff --git a/src/serialization/types/AgentsAgentCard.ts b/src/serialization/types/AgentsAgentCard.ts deleted file mode 100644 index 8ed7e6a5..00000000 --- a/src/serialization/types/AgentsAgentCard.ts +++ /dev/null @@ -1,59 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsAgentCapabilities } from "./AgentsAgentCapabilities.js"; -import { AgentsAgentCardSignature } from "./AgentsAgentCardSignature.js"; -import { AgentsAgentInterface } from "./AgentsAgentInterface.js"; -import { AgentsAgentProvider } from "./AgentsAgentProvider.js"; -import { AgentsAgentSkill } from "./AgentsAgentSkill.js"; - -export const AgentsAgentCard: core.serialization.ObjectSchema = - core.serialization.object({ - protocolVersion: core.serialization.string(), - name: core.serialization.string(), - description: core.serialization.string(), - url: core.serialization.string(), - preferredTransport: core.serialization.string().optionalNullable(), - additionalInterfaces: core.serialization.list(AgentsAgentInterface).optionalNullable(), - iconUrl: core.serialization.string().optionalNullable(), - documentationUrl: core.serialization.string().optionalNullable(), - provider: AgentsAgentProvider.optionalNullable(), - version: core.serialization.string(), - capabilities: AgentsAgentCapabilities.nullable(), - securitySchemes: core.serialization - .record(core.serialization.string(), core.serialization.unknown()) - .optionalNullable(), - security: core.serialization - .record(core.serialization.string(), core.serialization.unknown()) - .optionalNullable(), - defaultInputModes: core.serialization.list(core.serialization.string()), - defaultOutputModes: core.serialization.list(core.serialization.string()), - skills: core.serialization.list(AgentsAgentSkill), - supportsAuthenticatedExtendedCard: core.serialization.boolean().optionalNullable(), - signatures: core.serialization.list(AgentsAgentCardSignature).optionalNullable(), - }); - -export declare namespace AgentsAgentCard { - export interface Raw { - protocolVersion: string; - name: string; - description: string; - url: string; - preferredTransport?: (string | null | undefined) | null; - additionalInterfaces?: (AgentsAgentInterface.Raw[] | null | undefined) | null; - iconUrl?: (string | null | undefined) | null; - documentationUrl?: (string | null | undefined) | null; - provider?: (AgentsAgentProvider.Raw | null | undefined) | null; - version: string; - capabilities?: AgentsAgentCapabilities.Raw | null; - securitySchemes?: (Record | null | undefined) | null; - security?: (Record | null | undefined) | null; - defaultInputModes: string[]; - defaultOutputModes: string[]; - skills: AgentsAgentSkill.Raw[]; - supportsAuthenticatedExtendedCard?: (boolean | null | undefined) | null; - signatures?: (AgentsAgentCardSignature.Raw[] | null | undefined) | null; - } -} diff --git a/src/serialization/types/AgentsAgentExpertsItem.ts b/src/serialization/types/AgentsAgentExpertsItem.ts deleted file mode 100644 index 1978ab11..00000000 --- a/src/serialization/types/AgentsAgentExpertsItem.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsExpert } from "./AgentsExpert.js"; -import { AgentsExpertReference } from "./AgentsExpertReference.js"; - -export const AgentsAgentExpertsItem: core.serialization.Schema< - serializers.AgentsAgentExpertsItem.Raw, - Corti.AgentsAgentExpertsItem -> = core.serialization.undiscriminatedUnion([AgentsExpert, AgentsExpertReference]); - -export declare namespace AgentsAgentExpertsItem { - export type Raw = AgentsExpert.Raw | AgentsExpertReference.Raw; -} diff --git a/src/serialization/types/AgentsAgentExtension.ts b/src/serialization/types/AgentsAgentExtension.ts deleted file mode 100644 index f3dfb95c..00000000 --- a/src/serialization/types/AgentsAgentExtension.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsAgentExtension: core.serialization.ObjectSchema< - serializers.AgentsAgentExtension.Raw, - Corti.AgentsAgentExtension -> = core.serialization.object({ - uri: core.serialization.string(), - description: core.serialization.string().optional(), - required: core.serialization.boolean().optional(), - params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace AgentsAgentExtension { - export interface Raw { - uri: string; - description?: string | null; - required?: boolean | null; - params?: Record | null; - } -} diff --git a/src/serialization/types/AgentsAgentInterface.ts b/src/serialization/types/AgentsAgentInterface.ts deleted file mode 100644 index f8c7187e..00000000 --- a/src/serialization/types/AgentsAgentInterface.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsAgentInterface: core.serialization.ObjectSchema< - serializers.AgentsAgentInterface.Raw, - Corti.AgentsAgentInterface -> = core.serialization.object({ - url: core.serialization.string(), - transport: core.serialization.string(), -}); - -export declare namespace AgentsAgentInterface { - export interface Raw { - url: string; - transport: string; - } -} diff --git a/src/serialization/types/AgentsAgentProvider.ts b/src/serialization/types/AgentsAgentProvider.ts deleted file mode 100644 index 8915c8ef..00000000 --- a/src/serialization/types/AgentsAgentProvider.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsAgentProvider: core.serialization.ObjectSchema< - serializers.AgentsAgentProvider.Raw, - Corti.AgentsAgentProvider -> = core.serialization.object({ - organization: core.serialization.string(), - url: core.serialization.string(), -}); - -export declare namespace AgentsAgentProvider { - export interface Raw { - organization: string; - url: string; - } -} diff --git a/src/serialization/types/AgentsAgentReference.ts b/src/serialization/types/AgentsAgentReference.ts deleted file mode 100644 index 6a96a179..00000000 --- a/src/serialization/types/AgentsAgentReference.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsAgentReferenceType } from "./AgentsAgentReferenceType.js"; - -export const AgentsAgentReference: core.serialization.ObjectSchema< - serializers.AgentsAgentReference.Raw, - Corti.AgentsAgentReference -> = core.serialization.object({ - type: AgentsAgentReferenceType, - id: core.serialization.string().optional(), - name: core.serialization.string().optional(), -}); - -export declare namespace AgentsAgentReference { - export interface Raw { - type: AgentsAgentReferenceType.Raw; - id?: string | null; - name?: string | null; - } -} diff --git a/src/serialization/types/AgentsAgentReferenceType.ts b/src/serialization/types/AgentsAgentReferenceType.ts deleted file mode 100644 index 687b73af..00000000 --- a/src/serialization/types/AgentsAgentReferenceType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsAgentReferenceType: core.serialization.Schema< - serializers.AgentsAgentReferenceType.Raw, - Corti.AgentsAgentReferenceType -> = core.serialization.enum_(["reference"]); - -export declare namespace AgentsAgentReferenceType { - export type Raw = "reference"; -} diff --git a/src/serialization/types/AgentsAgentResponse.ts b/src/serialization/types/AgentsAgentResponse.ts deleted file mode 100644 index bd90f605..00000000 --- a/src/serialization/types/AgentsAgentResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsAgent } from "./AgentsAgent.js"; -import { AgentsAgentReference } from "./AgentsAgentReference.js"; - -export const AgentsAgentResponse: core.serialization.Schema< - serializers.AgentsAgentResponse.Raw, - Corti.AgentsAgentResponse -> = core.serialization.undiscriminatedUnion([AgentsAgent, AgentsAgentReference]); - -export declare namespace AgentsAgentResponse { - export type Raw = AgentsAgent.Raw | AgentsAgentReference.Raw; -} diff --git a/src/serialization/types/AgentsAgentSkill.ts b/src/serialization/types/AgentsAgentSkill.ts deleted file mode 100644 index 789396d3..00000000 --- a/src/serialization/types/AgentsAgentSkill.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsMessage } from "./AgentsMessage.js"; - -export const AgentsAgentSkill: core.serialization.ObjectSchema< - serializers.AgentsAgentSkill.Raw, - Corti.AgentsAgentSkill -> = core.serialization.object({ - id: core.serialization.string(), - name: core.serialization.string(), - description: core.serialization.string(), - tags: core.serialization.list(core.serialization.string()), - examples: core.serialization.list(AgentsMessage).optionalNullable(), - inputModes: core.serialization.list(core.serialization.string()).optionalNullable(), - outputModes: core.serialization.list(core.serialization.string()).optionalNullable(), - security: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), -}); - -export declare namespace AgentsAgentSkill { - export interface Raw { - id: string; - name: string; - description: string; - tags: string[]; - examples?: (AgentsMessage.Raw[] | null | undefined) | null; - inputModes?: (string[] | null | undefined) | null; - outputModes?: (string[] | null | undefined) | null; - security?: (Record | null | undefined) | null; - } -} diff --git a/src/serialization/types/AgentsArtifact.ts b/src/serialization/types/AgentsArtifact.ts deleted file mode 100644 index 63d29168..00000000 --- a/src/serialization/types/AgentsArtifact.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsPart } from "./AgentsPart.js"; - -export const AgentsArtifact: core.serialization.ObjectSchema = - core.serialization.object({ - artifactId: core.serialization.string(), - name: core.serialization.string().optional(), - description: core.serialization.string().optional(), - parts: core.serialization.list(AgentsPart), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - extensions: core.serialization.list(core.serialization.string()).optional(), - }); - -export declare namespace AgentsArtifact { - export interface Raw { - artifactId: string; - name?: string | null; - description?: string | null; - parts: AgentsPart.Raw[]; - metadata?: Record | null; - extensions?: string[] | null; - } -} diff --git a/src/serialization/types/AgentsContext.ts b/src/serialization/types/AgentsContext.ts deleted file mode 100644 index aea565d3..00000000 --- a/src/serialization/types/AgentsContext.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsContextItemsItem } from "./AgentsContextItemsItem.js"; - -export const AgentsContext: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string().optional(), - items: core.serialization.list(AgentsContextItemsItem).optional(), - }); - -export declare namespace AgentsContext { - export interface Raw { - id?: string | null; - items?: AgentsContextItemsItem.Raw[] | null; - } -} diff --git a/src/serialization/types/AgentsContextItemsItem.ts b/src/serialization/types/AgentsContextItemsItem.ts deleted file mode 100644 index 51296ae8..00000000 --- a/src/serialization/types/AgentsContextItemsItem.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsMessage } from "./AgentsMessage.js"; -import { AgentsTask } from "./AgentsTask.js"; - -export const AgentsContextItemsItem: core.serialization.Schema< - serializers.AgentsContextItemsItem.Raw, - Corti.AgentsContextItemsItem -> = core.serialization.undiscriminatedUnion([AgentsTask, AgentsMessage]); - -export declare namespace AgentsContextItemsItem { - export type Raw = AgentsTask.Raw | AgentsMessage.Raw; -} diff --git a/src/serialization/types/AgentsCreateExpert.ts b/src/serialization/types/AgentsCreateExpert.ts deleted file mode 100644 index fb98856f..00000000 --- a/src/serialization/types/AgentsCreateExpert.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsCreateExpertType } from "./AgentsCreateExpertType.js"; -import { AgentsCreateMcpServer } from "./AgentsCreateMcpServer.js"; - -export const AgentsCreateExpert: core.serialization.ObjectSchema< - serializers.AgentsCreateExpert.Raw, - Corti.AgentsCreateExpert -> = core.serialization.object({ - type: AgentsCreateExpertType, - name: core.serialization.string(), - description: core.serialization.string(), - systemPrompt: core.serialization.string().optional(), - mcpServers: core.serialization.list(AgentsCreateMcpServer).optional(), -}); - -export declare namespace AgentsCreateExpert { - export interface Raw { - type: AgentsCreateExpertType.Raw; - name: string; - description: string; - systemPrompt?: string | null; - mcpServers?: AgentsCreateMcpServer.Raw[] | null; - } -} diff --git a/src/serialization/types/AgentsCreateExpertReference.ts b/src/serialization/types/AgentsCreateExpertReference.ts deleted file mode 100644 index db40af90..00000000 --- a/src/serialization/types/AgentsCreateExpertReference.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsCreateExpertReferenceType } from "./AgentsCreateExpertReferenceType.js"; - -export const AgentsCreateExpertReference: core.serialization.ObjectSchema< - serializers.AgentsCreateExpertReference.Raw, - Corti.AgentsCreateExpertReference -> = core.serialization.object({ - type: AgentsCreateExpertReferenceType, - id: core.serialization.string().optional(), - name: core.serialization.string().optional(), - systemPrompt: core.serialization.string().optional(), - config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace AgentsCreateExpertReference { - export interface Raw { - type: AgentsCreateExpertReferenceType.Raw; - id?: string | null; - name?: string | null; - systemPrompt?: string | null; - config?: Record | null; - } -} diff --git a/src/serialization/types/AgentsCreateExpertReferenceType.ts b/src/serialization/types/AgentsCreateExpertReferenceType.ts deleted file mode 100644 index 818e4eaf..00000000 --- a/src/serialization/types/AgentsCreateExpertReferenceType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsCreateExpertReferenceType: core.serialization.Schema< - serializers.AgentsCreateExpertReferenceType.Raw, - Corti.AgentsCreateExpertReferenceType -> = core.serialization.enum_(["reference"]); - -export declare namespace AgentsCreateExpertReferenceType { - export type Raw = "reference"; -} diff --git a/src/serialization/types/AgentsCreateExpertType.ts b/src/serialization/types/AgentsCreateExpertType.ts deleted file mode 100644 index bde62982..00000000 --- a/src/serialization/types/AgentsCreateExpertType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsCreateExpertType: core.serialization.Schema< - serializers.AgentsCreateExpertType.Raw, - Corti.AgentsCreateExpertType -> = core.serialization.enum_(["new"]); - -export declare namespace AgentsCreateExpertType { - export type Raw = "new"; -} diff --git a/src/serialization/types/AgentsCreateMcpServer.ts b/src/serialization/types/AgentsCreateMcpServer.ts deleted file mode 100644 index a3a17f4b..00000000 --- a/src/serialization/types/AgentsCreateMcpServer.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsCreateMcpServerAuthorizationType } from "./AgentsCreateMcpServerAuthorizationType.js"; -import { AgentsCreateMcpServerTransportType } from "./AgentsCreateMcpServerTransportType.js"; - -export const AgentsCreateMcpServer: core.serialization.ObjectSchema< - serializers.AgentsCreateMcpServer.Raw, - Corti.AgentsCreateMcpServer -> = core.serialization.object({ - name: core.serialization.string(), - description: core.serialization.string().optional(), - transportType: AgentsCreateMcpServerTransportType, - authorizationType: AgentsCreateMcpServerAuthorizationType, - authorizationScope: core.serialization.string().optional(), - url: core.serialization.string(), - redirectUrl: core.serialization.string().optional(), - token: core.serialization.string().optional(), -}); - -export declare namespace AgentsCreateMcpServer { - export interface Raw { - name: string; - description?: string | null; - transportType: AgentsCreateMcpServerTransportType.Raw; - authorizationType: AgentsCreateMcpServerAuthorizationType.Raw; - authorizationScope?: string | null; - url: string; - redirectUrl?: string | null; - token?: string | null; - } -} diff --git a/src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts b/src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts deleted file mode 100644 index 9447f5d6..00000000 --- a/src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsCreateMcpServerAuthorizationType: core.serialization.Schema< - serializers.AgentsCreateMcpServerAuthorizationType.Raw, - Corti.AgentsCreateMcpServerAuthorizationType -> = core.serialization.enum_(["none", "bearer", "inherit", "oauth2.0"]); - -export declare namespace AgentsCreateMcpServerAuthorizationType { - export type Raw = "none" | "bearer" | "inherit" | "oauth2.0"; -} diff --git a/src/serialization/types/AgentsCreateMcpServerTransportType.ts b/src/serialization/types/AgentsCreateMcpServerTransportType.ts deleted file mode 100644 index 8e91252c..00000000 --- a/src/serialization/types/AgentsCreateMcpServerTransportType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsCreateMcpServerTransportType: core.serialization.Schema< - serializers.AgentsCreateMcpServerTransportType.Raw, - Corti.AgentsCreateMcpServerTransportType -> = core.serialization.enum_(["stdio", "streamable_http", "sse"]); - -export declare namespace AgentsCreateMcpServerTransportType { - export type Raw = "stdio" | "streamable_http" | "sse"; -} diff --git a/src/serialization/types/AgentsDataPart.ts b/src/serialization/types/AgentsDataPart.ts deleted file mode 100644 index 5dae00cb..00000000 --- a/src/serialization/types/AgentsDataPart.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsDataPartKind } from "./AgentsDataPartKind.js"; - -export const AgentsDataPart: core.serialization.ObjectSchema = - core.serialization.object({ - kind: AgentsDataPartKind, - data: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }); - -export declare namespace AgentsDataPart { - export interface Raw { - kind: AgentsDataPartKind.Raw; - data: Record; - metadata?: Record | null; - } -} diff --git a/src/serialization/types/AgentsDataPartKind.ts b/src/serialization/types/AgentsDataPartKind.ts deleted file mode 100644 index 3f364751..00000000 --- a/src/serialization/types/AgentsDataPartKind.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsDataPartKind: core.serialization.Schema< - serializers.AgentsDataPartKind.Raw, - Corti.AgentsDataPartKind -> = core.serialization.enum_(["data"]); - -export declare namespace AgentsDataPartKind { - export type Raw = "data"; -} diff --git a/src/serialization/types/AgentsExpert.ts b/src/serialization/types/AgentsExpert.ts deleted file mode 100644 index 1b03e633..00000000 --- a/src/serialization/types/AgentsExpert.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsExpertType } from "./AgentsExpertType.js"; -import { AgentsMcpServer } from "./AgentsMcpServer.js"; - -export const AgentsExpert: core.serialization.ObjectSchema = - core.serialization.object({ - type: AgentsExpertType, - id: core.serialization.string(), - name: core.serialization.string(), - description: core.serialization.string(), - systemPrompt: core.serialization.string(), - mcpServers: core.serialization.list(AgentsMcpServer).optional(), - }); - -export declare namespace AgentsExpert { - export interface Raw { - type: AgentsExpertType.Raw; - id: string; - name: string; - description: string; - systemPrompt: string; - mcpServers?: AgentsMcpServer.Raw[] | null; - } -} diff --git a/src/serialization/types/AgentsExpertReference.ts b/src/serialization/types/AgentsExpertReference.ts deleted file mode 100644 index 00a6167b..00000000 --- a/src/serialization/types/AgentsExpertReference.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsExpertReferenceType } from "./AgentsExpertReferenceType.js"; - -export const AgentsExpertReference: core.serialization.ObjectSchema< - serializers.AgentsExpertReference.Raw, - Corti.AgentsExpertReference -> = core.serialization.object({ - type: AgentsExpertReferenceType, - id: core.serialization.string(), - name: core.serialization.string(), - systemPrompt: core.serialization.string().optional(), - resolvedConfig: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace AgentsExpertReference { - export interface Raw { - type: AgentsExpertReferenceType.Raw; - id: string; - name: string; - systemPrompt?: string | null; - resolvedConfig?: Record | null; - } -} diff --git a/src/serialization/types/AgentsExpertReferenceType.ts b/src/serialization/types/AgentsExpertReferenceType.ts deleted file mode 100644 index f6c6d1ea..00000000 --- a/src/serialization/types/AgentsExpertReferenceType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsExpertReferenceType: core.serialization.Schema< - serializers.AgentsExpertReferenceType.Raw, - Corti.AgentsExpertReferenceType -> = core.serialization.enum_(["reference"]); - -export declare namespace AgentsExpertReferenceType { - export type Raw = "reference"; -} diff --git a/src/serialization/types/AgentsExpertType.ts b/src/serialization/types/AgentsExpertType.ts deleted file mode 100644 index 28daa1b9..00000000 --- a/src/serialization/types/AgentsExpertType.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsExpertType: core.serialization.Schema = - core.serialization.enum_(["expert"]); - -export declare namespace AgentsExpertType { - export type Raw = "expert"; -} diff --git a/src/serialization/types/AgentsFilePart.ts b/src/serialization/types/AgentsFilePart.ts deleted file mode 100644 index 8f4d1cea..00000000 --- a/src/serialization/types/AgentsFilePart.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsFilePartFile } from "./AgentsFilePartFile.js"; -import { AgentsFilePartKind } from "./AgentsFilePartKind.js"; - -export const AgentsFilePart: core.serialization.ObjectSchema = - core.serialization.object({ - kind: AgentsFilePartKind, - file: AgentsFilePartFile.optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }); - -export declare namespace AgentsFilePart { - export interface Raw { - kind: AgentsFilePartKind.Raw; - file?: AgentsFilePartFile.Raw | null; - metadata?: Record | null; - } -} diff --git a/src/serialization/types/AgentsFilePartFile.ts b/src/serialization/types/AgentsFilePartFile.ts deleted file mode 100644 index 827a1b4c..00000000 --- a/src/serialization/types/AgentsFilePartFile.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsFileWithBytes } from "./AgentsFileWithBytes.js"; -import { AgentsFileWithUri } from "./AgentsFileWithUri.js"; - -export const AgentsFilePartFile: core.serialization.Schema< - serializers.AgentsFilePartFile.Raw, - Corti.AgentsFilePartFile -> = core.serialization.undiscriminatedUnion([AgentsFileWithUri, AgentsFileWithBytes]); - -export declare namespace AgentsFilePartFile { - export type Raw = AgentsFileWithUri.Raw | AgentsFileWithBytes.Raw; -} diff --git a/src/serialization/types/AgentsFilePartKind.ts b/src/serialization/types/AgentsFilePartKind.ts deleted file mode 100644 index 77d4cd42..00000000 --- a/src/serialization/types/AgentsFilePartKind.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsFilePartKind: core.serialization.Schema< - serializers.AgentsFilePartKind.Raw, - Corti.AgentsFilePartKind -> = core.serialization.enum_(["file"]); - -export declare namespace AgentsFilePartKind { - export type Raw = "file"; -} diff --git a/src/serialization/types/AgentsFileWithBytes.ts b/src/serialization/types/AgentsFileWithBytes.ts deleted file mode 100644 index 6bf82871..00000000 --- a/src/serialization/types/AgentsFileWithBytes.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsFileWithBytes: core.serialization.ObjectSchema< - serializers.AgentsFileWithBytes.Raw, - Corti.AgentsFileWithBytes -> = core.serialization.object({ - bytes: core.serialization.string(), - name: core.serialization.string().optional(), - mimeType: core.serialization.string().optional(), -}); - -export declare namespace AgentsFileWithBytes { - export interface Raw { - bytes: string; - name?: string | null; - mimeType?: string | null; - } -} diff --git a/src/serialization/types/AgentsFileWithUri.ts b/src/serialization/types/AgentsFileWithUri.ts deleted file mode 100644 index f6025b3e..00000000 --- a/src/serialization/types/AgentsFileWithUri.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsFileWithUri: core.serialization.ObjectSchema< - serializers.AgentsFileWithUri.Raw, - Corti.AgentsFileWithUri -> = core.serialization.object({ - uri: core.serialization.string(), - name: core.serialization.string().optional(), - mimeType: core.serialization.string().optional(), -}); - -export declare namespace AgentsFileWithUri { - export interface Raw { - uri: string; - name?: string | null; - mimeType?: string | null; - } -} diff --git a/src/serialization/types/AgentsLabels.ts b/src/serialization/types/AgentsLabels.ts new file mode 100644 index 00000000..a080d939 --- /dev/null +++ b/src/serialization/types/AgentsLabels.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsLabels: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.string()); + +export declare namespace AgentsLabels { + export type Raw = Record; +} diff --git a/src/serialization/types/AgentsLifecycle.ts b/src/serialization/types/AgentsLifecycle.ts new file mode 100644 index 00000000..5993ff67 --- /dev/null +++ b/src/serialization/types/AgentsLifecycle.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsLifecycle: core.serialization.Schema = + core.serialization.enum_(["ephemeral", "persistent"]); + +export declare namespace AgentsLifecycle { + export type Raw = "ephemeral" | "persistent"; +} diff --git a/src/serialization/types/AgentsListResponse.ts b/src/serialization/types/AgentsListResponse.ts new file mode 100644 index 00000000..2027987d --- /dev/null +++ b/src/serialization/types/AgentsListResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsResponse } from "./AgentsResponse.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; + +export const AgentsListResponse: core.serialization.ObjectSchema< + serializers.AgentsListResponse.Raw, + Corti.AgentsListResponse +> = core.serialization.object({ + agents: core.serialization.list(AgentsResponse), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace AgentsListResponse { + export interface Raw { + agents: AgentsResponse.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/AgentsMcpServer.ts b/src/serialization/types/AgentsMcpServer.ts deleted file mode 100644 index 32d26f86..00000000 --- a/src/serialization/types/AgentsMcpServer.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsMcpServerAuthorizationType } from "./AgentsMcpServerAuthorizationType.js"; -import { AgentsMcpServerTransportType } from "./AgentsMcpServerTransportType.js"; - -export const AgentsMcpServer: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string(), - name: core.serialization.string(), - transportType: AgentsMcpServerTransportType, - authorizationType: AgentsMcpServerAuthorizationType, - authorizationScope: core.serialization.string().optional(), - url: core.serialization.string(), - redirectUrl: core.serialization.string().optionalNullable(), - }); - -export declare namespace AgentsMcpServer { - export interface Raw { - id: string; - name: string; - transportType: AgentsMcpServerTransportType.Raw; - authorizationType: AgentsMcpServerAuthorizationType.Raw; - authorizationScope?: string | null; - url: string; - redirectUrl?: (string | null | undefined) | null; - } -} diff --git a/src/serialization/types/AgentsMcpServerAuthorizationType.ts b/src/serialization/types/AgentsMcpServerAuthorizationType.ts deleted file mode 100644 index ea666a01..00000000 --- a/src/serialization/types/AgentsMcpServerAuthorizationType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsMcpServerAuthorizationType: core.serialization.Schema< - serializers.AgentsMcpServerAuthorizationType.Raw, - Corti.AgentsMcpServerAuthorizationType -> = core.serialization.enum_(["none", "bearer", "inherit", "oauth2.0"]); - -export declare namespace AgentsMcpServerAuthorizationType { - export type Raw = "none" | "bearer" | "inherit" | "oauth2.0"; -} diff --git a/src/serialization/types/AgentsMcpServerTransportType.ts b/src/serialization/types/AgentsMcpServerTransportType.ts deleted file mode 100644 index c913b4f7..00000000 --- a/src/serialization/types/AgentsMcpServerTransportType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsMcpServerTransportType: core.serialization.Schema< - serializers.AgentsMcpServerTransportType.Raw, - Corti.AgentsMcpServerTransportType -> = core.serialization.enum_(["stdio", "streamable_http", "sse"]); - -export declare namespace AgentsMcpServerTransportType { - export type Raw = "stdio" | "streamable_http" | "sse"; -} diff --git a/src/serialization/types/AgentsMessage.ts b/src/serialization/types/AgentsMessage.ts deleted file mode 100644 index 0f50d4cc..00000000 --- a/src/serialization/types/AgentsMessage.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsMessageKind } from "./AgentsMessageKind.js"; -import { AgentsMessageRole } from "./AgentsMessageRole.js"; -import { AgentsPart } from "./AgentsPart.js"; - -export const AgentsMessage: core.serialization.ObjectSchema = - core.serialization.object({ - role: AgentsMessageRole, - parts: core.serialization.list(AgentsPart), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - extensions: core.serialization.list(core.serialization.string()).optional(), - referenceTaskIds: core.serialization.list(core.serialization.string()).optional(), - messageId: core.serialization.string(), - taskId: core.serialization.string().optional(), - contextId: core.serialization.string().optional(), - kind: AgentsMessageKind, - }); - -export declare namespace AgentsMessage { - export interface Raw { - role: AgentsMessageRole.Raw; - parts: AgentsPart.Raw[]; - metadata?: Record | null; - extensions?: string[] | null; - referenceTaskIds?: string[] | null; - messageId: string; - taskId?: string | null; - contextId?: string | null; - kind: AgentsMessageKind.Raw; - } -} diff --git a/src/serialization/types/AgentsMessageRole.ts b/src/serialization/types/AgentsMessageRole.ts deleted file mode 100644 index 4c3115f9..00000000 --- a/src/serialization/types/AgentsMessageRole.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsMessageRole: core.serialization.Schema = - core.serialization.enum_(["user", "agent"]); - -export declare namespace AgentsMessageRole { - export type Raw = "user" | "agent"; -} diff --git a/src/serialization/types/AgentsMessageSendConfiguration.ts b/src/serialization/types/AgentsMessageSendConfiguration.ts deleted file mode 100644 index e3bd0a73..00000000 --- a/src/serialization/types/AgentsMessageSendConfiguration.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsPushNotificationConfig } from "./AgentsPushNotificationConfig.js"; - -export const AgentsMessageSendConfiguration: core.serialization.ObjectSchema< - serializers.AgentsMessageSendConfiguration.Raw, - Corti.AgentsMessageSendConfiguration -> = core.serialization.object({ - acceptedOutputModes: core.serialization.list(core.serialization.string()).optional(), - historyLength: core.serialization.number().optional(), - pushNotificationConfig: AgentsPushNotificationConfig.optional(), - blocking: core.serialization.boolean().optional(), -}); - -export declare namespace AgentsMessageSendConfiguration { - export interface Raw { - acceptedOutputModes?: string[] | null; - historyLength?: number | null; - pushNotificationConfig?: AgentsPushNotificationConfig.Raw | null; - blocking?: boolean | null; - } -} diff --git a/src/serialization/types/AgentsPart.ts b/src/serialization/types/AgentsPart.ts deleted file mode 100644 index cba88209..00000000 --- a/src/serialization/types/AgentsPart.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsDataPart } from "./AgentsDataPart.js"; -import { AgentsFilePart } from "./AgentsFilePart.js"; -import { AgentsTextPart } from "./AgentsTextPart.js"; - -export const AgentsPart: core.serialization.Schema = - core.serialization.undiscriminatedUnion([AgentsTextPart, AgentsFilePart, AgentsDataPart]); - -export declare namespace AgentsPart { - export type Raw = AgentsTextPart.Raw | AgentsFilePart.Raw | AgentsDataPart.Raw; -} diff --git a/src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts b/src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts deleted file mode 100644 index eb0b5742..00000000 --- a/src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsPushNotificationAuthenticationInfo: core.serialization.ObjectSchema< - serializers.AgentsPushNotificationAuthenticationInfo.Raw, - Corti.AgentsPushNotificationAuthenticationInfo -> = core.serialization.object({ - schemes: core.serialization.list(core.serialization.string()), - credentials: core.serialization.string().optional(), -}); - -export declare namespace AgentsPushNotificationAuthenticationInfo { - export interface Raw { - schemes: string[]; - credentials?: string | null; - } -} diff --git a/src/serialization/types/AgentsPushNotificationConfig.ts b/src/serialization/types/AgentsPushNotificationConfig.ts deleted file mode 100644 index 5c809ea9..00000000 --- a/src/serialization/types/AgentsPushNotificationConfig.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsPushNotificationAuthenticationInfo } from "./AgentsPushNotificationAuthenticationInfo.js"; - -export const AgentsPushNotificationConfig: core.serialization.ObjectSchema< - serializers.AgentsPushNotificationConfig.Raw, - Corti.AgentsPushNotificationConfig -> = core.serialization.object({ - id: core.serialization.string().optional(), - url: core.serialization.string(), - token: core.serialization.string().optional(), - authentication: AgentsPushNotificationAuthenticationInfo.optional(), -}); - -export declare namespace AgentsPushNotificationConfig { - export interface Raw { - id?: string | null; - url: string; - token?: string | null; - authentication?: AgentsPushNotificationAuthenticationInfo.Raw | null; - } -} diff --git a/src/serialization/types/AgentsRegistryExpert.ts b/src/serialization/types/AgentsRegistryExpert.ts deleted file mode 100644 index 674c9ced..00000000 --- a/src/serialization/types/AgentsRegistryExpert.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsRegistryMcpServer } from "./AgentsRegistryMcpServer.js"; - -export const AgentsRegistryExpert: core.serialization.ObjectSchema< - serializers.AgentsRegistryExpert.Raw, - Corti.AgentsRegistryExpert -> = core.serialization.object({ - name: core.serialization.string(), - displayName: core.serialization.string().optional(), - displayDescription: core.serialization.string().optional(), - description: core.serialization.string(), - mcpServers: core.serialization.list(AgentsRegistryMcpServer).optional(), - configSchema: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace AgentsRegistryExpert { - export interface Raw { - name: string; - displayName?: string | null; - displayDescription?: string | null; - description: string; - mcpServers?: AgentsRegistryMcpServer.Raw[] | null; - configSchema?: Record | null; - } -} diff --git a/src/serialization/types/AgentsRegistryExpertsResponse.ts b/src/serialization/types/AgentsRegistryExpertsResponse.ts deleted file mode 100644 index a2654f1f..00000000 --- a/src/serialization/types/AgentsRegistryExpertsResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsRegistryExpert } from "./AgentsRegistryExpert.js"; - -export const AgentsRegistryExpertsResponse: core.serialization.ObjectSchema< - serializers.AgentsRegistryExpertsResponse.Raw, - Corti.AgentsRegistryExpertsResponse -> = core.serialization.object({ - experts: core.serialization.list(AgentsRegistryExpert).optional(), -}); - -export declare namespace AgentsRegistryExpertsResponse { - export interface Raw { - experts?: AgentsRegistryExpert.Raw[] | null; - } -} diff --git a/src/serialization/types/AgentsRegistryMcpServer.ts b/src/serialization/types/AgentsRegistryMcpServer.ts deleted file mode 100644 index 7b771629..00000000 --- a/src/serialization/types/AgentsRegistryMcpServer.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsRegistryMcpServerAuthorizationType } from "./AgentsRegistryMcpServerAuthorizationType.js"; - -export const AgentsRegistryMcpServer: core.serialization.ObjectSchema< - serializers.AgentsRegistryMcpServer.Raw, - Corti.AgentsRegistryMcpServer -> = core.serialization.object({ - name: core.serialization.string(), - authorizationType: AgentsRegistryMcpServerAuthorizationType, -}); - -export declare namespace AgentsRegistryMcpServer { - export interface Raw { - name: string; - authorizationType: AgentsRegistryMcpServerAuthorizationType.Raw; - } -} diff --git a/src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts b/src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts deleted file mode 100644 index 29d87c55..00000000 --- a/src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsRegistryMcpServerAuthorizationType: core.serialization.Schema< - serializers.AgentsRegistryMcpServerAuthorizationType.Raw, - Corti.AgentsRegistryMcpServerAuthorizationType -> = core.serialization.enum_(["none", "bearer", "inherit", "oauth2.0"]); - -export declare namespace AgentsRegistryMcpServerAuthorizationType { - export type Raw = "none" | "bearer" | "inherit" | "oauth2.0"; -} diff --git a/src/serialization/types/AgentsResponse.ts b/src/serialization/types/AgentsResponse.ts new file mode 100644 index 00000000..fe2efda1 --- /dev/null +++ b/src/serialization/types/AgentsResponse.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsLabels } from "./AgentsLabels.js"; +import { AgentsLifecycle } from "./AgentsLifecycle.js"; +import { AgentsUserIdValue } from "./AgentsUserIdValue.js"; +import { AgentsVisibility } from "./AgentsVisibility.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; +import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; + +export const AgentsResponse: core.serialization.ObjectSchema = + core.serialization.object({ + id: CommonAgentIdValue, + name: core.serialization.string(), + description: core.serialization.string().optionalNullable(), + systemPrompt: core.serialization.string().optionalNullable(), + model: core.serialization.string().optionalNullable(), + visibility: AgentsVisibility, + lifecycle: AgentsLifecycle, + connectors: core.serialization.list(CommonConnectorResponse), + labels: AgentsLabels.optional(), + createdAt: core.serialization.date().optional(), + updatedAt: core.serialization.date().optional(), + createdBy: AgentsUserIdValue.optional(), + }); + +export declare namespace AgentsResponse { + export interface Raw { + id: CommonAgentIdValue.Raw; + name: string; + description?: (string | null | undefined) | null; + systemPrompt?: (string | null | undefined) | null; + model?: (string | null | undefined) | null; + visibility: AgentsVisibility.Raw; + lifecycle: AgentsLifecycle.Raw; + connectors: CommonConnectorResponse.Raw[]; + labels?: AgentsLabels.Raw | null; + createdAt?: string | null; + updatedAt?: string | null; + createdBy?: AgentsUserIdValue.Raw | null; + } +} diff --git a/src/serialization/types/AgentsTask.ts b/src/serialization/types/AgentsTask.ts deleted file mode 100644 index 7e1fa68d..00000000 --- a/src/serialization/types/AgentsTask.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsArtifact } from "./AgentsArtifact.js"; -import { AgentsMessage } from "./AgentsMessage.js"; -import { AgentsTaskKind } from "./AgentsTaskKind.js"; -import { AgentsTaskStatus } from "./AgentsTaskStatus.js"; - -export const AgentsTask: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string(), - contextId: core.serialization.string(), - status: AgentsTaskStatus, - history: core.serialization.list(AgentsMessage).optional(), - artifacts: core.serialization.list(AgentsArtifact).optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - kind: AgentsTaskKind, - }); - -export declare namespace AgentsTask { - export interface Raw { - id: string; - contextId: string; - status: AgentsTaskStatus.Raw; - history?: AgentsMessage.Raw[] | null; - artifacts?: AgentsArtifact.Raw[] | null; - metadata?: Record | null; - kind: AgentsTaskKind.Raw; - } -} diff --git a/src/serialization/types/AgentsTaskKind.ts b/src/serialization/types/AgentsTaskKind.ts deleted file mode 100644 index dc91c875..00000000 --- a/src/serialization/types/AgentsTaskKind.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsTaskKind: core.serialization.Schema = - core.serialization.enum_(["task"]); - -export declare namespace AgentsTaskKind { - export type Raw = "task"; -} diff --git a/src/serialization/types/AgentsTaskStatus.ts b/src/serialization/types/AgentsTaskStatus.ts deleted file mode 100644 index 4511659b..00000000 --- a/src/serialization/types/AgentsTaskStatus.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsMessage } from "./AgentsMessage.js"; -import { AgentsTaskStatusState } from "./AgentsTaskStatusState.js"; - -export const AgentsTaskStatus: core.serialization.ObjectSchema< - serializers.AgentsTaskStatus.Raw, - Corti.AgentsTaskStatus -> = core.serialization.object({ - state: AgentsTaskStatusState, - message: AgentsMessage.optional(), - timestamp: core.serialization.date().optional(), -}); - -export declare namespace AgentsTaskStatus { - export interface Raw { - state: AgentsTaskStatusState.Raw; - message?: AgentsMessage.Raw | null; - timestamp?: string | null; - } -} diff --git a/src/serialization/types/AgentsTaskStatusState.ts b/src/serialization/types/AgentsTaskStatusState.ts deleted file mode 100644 index 24e1e1d4..00000000 --- a/src/serialization/types/AgentsTaskStatusState.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsTaskStatusState: core.serialization.Schema< - serializers.AgentsTaskStatusState.Raw, - Corti.AgentsTaskStatusState -> = core.serialization.enum_([ - "submitted", - "working", - "input-required", - "completed", - "canceled", - "failed", - "rejected", - "auth-required", - "unknown", -]); - -export declare namespace AgentsTaskStatusState { - export type Raw = - | "submitted" - | "working" - | "input-required" - | "completed" - | "canceled" - | "failed" - | "rejected" - | "auth-required" - | "unknown"; -} diff --git a/src/serialization/types/AgentsTextPart.ts b/src/serialization/types/AgentsTextPart.ts deleted file mode 100644 index 79c24b59..00000000 --- a/src/serialization/types/AgentsTextPart.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsTextPartKind } from "./AgentsTextPartKind.js"; - -export const AgentsTextPart: core.serialization.ObjectSchema = - core.serialization.object({ - kind: AgentsTextPartKind, - text: core.serialization.string(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }); - -export declare namespace AgentsTextPart { - export interface Raw { - kind: AgentsTextPartKind.Raw; - text: string; - metadata?: Record | null; - } -} diff --git a/src/serialization/types/AgentsTextPartKind.ts b/src/serialization/types/AgentsTextPartKind.ts deleted file mode 100644 index 202e1895..00000000 --- a/src/serialization/types/AgentsTextPartKind.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsTextPartKind: core.serialization.Schema< - serializers.AgentsTextPartKind.Raw, - Corti.AgentsTextPartKind -> = core.serialization.enum_(["text"]); - -export declare namespace AgentsTextPartKind { - export type Raw = "text"; -} diff --git a/src/serialization/types/AgentsUpdateExpertReference.ts b/src/serialization/types/AgentsUpdateExpertReference.ts deleted file mode 100644 index 950b15d5..00000000 --- a/src/serialization/types/AgentsUpdateExpertReference.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import type * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsCreateExpertReference } from "./AgentsCreateExpertReference.js"; - -export const AgentsUpdateExpertReference: core.serialization.ObjectSchema< - serializers.AgentsUpdateExpertReference.Raw, - Corti.AgentsUpdateExpertReference -> = AgentsCreateExpertReference; - -export declare namespace AgentsUpdateExpertReference { - export type Raw = AgentsCreateExpertReference.Raw; -} diff --git a/src/serialization/types/AgentsUserIdValue.ts b/src/serialization/types/AgentsUserIdValue.ts new file mode 100644 index 00000000..6782956b --- /dev/null +++ b/src/serialization/types/AgentsUserIdValue.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsUserIdValue: core.serialization.Schema = + core.serialization.string(); + +export declare namespace AgentsUserIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/AgentsVisibility.ts b/src/serialization/types/AgentsVisibility.ts new file mode 100644 index 00000000..9d7fb839 --- /dev/null +++ b/src/serialization/types/AgentsVisibility.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsVisibility: core.serialization.Schema = + core.serialization.enum_(["private", "unlisted", "public"]); + +export declare namespace AgentsVisibility { + export type Raw = "private" | "unlisted" | "public"; +} diff --git a/src/serialization/types/CommonA2AConnector.ts b/src/serialization/types/CommonA2AConnector.ts new file mode 100644 index 00000000..fb899433 --- /dev/null +++ b/src/serialization/types/CommonA2AConnector.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonA2AConnector: core.serialization.ObjectSchema< + serializers.CommonA2AConnector.Raw, + Corti.CommonA2AConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("a2a"), + name: core.serialization.string().optional(), + url: core.serialization.string(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonA2AConnector { + export interface Raw { + type: "a2a"; + name?: string | null; + url: string; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonA2AConnectorCreate.ts b/src/serialization/types/CommonA2AConnectorCreate.ts new file mode 100644 index 00000000..59699d10 --- /dev/null +++ b/src/serialization/types/CommonA2AConnectorCreate.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonA2AConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonA2AConnectorCreate.Raw, + Corti.CommonA2AConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("a2a"), + name: core.serialization.string().optional(), + url: core.serialization.string(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonA2AConnectorCreate { + export interface Raw { + type: "a2a"; + name?: string | null; + url: string; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonAgentConnector.ts b/src/serialization/types/CommonAgentConnector.ts new file mode 100644 index 00000000..cb3dca8d --- /dev/null +++ b/src/serialization/types/CommonAgentConnector.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonAgentConnector: core.serialization.ObjectSchema< + serializers.CommonAgentConnector.Raw, + Corti.CommonAgentConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("agent"), + agentId: CommonAgentIdValue, + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonAgentConnector { + export interface Raw { + type: "agent"; + agentId: CommonAgentIdValue.Raw; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonAgentConnectorCreate.ts b/src/serialization/types/CommonAgentConnectorCreate.ts new file mode 100644 index 00000000..b000e3b7 --- /dev/null +++ b/src/serialization/types/CommonAgentConnectorCreate.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; + +export const CommonAgentConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonAgentConnectorCreate.Raw, + Corti.CommonAgentConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("agent"), + agentId: CommonAgentIdValue, + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonAgentConnectorCreate { + export interface Raw { + type: "agent"; + agentId: CommonAgentIdValue.Raw; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonAgentIdValue.ts b/src/serialization/types/CommonAgentIdValue.ts new file mode 100644 index 00000000..f722a543 --- /dev/null +++ b/src/serialization/types/CommonAgentIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonAgentIdValue: core.serialization.Schema< + serializers.CommonAgentIdValue.Raw, + Corti.CommonAgentIdValue +> = core.serialization.string(); + +export declare namespace CommonAgentIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonArtifactIdValue.ts b/src/serialization/types/CommonArtifactIdValue.ts new file mode 100644 index 00000000..a135e7e2 --- /dev/null +++ b/src/serialization/types/CommonArtifactIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonArtifactIdValue: core.serialization.Schema< + serializers.CommonArtifactIdValue.Raw, + Corti.CommonArtifactIdValue +> = core.serialization.string(); + +export declare namespace CommonArtifactIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonArtifactResponse.ts b/src/serialization/types/CommonArtifactResponse.ts new file mode 100644 index 00000000..b2aa8f1f --- /dev/null +++ b/src/serialization/types/CommonArtifactResponse.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonArtifactIdValue } from "./CommonArtifactIdValue.js"; +import { CommonPart } from "./CommonPart.js"; + +export const CommonArtifactResponse: core.serialization.ObjectSchema< + serializers.CommonArtifactResponse.Raw, + Corti.CommonArtifactResponse +> = core.serialization.object({ + artifactId: CommonArtifactIdValue, + name: core.serialization.string().optional(), + description: core.serialization.string().optional(), + extensions: core.serialization.list(core.serialization.string()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + parts: core.serialization.list(CommonPart), +}); + +export declare namespace CommonArtifactResponse { + export interface Raw { + artifactId: CommonArtifactIdValue.Raw; + name?: string | null; + description?: string | null; + extensions?: string[] | null; + metadata?: Record | null; + parts: CommonPart.Raw[]; + } +} diff --git a/src/serialization/types/CommonConnectorAuth.ts b/src/serialization/types/CommonConnectorAuth.ts new file mode 100644 index 00000000..da6cc3d9 --- /dev/null +++ b/src/serialization/types/CommonConnectorAuth.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorAuthType } from "./CommonConnectorAuthType.js"; + +export const CommonConnectorAuth: core.serialization.ObjectSchema< + serializers.CommonConnectorAuth.Raw, + Corti.CommonConnectorAuth +> = core.serialization.object({ + type: CommonConnectorAuthType, + scope: core.serialization.string().optional(), + redirectUrl: core.serialization.string().optional(), + ref: core.serialization.string().optional(), +}); + +export declare namespace CommonConnectorAuth { + export interface Raw { + type: CommonConnectorAuthType.Raw; + scope?: string | null; + redirectUrl?: string | null; + ref?: string | null; + } +} diff --git a/src/serialization/types/CommonConnectorAuthType.ts b/src/serialization/types/CommonConnectorAuthType.ts new file mode 100644 index 00000000..c9deff12 --- /dev/null +++ b/src/serialization/types/CommonConnectorAuthType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonConnectorAuthType: core.serialization.Schema< + serializers.CommonConnectorAuthType.Raw, + Corti.CommonConnectorAuthType +> = core.serialization.enum_(["none", "bearer", "apiKey", "oauth2"]); + +export declare namespace CommonConnectorAuthType { + export type Raw = "none" | "bearer" | "apiKey" | "oauth2"; +} diff --git a/src/serialization/types/CommonConnectorCreateRequest.ts b/src/serialization/types/CommonConnectorCreateRequest.ts new file mode 100644 index 00000000..d95dc3bb --- /dev/null +++ b/src/serialization/types/CommonConnectorCreateRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonA2AConnectorCreate } from "./CommonA2AConnectorCreate.js"; +import { CommonAgentConnectorCreate } from "./CommonAgentConnectorCreate.js"; +import { CommonMcpConnectorCreate } from "./CommonMcpConnectorCreate.js"; +import { CommonRegistryConnectorCreate } from "./CommonRegistryConnectorCreate.js"; +import { CommonSchemaConnectorCreate } from "./CommonSchemaConnectorCreate.js"; + +export const CommonConnectorCreateRequest: core.serialization.Schema< + serializers.CommonConnectorCreateRequest.Raw, + Corti.CommonConnectorCreateRequest +> = core.serialization.undiscriminatedUnion([ + CommonRegistryConnectorCreate, + CommonMcpConnectorCreate, + CommonAgentConnectorCreate, + CommonA2AConnectorCreate, + CommonSchemaConnectorCreate, +]); + +export declare namespace CommonConnectorCreateRequest { + export type Raw = + | CommonRegistryConnectorCreate.Raw + | CommonMcpConnectorCreate.Raw + | CommonAgentConnectorCreate.Raw + | CommonA2AConnectorCreate.Raw + | CommonSchemaConnectorCreate.Raw; +} diff --git a/src/serialization/types/CommonConnectorIdValue.ts b/src/serialization/types/CommonConnectorIdValue.ts new file mode 100644 index 00000000..a87af807 --- /dev/null +++ b/src/serialization/types/CommonConnectorIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonConnectorIdValue: core.serialization.Schema< + serializers.CommonConnectorIdValue.Raw, + Corti.CommonConnectorIdValue +> = core.serialization.string(); + +export declare namespace CommonConnectorIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonConnectorResponse.ts b/src/serialization/types/CommonConnectorResponse.ts new file mode 100644 index 00000000..942e8438 --- /dev/null +++ b/src/serialization/types/CommonConnectorResponse.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonA2AConnector } from "./CommonA2AConnector.js"; +import { CommonAgentConnector } from "./CommonAgentConnector.js"; +import { CommonMcpConnector } from "./CommonMcpConnector.js"; +import { CommonRegistryConnectorProvisioned } from "./CommonRegistryConnectorProvisioned.js"; +import { CommonSchemaConnector } from "./CommonSchemaConnector.js"; + +export const CommonConnectorResponse: core.serialization.Schema< + serializers.CommonConnectorResponse.Raw, + Corti.CommonConnectorResponse +> = core.serialization.undiscriminatedUnion([ + CommonRegistryConnectorProvisioned, + CommonMcpConnector, + CommonAgentConnector, + CommonA2AConnector, + CommonSchemaConnector, +]); + +export declare namespace CommonConnectorResponse { + export type Raw = + | CommonRegistryConnectorProvisioned.Raw + | CommonMcpConnector.Raw + | CommonAgentConnector.Raw + | CommonA2AConnector.Raw + | CommonSchemaConnector.Raw; +} diff --git a/src/serialization/types/CommonConnectorType.ts b/src/serialization/types/CommonConnectorType.ts new file mode 100644 index 00000000..fdea4339 --- /dev/null +++ b/src/serialization/types/CommonConnectorType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonConnectorType: core.serialization.Schema< + serializers.CommonConnectorType.Raw, + Corti.CommonConnectorType +> = core.serialization.enum_(["registry", "mcp", "agent", "a2a", "schema"]); + +export declare namespace CommonConnectorType { + export type Raw = "registry" | "mcp" | "agent" | "a2a" | "schema"; +} diff --git a/src/serialization/types/CommonContextIdValue.ts b/src/serialization/types/CommonContextIdValue.ts new file mode 100644 index 00000000..95ab2ae2 --- /dev/null +++ b/src/serialization/types/CommonContextIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonContextIdValue: core.serialization.Schema< + serializers.CommonContextIdValue.Raw, + Corti.CommonContextIdValue +> = core.serialization.string(); + +export declare namespace CommonContextIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonMcpConnector.ts b/src/serialization/types/CommonMcpConnector.ts new file mode 100644 index 00000000..98b38046 --- /dev/null +++ b/src/serialization/types/CommonMcpConnector.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonMcpConnector: core.serialization.ObjectSchema< + serializers.CommonMcpConnector.Raw, + Corti.CommonMcpConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp"), + name: core.serialization.string(), + url: core.serialization.string(), + auth: CommonConnectorAuth.optional(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonMcpConnector { + export interface Raw { + type: "mcp"; + name: string; + url: string; + auth?: CommonConnectorAuth.Raw | null; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonMcpConnectorCreate.ts b/src/serialization/types/CommonMcpConnectorCreate.ts new file mode 100644 index 00000000..6373c7b0 --- /dev/null +++ b/src/serialization/types/CommonMcpConnectorCreate.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; + +export const CommonMcpConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonMcpConnectorCreate.Raw, + Corti.CommonMcpConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp"), + name: core.serialization.string(), + url: core.serialization.string(), + enabled: core.serialization.boolean().optional(), + auth: CommonConnectorAuth.optional(), +}); + +export declare namespace CommonMcpConnectorCreate { + export interface Raw { + type: "mcp"; + name: string; + url: string; + enabled?: boolean | null; + auth?: CommonConnectorAuth.Raw | null; + } +} diff --git a/src/serialization/types/CommonMessage.ts b/src/serialization/types/CommonMessage.ts new file mode 100644 index 00000000..ebefe64c --- /dev/null +++ b/src/serialization/types/CommonMessage.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonContextIdValue } from "./CommonContextIdValue.js"; +import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; +import { CommonPart } from "./CommonPart.js"; +import { CommonRole } from "./CommonRole.js"; +import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; + +export const CommonMessage: core.serialization.ObjectSchema = + core.serialization.object({ + messageId: CommonMessageIdValue.optional(), + contextId: CommonContextIdValue.optional(), + taskId: CommonTaskIdValue.optional(), + role: CommonRole, + parts: core.serialization.list(CommonPart), + referenceTaskIds: core.serialization.list(CommonTaskIdValue).optional(), + extensions: core.serialization.list(core.serialization.string()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + }); + +export declare namespace CommonMessage { + export interface Raw { + messageId?: CommonMessageIdValue.Raw | null; + contextId?: CommonContextIdValue.Raw | null; + taskId?: CommonTaskIdValue.Raw | null; + role: CommonRole.Raw; + parts: CommonPart.Raw[]; + referenceTaskIds?: CommonTaskIdValue.Raw[] | null; + extensions?: string[] | null; + metadata?: Record | null; + } +} diff --git a/src/serialization/types/CommonMessageIdValue.ts b/src/serialization/types/CommonMessageIdValue.ts new file mode 100644 index 00000000..29d1b310 --- /dev/null +++ b/src/serialization/types/CommonMessageIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonMessageIdValue: core.serialization.Schema< + serializers.CommonMessageIdValue.Raw, + Corti.CommonMessageIdValue +> = core.serialization.string(); + +export declare namespace CommonMessageIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonNextPageToken.ts b/src/serialization/types/CommonNextPageToken.ts new file mode 100644 index 00000000..75f714c8 --- /dev/null +++ b/src/serialization/types/CommonNextPageToken.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonNextPageToken: core.serialization.Schema< + serializers.CommonNextPageToken.Raw, + Corti.CommonNextPageToken +> = core.serialization.string().nullable(); + +export declare namespace CommonNextPageToken { + export type Raw = string | null | undefined; +} diff --git a/src/serialization/types/CommonPart.ts b/src/serialization/types/CommonPart.ts new file mode 100644 index 00000000..87eed54a --- /dev/null +++ b/src/serialization/types/CommonPart.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonPart: core.serialization.ObjectSchema = + core.serialization + .object({ + text: core.serialization.string().optional(), + data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + filename: core.serialization.string().optional(), + mediaType: core.serialization.string().optional(), + raw: core.serialization.string().optional(), + url: core.serialization.string().optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + }) + .passthrough(); + +export declare namespace CommonPart { + export interface Raw { + text?: string | null; + data?: Record | null; + filename?: string | null; + mediaType?: string | null; + raw?: string | null; + url?: string | null; + metadata?: Record | null; + [key: string]: any; + } +} diff --git a/src/serialization/types/CommonRegistryConnectorCreate.ts b/src/serialization/types/CommonRegistryConnectorCreate.ts new file mode 100644 index 00000000..2fc6dc9e --- /dev/null +++ b/src/serialization/types/CommonRegistryConnectorCreate.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonRegistryConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonRegistryConnectorCreate.Raw, + Corti.CommonRegistryConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("registry"), + name: core.serialization.string(), + enabled: core.serialization.boolean().optional(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace CommonRegistryConnectorCreate { + export interface Raw { + type: "registry"; + name: string; + enabled?: boolean | null; + config?: Record | null; + } +} diff --git a/src/serialization/types/CommonRegistryConnectorProvisioned.ts b/src/serialization/types/CommonRegistryConnectorProvisioned.ts new file mode 100644 index 00000000..ebb182db --- /dev/null +++ b/src/serialization/types/CommonRegistryConnectorProvisioned.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonRegistryConnectorProvisioned: core.serialization.ObjectSchema< + serializers.CommonRegistryConnectorProvisioned.Raw, + Corti.CommonRegistryConnectorProvisioned +> = core.serialization.object({ + type: core.serialization.stringLiteral("registry"), + name: core.serialization.string(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonRegistryConnectorProvisioned { + export interface Raw { + type: "registry"; + name: string; + config?: Record | null; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonRole.ts b/src/serialization/types/CommonRole.ts new file mode 100644 index 00000000..001aaac7 --- /dev/null +++ b/src/serialization/types/CommonRole.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonRole: core.serialization.Schema = + core.serialization.enum_(["ROLE_USER", "ROLE_AGENT"]); + +export declare namespace CommonRole { + export type Raw = "ROLE_USER" | "ROLE_AGENT"; +} diff --git a/src/serialization/types/CommonSchemaConnector.ts b/src/serialization/types/CommonSchemaConnector.ts new file mode 100644 index 00000000..d596f08b --- /dev/null +++ b/src/serialization/types/CommonSchemaConnector.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; +import { CommonSchemaConnectorTransition } from "./CommonSchemaConnectorTransition.js"; + +export const CommonSchemaConnector: core.serialization.ObjectSchema< + serializers.CommonSchemaConnector.Raw, + Corti.CommonSchemaConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("schema"), + name: core.serialization.string(), + description: core.serialization.string().optional(), + schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + transition: CommonSchemaConnectorTransition.optional(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonSchemaConnector { + export interface Raw { + type: "schema"; + name: string; + description?: string | null; + schema: Record; + transition?: CommonSchemaConnectorTransition.Raw | null; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonSchemaConnectorCreate.ts b/src/serialization/types/CommonSchemaConnectorCreate.ts new file mode 100644 index 00000000..f37c77b7 --- /dev/null +++ b/src/serialization/types/CommonSchemaConnectorCreate.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonSchemaConnectorCreateTransition } from "./CommonSchemaConnectorCreateTransition.js"; + +export const CommonSchemaConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonSchemaConnectorCreate.Raw, + Corti.CommonSchemaConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("schema"), + name: core.serialization.string(), + description: core.serialization.string().optional(), + schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + transition: CommonSchemaConnectorCreateTransition.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonSchemaConnectorCreate { + export interface Raw { + type: "schema"; + name: string; + description?: string | null; + schema: Record; + transition?: CommonSchemaConnectorCreateTransition.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonSchemaConnectorCreateTransition.ts b/src/serialization/types/CommonSchemaConnectorCreateTransition.ts new file mode 100644 index 00000000..9fca7219 --- /dev/null +++ b/src/serialization/types/CommonSchemaConnectorCreateTransition.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonSchemaConnectorCreateTransition: core.serialization.Schema< + serializers.CommonSchemaConnectorCreateTransition.Raw, + Corti.CommonSchemaConnectorCreateTransition +> = core.serialization.enum_(["complete", "input_required"]); + +export declare namespace CommonSchemaConnectorCreateTransition { + export type Raw = "complete" | "input_required"; +} diff --git a/src/serialization/types/CommonSchemaConnectorTransition.ts b/src/serialization/types/CommonSchemaConnectorTransition.ts new file mode 100644 index 00000000..8e694c31 --- /dev/null +++ b/src/serialization/types/CommonSchemaConnectorTransition.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonSchemaConnectorTransition: core.serialization.Schema< + serializers.CommonSchemaConnectorTransition.Raw, + Corti.CommonSchemaConnectorTransition +> = core.serialization.enum_(["complete", "input_required"]); + +export declare namespace CommonSchemaConnectorTransition { + export type Raw = "complete" | "input_required"; +} diff --git a/src/serialization/types/AgentsMessageKind.ts b/src/serialization/types/CommonTaskIdValue.ts similarity index 56% rename from src/serialization/types/AgentsMessageKind.ts rename to src/serialization/types/CommonTaskIdValue.ts index 8ce118be..2bc1386e 100644 --- a/src/serialization/types/AgentsMessageKind.ts +++ b/src/serialization/types/CommonTaskIdValue.ts @@ -4,9 +4,9 @@ import type * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -export const AgentsMessageKind: core.serialization.Schema = - core.serialization.enum_(["message"]); +export const CommonTaskIdValue: core.serialization.Schema = + core.serialization.string(); -export declare namespace AgentsMessageKind { - export type Raw = "message"; +export declare namespace CommonTaskIdValue { + export type Raw = string; } diff --git a/src/serialization/types/CommonTaskListResponse.ts b/src/serialization/types/CommonTaskListResponse.ts new file mode 100644 index 00000000..e23a8a73 --- /dev/null +++ b/src/serialization/types/CommonTaskListResponse.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTaskResponse } from "./CommonTaskResponse.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; + +export const CommonTaskListResponse: core.serialization.ObjectSchema< + serializers.CommonTaskListResponse.Raw, + Corti.CommonTaskListResponse +> = core.serialization.object({ + pageSize: core.serialization.number().optional(), + tasks: core.serialization.list(CommonTaskResponse), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace CommonTaskListResponse { + export interface Raw { + pageSize?: number | null; + tasks: CommonTaskResponse.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/CommonTaskMetadata.ts b/src/serialization/types/CommonTaskMetadata.ts new file mode 100644 index 00000000..e7ce19ef --- /dev/null +++ b/src/serialization/types/CommonTaskMetadata.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonUsage } from "./CommonUsage.js"; + +export const CommonTaskMetadata: core.serialization.ObjectSchema< + serializers.CommonTaskMetadata.Raw, + Corti.CommonTaskMetadata +> = core.serialization + .object({ + usage: core.serialization.property("$usage", CommonUsage.optional()), + }) + .passthrough(); + +export declare namespace CommonTaskMetadata { + export interface Raw { + $usage?: CommonUsage.Raw | null; + [key: string]: any; + } +} diff --git a/src/serialization/types/CommonTaskResponse.ts b/src/serialization/types/CommonTaskResponse.ts new file mode 100644 index 00000000..9603f2ea --- /dev/null +++ b/src/serialization/types/CommonTaskResponse.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonArtifactResponse } from "./CommonArtifactResponse.js"; +import { CommonContextIdValue } from "./CommonContextIdValue.js"; +import { CommonMessage } from "./CommonMessage.js"; +import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; +import { CommonTaskMetadata } from "./CommonTaskMetadata.js"; +import { CommonTaskStatus } from "./CommonTaskStatus.js"; + +export const CommonTaskResponse: core.serialization.ObjectSchema< + serializers.CommonTaskResponse.Raw, + Corti.CommonTaskResponse +> = core.serialization.object({ + id: CommonTaskIdValue, + contextId: CommonContextIdValue, + status: CommonTaskStatus, + history: core.serialization.list(CommonMessage).optional(), + artifacts: core.serialization.list(CommonArtifactResponse).optional(), + metadata: CommonTaskMetadata.optional(), +}); + +export declare namespace CommonTaskResponse { + export interface Raw { + id: CommonTaskIdValue.Raw; + contextId: CommonContextIdValue.Raw; + status: CommonTaskStatus.Raw; + history?: CommonMessage.Raw[] | null; + artifacts?: CommonArtifactResponse.Raw[] | null; + metadata?: CommonTaskMetadata.Raw | null; + } +} diff --git a/src/serialization/types/CommonTaskState.ts b/src/serialization/types/CommonTaskState.ts new file mode 100644 index 00000000..f5142fa4 --- /dev/null +++ b/src/serialization/types/CommonTaskState.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonTaskState: core.serialization.Schema = + core.serialization.enum_([ + "TASK_STATE_SUBMITTED", + "TASK_STATE_WORKING", + "TASK_STATE_COMPLETED", + "TASK_STATE_FAILED", + "TASK_STATE_CANCELED", + "TASK_STATE_INPUT_REQUIRED", + "TASK_STATE_REJECTED", + "TASK_STATE_AUTH_REQUIRED", + ]); + +export declare namespace CommonTaskState { + export type Raw = + | "TASK_STATE_SUBMITTED" + | "TASK_STATE_WORKING" + | "TASK_STATE_COMPLETED" + | "TASK_STATE_FAILED" + | "TASK_STATE_CANCELED" + | "TASK_STATE_INPUT_REQUIRED" + | "TASK_STATE_REJECTED" + | "TASK_STATE_AUTH_REQUIRED"; +} diff --git a/src/serialization/types/CommonTaskStatus.ts b/src/serialization/types/CommonTaskStatus.ts new file mode 100644 index 00000000..80c2e3ad --- /dev/null +++ b/src/serialization/types/CommonTaskStatus.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonMessage } from "./CommonMessage.js"; +import { CommonTaskState } from "./CommonTaskState.js"; + +export const CommonTaskStatus: core.serialization.ObjectSchema< + serializers.CommonTaskStatus.Raw, + Corti.CommonTaskStatus +> = core.serialization.object({ + state: CommonTaskState, + message: CommonMessage.optional(), + timestamp: core.serialization.date().optional(), +}); + +export declare namespace CommonTaskStatus { + export interface Raw { + state: CommonTaskState.Raw; + message?: CommonMessage.Raw | null; + timestamp?: string | null; + } +} diff --git a/src/serialization/types/CommonTotalSize.ts b/src/serialization/types/CommonTotalSize.ts new file mode 100644 index 00000000..c0ed29e6 --- /dev/null +++ b/src/serialization/types/CommonTotalSize.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonTotalSize: core.serialization.Schema = + core.serialization.number(); + +export declare namespace CommonTotalSize { + export type Raw = number; +} diff --git a/src/serialization/types/CommonUsage.ts b/src/serialization/types/CommonUsage.ts new file mode 100644 index 00000000..67699121 --- /dev/null +++ b/src/serialization/types/CommonUsage.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonUsage: core.serialization.ObjectSchema = + core.serialization.object({ + model: core.serialization.string().optional(), + inputTokens: core.serialization.number(), + outputTokens: core.serialization.number(), + cachedInputTokens: core.serialization.number().optional(), + cacheCreationInputTokens: core.serialization.number().optional(), + totalTokens: core.serialization.number(), + credits: core.serialization.number().optional(), + }); + +export declare namespace CommonUsage { + export interface Raw { + model?: string | null; + inputTokens: number; + outputTokens: number; + cachedInputTokens?: number | null; + cacheCreationInputTokens?: number | null; + totalTokens: number; + credits?: number | null; + } +} diff --git a/src/serialization/types/ConnectorsListResponse.ts b/src/serialization/types/ConnectorsListResponse.ts new file mode 100644 index 00000000..42c70c3b --- /dev/null +++ b/src/serialization/types/ConnectorsListResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; + +export const ConnectorsListResponse: core.serialization.ObjectSchema< + serializers.ConnectorsListResponse.Raw, + Corti.ConnectorsListResponse +> = core.serialization.object({ + connectors: core.serialization.list(CommonConnectorResponse), +}); + +export declare namespace ConnectorsListResponse { + export interface Raw { + connectors: CommonConnectorResponse.Raw[]; + } +} diff --git a/src/serialization/types/Contexts.ts b/src/serialization/types/Contexts.ts new file mode 100644 index 00000000..aa1c12dc --- /dev/null +++ b/src/serialization/types/Contexts.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; +import { CommonContextIdValue } from "./CommonContextIdValue.js"; + +export const Contexts: core.serialization.ObjectSchema = + core.serialization.object({ + id: CommonContextIdValue, + agentId: CommonAgentIdValue.optional(), + taskCount: core.serialization.number().optional(), + createdAt: core.serialization.date().optional(), + updatedAt: core.serialization.date().optional(), + expiresAt: core.serialization.date().optionalNullable(), + }); + +export declare namespace Contexts { + export interface Raw { + id: CommonContextIdValue.Raw; + agentId?: CommonAgentIdValue.Raw | null; + taskCount?: number | null; + createdAt?: string | null; + updatedAt?: string | null; + expiresAt?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/ContextsDetailResponse.ts b/src/serialization/types/ContextsDetailResponse.ts new file mode 100644 index 00000000..3057a895 --- /dev/null +++ b/src/serialization/types/ContextsDetailResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonTaskResponse } from "./CommonTaskResponse.js"; +import { Contexts } from "./Contexts.js"; + +export const ContextsDetailResponse: core.serialization.ObjectSchema< + serializers.ContextsDetailResponse.Raw, + Corti.ContextsDetailResponse +> = core.serialization + .object({ + tasks: core.serialization.list(CommonTaskResponse), + }) + .extend(Contexts); + +export declare namespace ContextsDetailResponse { + export interface Raw extends Contexts.Raw { + tasks: CommonTaskResponse.Raw[]; + } +} diff --git a/src/serialization/types/ContextsOpenInferenceSpan.ts b/src/serialization/types/ContextsOpenInferenceSpan.ts new file mode 100644 index 00000000..e8d958cd --- /dev/null +++ b/src/serialization/types/ContextsOpenInferenceSpan.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ContextsOpenInferenceSpan: core.serialization.ObjectSchema< + serializers.ContextsOpenInferenceSpan.Raw, + Corti.ContextsOpenInferenceSpan +> = core.serialization.object({ + name: core.serialization.string(), + spanId: core.serialization.property("span_id", core.serialization.string()), + parentSpanId: core.serialization.property("parent_span_id", core.serialization.string().optional()), + startTime: core.serialization.property("start_time", core.serialization.date()), + endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), + attributes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace ContextsOpenInferenceSpan { + export interface Raw { + name: string; + span_id: string; + parent_span_id?: string | null; + start_time: string; + end_time?: (string | null | undefined) | null; + attributes?: Record | null; + } +} diff --git a/src/serialization/types/ContextsTraceItem.ts b/src/serialization/types/ContextsTraceItem.ts new file mode 100644 index 00000000..7b2ec7f8 --- /dev/null +++ b/src/serialization/types/ContextsTraceItem.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ContextsOpenInferenceSpan } from "./ContextsOpenInferenceSpan.js"; +import { ContextsTraceItemTrace } from "./ContextsTraceItemTrace.js"; + +export const ContextsTraceItem: core.serialization.ObjectSchema< + serializers.ContextsTraceItem.Raw, + Corti.ContextsTraceItem +> = core.serialization.object({ + trace: ContextsTraceItemTrace, + spans: core.serialization.list(ContextsOpenInferenceSpan), +}); + +export declare namespace ContextsTraceItem { + export interface Raw { + trace: ContextsTraceItemTrace.Raw; + spans: ContextsOpenInferenceSpan.Raw[]; + } +} diff --git a/src/serialization/types/ContextsTraceItemTrace.ts b/src/serialization/types/ContextsTraceItemTrace.ts new file mode 100644 index 00000000..75e2f533 --- /dev/null +++ b/src/serialization/types/ContextsTraceItemTrace.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ContextsTraceItemTrace: core.serialization.ObjectSchema< + serializers.ContextsTraceItemTrace.Raw, + Corti.ContextsTraceItemTrace +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + startTime: core.serialization.property("start_time", core.serialization.date()), + endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), + input: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + output: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + threadId: core.serialization.property("thread_id", core.serialization.string()), +}); + +export declare namespace ContextsTraceItemTrace { + export interface Raw { + id: string; + name: string; + start_time: string; + end_time?: (string | null | undefined) | null; + input?: Record | null; + output?: Record | null; + metadata?: Record | null; + tags?: string[] | null; + thread_id: string; + } +} diff --git a/src/serialization/types/ContextsTraceResponse.ts b/src/serialization/types/ContextsTraceResponse.ts new file mode 100644 index 00000000..b06ecbc9 --- /dev/null +++ b/src/serialization/types/ContextsTraceResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; +import { ContextsTraceItem } from "./ContextsTraceItem.js"; + +export const ContextsTraceResponse: core.serialization.ObjectSchema< + serializers.ContextsTraceResponse.Raw, + Corti.ContextsTraceResponse +> = core.serialization.object({ + traces: core.serialization.list(ContextsTraceItem), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace ContextsTraceResponse { + export interface Raw { + traces: ContextsTraceItem.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/FeedbackActor.ts b/src/serialization/types/FeedbackActor.ts new file mode 100644 index 00000000..feb0d51f --- /dev/null +++ b/src/serialization/types/FeedbackActor.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackActor: core.serialization.ObjectSchema = + core.serialization.object({ + externalId: core.serialization.string(), + }); + +export declare namespace FeedbackActor { + export interface Raw { + externalId: string; + } +} diff --git a/src/serialization/types/FeedbackIdValue.ts b/src/serialization/types/FeedbackIdValue.ts new file mode 100644 index 00000000..21dfa05f --- /dev/null +++ b/src/serialization/types/FeedbackIdValue.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackIdValue: core.serialization.Schema = + core.serialization.string(); + +export declare namespace FeedbackIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/FeedbackLabel.ts b/src/serialization/types/FeedbackLabel.ts new file mode 100644 index 00000000..dee3b08b --- /dev/null +++ b/src/serialization/types/FeedbackLabel.ts @@ -0,0 +1,41 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackLabel: core.serialization.Schema = + core.serialization.enum_([ + "correct", + "complete", + "helpful", + "wellPresented", + "efficient", + "incorrect", + "missingInformation", + "irrelevant", + "misunderstoodRequest", + "unsupportedClaim", + "unsafeOrInappropriate", + "poorlyPresented", + "tooVerbose", + "other", + ]); + +export declare namespace FeedbackLabel { + export type Raw = + | "correct" + | "complete" + | "helpful" + | "wellPresented" + | "efficient" + | "incorrect" + | "missingInformation" + | "irrelevant" + | "misunderstoodRequest" + | "unsupportedClaim" + | "unsafeOrInappropriate" + | "poorlyPresented" + | "tooVerbose" + | "other"; +} diff --git a/src/serialization/types/FeedbackListResponse.ts b/src/serialization/types/FeedbackListResponse.ts new file mode 100644 index 00000000..1a1cb098 --- /dev/null +++ b/src/serialization/types/FeedbackListResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { FeedbackResponse } from "./FeedbackResponse.js"; + +export const FeedbackListResponse: core.serialization.ObjectSchema< + serializers.FeedbackListResponse.Raw, + Corti.FeedbackListResponse +> = core.serialization.object({ + feedbacks: core.serialization.list(FeedbackResponse), +}); + +export declare namespace FeedbackListResponse { + export interface Raw { + feedbacks: FeedbackResponse.Raw[]; + } +} diff --git a/src/serialization/types/FeedbackMetadata.ts b/src/serialization/types/FeedbackMetadata.ts new file mode 100644 index 00000000..162c3f90 --- /dev/null +++ b/src/serialization/types/FeedbackMetadata.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { FeedbackActor } from "./FeedbackActor.js"; + +export const FeedbackMetadata: core.serialization.ObjectSchema< + serializers.FeedbackMetadata.Raw, + Corti.FeedbackMetadata +> = core.serialization.object({ + collectionMethod: core.serialization.string().optional(), + clientReference: core.serialization.string().optional(), + actor: FeedbackActor.optional(), +}); + +export declare namespace FeedbackMetadata { + export interface Raw { + collectionMethod?: string | null; + clientReference?: string | null; + actor?: FeedbackActor.Raw | null; + } +} diff --git a/src/serialization/types/FeedbackRating.ts b/src/serialization/types/FeedbackRating.ts new file mode 100644 index 00000000..87e5c7ca --- /dev/null +++ b/src/serialization/types/FeedbackRating.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { FeedbackRatingScale } from "./FeedbackRatingScale.js"; + +export const FeedbackRating: core.serialization.ObjectSchema = + core.serialization.object({ + scale: FeedbackRatingScale, + value: core.serialization.number(), + }); + +export declare namespace FeedbackRating { + export interface Raw { + scale: FeedbackRatingScale.Raw; + value: number; + } +} diff --git a/src/serialization/types/FeedbackRatingScale.ts b/src/serialization/types/FeedbackRatingScale.ts new file mode 100644 index 00000000..ebbeb7ba --- /dev/null +++ b/src/serialization/types/FeedbackRatingScale.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackRatingScale: core.serialization.Schema< + serializers.FeedbackRatingScale.Raw, + Corti.FeedbackRatingScale +> = core.serialization.enum_(["binary"]); + +export declare namespace FeedbackRatingScale { + export type Raw = "binary"; +} diff --git a/src/serialization/types/FeedbackResponse.ts b/src/serialization/types/FeedbackResponse.ts new file mode 100644 index 00000000..975ea339 --- /dev/null +++ b/src/serialization/types/FeedbackResponse.ts @@ -0,0 +1,40 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; +import { FeedbackIdValue } from "./FeedbackIdValue.js"; +import { FeedbackLabel } from "./FeedbackLabel.js"; +import { FeedbackMetadata } from "./FeedbackMetadata.js"; +import { FeedbackRating } from "./FeedbackRating.js"; +import { FeedbackTarget } from "./FeedbackTarget.js"; + +export const FeedbackResponse: core.serialization.ObjectSchema< + serializers.FeedbackResponse.Raw, + Corti.FeedbackResponse +> = core.serialization.object({ + id: FeedbackIdValue, + taskId: CommonTaskIdValue, + rating: FeedbackRating, + normalizedScore: core.serialization.number(), + labels: core.serialization.list(FeedbackLabel), + reason: core.serialization.string().optional(), + target: FeedbackTarget.optional(), + metadata: FeedbackMetadata.optional(), + createdAt: core.serialization.date().optional(), +}); + +export declare namespace FeedbackResponse { + export interface Raw { + id: FeedbackIdValue.Raw; + taskId: CommonTaskIdValue.Raw; + rating: FeedbackRating.Raw; + normalizedScore: number; + labels: FeedbackLabel.Raw[]; + reason?: string | null; + target?: FeedbackTarget.Raw | null; + metadata?: FeedbackMetadata.Raw | null; + createdAt?: string | null; + } +} diff --git a/src/serialization/types/FeedbackTarget.ts b/src/serialization/types/FeedbackTarget.ts new file mode 100644 index 00000000..fa3ed123 --- /dev/null +++ b/src/serialization/types/FeedbackTarget.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; + +export const FeedbackTarget: core.serialization.ObjectSchema = + core.serialization.object({ + messageId: CommonMessageIdValue, + }); + +export declare namespace FeedbackTarget { + export interface Raw { + messageId: CommonMessageIdValue.Raw; + } +} diff --git a/src/serialization/types/RegistryConnectorCapabilities.ts b/src/serialization/types/RegistryConnectorCapabilities.ts new file mode 100644 index 00000000..fed6df20 --- /dev/null +++ b/src/serialization/types/RegistryConnectorCapabilities.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const RegistryConnectorCapabilities: core.serialization.ObjectSchema< + serializers.RegistryConnectorCapabilities.Raw, + Corti.RegistryConnectorCapabilities +> = core.serialization.object({ + streaming: core.serialization.boolean().optional(), + inputModes: core.serialization.list(core.serialization.string()).optional(), + outputModes: core.serialization.list(core.serialization.string()).optional(), + tools: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace RegistryConnectorCapabilities { + export interface Raw { + streaming?: boolean | null; + inputModes?: string[] | null; + outputModes?: string[] | null; + tools?: string[] | null; + } +} diff --git a/src/serialization/types/RegistryConnectorListResponse.ts b/src/serialization/types/RegistryConnectorListResponse.ts new file mode 100644 index 00000000..f31cb6bb --- /dev/null +++ b/src/serialization/types/RegistryConnectorListResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; +import { RegistryConnectorResponse } from "./RegistryConnectorResponse.js"; + +export const RegistryConnectorListResponse: core.serialization.ObjectSchema< + serializers.RegistryConnectorListResponse.Raw, + Corti.RegistryConnectorListResponse +> = core.serialization.object({ + connectors: core.serialization.list(RegistryConnectorResponse), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace RegistryConnectorListResponse { + export interface Raw { + connectors: RegistryConnectorResponse.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/RegistryConnectorResponse.ts b/src/serialization/types/RegistryConnectorResponse.ts new file mode 100644 index 00000000..40a2c9df --- /dev/null +++ b/src/serialization/types/RegistryConnectorResponse.ts @@ -0,0 +1,45 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorType } from "./CommonConnectorType.js"; +import { RegistryConnectorCapabilities } from "./RegistryConnectorCapabilities.js"; +import { RegistryIcon } from "./RegistryIcon.js"; + +export const RegistryConnectorResponse: core.serialization.ObjectSchema< + serializers.RegistryConnectorResponse.Raw, + Corti.RegistryConnectorResponse +> = core.serialization.object({ + id: core.serialization.string(), + type: CommonConnectorType, + name: core.serialization.string(), + title: core.serialization.string().optional(), + description: core.serialization.string().optional(), + version: core.serialization.string().optional(), + icons: core.serialization.list(RegistryIcon).optional(), + provider: core.serialization.string().optional(), + websiteUrl: core.serialization.string().optional(), + documentationUrl: core.serialization.string().optional(), + capabilities: RegistryConnectorCapabilities.optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + configSchema: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace RegistryConnectorResponse { + export interface Raw { + id: string; + type: CommonConnectorType.Raw; + name: string; + title?: string | null; + description?: string | null; + version?: string | null; + icons?: RegistryIcon.Raw[] | null; + provider?: string | null; + websiteUrl?: string | null; + documentationUrl?: string | null; + capabilities?: RegistryConnectorCapabilities.Raw | null; + tags?: string[] | null; + configSchema?: Record | null; + } +} diff --git a/src/serialization/types/RegistryIcon.ts b/src/serialization/types/RegistryIcon.ts new file mode 100644 index 00000000..775dc0fe --- /dev/null +++ b/src/serialization/types/RegistryIcon.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const RegistryIcon: core.serialization.ObjectSchema = + core.serialization.object({ + src: core.serialization.string(), + mimeType: core.serialization.string().optional(), + sizes: core.serialization.list(core.serialization.string()).optional(), + }); + +export declare namespace RegistryIcon { + export interface Raw { + src: string; + mimeType?: string | null; + sizes?: string[] | null; + } +} diff --git a/src/serialization/types/UsageBucket.ts b/src/serialization/types/UsageBucket.ts new file mode 100644 index 00000000..cd9c0006 --- /dev/null +++ b/src/serialization/types/UsageBucket.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { UsageMetrics } from "./UsageMetrics.js"; + +export const UsageBucket: core.serialization.ObjectSchema = + core.serialization + .object({ + periodStart: core.serialization.date(), + periodEnd: core.serialization.date(), + }) + .extend(UsageMetrics); + +export declare namespace UsageBucket { + export interface Raw extends UsageMetrics.Raw { + periodStart: string; + periodEnd: string; + } +} diff --git a/src/serialization/types/UsageGranularity.ts b/src/serialization/types/UsageGranularity.ts new file mode 100644 index 00000000..2f3edc3a --- /dev/null +++ b/src/serialization/types/UsageGranularity.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const UsageGranularity: core.serialization.Schema = + core.serialization.enum_(["minute", "hour", "day", "week"]); + +export declare namespace UsageGranularity { + export type Raw = "minute" | "hour" | "day" | "week"; +} diff --git a/src/serialization/types/UsageMetrics.ts b/src/serialization/types/UsageMetrics.ts new file mode 100644 index 00000000..dff2cb76 --- /dev/null +++ b/src/serialization/types/UsageMetrics.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const UsageMetrics: core.serialization.ObjectSchema = + core.serialization.object({ + invocations: core.serialization.number(), + uniqueContexts: core.serialization.number(), + }); + +export declare namespace UsageMetrics { + export interface Raw { + invocations: number; + uniqueContexts: number; + } +} diff --git a/src/serialization/types/UsageReportResponse.ts b/src/serialization/types/UsageReportResponse.ts new file mode 100644 index 00000000..564744e9 --- /dev/null +++ b/src/serialization/types/UsageReportResponse.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { UsageBucket } from "./UsageBucket.js"; +import { UsageGranularity } from "./UsageGranularity.js"; +import { UsageMetrics } from "./UsageMetrics.js"; + +export const UsageReportResponse: core.serialization.ObjectSchema< + serializers.UsageReportResponse.Raw, + Corti.UsageReportResponse +> = core.serialization.object({ + granularity: UsageGranularity, + from: core.serialization.date(), + to: core.serialization.date(), + totals: UsageMetrics, + buckets: core.serialization.list(UsageBucket), +}); + +export declare namespace UsageReportResponse { + export interface Raw { + granularity: UsageGranularity.Raw; + from: string; + to: string; + totals: UsageMetrics.Raw; + buckets: UsageBucket.Raw[]; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 7ce73b9e..65634424 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,57 +1,23 @@ -export * from "./AgentsAgent.js"; -export * from "./AgentsAgentCapabilities.js"; -export * from "./AgentsAgentCard.js"; -export * from "./AgentsAgentCardSignature.js"; -export * from "./AgentsAgentExpertsItem.js"; -export * from "./AgentsAgentExtension.js"; -export * from "./AgentsAgentInterface.js"; -export * from "./AgentsAgentProvider.js"; -export * from "./AgentsAgentReference.js"; -export * from "./AgentsAgentReferenceType.js"; -export * from "./AgentsAgentResponse.js"; -export * from "./AgentsAgentSkill.js"; -export * from "./AgentsArtifact.js"; -export * from "./AgentsContext.js"; -export * from "./AgentsContextItemsItem.js"; -export * from "./AgentsCreateExpert.js"; -export * from "./AgentsCreateExpertReference.js"; -export * from "./AgentsCreateExpertReferenceType.js"; -export * from "./AgentsCreateExpertType.js"; -export * from "./AgentsCreateMcpServer.js"; -export * from "./AgentsCreateMcpServerAuthorizationType.js"; -export * from "./AgentsCreateMcpServerTransportType.js"; -export * from "./AgentsDataPart.js"; -export * from "./AgentsDataPartKind.js"; -export * from "./AgentsExpert.js"; -export * from "./AgentsExpertReference.js"; -export * from "./AgentsExpertReferenceType.js"; -export * from "./AgentsExpertType.js"; -export * from "./AgentsFilePart.js"; -export * from "./AgentsFilePartFile.js"; -export * from "./AgentsFilePartKind.js"; -export * from "./AgentsFileWithBytes.js"; -export * from "./AgentsFileWithUri.js"; -export * from "./AgentsMcpServer.js"; -export * from "./AgentsMcpServerAuthorizationType.js"; -export * from "./AgentsMcpServerTransportType.js"; -export * from "./AgentsMessage.js"; -export * from "./AgentsMessageKind.js"; -export * from "./AgentsMessageRole.js"; -export * from "./AgentsMessageSendConfiguration.js"; -export * from "./AgentsPart.js"; -export * from "./AgentsPushNotificationAuthenticationInfo.js"; -export * from "./AgentsPushNotificationConfig.js"; -export * from "./AgentsRegistryExpert.js"; -export * from "./AgentsRegistryExpertsResponse.js"; -export * from "./AgentsRegistryMcpServer.js"; -export * from "./AgentsRegistryMcpServerAuthorizationType.js"; -export * from "./AgentsTask.js"; -export * from "./AgentsTaskKind.js"; -export * from "./AgentsTaskStatus.js"; -export * from "./AgentsTaskStatusState.js"; -export * from "./AgentsTextPart.js"; -export * from "./AgentsTextPartKind.js"; -export * from "./AgentsUpdateExpertReference.js"; +export * from "./A2AjsonrpcResponse.js"; +export * from "./A2AjsonrpcResponseError.js"; +export * from "./A2AjsonrpcResponseId.js"; +export * from "./A2ASendMessageConfiguration.js"; +export * from "./A2ASendMessageRequest.js"; +export * from "./A2ASendMessageResponse.js"; +export * from "./A2AStreamEventResponse.js"; +export * from "./AgentCardResponse.js"; +export * from "./AgentCardResponseCapabilities.js"; +export * from "./AgentCardResponseProvider.js"; +export * from "./AgentCardResponseSignaturesItem.js"; +export * from "./AgentCardResponseSkillsItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; +export * from "./AgentsLabels.js"; +export * from "./AgentsLifecycle.js"; +export * from "./AgentsListResponse.js"; +export * from "./AgentsResponse.js"; +export * from "./AgentsUserIdValue.js"; +export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -63,20 +29,62 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; +export * from "./CommonA2AConnector.js"; +export * from "./CommonA2AConnectorCreate.js"; +export * from "./CommonAgentConnector.js"; +export * from "./CommonAgentConnectorCreate.js"; +export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; +export * from "./CommonArtifactIdValue.js"; +export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; +export * from "./CommonConnectorAuth.js"; +export * from "./CommonConnectorAuthType.js"; +export * from "./CommonConnectorCreateRequest.js"; +export * from "./CommonConnectorIdValue.js"; +export * from "./CommonConnectorResponse.js"; +export * from "./CommonConnectorType.js"; +export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; export * from "./CommonFactsContext.js"; +export * from "./CommonMcpConnector.js"; +export * from "./CommonMcpConnectorCreate.js"; +export * from "./CommonMessage.js"; +export * from "./CommonMessageIdValue.js"; +export * from "./CommonNextPageToken.js"; +export * from "./CommonPart.js"; +export * from "./CommonRegistryConnectorCreate.js"; +export * from "./CommonRegistryConnectorProvisioned.js"; +export * from "./CommonRole.js"; +export * from "./CommonSchemaConnector.js"; +export * from "./CommonSchemaConnectorCreate.js"; +export * from "./CommonSchemaConnectorCreateTransition.js"; +export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; +export * from "./CommonTaskIdValue.js"; +export * from "./CommonTaskListResponse.js"; +export * from "./CommonTaskMetadata.js"; +export * from "./CommonTaskResponse.js"; +export * from "./CommonTaskState.js"; +export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; +export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; +export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; +export * from "./ConnectorsListResponse.js"; +export * from "./Contexts.js"; +export * from "./ContextsDetailResponse.js"; +export * from "./ContextsOpenInferenceSpan.js"; +export * from "./ContextsTraceItem.js"; +export * from "./ContextsTraceItemTrace.js"; +export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -112,6 +120,15 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; +export * from "./FeedbackActor.js"; +export * from "./FeedbackIdValue.js"; +export * from "./FeedbackLabel.js"; +export * from "./FeedbackListResponse.js"; +export * from "./FeedbackMetadata.js"; +export * from "./FeedbackRating.js"; +export * from "./FeedbackRatingScale.js"; +export * from "./FeedbackResponse.js"; +export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -187,6 +204,10 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; +export * from "./RegistryConnectorCapabilities.js"; +export * from "./RegistryConnectorListResponse.js"; +export * from "./RegistryConnectorResponse.js"; +export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -273,4 +294,8 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; +export * from "./UsageBucket.js"; +export * from "./UsageGranularity.js"; +export * from "./UsageMetrics.js"; +export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/tests/unit/stream/Stream.test.ts b/tests/unit/stream/Stream.test.ts new file mode 100644 index 00000000..83575f07 --- /dev/null +++ b/tests/unit/stream/Stream.test.ts @@ -0,0 +1,563 @@ +import { Stream } from "../../../src/core/stream/Stream"; + +describe("Stream", () => { + describe("JSON streaming", () => { + it("should parse single JSON message", async () => { + const mockStream = createReadableStream(['{"value": 1}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should parse multiple JSON messages", async () => { + const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); + }); + + it("should handle messages split across chunks", async () => { + const mockStream = createReadableStream(['{"val', 'ue": 1}\n{"value":', " 2}\n"]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + + it("should skip empty lines", async () => { + const mockStream = createReadableStream(['{"value": 1}\n\n\n{"value": 2}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + + it("should handle custom message terminator", async () => { + const mockStream = createReadableStream(['{"value": 1}|||{"value": 2}|||']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "|||" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + }); + + describe("SSE streaming", () => { + it("should parse SSE data with prefix", async () => { + const mockStream = createReadableStream(['data: {"value": 1}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should parse multiple SSE events", async () => { + const mockStream = createReadableStream(['data: {"value": 1}\ndata: {"value": 2}\ndata: {"value": 3}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); + }); + + it("should stop at stream terminator", async () => { + const mockStream = createReadableStream(['data: {"value": 1}\ndata: [DONE]\ndata: {"value": 2}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse", streamTerminator: "[DONE]" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should skip lines without data prefix", async () => { + const mockStream = createReadableStream([ + 'event: message\ndata: {"value": 1}\nid: 123\ndata: {"value": 2}\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + }); + + describe("SSE event-level discrimination (inject discriminator)", () => { + it("should inject event type as discriminator into JSON data", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"content": "hello"}\n\nevent: completion\ndata: {"content": "world"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([ + { type: "completion", content: "hello" }, + { type: "completion", content: "world" }, + ]); + }); + + it("should inject different event types for mixed events", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"content": "hi"}\n\nevent: error\ndata: {"message": "fail"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "event" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([ + { event: "completion", content: "hi" }, + { event: "error", message: "fail" }, + ]); + }); + + it("should not inject if data already contains discriminator key", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"type": "existing", "content": "hello"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "existing", content: "hello" }]); + }); + + it("should not false-positive when discriminator key appears inside a value", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"description": "type: foo", "content": "hello"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", description: "type: foo", content: "hello" }]); + }); + + it("should not inject if no event field is present", async () => { + const mockStream = createReadableStream(['data: {"content": "hello"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ content: "hello" }]); + }); + + it("should handle empty JSON object", async () => { + const mockStream = createReadableStream(["event: heartbeat\ndata: {}\n\n"]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "heartbeat" }]); + }); + + it("should stop at stream terminator", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"content": "hi"}\n\nevent: done\ndata: [DONE]\n\nevent: completion\ndata: {"content": "bye"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type", streamTerminator: "[DONE]" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", content: "hi" }]); + }); + + it("should concatenate multiline data fields", async () => { + const mockStream = createReadableStream(['event: completion\ndata: {"delta":\ndata: "hello"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", delta: "hello" }]); + }); + + it("should handle events split across chunks", async () => { + const mockStream = createReadableStream(["event: comple", 'tion\ndata: {"con', 'tent": "hi"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", content: "hi" }]); + }); + + it("should handle last event without trailing blank line", async () => { + const mockStream = createReadableStream(['event: completion\ndata: {"content": "hi"}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", content: "hi" }]); + }); + + it("should handle CRLF line endings", async () => { + const mockStream = createReadableStream([ + 'event: completion\r\ndata: {"content": "hi"}\r\n\r\nevent: completion\r\ndata: {"content": "world"}\r\n\r\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([ + { type: "completion", content: "hi" }, + { type: "completion", content: "world" }, + ]); + }); + + it("should inject empty string discriminator when event field is present but empty", async () => { + const mockStream = createReadableStream(['event: \ndata: {"content": "hello"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "", content: "hello" }]); + }); + }); + + describe("encoding and decoding", () => { + it("should decode UTF-8 text using TextDecoder", async () => { + const encoder = new TextEncoder(); + const mockStream = createReadableStream([encoder.encode('{"text": "café"}\n')]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { text: string }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ text: "café" }]); + }); + + it("should decode emoji correctly", async () => { + const encoder = new TextEncoder(); + const mockStream = createReadableStream([encoder.encode('{"emoji": "🎉"}\n')]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { emoji: string }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ emoji: "🎉" }]); + }); + + it("should handle binary data chunks", async () => { + const encoder = new TextEncoder(); + const mockStream = createReadableStream([encoder.encode('{"val'), encoder.encode('ue": 1}\n')]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should handle multi-byte UTF-8 characters split across chunk boundaries", async () => { + // Test string with Japanese (3 bytes), Russian (2 bytes), German (2 bytes), and Chinese (3 bytes) + const testString = '{"text": "こんにちは Привет Größe 你好"}\n'; + const fullBytes = new TextEncoder().encode(testString); + + // Split the bytes in the middle of multi-byte characters + // Japanese "こ" starts at byte 11, is 3 bytes (E3 81 93) + // Split after first byte of "こ" to test mid-character splitting + const splitPoint = 12; // This splits "こ" in the middle + const chunk1 = fullBytes.slice(0, splitPoint); + const chunk2 = fullBytes.slice(splitPoint); + + const mockStream = createReadableStream([chunk1, chunk2]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { text: string }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ text: "こんにちは Привет Größe 你好" }]); + }); + }); + + describe("abort signal", () => { + it("should handle abort signal", async () => { + const controller = new AbortController(); + const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + signal: controller.signal, + }); + + const messages: unknown[] = []; + let count = 0; + for await (const message of stream) { + messages.push(message); + count++; + if (count === 2) { + controller.abort(); + break; + } + } + + expect(messages.length).toBe(2); + }); + }); + + describe("async iteration", () => { + it("should support async iterator protocol", async () => { + const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const iterator = stream[Symbol.asyncIterator](); + const first = await iterator.next(); + expect(first.done).toBe(false); + expect(first.value).toEqual({ value: 1 }); + + const second = await iterator.next(); + expect(second.done).toBe(false); + expect(second.value).toEqual({ value: 2 }); + + const third = await iterator.next(); + expect(third.done).toBe(true); + }); + }); + + describe("edge cases", () => { + it("should handle empty stream", async () => { + const mockStream = createReadableStream([]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([]); + }); + + it("should handle stream with only whitespace", async () => { + const mockStream = createReadableStream([" \n\n\t\n "]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([]); + }); + + it("should handle incomplete message at end of stream", async () => { + const mockStream = createReadableStream(['{"value": 1}\n{"incomplete']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + }); +}); + +// Helper function to create a ReadableStream from string chunks +function createReadableStream(chunks: (string | Uint8Array)[]): ReadableStream { + // For standard type, return ReadableStream + let index = 0; + return new ReadableStream({ + pull(controller) { + if (index < chunks.length) { + const chunk = chunks[index++]; + controller.enqueue(typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk); + } else { + controller.close(); + } + }, + }); +} diff --git a/tests/wire/agents.test.ts b/tests/wire/agents.test.ts index 9e0692d2..65487e47 100644 --- a/tests/wire/agents.test.ts +++ b/tests/wire/agents.test.ts @@ -14,58 +14,81 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawResponseBody = [ - { - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ - { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - }, - ], - mcpServers: [{ id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }], - }, - ]; - - server.mockEndpoint().get("/agents").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.agents.list(); - expect(response).toEqual([ - { - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ - { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - }, - ], - mcpServers: [ - { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - url: "url", + const rawResponseBody = { + agents: [ + { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "description", + systemPrompt: "systemPrompt", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + labels: { key: "value" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint({ once: false }) + .get("/v2/agentic/agents") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + agents: [ + { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "description", + systemPrompt: "systemPrompt", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + labels: { + key: "value", }, - ], - }, - ]); + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + const page = await client.agents.list({ + label: ["team=coding"], + q: "coder", + }); + + expect(expected.agents).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.agents).toEqual(nextPage.data); }); test("list (2)", async () => { @@ -76,13 +99,12 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { return await client.agents.list(); @@ -97,13 +119,12 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { return await client.agents.list(); @@ -118,43 +139,70 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "name", description: "description" }; - const rawResponseBody = { - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ + const rawRequestBody = { + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { type: "registry", name: "@dedalus/coding-expert" }, { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - mcpServers: [ - { id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }, - ], + type: "mcp", + name: "policybot", + url: "https://mcp.example.com", + auth: { + type: "oauth2", + scope: "read:policies", + redirectUrl: "https://app.corti.ai/oauth/callback", + }, + }, + { + type: "schema", + name: "submit_code", + description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + schema: { + type: "object", + properties: { + code: { type: "string", description: "The selected ICD-10 code." }, + confidence: { type: "number", minimum: 0, maximum: 1 }, + }, + required: ["code"], + }, + transition: "complete", }, ], - mcpServers: [ + labels: { team: "coding", env: "prod" }, + }; + const rawResponseBody = { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - authorizationScope: "authorizationScope", - url: "url", - redirectUrl: "redirectUrl", + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, }, ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }; server .mockEndpoint() - .post("/agents") + .post("/v2/agentic/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -162,43 +210,80 @@ describe("AgentsClient", () => { .build(); const response = await client.agents.create({ - name: "name", - description: "description", - }); - expect(response).toEqual({ - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - mcpServers: [ - { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - url: "url", + type: "registry", + name: "@dedalus/coding-expert", + }, + { + type: "mcp", + name: "policybot", + url: "https://mcp.example.com", + auth: { + type: "oauth2", + scope: "read:policies", + redirectUrl: "https://app.corti.ai/oauth/callback", + }, + }, + { + type: "schema", + name: "submit_code", + description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + schema: { + type: "object", + properties: { + code: { + type: "string", + description: "The selected ICD-10 code.", + }, + confidence: { + type: "number", + minimum: 0, + maximum: 1, + }, }, - ], + required: ["code"], + }, + transition: "complete", }, ], - mcpServers: [ + labels: { + team: "coding", + env: "prod", + }, + }); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - authorizationScope: "authorizationScope", - url: "url", - redirectUrl: "redirectUrl", + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, }, ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }); }); @@ -210,15 +295,14 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "name", description: "description" }; + const rawRequestBody = { name: "x" }; const rawResponseBody = { key: "value" }; server .mockEndpoint() - .post("/agents") + .post("/v2/agentic/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -227,8 +311,7 @@ describe("AgentsClient", () => { await expect(async () => { return await client.agents.create({ - name: "name", - description: "description", + name: "x", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -241,15 +324,14 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "name", description: "description" }; + const rawRequestBody = { name: "x" }; const rawResponseBody = { key: "value" }; server .mockEndpoint() - .post("/agents") + .post("/v2/agentic/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(401) @@ -258,8 +340,7 @@ describe("AgentsClient", () => { await expect(async () => { return await client.agents.create({ - name: "name", - description: "description", + name: "x", }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -272,15 +353,72 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "name", description: "description" }; + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.create({ + name: "x", + }); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.create({ + name: "x", + }); + }).rejects.toThrow(Corti.ConflictError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; const rawResponseBody = { key: "value" }; server .mockEndpoint() - .post("/agents") + .post("/v2/agentic/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(422) @@ -289,8 +427,7 @@ describe("AgentsClient", () => { await expect(async () => { return await client.agents.create({ - name: "name", - description: "description", + name: "x", }); }).rejects.toThrow(Corti.UnprocessableEntityError); }); @@ -303,83 +440,67 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ - { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - mcpServers: [ - { id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }, - ], - }, - ], - mcpServers: [ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - authorizationScope: "authorizationScope", - url: "url", - redirectUrl: "redirectUrl", + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, }, ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }; server .mockEndpoint() - .get("/agents/12345678-90ab-cdef-gh12-34567890abc") + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.agents.get("12345678-90ab-cdef-gh12-34567890abc"); + const response = await client.agents.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); expect(response).toEqual({ - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ - { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - mcpServers: [ - { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - url: "url", - }, - ], - }, - ], - mcpServers: [ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - authorizationScope: "authorizationScope", - url: "url", - redirectUrl: "redirectUrl", + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, }, ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }); }); @@ -391,17 +512,22 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/agents/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.agents.get("id"); - }).rejects.toThrow(Corti.BadRequestError); + return await client.agents.get("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); }); test("get (3)", async () => { @@ -412,17 +538,22 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/agents/id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.agents.get("id"); - }).rejects.toThrow(Corti.UnauthorizedError); + return await client.agents.get("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); }); test("get (4)", async () => { @@ -433,16 +564,21 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/agents/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.agents.get("id"); + return await client.agents.get("agentId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -454,18 +590,17 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() - .delete("/agents/12345678-90ab-cdef-gh12-34567890abc") + .delete("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") .respondWith() .statusCode(200) .build(); - const response = await client.agents.delete("12345678-90ab-cdef-gh12-34567890abc"); + const response = await client.agents.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); expect(response).toEqual(undefined); }); @@ -477,17 +612,22 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().delete("/agents/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.agents.delete("id"); - }).rejects.toThrow(Corti.BadRequestError); + return await client.agents.delete("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); }); test("delete (3)", async () => { @@ -498,17 +638,22 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().delete("/agents/id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.agents.delete("id"); - }).rejects.toThrow(Corti.UnauthorizedError); + return await client.agents.delete("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); }); test("delete (4)", async () => { @@ -519,16 +664,21 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().delete("/agents/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.agents.delete("id"); + return await client.agents.delete("agentId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -540,84 +690,76 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = {}; + const rawRequestBody = { name: "coder-v2", connectors: [{ type: "registry", name: "@dedalus/coding-expert" }] }; const rawResponseBody = { - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ - { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - mcpServers: [ - { id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }, - ], - }, - ], - mcpServers: [ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - authorizationScope: "authorizationScope", - url: "url", - redirectUrl: "redirectUrl", + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, }, ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }; server .mockEndpoint() - .patch("/agents/12345678-90ab-cdef-gh12-34567890abc") + .patch("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.agents.update("12345678-90ab-cdef-gh12-34567890abc"); - expect(response).toEqual({ - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - experts: [ + const response = await client.agents.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + name: "coder-v2", + connectors: [ { - type: "expert", - id: "id", - name: "name", - description: "description", - systemPrompt: "systemPrompt", - mcpServers: [ - { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - url: "url", - }, - ], + type: "registry", + name: "@dedalus/coding-expert", }, ], - mcpServers: [ + }); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ { - id: "id", - name: "name", - transportType: "stdio", - authorizationType: "none", - authorizationScope: "authorizationScope", - url: "url", - redirectUrl: "redirectUrl", + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, }, ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }); }); @@ -629,7 +771,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -637,7 +778,7 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/agents/id") + .patch("/v2/agentic/agents/agentId") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -645,7 +786,7 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("id"); + return await client.agents.update("agentId"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -657,7 +798,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -665,7 +805,7 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/agents/id") + .patch("/v2/agentic/agents/agentId") .jsonBody(rawRequestBody) .respondWith() .statusCode(401) @@ -673,7 +813,7 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("id"); + return await client.agents.update("agentId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -685,7 +825,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -693,7 +832,34 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/agents/id") + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.update("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -701,11 +867,11 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("id"); + return await client.agents.update("agentId"); }).rejects.toThrow(Corti.NotFoundError); }); - test("update (5)", async () => { + test("update (6)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -713,7 +879,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -721,7 +886,7 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/agents/id") + .patch("/v2/agentic/agents/agentId") .jsonBody(rawRequestBody) .respondWith() .statusCode(422) @@ -729,7 +894,7 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("id"); + return await client.agents.update("agentId"); }).rejects.toThrow(Corti.UnprocessableEntityError); }); @@ -741,1228 +906,110 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { - protocolVersion: "protocolVersion", - name: "name", - description: "description", - url: "url", - preferredTransport: "preferredTransport", - additionalInterfaces: [{ url: "url", transport: "transport" }], - iconUrl: "iconUrl", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", documentationUrl: "documentationUrl", - provider: { organization: "organization", url: "url" }, - version: "version", - capabilities: { - streaming: true, - pushNotifications: true, - stateTransitionHistory: true, - extensions: [{ uri: "uri" }], - }, + iconUrl: "iconUrl", + version: "0.1.0", + capabilities: { streaming: true, pushNotifications: false }, + defaultInputModes: ["text/plain"], + defaultOutputModes: ["text/plain"], + provider: { organization: "Corti", url: "https://corti.ai" }, + securityRequirements: [{ key: "value" }], securitySchemes: { key: "value" }, - security: { key: "value" }, - defaultInputModes: ["defaultInputModes"], - defaultOutputModes: ["defaultOutputModes"], + signatures: [{ protected: "protected", header: { key: "value" }, signature: "signature" }], skills: [ { - id: "id", - name: "name", - description: "description", - tags: ["tags"], - examples: [ - { - role: "user", - parts: [{ kind: "text", text: "text" }], - messageId: "messageId", - kind: "message", - }, - ], - inputModes: ["inputModes"], - outputModes: ["outputModes"], - security: { key: "value" }, + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + name: "coding-expert", + description: "ICD-10 coding.", + tags: ["expert"], + }, + ], + supportedInterfaces: [ + { + protocolBinding: "JSONRPC", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + { + protocolBinding: "HTTP+JSON", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", }, ], - supportsAuthenticatedExtendedCard: true, - signatures: [{ protected: "protected", signature: "signature", header: { key: "value" } }], }; server .mockEndpoint() - .get("/agents/12345678-90ab-cdef-gh12-34567890abc/agent-card.json") + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/.well-known/agent-card.json") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.agents.getCard("12345678-90ab-cdef-gh12-34567890abc"); + const response = await client.agents.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); expect(response).toEqual({ - protocolVersion: "protocolVersion", - name: "name", - description: "description", - url: "url", - preferredTransport: "preferredTransport", - additionalInterfaces: [ - { - url: "url", - transport: "transport", - }, - ], - iconUrl: "iconUrl", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", documentationUrl: "documentationUrl", - provider: { - organization: "organization", - url: "url", - }, - version: "version", + iconUrl: "iconUrl", + version: "0.1.0", capabilities: { streaming: true, - pushNotifications: true, - stateTransitionHistory: true, - extensions: [ - { - uri: "uri", - }, - ], + pushNotifications: false, }, - securitySchemes: { - key: "value", - }, - security: { - key: "value", + defaultInputModes: ["text/plain"], + defaultOutputModes: ["text/plain"], + provider: { + organization: "Corti", + url: "https://corti.ai", }, - defaultInputModes: ["defaultInputModes"], - defaultOutputModes: ["defaultOutputModes"], - skills: [ + securityRequirements: [ { - id: "id", - name: "name", - description: "description", - tags: ["tags"], - examples: [ - { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - ], - inputModes: ["inputModes"], - outputModes: ["outputModes"], - security: { - key: "value", - }, + key: "value", }, ], - supportsAuthenticatedExtendedCard: true, + securitySchemes: { + key: "value", + }, signatures: [ { protected: "protected", - signature: "signature", - header: { - key: "value", - }, - }, - ], - }); - }); - - test("getCard (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/agent-card.json") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getCard("id"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("getCard (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/agent-card.json") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getCard("id"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("getCard (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/agent-card.json") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getCard("id"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("messageSend (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { role: "user", parts: [{ kind: "text", text: "text" }], messageId: "messageId", kind: "message" }, - }; - const rawResponseBody = { - message: { - role: "user", - parts: [{ kind: "text", text: "text" }], - metadata: { key: "value" }, - extensions: ["extensions"], - referenceTaskIds: ["referenceTaskIds"], - messageId: "messageId", - taskId: "taskId", - contextId: "contextId", - kind: "message", - }, - task: { - id: "id", - contextId: "contextId", - status: { - state: "submitted", - message: { - role: "user", - parts: [{ kind: "text", text: "text" }], - messageId: "messageId", - kind: "message", - }, - timestamp: "2024-01-15T09:30:00Z", - }, - history: [ - { role: "user", parts: [{ kind: "text", text: "text" }], messageId: "messageId", kind: "message" }, - ], - artifacts: [{ artifactId: "artifactId", parts: [{ kind: "text", text: "text" }] }], - metadata: { key: "value" }, - kind: "task", - }, - }; - - server - .mockEndpoint() - .post("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/message:send") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", { - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - }); - expect(response).toEqual({ - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - metadata: { - key: "value", - }, - extensions: ["extensions"], - referenceTaskIds: ["referenceTaskIds"], - messageId: "messageId", - taskId: "taskId", - contextId: "contextId", - kind: "message", - }, - task: { - id: "id", - contextId: "contextId", - status: { - state: "submitted", - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - timestamp: new Date("2024-01-15T09:30:00.000Z"), - }, - history: [ - { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - ], - artifacts: [ - { - artifactId: "artifactId", - parts: [ - { - kind: "text", - text: "text", - }, - ], - }, - ], - metadata: { - key: "value", - }, - kind: "task", - }, - }); - }); - - test("messageSend (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - role: "user", - parts: [ - { kind: "text", text: "text" }, - { kind: "text", text: "text" }, - ], - messageId: "messageId", - kind: "message", - }, - }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/agents/id/v1/message:send") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.messageSend("id", { - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("messageSend (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - role: "user", - parts: [ - { kind: "text", text: "text" }, - { kind: "text", text: "text" }, - ], - messageId: "messageId", - kind: "message", - }, - }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/agents/id/v1/message:send") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.messageSend("id", { - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("messageSend (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - role: "user", - parts: [ - { kind: "text", text: "text" }, - { kind: "text", text: "text" }, - ], - messageId: "messageId", - kind: "message", - }, - }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/agents/id/v1/message:send") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.messageSend("id", { - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - }); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("messageSend (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - role: "user", - parts: [ - { kind: "text", text: "text" }, - { kind: "text", text: "text" }, - ], - messageId: "messageId", - kind: "message", - }, - }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/agents/id/v1/message:send") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.messageSend("id", { - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("messageSend (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - role: "user", - parts: [ - { kind: "text", text: "text" }, - { kind: "text", text: "text" }, - ], - messageId: "messageId", - kind: "message", - }, - }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/agents/id/v1/message:send") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.messageSend("id", { - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - }); - }).rejects.toThrow(Corti.UnprocessableEntityError); - }); - - test("getTask (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "id", - contextId: "contextId", - status: { - state: "submitted", - message: { - role: "user", - parts: [{ kind: "text", text: "text" }], - metadata: { key: "value" }, - extensions: ["extensions"], - referenceTaskIds: ["referenceTaskIds"], - messageId: "messageId", - taskId: "taskId", - contextId: "contextId", - kind: "message", - }, - timestamp: "2024-01-15T09:30:00Z", - }, - history: [ - { - role: "user", - parts: [{ kind: "text", text: "text" }], - metadata: { key: "value" }, - extensions: ["extensions"], - referenceTaskIds: ["referenceTaskIds"], - messageId: "messageId", - taskId: "taskId", - contextId: "contextId", - kind: "message", - }, - ], - artifacts: [ - { - artifactId: "artifactId", - name: "name", - description: "description", - parts: [{ kind: "text", text: "text" }], - metadata: { key: "value" }, - extensions: ["extensions"], - }, - ], - metadata: { key: "value" }, - kind: "task", - }; - - server - .mockEndpoint() - .get("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/tasks/taskId") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agents.getTask("12345678-90ab-cdef-gh12-34567890abc", "taskId"); - expect(response).toEqual({ - id: "id", - contextId: "contextId", - status: { - state: "submitted", - message: { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - metadata: { - key: "value", - }, - extensions: ["extensions"], - referenceTaskIds: ["referenceTaskIds"], - messageId: "messageId", - taskId: "taskId", - contextId: "contextId", - kind: "message", - }, - timestamp: new Date("2024-01-15T09:30:00.000Z"), - }, - history: [ - { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - metadata: { - key: "value", - }, - extensions: ["extensions"], - referenceTaskIds: ["referenceTaskIds"], - messageId: "messageId", - taskId: "taskId", - contextId: "contextId", - kind: "message", - }, - ], - artifacts: [ - { - artifactId: "artifactId", - name: "name", - description: "description", - parts: [ - { - kind: "text", - text: "text", - }, - ], - metadata: { - key: "value", - }, - extensions: ["extensions"], - }, - ], - metadata: { - key: "value", - }, - kind: "task", - }); - }); - - test("getTask (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/v1/tasks/taskId") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getTask("id", "taskId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("getTask (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/v1/tasks/taskId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getTask("id", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("getTask (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/v1/tasks/taskId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getTask("id", "taskId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("getTask (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/v1/tasks/taskId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getTask("id", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("getContext (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "id", - items: [ - { - id: "id", - contextId: "contextId", - status: { state: "submitted" }, - history: [ - { - role: "user", - parts: [{ kind: "text", text: "text" }], - messageId: "messageId", - kind: "message", - }, - ], - artifacts: [{ artifactId: "artifactId", parts: [{ kind: "text", text: "text" }] }], - metadata: { key: "value" }, - kind: "task", - }, - ], - }; - - server - .mockEndpoint() - .get("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/contexts/contextId") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agents.getContext("12345678-90ab-cdef-gh12-34567890abc", "contextId"); - expect(response).toEqual({ - id: "id", - items: [ - { - id: "id", - contextId: "contextId", - status: { - state: "submitted", - }, - history: [ - { - role: "user", - parts: [ - { - kind: "text", - text: "text", - }, - ], - messageId: "messageId", - kind: "message", - }, - ], - artifacts: [ - { - artifactId: "artifactId", - parts: [ - { - kind: "text", - text: "text", - }, - ], - }, - ], - metadata: { + header: { key: "value", }, - kind: "task", + signature: "signature", }, ], - }); - }); - - test("getContext (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/v1/contexts/contextId") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getContext("id", "contextId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("getContext (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/v1/contexts/contextId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getContext("id", "contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("getContext (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/id/v1/contexts/contextId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getContext("id", "contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("deleteContext (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/contexts/contextId") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agents.deleteContext("12345678-90ab-cdef-gh12-34567890abc", "contextId"); - expect(response).toEqual(undefined); - }); - - test("deleteContext (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/agents/id/v1/contexts/contextId") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.deleteContext("id", "contextId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("deleteContext (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/agents/id/v1/contexts/contextId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.deleteContext("id", "contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("deleteContext (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/agents/id/v1/contexts/contextId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.deleteContext("id", "contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("getRegistryExperts (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - experts: [ + skills: [ { - name: "name", - displayName: "displayName", - displayDescription: "displayDescription", - description: "description", - mcpServers: [{ name: "name", authorizationType: "none" }], - configSchema: { key: "value" }, + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + name: "coding-expert", + description: "ICD-10 coding.", + tags: ["expert"], }, ], - }; - - server - .mockEndpoint() - .get("/agents/registry/experts") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agents.getRegistryExperts({ - limit: 100, - offset: 0, - }); - expect(response).toEqual({ - experts: [ + supportedInterfaces: [ { - name: "name", - displayName: "displayName", - displayDescription: "displayDescription", - description: "description", - mcpServers: [ - { - name: "name", - authorizationType: "none", - }, - ], - configSchema: { - key: "value", - }, + protocolBinding: "JSONRPC", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + { + protocolBinding: "HTTP+JSON", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", }, ], }); }); - test("getRegistryExperts (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/agents/registry/experts") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.getRegistryExperts(); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("getRegistryExperts (3)", async () => { + test("getCard (2)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -1970,7 +1017,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1978,18 +1024,18 @@ describe("AgentsClient", () => { server .mockEndpoint() - .get("/agents/registry/experts") + .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.agents.getRegistryExperts(); + return await client.agents.getCard("agentId"); }).rejects.toThrow(Corti.UnauthorizedError); }); - test("getRegistryExperts (4)", async () => { + test("getCard (3)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -1997,7 +1043,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -2005,14 +1050,14 @@ describe("AgentsClient", () => { server .mockEndpoint() - .get("/agents/registry/experts") + .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") .respondWith() - .statusCode(422) + .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.agents.getRegistryExperts(); - }).rejects.toThrow(Corti.UnprocessableEntityError); + return await client.agents.getCard("agentId"); + }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents/a2A.test.ts b/tests/wire/agents/a2A.test.ts new file mode 100644 index 00000000..36271334 --- /dev/null +++ b/tests/wire/agents/a2A.test.ts @@ -0,0 +1,517 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("A2AClient", () => { + test("jsonRpc (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + jsonrpc: "2.0", + id: "1", + method: "SendMessage", + params: { + message: { + role: "ROLE_USER", + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + parts: [{ text: "Code this encounter." }], + }, + }, + }; + const rawResponseBody = { + jsonrpc: "2.0", + id: "msg-001", + result: { + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { state: "TASK_STATE_COMPLETED" }, + }, + }, + error: { code: -32600, message: "Invalid Request", data: { key: "value" } }, + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + id: "1", + method: "SendMessage", + params: { + message: { + role: "ROLE_USER", + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + parts: [ + { + text: "Code this encounter.", + }, + ], + }, + }, + }); + expect(response).toEqual({ + jsonrpc: "2.0", + id: "msg-001", + result: { + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + }, + }, + }, + error: { + code: -32600, + message: "Invalid Request", + data: { + key: "value", + }, + }, + }); + }); + + test("jsonRpc (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.jsonRpc("agentId", { + id: "id", + method: "SendMessage", + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("jsonRpc (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.jsonRpc("agentId", { + id: "id", + method: "SendMessage", + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("sendMessage (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [{ text: "What is the ICD-10 code for asthma?" }], + }, + }; + const rawResponseBody = { + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + timestamp: "2026-05-19T12:00:01Z", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + }, + }, + artifacts: [{ artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", parts: [{ text: "J45.909" }] }], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [ + { + text: "What is the ICD-10 code for asthma?", + }, + ], + }, + }); + expect(response).toEqual({ + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + timestamp: "2026-05-19T12:00:01Z", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + }, + }, + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + }); + }); + + test("sendMessage (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.sendMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("sendMessage (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.sendMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("sendMessage (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.sendMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("streamMessage (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [{ text: "What is the ICD-10 code for asthma?" }], + }, + }; + const rawResponseBody = + 'event: \ndata: {"data":"{\\"task\\":{\\"id\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_WORKING\\"}}}","event":"message","id":"id","retry":1}\n\n'; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .sseBody(rawResponseBody) + .build(); + + const response = await client.agents.a2A.streamMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [ + { + text: "What is the ICD-10 code for asthma?", + }, + ], + }, + }); + const events: unknown[] = []; + for await (const event of response) { + events.push(event); + } + expect(events).toEqual([ + { + data: '{"task":{"id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_WORKING"}}}', + event: "message", + id: "id", + retry: 1, + }, + ]); + }); + + test("streamMessage (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.streamMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("streamMessage (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.streamMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("streamMessage (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.streamMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/a2A/tasks.test.ts b/tests/wire/agents/a2A/tasks.test.ts new file mode 100644 index 00000000..ec1cf64d --- /dev/null +++ b/tests/wire/agents/a2A/tasks.test.ts @@ -0,0 +1,625 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../../src/api/index"; +import { CortiClient } from "../../../../src/Client"; +import { mockServerPool } from "../../../mock-server/MockServerPool"; +import { mockOAuth } from "../../mockAuth"; + +describe("TasksClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint({ once: false }) + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + const page = await client.agents.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + + expect(expected.tasks).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.tasks).toEqual(nextPage.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/a2a/tasks") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.tasks.list("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ) + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.a2A.tasks.get( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.tasks.get("agentId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.tasks.get("agentId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("cancel (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }; + + server + .mockEndpoint() + .post( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:cancel", + ) + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.a2A.tasks.cancel( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }); + }); + + test("cancel (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.tasks.cancel("agentId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("cancel (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.tasks.cancel("agentId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("cancel (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.a2A.tasks.cancel("agentId", "taskId"); + }).rejects.toThrow(Corti.ConflictError); + }); + + test("subscribe", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .get( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:subscribe", + ) + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agents.a2A.tasks.subscribe( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual(undefined); + }); +}); diff --git a/tests/wire/agents/artifacts.test.ts b/tests/wire/agents/artifacts.test.ts new file mode 100644 index 00000000..a1d89536 --- /dev/null +++ b/tests/wire/agents/artifacts.test.ts @@ -0,0 +1,157 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("ArtifactsClient", () => { + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [ + { + text: "J45.909", + data: { key: "value" }, + filename: "filename", + mediaType: "mediaType", + raw: "raw", + url: "url", + metadata: { key: "value" }, + }, + ], + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/artifacts/art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.artifacts.get( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + ); + expect(response).toEqual({ + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + data: { + key: "value", + }, + filename: "filename", + mediaType: "mediaType", + raw: "raw", + url: "url", + metadata: { + key: "value", + }, + }, + ], + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.artifacts.get("contextId", "taskId", "artifactId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.artifacts.get("contextId", "taskId", "artifactId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.artifacts.get("contextId", "taskId", "artifactId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/connectors.test.ts b/tests/wire/agents/connectors.test.ts new file mode 100644 index 00000000..a6ee95aa --- /dev/null +++ b/tests/wire/agents/connectors.test.ts @@ -0,0 +1,445 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("ConnectorsClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual({ + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.list("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.list("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("attach (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "@dedalus/coding-expert" }; + const rawResponseBody = { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + type: "registry", + name: "@dedalus/coding-expert", + }); + expect(response).toEqual({ + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }); + }); + + test("attach (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("attach (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("attach (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("attach (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.ConflictError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.connectors.get( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ); + expect(response).toEqual({ + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.get("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.get("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("remove (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agents.connectors.remove( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ); + expect(response).toEqual(undefined); + }); + + test("remove (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.remove("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("remove (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.connectors.remove("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/contexts.test.ts b/tests/wire/agents/contexts.test.ts new file mode 100644 index 00000000..2921b575 --- /dev/null +++ b/tests/wire/agents/contexts.test.ts @@ -0,0 +1,439 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("ContextsClient", () => { + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:01Z", + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{ text: "Code this encounter: acute asthma exacerbation." }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.901" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [{ text: "J45.901" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + expect(response).toEqual({ + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:01.000Z"), + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [ + { + text: "Code this encounter: acute asthma exacerbation.", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.901", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [ + { + text: "J45.901", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.get("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.get("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agents.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.delete("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.delete("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("getTrace (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + traces: [ + { + trace: { + id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", + name: "invoke_agent", + start_time: "2026-05-19T12:00:00Z", + thread_id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + }, + spans: [ + { + name: "invoke_llm", + span_id: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", + start_time: "2026-05-19T12:00:00Z", + }, + ], + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint({ once: false }) + .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/trace") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + traces: [ + { + trace: { + id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", + name: "invoke_agent", + startTime: new Date("2026-05-19T12:00:00.000Z"), + threadId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + }, + spans: [ + { + name: "invoke_llm", + spanId: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", + startTime: new Date("2026-05-19T12:00:00.000Z"), + }, + ], + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + const page = await client.agents.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + + expect(expected.traces).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.traces).toEqual(nextPage.data); + }); + + test("getTrace (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/trace") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.getTrace("contextId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("getTrace (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/trace") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.getTrace("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("getTrace (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/trace") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.getTrace("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/contexts/tasks.test.ts b/tests/wire/agents/contexts/tasks.test.ts new file mode 100644 index 00000000..5c967487 --- /dev/null +++ b/tests/wire/agents/contexts/tasks.test.ts @@ -0,0 +1,392 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../../src/api/index"; +import { CortiClient } from "../../../../src/Client"; +import { mockServerPool } from "../../../mock-server/MockServerPool"; +import { mockOAuth } from "../../mockAuth"; + +describe("TasksClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint({ once: false }) + .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + const page = await client.agents.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + + expect(expected.tasks).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.tasks).toEqual(nextPage.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.tasks.list("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.tasks.list("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.contexts.tasks.get( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.tasks.get("contextId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.contexts.tasks.get("contextId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/feedback.test.ts b/tests/wire/agents/feedback.test.ts new file mode 100644 index 00000000..e0710afc --- /dev/null +++ b/tests/wire/agents/feedback.test.ts @@ -0,0 +1,498 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("FeedbackClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + feedbacks: [ + { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { scale: "binary", value: 1 }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { collectionMethod: "thumbs" }, + createdAt: "2026-05-19T12:00:00Z", + }, + ], + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.feedback.list( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + feedbacks: [ + { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { + scale: "binary", + value: 1, + }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "thumbs", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + }, + ], + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.list("contextId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.list("contextId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("create (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1 } }; + const rawResponseBody = { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { scale: "binary", value: 1 }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { externalId: "externalId" }, + }, + createdAt: "2026-05-19T12:00:00Z", + }; + + server + .mockEndpoint() + .post( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", + ) + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.feedback.create( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + { + rating: { + scale: "binary", + value: 1, + }, + }, + ); + expect(response).toEqual({ + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { + scale: "binary", + value: 1, + }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { + externalId: "externalId", + }, + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + }); + }); + + test("create (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + rating: { scale: "binary", value: 0 }, + labels: ["unsupportedClaim"], + reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { + collectionMethod: "caseReview", + clientReference: "case-review-728193", + actor: { externalId: "clinician_4182" }, + }, + }; + const rawResponseBody = { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { scale: "binary", value: 1 }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { externalId: "externalId" }, + }, + createdAt: "2026-05-19T12:00:00Z", + }; + + server + .mockEndpoint() + .post( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", + ) + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.feedback.create( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + { + rating: { + scale: "binary", + value: 0, + }, + labels: ["unsupportedClaim"], + reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "caseReview", + clientReference: "case-review-728193", + actor: { + externalId: "clinician_4182", + }, + }, + }, + ); + expect(response).toEqual({ + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { + scale: "binary", + value: 1, + }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { + externalId: "externalId", + }, + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + }); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.UnprocessableEntityError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", + ) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agents.feedback.delete( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.delete("contextId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.feedback.delete("contextId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/registry.test.ts b/tests/wire/agents/registry.test.ts new file mode 100644 index 00000000..694f67b5 --- /dev/null +++ b/tests/wire/agents/registry.test.ts @@ -0,0 +1,239 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("RegistryClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + connectors: [ + { + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "description", + version: "1.4.2", + icons: [{ src: "src", mimeType: "image/svg+xml", sizes: ["48x48"] }], + provider: "Dedalus", + websiteUrl: "websiteUrl", + documentationUrl: "documentationUrl", + tags: ["tags"], + configSchema: { key: "value" }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint({ once: false }) + .get("/v2/agentic/registry/connectors") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + connectors: [ + { + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "description", + version: "1.4.2", + icons: [ + { + src: "src", + mimeType: "image/svg+xml", + sizes: ["48x48"], + }, + ], + provider: "Dedalus", + websiteUrl: "websiteUrl", + documentationUrl: "documentationUrl", + tags: ["tags"], + configSchema: { + key: "value", + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + const page = await client.agents.registry.list(); + + expect(expected.connectors).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.connectors).toEqual(nextPage.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.registry.list(); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "Returns ICD-10 codes for a clinical encounter.", + version: "1.4.2", + icons: [ + { + src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", + mimeType: "image/svg+xml", + sizes: ["any"], + }, + ], + provider: "Dedalus", + websiteUrl: "https://dedalus.example.com/coding-expert", + documentationUrl: "https://docs.dedalus.example.com/coding-expert", + capabilities: { + streaming: true, + inputModes: ["text/plain"], + outputModes: ["text/plain", "application/json"], + tools: ["lookup_icd10", "validate_code"], + }, + tags: ["icd10", "billing", "expert"], + configSchema: { key: "value" }, + }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors/connectorId") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.registry.get("connectorId"); + expect(response).toEqual({ + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "Returns ICD-10 codes for a clinical encounter.", + version: "1.4.2", + icons: [ + { + src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", + mimeType: "image/svg+xml", + sizes: ["any"], + }, + ], + provider: "Dedalus", + websiteUrl: "https://dedalus.example.com/coding-expert", + documentationUrl: "https://docs.dedalus.example.com/coding-expert", + capabilities: { + streaming: true, + inputModes: ["text/plain"], + outputModes: ["text/plain", "application/json"], + tools: ["lookup_icd10", "validate_code"], + }, + tags: ["icd10", "billing", "expert"], + configSchema: { + key: "value", + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors/connectorId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.registry.get("connectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors/connectorId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.registry.get("connectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/usage.test.ts b/tests/wire/agents/usage.test.ts new file mode 100644 index 00000000..cb7234c9 --- /dev/null +++ b/tests/wire/agents/usage.test.ts @@ -0,0 +1,155 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("UsageClient", () => { + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + granularity: "day", + from: "2026-05-19T00:00:00Z", + to: "2026-05-21T00:00:00Z", + totals: { invocations: 15, uniqueContexts: 6 }, + buckets: [ + { + invocations: 12, + uniqueContexts: 5, + periodStart: "2026-05-19T00:00:00Z", + periodEnd: "2026-05-20T00:00:00Z", + }, + { + invocations: 3, + uniqueContexts: 2, + periodStart: "2026-05-20T00:00:00Z", + periodEnd: "2026-05-21T00:00:00Z", + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/usage") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + from: new Date("2026-05-19T00:00:00.000Z"), + to: new Date("2026-05-20T00:00:00.000Z"), + }); + expect(response).toEqual({ + granularity: "day", + from: new Date("2026-05-19T00:00:00.000Z"), + to: new Date("2026-05-21T00:00:00.000Z"), + totals: { + invocations: 15, + uniqueContexts: 6, + }, + buckets: [ + { + invocations: 12, + uniqueContexts: 5, + periodStart: new Date("2026-05-19T00:00:00.000Z"), + periodEnd: new Date("2026-05-20T00:00:00.000Z"), + }, + { + invocations: 3, + uniqueContexts: 2, + periodStart: new Date("2026-05-20T00:00:00.000Z"), + periodEnd: new Date("2026-05-21T00:00:00.000Z"), + }, + ], + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/usage") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.usage.get("agentId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/usage") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.usage.get("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/usage") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.usage.get("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/auth.test.ts b/tests/wire/auth.test.ts index 0ce6a587..77d046b1 100644 --- a/tests/wire/auth.test.ts +++ b/tests/wire/auth.test.ts @@ -14,7 +14,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { client_id: "client_id", client_secret: "client_secret" }; @@ -64,7 +63,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -119,7 +117,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -155,7 +152,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/codes.test.ts b/tests/wire/codes.test.ts index d3909f46..7a8114ba 100644 --- a/tests/wire/codes.test.ts +++ b/tests/wire/codes.test.ts @@ -14,7 +14,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -54,6 +53,7 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -61,6 +61,7 @@ describe("CodesClient", () => { .build(); const response = await client.codes.predict({ + tenantName: "base", system: ["icd10cm-outpatient", "cpt"], context: [ { @@ -134,7 +135,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -175,6 +175,7 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -182,6 +183,7 @@ describe("CodesClient", () => { .build(); const response = await client.codes.predict({ + tenantName: "base", system: ["icd10cm-outpatient"], context: [ { @@ -259,7 +261,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -274,6 +275,7 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -282,6 +284,7 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ + tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -305,7 +308,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -320,6 +322,7 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -328,6 +331,7 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ + tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -351,7 +355,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -366,6 +369,7 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -374,6 +378,7 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ + tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -397,7 +402,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -412,6 +416,7 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(502) @@ -420,6 +425,7 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ + tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -443,7 +449,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -458,6 +463,7 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -466,6 +472,7 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ + tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { diff --git a/tests/wire/documents.test.ts b/tests/wire/documents.test.ts index 1f3e4b3e..d264879b 100644 --- a/tests/wire/documents.test.ts +++ b/tests/wire/documents.test.ts @@ -14,7 +14,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -46,12 +45,15 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); + const response = await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", + }); expect(response).toEqual({ data: [ { @@ -88,7 +90,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -97,13 +98,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id"); + return await client.documents.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -115,7 +119,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -124,13 +127,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id"); + return await client.documents.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -142,7 +148,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -151,13 +156,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id"); + return await client.documents.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -169,7 +177,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -178,13 +185,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id"); + return await client.documents.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -196,7 +206,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -228,6 +237,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -235,18 +245,21 @@ describe("DocumentsClient", () => { .build(); const response = await client.documents.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + tenantName: "base", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -280,7 +293,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -296,6 +308,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -304,32 +317,35 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + tenantName: "tenantName", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -342,7 +358,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -358,6 +373,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -366,32 +382,35 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + tenantName: "tenantName", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -404,7 +423,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -420,6 +438,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -428,32 +447,35 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + tenantName: "tenantName", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -466,7 +488,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -482,6 +503,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -490,32 +512,35 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + tenantName: "tenantName", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -528,7 +553,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -556,6 +580,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/f47ac10b-58cc-4372-a567-0e02b2c3d479") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -564,6 +589,9 @@ describe("DocumentsClient", () => { const response = await client.documents.get( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", + { + tenantName: "base", + }, ); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -597,7 +625,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -606,13 +633,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId"); + return await client.documents.get("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -624,7 +654,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -633,13 +662,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId"); + return await client.documents.get("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -651,7 +683,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -660,13 +691,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId"); + return await client.documents.get("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -678,7 +712,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -687,13 +720,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId"); + return await client.documents.get("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -705,13 +741,13 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/f47ac10b-58cc-4372-a567-0e02b2c3d479") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); @@ -719,6 +755,9 @@ describe("DocumentsClient", () => { const response = await client.documents.delete( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", + { + tenantName: "base", + }, ); expect(response).toEqual(undefined); }); @@ -731,7 +770,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -740,13 +778,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId"); + return await client.documents.delete("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -758,7 +799,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -767,13 +807,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId"); + return await client.documents.delete("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -785,7 +828,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -794,13 +836,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId"); + return await client.documents.delete("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -812,7 +857,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -821,13 +865,16 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId"); + return await client.documents.delete("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -839,7 +886,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -867,6 +913,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/f47ac10b-58cc-4372-a567-0e02b2c3d479") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -876,6 +923,9 @@ describe("DocumentsClient", () => { const response = await client.documents.update( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", + { + tenantName: "base", + }, ); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -909,7 +959,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -918,6 +967,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -925,7 +975,9 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId"); + return await client.documents.update("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -937,7 +989,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -946,6 +997,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -953,7 +1005,9 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId"); + return await client.documents.update("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -965,7 +1019,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -974,6 +1027,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -981,7 +1035,9 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId"); + return await client.documents.update("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -993,7 +1049,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -1002,6 +1057,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -1009,7 +1065,9 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId"); + return await client.documents.update("id", "documentId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -1021,7 +1079,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { outputLanguage: "outputLanguage", templateRef: { templateId: "templateId" } }; @@ -1042,6 +1099,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -1049,9 +1107,12 @@ describe("DocumentsClient", () => { .build(); const response = await client.documents.generate({ - outputLanguage: "outputLanguage", - templateRef: { - templateId: "templateId", + tenantName: "base", + body: { + outputLanguage: "outputLanguage", + templateRef: { + templateId: "templateId", + }, }, }); expect(response).toEqual({ @@ -1088,7 +1149,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1097,6 +1157,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -1105,10 +1166,13 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + tenantName: "tenantName", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -1121,7 +1185,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1130,6 +1193,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -1138,10 +1202,13 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + tenantName: "tenantName", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -1154,7 +1221,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1163,6 +1229,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(422) @@ -1171,10 +1238,13 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + tenantName: "tenantName", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.UnprocessableEntityError); }); @@ -1187,7 +1257,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1196,6 +1265,7 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -1204,10 +1274,13 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + tenantName: "tenantName", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.InternalServerError); }); diff --git a/tests/wire/documents/sections.test.ts b/tests/wire/documents/sections.test.ts index 687da8aa..0e365b55 100644 --- a/tests/wire/documents/sections.test.ts +++ b/tests/wire/documents/sections.test.ts @@ -14,7 +14,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -40,12 +39,15 @@ describe("SectionsClient", () => { server .mockEndpoint() .get("/documents/sections/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.list(); + const response = await client.documents.sections.list({ + tenantName: "base", + }); expect(response).toEqual([ { id: "id", @@ -79,7 +81,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -113,6 +114,7 @@ describe("SectionsClient", () => { server .mockEndpoint() .post("/documents/sections/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -120,8 +122,11 @@ describe("SectionsClient", () => { .build(); const response = await client.documents.sections.create({ - name: "name", - inheritFromId: "inheritFromId", + tenantName: "base", + body: { + name: "name", + inheritFromId: "inheritFromId", + }, }); expect(response).toEqual({ id: "id", @@ -168,7 +173,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -177,6 +181,7 @@ describe("SectionsClient", () => { server .mockEndpoint() .post("/documents/sections/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -185,8 +190,11 @@ describe("SectionsClient", () => { await expect(async () => { return await client.documents.sections.create({ - inheritFromId: "inheritFromId", - name: "name", + tenantName: "tenantName", + body: { + inheritFromId: "inheritFromId", + name: "name", + }, }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -199,7 +207,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -233,12 +240,15 @@ describe("SectionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.get("sectionID"); + const response = await client.documents.sections.get("sectionID", { + tenantName: "base", + }); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -284,7 +294,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -293,13 +302,16 @@ describe("SectionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.get("sectionID"); + return await client.documents.sections.get("sectionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -311,13 +323,20 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - server.mockEndpoint().delete("/documents/sections/sectionID").respondWith().statusCode(200).build(); + server + .mockEndpoint() + .delete("/documents/sections/sectionID") + .header("Tenant-Name", "base") + .respondWith() + .statusCode(200) + .build(); - const response = await client.documents.sections.delete("sectionID"); + const response = await client.documents.sections.delete("sectionID", { + tenantName: "base", + }); expect(response).toEqual(undefined); }); @@ -329,7 +348,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -338,13 +356,16 @@ describe("SectionsClient", () => { server .mockEndpoint() .delete("/documents/sections/sectionID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.delete("sectionID"); + return await client.documents.sections.delete("sectionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -356,22 +377,24 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; + const rawResponseBody = { key: "value" }; server .mockEndpoint() .delete("/documents/sections/sectionID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(409) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.delete("sectionID"); + return await client.documents.sections.delete("sectionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ConflictError); }); @@ -383,7 +406,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -417,13 +439,16 @@ describe("SectionsClient", () => { server .mockEndpoint() .patch("/documents/sections/sectionID") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.update("sectionID"); + const response = await client.documents.sections.update("sectionID", { + tenantName: "base", + }); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -469,7 +494,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -478,6 +502,7 @@ describe("SectionsClient", () => { server .mockEndpoint() .patch("/documents/sections/sectionID") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -485,7 +510,9 @@ describe("SectionsClient", () => { .build(); await expect(async () => { - return await client.documents.sections.update("sectionID"); + return await client.documents.sections.update("sectionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -497,7 +524,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -506,6 +532,7 @@ describe("SectionsClient", () => { server .mockEndpoint() .patch("/documents/sections/sectionID") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -513,7 +540,9 @@ describe("SectionsClient", () => { .build(); await expect(async () => { - return await client.documents.sections.update("sectionID"); + return await client.documents.sections.update("sectionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/documents/sections/versions.test.ts b/tests/wire/documents/sections/versions.test.ts index fb0f2ec1..7cb6cefc 100644 --- a/tests/wire/documents/sections/versions.test.ts +++ b/tests/wire/documents/sections/versions.test.ts @@ -14,7 +14,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -34,12 +33,15 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.versions.list("sectionID"); + const response = await client.documents.sections.versions.list("sectionID", { + tenantName: "base", + }); expect(response).toEqual([ { id: "id", @@ -66,7 +68,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -75,13 +76,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.list("sectionID"); + return await client.documents.sections.versions.list("sectionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -93,7 +97,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -121,6 +124,7 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -128,6 +132,7 @@ describe("VersionsClient", () => { .build(); const response = await client.documents.sections.versions.create("sectionID", { + tenantName: "base", generation: {}, }); expect(response).toEqual({ @@ -160,7 +165,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -169,6 +173,7 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -177,6 +182,7 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.sections.versions.create("sectionID", { + tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.BadRequestError); @@ -190,7 +196,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -199,6 +204,7 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -207,6 +213,7 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.sections.versions.create("sectionID", { + tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.NotFoundError); @@ -220,7 +227,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -248,12 +254,15 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/versionID") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.versions.get("sectionID", "versionID"); + const response = await client.documents.sections.versions.get("sectionID", "versionID", { + tenantName: "base", + }); expect(response).toEqual({ id: "id", versionNumber: 1, @@ -284,7 +293,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -293,13 +301,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/versionID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.get("sectionID", "versionID"); + return await client.documents.sections.versions.get("sectionID", "versionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -311,18 +322,20 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/documents/sections/sectionID/versions/versionID") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); - const response = await client.documents.sections.versions.delete("sectionID", "versionID"); + const response = await client.documents.sections.versions.delete("sectionID", "versionID", { + tenantName: "base", + }); expect(response).toEqual(undefined); }); @@ -334,7 +347,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -343,13 +355,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .delete("/documents/sections/sectionID/versions/versionID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.delete("sectionID", "versionID"); + return await client.documents.sections.versions.delete("sectionID", "versionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -361,7 +376,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -373,12 +387,15 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/versionID/publish") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.versions.publish("sectionID", "versionID"); + const response = await client.documents.sections.versions.publish("sectionID", "versionID", { + tenantName: "base", + }); expect(response).toEqual({ status: "status", evidence: { @@ -397,7 +414,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -406,13 +422,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/versionID/publish") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.publish("sectionID", "versionID"); + return await client.documents.sections.versions.publish("sectionID", "versionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/documents/templates.test.ts b/tests/wire/documents/templates.test.ts index 80291580..57a800ba 100644 --- a/tests/wire/documents/templates.test.ts +++ b/tests/wire/documents/templates.test.ts @@ -14,7 +14,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -40,12 +39,15 @@ describe("TemplatesClient", () => { server .mockEndpoint() .get("/documents/templates/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.list(); + const response = await client.documents.templates.list({ + tenantName: "base", + }); expect(response).toEqual([ { id: "id", @@ -79,7 +81,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -132,6 +133,7 @@ describe("TemplatesClient", () => { server .mockEndpoint() .post("/documents/templates/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -139,8 +141,11 @@ describe("TemplatesClient", () => { .build(); const response = await client.documents.templates.create({ - name: "name", - inheritFromId: "inheritFromId", + tenantName: "base", + body: { + name: "name", + inheritFromId: "inheritFromId", + }, }); expect(response).toEqual({ id: "id", @@ -213,7 +218,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -222,6 +226,7 @@ describe("TemplatesClient", () => { server .mockEndpoint() .post("/documents/templates/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -230,8 +235,11 @@ describe("TemplatesClient", () => { await expect(async () => { return await client.documents.templates.create({ - inheritFromId: "inheritFromId", - name: "name", + tenantName: "tenantName", + body: { + inheritFromId: "inheritFromId", + name: "name", + }, }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -244,7 +252,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -297,12 +304,15 @@ describe("TemplatesClient", () => { server .mockEndpoint() .get("/documents/templates/templateID") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.get("templateID"); + const response = await client.documents.templates.get("templateID", { + tenantName: "base", + }); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -374,7 +384,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -383,13 +392,16 @@ describe("TemplatesClient", () => { server .mockEndpoint() .get("/documents/templates/templateID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.get("templateID"); + return await client.documents.templates.get("templateID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -401,13 +413,20 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - server.mockEndpoint().delete("/documents/templates/templateID").respondWith().statusCode(200).build(); + server + .mockEndpoint() + .delete("/documents/templates/templateID") + .header("Tenant-Name", "base") + .respondWith() + .statusCode(200) + .build(); - const response = await client.documents.templates.delete("templateID"); + const response = await client.documents.templates.delete("templateID", { + tenantName: "base", + }); expect(response).toEqual(undefined); }); @@ -419,7 +438,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -428,13 +446,16 @@ describe("TemplatesClient", () => { server .mockEndpoint() .delete("/documents/templates/templateID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.delete("templateID"); + return await client.documents.templates.delete("templateID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -446,22 +467,24 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; + const rawResponseBody = { key: "value" }; server .mockEndpoint() .delete("/documents/templates/templateID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(409) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.delete("templateID"); + return await client.documents.templates.delete("templateID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ConflictError); }); @@ -473,7 +496,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -526,13 +548,16 @@ describe("TemplatesClient", () => { server .mockEndpoint() .patch("/documents/templates/templateID") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.update("templateID"); + const response = await client.documents.templates.update("templateID", { + tenantName: "base", + }); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -604,7 +629,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -613,6 +637,7 @@ describe("TemplatesClient", () => { server .mockEndpoint() .patch("/documents/templates/templateID") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -620,7 +645,9 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.documents.templates.update("templateID"); + return await client.documents.templates.update("templateID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -632,7 +659,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -641,6 +667,7 @@ describe("TemplatesClient", () => { server .mockEndpoint() .patch("/documents/templates/templateID") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -648,7 +675,9 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.documents.templates.update("templateID"); + return await client.documents.templates.update("templateID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/documents/templates/versions.test.ts b/tests/wire/documents/templates/versions.test.ts index bc156b08..71ee0dad 100644 --- a/tests/wire/documents/templates/versions.test.ts +++ b/tests/wire/documents/templates/versions.test.ts @@ -14,7 +14,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -33,12 +32,15 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.versions.list("templateID"); + const response = await client.documents.templates.versions.list("templateID", { + tenantName: "base", + }); expect(response).toEqual([ { id: "id", @@ -67,7 +69,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -76,13 +77,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.list("templateID"); + return await client.documents.templates.versions.list("templateID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -94,7 +98,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -108,6 +111,7 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -115,6 +119,7 @@ describe("VersionsClient", () => { .build(); const response = await client.documents.templates.versions.create("templateID", { + tenantName: "base", generation: {}, }); expect(response).toEqual({ @@ -143,7 +148,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -152,6 +156,7 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -160,6 +165,7 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.templates.versions.create("templateID", { + tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.BadRequestError); @@ -173,7 +179,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -182,6 +187,7 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -190,6 +196,7 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.templates.versions.create("templateID", { + tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.NotFoundError); @@ -203,7 +210,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -217,12 +223,15 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/versionID") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.versions.get("templateID", "versionID"); + const response = await client.documents.templates.versions.get("templateID", "versionID", { + tenantName: "base", + }); expect(response).toEqual({ id: "id", versionNumber: 1, @@ -249,7 +258,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -258,13 +266,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/versionID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.get("templateID", "versionID"); + return await client.documents.templates.versions.get("templateID", "versionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -276,18 +287,20 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/documents/templates/templateID/versions/versionID") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); - const response = await client.documents.templates.versions.delete("templateID", "versionID"); + const response = await client.documents.templates.versions.delete("templateID", "versionID", { + tenantName: "base", + }); expect(response).toEqual(undefined); }); @@ -299,7 +312,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -308,13 +320,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .delete("/documents/templates/templateID/versions/versionID") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.delete("templateID", "versionID"); + return await client.documents.templates.versions.delete("templateID", "versionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -326,7 +341,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -338,12 +352,15 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/versionID/publish") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.versions.publish("templateID", "versionID"); + const response = await client.documents.templates.versions.publish("templateID", "versionID", { + tenantName: "base", + }); expect(response).toEqual({ status: "status", evidence: { @@ -362,7 +379,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -371,13 +387,16 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/versionID/publish") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.publish("templateID", "versionID"); + return await client.documents.templates.versions.publish("templateID", "versionID", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/facts.test.ts b/tests/wire/facts.test.ts index 09c2a7ef..5a0cd175 100644 --- a/tests/wire/facts.test.ts +++ b/tests/wire/facts.test.ts @@ -14,7 +14,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -22,9 +21,18 @@ describe("FactsClient", () => { data: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", key: "key", translations: [{}] }], }; - server.mockEndpoint().get("/factgroups/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/factgroups/") + .header("Tenant-Name", "base") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - const response = await client.facts.factGroupsList(); + const response = await client.facts.factGroupsList({ + tenantName: "base", + }); expect(response).toEqual({ data: [ { @@ -44,16 +52,24 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server.mockEndpoint().get("/factgroups/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/factgroups/") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.facts.factGroupsList(); + return await client.facts.factGroupsList({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -65,7 +81,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -88,12 +103,15 @@ describe("FactsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); + const response = await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", + }); expect(response).toEqual({ facts: [ { @@ -119,7 +137,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -128,13 +145,16 @@ describe("FactsClient", () => { server .mockEndpoint() .get("/interactions/id/facts/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.facts.list("id"); + return await client.facts.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -146,7 +166,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ text: "text", group: "other" }] }; @@ -167,6 +186,7 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -174,6 +194,7 @@ describe("FactsClient", () => { .build(); const response = await client.facts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", facts: [ { text: "text", @@ -204,7 +225,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -218,6 +238,7 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/interactions/id/facts/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -226,6 +247,7 @@ describe("FactsClient", () => { await expect(async () => { return await client.facts.create("id", { + tenantName: "tenantName", facts: [ { text: "text", @@ -248,7 +270,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" }] }; @@ -270,6 +291,7 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -277,6 +299,7 @@ describe("FactsClient", () => { .build(); const response = await client.facts.batchUpdate("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", facts: [ { factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", @@ -307,7 +330,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "factId" }, { factId: "factId" }] }; @@ -316,6 +338,7 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/id/facts/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -324,6 +347,7 @@ describe("FactsClient", () => { await expect(async () => { return await client.facts.batchUpdate("id", { + tenantName: "tenantName", facts: [ { factId: "factId", @@ -344,7 +368,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -362,6 +385,7 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -371,6 +395,9 @@ describe("FactsClient", () => { const response = await client.facts.update( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", + { + tenantName: "base", + }, ); expect(response).toEqual({ id: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", @@ -392,7 +419,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -401,6 +427,7 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/id/facts/factId") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -408,7 +435,9 @@ describe("FactsClient", () => { .build(); await expect(async () => { - return await client.facts.update("id", "factId"); + return await client.facts.update("id", "factId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -420,7 +449,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { context: [{ type: "text", text: "text" }], outputLanguage: "outputLanguage" }; @@ -433,6 +461,7 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/tools/extract-facts") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -440,6 +469,7 @@ describe("FactsClient", () => { .build(); const response = await client.facts.extract({ + tenantName: "base", context: [ { type: "text", @@ -471,7 +501,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -486,6 +515,7 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/tools/extract-facts") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -494,6 +524,7 @@ describe("FactsClient", () => { await expect(async () => { return await client.facts.extract({ + tenantName: "tenantName", context: [ { type: "text", diff --git a/tests/wire/interactions.test.ts b/tests/wire/interactions.test.ts index e7853a48..2ad84485 100644 --- a/tests/wire/interactions.test.ts +++ b/tests/wire/interactions.test.ts @@ -14,7 +14,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -42,6 +41,7 @@ describe("InteractionsClient", () => { server .mockEndpoint({ once: false }) .get("/interactions/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -71,7 +71,9 @@ describe("InteractionsClient", () => { }, ], }; - const page = await client.interactions.list(); + const page = await client.interactions.list({ + tenantName: "base", + }); expect(expected.interactions).toEqual(page.data); expect(page.hasNextPage()).toBe(true); @@ -87,7 +89,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -96,13 +97,16 @@ describe("InteractionsClient", () => { server .mockEndpoint({ once: false }) .get("/interactions/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.list(); + return await client.interactions.list({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -114,7 +118,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -123,13 +126,16 @@ describe("InteractionsClient", () => { server .mockEndpoint({ once: false }) .get("/interactions/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.list(); + return await client.interactions.list({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -141,7 +147,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -152,6 +157,7 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -159,6 +165,7 @@ describe("InteractionsClient", () => { .build(); const response = await client.interactions.create({ + tenantName: "base", encounter: { identifier: "identifier", status: "planned", @@ -179,7 +186,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -190,6 +196,7 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -198,6 +205,7 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ + tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -215,7 +223,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -226,6 +233,7 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -234,6 +242,7 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ + tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -251,7 +260,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -262,6 +270,7 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -270,6 +279,7 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ + tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -287,7 +297,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -298,6 +307,7 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -306,6 +316,7 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ + tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -323,7 +334,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -354,12 +364,15 @@ describe("InteractionsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479"); + const response = await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", + }); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", assignedUserId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -396,16 +409,24 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/interactions/id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/interactions/id") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.interactions.get("id"); + return await client.interactions.get("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -417,16 +438,24 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server.mockEndpoint().get("/interactions/id").respondWith().statusCode(504).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/interactions/id") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(504) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.interactions.get("id"); + return await client.interactions.get("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -438,18 +467,20 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); - const response = await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479"); + const response = await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", + }); expect(response).toEqual(undefined); }); @@ -461,7 +492,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -470,13 +500,16 @@ describe("InteractionsClient", () => { server .mockEndpoint() .delete("/interactions/id") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.delete("id"); + return await client.interactions.delete("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -488,7 +521,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -497,13 +529,16 @@ describe("InteractionsClient", () => { server .mockEndpoint() .delete("/interactions/id") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.delete("id"); + return await client.interactions.delete("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -515,7 +550,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -546,13 +580,16 @@ describe("InteractionsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479"); + const response = await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", + }); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", assignedUserId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -589,7 +626,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -598,6 +634,7 @@ describe("InteractionsClient", () => { server .mockEndpoint() .patch("/interactions/id") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -605,7 +642,9 @@ describe("InteractionsClient", () => { .build(); await expect(async () => { - return await client.interactions.update("id"); + return await client.interactions.update("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -617,7 +656,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -626,6 +664,7 @@ describe("InteractionsClient", () => { server .mockEndpoint() .patch("/interactions/id") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -633,7 +672,9 @@ describe("InteractionsClient", () => { .build(); await expect(async () => { - return await client.interactions.update("id"); + return await client.interactions.update("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); }); diff --git a/tests/wire/languages.test.ts b/tests/wire/languages.test.ts index 61b40a6c..d0302375 100644 --- a/tests/wire/languages.test.ts +++ b/tests/wire/languages.test.ts @@ -14,15 +14,23 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { languages: { key: "value" } }; - server.mockEndpoint().get("/languages/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.languages.list(); + server + .mockEndpoint() + .get("/languages/") + .header("Tenant-Name", "base") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.languages.list({ + tenantName: "base", + }); expect(response).toEqual({ languages: { key: "value", @@ -38,16 +46,24 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/languages/").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/languages/") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.languages.list(); + return await client.languages.list({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -59,16 +75,24 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server.mockEndpoint().get("/languages/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/languages/") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.languages.list(); + return await client.languages.list({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); }); diff --git a/tests/wire/recordings.test.ts b/tests/wire/recordings.test.ts index c7f405a7..2f9f505d 100644 --- a/tests/wire/recordings.test.ts +++ b/tests/wire/recordings.test.ts @@ -14,7 +14,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -23,12 +22,15 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/recordings/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); + const response = await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", + }); expect(response).toEqual({ recordings: ["f47ac10b-58cc-4372-a567-0e02b2c3d479"], }); @@ -42,7 +44,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -51,13 +52,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id"); + return await client.recordings.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -69,7 +73,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -78,13 +81,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id"); + return await client.recordings.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -96,7 +102,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -105,13 +110,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id"); + return await client.recordings.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -123,7 +131,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -132,13 +139,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id"); + return await client.recordings.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -150,7 +160,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -159,6 +168,7 @@ describe("RecordingsClient", () => { .delete( "/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/recordings/f47ac10b-58cc-4372-a567-0e02b2c3d479", ) + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); @@ -166,6 +176,9 @@ describe("RecordingsClient", () => { const response = await client.recordings.delete( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", + { + tenantName: "base", + }, ); expect(response).toEqual(undefined); }); @@ -178,7 +191,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -187,13 +199,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId"); + return await client.recordings.delete("id", "recordingId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -205,7 +220,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -214,13 +228,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId"); + return await client.recordings.delete("id", "recordingId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -232,7 +249,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -241,13 +257,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId"); + return await client.recordings.delete("id", "recordingId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -259,7 +278,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -268,13 +286,16 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId"); + return await client.recordings.delete("id", "recordingId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); }); diff --git a/tests/wire/templates.test.ts b/tests/wire/templates.test.ts index f81356be..3f05d198 100644 --- a/tests/wire/templates.test.ts +++ b/tests/wire/templates.test.ts @@ -14,7 +14,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -37,9 +36,18 @@ describe("TemplatesClient", () => { ], }; - server.mockEndpoint().get("/templateSections/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.templates.sectionList(); + server + .mockEndpoint() + .get("/templateSections/") + .header("Tenant-Name", "base") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.templates.sectionList({ + tenantName: "base", + }); expect(response).toEqual({ data: [ { @@ -74,16 +82,24 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/templateSections/").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/templateSections/") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.templates.sectionList(); + return await client.templates.sectionList({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -95,16 +111,24 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server.mockEndpoint().get("/templateSections/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/templateSections/") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.templates.sectionList(); + return await client.templates.sectionList({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -116,7 +140,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -148,9 +171,18 @@ describe("TemplatesClient", () => { ], }; - server.mockEndpoint().get("/templates/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.templates.list(); + server + .mockEndpoint() + .get("/templates/") + .header("Tenant-Name", "base") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.templates.list({ + tenantName: "base", + }); expect(response).toEqual({ data: [ { @@ -198,16 +230,24 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/templates/").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/templates/") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.templates.list(); + return await client.templates.list({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -219,16 +259,24 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server.mockEndpoint().get("/templates/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/templates/") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.templates.list(); + return await client.templates.list({ + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -240,7 +288,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -268,9 +315,18 @@ describe("TemplatesClient", () => { translations: [{ languageId: "languageId", name: "name", description: "description" }], }; - server.mockEndpoint().get("/templates/key").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.templates.get("key"); + server + .mockEndpoint() + .get("/templates/key") + .header("Tenant-Name", "base") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.templates.get("key", { + tenantName: "base", + }); expect(response).toEqual({ updatedAt: new Date("2024-01-15T09:30:00.000Z"), name: "name", @@ -316,16 +372,24 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/templates/key").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/templates/key") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.templates.get("key"); + return await client.templates.get("key", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -337,16 +401,24 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server.mockEndpoint().get("/templates/key").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + server + .mockEndpoint() + .get("/templates/key") + .header("Tenant-Name", "tenantName") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); await expect(async () => { - return await client.templates.get("key"); + return await client.templates.get("key", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); }); diff --git a/tests/wire/transcripts.test.ts b/tests/wire/transcripts.test.ts index ea5be3b4..f2f5db77 100644 --- a/tests/wire/transcripts.test.ts +++ b/tests/wire/transcripts.test.ts @@ -14,7 +14,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -34,12 +33,15 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); + const response = await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", + }); expect(response).toEqual({ transcripts: [ { @@ -71,7 +73,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -80,13 +81,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id"); + return await client.transcripts.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -98,7 +102,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -107,13 +110,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id"); + return await client.transcripts.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -125,7 +131,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -134,13 +139,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id"); + return await client.transcripts.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -152,7 +160,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -161,13 +168,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id"); + return await client.transcripts.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -179,7 +189,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -188,13 +197,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id"); + return await client.transcripts.list("id", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -206,7 +218,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", primaryLanguage: "en" }; @@ -222,6 +233,7 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/") + .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -229,6 +241,7 @@ describe("TranscriptsClient", () => { .build(); const response = await client.transcripts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { + tenantName: "base", recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", primaryLanguage: "en", }); @@ -268,7 +281,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -277,6 +289,7 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -285,6 +298,7 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { + tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -299,7 +313,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -308,6 +321,7 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(401) @@ -316,6 +330,7 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { + tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -330,7 +345,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -339,6 +353,7 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -347,6 +362,7 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { + tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -361,7 +377,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -370,6 +385,7 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -378,6 +394,7 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { + tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -392,7 +409,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -401,6 +417,7 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") + .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -409,6 +426,7 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { + tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -423,7 +441,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -439,6 +456,7 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/f47ac10b-58cc-4372-a567-0e02b2c3d479") + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -447,6 +465,9 @@ describe("TranscriptsClient", () => { const response = await client.transcripts.get( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", + { + tenantName: "base", + }, ); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -484,7 +505,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -493,13 +513,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId"); + return await client.transcripts.get("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -511,7 +534,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -520,13 +542,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId"); + return await client.transcripts.get("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -538,7 +563,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -547,13 +571,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId"); + return await client.transcripts.get("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -565,7 +592,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -574,13 +600,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId"); + return await client.transcripts.get("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -592,7 +621,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -601,13 +629,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId"); + return await client.transcripts.get("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -619,7 +650,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -628,6 +658,7 @@ describe("TranscriptsClient", () => { .delete( "/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/f47ac10b-58cc-4372-a567-0e02b2c3d479", ) + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); @@ -635,6 +666,9 @@ describe("TranscriptsClient", () => { const response = await client.transcripts.delete( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", + { + tenantName: "base", + }, ); expect(response).toEqual(undefined); }); @@ -647,7 +681,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -656,13 +689,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId"); + return await client.transcripts.delete("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -674,7 +710,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -683,13 +718,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId"); + return await client.transcripts.delete("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -701,7 +739,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -710,13 +747,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId"); + return await client.transcripts.delete("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -728,7 +768,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -737,13 +776,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId"); + return await client.transcripts.delete("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -755,7 +797,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -764,13 +805,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId"); + return await client.transcripts.delete("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -782,7 +826,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -793,6 +836,7 @@ describe("TranscriptsClient", () => { .get( "/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/f47ac10b-58cc-4372-a567-0e02b2c3d479/status", ) + .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -801,6 +845,9 @@ describe("TranscriptsClient", () => { const response = await client.transcripts.getStatus( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", + { + tenantName: "base", + }, ); expect(response).toEqual({ status: "completed", @@ -815,7 +862,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -824,13 +870,16 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId/status") + .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.getStatus("id", "transcriptId"); + return await client.transcripts.getStatus("id", "transcriptId", { + tenantName: "tenantName", + }); }).rejects.toThrow(Corti.NotFoundError); }); }); From bd99973ef3dcea228a982b45d93a700942adeb35 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:37:14 +0000 Subject: [PATCH 03/18] SDK regeneration --- .fern/metadata.json | 4 +- src/BaseClient.ts | 5 + src/api/resources/agents/client/Client.ts | 8 +- .../agents/resources/a2A/client/Client.ts | 15 +- .../a2A/resources/tasks/client/Client.ts | 20 +- .../resources/artifacts/client/Client.ts | 3 +- .../resources/connectors/client/Client.ts | 6 +- .../resources/contexts/client/Client.ts | 5 +- .../contexts/resources/tasks/client/Client.ts | 4 +- .../resources/feedback/client/Client.ts | 5 +- .../resources/registry/client/Client.ts | 4 +- .../agents/resources/usage/client/Client.ts | 3 +- src/api/resources/auth/client/Client.ts | 17 +- ...okenRequest.ts => AuthTokenRequestBody.ts} | 2 +- src/api/resources/auth/types/index.ts | 2 +- src/api/resources/codes/client/Client.ts | 7 +- .../requests/CodesGeneralPredictRequest.ts | 4 - src/api/resources/documents/client/Client.ts | 99 ++-- .../client/requests/CreateDocumentsRequest.ts | 25 - .../client/requests/DeleteDocumentsRequest.ts | 12 - .../client/requests/DocumentsUpdateRequest.ts | 6 +- .../requests/GenerateDocumentsRequest.ts | 21 - .../client/requests/GetDocumentsRequest.ts | 12 - .../client/requests/ListDocumentsRequest.ts | 12 - .../documents/client/requests/index.ts | 5 - .../resources/sections/client/Client.ts | 72 +-- .../client/requests/CreateSectionsRequest.ts | 19 - .../client/requests/DeleteSectionsRequest.ts | 12 - .../client/requests/GetSectionsRequest.ts | 12 - .../requests/GuidedSectionsListRequest.ts | 6 +- .../requests/GuidedSectionsUpdateRequest.ts | 6 +- .../sections/client/requests/index.ts | 3 - .../resources/versions/client/Client.ts | 54 +-- .../client/requests/DeleteVersionsRequest.ts | 12 - .../client/requests/GetVersionsRequest.ts | 12 - .../GuidedSectionsCreateVersionRequest.ts | 3 - .../client/requests/ListVersionsRequest.ts | 12 - .../client/requests/PublishVersionsRequest.ts | 12 - .../versions/client/requests/index.ts | 4 - .../resources/templates/client/Client.ts | 72 +-- .../client/requests/CreateTemplatesRequest.ts | 19 - .../client/requests/DeleteTemplatesRequest.ts | 12 - .../client/requests/GetTemplatesRequest.ts | 12 - .../requests/GuidedTemplatesListRequest.ts | 6 +- .../requests/GuidedTemplatesUpdateRequest.ts | 6 +- .../templates/client/requests/index.ts | 3 - .../resources/versions/client/Client.ts | 54 +-- .../client/requests/DeleteVersionsRequest.ts | 12 - .../client/requests/GetVersionsRequest.ts | 12 - .../GuidedTemplatesCreateVersionRequest.ts | 3 - .../client/requests/ListVersionsRequest.ts | 12 - .../client/requests/PublishVersionsRequest.ts | 12 - .../versions/client/requests/index.ts | 4 - src/api/resources/facts/client/Client.ts | 55 +-- .../requests/FactsBatchUpdateRequest.ts | 3 - .../client/requests/FactsCreateRequest.ts | 3 - .../client/requests/FactsExtractRequest.ts | 3 - .../requests/FactsFactGroupsListRequest.ts | 12 - .../facts/client/requests/FactsListRequest.ts | 12 - .../client/requests/FactsUpdateRequest.ts | 6 +- .../resources/facts/client/requests/index.ts | 2 - src/api/resources/index.ts | 1 - .../resources/interactions/client/Client.ts | 58 +-- .../requests/InteractionsCreateRequest.ts | 3 - .../requests/InteractionsDeleteRequest.ts | 12 - .../client/requests/InteractionsGetRequest.ts | 12 - .../requests/InteractionsListRequest.ts | 6 +- .../requests/InteractionsUpdateRequest.ts | 6 +- .../interactions/client/requests/index.ts | 2 - src/api/resources/languages/client/Client.ts | 12 +- .../client/requests/LanguagesListRequest.ts | 6 +- src/api/resources/recordings/client/Client.ts | 32 +- src/api/resources/recordings/client/index.ts | 2 +- .../requests/RecordingsDeleteRequest.ts | 12 - .../client/requests/RecordingsGetRequest.ts | 12 - .../client/requests/RecordingsListRequest.ts | 12 - .../recordings/client/requests/index.ts | 3 - src/api/resources/templates/client/Client.ts | 36 +- .../client/requests/GetTemplatesRequest.ts | 12 - .../client/requests/TemplatesListRequest.ts | 6 +- .../requests/TemplatesSectionListRequest.ts | 6 +- .../templates/client/requests/index.ts | 1 - .../resources/transcripts/client/Client.ts | 54 +-- .../requests/TranscriptsCreateRequest.ts | 3 - .../requests/TranscriptsDeleteRequest.ts | 12 - .../client/requests/TranscriptsGetRequest.ts | 12 - .../requests/TranscriptsGetStatusRequest.ts | 12 - .../client/requests/TranscriptsListRequest.ts | 6 +- .../transcripts/client/requests/index.ts | 3 - ...okenRequest.ts => AuthTokenRequestBody.ts} | 20 +- .../resources/auth/types/index.ts | 2 +- .../requests/CodesGeneralPredictRequest.ts | 2 +- .../client/requests/DocumentsUpdateRequest.ts | 2 +- .../requests/GuidedSectionsUpdateRequest.ts | 2 +- .../GuidedSectionsCreateVersionRequest.ts | 2 +- .../requests/GuidedTemplatesUpdateRequest.ts | 2 +- .../GuidedTemplatesCreateVersionRequest.ts | 2 +- .../requests/FactsBatchUpdateRequest.ts | 2 +- .../client/requests/FactsCreateRequest.ts | 2 +- .../client/requests/FactsExtractRequest.ts | 2 +- .../client/requests/FactsUpdateRequest.ts | 2 +- .../requests/InteractionsCreateRequest.ts | 2 +- .../requests/InteractionsUpdateRequest.ts | 2 +- .../requests/TranscriptsCreateRequest.ts | 2 +- tests/wire/agents.test.ts | 26 ++ tests/wire/agents/a2A.test.ts | 11 + tests/wire/agents/a2A/tasks.test.ts | 10 + tests/wire/agents/artifacts.test.ts | 4 + tests/wire/agents/connectors.test.ts | 14 + tests/wire/agents/contexts.test.ts | 10 + tests/wire/agents/contexts/tasks.test.ts | 6 + tests/wire/agents/feedback.test.ts | 12 + tests/wire/agents/registry.test.ts | 5 + tests/wire/agents/usage.test.ts | 4 + tests/wire/auth.test.ts | 4 + tests/wire/codes.test.ts | 21 +- tests/wire/documents.test.ts | 429 ++++++++---------- tests/wire/documents/sections.test.ts | 79 +--- .../wire/documents/sections/versions.test.ts | 57 +-- tests/wire/documents/templates.test.ts | 79 +--- .../wire/documents/templates/versions.test.ts | 57 +-- tests/wire/facts.test.ts | 69 +-- tests/wire/interactions.test.ts | 103 ++--- tests/wire/languages.test.ts | 44 +- tests/wire/recordings.test.ts | 59 +-- tests/wire/templates.test.ts | 132 ++---- tests/wire/transcripts.test.ts | 135 ++---- 127 files changed, 838 insertions(+), 1814 deletions(-) rename src/api/resources/auth/types/{AuthTokenRequest.ts => AuthTokenRequestBody.ts} (90%) delete mode 100644 src/api/resources/documents/client/requests/CreateDocumentsRequest.ts delete mode 100644 src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts delete mode 100644 src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts delete mode 100644 src/api/resources/documents/client/requests/GetDocumentsRequest.ts delete mode 100644 src/api/resources/documents/client/requests/ListDocumentsRequest.ts delete mode 100644 src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts delete mode 100644 src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts delete mode 100644 src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts delete mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts delete mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts delete mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts delete mode 100644 src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts delete mode 100644 src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts delete mode 100644 src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts delete mode 100644 src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts delete mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts delete mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts delete mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts delete mode 100644 src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts delete mode 100644 src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts delete mode 100644 src/api/resources/facts/client/requests/FactsListRequest.ts delete mode 100644 src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts delete mode 100644 src/api/resources/interactions/client/requests/InteractionsGetRequest.ts delete mode 100644 src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts delete mode 100644 src/api/resources/recordings/client/requests/RecordingsGetRequest.ts delete mode 100644 src/api/resources/recordings/client/requests/RecordingsListRequest.ts delete mode 100644 src/api/resources/recordings/client/requests/index.ts delete mode 100644 src/api/resources/templates/client/requests/GetTemplatesRequest.ts delete mode 100644 src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts delete mode 100644 src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts delete mode 100644 src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts rename src/serialization/resources/auth/types/{AuthTokenRequest.ts => AuthTokenRequestBody.ts} (70%) diff --git a/.fern/metadata.json b/.fern/metadata.json index 86e2a4c5..ca510516 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "5.76.0", + "cliVersion": "5.75.1", "generatorName": "fernapi/fern-typescript-node-sdk", "generatorVersion": "3.54.0", "generatorConfig": { @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "494ce65f402ea1511484a96e17fc38f6e5de1eff", + "originGitCommit": "2d0f96ea6c9cae547e46b779d70a73ff3bfeee01", "sdkVersion": "0.0.0-dev" } diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 50d2b1af..27d389e5 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -9,6 +9,8 @@ export type BaseClientOptions = { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; + /** Override the Tenant-Name header */ + tenantName?: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | null | undefined>; /** The default maximum time to wait for a response in seconds. */ @@ -28,6 +30,8 @@ export interface BaseRequestOptions { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Override the Tenant-Name header */ + tenantName?: string | undefined; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ @@ -55,6 +59,7 @@ export function normalizeClientOptions({ diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts b/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts index 9b497b24..1ac7bb74 100644 --- a/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts +++ b/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts @@ -54,7 +54,10 @@ export class TasksClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -153,7 +156,10 @@ export class TasksClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -236,7 +242,10 @@ export class TasksClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -317,7 +326,10 @@ export class TasksClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "A2A-Version": "1.0" }), + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/agents/resources/artifacts/client/Client.ts b/src/api/resources/agents/resources/artifacts/client/Client.ts index bac817fa..aab9a226 100644 --- a/src/api/resources/agents/resources/artifacts/client/Client.ts +++ b/src/api/resources/agents/resources/artifacts/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -57,6 +57,7 @@ export class ArtifactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/agents/resources/connectors/client/Client.ts b/src/api/resources/agents/resources/connectors/client/Client.ts index 80b7b601..f03d43b4 100644 --- a/src/api/resources/agents/resources/connectors/client/Client.ts +++ b/src/api/resources/agents/resources/connectors/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -47,6 +47,7 @@ export class ConnectorsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -133,6 +134,7 @@ export class ConnectorsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -224,6 +226,7 @@ export class ConnectorsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -305,6 +308,7 @@ export class ConnectorsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/agents/resources/contexts/client/Client.ts b/src/api/resources/agents/resources/contexts/client/Client.ts index c33c5e75..d4ff15f2 100644 --- a/src/api/resources/agents/resources/contexts/client/Client.ts +++ b/src/api/resources/agents/resources/contexts/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -65,6 +65,7 @@ export class ContextsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -143,6 +144,7 @@ export class ContextsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -222,6 +224,7 @@ export class ContextsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts b/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts index 86a772d3..9d4f8ae9 100644 --- a/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts +++ b/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts @@ -5,7 +5,7 @@ import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; import * as core from "../../../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../../../errors/index.js"; @@ -54,6 +54,7 @@ export class TasksClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -147,6 +148,7 @@ export class TasksClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/agents/resources/feedback/client/Client.ts b/src/api/resources/agents/resources/feedback/client/Client.ts index cf07ff8a..1f451a41 100644 --- a/src/api/resources/agents/resources/feedback/client/Client.ts +++ b/src/api/resources/agents/resources/feedback/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -52,6 +52,7 @@ export class FeedbackClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -168,6 +169,7 @@ export class FeedbackClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -261,6 +263,7 @@ export class FeedbackClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/agents/resources/registry/client/Client.ts b/src/api/resources/agents/resources/registry/client/Client.ts index f6733871..e743a94c 100644 --- a/src/api/resources/agents/resources/registry/client/Client.ts +++ b/src/api/resources/agents/resources/registry/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -49,6 +49,7 @@ export class RegistryClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -137,6 +138,7 @@ export class RegistryClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/agents/resources/usage/client/Client.ts b/src/api/resources/agents/resources/usage/client/Client.ts index d1fe3072..b00118f2 100644 --- a/src/api/resources/agents/resources/usage/client/Client.ts +++ b/src/api/resources/agents/resources/usage/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -73,6 +73,7 @@ export class UsageClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/auth/client/Client.ts b/src/api/resources/auth/client/Client.ts index 0515c88b..61085918 100644 --- a/src/api/resources/auth/client/Client.ts +++ b/src/api/resources/auth/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -43,7 +43,11 @@ export class AuthClient { request: Corti.OAuthTokenRequest, requestOptions?: AuthClient.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -94,7 +98,7 @@ export class AuthClient { * authorization_code (with client_secret), authorization_code with PKCE (code_verifier), password (ROPC), or refresh_token. Use the returned access_token in the Authorization header when calling the Corti API. * * @param {string} tenantName - * @param {Corti.AuthTokenRequest} request + * @param {Corti.AuthTokenRequestBody} request * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -109,7 +113,7 @@ export class AuthClient { */ public token( tenantName: string, - request: Corti.AuthTokenRequest, + request: Corti.AuthTokenRequestBody, requestOptions?: AuthClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__token(tenantName, request, requestOptions)); @@ -117,13 +121,14 @@ export class AuthClient { private async __token( tenantName: string, - request: Corti.AuthTokenRequest, + request: Corti.AuthTokenRequestBody, requestOptions?: AuthClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -137,7 +142,7 @@ export class AuthClient { contentType: "application/x-www-form-urlencoded", queryParameters: requestOptions?.queryParams, requestType: "form", - body: serializers.AuthTokenRequest.jsonOrThrow(request, { + body: serializers.AuthTokenRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/auth/types/AuthTokenRequest.ts b/src/api/resources/auth/types/AuthTokenRequestBody.ts similarity index 90% rename from src/api/resources/auth/types/AuthTokenRequest.ts rename to src/api/resources/auth/types/AuthTokenRequestBody.ts index 62bc3cad..17aeb485 100644 --- a/src/api/resources/auth/types/AuthTokenRequest.ts +++ b/src/api/resources/auth/types/AuthTokenRequestBody.ts @@ -2,7 +2,7 @@ import type * as Corti from "../../../index.js"; -export type AuthTokenRequest = +export type AuthTokenRequestBody = | Corti.AuthTokenRequestClientCredentials | Corti.AuthTokenRequestAuthorizationCode | Corti.AuthTokenRequestAuthorizationPkce diff --git a/src/api/resources/auth/types/index.ts b/src/api/resources/auth/types/index.ts index c07e19c2..536709bd 100644 --- a/src/api/resources/auth/types/index.ts +++ b/src/api/resources/auth/types/index.ts @@ -1 +1 @@ -export * from "./AuthTokenRequest.js"; +export * from "./AuthTokenRequestBody.js"; diff --git a/src/api/resources/codes/client/Client.ts b/src/api/resources/codes/client/Client.ts index e4d18134..fc372036 100644 --- a/src/api/resources/codes/client/Client.ts +++ b/src/api/resources/codes/client/Client.ts @@ -36,7 +36,6 @@ export class CodesClient { * * @example * await client.codes.predict({ - * tenantName: "base", * system: ["icd10cm-outpatient", "cpt"], * context: [{ * type: "text", @@ -46,7 +45,6 @@ export class CodesClient { * * @example * await client.codes.predict({ - * tenantName: "base", * system: ["icd10cm-outpatient"], * context: [{ * type: "text", @@ -69,12 +67,11 @@ export class CodesClient { request: Corti.CodesGeneralPredictRequest, requestOptions?: CodesClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -88,7 +85,7 @@ export class CodesClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.CodesGeneralPredictRequest.jsonOrThrow(_body, { + body: serializers.CodesGeneralPredictRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts b/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts index e4bb20fc..26464004 100644 --- a/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts +++ b/src/api/resources/codes/client/requests/CodesGeneralPredictRequest.ts @@ -5,7 +5,6 @@ import type * as Corti from "../../../../index.js"; /** * @example * { - * tenantName: "base", * system: ["icd10cm-outpatient", "cpt"], * context: [{ * type: "text", @@ -15,7 +14,6 @@ import type * as Corti from "../../../../index.js"; * * @example * { - * tenantName: "base", * system: ["icd10cm-outpatient"], * context: [{ * type: "text", @@ -28,8 +26,6 @@ import type * as Corti from "../../../../index.js"; * } */ export interface CodesGeneralPredictRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** List of coding systems for prediction */ system: Corti.CommonCodingSystemEnum[]; /** Select either `text` or `documentId` as input context to the model for code prediction. Evidence indices in the response map to this array. */ diff --git a/src/api/resources/documents/client/Client.ts b/src/api/resources/documents/client/Client.ts index a71e2dc2..ed2310bb 100644 --- a/src/api/resources/documents/client/Client.ts +++ b/src/api/resources/documents/client/Client.ts @@ -40,7 +40,6 @@ export class DocumentsClient { * List Documents * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.ListDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -49,29 +48,24 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public list( id: Corti.Uuid, - request: Corti.ListDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(id, requestOptions)); } private async __list( id: Corti.Uuid, - request: Corti.ListDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -148,7 +142,7 @@ export class DocumentsClient { * This endpoint offers different ways to generate a document. Find guides to document generation [here](/textgen/documents-standard). * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.CreateDocumentsRequest} request + * @param {Corti.DocumentsCreateRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -158,22 +152,19 @@ export class DocumentsClient { * * @example * await client.documents.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base", - * body: { - * context: [{ - * type: "facts", - * data: [{ - * text: "text" - * }] - * }], - * templateKey: "templateKey", - * outputLanguage: "outputLanguage" - * } + * context: [{ + * type: "facts", + * data: [{ + * text: "text" + * }] + * }], + * templateKey: "templateKey", + * outputLanguage: "outputLanguage" * }) */ public create( id: Corti.Uuid, - request: Corti.CreateDocumentsRequest, + request: Corti.DocumentsCreateRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(id, request, requestOptions)); @@ -181,15 +172,14 @@ export class DocumentsClient { private async __create( id: Corti.Uuid, - request: Corti.CreateDocumentsRequest, + request: Corti.DocumentsCreateRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { - const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -203,7 +193,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.DocumentsCreateRequest.jsonOrThrow(_body, { + body: serializers.DocumentsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -278,7 +268,6 @@ export class DocumentsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} documentId - The document ID representing the context for the request. Must be a valid UUID. - * @param {Corti.GetDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -287,31 +276,26 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.documents.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public get( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.GetDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, documentId, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, documentId, requestOptions)); } private async __get( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.GetDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -392,7 +376,6 @@ export class DocumentsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} documentId - The document ID representing the context for the request. Must be a valid UUID. - * @param {Corti.DeleteDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} @@ -401,31 +384,26 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.documents.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public delete( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.DeleteDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, documentId, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(id, documentId, requestOptions)); } private async __delete( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.DeleteDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -506,14 +484,12 @@ export class DocumentsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.documents.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.documents.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public update( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.DocumentsUpdateRequest, + request: Corti.DocumentsUpdateRequest = {}, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, documentId, request, requestOptions)); @@ -522,15 +498,14 @@ export class DocumentsClient { private async __update( id: Corti.Uuid, documentId: Corti.Uuid, - request: Corti.DocumentsUpdateRequest, + request: Corti.DocumentsUpdateRequest = {}, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -544,7 +519,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.DocumentsUpdateRequest.jsonOrThrow(_body, { + body: serializers.DocumentsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -617,7 +592,7 @@ export class DocumentsClient { * Context can combine different types or reference an interactionId to automatically fetch existing context to pass to the LLM. Note that discarded facts are not passed to the LLM. * With the exception of the plain `templateRef` path (no overrides), every call creates a new auto-generated template aggregate that snapshots the resolved prompts as a drift-proof receipt, persisted for 30 days. * - * @param {Corti.GenerateDocumentsRequest} request + * @param {Corti.GuidedDocumentsGenerateRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -627,32 +602,28 @@ export class DocumentsClient { * * @example * await client.documents.generate({ - * tenantName: "base", - * body: { - * outputLanguage: "outputLanguage", - * templateRef: { - * templateId: "templateId" - * } + * outputLanguage: "outputLanguage", + * templateRef: { + * templateId: "templateId" * } * }) */ public generate( - request: Corti.GenerateDocumentsRequest, + request: Corti.GuidedDocumentsGenerateRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__generate(request, requestOptions)); } private async __generate( - request: Corti.GenerateDocumentsRequest, + request: Corti.GuidedDocumentsGenerateRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { - const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -666,7 +637,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.GuidedDocumentsGenerateRequest.jsonOrThrow(_body, { + body: serializers.GuidedDocumentsGenerateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts b/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts deleted file mode 100644 index 46d72681..00000000 --- a/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * tenantName: "base", - * body: { - * context: [{ - * type: "facts", - * data: [{ - * text: "text" - * }] - * }], - * templateKey: "templateKey", - * outputLanguage: "outputLanguage" - * } - * } - */ -export interface CreateDocumentsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; - body: Corti.DocumentsCreateRequest; -} diff --git a/src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts b/src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts deleted file mode 100644 index f2c6bc05..00000000 --- a/src/api/resources/documents/client/requests/DeleteDocumentsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface DeleteDocumentsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts b/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts index b0b485a0..20c1b75e 100644 --- a/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts +++ b/src/api/resources/documents/client/requests/DocumentsUpdateRequest.ts @@ -4,13 +4,9 @@ import type * as Corti from "../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface DocumentsUpdateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** An optional name for the document. */ name?: string; sections?: Corti.DocumentsSectionInput[]; diff --git a/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts b/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts deleted file mode 100644 index aa733f64..00000000 --- a/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * tenantName: "base", - * body: { - * outputLanguage: "outputLanguage", - * templateRef: { - * templateId: "templateId" - * } - * } - * } - */ -export interface GenerateDocumentsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; - body: Corti.GuidedDocumentsGenerateRequest; -} diff --git a/src/api/resources/documents/client/requests/GetDocumentsRequest.ts b/src/api/resources/documents/client/requests/GetDocumentsRequest.ts deleted file mode 100644 index 1460fdca..00000000 --- a/src/api/resources/documents/client/requests/GetDocumentsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface GetDocumentsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/client/requests/ListDocumentsRequest.ts b/src/api/resources/documents/client/requests/ListDocumentsRequest.ts deleted file mode 100644 index 89f2adef..00000000 --- a/src/api/resources/documents/client/requests/ListDocumentsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface ListDocumentsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/client/requests/index.ts b/src/api/resources/documents/client/requests/index.ts index a2eb647c..d86bd2d7 100644 --- a/src/api/resources/documents/client/requests/index.ts +++ b/src/api/resources/documents/client/requests/index.ts @@ -1,6 +1 @@ -export type { CreateDocumentsRequest } from "./CreateDocumentsRequest.js"; -export type { DeleteDocumentsRequest } from "./DeleteDocumentsRequest.js"; export type { DocumentsUpdateRequest } from "./DocumentsUpdateRequest.js"; -export type { GenerateDocumentsRequest } from "./GenerateDocumentsRequest.js"; -export type { GetDocumentsRequest } from "./GetDocumentsRequest.js"; -export type { ListDocumentsRequest } from "./ListDocumentsRequest.js"; diff --git a/src/api/resources/documents/resources/sections/client/Client.ts b/src/api/resources/documents/resources/sections/client/Client.ts index 4bdddc28..8454ef68 100644 --- a/src/api/resources/documents/resources/sections/client/Client.ts +++ b/src/api/resources/documents/resources/sections/client/Client.ts @@ -36,22 +36,20 @@ export class SectionsClient { * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.documents.sections.list({ - * tenantName: "base" - * }) + * await client.documents.sections.list() */ public list( - request: Corti.documents.GuidedSectionsListRequest, + request: Corti.documents.GuidedSectionsListRequest = {}, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.documents.GuidedSectionsListRequest, + request: Corti.documents.GuidedSectionsListRequest = {}, requestOptions?: SectionsClient.RequestOptions, ): Promise> { - const { lang, region, specialty, label, published, source, tenantName } = request; + const { lang, region, specialty, label, published, source } = request; const _queryParams: Record = { lang, region, @@ -70,7 +68,7 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -117,37 +115,33 @@ export class SectionsClient { * the response includes the published version with full inheritance resolution applied * (section inheritance chain walked to fill missing fields). * - * @param {Corti.documents.CreateSectionsRequest} request + * @param {Corti.GuidedSectionsCreateRequest} request * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * * @example * await client.documents.sections.create({ - * tenantName: "base", - * body: { - * name: "name", - * inheritFromId: "inheritFromId" - * } + * name: "name", + * inheritFromId: "inheritFromId" * }) */ public create( - request: Corti.documents.CreateSectionsRequest, + request: Corti.GuidedSectionsCreateRequest, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( - request: Corti.documents.CreateSectionsRequest, + request: Corti.GuidedSectionsCreateRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { - const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -161,7 +155,7 @@ export class SectionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.GuidedSectionsCreateRequest.jsonOrThrow(_body, { + body: serializers.GuidedSectionsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -206,35 +200,29 @@ export class SectionsClient { * GET /documents/sections/{sectionID}/versions/{versionID}. * * @param {string} sectionID - * @param {Corti.documents.GetSectionsRequest} request * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.get("sectionID", { - * tenantName: "base" - * }) + * await client.documents.sections.get("sectionID") */ public get( sectionID: string, - request: Corti.documents.GetSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(sectionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(sectionID, requestOptions)); } private async __get( sectionID: string, - request: Corti.documents.GetSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -290,36 +278,27 @@ export class SectionsClient { * Deletes a section and its versions. Returns 409 if other sections inherit from this section. * * @param {string} sectionID - * @param {Corti.documents.DeleteSectionsRequest} request * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * @throws {@link Corti.ConflictError} * * @example - * await client.documents.sections.delete("sectionID", { - * tenantName: "base" - * }) + * await client.documents.sections.delete("sectionID") */ - public delete( - sectionID: string, - request: Corti.documents.DeleteSectionsRequest, - requestOptions?: SectionsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, request, requestOptions)); + public delete(sectionID: string, requestOptions?: SectionsClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, requestOptions)); } private async __delete( sectionID: string, - request: Corti.documents.DeleteSectionsRequest, requestOptions?: SectionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -376,13 +355,11 @@ export class SectionsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.update("sectionID", { - * tenantName: "base" - * }) + * await client.documents.sections.update("sectionID") */ public update( sectionID: string, - request: Corti.documents.GuidedSectionsUpdateRequest, + request: Corti.documents.GuidedSectionsUpdateRequest = {}, requestOptions?: SectionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(sectionID, request, requestOptions)); @@ -390,15 +367,14 @@ export class SectionsClient { private async __update( sectionID: string, - request: Corti.documents.GuidedSectionsUpdateRequest, + request: Corti.documents.GuidedSectionsUpdateRequest = {}, requestOptions?: SectionsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -412,7 +388,7 @@ export class SectionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.GuidedSectionsUpdateRequest.jsonOrThrow(_body, { + body: serializers.documents.GuidedSectionsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts b/src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts deleted file mode 100644 index a44561a1..00000000 --- a/src/api/resources/documents/resources/sections/client/requests/CreateSectionsRequest.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * tenantName: "base", - * body: { - * name: "name", - * inheritFromId: "inheritFromId" - * } - * } - */ -export interface CreateSectionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; - body: Corti.GuidedSectionsCreateRequest; -} diff --git a/src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts b/src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts deleted file mode 100644 index 97f23474..00000000 --- a/src/api/resources/documents/resources/sections/client/requests/DeleteSectionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface DeleteSectionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts b/src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts deleted file mode 100644 index 7a00fd1f..00000000 --- a/src/api/resources/documents/resources/sections/client/requests/GetSectionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface GetSectionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts index a2f2516b..eceffddf 100644 --- a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts +++ b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsListRequest.ts @@ -4,9 +4,7 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface GuidedSectionsListRequest { /** Filter sections by BCP 47 language tag (e.g. `fr`, `de`, or `en-GB`). Repeatable. */ @@ -21,6 +19,4 @@ export interface GuidedSectionsListRequest { published?: boolean; /** Filter by source. Omit to return both. `user` returns only user-created sections; `corti` returns only Corti standard sections. */ source?: Corti.GuidedSourceFilter; - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; } diff --git a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts index 37346c95..958f4777 100644 --- a/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts +++ b/src/api/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts @@ -4,13 +4,9 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface GuidedSectionsUpdateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** A human-readable identifier for this section. Not passed to the LLM. */ name?: string; /** A description for this section. Not passed to the LLM. */ diff --git a/src/api/resources/documents/resources/sections/client/requests/index.ts b/src/api/resources/documents/resources/sections/client/requests/index.ts index b9a8c04a..0c305d8c 100644 --- a/src/api/resources/documents/resources/sections/client/requests/index.ts +++ b/src/api/resources/documents/resources/sections/client/requests/index.ts @@ -1,5 +1,2 @@ -export type { CreateSectionsRequest } from "./CreateSectionsRequest.js"; -export type { DeleteSectionsRequest } from "./DeleteSectionsRequest.js"; -export type { GetSectionsRequest } from "./GetSectionsRequest.js"; export type { GuidedSectionsListRequest } from "./GuidedSectionsListRequest.js"; export type { GuidedSectionsUpdateRequest } from "./GuidedSectionsUpdateRequest.js"; diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts index 6dc7de5a..447c2d53 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts @@ -29,35 +29,29 @@ export class VersionsClient { * Returns raw authored section versions without inheritance resolution. To see resolved content, use GET /sections/{sectionID} instead. * * @param {string} sectionID - * @param {Corti.documents.sections.ListVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.list("sectionID", { - * tenantName: "base" - * }) + * await client.documents.sections.versions.list("sectionID") */ public list( sectionID: string, - request: Corti.documents.sections.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(sectionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(sectionID, requestOptions)); } private async __list( sectionID: string, - request: Corti.documents.sections.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -121,7 +115,6 @@ export class VersionsClient { * * @example * await client.documents.sections.versions.create("sectionID", { - * tenantName: "base", * generation: {} * }) */ @@ -138,12 +131,11 @@ export class VersionsClient { request: Corti.documents.sections.GuidedSectionsCreateVersionRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -157,7 +149,7 @@ export class VersionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.sections.GuidedSectionsCreateVersionRequest.jsonOrThrow(_body, { + body: serializers.documents.sections.GuidedSectionsCreateVersionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -208,37 +200,31 @@ export class VersionsClient { * * @param {string} sectionID * @param {string} versionID - * @param {Corti.documents.sections.GetVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.get("sectionID", "versionID", { - * tenantName: "base" - * }) + * await client.documents.sections.versions.get("sectionID", "versionID") */ public get( sectionID: string, versionID: string, - request: Corti.documents.sections.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(sectionID, versionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(sectionID, versionID, requestOptions)); } private async __get( sectionID: string, versionID: string, - request: Corti.documents.sections.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -295,37 +281,31 @@ export class VersionsClient { * * @param {string} sectionID * @param {string} versionID - * @param {Corti.documents.sections.DeleteVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.delete("sectionID", "versionID", { - * tenantName: "base" - * }) + * await client.documents.sections.versions.delete("sectionID", "versionID") */ public delete( sectionID: string, versionID: string, - request: Corti.documents.sections.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, versionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(sectionID, versionID, requestOptions)); } private async __delete( sectionID: string, versionID: string, - request: Corti.documents.sections.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -373,37 +353,31 @@ export class VersionsClient { * * @param {string} sectionID * @param {string} versionID - * @param {Corti.documents.sections.PublishVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.sections.versions.publish("sectionID", "versionID", { - * tenantName: "base" - * }) + * await client.documents.sections.versions.publish("sectionID", "versionID") */ public publish( sectionID: string, versionID: string, - request: Corti.documents.sections.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__publish(sectionID, versionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__publish(sectionID, versionID, requestOptions)); } private async __publish( sectionID: string, versionID: string, - request: Corti.documents.sections.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts deleted file mode 100644 index 7fba5afa..00000000 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/DeleteVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface DeleteVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts deleted file mode 100644 index 772e504d..00000000 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/GetVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface GetVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts index d77940f6..7732d79c 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts @@ -5,12 +5,9 @@ import type * as Corti from "../../../../../../../../index.js"; /** * @example * { - * tenantName: "base", * generation: {} * } */ export interface GuidedSectionsCreateVersionRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; generation: Corti.GuidedSectionGenerationPartial; } diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts deleted file mode 100644 index e1f02cd3..00000000 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/ListVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface ListVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts deleted file mode 100644 index e2d2946a..00000000 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/PublishVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface PublishVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts b/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts index 275f5a14..2e8efdd9 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/requests/index.ts @@ -1,5 +1 @@ -export type { DeleteVersionsRequest } from "./DeleteVersionsRequest.js"; -export type { GetVersionsRequest } from "./GetVersionsRequest.js"; export type { GuidedSectionsCreateVersionRequest } from "./GuidedSectionsCreateVersionRequest.js"; -export type { ListVersionsRequest } from "./ListVersionsRequest.js"; -export type { PublishVersionsRequest } from "./PublishVersionsRequest.js"; diff --git a/src/api/resources/documents/resources/templates/client/Client.ts b/src/api/resources/documents/resources/templates/client/Client.ts index 3e67a183..1dbead5a 100644 --- a/src/api/resources/documents/resources/templates/client/Client.ts +++ b/src/api/resources/documents/resources/templates/client/Client.ts @@ -36,22 +36,20 @@ export class TemplatesClient { * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.documents.templates.list({ - * tenantName: "base" - * }) + * await client.documents.templates.list() */ public list( - request: Corti.documents.GuidedTemplatesListRequest, + request: Corti.documents.GuidedTemplatesListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.documents.GuidedTemplatesListRequest, + request: Corti.documents.GuidedTemplatesListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { lang, region, specialty, label, published, source, tenantName } = request; + const { lang, region, specialty, label, published, source } = request; const _queryParams: Record = { lang, region, @@ -70,7 +68,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -117,37 +115,33 @@ export class TemplatesClient { * the response includes the published version with full inheritance resolution applied * (template-level and section-level inheritance walked). * - * @param {Corti.documents.CreateTemplatesRequest} request + * @param {Corti.GuidedTemplatesCreateRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * * @example * await client.documents.templates.create({ - * tenantName: "base", - * body: { - * name: "name", - * inheritFromId: "inheritFromId" - * } + * name: "name", + * inheritFromId: "inheritFromId" * }) */ public create( - request: Corti.documents.CreateTemplatesRequest, + request: Corti.GuidedTemplatesCreateRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( - request: Corti.documents.CreateTemplatesRequest, + request: Corti.GuidedTemplatesCreateRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { tenantName, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -161,7 +155,7 @@ export class TemplatesClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.GuidedTemplatesCreateRequest.jsonOrThrow(_body, { + body: serializers.GuidedTemplatesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -206,35 +200,29 @@ export class TemplatesClient { * values without inheritance, use GET /documents/templates/{templateID}/versions/{versionID}. * * @param {string} templateID - * @param {Corti.documents.GetTemplatesRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.get("templateID", { - * tenantName: "base" - * }) + * await client.documents.templates.get("templateID") */ public get( templateID: string, - request: Corti.documents.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(templateID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(templateID, requestOptions)); } private async __get( templateID: string, - request: Corti.documents.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -290,36 +278,27 @@ export class TemplatesClient { * Deletes a template and its versions. Returns 409 if other templates or sections inherit from this template. * * @param {string} templateID - * @param {Corti.documents.DeleteTemplatesRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * @throws {@link Corti.ConflictError} * * @example - * await client.documents.templates.delete("templateID", { - * tenantName: "base" - * }) + * await client.documents.templates.delete("templateID") */ - public delete( - templateID: string, - request: Corti.documents.DeleteTemplatesRequest, - requestOptions?: TemplatesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(templateID, request, requestOptions)); + public delete(templateID: string, requestOptions?: TemplatesClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(templateID, requestOptions)); } private async __delete( templateID: string, - request: Corti.documents.DeleteTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -377,13 +356,11 @@ export class TemplatesClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.update("templateID", { - * tenantName: "base" - * }) + * await client.documents.templates.update("templateID") */ public update( templateID: string, - request: Corti.documents.GuidedTemplatesUpdateRequest, + request: Corti.documents.GuidedTemplatesUpdateRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(templateID, request, requestOptions)); @@ -391,15 +368,14 @@ export class TemplatesClient { private async __update( templateID: string, - request: Corti.documents.GuidedTemplatesUpdateRequest, + request: Corti.documents.GuidedTemplatesUpdateRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -413,7 +389,7 @@ export class TemplatesClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.GuidedTemplatesUpdateRequest.jsonOrThrow(_body, { + body: serializers.documents.GuidedTemplatesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts b/src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts deleted file mode 100644 index 6dc90aae..00000000 --- a/src/api/resources/documents/resources/templates/client/requests/CreateTemplatesRequest.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * tenantName: "base", - * body: { - * name: "name", - * inheritFromId: "inheritFromId" - * } - * } - */ -export interface CreateTemplatesRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; - body: Corti.GuidedTemplatesCreateRequest; -} diff --git a/src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts b/src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts deleted file mode 100644 index 30ce4a82..00000000 --- a/src/api/resources/documents/resources/templates/client/requests/DeleteTemplatesRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface DeleteTemplatesRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts b/src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts deleted file mode 100644 index 6a7ecc5b..00000000 --- a/src/api/resources/documents/resources/templates/client/requests/GetTemplatesRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface GetTemplatesRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts index e56248c5..a0f6bf28 100644 --- a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts +++ b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesListRequest.ts @@ -4,9 +4,7 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface GuidedTemplatesListRequest { /** Filter templates by BCP 47 language tag (e.g. `fr`, `de`, or `en-GB`). Repeatable. */ @@ -21,6 +19,4 @@ export interface GuidedTemplatesListRequest { published?: boolean; /** Filter by source. Omit to return both. `user` returns only user/client-created templates; `corti` returns only Corti standard templates. */ source?: Corti.GuidedSourceFilter; - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; } diff --git a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts index f72637ff..3c9bda6b 100644 --- a/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts +++ b/src/api/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts @@ -4,13 +4,9 @@ import type * as Corti from "../../../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface GuidedTemplatesUpdateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** The name of this template. Not passed to the LLM. */ name?: string; /** A description for this template. Not passed to the LLM. */ diff --git a/src/api/resources/documents/resources/templates/client/requests/index.ts b/src/api/resources/documents/resources/templates/client/requests/index.ts index aa0125de..8f1750b0 100644 --- a/src/api/resources/documents/resources/templates/client/requests/index.ts +++ b/src/api/resources/documents/resources/templates/client/requests/index.ts @@ -1,5 +1,2 @@ -export type { CreateTemplatesRequest } from "./CreateTemplatesRequest.js"; -export type { DeleteTemplatesRequest } from "./DeleteTemplatesRequest.js"; -export type { GetTemplatesRequest } from "./GetTemplatesRequest.js"; export type { GuidedTemplatesListRequest } from "./GuidedTemplatesListRequest.js"; export type { GuidedTemplatesUpdateRequest } from "./GuidedTemplatesUpdateRequest.js"; diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts index 2176ca55..305583a4 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts @@ -30,35 +30,29 @@ export class VersionsClient { * To see resolved content, use GET /documents/templates/{templateID} instead. * * @param {string} templateID - * @param {Corti.documents.templates.ListVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.list("templateID", { - * tenantName: "base" - * }) + * await client.documents.templates.versions.list("templateID") */ public list( templateID: string, - request: Corti.documents.templates.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(templateID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(templateID, requestOptions)); } private async __list( templateID: string, - request: Corti.documents.templates.ListVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -122,7 +116,6 @@ export class VersionsClient { * * @example * await client.documents.templates.versions.create("templateID", { - * tenantName: "base", * generation: {} * }) */ @@ -139,12 +132,11 @@ export class VersionsClient { request: Corti.documents.templates.GuidedTemplatesCreateVersionRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -158,7 +150,7 @@ export class VersionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.documents.templates.GuidedTemplatesCreateVersionRequest.jsonOrThrow(_body, { + body: serializers.documents.templates.GuidedTemplatesCreateVersionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -210,37 +202,31 @@ export class VersionsClient { * * @param {string} templateID * @param {string} versionID - * @param {Corti.documents.templates.GetVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.get("templateID", "versionID", { - * tenantName: "base" - * }) + * await client.documents.templates.versions.get("templateID", "versionID") */ public get( templateID: string, versionID: string, - request: Corti.documents.templates.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(templateID, versionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(templateID, versionID, requestOptions)); } private async __get( templateID: string, versionID: string, - request: Corti.documents.templates.GetVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -297,37 +283,31 @@ export class VersionsClient { * * @param {string} templateID * @param {string} versionID - * @param {Corti.documents.templates.DeleteVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.delete("templateID", "versionID", { - * tenantName: "base" - * }) + * await client.documents.templates.versions.delete("templateID", "versionID") */ public delete( templateID: string, versionID: string, - request: Corti.documents.templates.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(templateID, versionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(templateID, versionID, requestOptions)); } private async __delete( templateID: string, versionID: string, - request: Corti.documents.templates.DeleteVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -375,37 +355,31 @@ export class VersionsClient { * * @param {string} templateID * @param {string} versionID - * @param {Corti.documents.templates.PublishVersionsRequest} request * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.documents.templates.versions.publish("templateID", "versionID", { - * tenantName: "base" - * }) + * await client.documents.templates.versions.publish("templateID", "versionID") */ public publish( templateID: string, versionID: string, - request: Corti.documents.templates.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__publish(templateID, versionID, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__publish(templateID, versionID, requestOptions)); } private async __publish( templateID: string, versionID: string, - request: Corti.documents.templates.PublishVersionsRequest, requestOptions?: VersionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts deleted file mode 100644 index 7fba5afa..00000000 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/DeleteVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface DeleteVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts deleted file mode 100644 index 772e504d..00000000 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/GetVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface GetVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts index 21ba34fd..20fe9683 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts @@ -5,12 +5,9 @@ import type * as Corti from "../../../../../../../../index.js"; /** * @example * { - * tenantName: "base", * generation: {} * } */ export interface GuidedTemplatesCreateVersionRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; generation: Corti.GuidedTemplatesVersionGeneration; } diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts deleted file mode 100644 index e1f02cd3..00000000 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/ListVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface ListVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts deleted file mode 100644 index e2d2946a..00000000 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/PublishVersionsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface PublishVersionsRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts b/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts index c119313a..e1b33267 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/requests/index.ts @@ -1,5 +1 @@ -export type { DeleteVersionsRequest } from "./DeleteVersionsRequest.js"; -export type { GetVersionsRequest } from "./GetVersionsRequest.js"; export type { GuidedTemplatesCreateVersionRequest } from "./GuidedTemplatesCreateVersionRequest.js"; -export type { ListVersionsRequest } from "./ListVersionsRequest.js"; -export type { PublishVersionsRequest } from "./PublishVersionsRequest.js"; diff --git a/src/api/resources/facts/client/Client.ts b/src/api/resources/facts/client/Client.ts index ee4f94c1..684f256e 100644 --- a/src/api/resources/facts/client/Client.ts +++ b/src/api/resources/facts/client/Client.ts @@ -25,33 +25,27 @@ export class FactsClient { /** * Returns a list of available fact groups, used to categorize facts associated with an interaction. * - * @param {Corti.FactsFactGroupsListRequest} request * @param {FactsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.InternalServerError} * * @example - * await client.facts.factGroupsList({ - * tenantName: "base" - * }) + * await client.facts.factGroupsList() */ public factGroupsList( - request: Corti.FactsFactGroupsListRequest, requestOptions?: FactsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__factGroupsList(request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__factGroupsList(requestOptions)); } private async __factGroupsList( - request: Corti.FactsFactGroupsListRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -111,35 +105,29 @@ export class FactsClient { * Retrieves a list of facts for a given interaction. * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.FactsListRequest} request * @param {FactsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public list( id: Corti.Uuid, - request: Corti.FactsListRequest, requestOptions?: FactsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(id, requestOptions)); } private async __list( id: Corti.Uuid, - request: Corti.FactsListRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -206,7 +194,6 @@ export class FactsClient { * * @example * await client.facts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base", * facts: [{ * text: "text", * group: "other" @@ -226,12 +213,11 @@ export class FactsClient { request: Corti.FactsCreateRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -245,7 +231,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsCreateRequest.jsonOrThrow(_body, { + body: serializers.FactsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -304,7 +290,6 @@ export class FactsClient { * * @example * await client.facts.batchUpdate("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base", * facts: [{ * factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" * }] @@ -323,12 +308,11 @@ export class FactsClient { request: Corti.FactsBatchUpdateRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -342,7 +326,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsBatchUpdateRequest.jsonOrThrow(_body, { + body: serializers.FactsBatchUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -401,14 +385,12 @@ export class FactsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.facts.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", { - * tenantName: "base" - * }) + * await client.facts.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08") */ public update( id: Corti.Uuid, factId: string, - request: Corti.FactsUpdateRequest, + request: Corti.FactsUpdateRequest = {}, requestOptions?: FactsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, factId, request, requestOptions)); @@ -417,15 +399,14 @@ export class FactsClient { private async __update( id: Corti.Uuid, factId: string, - request: Corti.FactsUpdateRequest, + request: Corti.FactsUpdateRequest = {}, requestOptions?: FactsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -439,7 +420,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsUpdateRequest.jsonOrThrow(_body, { + body: serializers.FactsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -502,7 +483,6 @@ export class FactsClient { * * @example * await client.facts.extract({ - * tenantName: "base", * context: [{ * type: "text", * text: "text" @@ -521,12 +501,11 @@ export class FactsClient { request: Corti.FactsExtractRequest, requestOptions?: FactsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -540,7 +519,7 @@ export class FactsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.FactsExtractRequest.jsonOrThrow(_body, { + body: serializers.FactsExtractRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts b/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts index 3343870f..30d79bdf 100644 --- a/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts +++ b/src/api/resources/facts/client/requests/FactsBatchUpdateRequest.ts @@ -5,15 +5,12 @@ import type * as Corti from "../../../../index.js"; /** * @example * { - * tenantName: "base", * facts: [{ * factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" * }] * } */ export interface FactsBatchUpdateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** A list of facts to be updated. */ facts: Corti.FactsBatchUpdateInput[]; } diff --git a/src/api/resources/facts/client/requests/FactsCreateRequest.ts b/src/api/resources/facts/client/requests/FactsCreateRequest.ts index 8dfb57d7..17a9c3a2 100644 --- a/src/api/resources/facts/client/requests/FactsCreateRequest.ts +++ b/src/api/resources/facts/client/requests/FactsCreateRequest.ts @@ -5,7 +5,6 @@ import type * as Corti from "../../../../index.js"; /** * @example * { - * tenantName: "base", * facts: [{ * text: "text", * group: "other" @@ -13,8 +12,6 @@ import type * as Corti from "../../../../index.js"; * } */ export interface FactsCreateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** A list of facts to be created. */ facts: Corti.FactsCreateInput[]; } diff --git a/src/api/resources/facts/client/requests/FactsExtractRequest.ts b/src/api/resources/facts/client/requests/FactsExtractRequest.ts index 5a24f0a7..8107b215 100644 --- a/src/api/resources/facts/client/requests/FactsExtractRequest.ts +++ b/src/api/resources/facts/client/requests/FactsExtractRequest.ts @@ -5,7 +5,6 @@ import type * as Corti from "../../../../index.js"; /** * @example * { - * tenantName: "base", * context: [{ * type: "text", * text: "text" @@ -14,8 +13,6 @@ import type * as Corti from "../../../../index.js"; * } */ export interface FactsExtractRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; context: Corti.CommonTextContext[]; /** The desired output language code for extracted facts. Check [languages page](/stt/languages) for more. */ outputLanguage: string; diff --git a/src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts b/src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts deleted file mode 100644 index 0dc1b649..00000000 --- a/src/api/resources/facts/client/requests/FactsFactGroupsListRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface FactsFactGroupsListRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/facts/client/requests/FactsListRequest.ts b/src/api/resources/facts/client/requests/FactsListRequest.ts deleted file mode 100644 index 303a92b7..00000000 --- a/src/api/resources/facts/client/requests/FactsListRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface FactsListRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/facts/client/requests/FactsUpdateRequest.ts b/src/api/resources/facts/client/requests/FactsUpdateRequest.ts index 27ed0758..3dff4961 100644 --- a/src/api/resources/facts/client/requests/FactsUpdateRequest.ts +++ b/src/api/resources/facts/client/requests/FactsUpdateRequest.ts @@ -4,13 +4,9 @@ import type * as Corti from "../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface FactsUpdateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** The updated text of the fact. */ text?: string; /** The updated group key for the fact. */ diff --git a/src/api/resources/facts/client/requests/index.ts b/src/api/resources/facts/client/requests/index.ts index 2d87c617..c5c6a0cb 100644 --- a/src/api/resources/facts/client/requests/index.ts +++ b/src/api/resources/facts/client/requests/index.ts @@ -1,6 +1,4 @@ export type { FactsBatchUpdateRequest } from "./FactsBatchUpdateRequest.js"; export type { FactsCreateRequest } from "./FactsCreateRequest.js"; export type { FactsExtractRequest } from "./FactsExtractRequest.js"; -export type { FactsFactGroupsListRequest } from "./FactsFactGroupsListRequest.js"; -export type { FactsListRequest } from "./FactsListRequest.js"; export type { FactsUpdateRequest } from "./FactsUpdateRequest.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 8075b185..fa7a2c9a 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -14,7 +14,6 @@ export * from "./interactions/types/index.js"; export * from "./languages/client/requests/index.js"; export * as languages from "./languages/index.js"; export * from "./languages/types/index.js"; -export * from "./recordings/client/requests/index.js"; export * as recordings from "./recordings/index.js"; export * as stream from "./stream/index.js"; export * from "./templates/client/requests/index.js"; diff --git a/src/api/resources/interactions/client/Client.ts b/src/api/resources/interactions/client/Client.ts index 4a37f104..4c5256ac 100644 --- a/src/api/resources/interactions/client/Client.ts +++ b/src/api/resources/interactions/client/Client.ts @@ -32,19 +32,17 @@ export class InteractionsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.list({ - * tenantName: "base" - * }) + * await client.interactions.list() */ public async list( - request: Corti.InteractionsListRequest, + request: Corti.InteractionsListRequest = {}, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Corti.InteractionsListRequest, ): Promise> => { - const { sort, direction, pageSize, index, encounterStatus, patient, tenantName } = request; + const { sort, direction, pageSize, index, encounterStatus, patient } = request; const _queryParams: Record = { sort: sort != null @@ -81,7 +79,7 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -164,7 +162,6 @@ export class InteractionsClient { * * @example * await client.interactions.create({ - * tenantName: "base", * encounter: { * identifier: "identifier", * status: "planned", @@ -183,12 +180,11 @@ export class InteractionsClient { request: Corti.InteractionsCreateRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -202,7 +198,7 @@ export class InteractionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.InteractionsCreateRequest.jsonOrThrow(_body, { + body: serializers.InteractionsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -269,36 +265,30 @@ export class InteractionsClient { * Retrieves a previously recorded interaction by its unique identifier (interaction ID). * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.InteractionsGetRequest} request * @param {InteractionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public get( id: Corti.Uuid, - request: Corti.InteractionsGetRequest, requestOptions?: InteractionsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } private async __get( id: Corti.Uuid, - request: Corti.InteractionsGetRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -360,36 +350,27 @@ export class InteractionsClient { * Deletes an existing interaction. * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.InteractionsDeleteRequest} request * @param {InteractionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479") */ - public delete( - id: Corti.Uuid, - request: Corti.InteractionsDeleteRequest, - requestOptions?: InteractionsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, request, requestOptions)); + public delete(id: Corti.Uuid, requestOptions?: InteractionsClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } private async __delete( id: Corti.Uuid, - request: Corti.InteractionsDeleteRequest, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -449,13 +430,11 @@ export class InteractionsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public update( id: Corti.Uuid, - request: Corti.InteractionsUpdateRequest, + request: Corti.InteractionsUpdateRequest = {}, requestOptions?: InteractionsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions)); @@ -463,15 +442,14 @@ export class InteractionsClient { private async __update( id: Corti.Uuid, - request: Corti.InteractionsUpdateRequest, + request: Corti.InteractionsUpdateRequest = {}, requestOptions?: InteractionsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -485,7 +463,7 @@ export class InteractionsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.InteractionsUpdateRequest.jsonOrThrow(_body, { + body: serializers.InteractionsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts b/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts index 90f27b67..4840bd7f 100644 --- a/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts +++ b/src/api/resources/interactions/client/requests/InteractionsCreateRequest.ts @@ -5,7 +5,6 @@ import type * as Corti from "../../../../index.js"; /** * @example * { - * tenantName: "base", * encounter: { * identifier: "identifier", * status: "planned", @@ -14,8 +13,6 @@ import type * as Corti from "../../../../index.js"; * } */ export interface InteractionsCreateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** A unique identifier for the medical professional responsible for this interaction. If nulled, automatically set to a uuid. */ assignedUserId?: Corti.Uuid; /** Details about the encounter. */ diff --git a/src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts b/src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts deleted file mode 100644 index 681796ef..00000000 --- a/src/api/resources/interactions/client/requests/InteractionsDeleteRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface InteractionsDeleteRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/interactions/client/requests/InteractionsGetRequest.ts b/src/api/resources/interactions/client/requests/InteractionsGetRequest.ts deleted file mode 100644 index 31219baa..00000000 --- a/src/api/resources/interactions/client/requests/InteractionsGetRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface InteractionsGetRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/interactions/client/requests/InteractionsListRequest.ts b/src/api/resources/interactions/client/requests/InteractionsListRequest.ts index 4cec84bd..d91d520e 100644 --- a/src/api/resources/interactions/client/requests/InteractionsListRequest.ts +++ b/src/api/resources/interactions/client/requests/InteractionsListRequest.ts @@ -4,9 +4,7 @@ import type * as Corti from "../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface InteractionsListRequest { /** Field used to sort interactions. Default is createdAt. */ @@ -21,6 +19,4 @@ export interface InteractionsListRequest { encounterStatus?: Corti.InteractionsEncounterStatusEnum | Corti.InteractionsEncounterStatusEnum[]; /** A unique identifier for the patient. */ patient?: string; - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; } diff --git a/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts b/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts index 164e5798..59433ec3 100644 --- a/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts +++ b/src/api/resources/interactions/client/requests/InteractionsUpdateRequest.ts @@ -4,13 +4,9 @@ import type * as Corti from "../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface InteractionsUpdateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** The unique identifier of the medical professional responsible for this interaction. If nulled, automatically set to a uuid. */ assignedUserId?: Corti.Uuid; /** Details of the encounter being updated. */ diff --git a/src/api/resources/interactions/client/requests/index.ts b/src/api/resources/interactions/client/requests/index.ts index 6b6ba9fe..83043afc 100644 --- a/src/api/resources/interactions/client/requests/index.ts +++ b/src/api/resources/interactions/client/requests/index.ts @@ -1,5 +1,3 @@ export type { InteractionsCreateRequest } from "./InteractionsCreateRequest.js"; -export type { InteractionsDeleteRequest } from "./InteractionsDeleteRequest.js"; -export type { InteractionsGetRequest } from "./InteractionsGetRequest.js"; export type { InteractionsListRequest } from "./InteractionsListRequest.js"; export type { InteractionsUpdateRequest } from "./InteractionsUpdateRequest.js"; diff --git a/src/api/resources/languages/client/Client.ts b/src/api/resources/languages/client/Client.ts index 28b1453b..08ecca82 100644 --- a/src/api/resources/languages/client/Client.ts +++ b/src/api/resources/languages/client/Client.ts @@ -32,22 +32,20 @@ export class LanguagesClient { * @throws {@link Corti.InternalServerError} * * @example - * await client.languages.list({ - * tenantName: "base" - * }) + * await client.languages.list() */ public list( - request: Corti.LanguagesListRequest, + request: Corti.LanguagesListRequest = {}, requestOptions?: LanguagesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.LanguagesListRequest, + request: Corti.LanguagesListRequest = {}, requestOptions?: LanguagesClient.RequestOptions, ): Promise> { - const { endpoint, tenantName } = request; + const { endpoint } = request; const _queryParams: Record = { endpoint: endpoint != null @@ -61,7 +59,7 @@ export class LanguagesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/languages/client/requests/LanguagesListRequest.ts b/src/api/resources/languages/client/requests/LanguagesListRequest.ts index 241dab3c..9d25dcbc 100644 --- a/src/api/resources/languages/client/requests/LanguagesListRequest.ts +++ b/src/api/resources/languages/client/requests/LanguagesListRequest.ts @@ -4,13 +4,9 @@ import type * as Corti from "../../../../index.js"; /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface LanguagesListRequest { /** Field used to filter languages that supported specific endpoint. */ endpoint?: Corti.LanguagesListRequestEndpoint; - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; } diff --git a/src/api/resources/recordings/client/Client.ts b/src/api/resources/recordings/client/Client.ts index 656bab3e..92364ec0 100644 --- a/src/api/resources/recordings/client/Client.ts +++ b/src/api/resources/recordings/client/Client.ts @@ -26,7 +26,6 @@ export class RecordingsClient { * Retrieve a list of recordings for a given interaction. * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.RecordingsListRequest} request * @param {RecordingsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -35,29 +34,24 @@ export class RecordingsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public list( id: Corti.Uuid, - request: Corti.RecordingsListRequest, requestOptions?: RecordingsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__list(id, requestOptions)); } private async __list( id: Corti.Uuid, - request: Corti.RecordingsListRequest, requestOptions?: RecordingsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -163,6 +157,7 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), _binaryUploadRequest.headers, requestOptions?.headers, ); @@ -255,24 +250,21 @@ export class RecordingsClient { public get( id: Corti.Uuid, recordingId: Corti.Uuid, - request: Corti.RecordingsGetRequest, requestOptions?: RecordingsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, recordingId, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, recordingId, requestOptions)); } private async __get( id: Corti.Uuid, recordingId: Corti.Uuid, - request: Corti.RecordingsGetRequest, requestOptions?: RecordingsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -347,7 +339,6 @@ export class RecordingsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} recordingId - The unique identifier of the recording. Must be a valid UUID. - * @param {Corti.RecordingsDeleteRequest} request * @param {RecordingsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.ForbiddenError} @@ -356,31 +347,26 @@ export class RecordingsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.recordings.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.recordings.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public delete( id: Corti.Uuid, recordingId: Corti.Uuid, - request: Corti.RecordingsDeleteRequest, requestOptions?: RecordingsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, recordingId, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(id, recordingId, requestOptions)); } private async __delete( id: Corti.Uuid, recordingId: Corti.Uuid, - request: Corti.RecordingsDeleteRequest, requestOptions?: RecordingsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/recordings/client/index.ts b/src/api/resources/recordings/client/index.ts index 195f9aa8..cb0ff5c3 100644 --- a/src/api/resources/recordings/client/index.ts +++ b/src/api/resources/recordings/client/index.ts @@ -1 +1 @@ -export * from "./requests/index.js"; +export {}; diff --git a/src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts b/src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts deleted file mode 100644 index a6074519..00000000 --- a/src/api/resources/recordings/client/requests/RecordingsDeleteRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface RecordingsDeleteRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/recordings/client/requests/RecordingsGetRequest.ts b/src/api/resources/recordings/client/requests/RecordingsGetRequest.ts deleted file mode 100644 index d71d0f33..00000000 --- a/src/api/resources/recordings/client/requests/RecordingsGetRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "tenantName" - * } - */ -export interface RecordingsGetRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/recordings/client/requests/RecordingsListRequest.ts b/src/api/resources/recordings/client/requests/RecordingsListRequest.ts deleted file mode 100644 index d46c38dc..00000000 --- a/src/api/resources/recordings/client/requests/RecordingsListRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface RecordingsListRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/recordings/client/requests/index.ts b/src/api/resources/recordings/client/requests/index.ts deleted file mode 100644 index 4252facd..00000000 --- a/src/api/resources/recordings/client/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { RecordingsDeleteRequest } from "./RecordingsDeleteRequest.js"; -export type { RecordingsGetRequest } from "./RecordingsGetRequest.js"; -export type { RecordingsListRequest } from "./RecordingsListRequest.js"; diff --git a/src/api/resources/templates/client/Client.ts b/src/api/resources/templates/client/Client.ts index a1dd06af..3a109232 100644 --- a/src/api/resources/templates/client/Client.ts +++ b/src/api/resources/templates/client/Client.ts @@ -32,22 +32,20 @@ export class TemplatesClient { * @throws {@link Corti.InternalServerError} * * @example - * await client.templates.sectionList({ - * tenantName: "base" - * }) + * await client.templates.sectionList() */ public sectionList( - request: Corti.TemplatesSectionListRequest, + request: Corti.TemplatesSectionListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__sectionList(request, requestOptions)); } private async __sectionList( - request: Corti.TemplatesSectionListRequest, + request: Corti.TemplatesSectionListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { org, lang, tenantName } = request; + const { org, lang } = request; const _queryParams: Record = { org, lang, @@ -56,7 +54,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -124,22 +122,20 @@ export class TemplatesClient { * @throws {@link Corti.InternalServerError} * * @example - * await client.templates.list({ - * tenantName: "base" - * }) + * await client.templates.list() */ public list( - request: Corti.TemplatesListRequest, + request: Corti.TemplatesListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Corti.TemplatesListRequest, + request: Corti.TemplatesListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { org, lang, status, tenantName } = request; + const { org, lang, status } = request; const _queryParams: Record = { org, lang, @@ -149,7 +145,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -211,36 +207,30 @@ export class TemplatesClient { * Retrieves template by key. * * @param {string} key - The key of the template - * @param {Corti.GetTemplatesRequest} request * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.InternalServerError} * * @example - * await client.templates.get("key", { - * tenantName: "base" - * }) + * await client.templates.get("key") */ public get( key: string, - request: Corti.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(key, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(key, requestOptions)); } private async __get( key: string, - request: Corti.GetTemplatesRequest, requestOptions?: TemplatesClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/templates/client/requests/GetTemplatesRequest.ts b/src/api/resources/templates/client/requests/GetTemplatesRequest.ts deleted file mode 100644 index 6a7ecc5b..00000000 --- a/src/api/resources/templates/client/requests/GetTemplatesRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface GetTemplatesRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/templates/client/requests/TemplatesListRequest.ts b/src/api/resources/templates/client/requests/TemplatesListRequest.ts index d3859753..abc1c28c 100644 --- a/src/api/resources/templates/client/requests/TemplatesListRequest.ts +++ b/src/api/resources/templates/client/requests/TemplatesListRequest.ts @@ -2,9 +2,7 @@ /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface TemplatesListRequest { /** Filter templates by organization. */ @@ -13,6 +11,4 @@ export interface TemplatesListRequest { lang?: string | string[]; /** Filter templates by their status. */ status?: string | string[]; - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; } diff --git a/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts b/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts index 2435f7ef..d0768d63 100644 --- a/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts +++ b/src/api/resources/templates/client/requests/TemplatesSectionListRequest.ts @@ -2,15 +2,11 @@ /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface TemplatesSectionListRequest { /** Filter template sections by organization. */ org?: string | string[]; /** Filter template sections by language. */ lang?: string | string[]; - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; } diff --git a/src/api/resources/templates/client/requests/index.ts b/src/api/resources/templates/client/requests/index.ts index fed7cf59..d2764071 100644 --- a/src/api/resources/templates/client/requests/index.ts +++ b/src/api/resources/templates/client/requests/index.ts @@ -1,3 +1,2 @@ -export type { GetTemplatesRequest } from "./GetTemplatesRequest.js"; export type { TemplatesListRequest } from "./TemplatesListRequest.js"; export type { TemplatesSectionListRequest } from "./TemplatesSectionListRequest.js"; diff --git a/src/api/resources/transcripts/client/Client.ts b/src/api/resources/transcripts/client/Client.ts index 62a618a8..1c3f7c1d 100644 --- a/src/api/resources/transcripts/client/Client.ts +++ b/src/api/resources/transcripts/client/Client.ts @@ -36,13 +36,11 @@ export class TranscriptsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public list( id: Corti.Uuid, - request: Corti.TranscriptsListRequest, + request: Corti.TranscriptsListRequest = {}, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions)); @@ -50,10 +48,10 @@ export class TranscriptsClient { private async __list( id: Corti.Uuid, - request: Corti.TranscriptsListRequest, + request: Corti.TranscriptsListRequest = {}, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { - const { full, tenantName } = request; + const { full } = request; const _queryParams: Record = { full, }; @@ -61,7 +59,7 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -154,7 +152,6 @@ export class TranscriptsClient { * * @example * await client.transcripts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base", * recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", * primaryLanguage: "en" * }) @@ -172,12 +169,11 @@ export class TranscriptsClient { request: Corti.TranscriptsCreateRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { - const { tenantName, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -191,7 +187,7 @@ export class TranscriptsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.TranscriptsCreateRequest.jsonOrThrow(_body, { + body: serializers.TranscriptsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -266,7 +262,6 @@ export class TranscriptsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID. - * @param {Corti.TranscriptsGetRequest} request * @param {TranscriptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -276,31 +271,26 @@ export class TranscriptsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.transcripts.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.transcripts.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public get( id: Corti.Uuid, transcriptId: Corti.Uuid, - request: Corti.TranscriptsGetRequest, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(id, transcriptId, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__get(id, transcriptId, requestOptions)); } private async __get( id: Corti.Uuid, transcriptId: Corti.Uuid, - request: Corti.TranscriptsGetRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -383,7 +373,6 @@ export class TranscriptsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID. - * @param {Corti.TranscriptsDeleteRequest} request * @param {TranscriptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -393,31 +382,26 @@ export class TranscriptsClient { * @throws {@link Corti.GatewayTimeoutError} * * @example - * await client.transcripts.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.transcripts.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public delete( id: Corti.Uuid, transcriptId: Corti.Uuid, - request: Corti.TranscriptsDeleteRequest, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(id, transcriptId, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__delete(id, transcriptId, requestOptions)); } private async __delete( id: Corti.Uuid, transcriptId: Corti.Uuid, - request: Corti.TranscriptsDeleteRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -491,37 +475,31 @@ export class TranscriptsClient { * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. * @param {Corti.Uuid} transcriptId - The unique identifier of the transcript. Must be a valid UUID. - * @param {Corti.TranscriptsGetStatusRequest} request * @param {TranscriptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.NotFoundError} * * @example - * await client.transcripts.getStatus("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * tenantName: "base" - * }) + * await client.transcripts.getStatus("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479") */ public getStatus( id: Corti.Uuid, transcriptId: Corti.Uuid, - request: Corti.TranscriptsGetStatusRequest, requestOptions?: TranscriptsClient.RequestOptions, ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getStatus(id, transcriptId, request, requestOptions)); + return core.HttpResponsePromise.fromPromise(this.__getStatus(id, transcriptId, requestOptions)); } private async __getStatus( id: Corti.Uuid, transcriptId: Corti.Uuid, - request: Corti.TranscriptsGetStatusRequest, requestOptions?: TranscriptsClient.RequestOptions, ): Promise> { - const { tenantName } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": tenantName }), + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts index 5317bf34..b1f96a29 100644 --- a/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts +++ b/src/api/resources/transcripts/client/requests/TranscriptsCreateRequest.ts @@ -5,14 +5,11 @@ import type * as Corti from "../../../../index.js"; /** * @example * { - * tenantName: "base", * recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", * primaryLanguage: "en" * } */ export interface TranscriptsCreateRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; /** The unique identifier for the recording. */ recordingId: Corti.Uuid; /** The primary spoken language of the recording. Check https://docs.corti.ai/stt/languages for more. */ diff --git a/src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts deleted file mode 100644 index 52cceca1..00000000 --- a/src/api/resources/transcripts/client/requests/TranscriptsDeleteRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface TranscriptsDeleteRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts deleted file mode 100644 index bd26e380..00000000 --- a/src/api/resources/transcripts/client/requests/TranscriptsGetRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface TranscriptsGetRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts deleted file mode 100644 index c5ec0903..00000000 --- a/src/api/resources/transcripts/client/requests/TranscriptsGetStatusRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "base" - * } - */ -export interface TranscriptsGetStatusRequest { - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; -} diff --git a/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts b/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts index 325849d3..30294927 100644 --- a/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts +++ b/src/api/resources/transcripts/client/requests/TranscriptsListRequest.ts @@ -2,13 +2,9 @@ /** * @example - * { - * tenantName: "base" - * } + * {} */ export interface TranscriptsListRequest { /** Display full transcripts in listing */ full?: boolean; - /** Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request. */ - tenantName: string; } diff --git a/src/api/resources/transcripts/client/requests/index.ts b/src/api/resources/transcripts/client/requests/index.ts index a337b7ac..f3082818 100644 --- a/src/api/resources/transcripts/client/requests/index.ts +++ b/src/api/resources/transcripts/client/requests/index.ts @@ -1,5 +1,2 @@ export type { TranscriptsCreateRequest } from "./TranscriptsCreateRequest.js"; -export type { TranscriptsDeleteRequest } from "./TranscriptsDeleteRequest.js"; -export type { TranscriptsGetRequest } from "./TranscriptsGetRequest.js"; -export type { TranscriptsGetStatusRequest } from "./TranscriptsGetStatusRequest.js"; export type { TranscriptsListRequest } from "./TranscriptsListRequest.js"; diff --git a/src/serialization/resources/auth/types/AuthTokenRequest.ts b/src/serialization/resources/auth/types/AuthTokenRequestBody.ts similarity index 70% rename from src/serialization/resources/auth/types/AuthTokenRequest.ts rename to src/serialization/resources/auth/types/AuthTokenRequestBody.ts index 9bb52270..cd65369e 100644 --- a/src/serialization/resources/auth/types/AuthTokenRequest.ts +++ b/src/serialization/resources/auth/types/AuthTokenRequestBody.ts @@ -9,16 +9,18 @@ import { AuthTokenRequestClientCredentials } from "../../../types/AuthTokenReque import { AuthTokenRequestRefresh } from "../../../types/AuthTokenRequestRefresh.js"; import { AuthTokenRequestRopc } from "../../../types/AuthTokenRequestRopc.js"; -export const AuthTokenRequest: core.serialization.Schema = - core.serialization.undiscriminatedUnion([ - AuthTokenRequestClientCredentials, - AuthTokenRequestAuthorizationCode, - AuthTokenRequestAuthorizationPkce, - AuthTokenRequestRopc, - AuthTokenRequestRefresh, - ]); +export const AuthTokenRequestBody: core.serialization.Schema< + serializers.AuthTokenRequestBody.Raw, + Corti.AuthTokenRequestBody +> = core.serialization.undiscriminatedUnion([ + AuthTokenRequestClientCredentials, + AuthTokenRequestAuthorizationCode, + AuthTokenRequestAuthorizationPkce, + AuthTokenRequestRopc, + AuthTokenRequestRefresh, +]); -export declare namespace AuthTokenRequest { +export declare namespace AuthTokenRequestBody { export type Raw = | AuthTokenRequestClientCredentials.Raw | AuthTokenRequestAuthorizationCode.Raw diff --git a/src/serialization/resources/auth/types/index.ts b/src/serialization/resources/auth/types/index.ts index c07e19c2..536709bd 100644 --- a/src/serialization/resources/auth/types/index.ts +++ b/src/serialization/resources/auth/types/index.ts @@ -1 +1 @@ -export * from "./AuthTokenRequest.js"; +export * from "./AuthTokenRequestBody.js"; diff --git a/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts b/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts index 52169fbc..3470e074 100644 --- a/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts +++ b/src/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.ts @@ -9,7 +9,7 @@ import { CommonCodingSystemEnum } from "../../../../types/CommonCodingSystemEnum export const CodesGeneralPredictRequest: core.serialization.Schema< serializers.CodesGeneralPredictRequest.Raw, - Omit + Corti.CodesGeneralPredictRequest > = core.serialization.object({ system: core.serialization.list(CommonCodingSystemEnum), context: core.serialization.list(CommonAiContext), diff --git a/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts b/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts index 03f46c56..bf1bf144 100644 --- a/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts +++ b/src/serialization/resources/documents/client/requests/DocumentsUpdateRequest.ts @@ -7,7 +7,7 @@ import { DocumentsSectionInput } from "../../../../types/DocumentsSectionInput.j export const DocumentsUpdateRequest: core.serialization.Schema< serializers.DocumentsUpdateRequest.Raw, - Omit + Corti.DocumentsUpdateRequest > = core.serialization.object({ name: core.serialization.string().optional(), sections: core.serialization.list(DocumentsSectionInput).optional(), diff --git a/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts b/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts index d8f1bb55..1a39e5e7 100644 --- a/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts +++ b/src/serialization/resources/documents/resources/sections/client/requests/GuidedSectionsUpdateRequest.ts @@ -7,7 +7,7 @@ import { GuidedLabel } from "../../../../../../types/GuidedLabel.js"; export const GuidedSectionsUpdateRequest: core.serialization.Schema< serializers.documents.GuidedSectionsUpdateRequest.Raw, - Omit + Corti.documents.GuidedSectionsUpdateRequest > = core.serialization.object({ name: core.serialization.string().optional(), description: core.serialization.string().optional(), diff --git a/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts b/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts index f87356df..64e4fc1c 100644 --- a/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts +++ b/src/serialization/resources/documents/resources/sections/resources/versions/client/requests/GuidedSectionsCreateVersionRequest.ts @@ -7,7 +7,7 @@ import { GuidedSectionGenerationPartial } from "../../../../../../../../types/Gu export const GuidedSectionsCreateVersionRequest: core.serialization.Schema< serializers.documents.sections.GuidedSectionsCreateVersionRequest.Raw, - Omit + Corti.documents.sections.GuidedSectionsCreateVersionRequest > = core.serialization.object({ generation: GuidedSectionGenerationPartial, }); diff --git a/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts b/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts index 8b1bbb17..458ac07a 100644 --- a/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts +++ b/src/serialization/resources/documents/resources/templates/client/requests/GuidedTemplatesUpdateRequest.ts @@ -7,7 +7,7 @@ import { GuidedLabel } from "../../../../../../types/GuidedLabel.js"; export const GuidedTemplatesUpdateRequest: core.serialization.Schema< serializers.documents.GuidedTemplatesUpdateRequest.Raw, - Omit + Corti.documents.GuidedTemplatesUpdateRequest > = core.serialization.object({ name: core.serialization.string().optional(), description: core.serialization.string().optional(), diff --git a/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts b/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts index 6a9c00f7..2e55d23f 100644 --- a/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts +++ b/src/serialization/resources/documents/resources/templates/resources/versions/client/requests/GuidedTemplatesCreateVersionRequest.ts @@ -7,7 +7,7 @@ import { GuidedTemplatesVersionGeneration } from "../../../../../../../../types/ export const GuidedTemplatesCreateVersionRequest: core.serialization.Schema< serializers.documents.templates.GuidedTemplatesCreateVersionRequest.Raw, - Omit + Corti.documents.templates.GuidedTemplatesCreateVersionRequest > = core.serialization.object({ generation: GuidedTemplatesVersionGeneration, }); diff --git a/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts b/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts index 22a8a9db..ca29f0ab 100644 --- a/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsBatchUpdateRequest.ts @@ -7,7 +7,7 @@ import { FactsBatchUpdateInput } from "../../../../types/FactsBatchUpdateInput.j export const FactsBatchUpdateRequest: core.serialization.Schema< serializers.FactsBatchUpdateRequest.Raw, - Omit + Corti.FactsBatchUpdateRequest > = core.serialization.object({ facts: core.serialization.list(FactsBatchUpdateInput), }); diff --git a/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts b/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts index bef3ee20..3ff375df 100644 --- a/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsCreateRequest.ts @@ -7,7 +7,7 @@ import { FactsCreateInput } from "../../../../types/FactsCreateInput.js"; export const FactsCreateRequest: core.serialization.Schema< serializers.FactsCreateRequest.Raw, - Omit + Corti.FactsCreateRequest > = core.serialization.object({ facts: core.serialization.list(FactsCreateInput), }); diff --git a/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts b/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts index a6225259..ceb6246c 100644 --- a/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsExtractRequest.ts @@ -7,7 +7,7 @@ import { CommonTextContext } from "../../../../types/CommonTextContext.js"; export const FactsExtractRequest: core.serialization.Schema< serializers.FactsExtractRequest.Raw, - Omit + Corti.FactsExtractRequest > = core.serialization.object({ context: core.serialization.list(CommonTextContext), outputLanguage: core.serialization.string(), diff --git a/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts b/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts index 09dc5ba7..5feb287f 100644 --- a/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts +++ b/src/serialization/resources/facts/client/requests/FactsUpdateRequest.ts @@ -7,7 +7,7 @@ import { CommonSourceEnum } from "../../../../types/CommonSourceEnum.js"; export const FactsUpdateRequest: core.serialization.Schema< serializers.FactsUpdateRequest.Raw, - Omit + Corti.FactsUpdateRequest > = core.serialization.object({ text: core.serialization.string().optional(), group: core.serialization.string().optional(), diff --git a/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts b/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts index 4c248a2e..def31f5f 100644 --- a/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts +++ b/src/serialization/resources/interactions/client/requests/InteractionsCreateRequest.ts @@ -9,7 +9,7 @@ import { Uuid } from "../../../../types/Uuid.js"; export const InteractionsCreateRequest: core.serialization.Schema< serializers.InteractionsCreateRequest.Raw, - Omit + Corti.InteractionsCreateRequest > = core.serialization.object({ assignedUserId: Uuid.optional(), encounter: InteractionsEncounterCreateRequest, diff --git a/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts b/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts index b0485a56..19d78173 100644 --- a/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts +++ b/src/serialization/resources/interactions/client/requests/InteractionsUpdateRequest.ts @@ -9,7 +9,7 @@ import { Uuid } from "../../../../types/Uuid.js"; export const InteractionsUpdateRequest: core.serialization.Schema< serializers.InteractionsUpdateRequest.Raw, - Omit + Corti.InteractionsUpdateRequest > = core.serialization.object({ assignedUserId: Uuid.optional(), encounter: InteractionsEncounterUpdateRequest.optional(), diff --git a/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts b/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts index 242d61c0..ad97965b 100644 --- a/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts +++ b/src/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.ts @@ -10,7 +10,7 @@ import { TranscriptsCreateRequestReplacementsItem } from "../../types/Transcript export const TranscriptsCreateRequest: core.serialization.Schema< serializers.TranscriptsCreateRequest.Raw, - Omit + Corti.TranscriptsCreateRequest > = core.serialization.object({ recordingId: Uuid, primaryLanguage: core.serialization.string(), diff --git a/tests/wire/agents.test.ts b/tests/wire/agents.test.ts index 65487e47..5c721075 100644 --- a/tests/wire/agents.test.ts +++ b/tests/wire/agents.test.ts @@ -14,6 +14,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -99,6 +100,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -119,6 +121,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -139,6 +142,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -295,6 +299,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "x" }; @@ -324,6 +329,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "x" }; @@ -353,6 +359,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "x" }; @@ -382,6 +389,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "x" }; @@ -411,6 +419,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "x" }; @@ -440,6 +449,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -512,6 +522,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -538,6 +549,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -564,6 +576,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -590,6 +603,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -612,6 +626,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -638,6 +653,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -664,6 +680,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -690,6 +707,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "coder-v2", connectors: [{ type: "registry", name: "@dedalus/coding-expert" }] }; @@ -771,6 +789,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -798,6 +817,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -825,6 +845,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -852,6 +873,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -879,6 +901,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -906,6 +929,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1017,6 +1041,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1043,6 +1068,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/a2A.test.ts b/tests/wire/agents/a2A.test.ts index 36271334..3aa742c1 100644 --- a/tests/wire/agents/a2A.test.ts +++ b/tests/wire/agents/a2A.test.ts @@ -14,6 +14,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -96,6 +97,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; @@ -127,6 +129,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; @@ -158,6 +161,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -270,6 +274,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; @@ -303,6 +308,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; @@ -336,6 +342,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; @@ -369,6 +376,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -424,6 +432,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; @@ -457,6 +466,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; @@ -490,6 +500,7 @@ describe("A2AClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; diff --git a/tests/wire/agents/a2A/tasks.test.ts b/tests/wire/agents/a2A/tasks.test.ts index ec1cf64d..068d1336 100644 --- a/tests/wire/agents/a2A/tasks.test.ts +++ b/tests/wire/agents/a2A/tasks.test.ts @@ -14,6 +14,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -151,6 +152,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -178,6 +180,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -323,6 +326,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -350,6 +354,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -377,6 +382,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -522,6 +528,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -549,6 +556,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -576,6 +584,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -603,6 +612,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/artifacts.test.ts b/tests/wire/agents/artifacts.test.ts index a1d89536..a7f2caf1 100644 --- a/tests/wire/agents/artifacts.test.ts +++ b/tests/wire/agents/artifacts.test.ts @@ -14,6 +14,7 @@ describe("ArtifactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -85,6 +86,7 @@ describe("ArtifactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -111,6 +113,7 @@ describe("ArtifactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -137,6 +140,7 @@ describe("ArtifactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/connectors.test.ts b/tests/wire/agents/connectors.test.ts index a6ee95aa..b7a0a187 100644 --- a/tests/wire/agents/connectors.test.ts +++ b/tests/wire/agents/connectors.test.ts @@ -14,6 +14,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -61,6 +62,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -87,6 +89,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -113,6 +116,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { type: "registry", name: "@dedalus/coding-expert" }; @@ -156,6 +160,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { type: "registry", name: "name" }; @@ -186,6 +191,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { type: "registry", name: "name" }; @@ -216,6 +222,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { type: "registry", name: "name" }; @@ -246,6 +253,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { type: "registry", name: "name" }; @@ -276,6 +284,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -320,6 +329,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -346,6 +356,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -372,6 +383,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -399,6 +411,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -425,6 +438,7 @@ describe("ConnectorsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/contexts.test.ts b/tests/wire/agents/contexts.test.ts index 2921b575..49863385 100644 --- a/tests/wire/agents/contexts.test.ts +++ b/tests/wire/agents/contexts.test.ts @@ -14,6 +14,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -171,6 +172,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -197,6 +199,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -223,6 +226,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -245,6 +249,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -271,6 +276,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -297,6 +303,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -367,6 +374,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -393,6 +401,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -419,6 +428,7 @@ describe("ContextsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/contexts/tasks.test.ts b/tests/wire/agents/contexts/tasks.test.ts index 5c967487..2cc2f7e3 100644 --- a/tests/wire/agents/contexts/tasks.test.ts +++ b/tests/wire/agents/contexts/tasks.test.ts @@ -14,6 +14,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -150,6 +151,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -176,6 +178,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -202,6 +205,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -346,6 +350,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -372,6 +377,7 @@ describe("TasksClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/feedback.test.ts b/tests/wire/agents/feedback.test.ts index e0710afc..816a5132 100644 --- a/tests/wire/agents/feedback.test.ts +++ b/tests/wire/agents/feedback.test.ts @@ -14,6 +14,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -79,6 +80,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -105,6 +107,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -131,6 +134,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { rating: { scale: "binary", value: 1 } }; @@ -203,6 +207,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -297,6 +302,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; @@ -329,6 +335,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; @@ -361,6 +368,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; @@ -393,6 +401,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; @@ -425,6 +434,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -452,6 +462,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -478,6 +489,7 @@ describe("FeedbackClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/registry.test.ts b/tests/wire/agents/registry.test.ts index 694f67b5..bca1c68c 100644 --- a/tests/wire/agents/registry.test.ts +++ b/tests/wire/agents/registry.test.ts @@ -14,6 +14,7 @@ describe("RegistryClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -90,6 +91,7 @@ describe("RegistryClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -116,6 +118,7 @@ describe("RegistryClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -193,6 +196,7 @@ describe("RegistryClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -219,6 +223,7 @@ describe("RegistryClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/agents/usage.test.ts b/tests/wire/agents/usage.test.ts index cb7234c9..11536517 100644 --- a/tests/wire/agents/usage.test.ts +++ b/tests/wire/agents/usage.test.ts @@ -14,6 +14,7 @@ describe("UsageClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -83,6 +84,7 @@ describe("UsageClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -109,6 +111,7 @@ describe("UsageClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -135,6 +138,7 @@ describe("UsageClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/auth.test.ts b/tests/wire/auth.test.ts index 77d046b1..0ce6a587 100644 --- a/tests/wire/auth.test.ts +++ b/tests/wire/auth.test.ts @@ -14,6 +14,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { client_id: "client_id", client_secret: "client_secret" }; @@ -63,6 +64,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -117,6 +119,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -152,6 +155,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/codes.test.ts b/tests/wire/codes.test.ts index 7a8114ba..d3909f46 100644 --- a/tests/wire/codes.test.ts +++ b/tests/wire/codes.test.ts @@ -14,6 +14,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -53,7 +54,6 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -61,7 +61,6 @@ describe("CodesClient", () => { .build(); const response = await client.codes.predict({ - tenantName: "base", system: ["icd10cm-outpatient", "cpt"], context: [ { @@ -135,6 +134,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -175,7 +175,6 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -183,7 +182,6 @@ describe("CodesClient", () => { .build(); const response = await client.codes.predict({ - tenantName: "base", system: ["icd10cm-outpatient"], context: [ { @@ -261,6 +259,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -275,7 +274,6 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -284,7 +282,6 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ - tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -308,6 +305,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -322,7 +320,6 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -331,7 +328,6 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ - tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -355,6 +351,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -369,7 +366,6 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -378,7 +374,6 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ - tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -402,6 +397,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -416,7 +412,6 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(502) @@ -425,7 +420,6 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ - tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { @@ -449,6 +443,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -463,7 +458,6 @@ describe("CodesClient", () => { server .mockEndpoint() .post("/tools/coding/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -472,7 +466,6 @@ describe("CodesClient", () => { await expect(async () => { return await client.codes.predict({ - tenantName: "tenantName", system: ["icd10cm-inpatient", "icd10cm-inpatient"], context: [ { diff --git a/tests/wire/documents.test.ts b/tests/wire/documents.test.ts index d264879b..1f3e4b3e 100644 --- a/tests/wire/documents.test.ts +++ b/tests/wire/documents.test.ts @@ -14,6 +14,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -45,15 +46,12 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - }); + const response = await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); expect(response).toEqual({ data: [ { @@ -90,6 +88,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -98,16 +97,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id", { - tenantName: "tenantName", - }); + return await client.documents.list("id"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -119,6 +115,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -127,16 +124,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id", { - tenantName: "tenantName", - }); + return await client.documents.list("id"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -148,6 +142,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -156,16 +151,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id", { - tenantName: "tenantName", - }); + return await client.documents.list("id"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -177,6 +169,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -185,16 +178,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.list("id", { - tenantName: "tenantName", - }); + return await client.documents.list("id"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -206,6 +196,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -237,7 +228,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -245,21 +235,18 @@ describe("DocumentsClient", () => { .build(); const response = await client.documents.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - body: { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", - }, + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", }); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -293,6 +280,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -308,7 +296,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -317,35 +304,32 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - tenantName: "tenantName", - body: { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", - }, + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -358,6 +342,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -373,7 +358,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -382,35 +366,32 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - tenantName: "tenantName", - body: { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", - }, + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -423,6 +404,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -438,7 +420,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -447,35 +428,32 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - tenantName: "tenantName", - body: { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", - }, + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -488,6 +466,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -503,7 +482,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/interactions/id/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -512,35 +490,32 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - tenantName: "tenantName", - body: { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", - }, + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -553,6 +528,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -580,7 +556,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/f47ac10b-58cc-4372-a567-0e02b2c3d479") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -589,9 +564,6 @@ describe("DocumentsClient", () => { const response = await client.documents.get( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", - { - tenantName: "base", - }, ); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -625,6 +597,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -633,16 +606,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.get("id", "documentId"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -654,6 +624,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -662,16 +633,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.get("id", "documentId"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -683,6 +651,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -691,16 +660,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.get("id", "documentId"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -712,6 +678,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -720,16 +687,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .get("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.get("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.get("id", "documentId"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -741,13 +705,13 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/f47ac10b-58cc-4372-a567-0e02b2c3d479") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); @@ -755,9 +719,6 @@ describe("DocumentsClient", () => { const response = await client.documents.delete( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", - { - tenantName: "base", - }, ); expect(response).toEqual(undefined); }); @@ -770,6 +731,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -778,16 +740,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.delete("id", "documentId"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -799,6 +758,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -807,16 +767,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.delete("id", "documentId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -828,6 +785,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -836,16 +794,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.delete("id", "documentId"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -857,6 +812,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -865,16 +821,13 @@ describe("DocumentsClient", () => { server .mockEndpoint() .delete("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.delete("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.delete("id", "documentId"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -886,6 +839,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -913,7 +867,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/documents/f47ac10b-58cc-4372-a567-0e02b2c3d479") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -923,9 +876,6 @@ describe("DocumentsClient", () => { const response = await client.documents.update( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", - { - tenantName: "base", - }, ); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -959,6 +909,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -967,7 +918,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -975,9 +925,7 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.update("id", "documentId"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -989,6 +937,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -997,7 +946,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -1005,9 +953,7 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.update("id", "documentId"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -1019,6 +965,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -1027,7 +974,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -1035,9 +981,7 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.update("id", "documentId"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -1049,6 +993,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -1057,7 +1002,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .patch("/interactions/id/documents/documentId") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -1065,9 +1009,7 @@ describe("DocumentsClient", () => { .build(); await expect(async () => { - return await client.documents.update("id", "documentId", { - tenantName: "tenantName", - }); + return await client.documents.update("id", "documentId"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -1079,6 +1021,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { outputLanguage: "outputLanguage", templateRef: { templateId: "templateId" } }; @@ -1099,7 +1042,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -1107,12 +1049,9 @@ describe("DocumentsClient", () => { .build(); const response = await client.documents.generate({ - tenantName: "base", - body: { - outputLanguage: "outputLanguage", - templateRef: { - templateId: "templateId", - }, + outputLanguage: "outputLanguage", + templateRef: { + templateId: "templateId", }, }); expect(response).toEqual({ @@ -1149,6 +1088,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1157,7 +1097,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -1166,13 +1105,10 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - tenantName: "tenantName", - body: { - templateRef: { - templateId: "templateId", - }, - outputLanguage: "outputLanguage", + templateRef: { + templateId: "templateId", }, + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -1185,6 +1121,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1193,7 +1130,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -1202,13 +1138,10 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - tenantName: "tenantName", - body: { - templateRef: { - templateId: "templateId", - }, - outputLanguage: "outputLanguage", + templateRef: { + templateId: "templateId", }, + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -1221,6 +1154,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1229,7 +1163,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(422) @@ -1238,13 +1171,10 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - tenantName: "tenantName", - body: { - templateRef: { - templateId: "templateId", - }, - outputLanguage: "outputLanguage", + templateRef: { + templateId: "templateId", }, + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.UnprocessableEntityError); }); @@ -1257,6 +1187,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1265,7 +1196,6 @@ describe("DocumentsClient", () => { server .mockEndpoint() .post("/documents/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -1274,13 +1204,10 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - tenantName: "tenantName", - body: { - templateRef: { - templateId: "templateId", - }, - outputLanguage: "outputLanguage", + templateRef: { + templateId: "templateId", }, + outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.InternalServerError); }); diff --git a/tests/wire/documents/sections.test.ts b/tests/wire/documents/sections.test.ts index 0e365b55..fd570ae6 100644 --- a/tests/wire/documents/sections.test.ts +++ b/tests/wire/documents/sections.test.ts @@ -14,6 +14,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -39,15 +40,12 @@ describe("SectionsClient", () => { server .mockEndpoint() .get("/documents/sections/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.list({ - tenantName: "base", - }); + const response = await client.documents.sections.list(); expect(response).toEqual([ { id: "id", @@ -81,6 +79,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -114,7 +113,6 @@ describe("SectionsClient", () => { server .mockEndpoint() .post("/documents/sections/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -122,11 +120,8 @@ describe("SectionsClient", () => { .build(); const response = await client.documents.sections.create({ - tenantName: "base", - body: { - name: "name", - inheritFromId: "inheritFromId", - }, + name: "name", + inheritFromId: "inheritFromId", }); expect(response).toEqual({ id: "id", @@ -173,6 +168,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -181,7 +177,6 @@ describe("SectionsClient", () => { server .mockEndpoint() .post("/documents/sections/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -190,11 +185,8 @@ describe("SectionsClient", () => { await expect(async () => { return await client.documents.sections.create({ - tenantName: "tenantName", - body: { - inheritFromId: "inheritFromId", - name: "name", - }, + inheritFromId: "inheritFromId", + name: "name", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -207,6 +199,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -240,15 +233,12 @@ describe("SectionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.get("sectionID", { - tenantName: "base", - }); + const response = await client.documents.sections.get("sectionID"); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -294,6 +284,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -302,16 +293,13 @@ describe("SectionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.get("sectionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.get("sectionID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -323,20 +311,13 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - server - .mockEndpoint() - .delete("/documents/sections/sectionID") - .header("Tenant-Name", "base") - .respondWith() - .statusCode(200) - .build(); + server.mockEndpoint().delete("/documents/sections/sectionID").respondWith().statusCode(200).build(); - const response = await client.documents.sections.delete("sectionID", { - tenantName: "base", - }); + const response = await client.documents.sections.delete("sectionID"); expect(response).toEqual(undefined); }); @@ -348,6 +329,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -356,16 +338,13 @@ describe("SectionsClient", () => { server .mockEndpoint() .delete("/documents/sections/sectionID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.delete("sectionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.delete("sectionID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -377,6 +356,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -385,16 +365,13 @@ describe("SectionsClient", () => { server .mockEndpoint() .delete("/documents/sections/sectionID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(409) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.delete("sectionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.delete("sectionID"); }).rejects.toThrow(Corti.ConflictError); }); @@ -406,6 +383,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -439,16 +417,13 @@ describe("SectionsClient", () => { server .mockEndpoint() .patch("/documents/sections/sectionID") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.update("sectionID", { - tenantName: "base", - }); + const response = await client.documents.sections.update("sectionID"); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -494,6 +469,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -502,7 +478,6 @@ describe("SectionsClient", () => { server .mockEndpoint() .patch("/documents/sections/sectionID") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -510,9 +485,7 @@ describe("SectionsClient", () => { .build(); await expect(async () => { - return await client.documents.sections.update("sectionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.update("sectionID"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -524,6 +497,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -532,7 +506,6 @@ describe("SectionsClient", () => { server .mockEndpoint() .patch("/documents/sections/sectionID") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -540,9 +513,7 @@ describe("SectionsClient", () => { .build(); await expect(async () => { - return await client.documents.sections.update("sectionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.update("sectionID"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/documents/sections/versions.test.ts b/tests/wire/documents/sections/versions.test.ts index 7cb6cefc..fb0f2ec1 100644 --- a/tests/wire/documents/sections/versions.test.ts +++ b/tests/wire/documents/sections/versions.test.ts @@ -14,6 +14,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -33,15 +34,12 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.versions.list("sectionID", { - tenantName: "base", - }); + const response = await client.documents.sections.versions.list("sectionID"); expect(response).toEqual([ { id: "id", @@ -68,6 +66,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -76,16 +75,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.list("sectionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.versions.list("sectionID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -97,6 +93,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -124,7 +121,6 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -132,7 +128,6 @@ describe("VersionsClient", () => { .build(); const response = await client.documents.sections.versions.create("sectionID", { - tenantName: "base", generation: {}, }); expect(response).toEqual({ @@ -165,6 +160,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -173,7 +169,6 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -182,7 +177,6 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.sections.versions.create("sectionID", { - tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.BadRequestError); @@ -196,6 +190,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -204,7 +199,6 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -213,7 +207,6 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.sections.versions.create("sectionID", { - tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.NotFoundError); @@ -227,6 +220,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -254,15 +248,12 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/versionID") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.versions.get("sectionID", "versionID", { - tenantName: "base", - }); + const response = await client.documents.sections.versions.get("sectionID", "versionID"); expect(response).toEqual({ id: "id", versionNumber: 1, @@ -293,6 +284,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -301,16 +293,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/sections/sectionID/versions/versionID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.get("sectionID", "versionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.versions.get("sectionID", "versionID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -322,20 +311,18 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/documents/sections/sectionID/versions/versionID") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); - const response = await client.documents.sections.versions.delete("sectionID", "versionID", { - tenantName: "base", - }); + const response = await client.documents.sections.versions.delete("sectionID", "versionID"); expect(response).toEqual(undefined); }); @@ -347,6 +334,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -355,16 +343,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .delete("/documents/sections/sectionID/versions/versionID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.delete("sectionID", "versionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.versions.delete("sectionID", "versionID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -376,6 +361,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -387,15 +373,12 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/versionID/publish") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.sections.versions.publish("sectionID", "versionID", { - tenantName: "base", - }); + const response = await client.documents.sections.versions.publish("sectionID", "versionID"); expect(response).toEqual({ status: "status", evidence: { @@ -414,6 +397,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -422,16 +406,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/sections/sectionID/versions/versionID/publish") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.sections.versions.publish("sectionID", "versionID", { - tenantName: "tenantName", - }); + return await client.documents.sections.versions.publish("sectionID", "versionID"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/documents/templates.test.ts b/tests/wire/documents/templates.test.ts index 57a800ba..499cb608 100644 --- a/tests/wire/documents/templates.test.ts +++ b/tests/wire/documents/templates.test.ts @@ -14,6 +14,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -39,15 +40,12 @@ describe("TemplatesClient", () => { server .mockEndpoint() .get("/documents/templates/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.list({ - tenantName: "base", - }); + const response = await client.documents.templates.list(); expect(response).toEqual([ { id: "id", @@ -81,6 +79,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -133,7 +132,6 @@ describe("TemplatesClient", () => { server .mockEndpoint() .post("/documents/templates/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -141,11 +139,8 @@ describe("TemplatesClient", () => { .build(); const response = await client.documents.templates.create({ - tenantName: "base", - body: { - name: "name", - inheritFromId: "inheritFromId", - }, + name: "name", + inheritFromId: "inheritFromId", }); expect(response).toEqual({ id: "id", @@ -218,6 +213,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -226,7 +222,6 @@ describe("TemplatesClient", () => { server .mockEndpoint() .post("/documents/templates/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -235,11 +230,8 @@ describe("TemplatesClient", () => { await expect(async () => { return await client.documents.templates.create({ - tenantName: "tenantName", - body: { - inheritFromId: "inheritFromId", - name: "name", - }, + inheritFromId: "inheritFromId", + name: "name", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -252,6 +244,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -304,15 +297,12 @@ describe("TemplatesClient", () => { server .mockEndpoint() .get("/documents/templates/templateID") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.get("templateID", { - tenantName: "base", - }); + const response = await client.documents.templates.get("templateID"); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -384,6 +374,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -392,16 +383,13 @@ describe("TemplatesClient", () => { server .mockEndpoint() .get("/documents/templates/templateID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.get("templateID", { - tenantName: "tenantName", - }); + return await client.documents.templates.get("templateID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -413,20 +401,13 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - server - .mockEndpoint() - .delete("/documents/templates/templateID") - .header("Tenant-Name", "base") - .respondWith() - .statusCode(200) - .build(); + server.mockEndpoint().delete("/documents/templates/templateID").respondWith().statusCode(200).build(); - const response = await client.documents.templates.delete("templateID", { - tenantName: "base", - }); + const response = await client.documents.templates.delete("templateID"); expect(response).toEqual(undefined); }); @@ -438,6 +419,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -446,16 +428,13 @@ describe("TemplatesClient", () => { server .mockEndpoint() .delete("/documents/templates/templateID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.delete("templateID", { - tenantName: "tenantName", - }); + return await client.documents.templates.delete("templateID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -467,6 +446,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -475,16 +455,13 @@ describe("TemplatesClient", () => { server .mockEndpoint() .delete("/documents/templates/templateID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(409) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.delete("templateID", { - tenantName: "tenantName", - }); + return await client.documents.templates.delete("templateID"); }).rejects.toThrow(Corti.ConflictError); }); @@ -496,6 +473,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -548,16 +526,13 @@ describe("TemplatesClient", () => { server .mockEndpoint() .patch("/documents/templates/templateID") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.update("templateID", { - tenantName: "base", - }); + const response = await client.documents.templates.update("templateID"); expect(response).toEqual({ id: "id", inheritedFromId: "inheritedFromId", @@ -629,6 +604,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -637,7 +613,6 @@ describe("TemplatesClient", () => { server .mockEndpoint() .patch("/documents/templates/templateID") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -645,9 +620,7 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.documents.templates.update("templateID", { - tenantName: "tenantName", - }); + return await client.documents.templates.update("templateID"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -659,6 +632,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -667,7 +641,6 @@ describe("TemplatesClient", () => { server .mockEndpoint() .patch("/documents/templates/templateID") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -675,9 +648,7 @@ describe("TemplatesClient", () => { .build(); await expect(async () => { - return await client.documents.templates.update("templateID", { - tenantName: "tenantName", - }); + return await client.documents.templates.update("templateID"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/documents/templates/versions.test.ts b/tests/wire/documents/templates/versions.test.ts index 71ee0dad..bc156b08 100644 --- a/tests/wire/documents/templates/versions.test.ts +++ b/tests/wire/documents/templates/versions.test.ts @@ -14,6 +14,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -32,15 +33,12 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.versions.list("templateID", { - tenantName: "base", - }); + const response = await client.documents.templates.versions.list("templateID"); expect(response).toEqual([ { id: "id", @@ -69,6 +67,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -77,16 +76,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.list("templateID", { - tenantName: "tenantName", - }); + return await client.documents.templates.versions.list("templateID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -98,6 +94,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -111,7 +108,6 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -119,7 +115,6 @@ describe("VersionsClient", () => { .build(); const response = await client.documents.templates.versions.create("templateID", { - tenantName: "base", generation: {}, }); expect(response).toEqual({ @@ -148,6 +143,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -156,7 +152,6 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -165,7 +160,6 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.templates.versions.create("templateID", { - tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.BadRequestError); @@ -179,6 +173,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -187,7 +182,6 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -196,7 +190,6 @@ describe("VersionsClient", () => { await expect(async () => { return await client.documents.templates.versions.create("templateID", { - tenantName: "tenantName", generation: {}, }); }).rejects.toThrow(Corti.NotFoundError); @@ -210,6 +203,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -223,15 +217,12 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/versionID") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.versions.get("templateID", "versionID", { - tenantName: "base", - }); + const response = await client.documents.templates.versions.get("templateID", "versionID"); expect(response).toEqual({ id: "id", versionNumber: 1, @@ -258,6 +249,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -266,16 +258,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .get("/documents/templates/templateID/versions/versionID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.get("templateID", "versionID", { - tenantName: "tenantName", - }); + return await client.documents.templates.versions.get("templateID", "versionID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -287,20 +276,18 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/documents/templates/templateID/versions/versionID") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); - const response = await client.documents.templates.versions.delete("templateID", "versionID", { - tenantName: "base", - }); + const response = await client.documents.templates.versions.delete("templateID", "versionID"); expect(response).toEqual(undefined); }); @@ -312,6 +299,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -320,16 +308,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .delete("/documents/templates/templateID/versions/versionID") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.delete("templateID", "versionID", { - tenantName: "tenantName", - }); + return await client.documents.templates.versions.delete("templateID", "versionID"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -341,6 +326,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -352,15 +338,12 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/versionID/publish") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.documents.templates.versions.publish("templateID", "versionID", { - tenantName: "base", - }); + const response = await client.documents.templates.versions.publish("templateID", "versionID"); expect(response).toEqual({ status: "status", evidence: { @@ -379,6 +362,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -387,16 +371,13 @@ describe("VersionsClient", () => { server .mockEndpoint() .post("/documents/templates/templateID/versions/versionID/publish") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.documents.templates.versions.publish("templateID", "versionID", { - tenantName: "tenantName", - }); + return await client.documents.templates.versions.publish("templateID", "versionID"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/facts.test.ts b/tests/wire/facts.test.ts index 5a0cd175..09c2a7ef 100644 --- a/tests/wire/facts.test.ts +++ b/tests/wire/facts.test.ts @@ -14,6 +14,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -21,18 +22,9 @@ describe("FactsClient", () => { data: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", key: "key", translations: [{}] }], }; - server - .mockEndpoint() - .get("/factgroups/") - .header("Tenant-Name", "base") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/factgroups/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.facts.factGroupsList({ - tenantName: "base", - }); + const response = await client.facts.factGroupsList(); expect(response).toEqual({ data: [ { @@ -52,24 +44,16 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server - .mockEndpoint() - .get("/factgroups/") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/factgroups/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.facts.factGroupsList({ - tenantName: "tenantName", - }); + return await client.facts.factGroupsList(); }).rejects.toThrow(Corti.InternalServerError); }); @@ -81,6 +65,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -103,15 +88,12 @@ describe("FactsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - }); + const response = await client.facts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); expect(response).toEqual({ facts: [ { @@ -137,6 +119,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -145,16 +128,13 @@ describe("FactsClient", () => { server .mockEndpoint() .get("/interactions/id/facts/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.facts.list("id", { - tenantName: "tenantName", - }); + return await client.facts.list("id"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -166,6 +146,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ text: "text", group: "other" }] }; @@ -186,7 +167,6 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -194,7 +174,6 @@ describe("FactsClient", () => { .build(); const response = await client.facts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", facts: [ { text: "text", @@ -225,6 +204,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -238,7 +218,6 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/interactions/id/facts/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -247,7 +226,6 @@ describe("FactsClient", () => { await expect(async () => { return await client.facts.create("id", { - tenantName: "tenantName", facts: [ { text: "text", @@ -270,6 +248,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" }] }; @@ -291,7 +270,6 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -299,7 +277,6 @@ describe("FactsClient", () => { .build(); const response = await client.facts.batchUpdate("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", facts: [ { factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", @@ -330,6 +307,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "factId" }, { factId: "factId" }] }; @@ -338,7 +316,6 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/id/facts/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -347,7 +324,6 @@ describe("FactsClient", () => { await expect(async () => { return await client.facts.batchUpdate("id", { - tenantName: "tenantName", facts: [ { factId: "factId", @@ -368,6 +344,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -385,7 +362,6 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/facts/3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -395,9 +371,6 @@ describe("FactsClient", () => { const response = await client.facts.update( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", - { - tenantName: "base", - }, ); expect(response).toEqual({ id: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08", @@ -419,6 +392,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -427,7 +401,6 @@ describe("FactsClient", () => { server .mockEndpoint() .patch("/interactions/id/facts/factId") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -435,9 +408,7 @@ describe("FactsClient", () => { .build(); await expect(async () => { - return await client.facts.update("id", "factId", { - tenantName: "tenantName", - }); + return await client.facts.update("id", "factId"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -449,6 +420,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { context: [{ type: "text", text: "text" }], outputLanguage: "outputLanguage" }; @@ -461,7 +433,6 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/tools/extract-facts") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -469,7 +440,6 @@ describe("FactsClient", () => { .build(); const response = await client.facts.extract({ - tenantName: "base", context: [ { type: "text", @@ -501,6 +471,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -515,7 +486,6 @@ describe("FactsClient", () => { server .mockEndpoint() .post("/tools/extract-facts") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -524,7 +494,6 @@ describe("FactsClient", () => { await expect(async () => { return await client.facts.extract({ - tenantName: "tenantName", context: [ { type: "text", diff --git a/tests/wire/interactions.test.ts b/tests/wire/interactions.test.ts index 2ad84485..e7853a48 100644 --- a/tests/wire/interactions.test.ts +++ b/tests/wire/interactions.test.ts @@ -14,6 +14,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -41,7 +42,6 @@ describe("InteractionsClient", () => { server .mockEndpoint({ once: false }) .get("/interactions/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -71,9 +71,7 @@ describe("InteractionsClient", () => { }, ], }; - const page = await client.interactions.list({ - tenantName: "base", - }); + const page = await client.interactions.list(); expect(expected.interactions).toEqual(page.data); expect(page.hasNextPage()).toBe(true); @@ -89,6 +87,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -97,16 +96,13 @@ describe("InteractionsClient", () => { server .mockEndpoint({ once: false }) .get("/interactions/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.list({ - tenantName: "tenantName", - }); + return await client.interactions.list(); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -118,6 +114,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -126,16 +123,13 @@ describe("InteractionsClient", () => { server .mockEndpoint({ once: false }) .get("/interactions/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.list({ - tenantName: "tenantName", - }); + return await client.interactions.list(); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -147,6 +141,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -157,7 +152,6 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -165,7 +159,6 @@ describe("InteractionsClient", () => { .build(); const response = await client.interactions.create({ - tenantName: "base", encounter: { identifier: "identifier", status: "planned", @@ -186,6 +179,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -196,7 +190,6 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -205,7 +198,6 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ - tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -223,6 +215,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -233,7 +226,6 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -242,7 +234,6 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ - tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -260,6 +251,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -270,7 +262,6 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -279,7 +270,6 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ - tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -297,6 +287,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -307,7 +298,6 @@ describe("InteractionsClient", () => { server .mockEndpoint() .post("/interactions/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -316,7 +306,6 @@ describe("InteractionsClient", () => { await expect(async () => { return await client.interactions.create({ - tenantName: "tenantName", encounter: { identifier: "identifier", status: "planned", @@ -334,6 +323,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -364,15 +354,12 @@ describe("InteractionsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - }); + const response = await client.interactions.get("f47ac10b-58cc-4372-a567-0e02b2c3d479"); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", assignedUserId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -409,24 +396,16 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/interactions/id") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/interactions/id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.interactions.get("id", { - tenantName: "tenantName", - }); + return await client.interactions.get("id"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -438,24 +417,16 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server - .mockEndpoint() - .get("/interactions/id") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(504) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/interactions/id").respondWith().statusCode(504).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.interactions.get("id", { - tenantName: "tenantName", - }); + return await client.interactions.get("id"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -467,20 +438,18 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); server .mockEndpoint() .delete("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); - const response = await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - }); + const response = await client.interactions.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479"); expect(response).toEqual(undefined); }); @@ -492,6 +461,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -500,16 +470,13 @@ describe("InteractionsClient", () => { server .mockEndpoint() .delete("/interactions/id") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.delete("id", { - tenantName: "tenantName", - }); + return await client.interactions.delete("id"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -521,6 +488,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -529,16 +497,13 @@ describe("InteractionsClient", () => { server .mockEndpoint() .delete("/interactions/id") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.interactions.delete("id", { - tenantName: "tenantName", - }); + return await client.interactions.delete("id"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -550,6 +515,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -580,16 +546,13 @@ describe("InteractionsClient", () => { server .mockEndpoint() .patch("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - }); + const response = await client.interactions.update("f47ac10b-58cc-4372-a567-0e02b2c3d479"); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", assignedUserId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -626,6 +589,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -634,7 +598,6 @@ describe("InteractionsClient", () => { server .mockEndpoint() .patch("/interactions/id") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -642,9 +605,7 @@ describe("InteractionsClient", () => { .build(); await expect(async () => { - return await client.interactions.update("id", { - tenantName: "tenantName", - }); + return await client.interactions.update("id"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -656,6 +617,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -664,7 +626,6 @@ describe("InteractionsClient", () => { server .mockEndpoint() .patch("/interactions/id") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -672,9 +633,7 @@ describe("InteractionsClient", () => { .build(); await expect(async () => { - return await client.interactions.update("id", { - tenantName: "tenantName", - }); + return await client.interactions.update("id"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); }); diff --git a/tests/wire/languages.test.ts b/tests/wire/languages.test.ts index d0302375..61b40a6c 100644 --- a/tests/wire/languages.test.ts +++ b/tests/wire/languages.test.ts @@ -14,23 +14,15 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { languages: { key: "value" } }; - server - .mockEndpoint() - .get("/languages/") - .header("Tenant-Name", "base") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.languages.list({ - tenantName: "base", - }); + server.mockEndpoint().get("/languages/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.languages.list(); expect(response).toEqual({ languages: { key: "value", @@ -46,24 +38,16 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/languages/") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/languages/").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.languages.list({ - tenantName: "tenantName", - }); + return await client.languages.list(); }).rejects.toThrow(Corti.BadRequestError); }); @@ -75,24 +59,16 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server - .mockEndpoint() - .get("/languages/") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/languages/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.languages.list({ - tenantName: "tenantName", - }); + return await client.languages.list(); }).rejects.toThrow(Corti.InternalServerError); }); }); diff --git a/tests/wire/recordings.test.ts b/tests/wire/recordings.test.ts index 2f9f505d..c7f405a7 100644 --- a/tests/wire/recordings.test.ts +++ b/tests/wire/recordings.test.ts @@ -14,6 +14,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -22,15 +23,12 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/recordings/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - }); + const response = await client.recordings.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); expect(response).toEqual({ recordings: ["f47ac10b-58cc-4372-a567-0e02b2c3d479"], }); @@ -44,6 +42,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -52,16 +51,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id", { - tenantName: "tenantName", - }); + return await client.recordings.list("id"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -73,6 +69,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -81,16 +78,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id", { - tenantName: "tenantName", - }); + return await client.recordings.list("id"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -102,6 +96,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -110,16 +105,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id", { - tenantName: "tenantName", - }); + return await client.recordings.list("id"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -131,6 +123,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -139,16 +132,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .get("/interactions/id/recordings/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.list("id", { - tenantName: "tenantName", - }); + return await client.recordings.list("id"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -160,6 +150,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -168,7 +159,6 @@ describe("RecordingsClient", () => { .delete( "/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/recordings/f47ac10b-58cc-4372-a567-0e02b2c3d479", ) - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); @@ -176,9 +166,6 @@ describe("RecordingsClient", () => { const response = await client.recordings.delete( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", - { - tenantName: "base", - }, ); expect(response).toEqual(undefined); }); @@ -191,6 +178,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -199,16 +187,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId", { - tenantName: "tenantName", - }); + return await client.recordings.delete("id", "recordingId"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -220,6 +205,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -228,16 +214,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId", { - tenantName: "tenantName", - }); + return await client.recordings.delete("id", "recordingId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -249,6 +232,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -257,16 +241,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId", { - tenantName: "tenantName", - }); + return await client.recordings.delete("id", "recordingId"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -278,6 +259,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -286,16 +268,13 @@ describe("RecordingsClient", () => { server .mockEndpoint() .delete("/interactions/id/recordings/recordingId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.recordings.delete("id", "recordingId", { - tenantName: "tenantName", - }); + return await client.recordings.delete("id", "recordingId"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); }); diff --git a/tests/wire/templates.test.ts b/tests/wire/templates.test.ts index 3f05d198..f81356be 100644 --- a/tests/wire/templates.test.ts +++ b/tests/wire/templates.test.ts @@ -14,6 +14,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -36,18 +37,9 @@ describe("TemplatesClient", () => { ], }; - server - .mockEndpoint() - .get("/templateSections/") - .header("Tenant-Name", "base") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.templates.sectionList({ - tenantName: "base", - }); + server.mockEndpoint().get("/templateSections/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.templates.sectionList(); expect(response).toEqual({ data: [ { @@ -82,24 +74,16 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/templateSections/") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/templateSections/").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.templates.sectionList({ - tenantName: "tenantName", - }); + return await client.templates.sectionList(); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -111,24 +95,16 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server - .mockEndpoint() - .get("/templateSections/") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/templateSections/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.templates.sectionList({ - tenantName: "tenantName", - }); + return await client.templates.sectionList(); }).rejects.toThrow(Corti.InternalServerError); }); @@ -140,6 +116,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -171,18 +148,9 @@ describe("TemplatesClient", () => { ], }; - server - .mockEndpoint() - .get("/templates/") - .header("Tenant-Name", "base") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.templates.list({ - tenantName: "base", - }); + server.mockEndpoint().get("/templates/").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.templates.list(); expect(response).toEqual({ data: [ { @@ -230,24 +198,16 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/templates/") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/templates/").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.templates.list({ - tenantName: "tenantName", - }); + return await client.templates.list(); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -259,24 +219,16 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server - .mockEndpoint() - .get("/templates/") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/templates/").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.templates.list({ - tenantName: "tenantName", - }); + return await client.templates.list(); }).rejects.toThrow(Corti.InternalServerError); }); @@ -288,6 +240,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -315,18 +268,9 @@ describe("TemplatesClient", () => { translations: [{ languageId: "languageId", name: "name", description: "description" }], }; - server - .mockEndpoint() - .get("/templates/key") - .header("Tenant-Name", "base") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.templates.get("key", { - tenantName: "base", - }); + server.mockEndpoint().get("/templates/key").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.templates.get("key"); expect(response).toEqual({ updatedAt: new Date("2024-01-15T09:30:00.000Z"), name: "name", @@ -372,24 +316,16 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/templates/key") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/templates/key").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.templates.get("key", { - tenantName: "tenantName", - }); + return await client.templates.get("key"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -401,24 +337,16 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawResponseBody = { requestid: "requestid", status: 1, type: "type", detail: "detail" }; - server - .mockEndpoint() - .get("/templates/key") - .header("Tenant-Name", "tenantName") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/templates/key").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.templates.get("key", { - tenantName: "tenantName", - }); + return await client.templates.get("key"); }).rejects.toThrow(Corti.InternalServerError); }); }); diff --git a/tests/wire/transcripts.test.ts b/tests/wire/transcripts.test.ts index f2f5db77..ea5be3b4 100644 --- a/tests/wire/transcripts.test.ts +++ b/tests/wire/transcripts.test.ts @@ -14,6 +14,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -33,15 +34,12 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", - }); + const response = await client.transcripts.list("f47ac10b-58cc-4372-a567-0e02b2c3d479"); expect(response).toEqual({ transcripts: [ { @@ -73,6 +71,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -81,16 +80,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id", { - tenantName: "tenantName", - }); + return await client.transcripts.list("id"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -102,6 +98,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -110,16 +107,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id", { - tenantName: "tenantName", - }); + return await client.transcripts.list("id"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -131,6 +125,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -139,16 +134,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id", { - tenantName: "tenantName", - }); + return await client.transcripts.list("id"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -160,6 +152,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -168,16 +161,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id", { - tenantName: "tenantName", - }); + return await client.transcripts.list("id"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -189,6 +179,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -197,16 +188,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.list("id", { - tenantName: "tenantName", - }); + return await client.transcripts.list("id"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -218,6 +206,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", primaryLanguage: "en" }; @@ -233,7 +222,6 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/") - .header("Tenant-Name", "base") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -241,7 +229,6 @@ describe("TranscriptsClient", () => { .build(); const response = await client.transcripts.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - tenantName: "base", recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", primaryLanguage: "en", }); @@ -281,6 +268,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -289,7 +277,6 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -298,7 +285,6 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { - tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -313,6 +299,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -321,7 +308,6 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(401) @@ -330,7 +316,6 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { - tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -345,6 +330,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -353,7 +339,6 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(403) @@ -362,7 +347,6 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { - tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -377,6 +361,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -385,7 +370,6 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(500) @@ -394,7 +378,6 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { - tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -409,6 +392,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -417,7 +401,6 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .post("/interactions/id/transcripts/") - .header("Tenant-Name", "tenantName") .jsonBody(rawRequestBody) .respondWith() .statusCode(504) @@ -426,7 +409,6 @@ describe("TranscriptsClient", () => { await expect(async () => { return await client.transcripts.create("id", { - tenantName: "tenantName", recordingId: "recordingId", primaryLanguage: "primaryLanguage", }); @@ -441,6 +423,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -456,7 +439,6 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/f47ac10b-58cc-4372-a567-0e02b2c3d479") - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -465,9 +447,6 @@ describe("TranscriptsClient", () => { const response = await client.transcripts.get( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", - { - tenantName: "base", - }, ); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -505,6 +484,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -513,16 +493,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.get("id", "transcriptId"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -534,6 +511,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -542,16 +520,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.get("id", "transcriptId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -563,6 +538,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -571,16 +547,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.get("id", "transcriptId"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -592,6 +565,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -600,16 +574,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.get("id", "transcriptId"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -621,6 +592,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -629,16 +601,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.get("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.get("id", "transcriptId"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -650,6 +619,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -658,7 +628,6 @@ describe("TranscriptsClient", () => { .delete( "/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/f47ac10b-58cc-4372-a567-0e02b2c3d479", ) - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .build(); @@ -666,9 +635,6 @@ describe("TranscriptsClient", () => { const response = await client.transcripts.delete( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", - { - tenantName: "base", - }, ); expect(response).toEqual(undefined); }); @@ -681,6 +647,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -689,16 +656,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(400) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.delete("id", "transcriptId"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -710,6 +674,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -718,16 +683,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.delete("id", "transcriptId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -739,6 +701,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -747,16 +710,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(403) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.delete("id", "transcriptId"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -768,6 +728,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -776,16 +737,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(500) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.delete("id", "transcriptId"); }).rejects.toThrow(Corti.InternalServerError); }); @@ -797,6 +755,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -805,16 +764,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .delete("/interactions/id/transcripts/transcriptId") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(504) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.delete("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.delete("id", "transcriptId"); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -826,6 +782,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -836,7 +793,6 @@ describe("TranscriptsClient", () => { .get( "/interactions/f47ac10b-58cc-4372-a567-0e02b2c3d479/transcripts/f47ac10b-58cc-4372-a567-0e02b2c3d479/status", ) - .header("Tenant-Name", "base") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) @@ -845,9 +801,6 @@ describe("TranscriptsClient", () => { const response = await client.transcripts.getStatus( "f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479", - { - tenantName: "base", - }, ); expect(response).toEqual({ status: "completed", @@ -862,6 +815,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -870,16 +824,13 @@ describe("TranscriptsClient", () => { server .mockEndpoint() .get("/interactions/id/transcripts/transcriptId/status") - .header("Tenant-Name", "tenantName") .respondWith() .statusCode(404) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.transcripts.getStatus("id", "transcriptId", { - tenantName: "tenantName", - }); + return await client.transcripts.getStatus("id", "transcriptId"); }).rejects.toThrow(Corti.NotFoundError); }); }); From f1952c3c2c132b13c57e656316b7eacb0c8d4dce Mon Sep 17 00:00:00 2001 From: markitosha Date: Wed, 29 Jul 2026 14:41:13 +0200 Subject: [PATCH 04/18] fix: tolerate optional tenantName from regenerated BaseClientOptions Fern now types tenantName as Supplier. Coerce to string at custom call sites so the SDK builds again. --- src/custom/CortiClient.ts | 2 +- src/custom/auth/CortiAuth.ts | 4 +--- src/custom/stream/CustomStream.ts | 2 +- src/custom/transcribe/CustomTranscribe.ts | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/custom/CortiClient.ts b/src/custom/CortiClient.ts index 67b80128..d39323e8 100644 --- a/src/custom/CortiClient.ts +++ b/src/custom/CortiClient.ts @@ -133,7 +133,7 @@ export class CortiClient extends BaseCortiClient { return new Headers({ ...(req.headers ?? {}), - "Tenant-Name": await core.Supplier.get(this._options.tenantName), + "Tenant-Name": (await core.Supplier.get(this._options.tenantName)) ?? "", }); }; } diff --git a/src/custom/auth/CortiAuth.ts b/src/custom/auth/CortiAuth.ts index 84cf945a..8f103ed7 100644 --- a/src/custom/auth/CortiAuth.ts +++ b/src/custom/auth/CortiAuth.ts @@ -113,13 +113,11 @@ export class CortiAuth extends AuthClient { const { environment, tenantName, ...rest } = options; super({ ...rest, - // @ts-expect-error it suppose to be required, but we need to filter out header without rewriting too much - tenantName: null, environment: getEnvironment(environment), token: options.token ?? (() => ""), }); - this._tenantName = tenantName; + this._tenantName = async () => (await core.Supplier.get(tenantName)) ?? ""; this._options.authProvider = new core.NoOpAuthProvider(); /** Stripping Fern headers to bypass CORS on authentication requests */ diff --git a/src/custom/stream/CustomStream.ts b/src/custom/stream/CustomStream.ts index 62e5c1f1..d5557814 100644 --- a/src/custom/stream/CustomStream.ts +++ b/src/custom/stream/CustomStream.ts @@ -63,7 +63,7 @@ export class CustomStream extends StreamClient { await super.connect({ ...rest, token: (await this._options.authProvider?.getAuthRequest())?.headers.Authorization || "", - tenantName: await core.Supplier.get(this._options.tenantName), + tenantName: (await core.Supplier.get(this._options.tenantName)) ?? "", }) ).socket; diff --git a/src/custom/transcribe/CustomTranscribe.ts b/src/custom/transcribe/CustomTranscribe.ts index ce6d7909..a93ae0a5 100644 --- a/src/custom/transcribe/CustomTranscribe.ts +++ b/src/custom/transcribe/CustomTranscribe.ts @@ -62,7 +62,7 @@ export class CustomTranscribe extends TranscribeClient { await super.connect({ ...rest, token: (await this._options.authProvider?.getAuthRequest())?.headers.Authorization || "", - tenantName: await core.Supplier.get(this._options.tenantName), + tenantName: (await core.Supplier.get(this._options.tenantName)) ?? "", }) ).socket; From bc807fe2f15bdaf2716d3d77707f3e2f95c38409 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 13:32:02 +0000 Subject: [PATCH 05/18] SDK regeneration --- .fern/metadata.json | 2 +- src/Client.ts | 6 + src/api/resources/agentic/client/Client.ts | 661 ++++++ .../resources/a2A => agentic}/client/index.ts | 0 .../client/requests/AgentsCreateRequest.ts | 0 .../client/requests/AgentsPatchRequest.ts | 0 .../client/requests/ListAgenticRequest.ts} | 2 +- .../agentic/client/requests/index.ts | 3 + .../resources/contexts => agentic}/index.ts | 0 .../resources/a2A/client/Client.ts | 12 +- .../resources/a2A}/client/index.ts | 0 .../a2A/client/requests/A2AjsonrpcRequest.ts | 4 +- .../resources/a2A/client/requests/index.ts | 0 .../resources/a2A/index.ts | 0 .../resources/a2A/resources/index.ts | 0 .../a2A/resources/tasks/client/Client.ts | 20 +- .../a2A/resources/tasks}/client/index.ts | 0 .../tasks/client/requests/GetTasksRequest.ts | 0 .../tasks/client/requests/ListTasksRequest.ts | 0 .../resources/tasks/client/requests/index.ts | 0 .../resources/a2A/resources/tasks/index.ts | 0 .../a2A/types/A2AjsonrpcRequestId.ts | 0 .../a2A/types/A2AjsonrpcRequestMethod.ts | 0 .../resources/a2A/types/index.ts | 0 .../resources/artifacts/client/Client.ts | 2 +- .../resources/artifacts/client/index.ts | 0 .../resources/artifacts/index.ts | 0 .../resources/connectors/client/Client.ts | 8 +- .../resources/connectors/client/index.ts | 0 .../resources/connectors/index.ts | 0 .../resources/contexts/client/Client.ts | 18 +- .../resources/contexts}/client/index.ts | 0 .../client/requests/GetContextsRequest.ts | 0 .../requests/GetTraceContextsRequest.ts | 0 .../contexts/client/requests/index.ts | 0 .../agentic/resources/contexts/index.ts | 2 + .../resources/contexts/resources/index.ts | 0 .../contexts/resources/tasks/client/Client.ts | 10 +- .../contexts/resources/tasks}/client/index.ts | 0 .../tasks/client/requests/ListTasksRequest.ts | 0 .../resources/tasks/client/requests/index.ts | 0 .../contexts/resources/tasks/index.ts | 0 .../resources/feedback/client/Client.ts | 16 +- .../resources/feedback}/client/index.ts | 0 .../client/requests/FeedbackCreateRequest.ts | 0 .../feedback/client/requests/index.ts | 0 .../resources/feedback/index.ts | 0 .../{agents => agentic}/resources/index.ts | 0 .../resources/registry/client/Client.ts | 10 +- .../resources/registry}/client/index.ts | 0 .../client/requests/ListRegistryRequest.ts | 0 .../registry/client/requests/index.ts | 0 .../resources/registry/index.ts | 0 .../resources/usage/client/Client.ts | 8 +- .../agentic/resources/usage}/client/index.ts | 0 .../usage/client/requests/GetUsageRequest.ts | 0 .../resources/usage/client/requests/index.ts | 0 .../resources/usage/index.ts | 0 src/api/resources/agents/client/Client.ts | 896 +++++--- .../client/requests/AgentsCreateAgent.ts | 26 + .../requests/AgentsGetContextRequest.ts | 12 + .../AgentsGetRegistryExpertsRequest.ts | 15 + .../client/requests/AgentsGetTaskRequest.ts | 10 + .../client/requests/AgentsListRequest.ts | 14 + .../client/requests/AgentsMessageSendBody.ts | 24 + .../client/requests/AgentsUpdateAgent.ts | 19 + .../resources/agents/client/requests/index.ts | 10 +- src/api/resources/agents/index.ts | 2 +- .../types/AgentsCreateAgentAgentType.ts | 9 + .../types/AgentsCreateAgentExpertsItem.ts | 5 + .../agents/types/AgentsMessageSendResponse.ts | 8 + .../types/AgentsUpdateAgentExpertsItem.ts | 5 + src/api/resources/agents/types/index.ts | 4 + src/api/resources/index.ts | 3 + src/api/types/AgentsAgent.ts | 17 + src/api/types/AgentsAgentCapabilities.ts | 14 + src/api/types/AgentsAgentCard.ts | 39 + src/api/types/AgentsAgentCardSignature.ts | 10 + src/api/types/AgentsAgentExpertsItem.ts | 5 + src/api/types/AgentsAgentExtension.ts | 12 + src/api/types/AgentsAgentInterface.ts | 7 + src/api/types/AgentsAgentProvider.ts | 8 + src/api/types/AgentsAgentReference.ts | 14 + src/api/types/AgentsAgentReferenceType.ts | 6 + src/api/types/AgentsAgentResponse.ts | 5 + src/api/types/AgentsAgentSkill.ts | 22 + src/api/types/AgentsArtifact.ts | 18 + src/api/types/AgentsContext.ts | 9 + src/api/types/AgentsContextItemsItem.ts | 5 + src/api/types/AgentsCreateExpert.ts | 15 + src/api/types/AgentsCreateExpertReference.ts | 18 + .../types/AgentsCreateExpertReferenceType.ts | 7 + src/api/types/AgentsCreateExpertType.ts | 6 + src/api/types/AgentsCreateMcpServer.ts | 22 + .../AgentsCreateMcpServerAuthorizationType.ts | 11 + .../AgentsCreateMcpServerTransportType.ts | 10 + src/api/types/AgentsDataPart.ts | 12 + src/api/types/AgentsDataPartKind.ts | 7 + src/api/types/AgentsExpert.ts | 17 + src/api/types/AgentsExpertReference.ts | 18 + src/api/types/AgentsExpertReferenceType.ts | 6 + src/api/types/AgentsExpertType.ts | 6 + src/api/types/AgentsFilePart.ts | 11 + src/api/types/AgentsFilePartFile.ts | 5 + src/api/types/AgentsFilePartKind.ts | 7 + src/api/types/AgentsFileWithBytes.ts | 10 + src/api/types/AgentsFileWithUri.ts | 10 + src/api/types/AgentsMcpServer.ts | 20 + .../types/AgentsMcpServerAuthorizationType.ts | 11 + src/api/types/AgentsMcpServerTransportType.ts | 10 + src/api/types/AgentsMessage.ts | 24 + src/api/types/AgentsMessageKind.ts | 7 + src/api/types/AgentsMessageRole.ts | 8 + .../types/AgentsMessageSendConfiguration.ts | 13 + src/api/types/AgentsPart.ts | 5 + ...gentsPushNotificationAuthenticationInfo.ts | 8 + src/api/types/AgentsPushNotificationConfig.ts | 13 + src/api/types/AgentsRegistryExpert.ts | 18 + .../types/AgentsRegistryExpertsResponse.ts | 8 + src/api/types/AgentsRegistryMcpServer.ts | 10 + ...gentsRegistryMcpServerAuthorizationType.ts | 11 + src/api/types/AgentsTask.ts | 19 + src/api/types/AgentsTaskKind.ts | 7 + src/api/types/AgentsTaskStatus.ts | 12 + src/api/types/AgentsTaskStatusState.ts | 15 + src/api/types/AgentsTextPart.ts | 12 + src/api/types/AgentsTextPartKind.ts | 7 + src/api/types/AgentsUpdateExpertReference.ts | 8 + src/api/types/index.ts | 54 + .../feedback => agentic}/client/index.ts | 0 .../client/requests/AgentsCreateRequest.ts | 0 .../client/requests/AgentsPatchRequest.ts | 0 .../agentic/client/requests/index.ts | 2 + src/serialization/resources/agentic/index.ts | 2 + .../agentic/resources/a2A/client/index.ts | 1 + .../a2A/client/requests/A2AjsonrpcRequest.ts | 4 +- .../resources/a2A/client/requests/index.ts | 0 .../resources/a2A/index.ts | 0 .../a2A/types/A2AjsonrpcRequestId.ts | 4 +- .../a2A/types/A2AjsonrpcRequestMethod.ts | 4 +- .../resources/a2A/types/index.ts | 0 .../resources/feedback/client/index.ts | 1 + .../client/requests/FeedbackCreateRequest.ts | 4 +- .../feedback/client/requests/index.ts | 0 .../resources/feedback/index.ts | 0 .../{agents => agentic}/resources/index.ts | 0 .../resources/agents/client/index.ts | 1 + .../resources/agents/client/list.ts | 13 + .../client/requests/AgentsCreateAgent.ts | 31 + .../client/requests/AgentsMessageSendBody.ts | 24 + .../client/requests/AgentsUpdateAgent.ts | 26 + .../resources/agents/client/requests/index.ts | 5 +- src/serialization/resources/agents/index.ts | 2 +- .../types/AgentsCreateAgentAgentType.ts | 14 + .../types/AgentsCreateAgentExpertsItem.ts | 16 + .../agents/types/AgentsMessageSendResponse.ts | 22 + .../types/AgentsUpdateAgentExpertsItem.ts | 16 + .../resources/agents/types/index.ts | 4 + src/serialization/resources/index.ts | 3 + src/serialization/types/AgentsAgent.ts | 28 + .../types/AgentsAgentCapabilities.ts | 25 + src/serialization/types/AgentsAgentCard.ts | 59 + .../types/AgentsAgentCardSignature.ts | 22 + .../types/AgentsAgentExpertsItem.ts | 16 + .../types/AgentsAgentExtension.ts | 24 + .../types/AgentsAgentInterface.ts | 20 + .../types/AgentsAgentProvider.ts | 20 + .../types/AgentsAgentReference.ts | 23 + .../types/AgentsAgentReferenceType.ts | 14 + .../types/AgentsAgentResponse.ts | 16 + src/serialization/types/AgentsAgentSkill.ts | 33 + src/serialization/types/AgentsArtifact.ts | 27 + src/serialization/types/AgentsContext.ts | 19 + .../types/AgentsContextItemsItem.ts | 16 + src/serialization/types/AgentsCreateExpert.ts | 28 + .../types/AgentsCreateExpertReference.ts | 27 + .../types/AgentsCreateExpertReferenceType.ts | 14 + .../types/AgentsCreateExpertType.ts | 14 + .../types/AgentsCreateMcpServer.ts | 34 + .../AgentsCreateMcpServerAuthorizationType.ts | 14 + .../AgentsCreateMcpServerTransportType.ts | 14 + src/serialization/types/AgentsDataPart.ts | 21 + src/serialization/types/AgentsDataPartKind.ts | 14 + src/serialization/types/AgentsExpert.ts | 28 + .../types/AgentsExpertReference.ts | 27 + .../types/AgentsExpertReferenceType.ts | 14 + src/serialization/types/AgentsExpertType.ts | 12 + src/serialization/types/AgentsFilePart.ts | 22 + src/serialization/types/AgentsFilePartFile.ts | 16 + src/serialization/types/AgentsFilePartKind.ts | 14 + .../types/AgentsFileWithBytes.ts | 22 + src/serialization/types/AgentsFileWithUri.ts | 22 + src/serialization/types/AgentsMcpServer.ts | 30 + .../types/AgentsMcpServerAuthorizationType.ts | 14 + .../types/AgentsMcpServerTransportType.ts | 14 + src/serialization/types/AgentsMessage.ts | 35 + src/serialization/types/AgentsMessageKind.ts | 12 + src/serialization/types/AgentsMessageRole.ts | 12 + .../types/AgentsMessageSendConfiguration.ts | 25 + src/serialization/types/AgentsPart.ts | 15 + ...gentsPushNotificationAuthenticationInfo.ts | 20 + .../types/AgentsPushNotificationConfig.ts | 25 + .../types/AgentsRegistryExpert.ts | 29 + .../types/AgentsRegistryExpertsResponse.ts | 19 + .../types/AgentsRegistryMcpServer.ts | 21 + ...gentsRegistryMcpServerAuthorizationType.ts | 14 + src/serialization/types/AgentsTask.ts | 32 + src/serialization/types/AgentsTaskKind.ts | 12 + src/serialization/types/AgentsTaskStatus.ts | 24 + .../types/AgentsTaskStatusState.ts | 33 + src/serialization/types/AgentsTextPart.ts | 21 + src/serialization/types/AgentsTextPartKind.ts | 14 + .../types/AgentsUpdateExpertReference.ts | 15 + src/serialization/types/index.ts | 54 + tests/wire/agentic.test.ts | 1089 +++++++++ tests/wire/{agents => agentic}/a2A.test.ts | 22 +- .../{agents => agentic}/a2A/tasks.test.ts | 20 +- .../{agents => agentic}/artifacts.test.ts | 8 +- .../{agents => agentic}/connectors.test.ts | 28 +- .../wire/{agents => agentic}/contexts.test.ts | 20 +- .../contexts/tasks.test.ts | 12 +- .../wire/{agents => agentic}/feedback.test.ts | 24 +- .../wire/{agents => agentic}/registry.test.ts | 10 +- tests/wire/{agents => agentic}/usage.test.ts | 8 +- tests/wire/agents.test.ts | 1947 ++++++++++++----- 225 files changed, 6195 insertions(+), 936 deletions(-) create mode 100644 src/api/resources/agentic/client/Client.ts rename src/api/resources/{agents/resources/a2A => agentic}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/client/requests/AgentsCreateRequest.ts (100%) rename src/api/resources/{agents => agentic}/client/requests/AgentsPatchRequest.ts (100%) rename src/api/resources/{agents/client/requests/ListAgentsRequest.ts => agentic/client/requests/ListAgenticRequest.ts} (95%) create mode 100644 src/api/resources/agentic/client/requests/index.ts rename src/api/resources/{agents/resources/contexts => agentic}/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/client/Client.ts (97%) rename src/api/resources/{agents/resources/a2A/resources/tasks => agentic/resources/a2A}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/client/requests/A2AjsonrpcRequest.ts (88%) rename src/api/resources/{agents => agentic}/resources/a2A/client/requests/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/resources/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/resources/tasks/client/Client.ts (95%) rename src/api/resources/{agents/resources/contexts => agentic/resources/a2A/resources/tasks}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/resources/tasks/client/requests/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/resources/tasks/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/types/A2AjsonrpcRequestId.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/types/A2AjsonrpcRequestMethod.ts (100%) rename src/api/resources/{agents => agentic}/resources/a2A/types/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/artifacts/client/Client.ts (96%) rename src/api/resources/{agents => agentic}/resources/artifacts/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/artifacts/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/connectors/client/Client.ts (97%) rename src/api/resources/{agents => agentic}/resources/connectors/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/connectors/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/client/Client.ts (95%) rename src/api/resources/{agents/resources/contexts/resources/tasks => agentic/resources/contexts}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/client/requests/GetContextsRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/client/requests/GetTraceContextsRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/client/requests/index.ts (100%) create mode 100644 src/api/resources/agentic/resources/contexts/index.ts rename src/api/resources/{agents => agentic}/resources/contexts/resources/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/resources/tasks/client/Client.ts (95%) rename src/api/resources/{agents/resources/feedback => agentic/resources/contexts/resources/tasks}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/resources/tasks/client/requests/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/contexts/resources/tasks/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/feedback/client/Client.ts (94%) rename src/api/resources/{agents/resources/registry => agentic/resources/feedback}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/feedback/client/requests/FeedbackCreateRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/feedback/client/requests/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/feedback/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/registry/client/Client.ts (96%) rename src/api/resources/{agents/resources/usage => agentic/resources/registry}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/registry/client/requests/ListRegistryRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/registry/client/requests/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/registry/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/usage/client/Client.ts (95%) rename src/{serialization/resources/agents/resources/a2A => api/resources/agentic/resources/usage}/client/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/usage/client/requests/GetUsageRequest.ts (100%) rename src/api/resources/{agents => agentic}/resources/usage/client/requests/index.ts (100%) rename src/api/resources/{agents => agentic}/resources/usage/index.ts (100%) create mode 100644 src/api/resources/agents/client/requests/AgentsCreateAgent.ts create mode 100644 src/api/resources/agents/client/requests/AgentsGetContextRequest.ts create mode 100644 src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts create mode 100644 src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts create mode 100644 src/api/resources/agents/client/requests/AgentsListRequest.ts create mode 100644 src/api/resources/agents/client/requests/AgentsMessageSendBody.ts create mode 100644 src/api/resources/agents/client/requests/AgentsUpdateAgent.ts create mode 100644 src/api/resources/agents/types/AgentsCreateAgentAgentType.ts create mode 100644 src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts create mode 100644 src/api/resources/agents/types/AgentsMessageSendResponse.ts create mode 100644 src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts create mode 100644 src/api/resources/agents/types/index.ts create mode 100644 src/api/types/AgentsAgent.ts create mode 100644 src/api/types/AgentsAgentCapabilities.ts create mode 100644 src/api/types/AgentsAgentCard.ts create mode 100644 src/api/types/AgentsAgentCardSignature.ts create mode 100644 src/api/types/AgentsAgentExpertsItem.ts create mode 100644 src/api/types/AgentsAgentExtension.ts create mode 100644 src/api/types/AgentsAgentInterface.ts create mode 100644 src/api/types/AgentsAgentProvider.ts create mode 100644 src/api/types/AgentsAgentReference.ts create mode 100644 src/api/types/AgentsAgentReferenceType.ts create mode 100644 src/api/types/AgentsAgentResponse.ts create mode 100644 src/api/types/AgentsAgentSkill.ts create mode 100644 src/api/types/AgentsArtifact.ts create mode 100644 src/api/types/AgentsContext.ts create mode 100644 src/api/types/AgentsContextItemsItem.ts create mode 100644 src/api/types/AgentsCreateExpert.ts create mode 100644 src/api/types/AgentsCreateExpertReference.ts create mode 100644 src/api/types/AgentsCreateExpertReferenceType.ts create mode 100644 src/api/types/AgentsCreateExpertType.ts create mode 100644 src/api/types/AgentsCreateMcpServer.ts create mode 100644 src/api/types/AgentsCreateMcpServerAuthorizationType.ts create mode 100644 src/api/types/AgentsCreateMcpServerTransportType.ts create mode 100644 src/api/types/AgentsDataPart.ts create mode 100644 src/api/types/AgentsDataPartKind.ts create mode 100644 src/api/types/AgentsExpert.ts create mode 100644 src/api/types/AgentsExpertReference.ts create mode 100644 src/api/types/AgentsExpertReferenceType.ts create mode 100644 src/api/types/AgentsExpertType.ts create mode 100644 src/api/types/AgentsFilePart.ts create mode 100644 src/api/types/AgentsFilePartFile.ts create mode 100644 src/api/types/AgentsFilePartKind.ts create mode 100644 src/api/types/AgentsFileWithBytes.ts create mode 100644 src/api/types/AgentsFileWithUri.ts create mode 100644 src/api/types/AgentsMcpServer.ts create mode 100644 src/api/types/AgentsMcpServerAuthorizationType.ts create mode 100644 src/api/types/AgentsMcpServerTransportType.ts create mode 100644 src/api/types/AgentsMessage.ts create mode 100644 src/api/types/AgentsMessageKind.ts create mode 100644 src/api/types/AgentsMessageRole.ts create mode 100644 src/api/types/AgentsMessageSendConfiguration.ts create mode 100644 src/api/types/AgentsPart.ts create mode 100644 src/api/types/AgentsPushNotificationAuthenticationInfo.ts create mode 100644 src/api/types/AgentsPushNotificationConfig.ts create mode 100644 src/api/types/AgentsRegistryExpert.ts create mode 100644 src/api/types/AgentsRegistryExpertsResponse.ts create mode 100644 src/api/types/AgentsRegistryMcpServer.ts create mode 100644 src/api/types/AgentsRegistryMcpServerAuthorizationType.ts create mode 100644 src/api/types/AgentsTask.ts create mode 100644 src/api/types/AgentsTaskKind.ts create mode 100644 src/api/types/AgentsTaskStatus.ts create mode 100644 src/api/types/AgentsTaskStatusState.ts create mode 100644 src/api/types/AgentsTextPart.ts create mode 100644 src/api/types/AgentsTextPartKind.ts create mode 100644 src/api/types/AgentsUpdateExpertReference.ts rename src/serialization/resources/{agents/resources/feedback => agentic}/client/index.ts (100%) rename src/serialization/resources/{agents => agentic}/client/requests/AgentsCreateRequest.ts (100%) rename src/serialization/resources/{agents => agentic}/client/requests/AgentsPatchRequest.ts (100%) create mode 100644 src/serialization/resources/agentic/client/requests/index.ts create mode 100644 src/serialization/resources/agentic/index.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/client/index.ts rename src/serialization/resources/{agents => agentic}/resources/a2A/client/requests/A2AjsonrpcRequest.ts (91%) rename src/serialization/resources/{agents => agentic}/resources/a2A/client/requests/index.ts (100%) rename src/serialization/resources/{agents => agentic}/resources/a2A/index.ts (100%) rename src/serialization/resources/{agents => agentic}/resources/a2A/types/A2AjsonrpcRequestId.ts (85%) rename src/serialization/resources/{agents => agentic}/resources/a2A/types/A2AjsonrpcRequestMethod.ts (87%) rename src/serialization/resources/{agents => agentic}/resources/a2A/types/index.ts (100%) create mode 100644 src/serialization/resources/agentic/resources/feedback/client/index.ts rename src/serialization/resources/{agents => agentic}/resources/feedback/client/requests/FeedbackCreateRequest.ts (92%) rename src/serialization/resources/{agents => agentic}/resources/feedback/client/requests/index.ts (100%) rename src/serialization/resources/{agents => agentic}/resources/feedback/index.ts (100%) rename src/serialization/resources/{agents => agentic}/resources/index.ts (100%) create mode 100644 src/serialization/resources/agents/client/list.ts create mode 100644 src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts create mode 100644 src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts create mode 100644 src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts create mode 100644 src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts create mode 100644 src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts create mode 100644 src/serialization/resources/agents/types/AgentsMessageSendResponse.ts create mode 100644 src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts create mode 100644 src/serialization/resources/agents/types/index.ts create mode 100644 src/serialization/types/AgentsAgent.ts create mode 100644 src/serialization/types/AgentsAgentCapabilities.ts create mode 100644 src/serialization/types/AgentsAgentCard.ts create mode 100644 src/serialization/types/AgentsAgentCardSignature.ts create mode 100644 src/serialization/types/AgentsAgentExpertsItem.ts create mode 100644 src/serialization/types/AgentsAgentExtension.ts create mode 100644 src/serialization/types/AgentsAgentInterface.ts create mode 100644 src/serialization/types/AgentsAgentProvider.ts create mode 100644 src/serialization/types/AgentsAgentReference.ts create mode 100644 src/serialization/types/AgentsAgentReferenceType.ts create mode 100644 src/serialization/types/AgentsAgentResponse.ts create mode 100644 src/serialization/types/AgentsAgentSkill.ts create mode 100644 src/serialization/types/AgentsArtifact.ts create mode 100644 src/serialization/types/AgentsContext.ts create mode 100644 src/serialization/types/AgentsContextItemsItem.ts create mode 100644 src/serialization/types/AgentsCreateExpert.ts create mode 100644 src/serialization/types/AgentsCreateExpertReference.ts create mode 100644 src/serialization/types/AgentsCreateExpertReferenceType.ts create mode 100644 src/serialization/types/AgentsCreateExpertType.ts create mode 100644 src/serialization/types/AgentsCreateMcpServer.ts create mode 100644 src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts create mode 100644 src/serialization/types/AgentsCreateMcpServerTransportType.ts create mode 100644 src/serialization/types/AgentsDataPart.ts create mode 100644 src/serialization/types/AgentsDataPartKind.ts create mode 100644 src/serialization/types/AgentsExpert.ts create mode 100644 src/serialization/types/AgentsExpertReference.ts create mode 100644 src/serialization/types/AgentsExpertReferenceType.ts create mode 100644 src/serialization/types/AgentsExpertType.ts create mode 100644 src/serialization/types/AgentsFilePart.ts create mode 100644 src/serialization/types/AgentsFilePartFile.ts create mode 100644 src/serialization/types/AgentsFilePartKind.ts create mode 100644 src/serialization/types/AgentsFileWithBytes.ts create mode 100644 src/serialization/types/AgentsFileWithUri.ts create mode 100644 src/serialization/types/AgentsMcpServer.ts create mode 100644 src/serialization/types/AgentsMcpServerAuthorizationType.ts create mode 100644 src/serialization/types/AgentsMcpServerTransportType.ts create mode 100644 src/serialization/types/AgentsMessage.ts create mode 100644 src/serialization/types/AgentsMessageKind.ts create mode 100644 src/serialization/types/AgentsMessageRole.ts create mode 100644 src/serialization/types/AgentsMessageSendConfiguration.ts create mode 100644 src/serialization/types/AgentsPart.ts create mode 100644 src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts create mode 100644 src/serialization/types/AgentsPushNotificationConfig.ts create mode 100644 src/serialization/types/AgentsRegistryExpert.ts create mode 100644 src/serialization/types/AgentsRegistryExpertsResponse.ts create mode 100644 src/serialization/types/AgentsRegistryMcpServer.ts create mode 100644 src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts create mode 100644 src/serialization/types/AgentsTask.ts create mode 100644 src/serialization/types/AgentsTaskKind.ts create mode 100644 src/serialization/types/AgentsTaskStatus.ts create mode 100644 src/serialization/types/AgentsTaskStatusState.ts create mode 100644 src/serialization/types/AgentsTextPart.ts create mode 100644 src/serialization/types/AgentsTextPartKind.ts create mode 100644 src/serialization/types/AgentsUpdateExpertReference.ts create mode 100644 tests/wire/agentic.test.ts rename tests/wire/{agents => agentic}/a2A.test.ts (95%) rename tests/wire/{agents => agentic}/a2A/tasks.test.ts (96%) rename tests/wire/{agents => agentic}/artifacts.test.ts (93%) rename tests/wire/{agents => agentic}/connectors.test.ts (92%) rename tests/wire/{agents => agentic}/contexts.test.ts (95%) rename tests/wire/{agents => agentic}/contexts/tasks.test.ts (96%) rename tests/wire/{agents => agentic}/feedback.test.ts (95%) rename tests/wire/{agents => agentic}/registry.test.ts (96%) rename tests/wire/{agents => agentic}/usage.test.ts (94%) diff --git a/.fern/metadata.json b/.fern/metadata.json index ca510516..5f4bdae2 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "2d0f96ea6c9cae547e46b779d70a73ff3bfeee01", + "originGitCommit": "616e546fb2e837ad6be9e9fb0a90e8cdc594c6ec", "sdkVersion": "0.0.0-dev" } diff --git a/src/Client.ts b/src/Client.ts index 2098b736..0b8928d0 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,5 +1,6 @@ // This file was auto-generated by Fern from our API Definition. +import { AgenticClient } from "./api/resources/agentic/client/Client.js"; import { AgentsClient } from "./api/resources/agents/client/Client.js"; import { AuthClient } from "./api/resources/auth/client/Client.js"; import { CodesClient } from "./api/resources/codes/client/Client.js"; @@ -33,6 +34,7 @@ export class CortiClient { protected _codes: CodesClient | undefined; protected _languages: LanguagesClient | undefined; protected _agents: AgentsClient | undefined; + protected _agentic: AgenticClient | undefined; protected _stream: StreamClient | undefined; protected _transcribe: TranscribeClient | undefined; @@ -80,6 +82,10 @@ export class CortiClient { return (this._agents ??= new AgentsClient(this._options)); } + public get agentic(): AgenticClient { + return (this._agentic ??= new AgenticClient(this._options)); + } + public get stream(): StreamClient { return (this._stream ??= new StreamClient(this._options)); } diff --git a/src/api/resources/agentic/client/Client.ts b/src/api/resources/agentic/client/Client.ts new file mode 100644 index 00000000..aca3a420 --- /dev/null +++ b/src/api/resources/agentic/client/Client.ts @@ -0,0 +1,661 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as Corti from "../../../index.js"; +import { A2AClient } from "../resources/a2A/client/Client.js"; +import { ArtifactsClient } from "../resources/artifacts/client/Client.js"; +import { ConnectorsClient } from "../resources/connectors/client/Client.js"; +import { ContextsClient } from "../resources/contexts/client/Client.js"; +import { FeedbackClient } from "../resources/feedback/client/Client.js"; +import { RegistryClient } from "../resources/registry/client/Client.js"; +import { UsageClient } from "../resources/usage/client/Client.js"; + +export declare namespace AgenticClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class AgenticClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + protected _a2A: A2AClient | undefined; + protected _usage: UsageClient | undefined; + protected _connectors: ConnectorsClient | undefined; + protected _contexts: ContextsClient | undefined; + protected _artifacts: ArtifactsClient | undefined; + protected _registry: RegistryClient | undefined; + protected _feedback: FeedbackClient | undefined; + + constructor(options: AgenticClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + public get a2A(): A2AClient { + return (this._a2A ??= new A2AClient(this._options)); + } + + public get usage(): UsageClient { + return (this._usage ??= new UsageClient(this._options)); + } + + public get connectors(): ConnectorsClient { + return (this._connectors ??= new ConnectorsClient(this._options)); + } + + public get contexts(): ContextsClient { + return (this._contexts ??= new ContextsClient(this._options)); + } + + public get artifacts(): ArtifactsClient { + return (this._artifacts ??= new ArtifactsClient(this._options)); + } + + public get registry(): RegistryClient { + return (this._registry ??= new RegistryClient(this._options)); + } + + public get feedback(): FeedbackClient { + return (this._feedback ??= new FeedbackClient(this._options)); + } + + /** + * Lists agents visible to the caller. `private` agents are visible only to + * their creator/service principal; `unlisted` agents are omitted (fetch by + * ID instead); `public` agents are listed tenant-wide. + * The `visibility`, `lifecycle`, `label`, and `q` filter parameters are accepted but not yet honored by the server; the response is unfiltered. + * + * @param {Corti.ListAgenticRequest} request + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agentic.list({ + * label: ["team=coding"], + * q: "coder" + * }) + */ + public async list( + request: Corti.ListAgenticRequest = {}, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async (request: Corti.ListAgenticRequest): Promise> => { + const { pageSize, pageToken, visibility, lifecycle, label, q } = request; + const _queryParams: Record = { + pageSize, + pageToken, + visibility: Array.isArray(visibility) + ? visibility.map((item) => + serializers.AgentsVisibility.jsonOrThrow(item, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + ) + : visibility != null + ? serializers.AgentsVisibility.jsonOrThrow(visibility, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + lifecycle: + lifecycle != null + ? serializers.AgentsLifecycle.jsonOrThrow(lifecycle, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + label, + q, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/agents", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents"); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.agents ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, + }); + } + + /** + * Creates a new agent. The server assigns the UUIDv7 `id`. + * + * @param {Corti.AgentsCreateRequest} request + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.ConflictError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agentic.create({ + * name: "coder", + * description: "Returns ICD-10 codes for a clinical encounter.", + * systemPrompt: "Respond with only the ICD-10 code.", + * model: "corti-default", + * visibility: "private", + * lifecycle: "persistent", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }, { + * type: "mcp", + * name: "policybot", + * url: "https://mcp.example.com", + * auth: { + * type: "oauth2", + * scope: "read:policies", + * redirectUrl: "https://app.corti.ai/oauth/callback" + * } + * }, { + * type: "schema", + * name: "submit_code", + * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + * schema: { + * "type": "object", + * "properties": { + * "code": { + * "type": "string", + * "description": "The selected ICD-10 code." + * }, + * "confidence": { + * "type": "number", + * "minimum": 0, + * "maximum": 1 + * } + * }, + * "required": [ + * "code" + * ] + * }, + * transition: "complete" + * }], + * labels: { + * "team": "coding", + * "env": "prod" + * } + * }) + */ + public create( + request: Corti.AgentsCreateRequest, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + + private async __create( + request: Corti.AgentsCreateRequest, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/agents", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.AgentsCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 409: + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/agentic/agents"); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public get( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents/{agentId}"); + } + + /** + * Deletes a `persistent` agent. `ephemeral` agents are expired in place. + * Idempotent: deleting an already-deleted agent returns `204`. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public delete( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(agentId, requestOptions)); + } + + private async __delete( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/agents/{agentId}", + ); + } + + /** + * Partially updates an agent using JSON Merge Patch (RFC 7386). + * Omitted fields are unchanged; `null` clears a field; arrays replace. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.AgentsPatchRequest} request + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * name: "coder-v2", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }] + * }) + */ + public update( + agentId: Corti.CommonAgentIdValue, + request: Corti.AgentsPatchRequest = {}, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(agentId, request, requestOptions)); + } + + private async __update( + agentId: Corti.CommonAgentIdValue, + request: Corti.AgentsPatchRequest = {}, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/merge-patch+json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.AgentsPatchRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/v2/agentic/agents/{agentId}", + ); + } + + /** + * Returns the A2A v1.0 agent card describing the agent's capabilities, + * skills, and supported protocol interfaces. Served at the standard + * `.well-known` location for agent discovery. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public getCard( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCard(agentId, requestOptions)); + } + + private async __getCard( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/.well-known/agent-card.json`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentCardResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/.well-known/agent-card.json", + ); + } +} diff --git a/src/api/resources/agents/resources/a2A/client/index.ts b/src/api/resources/agentic/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/client/index.ts rename to src/api/resources/agentic/client/index.ts diff --git a/src/api/resources/agents/client/requests/AgentsCreateRequest.ts b/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts similarity index 100% rename from src/api/resources/agents/client/requests/AgentsCreateRequest.ts rename to src/api/resources/agentic/client/requests/AgentsCreateRequest.ts diff --git a/src/api/resources/agents/client/requests/AgentsPatchRequest.ts b/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts similarity index 100% rename from src/api/resources/agents/client/requests/AgentsPatchRequest.ts rename to src/api/resources/agentic/client/requests/AgentsPatchRequest.ts diff --git a/src/api/resources/agents/client/requests/ListAgentsRequest.ts b/src/api/resources/agentic/client/requests/ListAgenticRequest.ts similarity index 95% rename from src/api/resources/agents/client/requests/ListAgentsRequest.ts rename to src/api/resources/agentic/client/requests/ListAgenticRequest.ts index d11a9c83..5adb8943 100644 --- a/src/api/resources/agents/client/requests/ListAgentsRequest.ts +++ b/src/api/resources/agentic/client/requests/ListAgenticRequest.ts @@ -9,7 +9,7 @@ import type * as Corti from "../../../../index.js"; * q: "coder" * } */ -export interface ListAgentsRequest { +export interface ListAgenticRequest { /** Maximum number of items per page. */ pageSize?: number; /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ diff --git a/src/api/resources/agentic/client/requests/index.ts b/src/api/resources/agentic/client/requests/index.ts new file mode 100644 index 00000000..040d53cb --- /dev/null +++ b/src/api/resources/agentic/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { AgentsCreateRequest } from "./AgentsCreateRequest.js"; +export type { AgentsPatchRequest } from "./AgentsPatchRequest.js"; +export type { ListAgenticRequest } from "./ListAgenticRequest.js"; diff --git a/src/api/resources/agents/resources/contexts/index.ts b/src/api/resources/agentic/index.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/index.ts rename to src/api/resources/agentic/index.ts diff --git a/src/api/resources/agents/resources/a2A/client/Client.ts b/src/api/resources/agentic/resources/a2A/client/Client.ts similarity index 97% rename from src/api/resources/agents/resources/a2A/client/Client.ts rename to src/api/resources/agentic/resources/a2A/client/Client.ts index 112a1aac..04b6729a 100644 --- a/src/api/resources/agents/resources/a2A/client/Client.ts +++ b/src/api/resources/agentic/resources/a2A/client/Client.ts @@ -37,14 +37,14 @@ export class A2AClient { * `text/event-stream`; all others respond with a single JSON-RPC response. * * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agents.A2AjsonrpcRequest} request + * @param {Corti.agentic.A2AjsonrpcRequest} request * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { * id: "1", * method: "SendMessage", * params: { @@ -62,7 +62,7 @@ export class A2AClient { */ public jsonRpc( agentId: Corti.CommonAgentIdValue, - request: Corti.agents.A2AjsonrpcRequest, + request: Corti.agentic.A2AjsonrpcRequest, requestOptions?: A2AClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__jsonRpc(agentId, request, requestOptions)); @@ -70,7 +70,7 @@ export class A2AClient { private async __jsonRpc( agentId: Corti.CommonAgentIdValue, - request: Corti.agents.A2AjsonrpcRequest, + request: Corti.agentic.A2AjsonrpcRequest, requestOptions?: A2AClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -95,7 +95,7 @@ export class A2AClient { queryParameters: requestOptions?.queryParams, requestType: "json", body: { - ...serializers.agents.A2AjsonrpcRequest.jsonOrThrow(request, { + ...serializers.agentic.A2AjsonrpcRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -155,7 +155,7 @@ export class A2AClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { * message: { * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", * role: "ROLE_USER", diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/a2A/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/resources/tasks/client/index.ts rename to src/api/resources/agentic/resources/a2A/client/index.ts diff --git a/src/api/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts similarity index 88% rename from src/api/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts rename to src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts index 7f8b2619..2681a71b 100644 --- a/src/api/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts +++ b/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts @@ -21,9 +21,9 @@ import type * as Corti from "../../../../../../index.js"; * } */ export interface A2AjsonrpcRequest { - id: Corti.agents.A2AjsonrpcRequestId; + id: Corti.agentic.A2AjsonrpcRequestId; /** JSON-RPC method name (PascalCase on the wire). */ - method: Corti.agents.A2AjsonrpcRequestMethod; + method: Corti.agentic.A2AjsonrpcRequestMethod; /** JSON-RPC params object. */ params?: Record; } diff --git a/src/api/resources/agents/resources/a2A/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/client/requests/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/client/requests/index.ts rename to src/api/resources/agentic/resources/a2A/client/requests/index.ts diff --git a/src/api/resources/agents/resources/a2A/index.ts b/src/api/resources/agentic/resources/a2A/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/index.ts rename to src/api/resources/agentic/resources/a2A/index.ts diff --git a/src/api/resources/agents/resources/a2A/resources/index.ts b/src/api/resources/agentic/resources/a2A/resources/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/resources/index.ts rename to src/api/resources/agentic/resources/a2A/resources/index.ts diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts similarity index 95% rename from src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts rename to src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts index 1ac7bb74..0815c946 100644 --- a/src/api/resources/agents/resources/a2A/resources/tasks/client/Client.ts +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts @@ -27,22 +27,22 @@ export class TasksClient { /** * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agents.a2A.ListTasksRequest} request + * @param {Corti.agentic.a2A.ListTasksRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * * @example - * await client.agents.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + * await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") */ public async list( agentId: Corti.CommonAgentIdValue, - request: Corti.agents.a2A.ListTasksRequest = {}, + request: Corti.agentic.a2A.ListTasksRequest = {}, requestOptions?: TasksClient.RequestOptions, ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( - request: Corti.agents.a2A.ListTasksRequest, + request: Corti.agentic.a2A.ListTasksRequest, ): Promise> => { const { pageSize, pageToken, contextId } = request; const _queryParams: Record = { @@ -124,19 +124,19 @@ export class TasksClient { /** * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.agents.a2A.GetTasksRequest} request + * @param {Corti.agentic.a2A.GetTasksRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.a2A.tasks.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + * await client.agentic.a2A.tasks.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") */ public get( agentId: Corti.CommonAgentIdValue, taskId: Corti.CommonTaskIdValue, - request: Corti.agents.a2A.GetTasksRequest = {}, + request: Corti.agentic.a2A.GetTasksRequest = {}, requestOptions?: TasksClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(agentId, taskId, request, requestOptions)); @@ -145,7 +145,7 @@ export class TasksClient { private async __get( agentId: Corti.CommonAgentIdValue, taskId: Corti.CommonTaskIdValue, - request: Corti.agents.a2A.GetTasksRequest = {}, + request: Corti.agentic.a2A.GetTasksRequest = {}, requestOptions?: TasksClient.RequestOptions, ): Promise> { const { historyLength } = request; @@ -223,7 +223,7 @@ export class TasksClient { * @throws {@link Corti.ConflictError} * * @example - * await client.agents.a2A.tasks.cancel("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + * await client.agentic.a2A.tasks.cancel("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") */ public cancel( agentId: Corti.CommonAgentIdValue, @@ -307,7 +307,7 @@ export class TasksClient { * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.agents.a2A.tasks.subscribe("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + * await client.agentic.a2A.tasks.subscribe("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") */ public subscribe( agentId: Corti.CommonAgentIdValue, diff --git a/src/api/resources/agents/resources/contexts/client/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/client/index.ts rename to src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts rename to src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts rename to src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/resources/tasks/client/requests/index.ts rename to src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts diff --git a/src/api/resources/agents/resources/a2A/resources/tasks/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/resources/tasks/index.ts rename to src/api/resources/agentic/resources/a2A/resources/tasks/index.ts diff --git a/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts rename to src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts diff --git a/src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts rename to src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts diff --git a/src/api/resources/agents/resources/a2A/types/index.ts b/src/api/resources/agentic/resources/a2A/types/index.ts similarity index 100% rename from src/api/resources/agents/resources/a2A/types/index.ts rename to src/api/resources/agentic/resources/a2A/types/index.ts diff --git a/src/api/resources/agents/resources/artifacts/client/Client.ts b/src/api/resources/agentic/resources/artifacts/client/Client.ts similarity index 96% rename from src/api/resources/agents/resources/artifacts/client/Client.ts rename to src/api/resources/agentic/resources/artifacts/client/Client.ts index aab9a226..dcd57c7f 100644 --- a/src/api/resources/agents/resources/artifacts/client/Client.ts +++ b/src/api/resources/agentic/resources/artifacts/client/Client.ts @@ -36,7 +36,7 @@ export class ArtifactsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.artifacts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84") + * await client.agentic.artifacts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84") */ public get( contextId: Corti.CommonContextIdValue, diff --git a/src/api/resources/agents/resources/artifacts/client/index.ts b/src/api/resources/agentic/resources/artifacts/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/artifacts/client/index.ts rename to src/api/resources/agentic/resources/artifacts/client/index.ts diff --git a/src/api/resources/agents/resources/artifacts/index.ts b/src/api/resources/agentic/resources/artifacts/index.ts similarity index 100% rename from src/api/resources/agents/resources/artifacts/index.ts rename to src/api/resources/agentic/resources/artifacts/index.ts diff --git a/src/api/resources/agents/resources/connectors/client/Client.ts b/src/api/resources/agentic/resources/connectors/client/Client.ts similarity index 97% rename from src/api/resources/agents/resources/connectors/client/Client.ts rename to src/api/resources/agentic/resources/connectors/client/Client.ts index f03d43b4..4fd39ace 100644 --- a/src/api/resources/agents/resources/connectors/client/Client.ts +++ b/src/api/resources/agentic/resources/connectors/client/Client.ts @@ -30,7 +30,7 @@ export class ConnectorsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + * await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") */ public list( agentId: Corti.CommonAgentIdValue, @@ -112,7 +112,7 @@ export class ConnectorsClient { * @throws {@link Corti.ConflictError} * * @example - * await client.agents.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { * type: "registry", * name: "@dedalus/coding-expert" * }) @@ -207,7 +207,7 @@ export class ConnectorsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.connectors.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") + * await client.agentic.connectors.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") */ public get( agentId: Corti.CommonAgentIdValue, @@ -289,7 +289,7 @@ export class ConnectorsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.connectors.remove("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") + * await client.agentic.connectors.remove("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") */ public remove( agentId: Corti.CommonAgentIdValue, diff --git a/src/api/resources/agents/resources/connectors/client/index.ts b/src/api/resources/agentic/resources/connectors/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/connectors/client/index.ts rename to src/api/resources/agentic/resources/connectors/client/index.ts diff --git a/src/api/resources/agents/resources/connectors/index.ts b/src/api/resources/agentic/resources/connectors/index.ts similarity index 100% rename from src/api/resources/agents/resources/connectors/index.ts rename to src/api/resources/agentic/resources/connectors/index.ts diff --git a/src/api/resources/agents/resources/contexts/client/Client.ts b/src/api/resources/agentic/resources/contexts/client/Client.ts similarity index 95% rename from src/api/resources/agents/resources/contexts/client/Client.ts rename to src/api/resources/agentic/resources/contexts/client/Client.ts index d4ff15f2..22fc9d3e 100644 --- a/src/api/resources/agents/resources/contexts/client/Client.ts +++ b/src/api/resources/agentic/resources/contexts/client/Client.ts @@ -35,18 +35,18 @@ export class ContextsClient { * separate top-level message list). * * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agents.GetContextsRequest} request + * @param {Corti.agentic.GetContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + * await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") */ public get( contextId: Corti.CommonContextIdValue, - request: Corti.agents.GetContextsRequest = {}, + request: Corti.agentic.GetContextsRequest = {}, requestOptions?: ContextsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(contextId, request, requestOptions)); @@ -54,7 +54,7 @@ export class ContextsClient { private async __get( contextId: Corti.CommonContextIdValue, - request: Corti.agents.GetContextsRequest = {}, + request: Corti.agentic.GetContextsRequest = {}, requestOptions?: ContextsClient.RequestOptions, ): Promise> { const { historyLength } = request; @@ -127,7 +127,7 @@ export class ContextsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + * await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") */ public delete( contextId: Corti.CommonContextIdValue, @@ -196,7 +196,7 @@ export class ContextsClient { * traces with their spans inlined. * * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agents.GetTraceContextsRequest} request + * @param {Corti.agentic.GetTraceContextsRequest} request * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -204,16 +204,16 @@ export class ContextsClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + * await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") */ public async getTrace( contextId: Corti.CommonContextIdValue, - request: Corti.agents.GetTraceContextsRequest = {}, + request: Corti.agentic.GetTraceContextsRequest = {}, requestOptions?: ContextsClient.RequestOptions, ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( - request: Corti.agents.GetTraceContextsRequest, + request: Corti.agentic.GetTraceContextsRequest, ): Promise> => { const { pageSize, pageToken } = request; const _queryParams: Record = { diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/contexts/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/resources/tasks/client/index.ts rename to src/api/resources/agentic/resources/contexts/client/index.ts diff --git a/src/api/resources/agents/resources/contexts/client/requests/GetContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/client/requests/GetContextsRequest.ts rename to src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts diff --git a/src/api/resources/agents/resources/contexts/client/requests/GetTraceContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/client/requests/GetTraceContextsRequest.ts rename to src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts diff --git a/src/api/resources/agents/resources/contexts/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/client/requests/index.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/client/requests/index.ts rename to src/api/resources/agentic/resources/contexts/client/requests/index.ts diff --git a/src/api/resources/agentic/resources/contexts/index.ts b/src/api/resources/agentic/resources/contexts/index.ts new file mode 100644 index 00000000..9eb1192d --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/api/resources/agents/resources/contexts/resources/index.ts b/src/api/resources/agentic/resources/contexts/resources/index.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/resources/index.ts rename to src/api/resources/agentic/resources/contexts/resources/index.ts diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts similarity index 95% rename from src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts rename to src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts index 9d4f8ae9..16e40169 100644 --- a/src/api/resources/agents/resources/contexts/resources/tasks/client/Client.ts +++ b/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts @@ -27,23 +27,23 @@ export class TasksClient { /** * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agents.contexts.ListTasksRequest} request + * @param {Corti.agentic.contexts.ListTasksRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + * await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") */ public async list( contextId: Corti.CommonContextIdValue, - request: Corti.agents.contexts.ListTasksRequest = {}, + request: Corti.agentic.contexts.ListTasksRequest = {}, requestOptions?: TasksClient.RequestOptions, ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( - request: Corti.agents.contexts.ListTasksRequest, + request: Corti.agentic.contexts.ListTasksRequest, ): Promise> => { const { pageSize, pageToken } = request; const _queryParams: Record = { @@ -129,7 +129,7 @@ export class TasksClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.contexts.tasks.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + * await client.agentic.contexts.tasks.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") */ public get( contextId: Corti.CommonContextIdValue, diff --git a/src/api/resources/agents/resources/feedback/client/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/feedback/client/index.ts rename to src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts rename to src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/resources/tasks/client/requests/index.ts rename to src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts diff --git a/src/api/resources/agents/resources/contexts/resources/tasks/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts similarity index 100% rename from src/api/resources/agents/resources/contexts/resources/tasks/index.ts rename to src/api/resources/agentic/resources/contexts/resources/tasks/index.ts diff --git a/src/api/resources/agents/resources/feedback/client/Client.ts b/src/api/resources/agentic/resources/feedback/client/Client.ts similarity index 94% rename from src/api/resources/agents/resources/feedback/client/Client.ts rename to src/api/resources/agentic/resources/feedback/client/Client.ts index 1f451a41..743b4ca8 100644 --- a/src/api/resources/agents/resources/feedback/client/Client.ts +++ b/src/api/resources/agentic/resources/feedback/client/Client.ts @@ -33,7 +33,7 @@ export class FeedbackClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.feedback.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + * await client.agentic.feedback.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") */ public list( contextId: Corti.CommonContextIdValue, @@ -114,7 +114,7 @@ export class FeedbackClient { * * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.agents.FeedbackCreateRequest} request + * @param {Corti.agentic.FeedbackCreateRequest} request * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -123,7 +123,7 @@ export class FeedbackClient { * @throws {@link Corti.UnprocessableEntityError} * * @example - * await client.agents.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { + * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { * rating: { * scale: "binary", * value: 1 @@ -131,7 +131,7 @@ export class FeedbackClient { * }) * * @example - * await client.agents.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { + * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { * rating: { * scale: "binary", * value: 0 @@ -153,7 +153,7 @@ export class FeedbackClient { public create( contextId: Corti.CommonContextIdValue, taskId: Corti.CommonTaskIdValue, - request: Corti.agents.FeedbackCreateRequest, + request: Corti.agentic.FeedbackCreateRequest, requestOptions?: FeedbackClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(contextId, taskId, request, requestOptions)); @@ -162,7 +162,7 @@ export class FeedbackClient { private async __create( contextId: Corti.CommonContextIdValue, taskId: Corti.CommonTaskIdValue, - request: Corti.agents.FeedbackCreateRequest, + request: Corti.agentic.FeedbackCreateRequest, requestOptions?: FeedbackClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -183,7 +183,7 @@ export class FeedbackClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.agents.FeedbackCreateRequest.jsonOrThrow(request, { + body: serializers.agentic.FeedbackCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -244,7 +244,7 @@ export class FeedbackClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.feedback.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + * await client.agentic.feedback.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") */ public delete( contextId: Corti.CommonContextIdValue, diff --git a/src/api/resources/agents/resources/registry/client/index.ts b/src/api/resources/agentic/resources/feedback/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/registry/client/index.ts rename to src/api/resources/agentic/resources/feedback/client/index.ts diff --git a/src/api/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts similarity index 100% rename from src/api/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts rename to src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts diff --git a/src/api/resources/agents/resources/feedback/client/requests/index.ts b/src/api/resources/agentic/resources/feedback/client/requests/index.ts similarity index 100% rename from src/api/resources/agents/resources/feedback/client/requests/index.ts rename to src/api/resources/agentic/resources/feedback/client/requests/index.ts diff --git a/src/api/resources/agents/resources/feedback/index.ts b/src/api/resources/agentic/resources/feedback/index.ts similarity index 100% rename from src/api/resources/agents/resources/feedback/index.ts rename to src/api/resources/agentic/resources/feedback/index.ts diff --git a/src/api/resources/agents/resources/index.ts b/src/api/resources/agentic/resources/index.ts similarity index 100% rename from src/api/resources/agents/resources/index.ts rename to src/api/resources/agentic/resources/index.ts diff --git a/src/api/resources/agents/resources/registry/client/Client.ts b/src/api/resources/agentic/resources/registry/client/Client.ts similarity index 96% rename from src/api/resources/agents/resources/registry/client/Client.ts rename to src/api/resources/agentic/resources/registry/client/Client.ts index e743a94c..01250274 100644 --- a/src/api/resources/agents/resources/registry/client/Client.ts +++ b/src/api/resources/agentic/resources/registry/client/Client.ts @@ -23,21 +23,21 @@ export class RegistryClient { } /** - * @param {Corti.agents.ListRegistryRequest} request + * @param {Corti.agentic.ListRegistryRequest} request * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.UnauthorizedError} * * @example - * await client.agents.registry.list() + * await client.agentic.registry.list() */ public async list( - request: Corti.agents.ListRegistryRequest = {}, + request: Corti.agentic.ListRegistryRequest = {}, requestOptions?: RegistryClient.RequestOptions, ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( - request: Corti.agents.ListRegistryRequest, + request: Corti.agentic.ListRegistryRequest, ): Promise> => { const { q, pageSize, pageToken } = request; const _queryParams: Record = { @@ -121,7 +121,7 @@ export class RegistryClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.registry.get("connectorId") + * await client.agentic.registry.get("connectorId") */ public get( connectorId: string, diff --git a/src/api/resources/agents/resources/usage/client/index.ts b/src/api/resources/agentic/resources/registry/client/index.ts similarity index 100% rename from src/api/resources/agents/resources/usage/client/index.ts rename to src/api/resources/agentic/resources/registry/client/index.ts diff --git a/src/api/resources/agents/resources/registry/client/requests/ListRegistryRequest.ts b/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts similarity index 100% rename from src/api/resources/agents/resources/registry/client/requests/ListRegistryRequest.ts rename to src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts diff --git a/src/api/resources/agents/resources/registry/client/requests/index.ts b/src/api/resources/agentic/resources/registry/client/requests/index.ts similarity index 100% rename from src/api/resources/agents/resources/registry/client/requests/index.ts rename to src/api/resources/agentic/resources/registry/client/requests/index.ts diff --git a/src/api/resources/agents/resources/registry/index.ts b/src/api/resources/agentic/resources/registry/index.ts similarity index 100% rename from src/api/resources/agents/resources/registry/index.ts rename to src/api/resources/agentic/resources/registry/index.ts diff --git a/src/api/resources/agents/resources/usage/client/Client.ts b/src/api/resources/agentic/resources/usage/client/Client.ts similarity index 95% rename from src/api/resources/agents/resources/usage/client/Client.ts rename to src/api/resources/agentic/resources/usage/client/Client.ts index b00118f2..4d54539e 100644 --- a/src/api/resources/agents/resources/usage/client/Client.ts +++ b/src/api/resources/agentic/resources/usage/client/Client.ts @@ -31,7 +31,7 @@ export class UsageClient { * range defaults to the last 30 days. * * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agents.GetUsageRequest} request + * @param {Corti.agentic.GetUsageRequest} request * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -39,14 +39,14 @@ export class UsageClient { * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { * from: new Date("2026-05-19T00:00:00.000Z"), * to: new Date("2026-05-20T00:00:00.000Z") * }) */ public get( agentId: Corti.CommonAgentIdValue, - request: Corti.agents.GetUsageRequest = {}, + request: Corti.agentic.GetUsageRequest = {}, requestOptions?: UsageClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(agentId, request, requestOptions)); @@ -54,7 +54,7 @@ export class UsageClient { private async __get( agentId: Corti.CommonAgentIdValue, - request: Corti.agents.GetUsageRequest = {}, + request: Corti.agentic.GetUsageRequest = {}, requestOptions?: UsageClient.RequestOptions, ): Promise> { const { from: from_, to, granularity } = request; diff --git a/src/serialization/resources/agents/resources/a2A/client/index.ts b/src/api/resources/agentic/resources/usage/client/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/a2A/client/index.ts rename to src/api/resources/agentic/resources/usage/client/index.ts diff --git a/src/api/resources/agents/resources/usage/client/requests/GetUsageRequest.ts b/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts similarity index 100% rename from src/api/resources/agents/resources/usage/client/requests/GetUsageRequest.ts rename to src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts diff --git a/src/api/resources/agents/resources/usage/client/requests/index.ts b/src/api/resources/agentic/resources/usage/client/requests/index.ts similarity index 100% rename from src/api/resources/agents/resources/usage/client/requests/index.ts rename to src/api/resources/agentic/resources/usage/client/requests/index.ts diff --git a/src/api/resources/agents/resources/usage/index.ts b/src/api/resources/agentic/resources/usage/index.ts similarity index 100% rename from src/api/resources/agents/resources/usage/index.ts rename to src/api/resources/agentic/resources/usage/index.ts diff --git a/src/api/resources/agents/client/Client.ts b/src/api/resources/agents/client/Client.ts index 34cb3517..9fe90217 100644 --- a/src/api/resources/agents/client/Client.ts +++ b/src/api/resources/agents/client/Client.ts @@ -8,13 +8,6 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; import * as Corti from "../../../index.js"; -import { A2AClient } from "../resources/a2A/client/Client.js"; -import { ArtifactsClient } from "../resources/artifacts/client/Client.js"; -import { ConnectorsClient } from "../resources/connectors/client/Client.js"; -import { ContextsClient } from "../resources/contexts/client/Client.js"; -import { FeedbackClient } from "../resources/feedback/client/Client.js"; -import { RegistryClient } from "../resources/registry/client/Client.js"; -import { UsageClient } from "../resources/usage/client/Client.js"; export declare namespace AgentsClient { export type Options = BaseClientOptions; @@ -27,234 +20,128 @@ export declare namespace AgentsClient { */ export class AgentsClient { protected readonly _options: NormalizedClientOptionsWithAuth; - protected _a2A: A2AClient | undefined; - protected _usage: UsageClient | undefined; - protected _connectors: ConnectorsClient | undefined; - protected _contexts: ContextsClient | undefined; - protected _artifacts: ArtifactsClient | undefined; - protected _registry: RegistryClient | undefined; - protected _feedback: FeedbackClient | undefined; constructor(options: AgentsClient.Options) { this._options = normalizeClientOptionsWithAuth(options); } - public get a2A(): A2AClient { - return (this._a2A ??= new A2AClient(this._options)); - } - - public get usage(): UsageClient { - return (this._usage ??= new UsageClient(this._options)); - } - - public get connectors(): ConnectorsClient { - return (this._connectors ??= new ConnectorsClient(this._options)); - } - - public get contexts(): ContextsClient { - return (this._contexts ??= new ContextsClient(this._options)); - } - - public get artifacts(): ArtifactsClient { - return (this._artifacts ??= new ArtifactsClient(this._options)); - } - - public get registry(): RegistryClient { - return (this._registry ??= new RegistryClient(this._options)); - } - - public get feedback(): FeedbackClient { - return (this._feedback ??= new FeedbackClient(this._options)); - } - /** - * Lists agents visible to the caller. `private` agents are visible only to - * their creator/service principal; `unlisted` agents are omitted (fetch by - * ID instead); `public` agents are listed tenant-wide. - * The `visibility`, `lifecycle`, `label`, and `q` filter parameters are accepted but not yet honored by the server; the response is unfiltered. + * @deprecated + * + * This endpoint retrieves a list of all agents that can be called by the Corti Agent Framework. * - * @param {Corti.ListAgentsRequest} request + * @param {Corti.AgentsListRequest} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} * * @example - * await client.agents.list({ - * label: ["team=coding"], - * q: "coder" - * }) + * await client.agents.list() */ - public async list( - request: Corti.ListAgentsRequest = {}, + public list( + request: Corti.AgentsListRequest = {}, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async (request: Corti.ListAgentsRequest): Promise> => { - const { pageSize, pageToken, visibility, lifecycle, label, q } = request; - const _queryParams: Record = { - pageSize, - pageToken, - visibility: Array.isArray(visibility) - ? visibility.map((item) => - serializers.AgentsVisibility.jsonOrThrow(item, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - ) - : visibility != null - ? serializers.AgentsVisibility.jsonOrThrow(visibility, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - lifecycle: - lifecycle != null - ? serializers.AgentsLifecycle.jsonOrThrow(lifecycle, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - label, - q, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/agents", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents"); - }, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + + private async __list( + request: Corti.AgentsListRequest = {}, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const { limit, offset, ephemeral } = request; + const _queryParams: Record = { + limit, + offset, + ephemeral, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.nextPageToken != null && - !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: (response) => response?.agents ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); - }, + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "agents", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); + if (_response.ok) { + return { + data: serializers.agents.list.Response.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents"); } /** - * Creates a new agent. The server assigns the UUIDv7 `id`. + * @deprecated * - * @param {Corti.AgentsCreateRequest} request + * This endpoint allows the creation of a new agent that can be utilized in the `POST /agents/{id}/v1/message:send` endpoint. + * + * @param {Corti.AgentsCreateAgent} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.ConflictError} * @throws {@link Corti.UnprocessableEntityError} * * @example * await client.agents.create({ - * name: "coder", - * description: "Returns ICD-10 codes for a clinical encounter.", - * systemPrompt: "Respond with only the ICD-10 code.", - * model: "corti-default", - * visibility: "private", - * lifecycle: "persistent", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }, { - * type: "mcp", - * name: "policybot", - * url: "https://mcp.example.com", - * auth: { - * type: "oauth2", - * scope: "read:policies", - * redirectUrl: "https://app.corti.ai/oauth/callback" - * } - * }, { - * type: "schema", - * name: "submit_code", - * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - * schema: { - * "type": "object", - * "properties": { - * "code": { - * "type": "string", - * "description": "The selected ICD-10 code." - * }, - * "confidence": { - * "type": "number", - * "minimum": 0, - * "maximum": 1 - * } - * }, - * "required": [ - * "code" - * ] - * }, - * transition: "complete" - * }], - * labels: { - * "team": "coding", - * "env": "prod" - * } + * name: "name", + * description: "description" * }) */ public create( - request: Corti.AgentsCreateRequest, + request: Corti.AgentsCreateAgent, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( - request: Corti.AgentsCreateRequest, + request: Corti.AgentsCreateAgent, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { + ): Promise> { + const { ephemeral, ..._body } = request; + const _queryParams: Record = { + ephemeral, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -266,14 +153,14 @@ export class AgentsClient { url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/agents", + "agents", ), method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", - body: serializers.AgentsCreateRequest.jsonOrThrow(request, { + body: serializers.AgentsCreateAgent.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -285,7 +172,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { + data: serializers.AgentsAgent.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -302,10 +189,6 @@ export class AgentsClient { throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 409: - throw new Corti.ConflictError(_response.error.body, _response.rawResponse); case 422: throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); default: @@ -317,31 +200,35 @@ export class AgentsClient { } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/agentic/agents"); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/agents"); } /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @deprecated + * + * This endpoint retrieves an agent by its identifier. The agent contains information about its capabilities and the experts it can call. + * + * @param {string} id - The identifier of the agent associated with the context. * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + * await client.agents.get("12345678-90ab-cdef-gh12-34567890abc") */ public get( - agentId: Corti.CommonAgentIdValue, + id: string, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } private async __get( - agentId: Corti.CommonAgentIdValue, + id: string, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -353,7 +240,7 @@ export class AgentsClient { url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + `agents/${core.url.encodePathParam(id)}`, ), method: "GET", headers: _headers, @@ -366,7 +253,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { + data: serializers.AgentsAgentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -379,10 +266,10 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); case 404: throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); default: @@ -394,32 +281,30 @@ export class AgentsClient { } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents/{agentId}"); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents/{id}"); } /** - * Deletes a `persistent` agent. `ephemeral` agents are expired in place. - * Idempotent: deleting an already-deleted agent returns `204`. + * @deprecated * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * This endpoint deletes an agent by its identifier. Once deleted, the agent can no longer be used in threads. + * + * @param {string} id - The identifier of the agent associated with the context. * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + * await client.agents.delete("12345678-90ab-cdef-gh12-34567890abc") */ - public delete( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(agentId, requestOptions)); + public delete(id: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } private async __delete( - agentId: Corti.CommonAgentIdValue, + id: string, requestOptions?: AgentsClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -433,7 +318,7 @@ export class AgentsClient { url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + `agents/${core.url.encodePathParam(id)}`, ), method: "DELETE", headers: _headers, @@ -450,10 +335,10 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); case 404: throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); default: @@ -465,50 +350,39 @@ export class AgentsClient { } } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/agents/{agentId}", - ); + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/agents/{id}"); } /** - * Partially updates an agent using JSON Merge Patch (RFC 7386). - * Omitted fields are unchanged; `null` clears a field; arrays replace. + * @deprecated * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.AgentsPatchRequest} request + * This endpoint updates an existing agent. Only the fields provided in the request body will be updated; other fields will remain unchanged. + * + * @param {string} id - The identifier of the agent associated with the context. + * @param {Corti.AgentsUpdateAgent} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} * @throws {@link Corti.NotFoundError} * @throws {@link Corti.UnprocessableEntityError} * * @example - * await client.agents.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * name: "coder-v2", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }] - * }) + * await client.agents.update("12345678-90ab-cdef-gh12-34567890abc") */ public update( - agentId: Corti.CommonAgentIdValue, - request: Corti.AgentsPatchRequest = {}, + id: string, + request: Corti.AgentsUpdateAgent = {}, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(agentId, request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions)); } private async __update( - agentId: Corti.CommonAgentIdValue, - request: Corti.AgentsPatchRequest = {}, + id: string, + request: Corti.AgentsUpdateAgent = {}, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -520,14 +394,199 @@ export class AgentsClient { url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + `agents/${core.url.encodePathParam(id)}`, ), method: "PATCH", headers: _headers, - contentType: "application/merge-patch+json", + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.AgentsUpdateAgent.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsAgent.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/agents/{id}"); + } + + /** + * @deprecated + * + * This endpoint retrieves the agent card in JSON format, which provides metadata about the agent, including its name, description, and the experts it can call. + * + * @param {string} id - The identifier of the agent associated with the context. + * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.getCard("12345678-90ab-cdef-gh12-34567890abc") + */ + public getCard( + id: string, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCard(id, requestOptions)); + } + + private async __getCard( + id: string, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `agents/${core.url.encodePathParam(id)}/agent-card.json`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsAgentCard.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents/{id}/agent-card.json"); + } + + /** + * @deprecated + * + * This endpoint sends a message to the specified agent to start or continue a task. The agent processes the message and returns a response. If the message contains a task ID that matches an ongoing task, the agent will continue that task; otherwise, it will start a new task. + * + * @param {string} id - The identifier of the agent associated with the context. + * @param {Corti.AgentsMessageSendBody} request + * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", { + * message: { + * role: "user", + * parts: [{ + * kind: "text", + * text: "text" + * }], + * messageId: "messageId", + * kind: "message" + * } + * }) + */ + public messageSend( + id: string, + request: Corti.AgentsMessageSendBody, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__messageSend(id, request, requestOptions)); + } + + private async __messageSend( + id: string, + request: Corti.AgentsMessageSendBody, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `agents/${core.url.encodePathParam(id)}/v1/message:send`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.AgentsPatchRequest.jsonOrThrow(request, { + body: serializers.AgentsMessageSendBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -539,7 +598,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { + data: serializers.AgentsMessageSendResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -571,39 +630,145 @@ export class AgentsClient { } } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/agents/{id}/v1/message:send"); + } + + /** + * @deprecated + * + * This endpoint retrieves the status and details of a specific task associated with the given agent. It provides information about the task's current state, history, and any artifacts produced during its execution. + * + * @param {string} id - The identifier of the agent associated with the context. + * @param {string} taskId - The identifier of the task to retrieve. + * @param {Corti.AgentsGetTaskRequest} request + * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.getTask("12345678-90ab-cdef-gh12-34567890abc", "taskId") + */ + public getTask( + id: string, + taskId: string, + request: Corti.AgentsGetTaskRequest = {}, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTask(id, taskId, request, requestOptions)); + } + + private async __getTask( + id: string, + taskId: string, + request: Corti.AgentsGetTaskRequest = {}, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const { historyLength } = request; + const _queryParams: Record = { + historyLength, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `agents/${core.url.encodePathParam(id)}/v1/tasks/${core.url.encodePathParam(taskId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsTask.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( _response.error, _response.rawResponse, - "PATCH", - "/v2/agentic/agents/{agentId}", + "GET", + "/agents/{id}/v1/tasks/{taskId}", ); } /** - * Returns the A2A v1.0 agent card describing the agent's capabilities, - * skills, and supported protocol interfaces. Served at the standard - * `.well-known` location for agent discovery. + * @deprecated + * + * This endpoint retrieves all tasks and top-level messages associated with a specific context for the given agent. * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {string} id - The identifier of the agent associated with the context. + * @param {string} contextId - The identifier of the context (thread) to retrieve tasks for. + * @param {Corti.AgentsGetContextRequest} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Corti.BadRequestError} * @throws {@link Corti.UnauthorizedError} * @throws {@link Corti.NotFoundError} * * @example - * await client.agents.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + * await client.agents.getContext("12345678-90ab-cdef-gh12-34567890abc", "contextId") */ - public getCard( - agentId: Corti.CommonAgentIdValue, + public getContext( + id: string, + contextId: string, + request: Corti.AgentsGetContextRequest = {}, requestOptions?: AgentsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getCard(agentId, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getContext(id, contextId, request, requestOptions)); } - private async __getCard( - agentId: Corti.CommonAgentIdValue, + private async __getContext( + id: string, + contextId: string, + request: Corti.AgentsGetContextRequest = {}, requestOptions?: AgentsClient.RequestOptions, - ): Promise> { + ): Promise> { + const { limit, offset } = request; + const _queryParams: Record = { + limit, + offset, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -615,11 +780,11 @@ export class AgentsClient { url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/.well-known/agent-card.json`, + `agents/${core.url.encodePathParam(id)}/v1/contexts/${core.url.encodePathParam(contextId)}`, ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -628,7 +793,7 @@ export class AgentsClient { }); if (_response.ok) { return { - data: serializers.AgentCardResponse.parseOrThrow(_response.body, { + data: serializers.AgentsContext.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -641,6 +806,8 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); case 401: throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); case 404: @@ -658,7 +825,176 @@ export class AgentsClient { _response.error, _response.rawResponse, "GET", - "/v2/agentic/agents/{agentId}/.well-known/agent-card.json", + "/agents/{id}/v1/contexts/{contextId}", ); } + + /** + * @deprecated + * + * This endpoint deletes a context (thread) and scrubs all associated data including messages, memories, and memory chunks for the given agent. Thread and task metadata is soft-deleted for audit purposes, while content columns are irreversibly overwritten. + * + * @param {string} id - The identifier of the agent associated with the context. + * @param {string} contextId - The identifier of the context (thread) to delete. + * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agents.deleteContext("12345678-90ab-cdef-gh12-34567890abc", "contextId") + */ + public deleteContext( + id: string, + contextId: string, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteContext(id, contextId, requestOptions)); + } + + private async __deleteContext( + id: string, + contextId: string, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `agents/${core.url.encodePathParam(id)}/v1/contexts/${core.url.encodePathParam(contextId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/agents/{id}/v1/contexts/{contextId}", + ); + } + + /** + * @deprecated + * + * This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema. + * + * @param {Corti.AgentsGetRegistryExpertsRequest} request + * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agents.getRegistryExperts({ + * limit: 100, + * offset: 0 + * }) + */ + public getRegistryExperts( + request: Corti.AgentsGetRegistryExpertsRequest = {}, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getRegistryExperts(request, requestOptions)); + } + + private async __getRegistryExperts( + request: Corti.AgentsGetRegistryExpertsRequest = {}, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const { limit, offset } = request; + const _queryParams: Record = { + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "agents/registry/experts", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsRegistryExpertsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents/registry/experts"); + } } diff --git a/src/api/resources/agents/client/requests/AgentsCreateAgent.ts b/src/api/resources/agents/client/requests/AgentsCreateAgent.ts new file mode 100644 index 00000000..ab4a1e7e --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsCreateAgent.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * name: "name", + * description: "description" + * } + */ +export interface AgentsCreateAgent { + /** If set to true, the agent will be created as ephemeral, it won't be listed in the agents_list but can still be fetched by ID. Ephemeral agents will be deleted periodically. */ + ephemeral?: boolean; + /** The name of the agent. */ + name: string; + /** Optional type of agent. */ + agentType?: Corti.AgentsCreateAgentAgentType; + /** The system prompt that defines the overall agents behavior and expectations. This field is optional as there is a default system orchestrator. */ + systemPrompt?: string; + /** A brief description of the agent's capabilities. */ + description: string; + experts?: Corti.AgentsCreateAgentExpertsItem[]; + /** A list of MCP servers that the agent can call. If omitted, the agent can't call any MCP servers. */ + mcpServers?: Corti.AgentsCreateMcpServer[]; +} diff --git a/src/api/resources/agents/client/requests/AgentsGetContextRequest.ts b/src/api/resources/agents/client/requests/AgentsGetContextRequest.ts new file mode 100644 index 00000000..aa60df6e --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsGetContextRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface AgentsGetContextRequest { + /** The maximum number of tasks and messages to return. If not specified all history is returned. */ + limit?: number; + /** The number of tasks and messages to skip before starting to collect the result set. Default is 0. */ + offset?: number; +} diff --git a/src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts b/src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts new file mode 100644 index 00000000..8fcaf74f --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsGetRegistryExpertsRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * limit: 100, + * offset: 0 + * } + */ +export interface AgentsGetRegistryExpertsRequest { + /** The maximum number of items to return. If not specified, a default number of items will be returned. */ + limit?: number; + /** The number of items to skip before starting to collect the result set. Default is 0. */ + offset?: number; +} diff --git a/src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts b/src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts new file mode 100644 index 00000000..0d3dee98 --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsGetTaskRequest.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface AgentsGetTaskRequest { + /** The number of previous messages to include in the context for the agent when retrieving this task. Default is all messages. */ + historyLength?: number; +} diff --git a/src/api/resources/agents/client/requests/AgentsListRequest.ts b/src/api/resources/agents/client/requests/AgentsListRequest.ts new file mode 100644 index 00000000..efafb427 --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsListRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface AgentsListRequest { + /** The maximum number of agents to return. If not specified, all agents will be returned. */ + limit?: number; + /** The number of agents to skip before starting to collect the result set. Default is 0. */ + offset?: number; + /** If set to true, ephemeral agents will be included in the response. Default is false. */ + ephemeral?: boolean; +} diff --git a/src/api/resources/agents/client/requests/AgentsMessageSendBody.ts b/src/api/resources/agents/client/requests/AgentsMessageSendBody.ts new file mode 100644 index 00000000..922b0bda --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsMessageSendBody.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * message: { + * role: "user", + * parts: [{ + * kind: "text", + * text: "text" + * }], + * messageId: "messageId", + * kind: "message" + * } + * } + */ +export interface AgentsMessageSendBody { + message: Corti.AgentsMessage; + configuration?: Corti.AgentsMessageSendConfiguration; + /** Optional metadata that will be associated with the message. */ + metadata?: Record; +} diff --git a/src/api/resources/agents/client/requests/AgentsUpdateAgent.ts b/src/api/resources/agents/client/requests/AgentsUpdateAgent.ts new file mode 100644 index 00000000..2ec6d0a2 --- /dev/null +++ b/src/api/resources/agents/client/requests/AgentsUpdateAgent.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface AgentsUpdateAgent { + /** The name of the agent. */ + name?: string; + /** The system prompt that defines the overall agents behavior and expectations. This field is optional as there is a default system orchestrator. */ + systemPrompt?: string; + /** A brief description of the agent's capabilities. */ + description?: string; + experts?: Corti.AgentsUpdateAgentExpertsItem[]; + /** A list of MCP servers that the agent can call. If omitted, the agent can't call any MCP servers. */ + mcpServers?: Corti.AgentsCreateMcpServer[]; +} diff --git a/src/api/resources/agents/client/requests/index.ts b/src/api/resources/agents/client/requests/index.ts index 56393a4a..dbc8bcb0 100644 --- a/src/api/resources/agents/client/requests/index.ts +++ b/src/api/resources/agents/client/requests/index.ts @@ -1,3 +1,7 @@ -export type { AgentsCreateRequest } from "./AgentsCreateRequest.js"; -export type { AgentsPatchRequest } from "./AgentsPatchRequest.js"; -export type { ListAgentsRequest } from "./ListAgentsRequest.js"; +export type { AgentsCreateAgent } from "./AgentsCreateAgent.js"; +export type { AgentsGetContextRequest } from "./AgentsGetContextRequest.js"; +export type { AgentsGetRegistryExpertsRequest } from "./AgentsGetRegistryExpertsRequest.js"; +export type { AgentsGetTaskRequest } from "./AgentsGetTaskRequest.js"; +export type { AgentsListRequest } from "./AgentsListRequest.js"; +export type { AgentsMessageSendBody } from "./AgentsMessageSendBody.js"; +export type { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; diff --git a/src/api/resources/agents/index.ts b/src/api/resources/agents/index.ts index 9eb1192d..d9adb1af 100644 --- a/src/api/resources/agents/index.ts +++ b/src/api/resources/agents/index.ts @@ -1,2 +1,2 @@ export * from "./client/index.js"; -export * from "./resources/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/agents/types/AgentsCreateAgentAgentType.ts b/src/api/resources/agents/types/AgentsCreateAgentAgentType.ts new file mode 100644 index 00000000..745a52e8 --- /dev/null +++ b/src/api/resources/agents/types/AgentsCreateAgentAgentType.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Optional type of agent. */ +export const AgentsCreateAgentAgentType = { + Expert: "expert", + Orchestrator: "orchestrator", + InterviewingExpert: "interviewing-expert", +} as const; +export type AgentsCreateAgentAgentType = (typeof AgentsCreateAgentAgentType)[keyof typeof AgentsCreateAgentAgentType]; diff --git a/src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts b/src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts new file mode 100644 index 00000000..9a1278ed --- /dev/null +++ b/src/api/resources/agents/types/AgentsCreateAgentExpertsItem.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../index.js"; + +export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsCreateExpertReference; diff --git a/src/api/resources/agents/types/AgentsMessageSendResponse.ts b/src/api/resources/agents/types/AgentsMessageSendResponse.ts new file mode 100644 index 00000000..daa55406 --- /dev/null +++ b/src/api/resources/agents/types/AgentsMessageSendResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../index.js"; + +export interface AgentsMessageSendResponse { + message?: Corti.AgentsMessage; + task?: Corti.AgentsTask; +} diff --git a/src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts b/src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts new file mode 100644 index 00000000..ff5a5c08 --- /dev/null +++ b/src/api/resources/agents/types/AgentsUpdateAgentExpertsItem.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../index.js"; + +export type AgentsUpdateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsUpdateExpertReference; diff --git a/src/api/resources/agents/types/index.ts b/src/api/resources/agents/types/index.ts new file mode 100644 index 00000000..50610a88 --- /dev/null +++ b/src/api/resources/agents/types/index.ts @@ -0,0 +1,4 @@ +export * from "./AgentsCreateAgentAgentType.js"; +export * from "./AgentsCreateAgentExpertsItem.js"; +export * from "./AgentsMessageSendResponse.js"; +export * from "./AgentsUpdateAgentExpertsItem.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index fa7a2c9a..554828ee 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,5 +1,8 @@ +export * from "./agentic/client/requests/index.js"; +export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; +export * from "./agents/types/index.js"; export * as auth from "./auth/index.js"; export * from "./auth/types/index.js"; export * from "./codes/client/requests/index.js"; diff --git a/src/api/types/AgentsAgent.ts b/src/api/types/AgentsAgent.ts new file mode 100644 index 00000000..53974d59 --- /dev/null +++ b/src/api/types/AgentsAgent.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsAgent { + /** The unique identifier of the agent. */ + id: string; + /** The name of the agent. */ + name: string; + /** A brief description of the agent's capabilities. */ + description: string; + /** The system prompt that defines the overall agents behavior and expectations. */ + systemPrompt: string; + experts?: Corti.AgentsAgentExpertsItem[]; + /** A list of MCP servers that the agent can call. If omitted, the agent can't call any MCP servers. */ + mcpServers?: Corti.AgentsMcpServer[]; +} diff --git a/src/api/types/AgentsAgentCapabilities.ts b/src/api/types/AgentsAgentCapabilities.ts new file mode 100644 index 00000000..1421c537 --- /dev/null +++ b/src/api/types/AgentsAgentCapabilities.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsAgentCapabilities { + /** Indicates whether the agent supports streaming responses. */ + streaming?: boolean; + /** Indicates whether the agent supports push notifications for task status updates. */ + pushNotifications?: boolean; + /** Indicates whether the agent maintains a history of state transitions for tasks. */ + stateTransitionHistory?: boolean; + /** A list of protocol extensions supported by the agent. */ + extensions?: Corti.AgentsAgentExtension[] | null; +} diff --git a/src/api/types/AgentsAgentCard.ts b/src/api/types/AgentsAgentCard.ts new file mode 100644 index 00000000..98f9ec9a --- /dev/null +++ b/src/api/types/AgentsAgentCard.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsAgentCard { + /** The version of the A2A protocol this agents supports. */ + protocolVersion: string; + /** The name of the agent. */ + name: string; + /** A human readable description of the agent. */ + description: string; + /** The URL where the agent can be reached to process messages. */ + url: string; + preferredTransport?: string | null; + /** A list of additional transport protocols and URL combinations the agent supports. */ + additionalInterfaces?: Corti.AgentsAgentInterface[] | null; + /** A URL to an icon representing the agent. */ + iconUrl?: string | null; + /** A URL to documentation describing how to interact with the agent. */ + documentationUrl?: string | null; + provider?: Corti.AgentsAgentProvider | null; + /** The version of the agent. */ + version: string; + capabilities: Corti.AgentsAgentCapabilities | null; + /** A declaration of the security schemes available to authorize requests. The key is the scheme name. Follows the OpenAPI 3.0 Security Scheme Object. */ + securitySchemes?: Record | null; + /** A list of security requirement objects that apply to all agent interactions. Each object lists security schemes that can be used. Follows the OpenAPI 3.0 Security Requirement Object. This list can be seen as an OR of ANDs. Each object in the list describes one possible set of security requirements that must be present on a request. This allows specifying, for example, "callers must either use OAuth OR an API Key AND mTLS." */ + security?: Record | null; + /** Default set of supported input MIME types for all skills, which can be overridden on a per-skill basis. */ + defaultInputModes: string[]; + /** Default set of supported output MIME types for all skills, which can be overridden on a per-skill basis. */ + defaultOutputModes: string[]; + /** The set of skills, or distinct capabilities, that the agent can perform. */ + skills: Corti.AgentsAgentSkill[]; + /** Indicates whether the agent supports returning an extended agent card when called with authentication. */ + supportsAuthenticatedExtendedCard?: boolean | null; + /** JSON Web Signatures computed for this AgentCard. */ + signatures?: Corti.AgentsAgentCardSignature[] | null; +} diff --git a/src/api/types/AgentsAgentCardSignature.ts b/src/api/types/AgentsAgentCardSignature.ts new file mode 100644 index 00000000..d80738a0 --- /dev/null +++ b/src/api/types/AgentsAgentCardSignature.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentsAgentCardSignature { + /** The protected header of the JWS, base64url-encoded. */ + protected: string; + /** The JWS signature, base64url-encoded. */ + signature: string; + /** The unprotected header of the JWS, if any. */ + header?: Record; +} diff --git a/src/api/types/AgentsAgentExpertsItem.ts b/src/api/types/AgentsAgentExpertsItem.ts new file mode 100644 index 00000000..f8a9a698 --- /dev/null +++ b/src/api/types/AgentsAgentExpertsItem.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export type AgentsAgentExpertsItem = Corti.AgentsExpert | Corti.AgentsExpertReference; diff --git a/src/api/types/AgentsAgentExtension.ts b/src/api/types/AgentsAgentExtension.ts new file mode 100644 index 00000000..05d29ff3 --- /dev/null +++ b/src/api/types/AgentsAgentExtension.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentsAgentExtension { + /** The URI that identifies the extension. */ + uri: string; + /** A brief description of the extension. */ + description?: string; + /** If true, the client must understand and comply with the extension's requirements to interact with the agent. */ + required?: boolean; + /** Optional, extension-specific configuration parameters. */ + params?: Record; +} diff --git a/src/api/types/AgentsAgentInterface.ts b/src/api/types/AgentsAgentInterface.ts new file mode 100644 index 00000000..0dcf9151 --- /dev/null +++ b/src/api/types/AgentsAgentInterface.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentsAgentInterface { + /** The URL where the agent can be reached using the specified protocol. */ + url: string; + transport: string; +} diff --git a/src/api/types/AgentsAgentProvider.ts b/src/api/types/AgentsAgentProvider.ts new file mode 100644 index 00000000..2359af07 --- /dev/null +++ b/src/api/types/AgentsAgentProvider.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentsAgentProvider { + /** The name of the organization providing the agent. */ + organization: string; + /** The URL of the organization providing the agent. */ + url: string; +} diff --git a/src/api/types/AgentsAgentReference.ts b/src/api/types/AgentsAgentReference.ts new file mode 100644 index 00000000..d00c8c29 --- /dev/null +++ b/src/api/types/AgentsAgentReference.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A reference to an agent, either id or name must be provided. If both are passed, the id will be used. + */ +export interface AgentsAgentReference { + type: Corti.AgentsAgentReferenceType; + /** The unique identifier of the agent. */ + id?: string; + /** The name of the agent. */ + name?: string; +} diff --git a/src/api/types/AgentsAgentReferenceType.ts b/src/api/types/AgentsAgentReferenceType.ts new file mode 100644 index 00000000..0f7dc386 --- /dev/null +++ b/src/api/types/AgentsAgentReferenceType.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export const AgentsAgentReferenceType = { + Reference: "reference", +} as const; +export type AgentsAgentReferenceType = (typeof AgentsAgentReferenceType)[keyof typeof AgentsAgentReferenceType]; diff --git a/src/api/types/AgentsAgentResponse.ts b/src/api/types/AgentsAgentResponse.ts new file mode 100644 index 00000000..6cdfbabc --- /dev/null +++ b/src/api/types/AgentsAgentResponse.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export type AgentsAgentResponse = Corti.AgentsAgent | Corti.AgentsAgentReference; diff --git a/src/api/types/AgentsAgentSkill.ts b/src/api/types/AgentsAgentSkill.ts new file mode 100644 index 00000000..f7cc0579 --- /dev/null +++ b/src/api/types/AgentsAgentSkill.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsAgentSkill { + /** Unique identifier for the skill. */ + id: string; + /** The name of the skill. */ + name: string; + /** A brief description of the skill's capabilities. */ + description: string; + /** A list of tags or keywords associated with the skill, useful for categorization and search. */ + tags: string[]; + /** A list of example messages that demonstrate how to use this skill. */ + examples?: Corti.AgentsMessage[] | null; + /** A list of supported input MIME types for this skill. If omitted, the agent's default input modes apply. */ + inputModes?: string[] | null; + /** A list of supported output MIME types for this skill. If omitted, the agent's default output modes apply. */ + outputModes?: string[] | null; + /** Security schemes necessary for the agent to leverage this skill. As in the overall AgentCard.security, this list represents a logical OR of security requirement objects. Each object is a set of security schemes that must be used together (a logical AND). */ + security?: Record | null; +} diff --git a/src/api/types/AgentsArtifact.ts b/src/api/types/AgentsArtifact.ts new file mode 100644 index 00000000..f04e2c8f --- /dev/null +++ b/src/api/types/AgentsArtifact.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsArtifact { + /** Unique identifier for the artifact. */ + artifactId: string; + /** Name of the artifact. */ + name?: string; + /** Description of the artifact. */ + description?: string; + /** The content of the artifact. */ + parts: Corti.AgentsPart[]; + /** Additional metadata for the artifact. */ + metadata?: Record; + /** Extensions for the artifact. */ + extensions?: string[]; +} diff --git a/src/api/types/AgentsContext.ts b/src/api/types/AgentsContext.ts new file mode 100644 index 00000000..f3daeff2 --- /dev/null +++ b/src/api/types/AgentsContext.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsContext { + /** The context ID. */ + id?: string; + items?: Corti.AgentsContextItemsItem[]; +} diff --git a/src/api/types/AgentsContextItemsItem.ts b/src/api/types/AgentsContextItemsItem.ts new file mode 100644 index 00000000..2a2affbe --- /dev/null +++ b/src/api/types/AgentsContextItemsItem.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export type AgentsContextItemsItem = Corti.AgentsTask | Corti.AgentsMessage; diff --git a/src/api/types/AgentsCreateExpert.ts b/src/api/types/AgentsCreateExpert.ts new file mode 100644 index 00000000..0ee8760a --- /dev/null +++ b/src/api/types/AgentsCreateExpert.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsCreateExpert { + type: Corti.AgentsCreateExpertType; + /** The name of the expert. Must be unique. */ + name: string; + /** A brief description of the expert's capabilities. */ + description: string; + /** Optional system prompt that defines the expert's behavior and expectations. */ + systemPrompt?: string; + /** A list of MCP servers that the expert can call. If omitted, the expert can't call any MCP Servers. */ + mcpServers?: Corti.AgentsCreateMcpServer[]; +} diff --git a/src/api/types/AgentsCreateExpertReference.ts b/src/api/types/AgentsCreateExpertReference.ts new file mode 100644 index 00000000..faa939f2 --- /dev/null +++ b/src/api/types/AgentsCreateExpertReference.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A reference to a registry expert when creating an agent, either id or name must be provided. If both are passed, the id will be used. + */ +export interface AgentsCreateExpertReference { + type: Corti.AgentsCreateExpertReferenceType; + /** The unique identifier of the expert. */ + id?: string; + /** The name of the expert. */ + name?: string; + /** Optional. Additional system instructions appended to the default system prompt when creating an expert from the registry, extending the expert's behavior. */ + systemPrompt?: string; + /** Optional configuration override for the registry expert. Values provided here are deep-merged with the schema defaults declared on the registry expert and validated against its `configSchema`. Ignored when the registry expert has no schema. */ + config?: Record; +} diff --git a/src/api/types/AgentsCreateExpertReferenceType.ts b/src/api/types/AgentsCreateExpertReferenceType.ts new file mode 100644 index 00000000..5b760a87 --- /dev/null +++ b/src/api/types/AgentsCreateExpertReferenceType.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const AgentsCreateExpertReferenceType = { + Reference: "reference", +} as const; +export type AgentsCreateExpertReferenceType = + (typeof AgentsCreateExpertReferenceType)[keyof typeof AgentsCreateExpertReferenceType]; diff --git a/src/api/types/AgentsCreateExpertType.ts b/src/api/types/AgentsCreateExpertType.ts new file mode 100644 index 00000000..0e984eb3 --- /dev/null +++ b/src/api/types/AgentsCreateExpertType.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export const AgentsCreateExpertType = { + New: "new", +} as const; +export type AgentsCreateExpertType = (typeof AgentsCreateExpertType)[keyof typeof AgentsCreateExpertType]; diff --git a/src/api/types/AgentsCreateMcpServer.ts b/src/api/types/AgentsCreateMcpServer.ts new file mode 100644 index 00000000..1ec5d267 --- /dev/null +++ b/src/api/types/AgentsCreateMcpServer.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsCreateMcpServer { + /** Name of the MCP server. */ + name: string; + /** A brief description of the MCP server's capabilities. */ + description?: string; + /** Type of transport used by the MCP server. */ + transportType: Corti.AgentsCreateMcpServerTransportType; + /** Type of authorization used by the MCP server. */ + authorizationType: Corti.AgentsCreateMcpServerAuthorizationType; + /** OAuth2.0 authorization scope to request. */ + authorizationScope?: string; + /** URL of the MCP server. */ + url: string; + /** Redirect URI for OAuth2.0 authorization. */ + redirectUrl?: string; + /** Bearer token to be used in MCP client. */ + token?: string; +} diff --git a/src/api/types/AgentsCreateMcpServerAuthorizationType.ts b/src/api/types/AgentsCreateMcpServerAuthorizationType.ts new file mode 100644 index 00000000..ca4518e9 --- /dev/null +++ b/src/api/types/AgentsCreateMcpServerAuthorizationType.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Type of authorization used by the MCP server. */ +export const AgentsCreateMcpServerAuthorizationType = { + None: "none", + Bearer: "bearer", + Inherit: "inherit", + Oauth20: "oauth2.0", +} as const; +export type AgentsCreateMcpServerAuthorizationType = + (typeof AgentsCreateMcpServerAuthorizationType)[keyof typeof AgentsCreateMcpServerAuthorizationType]; diff --git a/src/api/types/AgentsCreateMcpServerTransportType.ts b/src/api/types/AgentsCreateMcpServerTransportType.ts new file mode 100644 index 00000000..37aef0b9 --- /dev/null +++ b/src/api/types/AgentsCreateMcpServerTransportType.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Type of transport used by the MCP server. */ +export const AgentsCreateMcpServerTransportType = { + Stdio: "stdio", + StreamableHttp: "streamable_http", + Sse: "sse", +} as const; +export type AgentsCreateMcpServerTransportType = + (typeof AgentsCreateMcpServerTransportType)[keyof typeof AgentsCreateMcpServerTransportType]; diff --git a/src/api/types/AgentsDataPart.ts b/src/api/types/AgentsDataPart.ts new file mode 100644 index 00000000..1223b959 --- /dev/null +++ b/src/api/types/AgentsDataPart.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsDataPart { + /** The kind of the part, always "data". */ + kind: Corti.AgentsDataPartKind; + /** JSON data payload. */ + data: Record; + /** Additional metadata for the data part. */ + metadata?: Record; +} diff --git a/src/api/types/AgentsDataPartKind.ts b/src/api/types/AgentsDataPartKind.ts new file mode 100644 index 00000000..7713b079 --- /dev/null +++ b/src/api/types/AgentsDataPartKind.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The kind of the part, always "data". */ +export const AgentsDataPartKind = { + Data: "data", +} as const; +export type AgentsDataPartKind = (typeof AgentsDataPartKind)[keyof typeof AgentsDataPartKind]; diff --git a/src/api/types/AgentsExpert.ts b/src/api/types/AgentsExpert.ts new file mode 100644 index 00000000..7117e0c9 --- /dev/null +++ b/src/api/types/AgentsExpert.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsExpert { + type: Corti.AgentsExpertType; + /** The unique identifier of the expert. */ + id: string; + /** The name of the expert. Must be unique. */ + name: string; + /** A brief description of the expert's capabilities. */ + description: string; + /** The system prompt that defines the expert's behavior and expectations. */ + systemPrompt: string; + /** A list of MCP servers that the expert can call. If omitted, the expert can't call any MCP Servers. */ + mcpServers?: Corti.AgentsMcpServer[]; +} diff --git a/src/api/types/AgentsExpertReference.ts b/src/api/types/AgentsExpertReference.ts new file mode 100644 index 00000000..09c21b14 --- /dev/null +++ b/src/api/types/AgentsExpertReference.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A reference to an expert returned by the API. The expert's id and name are always provided. systemPrompt is included only when a registry expert was created with a custom system prompt. + */ +export interface AgentsExpertReference { + type: Corti.AgentsExpertReferenceType; + /** The unique identifier of the expert. */ + id: string; + /** The name of the expert. */ + name: string; + /** Optional. Additional system instructions appended to the default system prompt when creating an expert from the registry, extending the expert's behavior. */ + systemPrompt?: string; + /** The fully resolved configuration for this expert: schema defaults from the registry expert deep-merged with any `config` override supplied at creation. Present only when the source registry expert defined a `configSchema`. */ + resolvedConfig?: Record; +} diff --git a/src/api/types/AgentsExpertReferenceType.ts b/src/api/types/AgentsExpertReferenceType.ts new file mode 100644 index 00000000..f9677db7 --- /dev/null +++ b/src/api/types/AgentsExpertReferenceType.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export const AgentsExpertReferenceType = { + Reference: "reference", +} as const; +export type AgentsExpertReferenceType = (typeof AgentsExpertReferenceType)[keyof typeof AgentsExpertReferenceType]; diff --git a/src/api/types/AgentsExpertType.ts b/src/api/types/AgentsExpertType.ts new file mode 100644 index 00000000..cef31a43 --- /dev/null +++ b/src/api/types/AgentsExpertType.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export const AgentsExpertType = { + Expert: "expert", +} as const; +export type AgentsExpertType = (typeof AgentsExpertType)[keyof typeof AgentsExpertType]; diff --git a/src/api/types/AgentsFilePart.ts b/src/api/types/AgentsFilePart.ts new file mode 100644 index 00000000..64794dfc --- /dev/null +++ b/src/api/types/AgentsFilePart.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsFilePart { + /** The kind of the part, always "file". */ + kind: Corti.AgentsFilePartKind; + file?: Corti.AgentsFilePartFile; + /** Additional metadata for the file part. */ + metadata?: Record; +} diff --git a/src/api/types/AgentsFilePartFile.ts b/src/api/types/AgentsFilePartFile.ts new file mode 100644 index 00000000..8ab63935 --- /dev/null +++ b/src/api/types/AgentsFilePartFile.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export type AgentsFilePartFile = Corti.AgentsFileWithUri | Corti.AgentsFileWithBytes; diff --git a/src/api/types/AgentsFilePartKind.ts b/src/api/types/AgentsFilePartKind.ts new file mode 100644 index 00000000..0bb2ac0e --- /dev/null +++ b/src/api/types/AgentsFilePartKind.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The kind of the part, always "file". */ +export const AgentsFilePartKind = { + File: "file", +} as const; +export type AgentsFilePartKind = (typeof AgentsFilePartKind)[keyof typeof AgentsFilePartKind]; diff --git a/src/api/types/AgentsFileWithBytes.ts b/src/api/types/AgentsFileWithBytes.ts new file mode 100644 index 00000000..b58af3f6 --- /dev/null +++ b/src/api/types/AgentsFileWithBytes.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentsFileWithBytes { + /** The byte content of the file. */ + bytes: string; + /** The name of the file. */ + name?: string; + /** The MIME type of the file. */ + mimeType?: string; +} diff --git a/src/api/types/AgentsFileWithUri.ts b/src/api/types/AgentsFileWithUri.ts new file mode 100644 index 00000000..9919157a --- /dev/null +++ b/src/api/types/AgentsFileWithUri.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentsFileWithUri { + /** The URI of the file. */ + uri: string; + /** The name of the file. */ + name?: string; + /** The MIME type of the file. */ + mimeType?: string; +} diff --git a/src/api/types/AgentsMcpServer.ts b/src/api/types/AgentsMcpServer.ts new file mode 100644 index 00000000..57fabed5 --- /dev/null +++ b/src/api/types/AgentsMcpServer.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsMcpServer { + /** Unique identifier for the MCP server. */ + id: string; + /** Name of the MCP server. */ + name: string; + /** Type of transport used by the MCP server. */ + transportType: Corti.AgentsMcpServerTransportType; + /** Type of authorization used by the MCP server. */ + authorizationType: Corti.AgentsMcpServerAuthorizationType; + /** OAuth2.0 authorization scope to request. */ + authorizationScope?: string; + /** URL of the MCP server. */ + url: string; + /** Redirect URI for OAuth2.0 authorization. */ + redirectUrl?: string | null; +} diff --git a/src/api/types/AgentsMcpServerAuthorizationType.ts b/src/api/types/AgentsMcpServerAuthorizationType.ts new file mode 100644 index 00000000..36d6daef --- /dev/null +++ b/src/api/types/AgentsMcpServerAuthorizationType.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Type of authorization used by the MCP server. */ +export const AgentsMcpServerAuthorizationType = { + None: "none", + Bearer: "bearer", + Inherit: "inherit", + Oauth20: "oauth2.0", +} as const; +export type AgentsMcpServerAuthorizationType = + (typeof AgentsMcpServerAuthorizationType)[keyof typeof AgentsMcpServerAuthorizationType]; diff --git a/src/api/types/AgentsMcpServerTransportType.ts b/src/api/types/AgentsMcpServerTransportType.ts new file mode 100644 index 00000000..39595cae --- /dev/null +++ b/src/api/types/AgentsMcpServerTransportType.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Type of transport used by the MCP server. */ +export const AgentsMcpServerTransportType = { + Stdio: "stdio", + StreamableHttp: "streamable_http", + Sse: "sse", +} as const; +export type AgentsMcpServerTransportType = + (typeof AgentsMcpServerTransportType)[keyof typeof AgentsMcpServerTransportType]; diff --git a/src/api/types/AgentsMessage.ts b/src/api/types/AgentsMessage.ts new file mode 100644 index 00000000..08b1d045 --- /dev/null +++ b/src/api/types/AgentsMessage.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsMessage { + /** The role of the message sender. */ + role: Corti.AgentsMessageRole; + /** The content of the message. */ + parts: Corti.AgentsPart[]; + /** Additional metadata for the message. */ + metadata?: Record; + /** Extensions for the message. */ + extensions?: string[]; + /** Task IDs that this message references for additional context. */ + referenceTaskIds?: string[]; + /** Unique identifier for the message. */ + messageId: string; + /** Unique identifier for the task associated with the message. */ + taskId?: string; + /** Identifier for the context (thread) in which the message is sent. */ + contextId?: string; + /** The kind of the object, always "message". */ + kind: Corti.AgentsMessageKind; +} diff --git a/src/api/types/AgentsMessageKind.ts b/src/api/types/AgentsMessageKind.ts new file mode 100644 index 00000000..33024a17 --- /dev/null +++ b/src/api/types/AgentsMessageKind.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The kind of the object, always "message". */ +export const AgentsMessageKind = { + Message: "message", +} as const; +export type AgentsMessageKind = (typeof AgentsMessageKind)[keyof typeof AgentsMessageKind]; diff --git a/src/api/types/AgentsMessageRole.ts b/src/api/types/AgentsMessageRole.ts new file mode 100644 index 00000000..c2e2164f --- /dev/null +++ b/src/api/types/AgentsMessageRole.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The role of the message sender. */ +export const AgentsMessageRole = { + User: "user", + Agent: "agent", +} as const; +export type AgentsMessageRole = (typeof AgentsMessageRole)[keyof typeof AgentsMessageRole]; diff --git a/src/api/types/AgentsMessageSendConfiguration.ts b/src/api/types/AgentsMessageSendConfiguration.ts new file mode 100644 index 00000000..f85cc4fd --- /dev/null +++ b/src/api/types/AgentsMessageSendConfiguration.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsMessageSendConfiguration { + /** A list of output MIME types the client is prepared to accept in the response. */ + acceptedOutputModes?: string[]; + /** The number of previous messages to include in the context for the agent when processing this message. */ + historyLength?: number; + pushNotificationConfig?: Corti.AgentsPushNotificationConfig; + /** If true, the client will wait for the task to complete. The server may reject this if the task is long-running. */ + blocking?: boolean; +} diff --git a/src/api/types/AgentsPart.ts b/src/api/types/AgentsPart.ts new file mode 100644 index 00000000..dbde9135 --- /dev/null +++ b/src/api/types/AgentsPart.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export type AgentsPart = Corti.AgentsTextPart | Corti.AgentsFilePart | Corti.AgentsDataPart; diff --git a/src/api/types/AgentsPushNotificationAuthenticationInfo.ts b/src/api/types/AgentsPushNotificationAuthenticationInfo.ts new file mode 100644 index 00000000..5769026a --- /dev/null +++ b/src/api/types/AgentsPushNotificationAuthenticationInfo.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentsPushNotificationAuthenticationInfo { + /** A list of supported authentication schemes (e.g. 'Basic', 'Bearer'). */ + schemes: string[]; + /** Optional credentials or tokens required for authentication. */ + credentials?: string; +} diff --git a/src/api/types/AgentsPushNotificationConfig.ts b/src/api/types/AgentsPushNotificationConfig.ts new file mode 100644 index 00000000..9c5f9cc4 --- /dev/null +++ b/src/api/types/AgentsPushNotificationConfig.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsPushNotificationConfig { + /** Unique identifier for the push notification configuration. */ + id?: string; + /** The URL to which push notifications will be sent when the task status changes. */ + url: string; + /** An optional bearer token to include in the Authorization header when sending push notifications. */ + token?: string; + authentication?: Corti.AgentsPushNotificationAuthenticationInfo; +} diff --git a/src/api/types/AgentsRegistryExpert.ts b/src/api/types/AgentsRegistryExpert.ts new file mode 100644 index 00000000..6bb800f1 --- /dev/null +++ b/src/api/types/AgentsRegistryExpert.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsRegistryExpert { + /** The name of the expert. */ + name: string; + /** An optional human-readable display name for the expert. */ + displayName?: string; + /** An optional human-readable display description for the expert. */ + displayDescription?: string; + /** A brief description of the expert's capabilities. */ + description: string; + /** A list of MCP servers the expert can call, including their authorization types. */ + mcpServers?: Corti.AgentsRegistryMcpServer[]; + /** Optional JSON Schema describing the configuration this expert accepts. When present, callers may supply a matching `config` object on `AgentsCreateExpertReference`; values are deep-merged with schema defaults and validated against this schema. */ + configSchema?: Record; +} diff --git a/src/api/types/AgentsRegistryExpertsResponse.ts b/src/api/types/AgentsRegistryExpertsResponse.ts new file mode 100644 index 00000000..f923bb1d --- /dev/null +++ b/src/api/types/AgentsRegistryExpertsResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsRegistryExpertsResponse { + /** A list of all available experts in the experts registry. */ + experts?: Corti.AgentsRegistryExpert[]; +} diff --git a/src/api/types/AgentsRegistryMcpServer.ts b/src/api/types/AgentsRegistryMcpServer.ts new file mode 100644 index 00000000..0236f42b --- /dev/null +++ b/src/api/types/AgentsRegistryMcpServer.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsRegistryMcpServer { + /** Name of the MCP server. */ + name: string; + /** Type of authorization used by the MCP server. */ + authorizationType: Corti.AgentsRegistryMcpServerAuthorizationType; +} diff --git a/src/api/types/AgentsRegistryMcpServerAuthorizationType.ts b/src/api/types/AgentsRegistryMcpServerAuthorizationType.ts new file mode 100644 index 00000000..e2764042 --- /dev/null +++ b/src/api/types/AgentsRegistryMcpServerAuthorizationType.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Type of authorization used by the MCP server. */ +export const AgentsRegistryMcpServerAuthorizationType = { + None: "none", + Bearer: "bearer", + Inherit: "inherit", + Oauth20: "oauth2.0", +} as const; +export type AgentsRegistryMcpServerAuthorizationType = + (typeof AgentsRegistryMcpServerAuthorizationType)[keyof typeof AgentsRegistryMcpServerAuthorizationType]; diff --git a/src/api/types/AgentsTask.ts b/src/api/types/AgentsTask.ts new file mode 100644 index 00000000..2bd6389f --- /dev/null +++ b/src/api/types/AgentsTask.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsTask { + /** Unique identifier for the task. */ + id: string; + /** Identifier for the context (thread) in which the task is created. */ + contextId: string; + status: Corti.AgentsTaskStatus; + /** The history of messages associated with the task. */ + history?: Corti.AgentsMessage[]; + /** The artifacts associated with the task. */ + artifacts?: Corti.AgentsArtifact[]; + /** Additional metadata for the task. */ + metadata?: Record; + /** The kind of the object, always "task". */ + kind: Corti.AgentsTaskKind; +} diff --git a/src/api/types/AgentsTaskKind.ts b/src/api/types/AgentsTaskKind.ts new file mode 100644 index 00000000..51fc3dda --- /dev/null +++ b/src/api/types/AgentsTaskKind.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The kind of the object, always "task". */ +export const AgentsTaskKind = { + Task: "task", +} as const; +export type AgentsTaskKind = (typeof AgentsTaskKind)[keyof typeof AgentsTaskKind]; diff --git a/src/api/types/AgentsTaskStatus.ts b/src/api/types/AgentsTaskStatus.ts new file mode 100644 index 00000000..c9f055ed --- /dev/null +++ b/src/api/types/AgentsTaskStatus.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsTaskStatus { + /** The current state of the task. */ + state: Corti.AgentsTaskStatusState; + /** Additional message or details about the task status. */ + message?: Corti.AgentsMessage; + /** The timestamp when this status was recorded. */ + timestamp?: Date; +} diff --git a/src/api/types/AgentsTaskStatusState.ts b/src/api/types/AgentsTaskStatusState.ts new file mode 100644 index 00000000..7e186848 --- /dev/null +++ b/src/api/types/AgentsTaskStatusState.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The current state of the task. */ +export const AgentsTaskStatusState = { + Submitted: "submitted", + Working: "working", + InputRequired: "input-required", + Completed: "completed", + Canceled: "canceled", + Failed: "failed", + Rejected: "rejected", + AuthRequired: "auth-required", + Unknown: "unknown", +} as const; +export type AgentsTaskStatusState = (typeof AgentsTaskStatusState)[keyof typeof AgentsTaskStatusState]; diff --git a/src/api/types/AgentsTextPart.ts b/src/api/types/AgentsTextPart.ts new file mode 100644 index 00000000..b0fda0cf --- /dev/null +++ b/src/api/types/AgentsTextPart.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentsTextPart { + /** The kind of the part, always "text". */ + kind: Corti.AgentsTextPartKind; + /** The text content of the part. */ + text: string; + /** Additional metadata for the text part. */ + metadata?: Record; +} diff --git a/src/api/types/AgentsTextPartKind.ts b/src/api/types/AgentsTextPartKind.ts new file mode 100644 index 00000000..3366f180 --- /dev/null +++ b/src/api/types/AgentsTextPartKind.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The kind of the part, always "text". */ +export const AgentsTextPartKind = { + Text: "text", +} as const; +export type AgentsTextPartKind = (typeof AgentsTextPartKind)[keyof typeof AgentsTextPartKind]; diff --git a/src/api/types/AgentsUpdateExpertReference.ts b/src/api/types/AgentsUpdateExpertReference.ts new file mode 100644 index 00000000..96a03aa7 --- /dev/null +++ b/src/api/types/AgentsUpdateExpertReference.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An expert reference when updating an agent. The id is required to identify which expert to update, or reference. The expert must already exist. + */ +export type AgentsUpdateExpertReference = Corti.AgentsCreateExpertReference; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 65634424..248401b0 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -12,10 +12,64 @@ export * from "./AgentCardResponseSignaturesItem.js"; export * from "./AgentCardResponseSkillsItem.js"; export * from "./AgentCardResponseSupportedInterfacesItem.js"; export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; +export * from "./AgentsAgent.js"; +export * from "./AgentsAgentCapabilities.js"; +export * from "./AgentsAgentCard.js"; +export * from "./AgentsAgentCardSignature.js"; +export * from "./AgentsAgentExpertsItem.js"; +export * from "./AgentsAgentExtension.js"; +export * from "./AgentsAgentInterface.js"; +export * from "./AgentsAgentProvider.js"; +export * from "./AgentsAgentReference.js"; +export * from "./AgentsAgentReferenceType.js"; +export * from "./AgentsAgentResponse.js"; +export * from "./AgentsAgentSkill.js"; +export * from "./AgentsArtifact.js"; +export * from "./AgentsContext.js"; +export * from "./AgentsContextItemsItem.js"; +export * from "./AgentsCreateExpert.js"; +export * from "./AgentsCreateExpertReference.js"; +export * from "./AgentsCreateExpertReferenceType.js"; +export * from "./AgentsCreateExpertType.js"; +export * from "./AgentsCreateMcpServer.js"; +export * from "./AgentsCreateMcpServerAuthorizationType.js"; +export * from "./AgentsCreateMcpServerTransportType.js"; +export * from "./AgentsDataPart.js"; +export * from "./AgentsDataPartKind.js"; +export * from "./AgentsExpert.js"; +export * from "./AgentsExpertReference.js"; +export * from "./AgentsExpertReferenceType.js"; +export * from "./AgentsExpertType.js"; +export * from "./AgentsFilePart.js"; +export * from "./AgentsFilePartFile.js"; +export * from "./AgentsFilePartKind.js"; +export * from "./AgentsFileWithBytes.js"; +export * from "./AgentsFileWithUri.js"; export * from "./AgentsLabels.js"; export * from "./AgentsLifecycle.js"; export * from "./AgentsListResponse.js"; +export * from "./AgentsMcpServer.js"; +export * from "./AgentsMcpServerAuthorizationType.js"; +export * from "./AgentsMcpServerTransportType.js"; +export * from "./AgentsMessage.js"; +export * from "./AgentsMessageKind.js"; +export * from "./AgentsMessageRole.js"; +export * from "./AgentsMessageSendConfiguration.js"; +export * from "./AgentsPart.js"; +export * from "./AgentsPushNotificationAuthenticationInfo.js"; +export * from "./AgentsPushNotificationConfig.js"; +export * from "./AgentsRegistryExpert.js"; +export * from "./AgentsRegistryExpertsResponse.js"; +export * from "./AgentsRegistryMcpServer.js"; +export * from "./AgentsRegistryMcpServerAuthorizationType.js"; export * from "./AgentsResponse.js"; +export * from "./AgentsTask.js"; +export * from "./AgentsTaskKind.js"; +export * from "./AgentsTaskStatus.js"; +export * from "./AgentsTaskStatusState.js"; +export * from "./AgentsTextPart.js"; +export * from "./AgentsTextPartKind.js"; +export * from "./AgentsUpdateExpertReference.js"; export * from "./AgentsUserIdValue.js"; export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; diff --git a/src/serialization/resources/agents/resources/feedback/client/index.ts b/src/serialization/resources/agentic/client/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/feedback/client/index.ts rename to src/serialization/resources/agentic/client/index.ts diff --git a/src/serialization/resources/agents/client/requests/AgentsCreateRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts similarity index 100% rename from src/serialization/resources/agents/client/requests/AgentsCreateRequest.ts rename to src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts diff --git a/src/serialization/resources/agents/client/requests/AgentsPatchRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts similarity index 100% rename from src/serialization/resources/agents/client/requests/AgentsPatchRequest.ts rename to src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts diff --git a/src/serialization/resources/agentic/client/requests/index.ts b/src/serialization/resources/agentic/client/requests/index.ts new file mode 100644 index 00000000..d89fef23 --- /dev/null +++ b/src/serialization/resources/agentic/client/requests/index.ts @@ -0,0 +1,2 @@ +export { AgentsCreateRequest } from "./AgentsCreateRequest.js"; +export { AgentsPatchRequest } from "./AgentsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/index.ts b/src/serialization/resources/agentic/index.ts new file mode 100644 index 00000000..9eb1192d --- /dev/null +++ b/src/serialization/resources/agentic/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/client/index.ts b/src/serialization/resources/agentic/resources/a2A/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts similarity index 91% rename from src/serialization/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts rename to src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts index 2804a374..9828ab57 100644 --- a/src/serialization/resources/agents/resources/a2A/client/requests/A2AjsonrpcRequest.ts +++ b/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts @@ -7,8 +7,8 @@ import { A2AjsonrpcRequestId } from "../../types/A2AjsonrpcRequestId.js"; import { A2AjsonrpcRequestMethod } from "../../types/A2AjsonrpcRequestMethod.js"; export const A2AjsonrpcRequest: core.serialization.Schema< - serializers.agents.A2AjsonrpcRequest.Raw, - Corti.agents.A2AjsonrpcRequest + serializers.agentic.A2AjsonrpcRequest.Raw, + Corti.agentic.A2AjsonrpcRequest > = core.serialization.object({ id: A2AjsonrpcRequestId, method: A2AjsonrpcRequestMethod, diff --git a/src/serialization/resources/agents/resources/a2A/client/requests/index.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/a2A/client/requests/index.ts rename to src/serialization/resources/agentic/resources/a2A/client/requests/index.ts diff --git a/src/serialization/resources/agents/resources/a2A/index.ts b/src/serialization/resources/agentic/resources/a2A/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/a2A/index.ts rename to src/serialization/resources/agentic/resources/a2A/index.ts diff --git a/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts similarity index 85% rename from src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts rename to src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts index d178c54e..5abc99c8 100644 --- a/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestId.ts +++ b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts @@ -5,8 +5,8 @@ import * as core from "../../../../../../core/index.js"; import type * as serializers from "../../../../../index.js"; export const A2AjsonrpcRequestId: core.serialization.Schema< - serializers.agents.A2AjsonrpcRequestId.Raw, - Corti.agents.A2AjsonrpcRequestId + serializers.agentic.A2AjsonrpcRequestId.Raw, + Corti.agentic.A2AjsonrpcRequestId > = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); export declare namespace A2AjsonrpcRequestId { diff --git a/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts similarity index 87% rename from src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts rename to src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts index 864138a9..ed080991 100644 --- a/src/serialization/resources/agents/resources/a2A/types/A2AjsonrpcRequestMethod.ts +++ b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts @@ -5,8 +5,8 @@ import * as core from "../../../../../../core/index.js"; import type * as serializers from "../../../../../index.js"; export const A2AjsonrpcRequestMethod: core.serialization.Schema< - serializers.agents.A2AjsonrpcRequestMethod.Raw, - Corti.agents.A2AjsonrpcRequestMethod + serializers.agentic.A2AjsonrpcRequestMethod.Raw, + Corti.agentic.A2AjsonrpcRequestMethod > = core.serialization.enum_([ "SendMessage", "SendStreamingMessage", diff --git a/src/serialization/resources/agents/resources/a2A/types/index.ts b/src/serialization/resources/agentic/resources/a2A/types/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/a2A/types/index.ts rename to src/serialization/resources/agentic/resources/a2A/types/index.ts diff --git a/src/serialization/resources/agentic/resources/feedback/client/index.ts b/src/serialization/resources/agentic/resources/feedback/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agentic/resources/feedback/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts similarity index 92% rename from src/serialization/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts rename to src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts index 66a94352..81438c6a 100644 --- a/src/serialization/resources/agents/resources/feedback/client/requests/FeedbackCreateRequest.ts +++ b/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts @@ -9,8 +9,8 @@ import { FeedbackRating } from "../../../../../../types/FeedbackRating.js"; import { FeedbackTarget } from "../../../../../../types/FeedbackTarget.js"; export const FeedbackCreateRequest: core.serialization.Schema< - serializers.agents.FeedbackCreateRequest.Raw, - Corti.agents.FeedbackCreateRequest + serializers.agentic.FeedbackCreateRequest.Raw, + Corti.agentic.FeedbackCreateRequest > = core.serialization.object({ rating: FeedbackRating, labels: core.serialization.list(FeedbackLabel).optional(), diff --git a/src/serialization/resources/agents/resources/feedback/client/requests/index.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/feedback/client/requests/index.ts rename to src/serialization/resources/agentic/resources/feedback/client/requests/index.ts diff --git a/src/serialization/resources/agents/resources/feedback/index.ts b/src/serialization/resources/agentic/resources/feedback/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/feedback/index.ts rename to src/serialization/resources/agentic/resources/feedback/index.ts diff --git a/src/serialization/resources/agents/resources/index.ts b/src/serialization/resources/agentic/resources/index.ts similarity index 100% rename from src/serialization/resources/agents/resources/index.ts rename to src/serialization/resources/agentic/resources/index.ts diff --git a/src/serialization/resources/agents/client/index.ts b/src/serialization/resources/agents/client/index.ts index 195f9aa8..cd155427 100644 --- a/src/serialization/resources/agents/client/index.ts +++ b/src/serialization/resources/agents/client/index.ts @@ -1 +1,2 @@ +export * as list from "./list.js"; export * from "./requests/index.js"; diff --git a/src/serialization/resources/agents/client/list.ts b/src/serialization/resources/agents/client/list.ts new file mode 100644 index 00000000..9866ad37 --- /dev/null +++ b/src/serialization/resources/agents/client/list.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; +import { AgentsAgentResponse } from "../../../types/AgentsAgentResponse.js"; + +export const Response: core.serialization.Schema = + core.serialization.list(AgentsAgentResponse); + +export declare namespace Response { + export type Raw = AgentsAgentResponse.Raw[]; +} diff --git a/src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts b/src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts new file mode 100644 index 00000000..a88b8561 --- /dev/null +++ b/src/serialization/resources/agents/client/requests/AgentsCreateAgent.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { AgentsCreateMcpServer } from "../../../../types/AgentsCreateMcpServer.js"; +import { AgentsCreateAgentAgentType } from "../../types/AgentsCreateAgentAgentType.js"; +import { AgentsCreateAgentExpertsItem } from "../../types/AgentsCreateAgentExpertsItem.js"; + +export const AgentsCreateAgent: core.serialization.Schema< + serializers.AgentsCreateAgent.Raw, + Omit +> = core.serialization.object({ + name: core.serialization.string(), + agentType: AgentsCreateAgentAgentType.optional(), + systemPrompt: core.serialization.string().optional(), + description: core.serialization.string(), + experts: core.serialization.list(AgentsCreateAgentExpertsItem).optional(), + mcpServers: core.serialization.list(AgentsCreateMcpServer).optional(), +}); + +export declare namespace AgentsCreateAgent { + export interface Raw { + name: string; + agentType?: AgentsCreateAgentAgentType.Raw | null; + systemPrompt?: string | null; + description: string; + experts?: AgentsCreateAgentExpertsItem.Raw[] | null; + mcpServers?: AgentsCreateMcpServer.Raw[] | null; + } +} diff --git a/src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts b/src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts new file mode 100644 index 00000000..0fc3860b --- /dev/null +++ b/src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { AgentsMessage } from "../../../../types/AgentsMessage.js"; +import { AgentsMessageSendConfiguration } from "../../../../types/AgentsMessageSendConfiguration.js"; + +export const AgentsMessageSendBody: core.serialization.Schema< + serializers.AgentsMessageSendBody.Raw, + Corti.AgentsMessageSendBody +> = core.serialization.object({ + message: AgentsMessage, + configuration: AgentsMessageSendConfiguration.optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace AgentsMessageSendBody { + export interface Raw { + message: AgentsMessage.Raw; + configuration?: AgentsMessageSendConfiguration.Raw | null; + metadata?: Record | null; + } +} diff --git a/src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts b/src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts new file mode 100644 index 00000000..236a7dcf --- /dev/null +++ b/src/serialization/resources/agents/client/requests/AgentsUpdateAgent.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { AgentsCreateMcpServer } from "../../../../types/AgentsCreateMcpServer.js"; +import { AgentsUpdateAgentExpertsItem } from "../../types/AgentsUpdateAgentExpertsItem.js"; + +export const AgentsUpdateAgent: core.serialization.Schema = + core.serialization.object({ + name: core.serialization.string().optional(), + systemPrompt: core.serialization.string().optional(), + description: core.serialization.string().optional(), + experts: core.serialization.list(AgentsUpdateAgentExpertsItem).optional(), + mcpServers: core.serialization.list(AgentsCreateMcpServer).optional(), + }); + +export declare namespace AgentsUpdateAgent { + export interface Raw { + name?: string | null; + systemPrompt?: string | null; + description?: string | null; + experts?: AgentsUpdateAgentExpertsItem.Raw[] | null; + mcpServers?: AgentsCreateMcpServer.Raw[] | null; + } +} diff --git a/src/serialization/resources/agents/client/requests/index.ts b/src/serialization/resources/agents/client/requests/index.ts index d89fef23..2ec1ca0a 100644 --- a/src/serialization/resources/agents/client/requests/index.ts +++ b/src/serialization/resources/agents/client/requests/index.ts @@ -1,2 +1,3 @@ -export { AgentsCreateRequest } from "./AgentsCreateRequest.js"; -export { AgentsPatchRequest } from "./AgentsPatchRequest.js"; +export { AgentsCreateAgent } from "./AgentsCreateAgent.js"; +export { AgentsMessageSendBody } from "./AgentsMessageSendBody.js"; +export { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; diff --git a/src/serialization/resources/agents/index.ts b/src/serialization/resources/agents/index.ts index 9eb1192d..d9adb1af 100644 --- a/src/serialization/resources/agents/index.ts +++ b/src/serialization/resources/agents/index.ts @@ -1,2 +1,2 @@ export * from "./client/index.js"; -export * from "./resources/index.js"; +export * from "./types/index.js"; diff --git a/src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts b/src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts new file mode 100644 index 00000000..831b82a0 --- /dev/null +++ b/src/serialization/resources/agents/types/AgentsCreateAgentAgentType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const AgentsCreateAgentAgentType: core.serialization.Schema< + serializers.AgentsCreateAgentAgentType.Raw, + Corti.AgentsCreateAgentAgentType +> = core.serialization.enum_(["expert", "orchestrator", "interviewing-expert"]); + +export declare namespace AgentsCreateAgentAgentType { + export type Raw = "expert" | "orchestrator" | "interviewing-expert"; +} diff --git a/src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts b/src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts new file mode 100644 index 00000000..8e113572 --- /dev/null +++ b/src/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; +import { AgentsCreateExpert } from "../../../types/AgentsCreateExpert.js"; +import { AgentsCreateExpertReference } from "../../../types/AgentsCreateExpertReference.js"; + +export const AgentsCreateAgentExpertsItem: core.serialization.Schema< + serializers.AgentsCreateAgentExpertsItem.Raw, + Corti.AgentsCreateAgentExpertsItem +> = core.serialization.undiscriminatedUnion([AgentsCreateExpert, AgentsCreateExpertReference]); + +export declare namespace AgentsCreateAgentExpertsItem { + export type Raw = AgentsCreateExpert.Raw | AgentsCreateExpertReference.Raw; +} diff --git a/src/serialization/resources/agents/types/AgentsMessageSendResponse.ts b/src/serialization/resources/agents/types/AgentsMessageSendResponse.ts new file mode 100644 index 00000000..9e7b74db --- /dev/null +++ b/src/serialization/resources/agents/types/AgentsMessageSendResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; +import { AgentsMessage } from "../../../types/AgentsMessage.js"; +import { AgentsTask } from "../../../types/AgentsTask.js"; + +export const AgentsMessageSendResponse: core.serialization.ObjectSchema< + serializers.AgentsMessageSendResponse.Raw, + Corti.AgentsMessageSendResponse +> = core.serialization.object({ + message: AgentsMessage.optional(), + task: AgentsTask.optional(), +}); + +export declare namespace AgentsMessageSendResponse { + export interface Raw { + message?: AgentsMessage.Raw | null; + task?: AgentsTask.Raw | null; + } +} diff --git a/src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts b/src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts new file mode 100644 index 00000000..e9c42deb --- /dev/null +++ b/src/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; +import { AgentsCreateExpert } from "../../../types/AgentsCreateExpert.js"; +import { AgentsUpdateExpertReference } from "../../../types/AgentsUpdateExpertReference.js"; + +export const AgentsUpdateAgentExpertsItem: core.serialization.Schema< + serializers.AgentsUpdateAgentExpertsItem.Raw, + Corti.AgentsUpdateAgentExpertsItem +> = core.serialization.undiscriminatedUnion([AgentsCreateExpert, AgentsUpdateExpertReference]); + +export declare namespace AgentsUpdateAgentExpertsItem { + export type Raw = AgentsCreateExpert.Raw | AgentsUpdateExpertReference.Raw; +} diff --git a/src/serialization/resources/agents/types/index.ts b/src/serialization/resources/agents/types/index.ts new file mode 100644 index 00000000..50610a88 --- /dev/null +++ b/src/serialization/resources/agents/types/index.ts @@ -0,0 +1,4 @@ +export * from "./AgentsCreateAgentAgentType.js"; +export * from "./AgentsCreateAgentExpertsItem.js"; +export * from "./AgentsMessageSendResponse.js"; +export * from "./AgentsUpdateAgentExpertsItem.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index cd58cbaa..c3ebce10 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,5 +1,8 @@ +export * from "./agentic/client/requests/index.js"; +export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; +export * from "./agents/types/index.js"; export * as auth from "./auth/index.js"; export * from "./auth/types/index.js"; export * from "./codes/client/requests/index.js"; diff --git a/src/serialization/types/AgentsAgent.ts b/src/serialization/types/AgentsAgent.ts new file mode 100644 index 00000000..adc5eaf5 --- /dev/null +++ b/src/serialization/types/AgentsAgent.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsAgentExpertsItem } from "./AgentsAgentExpertsItem.js"; +import { AgentsMcpServer } from "./AgentsMcpServer.js"; + +export const AgentsAgent: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string(), + systemPrompt: core.serialization.string(), + experts: core.serialization.list(AgentsAgentExpertsItem).optional(), + mcpServers: core.serialization.list(AgentsMcpServer).optional(), + }); + +export declare namespace AgentsAgent { + export interface Raw { + id: string; + name: string; + description: string; + systemPrompt: string; + experts?: AgentsAgentExpertsItem.Raw[] | null; + mcpServers?: AgentsMcpServer.Raw[] | null; + } +} diff --git a/src/serialization/types/AgentsAgentCapabilities.ts b/src/serialization/types/AgentsAgentCapabilities.ts new file mode 100644 index 00000000..93e62f14 --- /dev/null +++ b/src/serialization/types/AgentsAgentCapabilities.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsAgentExtension } from "./AgentsAgentExtension.js"; + +export const AgentsAgentCapabilities: core.serialization.ObjectSchema< + serializers.AgentsAgentCapabilities.Raw, + Corti.AgentsAgentCapabilities +> = core.serialization.object({ + streaming: core.serialization.boolean().optional(), + pushNotifications: core.serialization.boolean().optional(), + stateTransitionHistory: core.serialization.boolean().optional(), + extensions: core.serialization.list(AgentsAgentExtension).optionalNullable(), +}); + +export declare namespace AgentsAgentCapabilities { + export interface Raw { + streaming?: boolean | null; + pushNotifications?: boolean | null; + stateTransitionHistory?: boolean | null; + extensions?: (AgentsAgentExtension.Raw[] | null | undefined) | null; + } +} diff --git a/src/serialization/types/AgentsAgentCard.ts b/src/serialization/types/AgentsAgentCard.ts new file mode 100644 index 00000000..8ed7e6a5 --- /dev/null +++ b/src/serialization/types/AgentsAgentCard.ts @@ -0,0 +1,59 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsAgentCapabilities } from "./AgentsAgentCapabilities.js"; +import { AgentsAgentCardSignature } from "./AgentsAgentCardSignature.js"; +import { AgentsAgentInterface } from "./AgentsAgentInterface.js"; +import { AgentsAgentProvider } from "./AgentsAgentProvider.js"; +import { AgentsAgentSkill } from "./AgentsAgentSkill.js"; + +export const AgentsAgentCard: core.serialization.ObjectSchema = + core.serialization.object({ + protocolVersion: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string(), + url: core.serialization.string(), + preferredTransport: core.serialization.string().optionalNullable(), + additionalInterfaces: core.serialization.list(AgentsAgentInterface).optionalNullable(), + iconUrl: core.serialization.string().optionalNullable(), + documentationUrl: core.serialization.string().optionalNullable(), + provider: AgentsAgentProvider.optionalNullable(), + version: core.serialization.string(), + capabilities: AgentsAgentCapabilities.nullable(), + securitySchemes: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + security: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + defaultInputModes: core.serialization.list(core.serialization.string()), + defaultOutputModes: core.serialization.list(core.serialization.string()), + skills: core.serialization.list(AgentsAgentSkill), + supportsAuthenticatedExtendedCard: core.serialization.boolean().optionalNullable(), + signatures: core.serialization.list(AgentsAgentCardSignature).optionalNullable(), + }); + +export declare namespace AgentsAgentCard { + export interface Raw { + protocolVersion: string; + name: string; + description: string; + url: string; + preferredTransport?: (string | null | undefined) | null; + additionalInterfaces?: (AgentsAgentInterface.Raw[] | null | undefined) | null; + iconUrl?: (string | null | undefined) | null; + documentationUrl?: (string | null | undefined) | null; + provider?: (AgentsAgentProvider.Raw | null | undefined) | null; + version: string; + capabilities?: AgentsAgentCapabilities.Raw | null; + securitySchemes?: (Record | null | undefined) | null; + security?: (Record | null | undefined) | null; + defaultInputModes: string[]; + defaultOutputModes: string[]; + skills: AgentsAgentSkill.Raw[]; + supportsAuthenticatedExtendedCard?: (boolean | null | undefined) | null; + signatures?: (AgentsAgentCardSignature.Raw[] | null | undefined) | null; + } +} diff --git a/src/serialization/types/AgentsAgentCardSignature.ts b/src/serialization/types/AgentsAgentCardSignature.ts new file mode 100644 index 00000000..b9bd1fd0 --- /dev/null +++ b/src/serialization/types/AgentsAgentCardSignature.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsAgentCardSignature: core.serialization.ObjectSchema< + serializers.AgentsAgentCardSignature.Raw, + Corti.AgentsAgentCardSignature +> = core.serialization.object({ + protected: core.serialization.string(), + signature: core.serialization.string(), + header: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace AgentsAgentCardSignature { + export interface Raw { + protected: string; + signature: string; + header?: Record | null; + } +} diff --git a/src/serialization/types/AgentsAgentExpertsItem.ts b/src/serialization/types/AgentsAgentExpertsItem.ts new file mode 100644 index 00000000..1978ab11 --- /dev/null +++ b/src/serialization/types/AgentsAgentExpertsItem.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsExpert } from "./AgentsExpert.js"; +import { AgentsExpertReference } from "./AgentsExpertReference.js"; + +export const AgentsAgentExpertsItem: core.serialization.Schema< + serializers.AgentsAgentExpertsItem.Raw, + Corti.AgentsAgentExpertsItem +> = core.serialization.undiscriminatedUnion([AgentsExpert, AgentsExpertReference]); + +export declare namespace AgentsAgentExpertsItem { + export type Raw = AgentsExpert.Raw | AgentsExpertReference.Raw; +} diff --git a/src/serialization/types/AgentsAgentExtension.ts b/src/serialization/types/AgentsAgentExtension.ts new file mode 100644 index 00000000..f3dfb95c --- /dev/null +++ b/src/serialization/types/AgentsAgentExtension.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsAgentExtension: core.serialization.ObjectSchema< + serializers.AgentsAgentExtension.Raw, + Corti.AgentsAgentExtension +> = core.serialization.object({ + uri: core.serialization.string(), + description: core.serialization.string().optional(), + required: core.serialization.boolean().optional(), + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace AgentsAgentExtension { + export interface Raw { + uri: string; + description?: string | null; + required?: boolean | null; + params?: Record | null; + } +} diff --git a/src/serialization/types/AgentsAgentInterface.ts b/src/serialization/types/AgentsAgentInterface.ts new file mode 100644 index 00000000..f8c7187e --- /dev/null +++ b/src/serialization/types/AgentsAgentInterface.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsAgentInterface: core.serialization.ObjectSchema< + serializers.AgentsAgentInterface.Raw, + Corti.AgentsAgentInterface +> = core.serialization.object({ + url: core.serialization.string(), + transport: core.serialization.string(), +}); + +export declare namespace AgentsAgentInterface { + export interface Raw { + url: string; + transport: string; + } +} diff --git a/src/serialization/types/AgentsAgentProvider.ts b/src/serialization/types/AgentsAgentProvider.ts new file mode 100644 index 00000000..8915c8ef --- /dev/null +++ b/src/serialization/types/AgentsAgentProvider.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsAgentProvider: core.serialization.ObjectSchema< + serializers.AgentsAgentProvider.Raw, + Corti.AgentsAgentProvider +> = core.serialization.object({ + organization: core.serialization.string(), + url: core.serialization.string(), +}); + +export declare namespace AgentsAgentProvider { + export interface Raw { + organization: string; + url: string; + } +} diff --git a/src/serialization/types/AgentsAgentReference.ts b/src/serialization/types/AgentsAgentReference.ts new file mode 100644 index 00000000..6a96a179 --- /dev/null +++ b/src/serialization/types/AgentsAgentReference.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsAgentReferenceType } from "./AgentsAgentReferenceType.js"; + +export const AgentsAgentReference: core.serialization.ObjectSchema< + serializers.AgentsAgentReference.Raw, + Corti.AgentsAgentReference +> = core.serialization.object({ + type: AgentsAgentReferenceType, + id: core.serialization.string().optional(), + name: core.serialization.string().optional(), +}); + +export declare namespace AgentsAgentReference { + export interface Raw { + type: AgentsAgentReferenceType.Raw; + id?: string | null; + name?: string | null; + } +} diff --git a/src/serialization/types/AgentsAgentReferenceType.ts b/src/serialization/types/AgentsAgentReferenceType.ts new file mode 100644 index 00000000..687b73af --- /dev/null +++ b/src/serialization/types/AgentsAgentReferenceType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsAgentReferenceType: core.serialization.Schema< + serializers.AgentsAgentReferenceType.Raw, + Corti.AgentsAgentReferenceType +> = core.serialization.enum_(["reference"]); + +export declare namespace AgentsAgentReferenceType { + export type Raw = "reference"; +} diff --git a/src/serialization/types/AgentsAgentResponse.ts b/src/serialization/types/AgentsAgentResponse.ts new file mode 100644 index 00000000..bd90f605 --- /dev/null +++ b/src/serialization/types/AgentsAgentResponse.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsAgent } from "./AgentsAgent.js"; +import { AgentsAgentReference } from "./AgentsAgentReference.js"; + +export const AgentsAgentResponse: core.serialization.Schema< + serializers.AgentsAgentResponse.Raw, + Corti.AgentsAgentResponse +> = core.serialization.undiscriminatedUnion([AgentsAgent, AgentsAgentReference]); + +export declare namespace AgentsAgentResponse { + export type Raw = AgentsAgent.Raw | AgentsAgentReference.Raw; +} diff --git a/src/serialization/types/AgentsAgentSkill.ts b/src/serialization/types/AgentsAgentSkill.ts new file mode 100644 index 00000000..789396d3 --- /dev/null +++ b/src/serialization/types/AgentsAgentSkill.ts @@ -0,0 +1,33 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsMessage } from "./AgentsMessage.js"; + +export const AgentsAgentSkill: core.serialization.ObjectSchema< + serializers.AgentsAgentSkill.Raw, + Corti.AgentsAgentSkill +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string(), + tags: core.serialization.list(core.serialization.string()), + examples: core.serialization.list(AgentsMessage).optionalNullable(), + inputModes: core.serialization.list(core.serialization.string()).optionalNullable(), + outputModes: core.serialization.list(core.serialization.string()).optionalNullable(), + security: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), +}); + +export declare namespace AgentsAgentSkill { + export interface Raw { + id: string; + name: string; + description: string; + tags: string[]; + examples?: (AgentsMessage.Raw[] | null | undefined) | null; + inputModes?: (string[] | null | undefined) | null; + outputModes?: (string[] | null | undefined) | null; + security?: (Record | null | undefined) | null; + } +} diff --git a/src/serialization/types/AgentsArtifact.ts b/src/serialization/types/AgentsArtifact.ts new file mode 100644 index 00000000..63d29168 --- /dev/null +++ b/src/serialization/types/AgentsArtifact.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsPart } from "./AgentsPart.js"; + +export const AgentsArtifact: core.serialization.ObjectSchema = + core.serialization.object({ + artifactId: core.serialization.string(), + name: core.serialization.string().optional(), + description: core.serialization.string().optional(), + parts: core.serialization.list(AgentsPart), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + extensions: core.serialization.list(core.serialization.string()).optional(), + }); + +export declare namespace AgentsArtifact { + export interface Raw { + artifactId: string; + name?: string | null; + description?: string | null; + parts: AgentsPart.Raw[]; + metadata?: Record | null; + extensions?: string[] | null; + } +} diff --git a/src/serialization/types/AgentsContext.ts b/src/serialization/types/AgentsContext.ts new file mode 100644 index 00000000..aea565d3 --- /dev/null +++ b/src/serialization/types/AgentsContext.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsContextItemsItem } from "./AgentsContextItemsItem.js"; + +export const AgentsContext: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optional(), + items: core.serialization.list(AgentsContextItemsItem).optional(), + }); + +export declare namespace AgentsContext { + export interface Raw { + id?: string | null; + items?: AgentsContextItemsItem.Raw[] | null; + } +} diff --git a/src/serialization/types/AgentsContextItemsItem.ts b/src/serialization/types/AgentsContextItemsItem.ts new file mode 100644 index 00000000..51296ae8 --- /dev/null +++ b/src/serialization/types/AgentsContextItemsItem.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsMessage } from "./AgentsMessage.js"; +import { AgentsTask } from "./AgentsTask.js"; + +export const AgentsContextItemsItem: core.serialization.Schema< + serializers.AgentsContextItemsItem.Raw, + Corti.AgentsContextItemsItem +> = core.serialization.undiscriminatedUnion([AgentsTask, AgentsMessage]); + +export declare namespace AgentsContextItemsItem { + export type Raw = AgentsTask.Raw | AgentsMessage.Raw; +} diff --git a/src/serialization/types/AgentsCreateExpert.ts b/src/serialization/types/AgentsCreateExpert.ts new file mode 100644 index 00000000..fb98856f --- /dev/null +++ b/src/serialization/types/AgentsCreateExpert.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsCreateExpertType } from "./AgentsCreateExpertType.js"; +import { AgentsCreateMcpServer } from "./AgentsCreateMcpServer.js"; + +export const AgentsCreateExpert: core.serialization.ObjectSchema< + serializers.AgentsCreateExpert.Raw, + Corti.AgentsCreateExpert +> = core.serialization.object({ + type: AgentsCreateExpertType, + name: core.serialization.string(), + description: core.serialization.string(), + systemPrompt: core.serialization.string().optional(), + mcpServers: core.serialization.list(AgentsCreateMcpServer).optional(), +}); + +export declare namespace AgentsCreateExpert { + export interface Raw { + type: AgentsCreateExpertType.Raw; + name: string; + description: string; + systemPrompt?: string | null; + mcpServers?: AgentsCreateMcpServer.Raw[] | null; + } +} diff --git a/src/serialization/types/AgentsCreateExpertReference.ts b/src/serialization/types/AgentsCreateExpertReference.ts new file mode 100644 index 00000000..db40af90 --- /dev/null +++ b/src/serialization/types/AgentsCreateExpertReference.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsCreateExpertReferenceType } from "./AgentsCreateExpertReferenceType.js"; + +export const AgentsCreateExpertReference: core.serialization.ObjectSchema< + serializers.AgentsCreateExpertReference.Raw, + Corti.AgentsCreateExpertReference +> = core.serialization.object({ + type: AgentsCreateExpertReferenceType, + id: core.serialization.string().optional(), + name: core.serialization.string().optional(), + systemPrompt: core.serialization.string().optional(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace AgentsCreateExpertReference { + export interface Raw { + type: AgentsCreateExpertReferenceType.Raw; + id?: string | null; + name?: string | null; + systemPrompt?: string | null; + config?: Record | null; + } +} diff --git a/src/serialization/types/AgentsCreateExpertReferenceType.ts b/src/serialization/types/AgentsCreateExpertReferenceType.ts new file mode 100644 index 00000000..818e4eaf --- /dev/null +++ b/src/serialization/types/AgentsCreateExpertReferenceType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsCreateExpertReferenceType: core.serialization.Schema< + serializers.AgentsCreateExpertReferenceType.Raw, + Corti.AgentsCreateExpertReferenceType +> = core.serialization.enum_(["reference"]); + +export declare namespace AgentsCreateExpertReferenceType { + export type Raw = "reference"; +} diff --git a/src/serialization/types/AgentsCreateExpertType.ts b/src/serialization/types/AgentsCreateExpertType.ts new file mode 100644 index 00000000..bde62982 --- /dev/null +++ b/src/serialization/types/AgentsCreateExpertType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsCreateExpertType: core.serialization.Schema< + serializers.AgentsCreateExpertType.Raw, + Corti.AgentsCreateExpertType +> = core.serialization.enum_(["new"]); + +export declare namespace AgentsCreateExpertType { + export type Raw = "new"; +} diff --git a/src/serialization/types/AgentsCreateMcpServer.ts b/src/serialization/types/AgentsCreateMcpServer.ts new file mode 100644 index 00000000..a3a17f4b --- /dev/null +++ b/src/serialization/types/AgentsCreateMcpServer.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsCreateMcpServerAuthorizationType } from "./AgentsCreateMcpServerAuthorizationType.js"; +import { AgentsCreateMcpServerTransportType } from "./AgentsCreateMcpServerTransportType.js"; + +export const AgentsCreateMcpServer: core.serialization.ObjectSchema< + serializers.AgentsCreateMcpServer.Raw, + Corti.AgentsCreateMcpServer +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + transportType: AgentsCreateMcpServerTransportType, + authorizationType: AgentsCreateMcpServerAuthorizationType, + authorizationScope: core.serialization.string().optional(), + url: core.serialization.string(), + redirectUrl: core.serialization.string().optional(), + token: core.serialization.string().optional(), +}); + +export declare namespace AgentsCreateMcpServer { + export interface Raw { + name: string; + description?: string | null; + transportType: AgentsCreateMcpServerTransportType.Raw; + authorizationType: AgentsCreateMcpServerAuthorizationType.Raw; + authorizationScope?: string | null; + url: string; + redirectUrl?: string | null; + token?: string | null; + } +} diff --git a/src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts b/src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts new file mode 100644 index 00000000..9447f5d6 --- /dev/null +++ b/src/serialization/types/AgentsCreateMcpServerAuthorizationType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsCreateMcpServerAuthorizationType: core.serialization.Schema< + serializers.AgentsCreateMcpServerAuthorizationType.Raw, + Corti.AgentsCreateMcpServerAuthorizationType +> = core.serialization.enum_(["none", "bearer", "inherit", "oauth2.0"]); + +export declare namespace AgentsCreateMcpServerAuthorizationType { + export type Raw = "none" | "bearer" | "inherit" | "oauth2.0"; +} diff --git a/src/serialization/types/AgentsCreateMcpServerTransportType.ts b/src/serialization/types/AgentsCreateMcpServerTransportType.ts new file mode 100644 index 00000000..8e91252c --- /dev/null +++ b/src/serialization/types/AgentsCreateMcpServerTransportType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsCreateMcpServerTransportType: core.serialization.Schema< + serializers.AgentsCreateMcpServerTransportType.Raw, + Corti.AgentsCreateMcpServerTransportType +> = core.serialization.enum_(["stdio", "streamable_http", "sse"]); + +export declare namespace AgentsCreateMcpServerTransportType { + export type Raw = "stdio" | "streamable_http" | "sse"; +} diff --git a/src/serialization/types/AgentsDataPart.ts b/src/serialization/types/AgentsDataPart.ts new file mode 100644 index 00000000..5dae00cb --- /dev/null +++ b/src/serialization/types/AgentsDataPart.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsDataPartKind } from "./AgentsDataPartKind.js"; + +export const AgentsDataPart: core.serialization.ObjectSchema = + core.serialization.object({ + kind: AgentsDataPartKind, + data: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + }); + +export declare namespace AgentsDataPart { + export interface Raw { + kind: AgentsDataPartKind.Raw; + data: Record; + metadata?: Record | null; + } +} diff --git a/src/serialization/types/AgentsDataPartKind.ts b/src/serialization/types/AgentsDataPartKind.ts new file mode 100644 index 00000000..3f364751 --- /dev/null +++ b/src/serialization/types/AgentsDataPartKind.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsDataPartKind: core.serialization.Schema< + serializers.AgentsDataPartKind.Raw, + Corti.AgentsDataPartKind +> = core.serialization.enum_(["data"]); + +export declare namespace AgentsDataPartKind { + export type Raw = "data"; +} diff --git a/src/serialization/types/AgentsExpert.ts b/src/serialization/types/AgentsExpert.ts new file mode 100644 index 00000000..1b03e633 --- /dev/null +++ b/src/serialization/types/AgentsExpert.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsExpertType } from "./AgentsExpertType.js"; +import { AgentsMcpServer } from "./AgentsMcpServer.js"; + +export const AgentsExpert: core.serialization.ObjectSchema = + core.serialization.object({ + type: AgentsExpertType, + id: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string(), + systemPrompt: core.serialization.string(), + mcpServers: core.serialization.list(AgentsMcpServer).optional(), + }); + +export declare namespace AgentsExpert { + export interface Raw { + type: AgentsExpertType.Raw; + id: string; + name: string; + description: string; + systemPrompt: string; + mcpServers?: AgentsMcpServer.Raw[] | null; + } +} diff --git a/src/serialization/types/AgentsExpertReference.ts b/src/serialization/types/AgentsExpertReference.ts new file mode 100644 index 00000000..00a6167b --- /dev/null +++ b/src/serialization/types/AgentsExpertReference.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsExpertReferenceType } from "./AgentsExpertReferenceType.js"; + +export const AgentsExpertReference: core.serialization.ObjectSchema< + serializers.AgentsExpertReference.Raw, + Corti.AgentsExpertReference +> = core.serialization.object({ + type: AgentsExpertReferenceType, + id: core.serialization.string(), + name: core.serialization.string(), + systemPrompt: core.serialization.string().optional(), + resolvedConfig: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace AgentsExpertReference { + export interface Raw { + type: AgentsExpertReferenceType.Raw; + id: string; + name: string; + systemPrompt?: string | null; + resolvedConfig?: Record | null; + } +} diff --git a/src/serialization/types/AgentsExpertReferenceType.ts b/src/serialization/types/AgentsExpertReferenceType.ts new file mode 100644 index 00000000..f6c6d1ea --- /dev/null +++ b/src/serialization/types/AgentsExpertReferenceType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsExpertReferenceType: core.serialization.Schema< + serializers.AgentsExpertReferenceType.Raw, + Corti.AgentsExpertReferenceType +> = core.serialization.enum_(["reference"]); + +export declare namespace AgentsExpertReferenceType { + export type Raw = "reference"; +} diff --git a/src/serialization/types/AgentsExpertType.ts b/src/serialization/types/AgentsExpertType.ts new file mode 100644 index 00000000..28daa1b9 --- /dev/null +++ b/src/serialization/types/AgentsExpertType.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsExpertType: core.serialization.Schema = + core.serialization.enum_(["expert"]); + +export declare namespace AgentsExpertType { + export type Raw = "expert"; +} diff --git a/src/serialization/types/AgentsFilePart.ts b/src/serialization/types/AgentsFilePart.ts new file mode 100644 index 00000000..8f4d1cea --- /dev/null +++ b/src/serialization/types/AgentsFilePart.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsFilePartFile } from "./AgentsFilePartFile.js"; +import { AgentsFilePartKind } from "./AgentsFilePartKind.js"; + +export const AgentsFilePart: core.serialization.ObjectSchema = + core.serialization.object({ + kind: AgentsFilePartKind, + file: AgentsFilePartFile.optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + }); + +export declare namespace AgentsFilePart { + export interface Raw { + kind: AgentsFilePartKind.Raw; + file?: AgentsFilePartFile.Raw | null; + metadata?: Record | null; + } +} diff --git a/src/serialization/types/AgentsFilePartFile.ts b/src/serialization/types/AgentsFilePartFile.ts new file mode 100644 index 00000000..827a1b4c --- /dev/null +++ b/src/serialization/types/AgentsFilePartFile.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsFileWithBytes } from "./AgentsFileWithBytes.js"; +import { AgentsFileWithUri } from "./AgentsFileWithUri.js"; + +export const AgentsFilePartFile: core.serialization.Schema< + serializers.AgentsFilePartFile.Raw, + Corti.AgentsFilePartFile +> = core.serialization.undiscriminatedUnion([AgentsFileWithUri, AgentsFileWithBytes]); + +export declare namespace AgentsFilePartFile { + export type Raw = AgentsFileWithUri.Raw | AgentsFileWithBytes.Raw; +} diff --git a/src/serialization/types/AgentsFilePartKind.ts b/src/serialization/types/AgentsFilePartKind.ts new file mode 100644 index 00000000..77d4cd42 --- /dev/null +++ b/src/serialization/types/AgentsFilePartKind.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsFilePartKind: core.serialization.Schema< + serializers.AgentsFilePartKind.Raw, + Corti.AgentsFilePartKind +> = core.serialization.enum_(["file"]); + +export declare namespace AgentsFilePartKind { + export type Raw = "file"; +} diff --git a/src/serialization/types/AgentsFileWithBytes.ts b/src/serialization/types/AgentsFileWithBytes.ts new file mode 100644 index 00000000..6bf82871 --- /dev/null +++ b/src/serialization/types/AgentsFileWithBytes.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsFileWithBytes: core.serialization.ObjectSchema< + serializers.AgentsFileWithBytes.Raw, + Corti.AgentsFileWithBytes +> = core.serialization.object({ + bytes: core.serialization.string(), + name: core.serialization.string().optional(), + mimeType: core.serialization.string().optional(), +}); + +export declare namespace AgentsFileWithBytes { + export interface Raw { + bytes: string; + name?: string | null; + mimeType?: string | null; + } +} diff --git a/src/serialization/types/AgentsFileWithUri.ts b/src/serialization/types/AgentsFileWithUri.ts new file mode 100644 index 00000000..f6025b3e --- /dev/null +++ b/src/serialization/types/AgentsFileWithUri.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsFileWithUri: core.serialization.ObjectSchema< + serializers.AgentsFileWithUri.Raw, + Corti.AgentsFileWithUri +> = core.serialization.object({ + uri: core.serialization.string(), + name: core.serialization.string().optional(), + mimeType: core.serialization.string().optional(), +}); + +export declare namespace AgentsFileWithUri { + export interface Raw { + uri: string; + name?: string | null; + mimeType?: string | null; + } +} diff --git a/src/serialization/types/AgentsMcpServer.ts b/src/serialization/types/AgentsMcpServer.ts new file mode 100644 index 00000000..32d26f86 --- /dev/null +++ b/src/serialization/types/AgentsMcpServer.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsMcpServerAuthorizationType } from "./AgentsMcpServerAuthorizationType.js"; +import { AgentsMcpServerTransportType } from "./AgentsMcpServerTransportType.js"; + +export const AgentsMcpServer: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + transportType: AgentsMcpServerTransportType, + authorizationType: AgentsMcpServerAuthorizationType, + authorizationScope: core.serialization.string().optional(), + url: core.serialization.string(), + redirectUrl: core.serialization.string().optionalNullable(), + }); + +export declare namespace AgentsMcpServer { + export interface Raw { + id: string; + name: string; + transportType: AgentsMcpServerTransportType.Raw; + authorizationType: AgentsMcpServerAuthorizationType.Raw; + authorizationScope?: string | null; + url: string; + redirectUrl?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/AgentsMcpServerAuthorizationType.ts b/src/serialization/types/AgentsMcpServerAuthorizationType.ts new file mode 100644 index 00000000..ea666a01 --- /dev/null +++ b/src/serialization/types/AgentsMcpServerAuthorizationType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsMcpServerAuthorizationType: core.serialization.Schema< + serializers.AgentsMcpServerAuthorizationType.Raw, + Corti.AgentsMcpServerAuthorizationType +> = core.serialization.enum_(["none", "bearer", "inherit", "oauth2.0"]); + +export declare namespace AgentsMcpServerAuthorizationType { + export type Raw = "none" | "bearer" | "inherit" | "oauth2.0"; +} diff --git a/src/serialization/types/AgentsMcpServerTransportType.ts b/src/serialization/types/AgentsMcpServerTransportType.ts new file mode 100644 index 00000000..c913b4f7 --- /dev/null +++ b/src/serialization/types/AgentsMcpServerTransportType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsMcpServerTransportType: core.serialization.Schema< + serializers.AgentsMcpServerTransportType.Raw, + Corti.AgentsMcpServerTransportType +> = core.serialization.enum_(["stdio", "streamable_http", "sse"]); + +export declare namespace AgentsMcpServerTransportType { + export type Raw = "stdio" | "streamable_http" | "sse"; +} diff --git a/src/serialization/types/AgentsMessage.ts b/src/serialization/types/AgentsMessage.ts new file mode 100644 index 00000000..0f50d4cc --- /dev/null +++ b/src/serialization/types/AgentsMessage.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsMessageKind } from "./AgentsMessageKind.js"; +import { AgentsMessageRole } from "./AgentsMessageRole.js"; +import { AgentsPart } from "./AgentsPart.js"; + +export const AgentsMessage: core.serialization.ObjectSchema = + core.serialization.object({ + role: AgentsMessageRole, + parts: core.serialization.list(AgentsPart), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + extensions: core.serialization.list(core.serialization.string()).optional(), + referenceTaskIds: core.serialization.list(core.serialization.string()).optional(), + messageId: core.serialization.string(), + taskId: core.serialization.string().optional(), + contextId: core.serialization.string().optional(), + kind: AgentsMessageKind, + }); + +export declare namespace AgentsMessage { + export interface Raw { + role: AgentsMessageRole.Raw; + parts: AgentsPart.Raw[]; + metadata?: Record | null; + extensions?: string[] | null; + referenceTaskIds?: string[] | null; + messageId: string; + taskId?: string | null; + contextId?: string | null; + kind: AgentsMessageKind.Raw; + } +} diff --git a/src/serialization/types/AgentsMessageKind.ts b/src/serialization/types/AgentsMessageKind.ts new file mode 100644 index 00000000..8ce118be --- /dev/null +++ b/src/serialization/types/AgentsMessageKind.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsMessageKind: core.serialization.Schema = + core.serialization.enum_(["message"]); + +export declare namespace AgentsMessageKind { + export type Raw = "message"; +} diff --git a/src/serialization/types/AgentsMessageRole.ts b/src/serialization/types/AgentsMessageRole.ts new file mode 100644 index 00000000..4c3115f9 --- /dev/null +++ b/src/serialization/types/AgentsMessageRole.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsMessageRole: core.serialization.Schema = + core.serialization.enum_(["user", "agent"]); + +export declare namespace AgentsMessageRole { + export type Raw = "user" | "agent"; +} diff --git a/src/serialization/types/AgentsMessageSendConfiguration.ts b/src/serialization/types/AgentsMessageSendConfiguration.ts new file mode 100644 index 00000000..e3bd0a73 --- /dev/null +++ b/src/serialization/types/AgentsMessageSendConfiguration.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsPushNotificationConfig } from "./AgentsPushNotificationConfig.js"; + +export const AgentsMessageSendConfiguration: core.serialization.ObjectSchema< + serializers.AgentsMessageSendConfiguration.Raw, + Corti.AgentsMessageSendConfiguration +> = core.serialization.object({ + acceptedOutputModes: core.serialization.list(core.serialization.string()).optional(), + historyLength: core.serialization.number().optional(), + pushNotificationConfig: AgentsPushNotificationConfig.optional(), + blocking: core.serialization.boolean().optional(), +}); + +export declare namespace AgentsMessageSendConfiguration { + export interface Raw { + acceptedOutputModes?: string[] | null; + historyLength?: number | null; + pushNotificationConfig?: AgentsPushNotificationConfig.Raw | null; + blocking?: boolean | null; + } +} diff --git a/src/serialization/types/AgentsPart.ts b/src/serialization/types/AgentsPart.ts new file mode 100644 index 00000000..cba88209 --- /dev/null +++ b/src/serialization/types/AgentsPart.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsDataPart } from "./AgentsDataPart.js"; +import { AgentsFilePart } from "./AgentsFilePart.js"; +import { AgentsTextPart } from "./AgentsTextPart.js"; + +export const AgentsPart: core.serialization.Schema = + core.serialization.undiscriminatedUnion([AgentsTextPart, AgentsFilePart, AgentsDataPart]); + +export declare namespace AgentsPart { + export type Raw = AgentsTextPart.Raw | AgentsFilePart.Raw | AgentsDataPart.Raw; +} diff --git a/src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts b/src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts new file mode 100644 index 00000000..eb0b5742 --- /dev/null +++ b/src/serialization/types/AgentsPushNotificationAuthenticationInfo.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsPushNotificationAuthenticationInfo: core.serialization.ObjectSchema< + serializers.AgentsPushNotificationAuthenticationInfo.Raw, + Corti.AgentsPushNotificationAuthenticationInfo +> = core.serialization.object({ + schemes: core.serialization.list(core.serialization.string()), + credentials: core.serialization.string().optional(), +}); + +export declare namespace AgentsPushNotificationAuthenticationInfo { + export interface Raw { + schemes: string[]; + credentials?: string | null; + } +} diff --git a/src/serialization/types/AgentsPushNotificationConfig.ts b/src/serialization/types/AgentsPushNotificationConfig.ts new file mode 100644 index 00000000..5c809ea9 --- /dev/null +++ b/src/serialization/types/AgentsPushNotificationConfig.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsPushNotificationAuthenticationInfo } from "./AgentsPushNotificationAuthenticationInfo.js"; + +export const AgentsPushNotificationConfig: core.serialization.ObjectSchema< + serializers.AgentsPushNotificationConfig.Raw, + Corti.AgentsPushNotificationConfig +> = core.serialization.object({ + id: core.serialization.string().optional(), + url: core.serialization.string(), + token: core.serialization.string().optional(), + authentication: AgentsPushNotificationAuthenticationInfo.optional(), +}); + +export declare namespace AgentsPushNotificationConfig { + export interface Raw { + id?: string | null; + url: string; + token?: string | null; + authentication?: AgentsPushNotificationAuthenticationInfo.Raw | null; + } +} diff --git a/src/serialization/types/AgentsRegistryExpert.ts b/src/serialization/types/AgentsRegistryExpert.ts new file mode 100644 index 00000000..674c9ced --- /dev/null +++ b/src/serialization/types/AgentsRegistryExpert.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsRegistryMcpServer } from "./AgentsRegistryMcpServer.js"; + +export const AgentsRegistryExpert: core.serialization.ObjectSchema< + serializers.AgentsRegistryExpert.Raw, + Corti.AgentsRegistryExpert +> = core.serialization.object({ + name: core.serialization.string(), + displayName: core.serialization.string().optional(), + displayDescription: core.serialization.string().optional(), + description: core.serialization.string(), + mcpServers: core.serialization.list(AgentsRegistryMcpServer).optional(), + configSchema: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace AgentsRegistryExpert { + export interface Raw { + name: string; + displayName?: string | null; + displayDescription?: string | null; + description: string; + mcpServers?: AgentsRegistryMcpServer.Raw[] | null; + configSchema?: Record | null; + } +} diff --git a/src/serialization/types/AgentsRegistryExpertsResponse.ts b/src/serialization/types/AgentsRegistryExpertsResponse.ts new file mode 100644 index 00000000..a2654f1f --- /dev/null +++ b/src/serialization/types/AgentsRegistryExpertsResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsRegistryExpert } from "./AgentsRegistryExpert.js"; + +export const AgentsRegistryExpertsResponse: core.serialization.ObjectSchema< + serializers.AgentsRegistryExpertsResponse.Raw, + Corti.AgentsRegistryExpertsResponse +> = core.serialization.object({ + experts: core.serialization.list(AgentsRegistryExpert).optional(), +}); + +export declare namespace AgentsRegistryExpertsResponse { + export interface Raw { + experts?: AgentsRegistryExpert.Raw[] | null; + } +} diff --git a/src/serialization/types/AgentsRegistryMcpServer.ts b/src/serialization/types/AgentsRegistryMcpServer.ts new file mode 100644 index 00000000..7b771629 --- /dev/null +++ b/src/serialization/types/AgentsRegistryMcpServer.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsRegistryMcpServerAuthorizationType } from "./AgentsRegistryMcpServerAuthorizationType.js"; + +export const AgentsRegistryMcpServer: core.serialization.ObjectSchema< + serializers.AgentsRegistryMcpServer.Raw, + Corti.AgentsRegistryMcpServer +> = core.serialization.object({ + name: core.serialization.string(), + authorizationType: AgentsRegistryMcpServerAuthorizationType, +}); + +export declare namespace AgentsRegistryMcpServer { + export interface Raw { + name: string; + authorizationType: AgentsRegistryMcpServerAuthorizationType.Raw; + } +} diff --git a/src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts b/src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts new file mode 100644 index 00000000..29d87c55 --- /dev/null +++ b/src/serialization/types/AgentsRegistryMcpServerAuthorizationType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsRegistryMcpServerAuthorizationType: core.serialization.Schema< + serializers.AgentsRegistryMcpServerAuthorizationType.Raw, + Corti.AgentsRegistryMcpServerAuthorizationType +> = core.serialization.enum_(["none", "bearer", "inherit", "oauth2.0"]); + +export declare namespace AgentsRegistryMcpServerAuthorizationType { + export type Raw = "none" | "bearer" | "inherit" | "oauth2.0"; +} diff --git a/src/serialization/types/AgentsTask.ts b/src/serialization/types/AgentsTask.ts new file mode 100644 index 00000000..7e1fa68d --- /dev/null +++ b/src/serialization/types/AgentsTask.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsArtifact } from "./AgentsArtifact.js"; +import { AgentsMessage } from "./AgentsMessage.js"; +import { AgentsTaskKind } from "./AgentsTaskKind.js"; +import { AgentsTaskStatus } from "./AgentsTaskStatus.js"; + +export const AgentsTask: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + contextId: core.serialization.string(), + status: AgentsTaskStatus, + history: core.serialization.list(AgentsMessage).optional(), + artifacts: core.serialization.list(AgentsArtifact).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + kind: AgentsTaskKind, + }); + +export declare namespace AgentsTask { + export interface Raw { + id: string; + contextId: string; + status: AgentsTaskStatus.Raw; + history?: AgentsMessage.Raw[] | null; + artifacts?: AgentsArtifact.Raw[] | null; + metadata?: Record | null; + kind: AgentsTaskKind.Raw; + } +} diff --git a/src/serialization/types/AgentsTaskKind.ts b/src/serialization/types/AgentsTaskKind.ts new file mode 100644 index 00000000..dc91c875 --- /dev/null +++ b/src/serialization/types/AgentsTaskKind.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsTaskKind: core.serialization.Schema = + core.serialization.enum_(["task"]); + +export declare namespace AgentsTaskKind { + export type Raw = "task"; +} diff --git a/src/serialization/types/AgentsTaskStatus.ts b/src/serialization/types/AgentsTaskStatus.ts new file mode 100644 index 00000000..4511659b --- /dev/null +++ b/src/serialization/types/AgentsTaskStatus.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsMessage } from "./AgentsMessage.js"; +import { AgentsTaskStatusState } from "./AgentsTaskStatusState.js"; + +export const AgentsTaskStatus: core.serialization.ObjectSchema< + serializers.AgentsTaskStatus.Raw, + Corti.AgentsTaskStatus +> = core.serialization.object({ + state: AgentsTaskStatusState, + message: AgentsMessage.optional(), + timestamp: core.serialization.date().optional(), +}); + +export declare namespace AgentsTaskStatus { + export interface Raw { + state: AgentsTaskStatusState.Raw; + message?: AgentsMessage.Raw | null; + timestamp?: string | null; + } +} diff --git a/src/serialization/types/AgentsTaskStatusState.ts b/src/serialization/types/AgentsTaskStatusState.ts new file mode 100644 index 00000000..24e1e1d4 --- /dev/null +++ b/src/serialization/types/AgentsTaskStatusState.ts @@ -0,0 +1,33 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsTaskStatusState: core.serialization.Schema< + serializers.AgentsTaskStatusState.Raw, + Corti.AgentsTaskStatusState +> = core.serialization.enum_([ + "submitted", + "working", + "input-required", + "completed", + "canceled", + "failed", + "rejected", + "auth-required", + "unknown", +]); + +export declare namespace AgentsTaskStatusState { + export type Raw = + | "submitted" + | "working" + | "input-required" + | "completed" + | "canceled" + | "failed" + | "rejected" + | "auth-required" + | "unknown"; +} diff --git a/src/serialization/types/AgentsTextPart.ts b/src/serialization/types/AgentsTextPart.ts new file mode 100644 index 00000000..79c24b59 --- /dev/null +++ b/src/serialization/types/AgentsTextPart.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsTextPartKind } from "./AgentsTextPartKind.js"; + +export const AgentsTextPart: core.serialization.ObjectSchema = + core.serialization.object({ + kind: AgentsTextPartKind, + text: core.serialization.string(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + }); + +export declare namespace AgentsTextPart { + export interface Raw { + kind: AgentsTextPartKind.Raw; + text: string; + metadata?: Record | null; + } +} diff --git a/src/serialization/types/AgentsTextPartKind.ts b/src/serialization/types/AgentsTextPartKind.ts new file mode 100644 index 00000000..202e1895 --- /dev/null +++ b/src/serialization/types/AgentsTextPartKind.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsTextPartKind: core.serialization.Schema< + serializers.AgentsTextPartKind.Raw, + Corti.AgentsTextPartKind +> = core.serialization.enum_(["text"]); + +export declare namespace AgentsTextPartKind { + export type Raw = "text"; +} diff --git a/src/serialization/types/AgentsUpdateExpertReference.ts b/src/serialization/types/AgentsUpdateExpertReference.ts new file mode 100644 index 00000000..950b15d5 --- /dev/null +++ b/src/serialization/types/AgentsUpdateExpertReference.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsCreateExpertReference } from "./AgentsCreateExpertReference.js"; + +export const AgentsUpdateExpertReference: core.serialization.ObjectSchema< + serializers.AgentsUpdateExpertReference.Raw, + Corti.AgentsUpdateExpertReference +> = AgentsCreateExpertReference; + +export declare namespace AgentsUpdateExpertReference { + export type Raw = AgentsCreateExpertReference.Raw; +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 65634424..248401b0 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -12,10 +12,64 @@ export * from "./AgentCardResponseSignaturesItem.js"; export * from "./AgentCardResponseSkillsItem.js"; export * from "./AgentCardResponseSupportedInterfacesItem.js"; export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; +export * from "./AgentsAgent.js"; +export * from "./AgentsAgentCapabilities.js"; +export * from "./AgentsAgentCard.js"; +export * from "./AgentsAgentCardSignature.js"; +export * from "./AgentsAgentExpertsItem.js"; +export * from "./AgentsAgentExtension.js"; +export * from "./AgentsAgentInterface.js"; +export * from "./AgentsAgentProvider.js"; +export * from "./AgentsAgentReference.js"; +export * from "./AgentsAgentReferenceType.js"; +export * from "./AgentsAgentResponse.js"; +export * from "./AgentsAgentSkill.js"; +export * from "./AgentsArtifact.js"; +export * from "./AgentsContext.js"; +export * from "./AgentsContextItemsItem.js"; +export * from "./AgentsCreateExpert.js"; +export * from "./AgentsCreateExpertReference.js"; +export * from "./AgentsCreateExpertReferenceType.js"; +export * from "./AgentsCreateExpertType.js"; +export * from "./AgentsCreateMcpServer.js"; +export * from "./AgentsCreateMcpServerAuthorizationType.js"; +export * from "./AgentsCreateMcpServerTransportType.js"; +export * from "./AgentsDataPart.js"; +export * from "./AgentsDataPartKind.js"; +export * from "./AgentsExpert.js"; +export * from "./AgentsExpertReference.js"; +export * from "./AgentsExpertReferenceType.js"; +export * from "./AgentsExpertType.js"; +export * from "./AgentsFilePart.js"; +export * from "./AgentsFilePartFile.js"; +export * from "./AgentsFilePartKind.js"; +export * from "./AgentsFileWithBytes.js"; +export * from "./AgentsFileWithUri.js"; export * from "./AgentsLabels.js"; export * from "./AgentsLifecycle.js"; export * from "./AgentsListResponse.js"; +export * from "./AgentsMcpServer.js"; +export * from "./AgentsMcpServerAuthorizationType.js"; +export * from "./AgentsMcpServerTransportType.js"; +export * from "./AgentsMessage.js"; +export * from "./AgentsMessageKind.js"; +export * from "./AgentsMessageRole.js"; +export * from "./AgentsMessageSendConfiguration.js"; +export * from "./AgentsPart.js"; +export * from "./AgentsPushNotificationAuthenticationInfo.js"; +export * from "./AgentsPushNotificationConfig.js"; +export * from "./AgentsRegistryExpert.js"; +export * from "./AgentsRegistryExpertsResponse.js"; +export * from "./AgentsRegistryMcpServer.js"; +export * from "./AgentsRegistryMcpServerAuthorizationType.js"; export * from "./AgentsResponse.js"; +export * from "./AgentsTask.js"; +export * from "./AgentsTaskKind.js"; +export * from "./AgentsTaskStatus.js"; +export * from "./AgentsTaskStatusState.js"; +export * from "./AgentsTextPart.js"; +export * from "./AgentsTextPartKind.js"; +export * from "./AgentsUpdateExpertReference.js"; export * from "./AgentsUserIdValue.js"; export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; diff --git a/tests/wire/agentic.test.ts b/tests/wire/agentic.test.ts new file mode 100644 index 00000000..1c5444ca --- /dev/null +++ b/tests/wire/agentic.test.ts @@ -0,0 +1,1089 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../src/api/index"; +import { CortiClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; +import { mockOAuth } from "./mockAuth"; + +describe("AgenticClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + agents: [ + { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "description", + systemPrompt: "systemPrompt", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + labels: { key: "value" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint({ once: false }) + .get("/v2/agentic/agents") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + agents: [ + { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "description", + systemPrompt: "systemPrompt", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + labels: { + key: "value", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + const page = await client.agentic.list({ + label: ["team=coding"], + q: "coder", + }); + + expect(expected.agents).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.agents).toEqual(nextPage.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.agentic.list(); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.agentic.list(); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("create (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { type: "registry", name: "@dedalus/coding-expert" }, + { + type: "mcp", + name: "policybot", + url: "https://mcp.example.com", + auth: { + type: "oauth2", + scope: "read:policies", + redirectUrl: "https://app.corti.ai/oauth/callback", + }, + }, + { + type: "schema", + name: "submit_code", + description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + schema: { + type: "object", + properties: { + code: { type: "string", description: "The selected ICD-10 code." }, + confidence: { type: "number", minimum: 0, maximum: 1 }, + }, + required: ["code"], + }, + transition: "complete", + }, + ], + labels: { team: "coding", env: "prod" }, + }; + const rawResponseBody = { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.create({ + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + type: "registry", + name: "@dedalus/coding-expert", + }, + { + type: "mcp", + name: "policybot", + url: "https://mcp.example.com", + auth: { + type: "oauth2", + scope: "read:policies", + redirectUrl: "https://app.corti.ai/oauth/callback", + }, + }, + { + type: "schema", + name: "submit_code", + description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + schema: { + type: "object", + properties: { + code: { + type: "string", + description: "The selected ICD-10 code.", + }, + confidence: { + type: "number", + minimum: 0, + maximum: 1, + }, + }, + required: ["code"], + }, + transition: "complete", + }, + ], + labels: { + team: "coding", + env: "prod", + }, + }); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }); + }); + + test("create (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.ConflictError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.UnprocessableEntityError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.get("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.get("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.get("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.delete("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.delete("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.delete("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("update (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "coder-v2", connectors: [{ type: "registry", name: "@dedalus/coding-expert" }] }; + const rawResponseBody = { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + name: "coder-v2", + connectors: [ + { + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + }); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }); + }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.UnprocessableEntityError); + }); + + test("getCard (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + documentationUrl: "documentationUrl", + iconUrl: "iconUrl", + version: "0.1.0", + capabilities: { streaming: true, pushNotifications: false }, + defaultInputModes: ["text/plain"], + defaultOutputModes: ["text/plain"], + provider: { organization: "Corti", url: "https://corti.ai" }, + securityRequirements: [{ key: "value" }], + securitySchemes: { key: "value" }, + signatures: [{ protected: "protected", header: { key: "value" }, signature: "signature" }], + skills: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + name: "coding-expert", + description: "ICD-10 coding.", + tags: ["expert"], + }, + ], + supportedInterfaces: [ + { + protocolBinding: "JSONRPC", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + { + protocolBinding: "HTTP+JSON", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/.well-known/agent-card.json") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual({ + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + documentationUrl: "documentationUrl", + iconUrl: "iconUrl", + version: "0.1.0", + capabilities: { + streaming: true, + pushNotifications: false, + }, + defaultInputModes: ["text/plain"], + defaultOutputModes: ["text/plain"], + provider: { + organization: "Corti", + url: "https://corti.ai", + }, + securityRequirements: [ + { + key: "value", + }, + ], + securitySchemes: { + key: "value", + }, + signatures: [ + { + protected: "protected", + header: { + key: "value", + }, + signature: "signature", + }, + ], + skills: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + name: "coding-expert", + description: "ICD-10 coding.", + tags: ["expert"], + }, + ], + supportedInterfaces: [ + { + protocolBinding: "JSONRPC", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + { + protocolBinding: "HTTP+JSON", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + ], + }); + }); + + test("getCard (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.getCard("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("getCard (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.getCard("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agents/a2A.test.ts b/tests/wire/agentic/a2A.test.ts similarity index 95% rename from tests/wire/agents/a2A.test.ts rename to tests/wire/agentic/a2A.test.ts index 3aa742c1..f538c0d9 100644 --- a/tests/wire/agents/a2A.test.ts +++ b/tests/wire/agentic/a2A.test.ts @@ -52,7 +52,7 @@ describe("A2AClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + const response = await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { id: "1", method: "SendMessage", params: { @@ -114,7 +114,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.jsonRpc("agentId", { + return await client.agentic.a2A.jsonRpc("agentId", { id: "id", method: "SendMessage", }); @@ -146,7 +146,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.jsonRpc("agentId", { + return await client.agentic.a2A.jsonRpc("agentId", { id: "id", method: "SendMessage", }); @@ -211,7 +211,7 @@ describe("A2AClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + const response = await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { message: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", role: "ROLE_USER", @@ -291,7 +291,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.sendMessage("agentId", { + return await client.agentic.a2A.sendMessage("agentId", { message: { role: "ROLE_USER", parts: [{}, {}], @@ -325,7 +325,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.sendMessage("agentId", { + return await client.agentic.a2A.sendMessage("agentId", { message: { role: "ROLE_USER", parts: [{}, {}], @@ -359,7 +359,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.sendMessage("agentId", { + return await client.agentic.a2A.sendMessage("agentId", { message: { role: "ROLE_USER", parts: [{}, {}], @@ -399,7 +399,7 @@ describe("A2AClient", () => { .sseBody(rawResponseBody) .build(); - const response = await client.agents.a2A.streamMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + const response = await client.agentic.a2A.streamMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { message: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", role: "ROLE_USER", @@ -449,7 +449,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.streamMessage("agentId", { + return await client.agentic.a2A.streamMessage("agentId", { message: { role: "ROLE_USER", parts: [{}, {}], @@ -483,7 +483,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.streamMessage("agentId", { + return await client.agentic.a2A.streamMessage("agentId", { message: { role: "ROLE_USER", parts: [{}, {}], @@ -517,7 +517,7 @@ describe("A2AClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.streamMessage("agentId", { + return await client.agentic.a2A.streamMessage("agentId", { message: { role: "ROLE_USER", parts: [{}, {}], diff --git a/tests/wire/agents/a2A/tasks.test.ts b/tests/wire/agentic/a2A/tasks.test.ts similarity index 96% rename from tests/wire/agents/a2A/tasks.test.ts rename to tests/wire/agentic/a2A/tasks.test.ts index 068d1336..6bffa2b4 100644 --- a/tests/wire/agents/a2A/tasks.test.ts +++ b/tests/wire/agentic/a2A/tasks.test.ts @@ -136,7 +136,7 @@ describe("TasksClient", () => { nextPageToken: "nextPageToken", totalSize: 42, }; - const page = await client.agents.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + const page = await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); expect(expected.tasks).toEqual(page.data); expect(page.hasNextPage()).toBe(true); @@ -168,7 +168,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.tasks.list("agentId"); + return await client.agentic.a2A.tasks.list("agentId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -247,7 +247,7 @@ describe("TasksClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.a2A.tasks.get( + const response = await client.agentic.a2A.tasks.get( "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", ); @@ -342,7 +342,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.tasks.get("agentId", "taskId"); + return await client.agentic.a2A.tasks.get("agentId", "taskId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -370,7 +370,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.tasks.get("agentId", "taskId"); + return await client.agentic.a2A.tasks.get("agentId", "taskId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -449,7 +449,7 @@ describe("TasksClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.a2A.tasks.cancel( + const response = await client.agentic.a2A.tasks.cancel( "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", ); @@ -544,7 +544,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.tasks.cancel("agentId", "taskId"); + return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -572,7 +572,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.tasks.cancel("agentId", "taskId"); + return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -600,7 +600,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.a2A.tasks.cancel("agentId", "taskId"); + return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); }).rejects.toThrow(Corti.ConflictError); }); @@ -626,7 +626,7 @@ describe("TasksClient", () => { .statusCode(200) .build(); - const response = await client.agents.a2A.tasks.subscribe( + const response = await client.agentic.a2A.tasks.subscribe( "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", ); diff --git a/tests/wire/agents/artifacts.test.ts b/tests/wire/agentic/artifacts.test.ts similarity index 93% rename from tests/wire/agents/artifacts.test.ts rename to tests/wire/agentic/artifacts.test.ts index a7f2caf1..ef140243 100644 --- a/tests/wire/agents/artifacts.test.ts +++ b/tests/wire/agentic/artifacts.test.ts @@ -47,7 +47,7 @@ describe("ArtifactsClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.artifacts.get( + const response = await client.agentic.artifacts.get( "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", @@ -101,7 +101,7 @@ describe("ArtifactsClient", () => { .build(); await expect(async () => { - return await client.agents.artifacts.get("contextId", "taskId", "artifactId"); + return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -128,7 +128,7 @@ describe("ArtifactsClient", () => { .build(); await expect(async () => { - return await client.agents.artifacts.get("contextId", "taskId", "artifactId"); + return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -155,7 +155,7 @@ describe("ArtifactsClient", () => { .build(); await expect(async () => { - return await client.agents.artifacts.get("contextId", "taskId", "artifactId"); + return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents/connectors.test.ts b/tests/wire/agentic/connectors.test.ts similarity index 92% rename from tests/wire/agents/connectors.test.ts rename to tests/wire/agentic/connectors.test.ts index b7a0a187..f09b4596 100644 --- a/tests/wire/agents/connectors.test.ts +++ b/tests/wire/agentic/connectors.test.ts @@ -38,7 +38,7 @@ describe("ConnectorsClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + const response = await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); expect(response).toEqual({ connectors: [ { @@ -77,7 +77,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.list("agentId"); + return await client.agentic.connectors.list("agentId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -104,7 +104,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.list("agentId"); + return await client.agentic.connectors.list("agentId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -137,7 +137,7 @@ describe("ConnectorsClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + const response = await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { type: "registry", name: "@dedalus/coding-expert", }); @@ -176,7 +176,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.attach("agentId", { + return await client.agentic.connectors.attach("agentId", { type: "registry", name: "name", }); @@ -207,7 +207,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.attach("agentId", { + return await client.agentic.connectors.attach("agentId", { type: "registry", name: "name", }); @@ -238,7 +238,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.attach("agentId", { + return await client.agentic.connectors.attach("agentId", { type: "registry", name: "name", }); @@ -269,7 +269,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.attach("agentId", { + return await client.agentic.connectors.attach("agentId", { type: "registry", name: "name", }); @@ -306,7 +306,7 @@ describe("ConnectorsClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.connectors.get( + const response = await client.agentic.connectors.get( "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", ); @@ -344,7 +344,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.get("agentId", "agentConnectorId"); + return await client.agentic.connectors.get("agentId", "agentConnectorId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -371,7 +371,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.get("agentId", "agentConnectorId"); + return await client.agentic.connectors.get("agentId", "agentConnectorId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -396,7 +396,7 @@ describe("ConnectorsClient", () => { .statusCode(200) .build(); - const response = await client.agents.connectors.remove( + const response = await client.agentic.connectors.remove( "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", ); @@ -426,7 +426,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.remove("agentId", "agentConnectorId"); + return await client.agentic.connectors.remove("agentId", "agentConnectorId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -453,7 +453,7 @@ describe("ConnectorsClient", () => { .build(); await expect(async () => { - return await client.agents.connectors.remove("agentId", "agentConnectorId"); + return await client.agentic.connectors.remove("agentId", "agentConnectorId"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents/contexts.test.ts b/tests/wire/agentic/contexts.test.ts similarity index 95% rename from tests/wire/agents/contexts.test.ts rename to tests/wire/agentic/contexts.test.ts index 49863385..20e532a9 100644 --- a/tests/wire/agents/contexts.test.ts +++ b/tests/wire/agentic/contexts.test.ts @@ -88,7 +88,7 @@ describe("ContextsClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + const response = await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); expect(response).toEqual({ id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", @@ -187,7 +187,7 @@ describe("ContextsClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.get("contextId"); + return await client.agentic.contexts.get("contextId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -214,7 +214,7 @@ describe("ContextsClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.get("contextId"); + return await client.agentic.contexts.get("contextId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -237,7 +237,7 @@ describe("ContextsClient", () => { .statusCode(200) .build(); - const response = await client.agents.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + const response = await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); expect(response).toEqual(undefined); }); @@ -264,7 +264,7 @@ describe("ContextsClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.delete("contextId"); + return await client.agentic.contexts.delete("contextId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -291,7 +291,7 @@ describe("ContextsClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.delete("contextId"); + return await client.agentic.contexts.delete("contextId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -358,7 +358,7 @@ describe("ContextsClient", () => { nextPageToken: "nextPageToken", totalSize: 42, }; - const page = await client.agents.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + const page = await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); expect(expected.traces).toEqual(page.data); expect(page.hasNextPage()).toBe(true); @@ -389,7 +389,7 @@ describe("ContextsClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.getTrace("contextId"); + return await client.agentic.contexts.getTrace("contextId"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -416,7 +416,7 @@ describe("ContextsClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.getTrace("contextId"); + return await client.agentic.contexts.getTrace("contextId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -443,7 +443,7 @@ describe("ContextsClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.getTrace("contextId"); + return await client.agentic.contexts.getTrace("contextId"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents/contexts/tasks.test.ts b/tests/wire/agentic/contexts/tasks.test.ts similarity index 96% rename from tests/wire/agents/contexts/tasks.test.ts rename to tests/wire/agentic/contexts/tasks.test.ts index 2cc2f7e3..b0d73b0a 100644 --- a/tests/wire/agents/contexts/tasks.test.ts +++ b/tests/wire/agentic/contexts/tasks.test.ts @@ -135,7 +135,7 @@ describe("TasksClient", () => { nextPageToken: "nextPageToken", totalSize: 42, }; - const page = await client.agents.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + const page = await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); expect(expected.tasks).toEqual(page.data); expect(page.hasNextPage()).toBe(true); @@ -166,7 +166,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.tasks.list("contextId"); + return await client.agentic.contexts.tasks.list("contextId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -193,7 +193,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.tasks.list("contextId"); + return await client.agentic.contexts.tasks.list("contextId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -271,7 +271,7 @@ describe("TasksClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.contexts.tasks.get( + const response = await client.agentic.contexts.tasks.get( "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", ); @@ -365,7 +365,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.tasks.get("contextId", "taskId"); + return await client.agentic.contexts.tasks.get("contextId", "taskId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -392,7 +392,7 @@ describe("TasksClient", () => { .build(); await expect(async () => { - return await client.agents.contexts.tasks.get("contextId", "taskId"); + return await client.agentic.contexts.tasks.get("contextId", "taskId"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents/feedback.test.ts b/tests/wire/agentic/feedback.test.ts similarity index 95% rename from tests/wire/agents/feedback.test.ts rename to tests/wire/agentic/feedback.test.ts index 816a5132..510caa9c 100644 --- a/tests/wire/agents/feedback.test.ts +++ b/tests/wire/agentic/feedback.test.ts @@ -44,7 +44,7 @@ describe("FeedbackClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.feedback.list( + const response = await client.agentic.feedback.list( "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", ); @@ -95,7 +95,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.list("contextId", "taskId"); + return await client.agentic.feedback.list("contextId", "taskId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -122,7 +122,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.list("contextId", "taskId"); + return await client.agentic.feedback.list("contextId", "taskId"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -165,7 +165,7 @@ describe("FeedbackClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.feedback.create( + const response = await client.agentic.feedback.create( "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { @@ -248,7 +248,7 @@ describe("FeedbackClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.feedback.create( + const response = await client.agentic.feedback.create( "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { @@ -318,7 +318,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.create("contextId", "taskId", { + return await client.agentic.feedback.create("contextId", "taskId", { rating: { scale: "binary", value: 1.1, @@ -351,7 +351,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.create("contextId", "taskId", { + return await client.agentic.feedback.create("contextId", "taskId", { rating: { scale: "binary", value: 1.1, @@ -384,7 +384,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.create("contextId", "taskId", { + return await client.agentic.feedback.create("contextId", "taskId", { rating: { scale: "binary", value: 1.1, @@ -417,7 +417,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.create("contextId", "taskId", { + return await client.agentic.feedback.create("contextId", "taskId", { rating: { scale: "binary", value: 1.1, @@ -447,7 +447,7 @@ describe("FeedbackClient", () => { .statusCode(200) .build(); - const response = await client.agents.feedback.delete( + const response = await client.agentic.feedback.delete( "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", ); @@ -477,7 +477,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.delete("contextId", "taskId"); + return await client.agentic.feedback.delete("contextId", "taskId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -504,7 +504,7 @@ describe("FeedbackClient", () => { .build(); await expect(async () => { - return await client.agents.feedback.delete("contextId", "taskId"); + return await client.agentic.feedback.delete("contextId", "taskId"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents/registry.test.ts b/tests/wire/agentic/registry.test.ts similarity index 96% rename from tests/wire/agents/registry.test.ts rename to tests/wire/agentic/registry.test.ts index bca1c68c..7a353ce4 100644 --- a/tests/wire/agents/registry.test.ts +++ b/tests/wire/agentic/registry.test.ts @@ -75,7 +75,7 @@ describe("RegistryClient", () => { nextPageToken: "nextPageToken", totalSize: 42, }; - const page = await client.agents.registry.list(); + const page = await client.agentic.registry.list(); expect(expected.connectors).toEqual(page.data); expect(page.hasNextPage()).toBe(true); @@ -106,7 +106,7 @@ describe("RegistryClient", () => { .build(); await expect(async () => { - return await client.agents.registry.list(); + return await client.agentic.registry.list(); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -157,7 +157,7 @@ describe("RegistryClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.registry.get("connectorId"); + const response = await client.agentic.registry.get("connectorId"); expect(response).toEqual({ id: "@dedalus/coding-expert", type: "registry", @@ -211,7 +211,7 @@ describe("RegistryClient", () => { .build(); await expect(async () => { - return await client.agents.registry.get("connectorId"); + return await client.agentic.registry.get("connectorId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -238,7 +238,7 @@ describe("RegistryClient", () => { .build(); await expect(async () => { - return await client.agents.registry.get("connectorId"); + return await client.agentic.registry.get("connectorId"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents/usage.test.ts b/tests/wire/agentic/usage.test.ts similarity index 94% rename from tests/wire/agents/usage.test.ts rename to tests/wire/agentic/usage.test.ts index 11536517..c7586319 100644 --- a/tests/wire/agents/usage.test.ts +++ b/tests/wire/agentic/usage.test.ts @@ -47,7 +47,7 @@ describe("UsageClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.agents.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + const response = await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { from: new Date("2026-05-19T00:00:00.000Z"), to: new Date("2026-05-20T00:00:00.000Z"), }); @@ -99,7 +99,7 @@ describe("UsageClient", () => { .build(); await expect(async () => { - return await client.agents.usage.get("agentId"); + return await client.agentic.usage.get("agentId"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -126,7 +126,7 @@ describe("UsageClient", () => { .build(); await expect(async () => { - return await client.agents.usage.get("agentId"); + return await client.agentic.usage.get("agentId"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -153,7 +153,7 @@ describe("UsageClient", () => { .build(); await expect(async () => { - return await client.agents.usage.get("agentId"); + return await client.agentic.usage.get("agentId"); }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agents.test.ts b/tests/wire/agents.test.ts index 5c721075..9e0692d2 100644 --- a/tests/wire/agents.test.ts +++ b/tests/wire/agents.test.ts @@ -18,78 +18,54 @@ describe("AgentsClient", () => { environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawResponseBody = { - agents: [ - { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "description", - systemPrompt: "systemPrompt", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - labels: { key: "value" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint({ once: false }) - .get("/v2/agentic/agents") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - agents: [ - { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "description", - systemPrompt: "systemPrompt", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - labels: { - key: "value", + const rawResponseBody = [ + { + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ + { + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - const page = await client.agents.list({ - label: ["team=coding"], - q: "coder", - }); - - expect(expected.agents).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.agents).toEqual(nextPage.data); + ], + mcpServers: [{ id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }], + }, + ]; + + server.mockEndpoint().get("/agents").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.agents.list(); + expect(response).toEqual([ + { + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ + { + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + }, + ], + mcpServers: [ + { + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + url: "url", + }, + ], + }, + ]); }); test("list (2)", async () => { @@ -106,7 +82,7 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + server.mockEndpoint().get("/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { return await client.agents.list(); @@ -127,7 +103,7 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + server.mockEndpoint().get("/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { return await client.agents.list(); @@ -145,68 +121,40 @@ describe("AgentsClient", () => { tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { type: "registry", name: "@dedalus/coding-expert" }, - { - type: "mcp", - name: "policybot", - url: "https://mcp.example.com", - auth: { - type: "oauth2", - scope: "read:policies", - redirectUrl: "https://app.corti.ai/oauth/callback", - }, - }, + const rawRequestBody = { name: "name", description: "description" }; + const rawResponseBody = { + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ { - type: "schema", - name: "submit_code", - description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - schema: { - type: "object", - properties: { - code: { type: "string", description: "The selected ICD-10 code." }, - confidence: { type: "number", minimum: 0, maximum: 1 }, - }, - required: ["code"], - }, - transition: "complete", + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + mcpServers: [ + { id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }, + ], }, ], - labels: { team: "coding", env: "prod" }, - }; - const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ + mcpServers: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + authorizationScope: "authorizationScope", + url: "url", + redirectUrl: "redirectUrl", }, ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }; server .mockEndpoint() - .post("/v2/agentic/agents") + .post("/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -214,80 +162,43 @@ describe("AgentsClient", () => { .build(); const response = await client.agents.create({ - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - type: "registry", - name: "@dedalus/coding-expert", - }, - { - type: "mcp", - name: "policybot", - url: "https://mcp.example.com", - auth: { - type: "oauth2", - scope: "read:policies", - redirectUrl: "https://app.corti.ai/oauth/callback", - }, - }, + name: "name", + description: "description", + }); + expect(response).toEqual({ + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ { - type: "schema", - name: "submit_code", - description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - schema: { - type: "object", - properties: { - code: { - type: "string", - description: "The selected ICD-10 code.", - }, - confidence: { - type: "number", - minimum: 0, - maximum: 1, - }, + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + mcpServers: [ + { + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + url: "url", }, - required: ["code"], - }, - transition: "complete", + ], }, ], - labels: { - team: "coding", - env: "prod", - }, - }); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ + mcpServers: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + authorizationScope: "authorizationScope", + url: "url", + redirectUrl: "redirectUrl", }, ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }); }); @@ -302,12 +213,12 @@ describe("AgentsClient", () => { tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "x" }; + const rawRequestBody = { name: "name", description: "description" }; const rawResponseBody = { key: "value" }; server .mockEndpoint() - .post("/v2/agentic/agents") + .post("/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -316,7 +227,8 @@ describe("AgentsClient", () => { await expect(async () => { return await client.agents.create({ - name: "x", + name: "name", + description: "description", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -332,12 +244,12 @@ describe("AgentsClient", () => { tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "x" }; + const rawRequestBody = { name: "name", description: "description" }; const rawResponseBody = { key: "value" }; server .mockEndpoint() - .post("/v2/agentic/agents") + .post("/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(401) @@ -346,7 +258,8 @@ describe("AgentsClient", () => { await expect(async () => { return await client.agents.create({ - name: "x", + name: "name", + description: "description", }); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -362,72 +275,12 @@ describe("AgentsClient", () => { tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.create({ - name: "x", - }); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.create({ - name: "x", - }); - }).rejects.toThrow(Corti.ConflictError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; + const rawRequestBody = { name: "name", description: "description" }; const rawResponseBody = { key: "value" }; server .mockEndpoint() - .post("/v2/agentic/agents") + .post("/agents") .jsonBody(rawRequestBody) .respondWith() .statusCode(422) @@ -436,7 +289,8 @@ describe("AgentsClient", () => { await expect(async () => { return await client.agents.create({ - name: "x", + name: "name", + description: "description", }); }).rejects.toThrow(Corti.UnprocessableEntityError); }); @@ -454,63 +308,78 @@ describe("AgentsClient", () => { }); const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ + { + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + mcpServers: [ + { id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }, + ], + }, + ], + mcpServers: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + authorizationScope: "authorizationScope", + url: "url", + redirectUrl: "redirectUrl", }, ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }; server .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .get("/agents/12345678-90ab-cdef-gh12-34567890abc") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.agents.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + const response = await client.agents.get("12345678-90ab-cdef-gh12-34567890abc"); expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + mcpServers: [ + { + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + url: "url", + }, + ], + }, + ], + mcpServers: [ + { + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + authorizationScope: "authorizationScope", + url: "url", + redirectUrl: "redirectUrl", }, ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }); }); @@ -528,17 +397,11 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/agents/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.agents.get("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); + return await client.agents.get("id"); + }).rejects.toThrow(Corti.BadRequestError); }); test("get (3)", async () => { @@ -555,17 +418,11 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/agents/id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.agents.get("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); + return await client.agents.get("id"); + }).rejects.toThrow(Corti.UnauthorizedError); }); test("get (4)", async () => { @@ -582,16 +439,10 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/agents/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.agents.get("agentId"); + return await client.agents.get("id"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -609,12 +460,12 @@ describe("AgentsClient", () => { server .mockEndpoint() - .delete("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .delete("/agents/12345678-90ab-cdef-gh12-34567890abc") .respondWith() .statusCode(200) .build(); - const response = await client.agents.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + const response = await client.agents.delete("12345678-90ab-cdef-gh12-34567890abc"); expect(response).toEqual(undefined); }); @@ -632,17 +483,11 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().delete("/agents/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.agents.delete("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); + return await client.agents.delete("id"); + }).rejects.toThrow(Corti.BadRequestError); }); test("delete (3)", async () => { @@ -659,17 +504,11 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().delete("/agents/id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.agents.delete("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); + return await client.agents.delete("id"); + }).rejects.toThrow(Corti.UnauthorizedError); }); test("delete (4)", async () => { @@ -686,16 +525,10 @@ describe("AgentsClient", () => { const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().delete("/agents/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { - return await client.agents.delete("agentId"); + return await client.agents.delete("id"); }).rejects.toThrow(Corti.NotFoundError); }); @@ -710,74 +543,81 @@ describe("AgentsClient", () => { tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); - const rawRequestBody = { name: "coder-v2", connectors: [{ type: "registry", name: "@dedalus/coding-expert" }] }; + const rawRequestBody = {}; const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ + { + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + mcpServers: [ + { id: "id", name: "name", transportType: "stdio", authorizationType: "none", url: "url" }, + ], + }, + ], + mcpServers: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + authorizationScope: "authorizationScope", + url: "url", + redirectUrl: "redirectUrl", }, ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }; server .mockEndpoint() - .patch("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .patch("/agents/12345678-90ab-cdef-gh12-34567890abc") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.agents.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - name: "coder-v2", - connectors: [ + const response = await client.agents.update("12345678-90ab-cdef-gh12-34567890abc"); + expect(response).toEqual({ + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + experts: [ { - type: "registry", - name: "@dedalus/coding-expert", + type: "expert", + id: "id", + name: "name", + description: "description", + systemPrompt: "systemPrompt", + mcpServers: [ + { + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + url: "url", + }, + ], }, ], - }); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ + mcpServers: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, + id: "id", + name: "name", + transportType: "stdio", + authorizationType: "none", + authorizationScope: "authorizationScope", + url: "url", + redirectUrl: "redirectUrl", }, ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", }); }); @@ -797,7 +637,7 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/v2/agentic/agents/agentId") + .patch("/agents/id") .jsonBody(rawRequestBody) .respondWith() .statusCode(400) @@ -805,7 +645,7 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("agentId"); + return await client.agents.update("id"); }).rejects.toThrow(Corti.BadRequestError); }); @@ -825,7 +665,7 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/v2/agentic/agents/agentId") + .patch("/agents/id") .jsonBody(rawRequestBody) .respondWith() .statusCode(401) @@ -833,7 +673,7 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("agentId"); + return await client.agents.update("id"); }).rejects.toThrow(Corti.UnauthorizedError); }); @@ -853,35 +693,7 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agents.update("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") + .patch("/agents/id") .jsonBody(rawRequestBody) .respondWith() .statusCode(404) @@ -889,11 +701,11 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("agentId"); + return await client.agents.update("id"); }).rejects.toThrow(Corti.NotFoundError); }); - test("update (6)", async () => { + test("update (5)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -909,7 +721,7 @@ describe("AgentsClient", () => { server .mockEndpoint() - .patch("/v2/agentic/agents/agentId") + .patch("/agents/id") .jsonBody(rawRequestBody) .respondWith() .statusCode(422) @@ -917,7 +729,7 @@ describe("AgentsClient", () => { .build(); await expect(async () => { - return await client.agents.update("agentId"); + return await client.agents.update("id"); }).rejects.toThrow(Corti.UnprocessableEntityError); }); @@ -934,106 +746,1223 @@ describe("AgentsClient", () => { }); const rawResponseBody = { - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - documentationUrl: "documentationUrl", + protocolVersion: "protocolVersion", + name: "name", + description: "description", + url: "url", + preferredTransport: "preferredTransport", + additionalInterfaces: [{ url: "url", transport: "transport" }], iconUrl: "iconUrl", - version: "0.1.0", - capabilities: { streaming: true, pushNotifications: false }, - defaultInputModes: ["text/plain"], - defaultOutputModes: ["text/plain"], - provider: { organization: "Corti", url: "https://corti.ai" }, - securityRequirements: [{ key: "value" }], + documentationUrl: "documentationUrl", + provider: { organization: "organization", url: "url" }, + version: "version", + capabilities: { + streaming: true, + pushNotifications: true, + stateTransitionHistory: true, + extensions: [{ uri: "uri" }], + }, securitySchemes: { key: "value" }, - signatures: [{ protected: "protected", header: { key: "value" }, signature: "signature" }], + security: { key: "value" }, + defaultInputModes: ["defaultInputModes"], + defaultOutputModes: ["defaultOutputModes"], skills: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - name: "coding-expert", - description: "ICD-10 coding.", - tags: ["expert"], - }, - ], - supportedInterfaces: [ - { - protocolBinding: "JSONRPC", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - { - protocolBinding: "HTTP+JSON", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + id: "id", + name: "name", + description: "description", + tags: ["tags"], + examples: [ + { + role: "user", + parts: [{ kind: "text", text: "text" }], + messageId: "messageId", + kind: "message", + }, + ], + inputModes: ["inputModes"], + outputModes: ["outputModes"], + security: { key: "value" }, }, ], + supportsAuthenticatedExtendedCard: true, + signatures: [{ protected: "protected", signature: "signature", header: { key: "value" } }], }; server .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/.well-known/agent-card.json") + .get("/agents/12345678-90ab-cdef-gh12-34567890abc/agent-card.json") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.agents.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + const response = await client.agents.getCard("12345678-90ab-cdef-gh12-34567890abc"); expect(response).toEqual({ - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - documentationUrl: "documentationUrl", + protocolVersion: "protocolVersion", + name: "name", + description: "description", + url: "url", + preferredTransport: "preferredTransport", + additionalInterfaces: [ + { + url: "url", + transport: "transport", + }, + ], iconUrl: "iconUrl", - version: "0.1.0", + documentationUrl: "documentationUrl", + provider: { + organization: "organization", + url: "url", + }, + version: "version", capabilities: { streaming: true, - pushNotifications: false, - }, - defaultInputModes: ["text/plain"], - defaultOutputModes: ["text/plain"], - provider: { - organization: "Corti", - url: "https://corti.ai", + pushNotifications: true, + stateTransitionHistory: true, + extensions: [ + { + uri: "uri", + }, + ], }, - securityRequirements: [ - { - key: "value", - }, - ], securitySchemes: { key: "value", }, - signatures: [ + security: { + key: "value", + }, + defaultInputModes: ["defaultInputModes"], + defaultOutputModes: ["defaultOutputModes"], + skills: [ { - protected: "protected", - header: { - key: "value", + id: "id", + name: "name", + description: "description", + tags: ["tags"], + examples: [ + { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + ], + inputModes: ["inputModes"], + outputModes: ["outputModes"], + security: { + key: "value", }, + }, + ], + supportsAuthenticatedExtendedCard: true, + signatures: [ + { + protected: "protected", signature: "signature", + header: { + key: "value", + }, + }, + ], + }); + }); + + test("getCard (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/agent-card.json") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getCard("id"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("getCard (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/agent-card.json") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getCard("id"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("getCard (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/agent-card.json") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getCard("id"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("messageSend (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { role: "user", parts: [{ kind: "text", text: "text" }], messageId: "messageId", kind: "message" }, + }; + const rawResponseBody = { + message: { + role: "user", + parts: [{ kind: "text", text: "text" }], + metadata: { key: "value" }, + extensions: ["extensions"], + referenceTaskIds: ["referenceTaskIds"], + messageId: "messageId", + taskId: "taskId", + contextId: "contextId", + kind: "message", + }, + task: { + id: "id", + contextId: "contextId", + status: { + state: "submitted", + message: { + role: "user", + parts: [{ kind: "text", text: "text" }], + messageId: "messageId", + kind: "message", + }, + timestamp: "2024-01-15T09:30:00Z", + }, + history: [ + { role: "user", parts: [{ kind: "text", text: "text" }], messageId: "messageId", kind: "message" }, + ], + artifacts: [{ artifactId: "artifactId", parts: [{ kind: "text", text: "text" }] }], + metadata: { key: "value" }, + kind: "task", + }, + }; + + server + .mockEndpoint() + .post("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/message:send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", { + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + }); + expect(response).toEqual({ + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + metadata: { + key: "value", + }, + extensions: ["extensions"], + referenceTaskIds: ["referenceTaskIds"], + messageId: "messageId", + taskId: "taskId", + contextId: "contextId", + kind: "message", + }, + task: { + id: "id", + contextId: "contextId", + status: { + state: "submitted", + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + timestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + history: [ + { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + ], + artifacts: [ + { + artifactId: "artifactId", + parts: [ + { + kind: "text", + text: "text", + }, + ], + }, + ], + metadata: { + key: "value", + }, + kind: "task", + }, + }); + }); + + test("messageSend (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + role: "user", + parts: [ + { kind: "text", text: "text" }, + { kind: "text", text: "text" }, + ], + messageId: "messageId", + kind: "message", + }, + }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/agents/id/v1/message:send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.messageSend("id", { + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("messageSend (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + role: "user", + parts: [ + { kind: "text", text: "text" }, + { kind: "text", text: "text" }, + ], + messageId: "messageId", + kind: "message", + }, + }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/agents/id/v1/message:send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.messageSend("id", { + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("messageSend (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + role: "user", + parts: [ + { kind: "text", text: "text" }, + { kind: "text", text: "text" }, + ], + messageId: "messageId", + kind: "message", + }, + }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/agents/id/v1/message:send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.messageSend("id", { + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + }); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("messageSend (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + role: "user", + parts: [ + { kind: "text", text: "text" }, + { kind: "text", text: "text" }, + ], + messageId: "messageId", + kind: "message", + }, + }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/agents/id/v1/message:send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.messageSend("id", { + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("messageSend (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + role: "user", + parts: [ + { kind: "text", text: "text" }, + { kind: "text", text: "text" }, + ], + messageId: "messageId", + kind: "message", + }, + }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/agents/id/v1/message:send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.messageSend("id", { + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + }); + }).rejects.toThrow(Corti.UnprocessableEntityError); + }); + + test("getTask (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "id", + contextId: "contextId", + status: { + state: "submitted", + message: { + role: "user", + parts: [{ kind: "text", text: "text" }], + metadata: { key: "value" }, + extensions: ["extensions"], + referenceTaskIds: ["referenceTaskIds"], + messageId: "messageId", + taskId: "taskId", + contextId: "contextId", + kind: "message", + }, + timestamp: "2024-01-15T09:30:00Z", + }, + history: [ + { + role: "user", + parts: [{ kind: "text", text: "text" }], + metadata: { key: "value" }, + extensions: ["extensions"], + referenceTaskIds: ["referenceTaskIds"], + messageId: "messageId", + taskId: "taskId", + contextId: "contextId", + kind: "message", + }, + ], + artifacts: [ + { + artifactId: "artifactId", + name: "name", + description: "description", + parts: [{ kind: "text", text: "text" }], + metadata: { key: "value" }, + extensions: ["extensions"], + }, + ], + metadata: { key: "value" }, + kind: "task", + }; + + server + .mockEndpoint() + .get("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/tasks/taskId") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.getTask("12345678-90ab-cdef-gh12-34567890abc", "taskId"); + expect(response).toEqual({ + id: "id", + contextId: "contextId", + status: { + state: "submitted", + message: { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + metadata: { + key: "value", + }, + extensions: ["extensions"], + referenceTaskIds: ["referenceTaskIds"], + messageId: "messageId", + taskId: "taskId", + contextId: "contextId", + kind: "message", + }, + timestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + history: [ + { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + metadata: { + key: "value", + }, + extensions: ["extensions"], + referenceTaskIds: ["referenceTaskIds"], + messageId: "messageId", + taskId: "taskId", + contextId: "contextId", + kind: "message", + }, + ], + artifacts: [ + { + artifactId: "artifactId", + name: "name", + description: "description", + parts: [ + { + kind: "text", + text: "text", + }, + ], + metadata: { + key: "value", + }, + extensions: ["extensions"], + }, + ], + metadata: { + key: "value", + }, + kind: "task", + }); + }); + + test("getTask (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/v1/tasks/taskId") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getTask("id", "taskId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("getTask (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/v1/tasks/taskId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getTask("id", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("getTask (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/v1/tasks/taskId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getTask("id", "taskId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("getTask (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/v1/tasks/taskId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getTask("id", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("getContext (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "id", + items: [ + { + id: "id", + contextId: "contextId", + status: { state: "submitted" }, + history: [ + { + role: "user", + parts: [{ kind: "text", text: "text" }], + messageId: "messageId", + kind: "message", + }, + ], + artifacts: [{ artifactId: "artifactId", parts: [{ kind: "text", text: "text" }] }], + metadata: { key: "value" }, + kind: "task", }, ], - skills: [ + }; + + server + .mockEndpoint() + .get("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/contexts/contextId") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.getContext("12345678-90ab-cdef-gh12-34567890abc", "contextId"); + expect(response).toEqual({ + id: "id", + items: [ { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - name: "coding-expert", - description: "ICD-10 coding.", - tags: ["expert"], + id: "id", + contextId: "contextId", + status: { + state: "submitted", + }, + history: [ + { + role: "user", + parts: [ + { + kind: "text", + text: "text", + }, + ], + messageId: "messageId", + kind: "message", + }, + ], + artifacts: [ + { + artifactId: "artifactId", + parts: [ + { + kind: "text", + text: "text", + }, + ], + }, + ], + metadata: { + key: "value", + }, + kind: "task", }, ], - supportedInterfaces: [ + }); + }); + + test("getContext (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/v1/contexts/contextId") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getContext("id", "contextId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("getContext (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/v1/contexts/contextId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getContext("id", "contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("getContext (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/id/v1/contexts/contextId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getContext("id", "contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("deleteContext (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/agents/12345678-90ab-cdef-gh12-34567890abc/v1/contexts/contextId") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agents.deleteContext("12345678-90ab-cdef-gh12-34567890abc", "contextId"); + expect(response).toEqual(undefined); + }); + + test("deleteContext (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/agents/id/v1/contexts/contextId") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.deleteContext("id", "contextId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("deleteContext (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/agents/id/v1/contexts/contextId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.deleteContext("id", "contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("deleteContext (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/agents/id/v1/contexts/contextId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.deleteContext("id", "contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("getRegistryExperts (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + experts: [ { - protocolBinding: "JSONRPC", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + name: "name", + displayName: "displayName", + displayDescription: "displayDescription", + description: "description", + mcpServers: [{ name: "name", authorizationType: "none" }], + configSchema: { key: "value" }, }, + ], + }; + + server + .mockEndpoint() + .get("/agents/registry/experts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.getRegistryExperts({ + limit: 100, + offset: 0, + }); + expect(response).toEqual({ + experts: [ { - protocolBinding: "HTTP+JSON", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + name: "name", + displayName: "displayName", + displayDescription: "displayDescription", + description: "description", + mcpServers: [ + { + name: "name", + authorizationType: "none", + }, + ], + configSchema: { + key: "value", + }, }, ], }); }); - test("getCard (2)", async () => { + test("getRegistryExperts (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/agents/registry/experts") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getRegistryExperts(); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("getRegistryExperts (3)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -1049,18 +1978,18 @@ describe("AgentsClient", () => { server .mockEndpoint() - .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") + .get("/agents/registry/experts") .respondWith() .statusCode(401) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.agents.getCard("agentId"); + return await client.agents.getRegistryExperts(); }).rejects.toThrow(Corti.UnauthorizedError); }); - test("getCard (3)", async () => { + test("getRegistryExperts (4)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -1076,14 +2005,14 @@ describe("AgentsClient", () => { server .mockEndpoint() - .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") + .get("/agents/registry/experts") .respondWith() - .statusCode(404) + .statusCode(422) .jsonBody(rawResponseBody) .build(); await expect(async () => { - return await client.agents.getCard("agentId"); - }).rejects.toThrow(Corti.NotFoundError); + return await client.agents.getRegistryExperts(); + }).rejects.toThrow(Corti.UnprocessableEntityError); }); }); From ba1cd02e4f009c66555319b2ed81074ceb34e2c8 Mon Sep 17 00:00:00 2001 From: markitosha Date: Wed, 29 Jul 2026 15:33:02 +0200 Subject: [PATCH 06/18] feat(agents): keep deprecated agents v1 and add agentic v2 namespace Restore v1 agents API under client.agents (deprecated) and expose Agents API v2 as client.agentic, with CustomAgentic helpers and restored v1 integration tests. --- src/BaseClient.ts | 4 +- src/custom/CortiClient.ts | 7 + src/custom/agents/CustomAgentic.ts | 27 + src/custom/agents/CustomAgents.ts | 9 +- src/version.ts | 2 +- tests/custom/agents.create.integration.ts | 196 +++++++ tests/custom/agents.delete.integration.ts | 55 ++ .../agents.deleteContext.integration.ts | 94 ++++ tests/custom/agents.get.integration.ts | 55 ++ tests/custom/agents.getCard.integration.ts | 55 ++ tests/custom/agents.getCardUrl.integration.ts | 63 +++ tests/custom/agents.getContext.integration.ts | 166 ++++++ .../agents.getRegistryExperts.integration.ts | 67 +++ tests/custom/agents.getTask.integration.ts | 124 +++++ tests/custom/agents.list.integration.ts | 92 +++ .../custom/agents.messageSend.integration.ts | 523 ++++++++++++++++++ tests/custom/agents.update.integration.ts | 131 +++++ 17 files changed, 1664 insertions(+), 6 deletions(-) create mode 100644 src/custom/agents/CustomAgentic.ts create mode 100644 tests/custom/agents.create.integration.ts create mode 100644 tests/custom/agents.delete.integration.ts create mode 100644 tests/custom/agents.deleteContext.integration.ts create mode 100644 tests/custom/agents.get.integration.ts create mode 100644 tests/custom/agents.getCard.integration.ts create mode 100644 tests/custom/agents.getCardUrl.integration.ts create mode 100644 tests/custom/agents.getContext.integration.ts create mode 100644 tests/custom/agents.getRegistryExperts.integration.ts create mode 100644 tests/custom/agents.getTask.integration.ts create mode 100644 tests/custom/agents.list.integration.ts create mode 100644 tests/custom/agents.messageSend.integration.ts create mode 100644 tests/custom/agents.update.integration.ts diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 27d389e5..203dc47b 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -55,8 +55,8 @@ export function normalizeClientOptions} A Promise that resolves to the URL for the agent card + * + * @example + * const url = await client.agentic.getCardUrl("agent-123"); + */ + public getCardUrl = async (agentId: string): Promise => { + const encodedAgentId = encodeURIComponent(agentId); + + return new URL( + `/v2/agentic/agents/${encodedAgentId}/.well-known/agent-card.json`, + (await core.Supplier.get(this._options.environment)).agents, + ); + }; +} diff --git a/src/custom/agents/CustomAgents.ts b/src/custom/agents/CustomAgents.ts index 34c07856..166767ed 100644 --- a/src/custom/agents/CustomAgents.ts +++ b/src/custom/agents/CustomAgents.ts @@ -3,12 +3,13 @@ * * It extends the auto-generated Agents class and adds custom helper methods. * - * All the patches marked with `// Patch: ...` comments. + * @deprecated Use {@link CustomAgentic} / `client.agentic` (Agents API v2) instead. */ import { AgentsClient } from "../../api/resources/agents/client/Client.js"; import * as core from "../../core/index.js"; +/** @deprecated Use `client.agentic` (Agents API v2) instead. */ export class CustomAgents extends AgentsClient { /** * Returns the URL for the agent card JSON file. @@ -16,13 +17,15 @@ export class CustomAgents extends AgentsClient { * @param {string} agentId - The ID of the agent * @returns {Promise} A Promise that resolves to the URL for the agent card * + * @deprecated Use `client.agentic.getCardUrl` instead. + * * @example - * const url = await client.agents.getAgentCardUrl("agent-123"); + * const url = await client.agents.getCardUrl("agent-123"); */ public getCardUrl = async (agentId: string): Promise => { const encodedAgentId = encodeURIComponent(agentId); return new URL( - `/v2/agentic/agents/${encodedAgentId}/.well-known/agent-card.json`, + `/agents/${encodedAgentId}/agent-card.json`, (await core.Supplier.get(this._options.environment)).agents, ); }; diff --git a/src/version.ts b/src/version.ts index 207a5943..ad3a7d4f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "0.0.0-dev"; +export const SDK_VERSION = "4.1.1"; diff --git a/tests/custom/agents.create.integration.ts b/tests/custom/agents.create.integration.ts new file mode 100644 index 00000000..a54fd497 --- /dev/null +++ b/tests/custom/agents.create.integration.ts @@ -0,0 +1,196 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.create", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should create agent with only required values", () => { + it("should create agent with only name and description without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should create agent with all optional values", () => { + it("should create agent with systemPrompt without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + systemPrompt: faker.lorem.paragraph(), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should create agent with ephemeral set to true without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + ephemeral: true, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should create agent with all optional parameters without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + systemPrompt: faker.lorem.paragraph(), + ephemeral: false, + agentType: "orchestrator", + experts: [], + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should create agent with all agentType enum values", () => { + it("should create agent with agentType expert without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + agentType: "expert", + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should create agent with agentType orchestrator without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + agentType: "orchestrator", + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should create agent with agentType interviewing-expert without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + agentType: "interviewing-expert", + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should create agent with experts", () => { + it("should create agent with an expert reference by name without errors or warnings", async () => { + const registry = await cortiClient.agents.getRegistryExperts({ limit: 1 }); + const expertName = registry.experts?.[0]?.name; + if (!expertName) { + console.warn("Skipping: no registry experts available"); + return; + } + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + experts: [{ type: "reference", name: expertName }], + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should create agent with a new inline expert without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + experts: [ + { + type: "new", + name: faker.string.alphanumeric(10), + description: faker.lorem.sentence(), + systemPrompt: faker.lorem.paragraph(), + }, + ], + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when expert reference name does not exist in registry", async () => { + expect.assertions(1); + + await expect( + cortiClient.agents.create({ + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + experts: [{ type: "reference", name: faker.string.alphanumeric(10) }], + }), + ).rejects.toThrow("Status code: 400"); + }); + }); + + describe("should handle errors when required parameters are missing", () => { + it("should throw error when name is missing", async () => { + expect.assertions(1); + + await expect( + cortiClient.agents.create({ + description: faker.lorem.sentence(), + } as any), + ).rejects.toThrow('Missing required key "name"'); + }); + + it("should throw error when description is missing", async () => { + expect.assertions(1); + + await expect( + cortiClient.agents.create({ + name: faker.lorem.words(3), + } as any), + ).rejects.toThrow('Missing required key "description"'); + }); + }); +}); diff --git a/tests/custom/agents.delete.integration.ts b/tests/custom/agents.delete.integration.ts new file mode 100644 index 00000000..1fb63829 --- /dev/null +++ b/tests/custom/agents.delete.integration.ts @@ -0,0 +1,55 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.delete", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should delete agent with only required values", () => { + it("should successfully delete an existing agent without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.delete(agent.id); + + expect(result).toBeUndefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when required parameters are missing", () => { + it("should throw error when agent ID is missing", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.delete(undefined as any)).rejects.toThrow(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when agent ID is invalid format", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.delete("invalid-uuid")).rejects.toThrow("Status code: 400"); + }); + + it("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.delete(faker.string.uuid())).rejects.toThrow("Status code: 404"); + }); + }); +}); diff --git a/tests/custom/agents.deleteContext.integration.ts b/tests/custom/agents.deleteContext.integration.ts new file mode 100644 index 00000000..eb55ac3a --- /dev/null +++ b/tests/custom/agents.deleteContext.integration.ts @@ -0,0 +1,94 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, sendTestMessage, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.deleteContext", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should delete context with only required values", () => { + it("should successfully delete an existing context without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + const result = await cortiClient.agents.deleteContext(agent.id, contextId); + + expect(result).toBeUndefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when agent ID is invalid format", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + await expect(cortiClient.agents.deleteContext("invalid-uuid", contextId)).rejects.toThrow( + "Status code: 400", + ); + }); + + it("should throw error when context ID is invalid format", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.deleteContext(agent.id, "invalid-uuid")).rejects.toThrow( + "Status code: 400", + ); + }); + + // FIXME: re-enable when agents team fixes the regression where the endpoint stopped validating the agent ID + it.skip("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + await expect(cortiClient.agents.deleteContext(faker.string.uuid(), contextId)).rejects.toThrow( + "Status code: 404", + ); + }); + + it("should throw error when context ID does not exist", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.deleteContext(agent.id, faker.string.uuid())).rejects.toThrow( + "Status code: 404", + ); + }); + }); +}); diff --git a/tests/custom/agents.get.integration.ts b/tests/custom/agents.get.integration.ts new file mode 100644 index 00000000..6f2fec7d --- /dev/null +++ b/tests/custom/agents.get.integration.ts @@ -0,0 +1,55 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.get", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should retrieve agent with only required values", () => { + it("should successfully retrieve an existing agent without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.get(agent.id); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when required parameters are missing", () => { + it("should throw error when agent ID is missing", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.get(undefined as any)).rejects.toThrow(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when agent ID is invalid format", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.get("invalid-uuid")).rejects.toThrow("Status code: 400"); + }); + + it("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.get(faker.string.uuid())).rejects.toThrow("Status code: 404"); + }); + }); +}); diff --git a/tests/custom/agents.getCard.integration.ts b/tests/custom/agents.getCard.integration.ts new file mode 100644 index 00000000..df9b53a3 --- /dev/null +++ b/tests/custom/agents.getCard.integration.ts @@ -0,0 +1,55 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.getCard", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should retrieve agent card with only required values", () => { + it("should successfully retrieve an agent card without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.getCard(agent.id); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when required parameters are missing", () => { + it("should throw error when agent ID is missing", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.getCard(undefined as any)).rejects.toThrow(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when agent ID is invalid format", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.getCard("invalid-uuid")).rejects.toThrow("Status code: 400"); + }); + + it("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.getCard(faker.string.uuid())).rejects.toThrow("Status code: 404"); + }); + }); +}); diff --git a/tests/custom/agents.getCardUrl.integration.ts b/tests/custom/agents.getCardUrl.integration.ts new file mode 100644 index 00000000..2fffde5e --- /dev/null +++ b/tests/custom/agents.getCardUrl.integration.ts @@ -0,0 +1,63 @@ +import type { CortiClient } from "../../src"; +import { createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.getCardUrl", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should return correct URL for agent card", () => { + it("should return a valid URL instance without errors or warnings", async () => { + expect.assertions(4); + + const agentId = "test-agent-123"; + + const url = await cortiClient.agents.getCardUrl(agentId); + + expect(url).toBeInstanceOf(URL); + expect(url.toString()).toContain(`/agents/${agentId}/agent-card.json`); + expect(url.toString()).toContain(process.env.CORTI_ENVIRONMENT); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should handle different agent IDs correctly", async () => { + expect.assertions(7); + + const agentIds = ["agent-1", "550e8400-e29b-41d4-a716-446655440000", "my-custom-agent"]; + + for (const agentId of agentIds) { + const url = await cortiClient.agents.getCardUrl(agentId); + + expect(url).toBeInstanceOf(URL); + expect(url.toString()).toContain(`/agents/${agentId}/agent-card.json`); + } + + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("URL structure", () => { + it("should return URL with correct path structure", async () => { + expect.assertions(3); + + const agentId = "test-agent"; + + const url = await cortiClient.agents.getCardUrl(agentId); + + expect(url).toBeInstanceOf(URL); + expect(url.pathname).toBe(`/agents/${agentId}/agent-card.json`); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/tests/custom/agents.getContext.integration.ts b/tests/custom/agents.getContext.integration.ts new file mode 100644 index 00000000..c508af3d --- /dev/null +++ b/tests/custom/agents.getContext.integration.ts @@ -0,0 +1,166 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, sendTestMessage, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.getContext", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should retrieve context with only required values", () => { + it("should successfully retrieve a context without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + const result = await cortiClient.agents.getContext(agent.id, contextId); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should retrieve context with optional parameters", () => { + it("should retrieve context with limit parameter without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + const result = await cortiClient.agents.getContext(agent.id, contextId, { + limit: faker.number.int({ min: 1, max: 100 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should retrieve context with offset parameter without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + const result = await cortiClient.agents.getContext(agent.id, contextId, { + offset: faker.number.int({ min: 0, max: 100 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should retrieve context with all optional parameters without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + const result = await cortiClient.agents.getContext(agent.id, contextId, { + limit: faker.number.int({ min: 1, max: 100 }), + offset: faker.number.int({ min: 0, max: 100 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when required parameters are missing", () => { + it("should throw error when agent ID is missing", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.getContext(undefined as any, faker.string.uuid())).rejects.toThrow(); + }); + + it("should throw error when context ID is missing", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.getContext(agent.id, undefined as any)).rejects.toThrow(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when agent ID is invalid format", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + await expect(cortiClient.agents.getContext("invalid-uuid", contextId)).rejects.toThrow("Status code: 400"); + }); + + it("should throw error when context ID is invalid format", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.getContext(agent.id, "invalid-uuid")).rejects.toThrow("Status code: 400"); + }); + + // FIXME: re-enable when agents team fixes the regression where the endpoint stopped validating the agent ID + it.skip("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const contextId = messageResponse.task?.contextId; + + if (!contextId) { + throw new Error("No context ID returned from message send"); + } + + await expect(cortiClient.agents.getContext(faker.string.uuid(), contextId)).rejects.toThrow( + "Status code: 404", + ); + }); + + it("should throw error when context ID does not exist", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.getContext(agent.id, faker.string.uuid())).rejects.toThrow( + "Status code: 404", + ); + }); + }); +}); diff --git a/tests/custom/agents.getRegistryExperts.integration.ts b/tests/custom/agents.getRegistryExperts.integration.ts new file mode 100644 index 00000000..fdcc4f99 --- /dev/null +++ b/tests/custom/agents.getRegistryExperts.integration.ts @@ -0,0 +1,67 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.getRegistryExperts", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should retrieve registry experts with only required values", () => { + it("should return registry experts without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.getRegistryExperts(); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should retrieve registry experts with optional parameters", () => { + it("should return registry experts with limit parameter without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.getRegistryExperts({ + limit: faker.number.int({ min: 1, max: 100 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should return registry experts with offset parameter without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.getRegistryExperts({ + offset: faker.number.int({ min: 0, max: 100 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should return registry experts with all optional parameters without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.getRegistryExperts({ + limit: faker.number.int({ min: 1, max: 100 }), + offset: faker.number.int({ min: 0, max: 100 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/tests/custom/agents.getTask.integration.ts b/tests/custom/agents.getTask.integration.ts new file mode 100644 index 00000000..602afb68 --- /dev/null +++ b/tests/custom/agents.getTask.integration.ts @@ -0,0 +1,124 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, sendTestMessage, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.getTask", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should retrieve task with only required values", () => { + it("should successfully retrieve a task without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const taskId = messageResponse.task?.id; + + if (!taskId) { + throw new Error("No task ID returned from message send"); + } + + const result = await cortiClient.agents.getTask(agent.id, taskId); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should retrieve task with optional parameters", () => { + it("should retrieve task with historyLength parameter without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const taskId = messageResponse.task?.id; + + if (!taskId) { + throw new Error("No task ID returned from message send"); + } + + const result = await cortiClient.agents.getTask(agent.id, taskId, { + historyLength: faker.number.int({ min: 1, max: 100 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when required parameters are missing", () => { + it("should throw error when agent ID is missing", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.getTask(undefined as any, faker.string.uuid())).rejects.toThrow(); + }); + + it("should throw error when task ID is missing", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.getTask(agent.id, undefined as any)).rejects.toThrow(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + // FIXME: re-enable when validation is implemented + it.skip("should throw error when agent ID is invalid format", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const taskId = messageResponse.task?.id; + + if (!taskId) { + throw new Error("No task ID returned from message send"); + } + + await expect(cortiClient.agents.getTask("invalid-uuid", taskId)).rejects.toThrow("Status code: 400"); + }); + + it("should throw error when task ID is invalid format", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.getTask(agent.id, "invalid-uuid")).rejects.toThrow("Status code: 400"); + }); + + // FIXME: re-enable when proper error handling is implemented + it.skip("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + const messageResponse = await sendTestMessage(cortiClient, agent.id); + const taskId = messageResponse.task?.id; + + if (!taskId) { + throw new Error("No task ID returned from message send"); + } + + await expect(cortiClient.agents.getTask(faker.string.uuid(), taskId)).rejects.toThrow("Status code: 404"); + }); + + it("should throw error when task ID does not exist", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.getTask(agent.id, faker.string.uuid())).rejects.toThrow("Status code: 404"); + }); + }); +}); diff --git a/tests/custom/agents.list.integration.ts b/tests/custom/agents.list.integration.ts new file mode 100644 index 00000000..d66a307f --- /dev/null +++ b/tests/custom/agents.list.integration.ts @@ -0,0 +1,92 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.list", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should list agents with only required values", () => { + it("should return created agent in list without errors or warnings", async () => { + expect.assertions(2); + + await createTestAgent(cortiClient); + + const result = await cortiClient.agents.list(); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should return list with optional parameters", () => { + it("should return list with limit parameter without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.list({ + limit: faker.number.int({ min: 1, max: 10 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should return list with offset parameter without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.list({ + offset: faker.number.int({ min: 0, max: 10 }), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should return list with ephemeral false without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.list({ + ephemeral: false, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should return list with ephemeral true without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.list({ + ephemeral: true, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should return list with all optional parameters without errors or warnings", async () => { + expect.assertions(2); + + const result = await cortiClient.agents.list({ + limit: faker.number.int({ min: 1, max: 10 }), + offset: faker.number.int({ min: 0, max: 10 }), + ephemeral: false, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/tests/custom/agents.messageSend.integration.ts b/tests/custom/agents.messageSend.integration.ts new file mode 100644 index 00000000..f3088994 --- /dev/null +++ b/tests/custom/agents.messageSend.integration.ts @@ -0,0 +1,523 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.messageSend", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should send message with minimal fields", () => { + it("should send message with only required fields without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should send message with agent role without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "agent", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should send message with all optional fields", () => { + it("should send message with metadata without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + metadata: { + testKey: faker.lorem.word(), + }, + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should send message with extensions without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + extensions: [faker.lorem.word()], + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + // FIXME: We need to be able to get a task in not final state, otherwise error is valid + it.skip("should send message with taskId and contextId without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const firstMessage = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }); + + const taskId = firstMessage.task?.id; + const contextId = firstMessage.task?.contextId; + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + taskId: taskId, + contextId: contextId, + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should send message with referenceTaskIds without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + referenceTaskIds: [faker.string.uuid()], + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + // FIXME: We need to be able to get a task in not final state, otherwise error is valid + it.skip("should send message with all optional parameters without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const firstMessage = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }); + + const taskId = firstMessage.task?.id; + const contextId = firstMessage.task?.contextId; + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + metadata: { + testKey: faker.lorem.word(), + }, + extensions: [faker.lorem.word()], + taskId: taskId, + contextId: contextId, + referenceTaskIds: [faker.string.uuid()], + }, + configuration: { + blocking: true, + }, + metadata: { + testMetadata: faker.lorem.word(), + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should send message with all part kinds", () => { + it("should send message with file part (uri) without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "file", + file: { uri: "https://example.com/file.pdf", mimeType: "application/pdf" }, + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should send message with data part without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "data", + data: { key: faker.lorem.word() }, + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should send message with configuration fields", () => { + it("should send message with configuration.acceptedOutputModes without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [{ kind: "text", text: faker.lorem.sentence() }], + messageId: faker.string.uuid(), + kind: "message", + }, + configuration: { acceptedOutputModes: ["text/plain"] }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should send message with configuration.historyLength without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [{ kind: "text", text: faker.lorem.sentence() }], + messageId: faker.string.uuid(), + kind: "message", + }, + configuration: { historyLength: faker.number.int({ min: 1, max: 10 }) }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should send message with configuration.blocking false without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [{ kind: "text", text: faker.lorem.sentence() }], + messageId: faker.string.uuid(), + kind: "message", + }, + configuration: { blocking: false }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should send message with top-level metadata", () => { + it("should send message with metadata without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [{ kind: "text", text: faker.lorem.sentence() }], + messageId: faker.string.uuid(), + kind: "message", + }, + metadata: { testKey: faker.lorem.word() }, + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when required parameters are missing", () => { + it("should throw error when message is missing", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect(cortiClient.agents.messageSend(agent.id, {} as any)).rejects.toThrow( + 'Missing required key "message"', + ); + }); + + it("should throw error when role is missing", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect( + cortiClient.agents.messageSend(agent.id, { + message: { + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + } as any, + }), + ).rejects.toThrow('Missing required key "role"'); + }); + + it("should throw error when parts is missing", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect( + cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + messageId: faker.string.uuid(), + kind: "message", + } as any, + }), + ).rejects.toThrow('Missing required key "parts"'); + }); + + it("should throw error when messageId is missing", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect( + cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + kind: "message", + } as any, + }), + ).rejects.toThrow('Missing required key "messageId"'); + }); + + it("should throw error when kind is missing", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect( + cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + } as any, + }), + ).rejects.toThrow('Missing required key "kind"'); + }); + + it("should throw error when text is missing in text part", async () => { + expect.assertions(1); + + const agent = await createTestAgent(cortiClient); + + await expect( + cortiClient.agents.messageSend(agent.id, { + message: { + role: "user", + parts: [ + { + kind: "text", + } as any, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }), + ).rejects.toThrow('Missing required key "text"'); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when agent ID is invalid format", async () => { + expect.assertions(1); + + await expect( + cortiClient.agents.messageSend("invalid-uuid", { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }), + ).rejects.toThrow("Status code: 400"); + }); + + it("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + await expect( + cortiClient.agents.messageSend(faker.string.uuid(), { + message: { + role: "user", + parts: [ + { + kind: "text", + text: faker.lorem.sentence(), + }, + ], + messageId: faker.string.uuid(), + kind: "message", + }, + }), + ).rejects.toThrow("Status code: 404"); + }); + }); +}); diff --git a/tests/custom/agents.update.integration.ts b/tests/custom/agents.update.integration.ts new file mode 100644 index 00000000..b70e4d69 --- /dev/null +++ b/tests/custom/agents.update.integration.ts @@ -0,0 +1,131 @@ +import { faker } from "@faker-js/faker"; +import type { CortiClient } from "../../src"; +import { createTestAgent, createTestCortiClient, setupConsoleWarnSpy } from "./testUtils"; + +describe("cortiClient.agents.update", () => { + let cortiClient: CortiClient; + let consoleWarnSpy: ReturnType; + + beforeAll(() => { + cortiClient = createTestCortiClient(); + }); + + beforeEach(() => { + consoleWarnSpy = setupConsoleWarnSpy(); + }); + + afterEach(() => { + consoleWarnSpy.mockRestore(); + }); + + describe("should update agent with only required values", () => { + it("should update agent with empty body without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.update(agent.id, {}); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should update agent with all optional values", () => { + it("should update agent with name without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.update(agent.id, { + name: faker.lorem.words(3), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should update agent with description without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.update(agent.id, { + description: faker.lorem.sentence(), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should update agent with systemPrompt without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.update(agent.id, { + systemPrompt: faker.lorem.paragraph(), + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should update agent with inline expert without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.update(agent.id, { + experts: [ + { + type: "new", + name: faker.string.alphanumeric(10), + description: faker.lorem.sentence(), + }, + ], + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + + it("should update agent with all optional parameters without errors or warnings", async () => { + expect.assertions(2); + + const agent = await createTestAgent(cortiClient); + + const result = await cortiClient.agents.update(agent.id, { + name: faker.lorem.words(3), + description: faker.lorem.sentence(), + systemPrompt: faker.lorem.paragraph(), + experts: [], + }); + + expect(result).toBeDefined(); + expect(consoleWarnSpy).not.toHaveBeenCalled(); + }); + }); + + describe("should throw error when required parameters are missing", () => { + it("should throw error when agent ID is missing", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.update(undefined as any, {})).rejects.toThrow(); + }); + }); + + describe("should throw error when invalid parameters are provided", () => { + it("should throw error when agent ID is invalid", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.update("invalid-uuid", {})).rejects.toThrow("Status code: 400"); + }); + + it("should throw error when agent ID does not exist", async () => { + expect.assertions(1); + + await expect(cortiClient.agents.update(faker.string.uuid(), {})).rejects.toThrow("Status code: 404"); + }); + }); +}); From 9c8c8f158e344d545cba33477e508939160b3a8a Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 13:47:08 +0000 Subject: [PATCH 07/18] SDK regeneration --- .fern/metadata.json | 2 +- src/BaseClient.ts | 4 +- .../resources/feedback/client/Client.ts | 22 ++------ src/version.ts | 2 +- tests/wire/agentic/feedback.test.ts | 56 +------------------ 5 files changed, 10 insertions(+), 76 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 5f4bdae2..f2541792 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "616e546fb2e837ad6be9e9fb0a90e8cdc594c6ec", + "originGitCommit": "ed57b083f812d0cf63cc4c23deba88cdfca00ca8", "sdkVersion": "0.0.0-dev" } diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 203dc47b..27d389e5 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -55,8 +55,8 @@ export function normalizeClientOptions { }).rejects.toThrow(Corti.UnprocessableEntityError); }); - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -453,58 +453,4 @@ describe("FeedbackClient", () => { ); expect(response).toEqual(undefined); }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.delete("contextId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.delete("contextId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); }); From b58a4d04fe94b76807b38a3d670f1afd6f3fba26 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 14:11:27 +0000 Subject: [PATCH 08/18] SDK regeneration --- .fern/metadata.json | 2 +- src/api/errors/NotImplementedError.ts | 22 +++ src/api/errors/index.ts | 1 + .../a2A/resources/tasks/client/Client.ts | 55 ++++-- .../resources/connectors/client/Client.ts | 112 ++++++++++++ .../resources/connectors/client/index.ts | 2 +- .../client/requests/ConnectorsPatchRequest.ts | 21 +++ .../connectors/client/requests/index.ts | 1 + .../resources/contexts/client/Client.ts | 91 ++++++++++ .../client/requests/ListContextsRequest.ts | 18 ++ .../contexts/client/requests/index.ts | 1 + src/api/resources/agentic/resources/index.ts | 1 + src/api/resources/agents/client/Client.ts | 8 +- ...SendBody.ts => AgentsMessageSendParams.ts} | 2 +- .../resources/agents/client/requests/index.ts | 2 +- src/api/types/CommonErrorResponse.ts | 24 +++ src/api/types/CommonErrorResponseError.ts | 25 +++ .../types/CommonErrorResponseErrorDetails.ts | 14 ++ ...esponseErrorDetailsValidationErrorsItem.ts | 8 + src/api/types/ContextsListResponse.ts | 13 ++ src/api/types/index.ts | 5 + .../resources/connectors/client/index.ts | 1 + .../client/requests/ConnectorsPatchRequest.ts | 27 +++ .../connectors/client/requests/index.ts | 1 + .../agentic/resources/connectors/index.ts | 1 + .../resources/agentic/resources/index.ts | 2 + ...SendBody.ts => AgentsMessageSendParams.ts} | 8 +- .../resources/agents/client/requests/index.ts | 2 +- .../types/CommonErrorResponse.ts | 19 +++ .../types/CommonErrorResponseError.ts | 27 +++ .../types/CommonErrorResponseErrorDetails.ts | 22 +++ ...esponseErrorDetailsValidationErrorsItem.ts | 20 +++ .../types/ContextsListResponse.ts | 25 +++ src/serialization/types/index.ts | 5 + tests/wire/agentic/a2A/tasks.test.ts | 77 ++++++++- tests/wire/agentic/connectors.test.ts | 161 ++++++++++++++++++ tests/wire/agentic/contexts.test.ts | 84 +++++++++ 37 files changed, 877 insertions(+), 33 deletions(-) create mode 100644 src/api/errors/NotImplementedError.ts create mode 100644 src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts create mode 100644 src/api/resources/agentic/resources/connectors/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts rename src/api/resources/agents/client/requests/{AgentsMessageSendBody.ts => AgentsMessageSendParams.ts} (93%) create mode 100644 src/api/types/CommonErrorResponse.ts create mode 100644 src/api/types/CommonErrorResponseError.ts create mode 100644 src/api/types/CommonErrorResponseErrorDetails.ts create mode 100644 src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts create mode 100644 src/api/types/ContextsListResponse.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/client/index.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/index.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/index.ts rename src/serialization/resources/agents/client/requests/{AgentsMessageSendBody.ts => AgentsMessageSendParams.ts} (81%) create mode 100644 src/serialization/types/CommonErrorResponse.ts create mode 100644 src/serialization/types/CommonErrorResponseError.ts create mode 100644 src/serialization/types/CommonErrorResponseErrorDetails.ts create mode 100644 src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts create mode 100644 src/serialization/types/ContextsListResponse.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index f2541792..d18c9351 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "ed57b083f812d0cf63cc4c23deba88cdfca00ca8", + "originGitCommit": "179ce2aa8c7ce3a8001b6e6ae2e38a48998bab61", "sdkVersion": "0.0.0-dev" } diff --git a/src/api/errors/NotImplementedError.ts b/src/api/errors/NotImplementedError.ts new file mode 100644 index 00000000..24387bb0 --- /dev/null +++ b/src/api/errors/NotImplementedError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Corti from "../index.js"; + +export class NotImplementedError extends errors.CortiError { + constructor(body: Corti.CommonErrorResponse, rawResponse?: core.RawResponse) { + super({ + message: "NotImplementedError", + statusCode: 501, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 7ce4a0f0..1cd5a26b 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -5,5 +5,6 @@ export * from "./ForbiddenError.js"; export * from "./GatewayTimeoutError.js"; export * from "./InternalServerError.js"; export * from "./NotFoundError.js"; +export * from "./NotImplementedError.js"; export * from "./UnauthorizedError.js"; export * from "./UnprocessableEntityError.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts index 0815c946..7cc1e7e3 100644 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts @@ -302,18 +302,13 @@ export class TasksClient { } /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.agentic.a2A.tasks.subscribe("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + * Resubscribe to an in-flight task's event stream over SSE. */ public subscribe( agentId: Corti.CommonAgentIdValue, taskId: Corti.CommonTaskIdValue, requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise> { return core.HttpResponsePromise.fromPromise(this.__subscribe(agentId, taskId, requestOptions)); } @@ -321,7 +316,7 @@ export class TasksClient { agentId: Corti.CommonAgentIdValue, taskId: Corti.CommonTaskIdValue, requestOptions?: TasksClient.RequestOptions, - ): Promise> { + ): Promise>> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -332,15 +327,16 @@ export class TasksClient { }), requestOptions?.headers, ); - const _response = await core.fetcher({ + const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)).agents, `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:subscribe`, ), - method: "GET", + method: "POST", headers: _headers, queryParameters: requestOptions?.queryParams, + responseType: "sse", timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -348,21 +344,46 @@ export class TasksClient { logging: this._options.logging, }); if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; + return { + data: new core.Stream({ + stream: _response.body, + parse: async (data) => { + return serializers.A2AStreamEventResponse.parseOrThrow(data, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + }, + signal: requestOptions?.abortSignal, + eventShape: { + type: "sse", + }, + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError( _response.error, _response.rawResponse, - "GET", + "POST", "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:subscribe", ); } diff --git a/src/api/resources/agentic/resources/connectors/client/Client.ts b/src/api/resources/agentic/resources/connectors/client/Client.ts index 4fd39ace..fa6bc5d3 100644 --- a/src/api/resources/agentic/resources/connectors/client/Client.ts +++ b/src/api/resources/agentic/resources/connectors/client/Client.ts @@ -352,4 +352,116 @@ export class ConnectorsClient { "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", ); } + + /** + * Partially updates an agent-scoped connector using JSON Merge Patch + * (RFC 7386). `type` is immutable. + * **Future scope**: not yet implemented; the server returns `501`. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). + * @param {Corti.agentic.ConnectorsPatchRequest} request + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.NotImplementedError} + * + * @example + * await client.agentic.connectors.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", { + * enabled: false + * }) + */ + public update( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + request: Corti.agentic.ConnectorsPatchRequest = {}, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(agentId, agentConnectorId, request, requestOptions)); + } + + private async __update( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + request: Corti.agentic.ConnectorsPatchRequest = {}, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/merge-patch+json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.agentic.ConnectorsPatchRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 501: + throw new Corti.NotImplementedError( + serializers.CommonErrorResponse.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", + ); + } } diff --git a/src/api/resources/agentic/resources/connectors/client/index.ts b/src/api/resources/agentic/resources/connectors/client/index.ts index cb0ff5c3..195f9aa8 100644 --- a/src/api/resources/agentic/resources/connectors/client/index.ts +++ b/src/api/resources/agentic/resources/connectors/client/index.ts @@ -1 +1 @@ -export {}; +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts new file mode 100644 index 00000000..5094288b --- /dev/null +++ b/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * enabled: false + * } + */ +export interface ConnectorsPatchRequest { + /** Whether the connector is active. */ + enabled?: boolean; + /** New connector name. */ + name?: string; + /** New connector URL; `null` clears it. */ + url?: string | null; + /** New connector config; `null` clears it. */ + config?: Record | null; + auth?: Corti.CommonConnectorAuth | null; +} diff --git a/src/api/resources/agentic/resources/connectors/client/requests/index.ts b/src/api/resources/agentic/resources/connectors/client/requests/index.ts new file mode 100644 index 00000000..d39ed3f7 --- /dev/null +++ b/src/api/resources/agentic/resources/connectors/client/requests/index.ts @@ -0,0 +1 @@ +export type { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/api/resources/agentic/resources/contexts/client/Client.ts b/src/api/resources/agentic/resources/contexts/client/Client.ts index 22fc9d3e..58aa4100 100644 --- a/src/api/resources/agentic/resources/contexts/client/Client.ts +++ b/src/api/resources/agentic/resources/contexts/client/Client.ts @@ -28,6 +28,97 @@ export class ContextsClient { return (this._tasks ??= new TasksClient(this._options)); } + /** + * Lists contexts matching the filters. + * **Future scope**: not yet implemented; the server currently returns an empty page and ignores all parameters. + * + * @param {Corti.agentic.ListContextsRequest} request + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agentic.contexts.list() + */ + public async list( + request: Corti.agentic.ListContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Corti.agentic.ListContextsRequest, + ): Promise> => { + const { agentId, from: from_, to, pageSize, pageToken } = request; + const _queryParams: Record = { + agentId, + from: from_ != null ? from_?.toISOString() : undefined, + to: to != null ? to?.toISOString() : undefined, + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/contexts", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ContextsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/contexts"); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.contexts ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, + }); + } + /** * Returns the context's metadata together with its `tasks`, oldest first. * Each task carries its full message `history`; the user's prompt for a diff --git a/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts new file mode 100644 index 00000000..111bb811 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListContextsRequest { + /** Restrict to contexts owned by this agent. */ + agentId?: string; + /** Inclusive lower bound on `createdAt` (RFC 3339). */ + from?: Date; + /** Exclusive upper bound on `createdAt` (RFC 3339). */ + to?: Date; + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/client/requests/index.ts index 3965334a..db21c8ce 100644 --- a/src/api/resources/agentic/resources/contexts/client/requests/index.ts +++ b/src/api/resources/agentic/resources/contexts/client/requests/index.ts @@ -1,2 +1,3 @@ export type { GetContextsRequest } from "./GetContextsRequest.js"; export type { GetTraceContextsRequest } from "./GetTraceContextsRequest.js"; +export type { ListContextsRequest } from "./ListContextsRequest.js"; diff --git a/src/api/resources/agentic/resources/index.ts b/src/api/resources/agentic/resources/index.ts index c5b3b597..3fe97949 100644 --- a/src/api/resources/agentic/resources/index.ts +++ b/src/api/resources/agentic/resources/index.ts @@ -2,6 +2,7 @@ export * from "./a2A/client/requests/index.js"; export * as a2A from "./a2A/index.js"; export * from "./a2A/types/index.js"; export * as artifacts from "./artifacts/index.js"; +export * from "./connectors/client/requests/index.js"; export * as connectors from "./connectors/index.js"; export * from "./contexts/client/requests/index.js"; export * as contexts from "./contexts/index.js"; diff --git a/src/api/resources/agents/client/Client.ts b/src/api/resources/agents/client/Client.ts index 9fe90217..f3b9e853 100644 --- a/src/api/resources/agents/client/Client.ts +++ b/src/api/resources/agents/client/Client.ts @@ -533,7 +533,7 @@ export class AgentsClient { * This endpoint sends a message to the specified agent to start or continue a task. The agent processes the message and returns a response. If the message contains a task ID that matches an ongoing task, the agent will continue that task; otherwise, it will start a new task. * * @param {string} id - The identifier of the agent associated with the context. - * @param {Corti.AgentsMessageSendBody} request + * @param {Corti.AgentsMessageSendParams} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -557,7 +557,7 @@ export class AgentsClient { */ public messageSend( id: string, - request: Corti.AgentsMessageSendBody, + request: Corti.AgentsMessageSendParams, requestOptions?: AgentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__messageSend(id, request, requestOptions)); @@ -565,7 +565,7 @@ export class AgentsClient { private async __messageSend( id: string, - request: Corti.AgentsMessageSendBody, + request: Corti.AgentsMessageSendParams, requestOptions?: AgentsClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -586,7 +586,7 @@ export class AgentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.AgentsMessageSendBody.jsonOrThrow(request, { + body: serializers.AgentsMessageSendParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/agents/client/requests/AgentsMessageSendBody.ts b/src/api/resources/agents/client/requests/AgentsMessageSendParams.ts similarity index 93% rename from src/api/resources/agents/client/requests/AgentsMessageSendBody.ts rename to src/api/resources/agents/client/requests/AgentsMessageSendParams.ts index 922b0bda..53f9cf2e 100644 --- a/src/api/resources/agents/client/requests/AgentsMessageSendBody.ts +++ b/src/api/resources/agents/client/requests/AgentsMessageSendParams.ts @@ -16,7 +16,7 @@ import type * as Corti from "../../../../index.js"; * } * } */ -export interface AgentsMessageSendBody { +export interface AgentsMessageSendParams { message: Corti.AgentsMessage; configuration?: Corti.AgentsMessageSendConfiguration; /** Optional metadata that will be associated with the message. */ diff --git a/src/api/resources/agents/client/requests/index.ts b/src/api/resources/agents/client/requests/index.ts index dbc8bcb0..e43b0bbc 100644 --- a/src/api/resources/agents/client/requests/index.ts +++ b/src/api/resources/agents/client/requests/index.ts @@ -3,5 +3,5 @@ export type { AgentsGetContextRequest } from "./AgentsGetContextRequest.js"; export type { AgentsGetRegistryExpertsRequest } from "./AgentsGetRegistryExpertsRequest.js"; export type { AgentsGetTaskRequest } from "./AgentsGetTaskRequest.js"; export type { AgentsListRequest } from "./AgentsListRequest.js"; -export type { AgentsMessageSendBody } from "./AgentsMessageSendBody.js"; +export type { AgentsMessageSendParams } from "./AgentsMessageSendParams.js"; export type { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; diff --git a/src/api/types/CommonErrorResponse.ts b/src/api/types/CommonErrorResponse.ts new file mode 100644 index 00000000..7ceeae50 --- /dev/null +++ b/src/api/types/CommonErrorResponse.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Corti management-plane error envelope, used by all non-A2A endpoints. + * + * - **Standard** — when the error chain contains at least one `PublicError`, + * `code` and `message` come from the outermost `PublicError` and `details` + * is merged across the whole chain (outer values take precedence). + * - **Fallback** — when the chain contains no `PublicError`, the response is + * a generic `500` carrying a `requestId` for support reference. + * - **Validation** — a single `PublicError` whose `details.validationErrors` + * lists the offending fields. + * + * Field names use camelCase on the wire (e.g. `requestId`, `howToFix`). + * The free-form `details` object may carry arbitrary caller-defined keys. + * + * Rate limiting (HTTP 429) is not yet implemented; the server does not emit a 429 response. + */ +export interface CommonErrorResponse { + /** The error object with code, message, and optional details. */ + error: Corti.CommonErrorResponseError; +} diff --git a/src/api/types/CommonErrorResponseError.ts b/src/api/types/CommonErrorResponseError.ts new file mode 100644 index 00000000..4e0ca42c --- /dev/null +++ b/src/api/types/CommonErrorResponseError.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * The error object with code, message, and optional details. + */ +export interface CommonErrorResponseError { + /** Stable, machine-readable, SCREAMING_SNAKE_CASE error code. */ + code: string; + /** Human-readable explanation. */ + message: string; + /** Optional guidance for the caller to resolve the error. */ + howToFix?: string; + /** + * Structured context, merged from every `PublicError` in the chain + * (outer values win). Omitted on the generic fallback response. + */ + details?: Corti.CommonErrorResponseErrorDetails; + /** + * Correlation ID from request middleware. Included only on the + * generic `500` fallback so consumers can quote it in support requests. + */ + requestId?: string; +} diff --git a/src/api/types/CommonErrorResponseErrorDetails.ts b/src/api/types/CommonErrorResponseErrorDetails.ts new file mode 100644 index 00000000..e20d410b --- /dev/null +++ b/src/api/types/CommonErrorResponseErrorDetails.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Structured context, merged from every `PublicError` in the chain + * (outer values win). Omitted on the generic fallback response. + */ +export interface CommonErrorResponseErrorDetails { + /** Present when `code` is `VALIDATION_FAILED`. */ + validationErrors?: Corti.CommonErrorResponseErrorDetailsValidationErrorsItem[]; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts new file mode 100644 index 00000000..541d42b2 --- /dev/null +++ b/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CommonErrorResponseErrorDetailsValidationErrorsItem { + /** The field that failed validation. */ + field: string; + /** Why the field failed validation. */ + reason: string; +} diff --git a/src/api/types/ContextsListResponse.ts b/src/api/types/ContextsListResponse.ts new file mode 100644 index 00000000..48126c80 --- /dev/null +++ b/src/api/types/ContextsListResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of contexts. + */ +export interface ContextsListResponse { + /** Contexts on the current page. */ + contexts: Corti.Contexts[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 248401b0..2ffaffbc 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -102,6 +102,10 @@ export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; +export * from "./CommonErrorResponse.js"; +export * from "./CommonErrorResponseError.js"; +export * from "./CommonErrorResponseErrorDetails.js"; +export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; export * from "./CommonMcpConnector.js"; export * from "./CommonMcpConnectorCreate.js"; @@ -135,6 +139,7 @@ export * from "./CommonUsageInfo.js"; export * from "./ConnectorsListResponse.js"; export * from "./Contexts.js"; export * from "./ContextsDetailResponse.js"; +export * from "./ContextsListResponse.js"; export * from "./ContextsOpenInferenceSpan.js"; export * from "./ContextsTraceItem.js"; export * from "./ContextsTraceItemTrace.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/index.ts b/src/serialization/resources/agentic/resources/connectors/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts new file mode 100644 index 00000000..95949c28 --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../../api/index.js"; +import * as core from "../../../../../../../core/index.js"; +import type * as serializers from "../../../../../../index.js"; +import { CommonConnectorAuth } from "../../../../../../types/CommonConnectorAuth.js"; + +export const ConnectorsPatchRequest: core.serialization.Schema< + serializers.agentic.ConnectorsPatchRequest.Raw, + Corti.agentic.ConnectorsPatchRequest +> = core.serialization.object({ + enabled: core.serialization.boolean().optional(), + name: core.serialization.string().optional(), + url: core.serialization.string().optionalNullable(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + auth: CommonConnectorAuth.optionalNullable(), +}); + +export declare namespace ConnectorsPatchRequest { + export interface Raw { + enabled?: boolean | null; + name?: string | null; + url?: (string | null | undefined) | null; + config?: (Record | null | undefined) | null; + auth?: (CommonConnectorAuth.Raw | null | undefined) | null; + } +} diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts new file mode 100644 index 00000000..fd257b20 --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts @@ -0,0 +1 @@ +export { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/index.ts b/src/serialization/resources/agentic/resources/connectors/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/serialization/resources/agentic/resources/index.ts b/src/serialization/resources/agentic/resources/index.ts index 6ab20411..3165166f 100644 --- a/src/serialization/resources/agentic/resources/index.ts +++ b/src/serialization/resources/agentic/resources/index.ts @@ -1,5 +1,7 @@ export * from "./a2A/client/requests/index.js"; export * as a2A from "./a2A/index.js"; export * from "./a2A/types/index.js"; +export * from "./connectors/client/requests/index.js"; +export * as connectors from "./connectors/index.js"; export * from "./feedback/client/requests/index.js"; export * as feedback from "./feedback/index.js"; diff --git a/src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts b/src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts similarity index 81% rename from src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts rename to src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts index 0fc3860b..24247fb7 100644 --- a/src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts +++ b/src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts @@ -6,16 +6,16 @@ import type * as serializers from "../../../../index.js"; import { AgentsMessage } from "../../../../types/AgentsMessage.js"; import { AgentsMessageSendConfiguration } from "../../../../types/AgentsMessageSendConfiguration.js"; -export const AgentsMessageSendBody: core.serialization.Schema< - serializers.AgentsMessageSendBody.Raw, - Corti.AgentsMessageSendBody +export const AgentsMessageSendParams: core.serialization.Schema< + serializers.AgentsMessageSendParams.Raw, + Corti.AgentsMessageSendParams > = core.serialization.object({ message: AgentsMessage, configuration: AgentsMessageSendConfiguration.optional(), metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), }); -export declare namespace AgentsMessageSendBody { +export declare namespace AgentsMessageSendParams { export interface Raw { message: AgentsMessage.Raw; configuration?: AgentsMessageSendConfiguration.Raw | null; diff --git a/src/serialization/resources/agents/client/requests/index.ts b/src/serialization/resources/agents/client/requests/index.ts index 2ec1ca0a..36d03a60 100644 --- a/src/serialization/resources/agents/client/requests/index.ts +++ b/src/serialization/resources/agents/client/requests/index.ts @@ -1,3 +1,3 @@ export { AgentsCreateAgent } from "./AgentsCreateAgent.js"; -export { AgentsMessageSendBody } from "./AgentsMessageSendBody.js"; +export { AgentsMessageSendParams } from "./AgentsMessageSendParams.js"; export { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; diff --git a/src/serialization/types/CommonErrorResponse.ts b/src/serialization/types/CommonErrorResponse.ts new file mode 100644 index 00000000..ca0e5b74 --- /dev/null +++ b/src/serialization/types/CommonErrorResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonErrorResponseError } from "./CommonErrorResponseError.js"; + +export const CommonErrorResponse: core.serialization.ObjectSchema< + serializers.CommonErrorResponse.Raw, + Corti.CommonErrorResponse +> = core.serialization.object({ + error: CommonErrorResponseError, +}); + +export declare namespace CommonErrorResponse { + export interface Raw { + error: CommonErrorResponseError.Raw; + } +} diff --git a/src/serialization/types/CommonErrorResponseError.ts b/src/serialization/types/CommonErrorResponseError.ts new file mode 100644 index 00000000..4b40f814 --- /dev/null +++ b/src/serialization/types/CommonErrorResponseError.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonErrorResponseErrorDetails } from "./CommonErrorResponseErrorDetails.js"; + +export const CommonErrorResponseError: core.serialization.ObjectSchema< + serializers.CommonErrorResponseError.Raw, + Corti.CommonErrorResponseError +> = core.serialization.object({ + code: core.serialization.string(), + message: core.serialization.string(), + howToFix: core.serialization.string().optional(), + details: CommonErrorResponseErrorDetails.optional(), + requestId: core.serialization.string().optional(), +}); + +export declare namespace CommonErrorResponseError { + export interface Raw { + code: string; + message: string; + howToFix?: string | null; + details?: CommonErrorResponseErrorDetails.Raw | null; + requestId?: string | null; + } +} diff --git a/src/serialization/types/CommonErrorResponseErrorDetails.ts b/src/serialization/types/CommonErrorResponseErrorDetails.ts new file mode 100644 index 00000000..79578cce --- /dev/null +++ b/src/serialization/types/CommonErrorResponseErrorDetails.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonErrorResponseErrorDetailsValidationErrorsItem } from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; + +export const CommonErrorResponseErrorDetails: core.serialization.ObjectSchema< + serializers.CommonErrorResponseErrorDetails.Raw, + Corti.CommonErrorResponseErrorDetails +> = core.serialization + .object({ + validationErrors: core.serialization.list(CommonErrorResponseErrorDetailsValidationErrorsItem).optional(), + }) + .passthrough(); + +export declare namespace CommonErrorResponseErrorDetails { + export interface Raw { + validationErrors?: CommonErrorResponseErrorDetailsValidationErrorsItem.Raw[] | null; + [key: string]: any; + } +} diff --git a/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts new file mode 100644 index 00000000..31bf3888 --- /dev/null +++ b/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonErrorResponseErrorDetailsValidationErrorsItem: core.serialization.ObjectSchema< + serializers.CommonErrorResponseErrorDetailsValidationErrorsItem.Raw, + Corti.CommonErrorResponseErrorDetailsValidationErrorsItem +> = core.serialization.object({ + field: core.serialization.string(), + reason: core.serialization.string(), +}); + +export declare namespace CommonErrorResponseErrorDetailsValidationErrorsItem { + export interface Raw { + field: string; + reason: string; + } +} diff --git a/src/serialization/types/ContextsListResponse.ts b/src/serialization/types/ContextsListResponse.ts new file mode 100644 index 00000000..e6765e17 --- /dev/null +++ b/src/serialization/types/ContextsListResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; +import { Contexts } from "./Contexts.js"; + +export const ContextsListResponse: core.serialization.ObjectSchema< + serializers.ContextsListResponse.Raw, + Corti.ContextsListResponse +> = core.serialization.object({ + contexts: core.serialization.list(Contexts), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace ContextsListResponse { + export interface Raw { + contexts: Contexts.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 248401b0..2ffaffbc 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -102,6 +102,10 @@ export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; +export * from "./CommonErrorResponse.js"; +export * from "./CommonErrorResponseError.js"; +export * from "./CommonErrorResponseErrorDetails.js"; +export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; export * from "./CommonMcpConnector.js"; export * from "./CommonMcpConnectorCreate.js"; @@ -135,6 +139,7 @@ export * from "./CommonUsageInfo.js"; export * from "./ConnectorsListResponse.js"; export * from "./Contexts.js"; export * from "./ContextsDetailResponse.js"; +export * from "./ContextsListResponse.js"; export * from "./ContextsOpenInferenceSpan.js"; export * from "./ContextsTraceItem.js"; export * from "./ContextsTraceItemTrace.js"; diff --git a/tests/wire/agentic/a2A/tasks.test.ts b/tests/wire/agentic/a2A/tasks.test.ts index 6bffa2b4..37719b87 100644 --- a/tests/wire/agentic/a2A/tasks.test.ts +++ b/tests/wire/agentic/a2A/tasks.test.ts @@ -604,7 +604,7 @@ describe("TasksClient", () => { }).rejects.toThrow(Corti.ConflictError); }); - test("subscribe", async () => { + test("subscribe (1)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); @@ -616,20 +616,91 @@ describe("TasksClient", () => { environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); + const rawResponseBody = + 'event: \ndata: {"data":"{\\"statusUpdate\\":{\\"taskId\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_COMPLETED\\",\\"timestamp\\":\\"2026-05-19T12:00:01Z\\"}}}","event":"event","id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","retry":1}\n\n'; + server .mockEndpoint() - .get( + .post( "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:subscribe", ) .header("A2A-Version", "1.0") .respondWith() .statusCode(200) + .sseBody(rawResponseBody) .build(); const response = await client.agentic.a2A.tasks.subscribe( "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", ); - expect(response).toEqual(undefined); + const events: unknown[] = []; + for await (const event of response) { + events.push(event); + } + expect(events).toEqual([ + { + data: '{"statusUpdate":{"taskId":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_COMPLETED","timestamp":"2026-05-19T12:00:01Z"}}}', + event: "event", + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + retry: 1, + }, + ]); + }); + + test("subscribe (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("subscribe (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); }); }); diff --git a/tests/wire/agentic/connectors.test.ts b/tests/wire/agentic/connectors.test.ts index f09b4596..22533425 100644 --- a/tests/wire/agentic/connectors.test.ts +++ b/tests/wire/agentic/connectors.test.ts @@ -456,4 +456,165 @@ describe("ConnectorsClient", () => { return await client.agentic.connectors.remove("agentId", "agentConnectorId"); }).rejects.toThrow(Corti.NotFoundError); }); + + test("update (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { enabled: false }; + const rawResponseBody = { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }; + + server + .mockEndpoint() + .patch( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ) + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.connectors.update( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + { + enabled: false, + }, + ); + expect(response).toEqual({ + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }); + }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { error: { code: "code", message: "message" } }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(501) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotImplementedError); + }); }); diff --git a/tests/wire/agentic/contexts.test.ts b/tests/wire/agentic/contexts.test.ts index 20e532a9..ebbbf710 100644 --- a/tests/wire/agentic/contexts.test.ts +++ b/tests/wire/agentic/contexts.test.ts @@ -6,6 +6,90 @@ import { mockServerPool } from "../../mock-server/MockServerPool"; import { mockOAuth } from "../mockAuth"; describe("ContextsClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + contexts: [ + { + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + expiresAt: "2024-01-15T09:30:00Z", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint({ once: false }) + .get("/v2/agentic/contexts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + contexts: [ + { + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + expiresAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + const page = await client.agentic.contexts.list(); + + expect(expected.contexts).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.contexts).toEqual(nextPage.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.list(); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + test("get (1)", async () => { const server = mockServerPool.createServer(); mockOAuth(server); From 53309e043c46cd74a548a49f6b30ec4520462388 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 14:29:10 +0000 Subject: [PATCH 09/18] SDK regeneration --- .fern/metadata.json | 4 +- src/BaseClient.ts | 4 +- src/Client.ts | 6 - src/api/errors/NotImplementedError.ts | 22 - src/api/errors/index.ts | 1 - src/api/resources/agentic/client/Client.ts | 661 ---------- src/api/resources/agentic/client/index.ts | 1 - .../client/requests/AgentsCreateRequest.ts | 69 -- .../client/requests/AgentsPatchRequest.ts | 30 - .../client/requests/ListAgenticRequest.ts | 25 - .../agentic/client/requests/index.ts | 3 - src/api/resources/agentic/index.ts | 2 - .../agentic/resources/a2A/client/Client.ts | 345 ------ .../agentic/resources/a2A/client/index.ts | 1 - .../a2A/client/requests/A2AjsonrpcRequest.ts | 29 - .../resources/a2A/client/requests/index.ts | 1 - .../resources/agentic/resources/a2A/index.ts | 3 - .../agentic/resources/a2A/resources/index.ts | 2 - .../a2A/resources/tasks/client/Client.ts | 390 ------ .../a2A/resources/tasks/client/index.ts | 1 - .../tasks/client/requests/GetTasksRequest.ts | 10 - .../tasks/client/requests/ListTasksRequest.ts | 14 - .../resources/tasks/client/requests/index.ts | 2 - .../resources/a2A/resources/tasks/index.ts | 1 - .../a2A/types/A2AjsonrpcRequestId.ts | 3 - .../a2A/types/A2AjsonrpcRequestMethod.ts | 12 - .../agentic/resources/a2A/types/index.ts | 2 - .../resources/artifacts/client/Client.ts | 115 -- .../resources/artifacts/client/index.ts | 1 - .../agentic/resources/artifacts/index.ts | 1 - .../resources/connectors/client/Client.ts | 467 ------- .../resources/connectors/client/index.ts | 1 - .../client/requests/ConnectorsPatchRequest.ts | 21 - .../connectors/client/requests/index.ts | 1 - .../agentic/resources/connectors/index.ts | 1 - .../resources/contexts/client/Client.ts | 385 ------ .../resources/contexts/client/index.ts | 1 - .../client/requests/GetContextsRequest.ts | 10 - .../requests/GetTraceContextsRequest.ts | 12 - .../client/requests/ListContextsRequest.ts | 18 - .../contexts/client/requests/index.ts | 3 - .../agentic/resources/contexts/index.ts | 2 - .../resources/contexts/resources/index.ts | 2 - .../contexts/resources/tasks/client/Client.ts | 204 --- .../contexts/resources/tasks/client/index.ts | 1 - .../tasks/client/requests/ListTasksRequest.ts | 12 - .../resources/tasks/client/requests/index.ts | 1 - .../contexts/resources/tasks/index.ts | 1 - .../resources/feedback/client/Client.ts | 298 ----- .../resources/feedback/client/index.ts | 1 - .../client/requests/FeedbackCreateRequest.ts | 49 - .../feedback/client/requests/index.ts | 1 - .../agentic/resources/feedback/index.ts | 1 - src/api/resources/agentic/resources/index.ts | 14 - .../resources/registry/client/Client.ts | 194 --- .../resources/registry/client/index.ts | 1 - .../client/requests/ListRegistryRequest.ts | 17 - .../registry/client/requests/index.ts | 1 - .../agentic/resources/registry/index.ts | 1 - .../agentic/resources/usage/client/Client.ts | 131 -- .../agentic/resources/usage/client/index.ts | 1 - .../usage/client/requests/GetUsageRequest.ts | 25 - .../resources/usage/client/requests/index.ts | 1 - .../agentic/resources/usage/index.ts | 1 - src/api/resources/index.ts | 2 - src/api/types/A2ASendMessageConfiguration.ts | 13 - src/api/types/A2ASendMessageRequest.ts | 15 - src/api/types/A2ASendMessageResponse.ts | 6 - src/api/types/A2AStreamEventResponse.ts | 18 - src/api/types/A2AjsonrpcResponse.ts | 16 - src/api/types/A2AjsonrpcResponseError.ts | 13 - src/api/types/A2AjsonrpcResponseId.ts | 3 - src/api/types/AgentCardResponse.ts | 37 - .../types/AgentCardResponseCapabilities.ts | 14 - src/api/types/AgentCardResponseProvider.ts | 11 - .../types/AgentCardResponseSignaturesItem.ts | 10 - src/api/types/AgentCardResponseSkillsItem.ts | 12 - ...gentCardResponseSupportedInterfacesItem.ts | 12 - ...eSupportedInterfacesItemProtocolBinding.ts | 9 - src/api/types/AgentsLabels.ts | 6 - src/api/types/AgentsLifecycle.ts | 11 - src/api/types/AgentsListResponse.ts | 13 - src/api/types/AgentsResponse.ts | 32 - src/api/types/AgentsUserIdValue.ts | 6 - src/api/types/AgentsVisibility.ts | 13 - src/api/types/CommonA2AConnector.ts | 22 - src/api/types/CommonA2AConnectorCreate.ts | 14 - src/api/types/CommonAgentConnector.ts | 19 - src/api/types/CommonAgentConnectorCreate.ts | 13 - src/api/types/CommonAgentIdValue.ts | 6 - src/api/types/CommonArtifactIdValue.ts | 6 - src/api/types/CommonArtifactResponse.ts | 20 - src/api/types/CommonConnectorAuth.ts | 17 - src/api/types/CommonConnectorAuthType.ts | 10 - src/api/types/CommonConnectorCreateRequest.ts | 13 - src/api/types/CommonConnectorIdValue.ts | 6 - src/api/types/CommonConnectorResponse.ts | 13 - src/api/types/CommonConnectorType.ts | 15 - src/api/types/CommonContextIdValue.ts | 6 - src/api/types/CommonErrorResponse.ts | 24 - src/api/types/CommonErrorResponseError.ts | 25 - .../types/CommonErrorResponseErrorDetails.ts | 14 - ...esponseErrorDetailsValidationErrorsItem.ts | 8 - src/api/types/CommonMcpConnector.ts | 23 - src/api/types/CommonMcpConnectorCreate.ts | 17 - src/api/types/CommonMessage.ts | 27 - src/api/types/CommonMessageIdValue.ts | 6 - src/api/types/CommonNextPageToken.ts | 6 - src/api/types/CommonPart.ts | 23 - .../types/CommonRegistryConnectorCreate.ts | 14 - .../CommonRegistryConnectorProvisioned.ts | 22 - src/api/types/CommonRole.ts | 8 - src/api/types/CommonSchemaConnector.ts | 26 - src/api/types/CommonSchemaConnectorCreate.ts | 20 - .../CommonSchemaConnectorCreateTransition.ts | 9 - .../types/CommonSchemaConnectorTransition.ts | 9 - src/api/types/CommonTaskIdValue.ts | 6 - src/api/types/CommonTaskListResponse.ts | 15 - src/api/types/CommonTaskMetadata.ts | 15 - src/api/types/CommonTaskResponse.ts | 18 - src/api/types/CommonTaskState.ts | 14 - src/api/types/CommonTaskStatus.ts | 13 - src/api/types/CommonTotalSize.ts | 6 - src/api/types/CommonUsage.ts | 27 - src/api/types/ConnectorsListResponse.ts | 11 - src/api/types/Contexts.ts | 19 - src/api/types/ContextsDetailResponse.ts | 14 - src/api/types/ContextsListResponse.ts | 13 - src/api/types/ContextsOpenInferenceSpan.ts | 19 - src/api/types/ContextsTraceItem.ts | 13 - src/api/types/ContextsTraceItemTrace.ts | 25 - src/api/types/ContextsTraceResponse.ts | 14 - src/api/types/FeedbackActor.ts | 14 - src/api/types/FeedbackIdValue.ts | 6 - src/api/types/FeedbackLabel.ts | 37 - src/api/types/FeedbackListResponse.ts | 11 - src/api/types/FeedbackMetadata.ts | 18 - src/api/types/FeedbackRating.ts | 12 - src/api/types/FeedbackRatingScale.ts | 12 - src/api/types/FeedbackResponse.ts | 25 - src/api/types/FeedbackTarget.ts | 11 - .../types/RegistryConnectorCapabilities.ts | 15 - .../types/RegistryConnectorListResponse.ts | 13 - src/api/types/RegistryConnectorResponse.ts | 35 - src/api/types/RegistryIcon.ts | 13 - src/api/types/UsageBucket.ts | 13 - src/api/types/UsageGranularity.ts | 10 - src/api/types/UsageMetrics.ts | 11 - src/api/types/UsageReportResponse.ts | 18 - src/api/types/index.ts | 84 -- src/core/index.ts | 1 - src/core/stream/Stream.ts | 235 ---- src/core/stream/index.ts | 1 - .../resources/agentic/client/index.ts | 1 - .../client/requests/AgentsCreateRequest.ts | 36 - .../client/requests/AgentsPatchRequest.ts | 37 - .../agentic/client/requests/index.ts | 2 - src/serialization/resources/agentic/index.ts | 2 - .../agentic/resources/a2A/client/index.ts | 1 - .../a2A/client/requests/A2AjsonrpcRequest.ts | 24 - .../resources/a2A/client/requests/index.ts | 1 - .../resources/agentic/resources/a2A/index.ts | 2 - .../a2A/types/A2AjsonrpcRequestId.ts | 14 - .../a2A/types/A2AjsonrpcRequestMethod.ts | 27 - .../agentic/resources/a2A/types/index.ts | 2 - .../resources/connectors/client/index.ts | 1 - .../client/requests/ConnectorsPatchRequest.ts | 27 - .../connectors/client/requests/index.ts | 1 - .../agentic/resources/connectors/index.ts | 1 - .../resources/feedback/client/index.ts | 1 - .../client/requests/FeedbackCreateRequest.ts | 30 - .../feedback/client/requests/index.ts | 1 - .../agentic/resources/feedback/index.ts | 1 - .../resources/agentic/resources/index.ts | 7 - src/serialization/resources/index.ts | 2 - .../types/A2ASendMessageConfiguration.ts | 22 - .../types/A2ASendMessageRequest.ts | 26 - .../types/A2ASendMessageResponse.ts | 14 - .../types/A2AStreamEventResponse.ts | 24 - src/serialization/types/A2AjsonrpcResponse.ts | 26 - .../types/A2AjsonrpcResponseError.ts | 22 - .../types/A2AjsonrpcResponseId.ts | 14 - src/serialization/types/AgentCardResponse.ts | 51 - .../types/AgentCardResponseCapabilities.ts | 20 - .../types/AgentCardResponseProvider.ts | 20 - .../types/AgentCardResponseSignaturesItem.ts | 22 - .../types/AgentCardResponseSkillsItem.ts | 24 - ...gentCardResponseSupportedInterfacesItem.ts | 23 - ...eSupportedInterfacesItemProtocolBinding.ts | 14 - src/serialization/types/AgentsLabels.ts | 12 - src/serialization/types/AgentsLifecycle.ts | 12 - src/serialization/types/AgentsListResponse.ts | 25 - src/serialization/types/AgentsResponse.ts | 44 - src/serialization/types/AgentsUserIdValue.ts | 12 - src/serialization/types/AgentsVisibility.ts | 12 - src/serialization/types/CommonA2AConnector.ts | 27 - .../types/CommonA2AConnectorCreate.ts | 24 - .../types/CommonAgentConnector.ts | 26 - .../types/CommonAgentConnectorCreate.ts | 23 - src/serialization/types/CommonAgentIdValue.ts | 14 - .../types/CommonArtifactIdValue.ts | 14 - .../types/CommonArtifactResponse.ts | 30 - .../types/CommonConnectorAuth.ts | 25 - .../types/CommonConnectorAuthType.ts | 14 - .../types/CommonConnectorCreateRequest.ts | 30 - .../types/CommonConnectorIdValue.ts | 14 - .../types/CommonConnectorResponse.ts | 30 - .../types/CommonConnectorType.ts | 14 - .../types/CommonContextIdValue.ts | 14 - .../types/CommonErrorResponse.ts | 19 - .../types/CommonErrorResponseError.ts | 27 - .../types/CommonErrorResponseErrorDetails.ts | 22 - ...esponseErrorDetailsValidationErrorsItem.ts | 20 - src/serialization/types/CommonMcpConnector.ts | 30 - .../types/CommonMcpConnectorCreate.ts | 27 - src/serialization/types/CommonMessage.ts | 35 - .../types/CommonMessageIdValue.ts | 14 - .../types/CommonNextPageToken.ts | 14 - src/serialization/types/CommonPart.ts | 31 - .../types/CommonRegistryConnectorCreate.ts | 24 - .../CommonRegistryConnectorProvisioned.ts | 27 - src/serialization/types/CommonRole.ts | 12 - .../types/CommonSchemaConnector.ts | 32 - .../types/CommonSchemaConnectorCreate.ts | 29 - .../CommonSchemaConnectorCreateTransition.ts | 14 - .../types/CommonSchemaConnectorTransition.ts | 14 - src/serialization/types/CommonTaskIdValue.ts | 12 - .../types/CommonTaskListResponse.ts | 27 - src/serialization/types/CommonTaskMetadata.ts | 22 - src/serialization/types/CommonTaskResponse.ts | 34 - src/serialization/types/CommonTaskState.ts | 29 - src/serialization/types/CommonTaskStatus.ts | 24 - src/serialization/types/CommonTotalSize.ts | 12 - src/serialization/types/CommonUsage.ts | 28 - .../types/ConnectorsListResponse.ts | 19 - src/serialization/types/Contexts.ts | 28 - .../types/ContextsDetailResponse.ts | 22 - .../types/ContextsListResponse.ts | 25 - .../types/ContextsOpenInferenceSpan.ts | 28 - src/serialization/types/ContextsTraceItem.ts | 22 - .../types/ContextsTraceItemTrace.ts | 34 - .../types/ContextsTraceResponse.ts | 25 - src/serialization/types/FeedbackActor.ts | 16 - src/serialization/types/FeedbackIdValue.ts | 12 - src/serialization/types/FeedbackLabel.ts | 41 - .../types/FeedbackListResponse.ts | 19 - src/serialization/types/FeedbackMetadata.ts | 23 - src/serialization/types/FeedbackRating.ts | 19 - .../types/FeedbackRatingScale.ts | 14 - src/serialization/types/FeedbackResponse.ts | 40 - src/serialization/types/FeedbackTarget.ts | 17 - .../types/RegistryConnectorCapabilities.ts | 24 - .../types/RegistryConnectorListResponse.ts | 25 - .../types/RegistryConnectorResponse.ts | 45 - src/serialization/types/RegistryIcon.ts | 20 - src/serialization/types/UsageBucket.ts | 21 - src/serialization/types/UsageGranularity.ts | 12 - src/serialization/types/UsageMetrics.ts | 18 - .../types/UsageReportResponse.ts | 29 - src/serialization/types/index.ts | 84 -- tests/unit/stream/Stream.test.ts | 563 --------- tests/wire/agentic.test.ts | 1089 ----------------- tests/wire/agentic/a2A.test.ts | 528 -------- tests/wire/agentic/a2A/tasks.test.ts | 706 ----------- tests/wire/agentic/artifacts.test.ts | 161 --- tests/wire/agentic/connectors.test.ts | 620 ---------- tests/wire/agentic/contexts.test.ts | 533 -------- tests/wire/agentic/contexts/tasks.test.ts | 398 ------ tests/wire/agentic/feedback.test.ts | 456 ------- tests/wire/agentic/registry.test.ts | 244 ---- tests/wire/agentic/usage.test.ts | 159 --- 271 files changed, 4 insertions(+), 12884 deletions(-) delete mode 100644 src/api/errors/NotImplementedError.ts delete mode 100644 src/api/resources/agentic/client/Client.ts delete mode 100644 src/api/resources/agentic/client/index.ts delete mode 100644 src/api/resources/agentic/client/requests/AgentsCreateRequest.ts delete mode 100644 src/api/resources/agentic/client/requests/AgentsPatchRequest.ts delete mode 100644 src/api/resources/agentic/client/requests/ListAgenticRequest.ts delete mode 100644 src/api/resources/agentic/client/requests/index.ts delete mode 100644 src/api/resources/agentic/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts delete mode 100644 src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts delete mode 100644 src/api/resources/agentic/resources/a2A/types/index.ts delete mode 100644 src/api/resources/agentic/resources/artifacts/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/artifacts/client/index.ts delete mode 100644 src/api/resources/agentic/resources/artifacts/index.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/index.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/connectors/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/index.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/index.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/feedback/index.ts delete mode 100644 src/api/resources/agentic/resources/index.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/index.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/registry/index.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/index.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/usage/index.ts delete mode 100644 src/api/types/A2ASendMessageConfiguration.ts delete mode 100644 src/api/types/A2ASendMessageRequest.ts delete mode 100644 src/api/types/A2ASendMessageResponse.ts delete mode 100644 src/api/types/A2AStreamEventResponse.ts delete mode 100644 src/api/types/A2AjsonrpcResponse.ts delete mode 100644 src/api/types/A2AjsonrpcResponseError.ts delete mode 100644 src/api/types/A2AjsonrpcResponseId.ts delete mode 100644 src/api/types/AgentCardResponse.ts delete mode 100644 src/api/types/AgentCardResponseCapabilities.ts delete mode 100644 src/api/types/AgentCardResponseProvider.ts delete mode 100644 src/api/types/AgentCardResponseSignaturesItem.ts delete mode 100644 src/api/types/AgentCardResponseSkillsItem.ts delete mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItem.ts delete mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts delete mode 100644 src/api/types/AgentsLabels.ts delete mode 100644 src/api/types/AgentsLifecycle.ts delete mode 100644 src/api/types/AgentsListResponse.ts delete mode 100644 src/api/types/AgentsResponse.ts delete mode 100644 src/api/types/AgentsUserIdValue.ts delete mode 100644 src/api/types/AgentsVisibility.ts delete mode 100644 src/api/types/CommonA2AConnector.ts delete mode 100644 src/api/types/CommonA2AConnectorCreate.ts delete mode 100644 src/api/types/CommonAgentConnector.ts delete mode 100644 src/api/types/CommonAgentConnectorCreate.ts delete mode 100644 src/api/types/CommonAgentIdValue.ts delete mode 100644 src/api/types/CommonArtifactIdValue.ts delete mode 100644 src/api/types/CommonArtifactResponse.ts delete mode 100644 src/api/types/CommonConnectorAuth.ts delete mode 100644 src/api/types/CommonConnectorAuthType.ts delete mode 100644 src/api/types/CommonConnectorCreateRequest.ts delete mode 100644 src/api/types/CommonConnectorIdValue.ts delete mode 100644 src/api/types/CommonConnectorResponse.ts delete mode 100644 src/api/types/CommonConnectorType.ts delete mode 100644 src/api/types/CommonContextIdValue.ts delete mode 100644 src/api/types/CommonErrorResponse.ts delete mode 100644 src/api/types/CommonErrorResponseError.ts delete mode 100644 src/api/types/CommonErrorResponseErrorDetails.ts delete mode 100644 src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts delete mode 100644 src/api/types/CommonMcpConnector.ts delete mode 100644 src/api/types/CommonMcpConnectorCreate.ts delete mode 100644 src/api/types/CommonMessage.ts delete mode 100644 src/api/types/CommonMessageIdValue.ts delete mode 100644 src/api/types/CommonNextPageToken.ts delete mode 100644 src/api/types/CommonPart.ts delete mode 100644 src/api/types/CommonRegistryConnectorCreate.ts delete mode 100644 src/api/types/CommonRegistryConnectorProvisioned.ts delete mode 100644 src/api/types/CommonRole.ts delete mode 100644 src/api/types/CommonSchemaConnector.ts delete mode 100644 src/api/types/CommonSchemaConnectorCreate.ts delete mode 100644 src/api/types/CommonSchemaConnectorCreateTransition.ts delete mode 100644 src/api/types/CommonSchemaConnectorTransition.ts delete mode 100644 src/api/types/CommonTaskIdValue.ts delete mode 100644 src/api/types/CommonTaskListResponse.ts delete mode 100644 src/api/types/CommonTaskMetadata.ts delete mode 100644 src/api/types/CommonTaskResponse.ts delete mode 100644 src/api/types/CommonTaskState.ts delete mode 100644 src/api/types/CommonTaskStatus.ts delete mode 100644 src/api/types/CommonTotalSize.ts delete mode 100644 src/api/types/CommonUsage.ts delete mode 100644 src/api/types/ConnectorsListResponse.ts delete mode 100644 src/api/types/Contexts.ts delete mode 100644 src/api/types/ContextsDetailResponse.ts delete mode 100644 src/api/types/ContextsListResponse.ts delete mode 100644 src/api/types/ContextsOpenInferenceSpan.ts delete mode 100644 src/api/types/ContextsTraceItem.ts delete mode 100644 src/api/types/ContextsTraceItemTrace.ts delete mode 100644 src/api/types/ContextsTraceResponse.ts delete mode 100644 src/api/types/FeedbackActor.ts delete mode 100644 src/api/types/FeedbackIdValue.ts delete mode 100644 src/api/types/FeedbackLabel.ts delete mode 100644 src/api/types/FeedbackListResponse.ts delete mode 100644 src/api/types/FeedbackMetadata.ts delete mode 100644 src/api/types/FeedbackRating.ts delete mode 100644 src/api/types/FeedbackRatingScale.ts delete mode 100644 src/api/types/FeedbackResponse.ts delete mode 100644 src/api/types/FeedbackTarget.ts delete mode 100644 src/api/types/RegistryConnectorCapabilities.ts delete mode 100644 src/api/types/RegistryConnectorListResponse.ts delete mode 100644 src/api/types/RegistryConnectorResponse.ts delete mode 100644 src/api/types/RegistryIcon.ts delete mode 100644 src/api/types/UsageBucket.ts delete mode 100644 src/api/types/UsageGranularity.ts delete mode 100644 src/api/types/UsageMetrics.ts delete mode 100644 src/api/types/UsageReportResponse.ts delete mode 100644 src/core/stream/Stream.ts delete mode 100644 src/core/stream/index.ts delete mode 100644 src/serialization/resources/agentic/client/index.ts delete mode 100644 src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts delete mode 100644 src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts delete mode 100644 src/serialization/resources/agentic/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/client/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/types/index.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/client/index.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/index.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/client/index.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/index.ts delete mode 100644 src/serialization/resources/agentic/resources/index.ts delete mode 100644 src/serialization/types/A2ASendMessageConfiguration.ts delete mode 100644 src/serialization/types/A2ASendMessageRequest.ts delete mode 100644 src/serialization/types/A2ASendMessageResponse.ts delete mode 100644 src/serialization/types/A2AStreamEventResponse.ts delete mode 100644 src/serialization/types/A2AjsonrpcResponse.ts delete mode 100644 src/serialization/types/A2AjsonrpcResponseError.ts delete mode 100644 src/serialization/types/A2AjsonrpcResponseId.ts delete mode 100644 src/serialization/types/AgentCardResponse.ts delete mode 100644 src/serialization/types/AgentCardResponseCapabilities.ts delete mode 100644 src/serialization/types/AgentCardResponseProvider.ts delete mode 100644 src/serialization/types/AgentCardResponseSignaturesItem.ts delete mode 100644 src/serialization/types/AgentCardResponseSkillsItem.ts delete mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts delete mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts delete mode 100644 src/serialization/types/AgentsLabels.ts delete mode 100644 src/serialization/types/AgentsLifecycle.ts delete mode 100644 src/serialization/types/AgentsListResponse.ts delete mode 100644 src/serialization/types/AgentsResponse.ts delete mode 100644 src/serialization/types/AgentsUserIdValue.ts delete mode 100644 src/serialization/types/AgentsVisibility.ts delete mode 100644 src/serialization/types/CommonA2AConnector.ts delete mode 100644 src/serialization/types/CommonA2AConnectorCreate.ts delete mode 100644 src/serialization/types/CommonAgentConnector.ts delete mode 100644 src/serialization/types/CommonAgentConnectorCreate.ts delete mode 100644 src/serialization/types/CommonAgentIdValue.ts delete mode 100644 src/serialization/types/CommonArtifactIdValue.ts delete mode 100644 src/serialization/types/CommonArtifactResponse.ts delete mode 100644 src/serialization/types/CommonConnectorAuth.ts delete mode 100644 src/serialization/types/CommonConnectorAuthType.ts delete mode 100644 src/serialization/types/CommonConnectorCreateRequest.ts delete mode 100644 src/serialization/types/CommonConnectorIdValue.ts delete mode 100644 src/serialization/types/CommonConnectorResponse.ts delete mode 100644 src/serialization/types/CommonConnectorType.ts delete mode 100644 src/serialization/types/CommonContextIdValue.ts delete mode 100644 src/serialization/types/CommonErrorResponse.ts delete mode 100644 src/serialization/types/CommonErrorResponseError.ts delete mode 100644 src/serialization/types/CommonErrorResponseErrorDetails.ts delete mode 100644 src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts delete mode 100644 src/serialization/types/CommonMcpConnector.ts delete mode 100644 src/serialization/types/CommonMcpConnectorCreate.ts delete mode 100644 src/serialization/types/CommonMessage.ts delete mode 100644 src/serialization/types/CommonMessageIdValue.ts delete mode 100644 src/serialization/types/CommonNextPageToken.ts delete mode 100644 src/serialization/types/CommonPart.ts delete mode 100644 src/serialization/types/CommonRegistryConnectorCreate.ts delete mode 100644 src/serialization/types/CommonRegistryConnectorProvisioned.ts delete mode 100644 src/serialization/types/CommonRole.ts delete mode 100644 src/serialization/types/CommonSchemaConnector.ts delete mode 100644 src/serialization/types/CommonSchemaConnectorCreate.ts delete mode 100644 src/serialization/types/CommonSchemaConnectorCreateTransition.ts delete mode 100644 src/serialization/types/CommonSchemaConnectorTransition.ts delete mode 100644 src/serialization/types/CommonTaskIdValue.ts delete mode 100644 src/serialization/types/CommonTaskListResponse.ts delete mode 100644 src/serialization/types/CommonTaskMetadata.ts delete mode 100644 src/serialization/types/CommonTaskResponse.ts delete mode 100644 src/serialization/types/CommonTaskState.ts delete mode 100644 src/serialization/types/CommonTaskStatus.ts delete mode 100644 src/serialization/types/CommonTotalSize.ts delete mode 100644 src/serialization/types/CommonUsage.ts delete mode 100644 src/serialization/types/ConnectorsListResponse.ts delete mode 100644 src/serialization/types/Contexts.ts delete mode 100644 src/serialization/types/ContextsDetailResponse.ts delete mode 100644 src/serialization/types/ContextsListResponse.ts delete mode 100644 src/serialization/types/ContextsOpenInferenceSpan.ts delete mode 100644 src/serialization/types/ContextsTraceItem.ts delete mode 100644 src/serialization/types/ContextsTraceItemTrace.ts delete mode 100644 src/serialization/types/ContextsTraceResponse.ts delete mode 100644 src/serialization/types/FeedbackActor.ts delete mode 100644 src/serialization/types/FeedbackIdValue.ts delete mode 100644 src/serialization/types/FeedbackLabel.ts delete mode 100644 src/serialization/types/FeedbackListResponse.ts delete mode 100644 src/serialization/types/FeedbackMetadata.ts delete mode 100644 src/serialization/types/FeedbackRating.ts delete mode 100644 src/serialization/types/FeedbackRatingScale.ts delete mode 100644 src/serialization/types/FeedbackResponse.ts delete mode 100644 src/serialization/types/FeedbackTarget.ts delete mode 100644 src/serialization/types/RegistryConnectorCapabilities.ts delete mode 100644 src/serialization/types/RegistryConnectorListResponse.ts delete mode 100644 src/serialization/types/RegistryConnectorResponse.ts delete mode 100644 src/serialization/types/RegistryIcon.ts delete mode 100644 src/serialization/types/UsageBucket.ts delete mode 100644 src/serialization/types/UsageGranularity.ts delete mode 100644 src/serialization/types/UsageMetrics.ts delete mode 100644 src/serialization/types/UsageReportResponse.ts delete mode 100644 tests/unit/stream/Stream.test.ts delete mode 100644 tests/wire/agentic.test.ts delete mode 100644 tests/wire/agentic/a2A.test.ts delete mode 100644 tests/wire/agentic/a2A/tasks.test.ts delete mode 100644 tests/wire/agentic/artifacts.test.ts delete mode 100644 tests/wire/agentic/connectors.test.ts delete mode 100644 tests/wire/agentic/contexts.test.ts delete mode 100644 tests/wire/agentic/contexts/tasks.test.ts delete mode 100644 tests/wire/agentic/feedback.test.ts delete mode 100644 tests/wire/agentic/registry.test.ts delete mode 100644 tests/wire/agentic/usage.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index d18c9351..0b137d8c 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "5.75.1", + "cliVersion": "5.77.0", "generatorName": "fernapi/fern-typescript-node-sdk", "generatorVersion": "3.54.0", "generatorConfig": { @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "179ce2aa8c7ce3a8001b6e6ae2e38a48998bab61", + "originGitCommit": "e823ff09435fdcb10253f674c070042b8a265d69", "sdkVersion": "0.0.0-dev" } diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 27d389e5..1b76cbaa 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -10,7 +10,7 @@ export type BaseClientOptions = { /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; /** Override the Tenant-Name header */ - tenantName?: core.Supplier; + tenantName: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | null | undefined>; /** The default maximum time to wait for a response in seconds. */ @@ -31,7 +31,7 @@ export interface BaseRequestOptions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Tenant-Name header */ - tenantName?: string | undefined; + tenantName?: string; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ diff --git a/src/Client.ts b/src/Client.ts index 0b8928d0..2098b736 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,6 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import { AgenticClient } from "./api/resources/agentic/client/Client.js"; import { AgentsClient } from "./api/resources/agents/client/Client.js"; import { AuthClient } from "./api/resources/auth/client/Client.js"; import { CodesClient } from "./api/resources/codes/client/Client.js"; @@ -34,7 +33,6 @@ export class CortiClient { protected _codes: CodesClient | undefined; protected _languages: LanguagesClient | undefined; protected _agents: AgentsClient | undefined; - protected _agentic: AgenticClient | undefined; protected _stream: StreamClient | undefined; protected _transcribe: TranscribeClient | undefined; @@ -82,10 +80,6 @@ export class CortiClient { return (this._agents ??= new AgentsClient(this._options)); } - public get agentic(): AgenticClient { - return (this._agentic ??= new AgenticClient(this._options)); - } - public get stream(): StreamClient { return (this._stream ??= new StreamClient(this._options)); } diff --git a/src/api/errors/NotImplementedError.ts b/src/api/errors/NotImplementedError.ts deleted file mode 100644 index 24387bb0..00000000 --- a/src/api/errors/NotImplementedError.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as core from "../../core/index.js"; -import * as errors from "../../errors/index.js"; -import type * as Corti from "../index.js"; - -export class NotImplementedError extends errors.CortiError { - constructor(body: Corti.CommonErrorResponse, rawResponse?: core.RawResponse) { - super({ - message: "NotImplementedError", - statusCode: 501, - body: body, - rawResponse: rawResponse, - }); - Object.setPrototypeOf(this, new.target.prototype); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = this.constructor.name; - } -} diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 1cd5a26b..7ce4a0f0 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -5,6 +5,5 @@ export * from "./ForbiddenError.js"; export * from "./GatewayTimeoutError.js"; export * from "./InternalServerError.js"; export * from "./NotFoundError.js"; -export * from "./NotImplementedError.js"; export * from "./UnauthorizedError.js"; export * from "./UnprocessableEntityError.js"; diff --git a/src/api/resources/agentic/client/Client.ts b/src/api/resources/agentic/client/Client.ts deleted file mode 100644 index aca3a420..00000000 --- a/src/api/resources/agentic/client/Client.ts +++ /dev/null @@ -1,661 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as core from "../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../errors/index.js"; -import * as serializers from "../../../../serialization/index.js"; -import * as Corti from "../../../index.js"; -import { A2AClient } from "../resources/a2A/client/Client.js"; -import { ArtifactsClient } from "../resources/artifacts/client/Client.js"; -import { ConnectorsClient } from "../resources/connectors/client/Client.js"; -import { ContextsClient } from "../resources/contexts/client/Client.js"; -import { FeedbackClient } from "../resources/feedback/client/Client.js"; -import { RegistryClient } from "../resources/registry/client/Client.js"; -import { UsageClient } from "../resources/usage/client/Client.js"; - -export declare namespace AgenticClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class AgenticClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _a2A: A2AClient | undefined; - protected _usage: UsageClient | undefined; - protected _connectors: ConnectorsClient | undefined; - protected _contexts: ContextsClient | undefined; - protected _artifacts: ArtifactsClient | undefined; - protected _registry: RegistryClient | undefined; - protected _feedback: FeedbackClient | undefined; - - constructor(options: AgenticClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get a2A(): A2AClient { - return (this._a2A ??= new A2AClient(this._options)); - } - - public get usage(): UsageClient { - return (this._usage ??= new UsageClient(this._options)); - } - - public get connectors(): ConnectorsClient { - return (this._connectors ??= new ConnectorsClient(this._options)); - } - - public get contexts(): ContextsClient { - return (this._contexts ??= new ContextsClient(this._options)); - } - - public get artifacts(): ArtifactsClient { - return (this._artifacts ??= new ArtifactsClient(this._options)); - } - - public get registry(): RegistryClient { - return (this._registry ??= new RegistryClient(this._options)); - } - - public get feedback(): FeedbackClient { - return (this._feedback ??= new FeedbackClient(this._options)); - } - - /** - * Lists agents visible to the caller. `private` agents are visible only to - * their creator/service principal; `unlisted` agents are omitted (fetch by - * ID instead); `public` agents are listed tenant-wide. - * The `visibility`, `lifecycle`, `label`, and `q` filter parameters are accepted but not yet honored by the server; the response is unfiltered. - * - * @param {Corti.ListAgenticRequest} request - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.list({ - * label: ["team=coding"], - * q: "coder" - * }) - */ - public async list( - request: Corti.ListAgenticRequest = {}, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async (request: Corti.ListAgenticRequest): Promise> => { - const { pageSize, pageToken, visibility, lifecycle, label, q } = request; - const _queryParams: Record = { - pageSize, - pageToken, - visibility: Array.isArray(visibility) - ? visibility.map((item) => - serializers.AgentsVisibility.jsonOrThrow(item, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - ) - : visibility != null - ? serializers.AgentsVisibility.jsonOrThrow(visibility, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - lifecycle: - lifecycle != null - ? serializers.AgentsLifecycle.jsonOrThrow(lifecycle, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - label, - q, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/agents", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents"); - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.nextPageToken != null && - !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: (response) => response?.agents ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); - }, - }); - } - - /** - * Creates a new agent. The server assigns the UUIDv7 `id`. - * - * @param {Corti.AgentsCreateRequest} request - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.ConflictError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agentic.create({ - * name: "coder", - * description: "Returns ICD-10 codes for a clinical encounter.", - * systemPrompt: "Respond with only the ICD-10 code.", - * model: "corti-default", - * visibility: "private", - * lifecycle: "persistent", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }, { - * type: "mcp", - * name: "policybot", - * url: "https://mcp.example.com", - * auth: { - * type: "oauth2", - * scope: "read:policies", - * redirectUrl: "https://app.corti.ai/oauth/callback" - * } - * }, { - * type: "schema", - * name: "submit_code", - * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - * schema: { - * "type": "object", - * "properties": { - * "code": { - * "type": "string", - * "description": "The selected ICD-10 code." - * }, - * "confidence": { - * "type": "number", - * "minimum": 0, - * "maximum": 1 - * } - * }, - * "required": [ - * "code" - * ] - * }, - * transition: "complete" - * }], - * labels: { - * "team": "coding", - * "env": "prod" - * } - * }) - */ - public create( - request: Corti.AgentsCreateRequest, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: Corti.AgentsCreateRequest, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/agents", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.AgentsCreateRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 409: - throw new Corti.ConflictError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/agentic/agents"); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public get( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents/{agentId}"); - } - - /** - * Deletes a `persistent` agent. `ephemeral` agents are expired in place. - * Idempotent: deleting an already-deleted agent returns `204`. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public delete( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(agentId, requestOptions)); - } - - private async __delete( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/agents/{agentId}", - ); - } - - /** - * Partially updates an agent using JSON Merge Patch (RFC 7386). - * Omitted fields are unchanged; `null` clears a field; arrays replace. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.AgentsPatchRequest} request - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * name: "coder-v2", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }] - * }) - */ - public update( - agentId: Corti.CommonAgentIdValue, - request: Corti.AgentsPatchRequest = {}, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(agentId, request, requestOptions)); - } - - private async __update( - agentId: Corti.CommonAgentIdValue, - request: Corti.AgentsPatchRequest = {}, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, - ), - method: "PATCH", - headers: _headers, - contentType: "application/merge-patch+json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.AgentsPatchRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "PATCH", - "/v2/agentic/agents/{agentId}", - ); - } - - /** - * Returns the A2A v1.0 agent card describing the agent's capabilities, - * skills, and supported protocol interfaces. Served at the standard - * `.well-known` location for agent discovery. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public getCard( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getCard(agentId, requestOptions)); - } - - private async __getCard( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/.well-known/agent-card.json`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentCardResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/.well-known/agent-card.json", - ); - } -} diff --git a/src/api/resources/agentic/client/index.ts b/src/api/resources/agentic/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts b/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts deleted file mode 100644 index 76267264..00000000 --- a/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts +++ /dev/null @@ -1,69 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * name: "coder", - * description: "Returns ICD-10 codes for a clinical encounter.", - * systemPrompt: "Respond with only the ICD-10 code.", - * model: "corti-default", - * visibility: "private", - * lifecycle: "persistent", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }, { - * type: "mcp", - * name: "policybot", - * url: "https://mcp.example.com", - * auth: { - * type: "oauth2", - * scope: "read:policies", - * redirectUrl: "https://app.corti.ai/oauth/callback" - * } - * }, { - * type: "schema", - * name: "submit_code", - * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - * schema: { - * "type": "object", - * "properties": { - * "code": { - * "type": "string", - * "description": "The selected ICD-10 code." - * }, - * "confidence": { - * "type": "number", - * "minimum": 0, - * "maximum": 1 - * } - * }, - * "required": [ - * "code" - * ] - * }, - * transition: "complete" - * }], - * labels: { - * "team": "coding", - * "env": "prod" - * } - * } - */ -export interface AgentsCreateRequest { - /** Human-readable, unique-per-tenant agent name. */ - name: string; - /** Free-form agent description. */ - description?: string; - /** System prompt prepended to every invocation. */ - systemPrompt?: string; - /** Tenant default if omitted. */ - model?: string; - visibility?: Corti.AgentsVisibility; - lifecycle?: Corti.AgentsLifecycle; - /** Connectors to attach at creation. Defaults to an empty array. */ - connectors?: Corti.CommonConnectorCreateRequest[]; - labels?: Corti.AgentsLabels; -} diff --git a/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts b/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts deleted file mode 100644 index 30cfd750..00000000 --- a/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * name: "coder-v2", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }] - * } - */ -export interface AgentsPatchRequest { - /** New agent name. */ - name?: string; - /** New description; `null` clears it. */ - description?: string | null; - /** New system prompt; `null` clears it. */ - systemPrompt?: string | null; - /** New model identifier; `null` falls back to the tenant default. */ - model?: string | null; - visibility?: Corti.AgentsVisibility; - lifecycle?: Corti.AgentsLifecycle; - /** Replacement connector list; `null` clears connectors. */ - connectors?: Corti.CommonConnectorCreateRequest[] | null; - /** Replacement labels; `null` clears labels. */ - labels?: Record | null; -} diff --git a/src/api/resources/agentic/client/requests/ListAgenticRequest.ts b/src/api/resources/agentic/client/requests/ListAgenticRequest.ts deleted file mode 100644 index 5adb8943..00000000 --- a/src/api/resources/agentic/client/requests/ListAgenticRequest.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * label: ["team=coding"], - * q: "coder" - * } - */ -export interface ListAgenticRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; - /** Filter by one or more visibility levels. */ - visibility?: Corti.AgentsVisibility | Corti.AgentsVisibility[]; - /** Filter by lifecycle. */ - lifecycle?: Corti.AgentsLifecycle; - /** Filter by label equality, repeated `key=value` pairs (AND-combined). */ - label?: string | string[]; - /** Free-text search over `name` and `description`. */ - q?: string; -} diff --git a/src/api/resources/agentic/client/requests/index.ts b/src/api/resources/agentic/client/requests/index.ts deleted file mode 100644 index 040d53cb..00000000 --- a/src/api/resources/agentic/client/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { AgentsCreateRequest } from "./AgentsCreateRequest.js"; -export type { AgentsPatchRequest } from "./AgentsPatchRequest.js"; -export type { ListAgenticRequest } from "./ListAgenticRequest.js"; diff --git a/src/api/resources/agentic/index.ts b/src/api/resources/agentic/index.ts deleted file mode 100644 index 9eb1192d..00000000 --- a/src/api/resources/agentic/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/client/Client.ts b/src/api/resources/agentic/resources/a2A/client/Client.ts deleted file mode 100644 index 04b6729a..00000000 --- a/src/api/resources/agentic/resources/a2A/client/Client.ts +++ /dev/null @@ -1,345 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; -import { TasksClient } from "../resources/tasks/client/Client.js"; - -export declare namespace A2AClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class A2AClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _tasks: TasksClient | undefined; - - constructor(options: A2AClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get tasks(): TasksClient { - return (this._tasks ??= new TasksClient(this._options)); - } - - /** - * The `JSONRPC` protocol binding for A2A v1.0. Accepts a single JSON-RPC 2.0 - * request whose `method` is one of `SendMessage`, `SendStreamingMessage`, - * `GetTask`, `ListTasks`, `CancelTask`, or `SubscribeToTask`. - * - * Streaming methods (`SendStreamingMessage`, `SubscribeToTask`) respond with - * `text/event-stream`; all others respond with a single JSON-RPC response. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agentic.A2AjsonrpcRequest} request - * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * id: "1", - * method: "SendMessage", - * params: { - * "message": { - * "role": "ROLE_USER", - * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - * "parts": [ - * { - * "text": "Code this encounter." - * } - * ] - * } - * } - * }) - */ - public jsonRpc( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.A2AjsonrpcRequest, - requestOptions?: A2AClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__jsonRpc(agentId, request, requestOptions)); - } - - private async __jsonRpc( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.A2AjsonrpcRequest, - requestOptions?: A2AClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: { - ...serializers.agentic.A2AjsonrpcRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - jsonrpc: "2.0", - }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.A2AjsonrpcResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a", - ); - } - - /** - * The `HTTP+JSON` binding of A2A `SendMessage`. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.A2ASendMessageRequest} request - * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * message: { - * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - * role: "ROLE_USER", - * parts: [{ - * text: "What is the ICD-10 code for asthma?" - * }] - * } - * }) - */ - public sendMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__sendMessage(agentId, request, requestOptions)); - } - - private async __sendMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:send`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.A2ASendMessageResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/message:send", - ); - } - - /** - * The `HTTP+JSON` binding of A2A `SendStreamingMessage`. Responds with a - * `text/event-stream` of `Task`, `statusUpdate`, and `artifactUpdate` events. - */ - public streamMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): core.HttpResponsePromise> { - return core.HttpResponsePromise.fromPromise(this.__streamMessage(agentId, request, requestOptions)); - } - - private async __streamMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): Promise>> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:stream`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - responseType: "sse", - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: new core.Stream({ - stream: _response.body, - parse: async (data) => { - return serializers.A2AStreamEventResponse.parseOrThrow(data, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - }, - signal: requestOptions?.abortSignal, - eventShape: { - type: "sse", - }, - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/message:stream", - ); - } -} diff --git a/src/api/resources/agentic/resources/a2A/client/index.ts b/src/api/resources/agentic/resources/a2A/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/a2A/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts deleted file mode 100644 index 2681a71b..00000000 --- a/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * id: "1", - * method: "SendMessage", - * params: { - * "message": { - * "role": "ROLE_USER", - * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - * "parts": [ - * { - * "text": "Code this encounter." - * } - * ] - * } - * } - * } - */ -export interface A2AjsonrpcRequest { - id: Corti.agentic.A2AjsonrpcRequestId; - /** JSON-RPC method name (PascalCase on the wire). */ - method: Corti.agentic.A2AjsonrpcRequestMethod; - /** JSON-RPC params object. */ - params?: Record; -} diff --git a/src/api/resources/agentic/resources/a2A/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/client/requests/index.ts deleted file mode 100644 index 23999406..00000000 --- a/src/api/resources/agentic/resources/a2A/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/api/resources/agentic/resources/a2A/index.ts b/src/api/resources/agentic/resources/a2A/index.ts deleted file mode 100644 index 0ef16e76..00000000 --- a/src/api/resources/agentic/resources/a2A/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; -export * from "./types/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/index.ts b/src/api/resources/agentic/resources/a2A/resources/index.ts deleted file mode 100644 index a371e105..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./tasks/client/requests/index.js"; -export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts deleted file mode 100644 index 7cc1e7e3..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts +++ /dev/null @@ -1,390 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; -import { - type NormalizedClientOptionsWithAuth, - normalizeClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; -import * as core from "../../../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../errors/index.js"; -import * as serializers from "../../../../../../../../serialization/index.js"; -import * as Corti from "../../../../../../../index.js"; - -export declare namespace TasksClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class TasksClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: TasksClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agentic.a2A.ListTasksRequest} request - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public async list( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.a2A.ListTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async ( - request: Corti.agentic.a2A.ListTasksRequest, - ): Promise> => { - const { pageSize, pageToken, contextId } = request; - const _queryParams: Record = { - pageSize, - pageToken, - contextId, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/a2a/tasks", - ); - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.nextPageToken != null && - !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: (response) => response?.tasks ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); - }, - }); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.agentic.a2A.GetTasksRequest} request - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.a2A.tasks.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public get( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.a2A.GetTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, taskId, request, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.a2A.GetTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const { historyLength } = request; - const _queryParams: Record = { - historyLength, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.ConflictError} - * - * @example - * await client.agentic.a2A.tasks.cancel("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public cancel( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__cancel(agentId, taskId, requestOptions)); - } - - private async __cancel( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:cancel`, - ), - method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 409: - throw new Corti.ConflictError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:cancel", - ); - } - - /** - * Resubscribe to an in-flight task's event stream over SSE. - */ - public subscribe( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise> { - return core.HttpResponsePromise.fromPromise(this.__subscribe(agentId, taskId, requestOptions)); - } - - private async __subscribe( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): Promise>> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:subscribe`, - ), - method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - responseType: "sse", - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: new core.Stream({ - stream: _response.body, - parse: async (data) => { - return serializers.A2AStreamEventResponse.parseOrThrow(data, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - }, - signal: requestOptions?.abortSignal, - eventShape: { - type: "sse", - }, - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:subscribe", - ); - } -} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts deleted file mode 100644 index ea6be9c2..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface GetTasksRequest { - /** Cap the number of history messages returned. */ - historyLength?: number; -} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts deleted file mode 100644 index c784ca5d..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListTasksRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; - /** Restrict to tasks within this context. */ - contextId?: string; -} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts deleted file mode 100644 index 508b914d..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { GetTasksRequest } from "./GetTasksRequest.js"; -export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts deleted file mode 100644 index 579038a0..00000000 --- a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export type A2AjsonrpcRequestId = string | number; diff --git a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts deleted file mode 100644 index d6b216bb..00000000 --- a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** JSON-RPC method name (PascalCase on the wire). */ -export const A2AjsonrpcRequestMethod = { - SendMessage: "SendMessage", - SendStreamingMessage: "SendStreamingMessage", - GetTask: "GetTask", - ListTasks: "ListTasks", - CancelTask: "CancelTask", - SubscribeToTask: "SubscribeToTask", -} as const; -export type A2AjsonrpcRequestMethod = (typeof A2AjsonrpcRequestMethod)[keyof typeof A2AjsonrpcRequestMethod]; diff --git a/src/api/resources/agentic/resources/a2A/types/index.ts b/src/api/resources/agentic/resources/a2A/types/index.ts deleted file mode 100644 index d506c662..00000000 --- a/src/api/resources/agentic/resources/a2A/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./A2AjsonrpcRequestId.js"; -export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/api/resources/agentic/resources/artifacts/client/Client.ts b/src/api/resources/agentic/resources/artifacts/client/Client.ts deleted file mode 100644 index dcd57c7f..00000000 --- a/src/api/resources/agentic/resources/artifacts/client/Client.ts +++ /dev/null @@ -1,115 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace ArtifactsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class ArtifactsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: ArtifactsClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * Returns an artifact produced by a task within a context. File parts may - * carry inline `bytes` or a `uri` to fetch the content out of band. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.CommonArtifactIdValue} artifactId - Artifact identifier (prefixed UUIDv7). - * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.artifacts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84") - */ - public get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - artifactId: Corti.CommonArtifactIdValue, - requestOptions?: ArtifactsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, artifactId, requestOptions)); - } - - private async __get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - artifactId: Corti.CommonArtifactIdValue, - requestOptions?: ArtifactsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/artifacts/${core.url.encodePathParam(serializers.CommonArtifactIdValue.jsonOrThrow(artifactId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonArtifactResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/artifacts/{artifactId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/artifacts/client/index.ts b/src/api/resources/agentic/resources/artifacts/client/index.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/src/api/resources/agentic/resources/artifacts/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/src/api/resources/agentic/resources/artifacts/index.ts b/src/api/resources/agentic/resources/artifacts/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/artifacts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/connectors/client/Client.ts b/src/api/resources/agentic/resources/connectors/client/Client.ts deleted file mode 100644 index fa6bc5d3..00000000 --- a/src/api/resources/agentic/resources/connectors/client/Client.ts +++ /dev/null @@ -1,467 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace ConnectorsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class ConnectorsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: ConnectorsClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public list( - agentId: Corti.CommonAgentIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions)); - } - - private async __list( - agentId: Corti.CommonAgentIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ConnectorsListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/connectors", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorCreateRequest} request - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.ConflictError} - * - * @example - * await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * type: "registry", - * name: "@dedalus/coding-expert" - * }) - */ - public attach( - agentId: Corti.CommonAgentIdValue, - request: Corti.CommonConnectorCreateRequest, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__attach(agentId, request, requestOptions)); - } - - private async __attach( - agentId: Corti.CommonAgentIdValue, - request: Corti.CommonConnectorCreateRequest, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.CommonConnectorCreateRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 409: - throw new Corti.ConflictError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/connectors", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.connectors.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") - */ - public get( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, agentConnectorId, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.connectors.remove("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") - */ - public remove( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__remove(agentId, agentConnectorId, requestOptions)); - } - - private async __remove( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", - ); - } - - /** - * Partially updates an agent-scoped connector using JSON Merge Patch - * (RFC 7386). `type` is immutable. - * **Future scope**: not yet implemented; the server returns `501`. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). - * @param {Corti.agentic.ConnectorsPatchRequest} request - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.NotImplementedError} - * - * @example - * await client.agentic.connectors.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", { - * enabled: false - * }) - */ - public update( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - request: Corti.agentic.ConnectorsPatchRequest = {}, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(agentId, agentConnectorId, request, requestOptions)); - } - - private async __update( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - request: Corti.agentic.ConnectorsPatchRequest = {}, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, - ), - method: "PATCH", - headers: _headers, - contentType: "application/merge-patch+json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.agentic.ConnectorsPatchRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 501: - throw new Corti.NotImplementedError( - serializers.CommonErrorResponse.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "PATCH", - "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/connectors/client/index.ts b/src/api/resources/agentic/resources/connectors/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/connectors/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts deleted file mode 100644 index 5094288b..00000000 --- a/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * enabled: false - * } - */ -export interface ConnectorsPatchRequest { - /** Whether the connector is active. */ - enabled?: boolean; - /** New connector name. */ - name?: string; - /** New connector URL; `null` clears it. */ - url?: string | null; - /** New connector config; `null` clears it. */ - config?: Record | null; - auth?: Corti.CommonConnectorAuth | null; -} diff --git a/src/api/resources/agentic/resources/connectors/client/requests/index.ts b/src/api/resources/agentic/resources/connectors/client/requests/index.ts deleted file mode 100644 index d39ed3f7..00000000 --- a/src/api/resources/agentic/resources/connectors/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/api/resources/agentic/resources/connectors/index.ts b/src/api/resources/agentic/resources/connectors/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/connectors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/client/Client.ts b/src/api/resources/agentic/resources/contexts/client/Client.ts deleted file mode 100644 index 58aa4100..00000000 --- a/src/api/resources/agentic/resources/contexts/client/Client.ts +++ /dev/null @@ -1,385 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; -import { TasksClient } from "../resources/tasks/client/Client.js"; - -export declare namespace ContextsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class ContextsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _tasks: TasksClient | undefined; - - constructor(options: ContextsClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get tasks(): TasksClient { - return (this._tasks ??= new TasksClient(this._options)); - } - - /** - * Lists contexts matching the filters. - * **Future scope**: not yet implemented; the server currently returns an empty page and ignores all parameters. - * - * @param {Corti.agentic.ListContextsRequest} request - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.contexts.list() - */ - public async list( - request: Corti.agentic.ListContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async ( - request: Corti.agentic.ListContextsRequest, - ): Promise> => { - const { agentId, from: from_, to, pageSize, pageToken } = request; - const _queryParams: Record = { - agentId, - from: from_ != null ? from_?.toISOString() : undefined, - to: to != null ? to?.toISOString() : undefined, - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/contexts", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ContextsListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/contexts"); - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.nextPageToken != null && - !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: (response) => response?.contexts ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); - }, - }); - } - - /** - * Returns the context's metadata together with its `tasks`, oldest first. - * Each task carries its full message `history`; the user's prompt for a - * task is the `ROLE_USER` message within that task's history (there is no - * separate top-level message list). - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agentic.GetContextsRequest} request - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public get( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.GetContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(contextId, request, requestOptions)); - } - - private async __get( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.GetContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const { historyLength } = request; - const _queryParams: Record = { - historyLength, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ContextsDetailResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}", - ); - } - - /** - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public delete( - contextId: Corti.CommonContextIdValue, - requestOptions?: ContextsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(contextId, requestOptions)); - } - - private async __delete( - contextId: Corti.CommonContextIdValue, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/contexts/{contextId}", - ); - } - - /** - * Returns the execution traces for the context — LLM calls, tool - * executions, and token usage — in OpenInference format. Traces are - * ordered newest-first and paginated; each page returns up to `pageSize` - * traces with their spans inlined. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agentic.GetTraceContextsRequest} request - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public async getTrace( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.GetTraceContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async ( - request: Corti.agentic.GetTraceContextsRequest, - ): Promise> => { - const { pageSize, pageToken } = request; - const _queryParams: Record = { - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/trace`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ContextsTraceResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/trace", - ); - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.nextPageToken != null && - !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: (response) => response?.traces ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); - }, - }); - } -} diff --git a/src/api/resources/agentic/resources/contexts/client/index.ts b/src/api/resources/agentic/resources/contexts/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/contexts/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts deleted file mode 100644 index ac1ae3a8..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface GetContextsRequest { - /** Cap the number of history messages returned per task. */ - historyLength?: number; -} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts deleted file mode 100644 index e85c8b41..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface GetTraceContextsRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts deleted file mode 100644 index 111bb811..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListContextsRequest { - /** Restrict to contexts owned by this agent. */ - agentId?: string; - /** Inclusive lower bound on `createdAt` (RFC 3339). */ - from?: Date; - /** Exclusive upper bound on `createdAt` (RFC 3339). */ - to?: Date; - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/client/requests/index.ts deleted file mode 100644 index db21c8ce..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { GetContextsRequest } from "./GetContextsRequest.js"; -export type { GetTraceContextsRequest } from "./GetTraceContextsRequest.js"; -export type { ListContextsRequest } from "./ListContextsRequest.js"; diff --git a/src/api/resources/agentic/resources/contexts/index.ts b/src/api/resources/agentic/resources/contexts/index.ts deleted file mode 100644 index 9eb1192d..00000000 --- a/src/api/resources/agentic/resources/contexts/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/index.ts b/src/api/resources/agentic/resources/contexts/resources/index.ts deleted file mode 100644 index a371e105..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./tasks/client/requests/index.js"; -export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts deleted file mode 100644 index 16e40169..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts +++ /dev/null @@ -1,204 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; -import { - type NormalizedClientOptionsWithAuth, - normalizeClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; -import * as core from "../../../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../errors/index.js"; -import * as serializers from "../../../../../../../../serialization/index.js"; -import * as Corti from "../../../../../../../index.js"; - -export declare namespace TasksClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class TasksClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: TasksClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agentic.contexts.ListTasksRequest} request - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public async list( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.contexts.ListTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async ( - request: Corti.agentic.contexts.ListTasksRequest, - ): Promise> => { - const { pageSize, pageToken } = request; - const _queryParams: Record = { - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks", - ); - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.nextPageToken != null && - !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: (response) => response?.tasks ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); - }, - }); - } - - /** - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.tasks.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, requestOptions)); - } - - private async __get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts deleted file mode 100644 index 05240c95..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListTasksRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts deleted file mode 100644 index 0e50f63c..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/feedback/client/Client.ts b/src/api/resources/agentic/resources/feedback/client/Client.ts deleted file mode 100644 index 784387ff..00000000 --- a/src/api/resources/agentic/resources/feedback/client/Client.ts +++ /dev/null @@ -1,298 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace FeedbackClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class FeedbackClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: FeedbackClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * Returns all feedback resources submitted for the task by the authenticated user, newest-first. The task must exist, belong to the supplied context, and belong to the authenticated customer. Feedback is scoped to the calling user via row-level security, so the response contains only that user's feedback. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.feedback.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public list( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(contextId, taskId, requestOptions)); - } - - private async __list( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.FeedbackListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", - ); - } - - /** - * Submits feedback about a task as a whole or about a specific user-visible - * message within the task. The task must exist, belong to the supplied - * context, and belong to the authenticated customer. Multiple feedback - * resources may be submitted for the same task or message. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.agentic.FeedbackCreateRequest} request - * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { - * rating: { - * scale: "binary", - * value: 1 - * } - * }) - * - * @example - * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { - * rating: { - * scale: "binary", - * value: 0 - * }, - * labels: ["unsupportedClaim"], - * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - * target: { - * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" - * }, - * metadata: { - * collectionMethod: "caseReview", - * clientReference: "case-review-728193", - * actor: { - * externalId: "clinician_4182" - * } - * } - * }) - */ - public create( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.FeedbackCreateRequest, - requestOptions?: FeedbackClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(contextId, taskId, request, requestOptions)); - } - - private async __create( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.FeedbackCreateRequest, - requestOptions?: FeedbackClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.agentic.FeedbackCreateRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.FeedbackResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", - ); - } - - /** - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.agentic.feedback.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public delete( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(contextId, taskId, requestOptions)); - } - - private async __delete( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", - ); - } -} diff --git a/src/api/resources/agentic/resources/feedback/client/index.ts b/src/api/resources/agentic/resources/feedback/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/feedback/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts deleted file mode 100644 index e427a0df..00000000 --- a/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts +++ /dev/null @@ -1,49 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * rating: { - * scale: "binary", - * value: 1 - * } - * } - * - * @example - * { - * rating: { - * scale: "binary", - * value: 0 - * }, - * labels: ["unsupportedClaim"], - * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - * target: { - * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" - * }, - * metadata: { - * collectionMethod: "caseReview", - * clientReference: "case-review-728193", - * actor: { - * externalId: "clinician_4182" - * } - * } - * } - */ -export interface FeedbackCreateRequest { - rating: Corti.FeedbackRating; - /** - * Structured observations about the result. Defaults to an empty array. - * Positive and negative labels may be combined. Duplicate labels are - * rejected. A maximum of five labels may be submitted. - */ - labels?: Corti.FeedbackLabel[]; - /** - * The user's explanation of the rating or labels. Required when `labels` - * contains `other`. - */ - reason?: string; - target?: Corti.FeedbackTarget; - metadata?: Corti.FeedbackMetadata; -} diff --git a/src/api/resources/agentic/resources/feedback/client/requests/index.ts b/src/api/resources/agentic/resources/feedback/client/requests/index.ts deleted file mode 100644 index 06c3ce4e..00000000 --- a/src/api/resources/agentic/resources/feedback/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/api/resources/agentic/resources/feedback/index.ts b/src/api/resources/agentic/resources/feedback/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/feedback/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/index.ts b/src/api/resources/agentic/resources/index.ts deleted file mode 100644 index 3fe97949..00000000 --- a/src/api/resources/agentic/resources/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from "./a2A/client/requests/index.js"; -export * as a2A from "./a2A/index.js"; -export * from "./a2A/types/index.js"; -export * as artifacts from "./artifacts/index.js"; -export * from "./connectors/client/requests/index.js"; -export * as connectors from "./connectors/index.js"; -export * from "./contexts/client/requests/index.js"; -export * as contexts from "./contexts/index.js"; -export * from "./feedback/client/requests/index.js"; -export * as feedback from "./feedback/index.js"; -export * from "./registry/client/requests/index.js"; -export * as registry from "./registry/index.js"; -export * from "./usage/client/requests/index.js"; -export * as usage from "./usage/index.js"; diff --git a/src/api/resources/agentic/resources/registry/client/Client.ts b/src/api/resources/agentic/resources/registry/client/Client.ts deleted file mode 100644 index 01250274..00000000 --- a/src/api/resources/agentic/resources/registry/client/Client.ts +++ /dev/null @@ -1,194 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace RegistryClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class RegistryClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: RegistryClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.agentic.ListRegistryRequest} request - * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.registry.list() - */ - public async list( - request: Corti.agentic.ListRegistryRequest = {}, - requestOptions?: RegistryClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async ( - request: Corti.agentic.ListRegistryRequest, - ): Promise> => { - const { q, pageSize, pageToken } = request; - const _queryParams: Record = { - q, - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/registry/connectors", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.RegistryConnectorListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/registry/connectors", - ); - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.nextPageToken != null && - !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: (response) => response?.connectors ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); - }, - }); - } - - /** - * @param {string} connectorId - Registry connector identifier (e.g. `@dedalus/coding-expert`). - * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.registry.get("connectorId") - */ - public get( - connectorId: string, - requestOptions?: RegistryClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(connectorId, requestOptions)); - } - - private async __get( - connectorId: string, - requestOptions?: RegistryClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/registry/connectors/${core.url.encodePathParam(connectorId)}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.RegistryConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/registry/connectors/{connectorId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/registry/client/index.ts b/src/api/resources/agentic/resources/registry/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/registry/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts b/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts deleted file mode 100644 index 8fb6c858..00000000 --- a/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListRegistryRequest { - /** - * Free-text search over name and description. - * **Future scope**: not yet implemented; the server ignores this parameter and returns the unfiltered page. - */ - q?: string; - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/registry/client/requests/index.ts b/src/api/resources/agentic/resources/registry/client/requests/index.ts deleted file mode 100644 index 763983d1..00000000 --- a/src/api/resources/agentic/resources/registry/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ListRegistryRequest } from "./ListRegistryRequest.js"; diff --git a/src/api/resources/agentic/resources/registry/index.ts b/src/api/resources/agentic/resources/registry/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/registry/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/usage/client/Client.ts b/src/api/resources/agentic/resources/usage/client/Client.ts deleted file mode 100644 index 4d54539e..00000000 --- a/src/api/resources/agentic/resources/usage/client/Client.ts +++ /dev/null @@ -1,131 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace UsageClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class UsageClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: UsageClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * Returns invocation metrics for the agent over the half-open `[from, to)` - * time range (UTC), bucketed at the requested `granularity`. The response - * echoes the resolved range and granularity, a `totals` summary across the - * whole range, and one `buckets` entry per period that had activity (the - * array is empty when there was none). When `from`/`to` are omitted, the - * range defaults to the last 30 days. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agentic.GetUsageRequest} request - * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * from: new Date("2026-05-19T00:00:00.000Z"), - * to: new Date("2026-05-20T00:00:00.000Z") - * }) - */ - public get( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.GetUsageRequest = {}, - requestOptions?: UsageClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, request, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.GetUsageRequest = {}, - requestOptions?: UsageClient.RequestOptions, - ): Promise> { - const { from: from_, to, granularity } = request; - const _queryParams: Record = { - from: from_ != null ? from_?.toISOString() : undefined, - to: to != null ? to?.toISOString() : undefined, - granularity: - granularity != null - ? serializers.UsageGranularity.jsonOrThrow(granularity, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/usage`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.UsageReportResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/usage", - ); - } -} diff --git a/src/api/resources/agentic/resources/usage/client/index.ts b/src/api/resources/agentic/resources/usage/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/usage/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts b/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts deleted file mode 100644 index c6f0d3f7..00000000 --- a/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * from: new Date("2026-05-19T00:00:00.000Z"), - * to: new Date("2026-05-20T00:00:00.000Z") - * } - */ -export interface GetUsageRequest { - /** - * Inclusive start of the range, as an RFC 3339 timestamp (UTC). - * Defaults to 30 days before `to`. Must not be after `to`. - */ - from?: Date; - /** - * Exclusive end of the range, as an RFC 3339 timestamp (UTC). - * Defaults to the current time. - */ - to?: Date; - /** Size of each reporting bucket. Defaults to `day`. */ - granularity?: Corti.UsageGranularity; -} diff --git a/src/api/resources/agentic/resources/usage/client/requests/index.ts b/src/api/resources/agentic/resources/usage/client/requests/index.ts deleted file mode 100644 index 6e62640f..00000000 --- a/src/api/resources/agentic/resources/usage/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { GetUsageRequest } from "./GetUsageRequest.js"; diff --git a/src/api/resources/agentic/resources/usage/index.ts b/src/api/resources/agentic/resources/usage/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/usage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 554828ee..2e1d98c8 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,5 +1,3 @@ -export * from "./agentic/client/requests/index.js"; -export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; export * from "./agents/types/index.js"; diff --git a/src/api/types/A2ASendMessageConfiguration.ts b/src/api/types/A2ASendMessageConfiguration.ts deleted file mode 100644 index b1fc30ed..00000000 --- a/src/api/types/A2ASendMessageConfiguration.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Per-request options controlling how a message is processed. - */ -export interface A2ASendMessageConfiguration { - /** If `true`, return as soon as the task is submitted, even if processing is still in progress. If `false` (default), wait until the task reaches a terminal (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`) or interrupted (`INPUT_REQUIRED`, `AUTH_REQUIRED`) state. */ - returnImmediately?: boolean; - /** Maximum number of prior messages to include as context. */ - historyLength?: number; - /** Output media types the caller accepts. */ - acceptedOutputModes?: string[]; -} diff --git a/src/api/types/A2ASendMessageRequest.ts b/src/api/types/A2ASendMessageRequest.ts deleted file mode 100644 index 0b8fcc65..00000000 --- a/src/api/types/A2ASendMessageRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for sending a message to an agent. - */ -export interface A2ASendMessageRequest { - message: Corti.CommonMessage; - configuration?: Corti.A2ASendMessageConfiguration; - /** Free-form request metadata. */ - metadata?: Record; - /** Optional. Opaque routing identifier. Must match the `tenant` value from the selected `AgentInterface` in the Agent Card when that field is set. */ - tenant?: string; -} diff --git a/src/api/types/A2ASendMessageResponse.ts b/src/api/types/A2ASendMessageResponse.ts deleted file mode 100644 index 4b03d590..00000000 --- a/src/api/types/A2ASendMessageResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Exactly one of `task` or `message` is present. - */ -export type A2ASendMessageResponse = unknown; diff --git a/src/api/types/A2AStreamEventResponse.ts b/src/api/types/A2AStreamEventResponse.ts deleted file mode 100644 index 36e6af48..00000000 --- a/src/api/types/A2AStreamEventResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * An SSE event carrying an A2A `HTTP+JSON` streaming response. - */ -export interface A2AStreamEventResponse { - /** SSE payload: an A2A HTTP+JSON streaming response. */ - data?: string; - /** Event type. Absent for the default `message` event. */ - event?: string; - /** - * Opaque event id. Clients echo the most recent value in the - * `Last-Event-ID` header to resume a dropped stream. - */ - id?: string; - /** Reconnection time in milliseconds the client should use. */ - retry?: number; -} diff --git a/src/api/types/A2AjsonrpcResponse.ts b/src/api/types/A2AjsonrpcResponse.ts deleted file mode 100644 index 431728b4..00000000 --- a/src/api/types/A2AjsonrpcResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A JSON-RPC 2.0 response envelope. - */ -export interface A2AjsonrpcResponse { - /** JSON-RPC protocol version; always `2.0`. */ - jsonrpc: "2.0"; - id: Corti.A2AjsonrpcResponseId | null; - /** JSON-RPC result object (present on success). */ - result?: Record; - /** JSON-RPC error object (present on failure). */ - error?: Corti.A2AjsonrpcResponseError; -} diff --git a/src/api/types/A2AjsonrpcResponseError.ts b/src/api/types/A2AjsonrpcResponseError.ts deleted file mode 100644 index f649367d..00000000 --- a/src/api/types/A2AjsonrpcResponseError.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * JSON-RPC error object (present on failure). - */ -export interface A2AjsonrpcResponseError { - /** JSON-RPC error code. */ - code: number; - /** Human-readable error message. */ - message: string; - /** Additional error details. */ - data?: Record; -} diff --git a/src/api/types/A2AjsonrpcResponseId.ts b/src/api/types/A2AjsonrpcResponseId.ts deleted file mode 100644 index ef652a55..00000000 --- a/src/api/types/A2AjsonrpcResponseId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export type A2AjsonrpcResponseId = string | number; diff --git a/src/api/types/AgentCardResponse.ts b/src/api/types/AgentCardResponse.ts deleted file mode 100644 index ecf4d1d7..00000000 --- a/src/api/types/AgentCardResponse.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An A2A agent card describing capabilities, skills, and supported interfaces. - */ -export interface AgentCardResponse { - /** Agent display name. */ - name: string; - /** Agent description. */ - description?: string; - /** A URL providing additional documentation about the agent. */ - documentationUrl?: string; - /** Optional URL to an icon for the agent. */ - iconUrl?: string; - /** Agent card version (SemVer). */ - version: string; - /** Agent capability flags (streaming, push notifications). */ - capabilities: Corti.AgentCardResponseCapabilities; - /** Default input media types. */ - defaultInputModes?: string[]; - /** Default output media types. */ - defaultOutputModes?: string[]; - /** Publishing organization and URL. */ - provider?: Corti.AgentCardResponseProvider; - /** Security requirements for contacting the agent. */ - securityRequirements?: Record[]; - /** The security scheme details used for authenticating with this agent. */ - securitySchemes?: Record; - /** JSON Web Signatures (JWS, RFC 7515) computed for this agent card. */ - signatures?: Corti.AgentCardResponseSignaturesItem[]; - /** Skills the agent exposes. */ - skills?: Corti.AgentCardResponseSkillsItem[]; - /** A2A protocol bindings. v2 advertises protocolVersion `1.0` only. */ - supportedInterfaces: Corti.AgentCardResponseSupportedInterfacesItem[]; -} diff --git a/src/api/types/AgentCardResponseCapabilities.ts b/src/api/types/AgentCardResponseCapabilities.ts deleted file mode 100644 index a28f56e0..00000000 --- a/src/api/types/AgentCardResponseCapabilities.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Agent capability flags (streaming, push notifications). - */ -export interface AgentCardResponseCapabilities { - /** Whether the agent supports streaming responses. */ - streaming?: boolean; - /** - * Whether the agent can push task updates to a client-supplied webhook. - * **Future scope**: the `tasks/pushNotificationConfig/*` management endpoints are not yet implemented. Expect this to be `false` until they ship. - */ - pushNotifications?: boolean; -} diff --git a/src/api/types/AgentCardResponseProvider.ts b/src/api/types/AgentCardResponseProvider.ts deleted file mode 100644 index 4ddb0ec9..00000000 --- a/src/api/types/AgentCardResponseProvider.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Publishing organization and URL. - */ -export interface AgentCardResponseProvider { - /** Publishing organization name. */ - organization?: string; - /** Publishing organization URL. */ - url?: string; -} diff --git a/src/api/types/AgentCardResponseSignaturesItem.ts b/src/api/types/AgentCardResponseSignaturesItem.ts deleted file mode 100644 index 1e9cfd7e..00000000 --- a/src/api/types/AgentCardResponseSignaturesItem.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentCardResponseSignaturesItem { - /** Base64url-encoded protected JWS header. */ - protected: string; - /** Unprotected JWS header values. */ - header?: Record; - /** Base64url-encoded signature. */ - signature: string; -} diff --git a/src/api/types/AgentCardResponseSkillsItem.ts b/src/api/types/AgentCardResponseSkillsItem.ts deleted file mode 100644 index 766ce4ce..00000000 --- a/src/api/types/AgentCardResponseSkillsItem.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentCardResponseSkillsItem { - /** Skill identifier. */ - id: string; - /** Skill display name. */ - name: string; - /** Skill description. */ - description?: string; - /** Keywords for search and filtering. */ - tags?: string[]; -} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItem.ts b/src/api/types/AgentCardResponseSupportedInterfacesItem.ts deleted file mode 100644 index 345f16d8..00000000 --- a/src/api/types/AgentCardResponseSupportedInterfacesItem.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentCardResponseSupportedInterfacesItem { - /** A2A protocol binding type. */ - protocolBinding: Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding; - /** A2A protocol version; always `1.0`. */ - protocolVersion: "1.0"; - /** Endpoint URL for this protocol binding. */ - url: string; -} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts deleted file mode 100644 index 658ead3f..00000000 --- a/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** A2A protocol binding type. */ -export const AgentCardResponseSupportedInterfacesItemProtocolBinding = { - Jsonrpc: "JSONRPC", - HttpJson: "HTTP+JSON", -} as const; -export type AgentCardResponseSupportedInterfacesItemProtocolBinding = - (typeof AgentCardResponseSupportedInterfacesItemProtocolBinding)[keyof typeof AgentCardResponseSupportedInterfacesItemProtocolBinding]; diff --git a/src/api/types/AgentsLabels.ts b/src/api/types/AgentsLabels.ts deleted file mode 100644 index f7a70f75..00000000 --- a/src/api/types/AgentsLabels.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Free-form `string → string` metadata for filtering and organisation. Not used for routing or auth. - */ -export type AgentsLabels = Record; diff --git a/src/api/types/AgentsLifecycle.ts b/src/api/types/AgentsLifecycle.ts deleted file mode 100644 index 479e335b..00000000 --- a/src/api/types/AgentsLifecycle.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * - `ephemeral` — short-lived; expired automatically. - * - `persistent` — retained until explicitly deleted. - */ -export const AgentsLifecycle = { - Ephemeral: "ephemeral", - Persistent: "persistent", -} as const; -export type AgentsLifecycle = (typeof AgentsLifecycle)[keyof typeof AgentsLifecycle]; diff --git a/src/api/types/AgentsListResponse.ts b/src/api/types/AgentsListResponse.ts deleted file mode 100644 index 3e2ede49..00000000 --- a/src/api/types/AgentsListResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of agents. - */ -export interface AgentsListResponse { - /** Agents on the current page. */ - agents: Corti.AgentsResponse[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/AgentsResponse.ts b/src/api/types/AgentsResponse.ts deleted file mode 100644 index ff04c554..00000000 --- a/src/api/types/AgentsResponse.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A configured agent — its metadata, model, and attached connectors. - */ -export interface AgentsResponse { - id: Corti.CommonAgentIdValue; - /** Human-readable, unique-per-tenant agent name. */ - name: string; - /** Free-form agent description shown to users and in tooling. */ - description?: string | null; - /** System prompt prepended to every invocation. */ - systemPrompt?: string | null; - /** - * Model identifier. Tenant default if omitted or `null`. - * **Open question** — in the current implementation a model is configured per *expert*, not per *agent* (`Expert.modelName`), and an `Agent` has no model field at all. The desired end state is that there is **no distinction between an expert and an agent**, so `model` lives uniformly on this resource. Until that convergence lands, the precedence of an agent-level `model` over a connector/expert-level override is undecided and MUST be resolved before this field ships. - */ - model?: string | null; - visibility: Corti.AgentsVisibility; - lifecycle: Corti.AgentsLifecycle; - /** Connectors attached to the agent, discriminated by `type`. */ - connectors: Corti.CommonConnectorResponse[]; - labels?: Corti.AgentsLabels; - /** When the agent was created. */ - createdAt?: Date; - /** When the agent was last updated. */ - updatedAt?: Date; - /** Principal (user or service principal) that created the agent. */ - createdBy?: Corti.AgentsUserIdValue; -} diff --git a/src/api/types/AgentsUserIdValue.ts b/src/api/types/AgentsUserIdValue.ts deleted file mode 100644 index 1b1123af..00000000 --- a/src/api/types/AgentsUserIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Principal identifier. Accepts `usr.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type AgentsUserIdValue = string; diff --git a/src/api/types/AgentsVisibility.ts b/src/api/types/AgentsVisibility.ts deleted file mode 100644 index 47ee0338..00000000 --- a/src/api/types/AgentsVisibility.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * - `private` — creator / service principal only. - * - `unlisted` — usable by ID, hidden from list results. - * - `public` — listed tenant-wide. - */ -export const AgentsVisibility = { - Private: "private", - Unlisted: "unlisted", - Public: "public", -} as const; -export type AgentsVisibility = (typeof AgentsVisibility)[keyof typeof AgentsVisibility]; diff --git a/src/api/types/CommonA2AConnector.ts b/src/api/types/CommonA2AConnector.ts deleted file mode 100644 index 66820c78..00000000 --- a/src/api/types/CommonA2AConnector.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector that delegates to a remote A2A agent by endpoint URL. - */ -export interface CommonA2AConnector { - type: "a2a"; - /** Optional display name for the remote A2A agent. */ - name?: string; - /** The remote agent's A2A endpoint (typically a `.well-known/agent-card.json`). */ - url: string; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonA2AConnectorCreate.ts b/src/api/types/CommonA2AConnectorCreate.ts deleted file mode 100644 index 206c2513..00000000 --- a/src/api/types/CommonA2AConnectorCreate.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Request body for attaching a remote A2A agent connector. - */ -export interface CommonA2AConnectorCreate { - type: "a2a"; - /** Optional display name for the remote A2A agent. */ - name?: string; - /** Remote agent A2A endpoint URL. */ - url: string; - /** Whether the connector is active for invocations. */ - enabled?: boolean; -} diff --git a/src/api/types/CommonAgentConnector.ts b/src/api/types/CommonAgentConnector.ts deleted file mode 100644 index a07da86b..00000000 --- a/src/api/types/CommonAgentConnector.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector that delegates to another agent. - */ -export interface CommonAgentConnector { - type: "agent"; - agentId: Corti.CommonAgentIdValue; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonAgentConnectorCreate.ts b/src/api/types/CommonAgentConnectorCreate.ts deleted file mode 100644 index b88662df..00000000 --- a/src/api/types/CommonAgentConnectorCreate.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for attaching an agent connector. - */ -export interface CommonAgentConnectorCreate { - type: "agent"; - agentId: Corti.CommonAgentIdValue; - /** Whether the connector is active for invocations. */ - enabled?: boolean; -} diff --git a/src/api/types/CommonAgentIdValue.ts b/src/api/types/CommonAgentIdValue.ts deleted file mode 100644 index 6a47de42..00000000 --- a/src/api/types/CommonAgentIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Agent identifier. Accepts `agt.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonAgentIdValue = string; diff --git a/src/api/types/CommonArtifactIdValue.ts b/src/api/types/CommonArtifactIdValue.ts deleted file mode 100644 index c77bf933..00000000 --- a/src/api/types/CommonArtifactIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Artifact identifier. Accepts `art.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonArtifactIdValue = string; diff --git a/src/api/types/CommonArtifactResponse.ts b/src/api/types/CommonArtifactResponse.ts deleted file mode 100644 index 675a5c94..00000000 --- a/src/api/types/CommonArtifactResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A named output produced by a task. - */ -export interface CommonArtifactResponse { - artifactId: Corti.CommonArtifactIdValue; - /** Optional artifact name. */ - name?: string; - /** A human-readable description of the artifact. */ - description?: string; - /** URIs of extensions that contributed to this artifact. */ - extensions?: string[]; - /** Optional metadata included with the artifact. */ - metadata?: Record; - /** Content parts of the artifact. */ - parts: Corti.CommonPart[]; -} diff --git a/src/api/types/CommonConnectorAuth.ts b/src/api/types/CommonConnectorAuth.ts deleted file mode 100644 index 74a0e61a..00000000 --- a/src/api/types/CommonConnectorAuth.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Authentication configuration for an outbound connector. - */ -export interface CommonConnectorAuth { - /** Authentication mechanism. */ - type: Corti.CommonConnectorAuthType; - /** OAuth2 scope requested. */ - scope?: string; - /** OAuth2 redirect URL. */ - redirectUrl?: string; - /** Reference to a server-side stored secret. Mutually exclusive with inline credentials passed at call time. */ - ref?: string; -} diff --git a/src/api/types/CommonConnectorAuthType.ts b/src/api/types/CommonConnectorAuthType.ts deleted file mode 100644 index 2a11f3ff..00000000 --- a/src/api/types/CommonConnectorAuthType.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Authentication mechanism. */ -export const CommonConnectorAuthType = { - None: "none", - Bearer: "bearer", - ApiKey: "apiKey", - Oauth2: "oauth2", -} as const; -export type CommonConnectorAuthType = (typeof CommonConnectorAuthType)[keyof typeof CommonConnectorAuthType]; diff --git a/src/api/types/CommonConnectorCreateRequest.ts b/src/api/types/CommonConnectorCreateRequest.ts deleted file mode 100644 index bff44d16..00000000 --- a/src/api/types/CommonConnectorCreateRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Same envelope as `Connector` but without the server-generated `id`. - */ -export type CommonConnectorCreateRequest = - | Corti.CommonRegistryConnectorCreate - | Corti.CommonMcpConnectorCreate - | Corti.CommonAgentConnectorCreate - | Corti.CommonA2AConnectorCreate - | Corti.CommonSchemaConnectorCreate; diff --git a/src/api/types/CommonConnectorIdValue.ts b/src/api/types/CommonConnectorIdValue.ts deleted file mode 100644 index a4170444..00000000 --- a/src/api/types/CommonConnectorIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Connector identifier. Accepts `con.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonConnectorIdValue = string; diff --git a/src/api/types/CommonConnectorResponse.ts b/src/api/types/CommonConnectorResponse.ts deleted file mode 100644 index 05a8410f..00000000 --- a/src/api/types/CommonConnectorResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector attached to an agent, discriminated by `type`. - */ -export type CommonConnectorResponse = - | Corti.CommonRegistryConnectorProvisioned - | Corti.CommonMcpConnector - | Corti.CommonAgentConnector - | Corti.CommonA2AConnector - | Corti.CommonSchemaConnector; diff --git a/src/api/types/CommonConnectorType.ts b/src/api/types/CommonConnectorType.ts deleted file mode 100644 index 88d075cd..00000000 --- a/src/api/types/CommonConnectorType.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * The connector discriminator. v2 ships `registry`, `mcp`, `agent`, - * `a2a`, and `schema`; `openapi` and `custom` are reserved for future - * minor versions. - */ -export const CommonConnectorType = { - Registry: "registry", - Mcp: "mcp", - Agent: "agent", - A2A: "a2a", - Schema: "schema", -} as const; -export type CommonConnectorType = (typeof CommonConnectorType)[keyof typeof CommonConnectorType]; diff --git a/src/api/types/CommonContextIdValue.ts b/src/api/types/CommonContextIdValue.ts deleted file mode 100644 index c5ea5a8e..00000000 --- a/src/api/types/CommonContextIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Context identifier. Accepts `ctx.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonContextIdValue = string; diff --git a/src/api/types/CommonErrorResponse.ts b/src/api/types/CommonErrorResponse.ts deleted file mode 100644 index 7ceeae50..00000000 --- a/src/api/types/CommonErrorResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Corti management-plane error envelope, used by all non-A2A endpoints. - * - * - **Standard** — when the error chain contains at least one `PublicError`, - * `code` and `message` come from the outermost `PublicError` and `details` - * is merged across the whole chain (outer values take precedence). - * - **Fallback** — when the chain contains no `PublicError`, the response is - * a generic `500` carrying a `requestId` for support reference. - * - **Validation** — a single `PublicError` whose `details.validationErrors` - * lists the offending fields. - * - * Field names use camelCase on the wire (e.g. `requestId`, `howToFix`). - * The free-form `details` object may carry arbitrary caller-defined keys. - * - * Rate limiting (HTTP 429) is not yet implemented; the server does not emit a 429 response. - */ -export interface CommonErrorResponse { - /** The error object with code, message, and optional details. */ - error: Corti.CommonErrorResponseError; -} diff --git a/src/api/types/CommonErrorResponseError.ts b/src/api/types/CommonErrorResponseError.ts deleted file mode 100644 index 4e0ca42c..00000000 --- a/src/api/types/CommonErrorResponseError.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * The error object with code, message, and optional details. - */ -export interface CommonErrorResponseError { - /** Stable, machine-readable, SCREAMING_SNAKE_CASE error code. */ - code: string; - /** Human-readable explanation. */ - message: string; - /** Optional guidance for the caller to resolve the error. */ - howToFix?: string; - /** - * Structured context, merged from every `PublicError` in the chain - * (outer values win). Omitted on the generic fallback response. - */ - details?: Corti.CommonErrorResponseErrorDetails; - /** - * Correlation ID from request middleware. Included only on the - * generic `500` fallback so consumers can quote it in support requests. - */ - requestId?: string; -} diff --git a/src/api/types/CommonErrorResponseErrorDetails.ts b/src/api/types/CommonErrorResponseErrorDetails.ts deleted file mode 100644 index e20d410b..00000000 --- a/src/api/types/CommonErrorResponseErrorDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Structured context, merged from every `PublicError` in the chain - * (outer values win). Omitted on the generic fallback response. - */ -export interface CommonErrorResponseErrorDetails { - /** Present when `code` is `VALIDATION_FAILED`. */ - validationErrors?: Corti.CommonErrorResponseErrorDetailsValidationErrorsItem[]; - /** Accepts any additional properties */ - [key: string]: any; -} diff --git a/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts deleted file mode 100644 index 541d42b2..00000000 --- a/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface CommonErrorResponseErrorDetailsValidationErrorsItem { - /** The field that failed validation. */ - field: string; - /** Why the field failed validation. */ - reason: string; -} diff --git a/src/api/types/CommonMcpConnector.ts b/src/api/types/CommonMcpConnector.ts deleted file mode 100644 index d64b84ef..00000000 --- a/src/api/types/CommonMcpConnector.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector backed by a remote MCP server. - */ -export interface CommonMcpConnector { - type: "mcp"; - /** Display name for the MCP connector. */ - name: string; - /** MCP server endpoint URL. */ - url: string; - auth?: Corti.CommonConnectorAuth; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonMcpConnectorCreate.ts b/src/api/types/CommonMcpConnectorCreate.ts deleted file mode 100644 index d553e5b5..00000000 --- a/src/api/types/CommonMcpConnectorCreate.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for attaching an MCP connector. - */ -export interface CommonMcpConnectorCreate { - type: "mcp"; - /** Display name for the MCP connector. */ - name: string; - /** MCP server endpoint URL. */ - url: string; - /** Whether the connector is active for invocations. */ - enabled?: boolean; - auth?: Corti.CommonConnectorAuth; -} diff --git a/src/api/types/CommonMessage.ts b/src/api/types/CommonMessage.ts deleted file mode 100644 index 444606cc..00000000 --- a/src/api/types/CommonMessage.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An A2A message — an ordered list of content parts with a role. - */ -export interface CommonMessage { - messageId?: Corti.CommonMessageIdValue; - contextId?: Corti.CommonContextIdValue; - taskId?: Corti.CommonTaskIdValue; - role: Corti.CommonRole; - /** Ordered content parts of the message. */ - parts: Corti.CommonPart[]; - /** Task ids this message references (A2A v1.0 `Message.referenceTaskIds`). */ - referenceTaskIds?: Corti.CommonTaskIdValue[]; - /** URIs of A2A extensions that contributed to this message (A2A v1.0 `Message.extensions`). */ - extensions?: string[]; - /** - * Free-form A2A metadata. Corti's own first-party keys are prefixed - * with `$` (à la Mixpanel) to set them apart from caller-supplied keys. - * A2A defines no message-level timestamp, so Corti carries one as - * `$timestamp` (RFC 3339 / ISO 8601) — useful for timing *user* - * messages, which `TaskStatus.timestamp` cannot. - */ - metadata?: Record; -} diff --git a/src/api/types/CommonMessageIdValue.ts b/src/api/types/CommonMessageIdValue.ts deleted file mode 100644 index 698241f0..00000000 --- a/src/api/types/CommonMessageIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Message identifier. Accepts `msg.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonMessageIdValue = string; diff --git a/src/api/types/CommonNextPageToken.ts b/src/api/types/CommonNextPageToken.ts deleted file mode 100644 index d6b4861e..00000000 --- a/src/api/types/CommonNextPageToken.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Opaque cursor to request the next page, or `null` if there are no more pages. - */ -export type CommonNextPageToken = string | null; diff --git a/src/api/types/CommonPart.ts b/src/api/types/CommonPart.ts deleted file mode 100644 index aef7692d..00000000 --- a/src/api/types/CommonPart.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * A single content part of a message or artifact. - */ -export interface CommonPart { - /** The string content of the `text` part. */ - text?: string; - /** Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null). */ - data?: Record; - /** An optional `filename` for the file (e.g., `document.pdf`). */ - filename?: string; - /** The `media_type` (MIME type) of the part content (e.g., `text/plain`, `application/json`, `image/png`). */ - mediaType?: string; - /** The `raw` byte content of a file. Encoded as a base64 string. */ - raw?: string; - /** A `url` pointing to the file's content. */ - url?: string; - /** Optional metadata associated with this part. */ - metadata?: Record; - /** Accepts any additional properties */ - [key: string]: any; -} diff --git a/src/api/types/CommonRegistryConnectorCreate.ts b/src/api/types/CommonRegistryConnectorCreate.ts deleted file mode 100644 index a8442138..00000000 --- a/src/api/types/CommonRegistryConnectorCreate.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Request body for attaching a registry connector. - */ -export interface CommonRegistryConnectorCreate { - type: "registry"; - /** Registry connector name. */ - name: string; - /** Whether the connector is active for invocations. */ - enabled?: boolean; - /** Connector-specific configuration validated against the registry schema. Not yet persisted — the server currently drops `config` for registry connectors on create. */ - config?: Record; -} diff --git a/src/api/types/CommonRegistryConnectorProvisioned.ts b/src/api/types/CommonRegistryConnectorProvisioned.ts deleted file mode 100644 index 4b13e427..00000000 --- a/src/api/types/CommonRegistryConnectorProvisioned.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector provisioned from a registry entry. - */ -export interface CommonRegistryConnectorProvisioned { - type: "registry"; - /** Registry connector name. */ - name: string; - /** Connector-specific configuration validated against the registry schema. */ - config?: Record; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonRole.ts b/src/api/types/CommonRole.ts deleted file mode 100644 index e3947086..00000000 --- a/src/api/types/CommonRole.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The author of a message. */ -export const CommonRole = { - RoleUser: "ROLE_USER", - RoleAgent: "ROLE_AGENT", -} as const; -export type CommonRole = (typeof CommonRole)[keyof typeof CommonRole]; diff --git a/src/api/types/CommonSchemaConnector.ts b/src/api/types/CommonSchemaConnector.ts deleted file mode 100644 index 2cae8b20..00000000 --- a/src/api/types/CommonSchemaConnector.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector backed by a schema definition. - */ -export interface CommonSchemaConnector { - type: "schema"; - /** Schema connector name. Used as the tool name the LLM calls. */ - name: string; - /** What the tool does. Read by the LLM to decide when to call it. */ - description?: string; - /** JSON Schema defining the tool's output shape. */ - schema: Record; - /** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ - transition?: Corti.CommonSchemaConnectorTransition; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonSchemaConnectorCreate.ts b/src/api/types/CommonSchemaConnectorCreate.ts deleted file mode 100644 index 5de599c1..00000000 --- a/src/api/types/CommonSchemaConnectorCreate.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for attaching a schema connector. - */ -export interface CommonSchemaConnectorCreate { - type: "schema"; - /** Schema connector name. */ - name: string; - /** What the tool does. Read by the LLM to decide when to call it. */ - description?: string; - /** JSON Schema defining the tool's output shape. */ - schema: Record; - /** If set, calling this tool terminates the loop in the given state. */ - transition?: Corti.CommonSchemaConnectorCreateTransition; - /** Whether the connector is active for invocations. */ - enabled?: boolean; -} diff --git a/src/api/types/CommonSchemaConnectorCreateTransition.ts b/src/api/types/CommonSchemaConnectorCreateTransition.ts deleted file mode 100644 index 103aba0a..00000000 --- a/src/api/types/CommonSchemaConnectorCreateTransition.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** If set, calling this tool terminates the loop in the given state. */ -export const CommonSchemaConnectorCreateTransition = { - Complete: "complete", - InputRequired: "input_required", -} as const; -export type CommonSchemaConnectorCreateTransition = - (typeof CommonSchemaConnectorCreateTransition)[keyof typeof CommonSchemaConnectorCreateTransition]; diff --git a/src/api/types/CommonSchemaConnectorTransition.ts b/src/api/types/CommonSchemaConnectorTransition.ts deleted file mode 100644 index a169a64a..00000000 --- a/src/api/types/CommonSchemaConnectorTransition.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ -export const CommonSchemaConnectorTransition = { - Complete: "complete", - InputRequired: "input_required", -} as const; -export type CommonSchemaConnectorTransition = - (typeof CommonSchemaConnectorTransition)[keyof typeof CommonSchemaConnectorTransition]; diff --git a/src/api/types/CommonTaskIdValue.ts b/src/api/types/CommonTaskIdValue.ts deleted file mode 100644 index 1bbf83f3..00000000 --- a/src/api/types/CommonTaskIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Task identifier. Accepts `task.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonTaskIdValue = string; diff --git a/src/api/types/CommonTaskListResponse.ts b/src/api/types/CommonTaskListResponse.ts deleted file mode 100644 index cd8c0aea..00000000 --- a/src/api/types/CommonTaskListResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of tasks. - */ -export interface CommonTaskListResponse { - /** The page size used for this response. */ - pageSize?: number; - /** Tasks on the current page. */ - tasks: Corti.CommonTaskResponse[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/CommonTaskMetadata.ts b/src/api/types/CommonTaskMetadata.ts deleted file mode 100644 index df32e38b..00000000 --- a/src/api/types/CommonTaskMetadata.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Free-form A2A task metadata. Corti's first-party keys are prefixed with - * `$` (à la Mixpanel) to set them apart from caller-supplied keys. Token and - * credit accounting is carried under `$usage`. Arbitrary additional keys are - * permitted. - */ -export interface CommonTaskMetadata { - usage?: Corti.CommonUsage; - /** Accepts any additional properties */ - [key: string]: any; -} diff --git a/src/api/types/CommonTaskResponse.ts b/src/api/types/CommonTaskResponse.ts deleted file mode 100644 index 877dc4c1..00000000 --- a/src/api/types/CommonTaskResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An A2A task — a unit of agent work with status, history, and artifacts. - */ -export interface CommonTaskResponse { - id: Corti.CommonTaskIdValue; - contextId: Corti.CommonContextIdValue; - status: Corti.CommonTaskStatus; - /** Messages exchanged during the task, oldest first. */ - history?: Corti.CommonMessage[]; - /** Artifacts produced by the task. */ - artifacts?: Corti.CommonArtifactResponse[]; - /** Task metadata, including `$usage` token/credit accounting. Not yet exposed through the REST binding (deferred); only the JSON-RPC binding populates this field. */ - metadata?: Corti.CommonTaskMetadata; -} diff --git a/src/api/types/CommonTaskState.ts b/src/api/types/CommonTaskState.ts deleted file mode 100644 index 0ee2d276..00000000 --- a/src/api/types/CommonTaskState.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The lifecycle state of a task. */ -export const CommonTaskState = { - TaskStateSubmitted: "TASK_STATE_SUBMITTED", - TaskStateWorking: "TASK_STATE_WORKING", - TaskStateCompleted: "TASK_STATE_COMPLETED", - TaskStateFailed: "TASK_STATE_FAILED", - TaskStateCanceled: "TASK_STATE_CANCELED", - TaskStateInputRequired: "TASK_STATE_INPUT_REQUIRED", - TaskStateRejected: "TASK_STATE_REJECTED", - TaskStateAuthRequired: "TASK_STATE_AUTH_REQUIRED", -} as const; -export type CommonTaskState = (typeof CommonTaskState)[keyof typeof CommonTaskState]; diff --git a/src/api/types/CommonTaskStatus.ts b/src/api/types/CommonTaskStatus.ts deleted file mode 100644 index d2d4b371..00000000 --- a/src/api/types/CommonTaskStatus.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A task's current state, with an optional status message and timestamp. - */ -export interface CommonTaskStatus { - state: Corti.CommonTaskState; - message?: Corti.CommonMessage; - /** When the status was last updated. */ - timestamp?: Date; -} diff --git a/src/api/types/CommonTotalSize.ts b/src/api/types/CommonTotalSize.ts deleted file mode 100644 index 8dc035c2..00000000 --- a/src/api/types/CommonTotalSize.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Total number of items matching the query, when known. Not currently populated by the server; treat as absent. - */ -export type CommonTotalSize = number; diff --git a/src/api/types/CommonUsage.ts b/src/api/types/CommonUsage.ts deleted file mode 100644 index da9f9b51..00000000 --- a/src/api/types/CommonUsage.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Token and credit accounting for a task, following the conventions used by - * major LLM providers. `inputTokens`/`outputTokens` count the prompt and - * completion respectively; `cachedInputTokens` is the subset of - * `inputTokens` served from the provider's prompt cache (a discount, not an - * addition), and `cacheCreationInputTokens` is the surcharge paid to - * *write* the cache. `totalTokens` is the all-in count. `credits` is the - * Corti billing unit charged for the task. - */ -export interface CommonUsage { - /** The model identifier that served the request. */ - model?: string; - /** Prompt tokens consumed. */ - inputTokens: number; - /** Completion tokens produced. */ - outputTokens: number; - /** Subset of `inputTokens` served from the prompt cache (cache read). */ - cachedInputTokens?: number; - /** Input tokens written to the prompt cache (cache-write surcharge). */ - cacheCreationInputTokens?: number; - /** Total tokens billed (`inputTokens` + `outputTokens`). */ - totalTokens: number; - /** Corti billing credits charged for the task. */ - credits?: number; -} diff --git a/src/api/types/ConnectorsListResponse.ts b/src/api/types/ConnectorsListResponse.ts deleted file mode 100644 index b3974960..00000000 --- a/src/api/types/ConnectorsListResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An agent's attached connectors. - */ -export interface ConnectorsListResponse { - /** Connectors attached to the agent. */ - connectors: Corti.CommonConnectorResponse[]; -} diff --git a/src/api/types/Contexts.ts b/src/api/types/Contexts.ts deleted file mode 100644 index 1a17c5f1..00000000 --- a/src/api/types/Contexts.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Lightweight context metadata, as returned in list responses. Contexts are not first-class CRUD resources: there is no explicit create or update endpoint — a context is created implicitly on the first message send (or reused by client-supplied contextId), and list is not yet implemented. - */ -export interface Contexts { - id: Corti.CommonContextIdValue; - agentId?: Corti.CommonAgentIdValue; - /** Total number of tasks in the context. */ - taskCount?: number; - /** When the context was created. */ - createdAt?: Date; - /** When the context was last updated. */ - updatedAt?: Date; - /** When the context expires; `null` means it does not expire. Not yet implemented — the server always returns `null` and performs no TTL-based cleanup. */ - expiresAt?: Date | null; -} diff --git a/src/api/types/ContextsDetailResponse.ts b/src/api/types/ContextsDetailResponse.ts deleted file mode 100644 index 76b54a75..00000000 --- a/src/api/types/ContextsDetailResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A context together with its tasks. Returned by `GET /contexts/{id}`. - * Tasks are ordered oldest first and each carries its full message - * `history` — the user's prompt for a task is the `ROLE_USER` message - * within that task's history. - */ -export interface ContextsDetailResponse extends Corti.Contexts { - /** The context's tasks, oldest first, each with full message history. */ - tasks: Corti.CommonTaskResponse[]; -} diff --git a/src/api/types/ContextsListResponse.ts b/src/api/types/ContextsListResponse.ts deleted file mode 100644 index 48126c80..00000000 --- a/src/api/types/ContextsListResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of contexts. - */ -export interface ContextsListResponse { - /** Contexts on the current page. */ - contexts: Corti.Contexts[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/ContextsOpenInferenceSpan.ts b/src/api/types/ContextsOpenInferenceSpan.ts deleted file mode 100644 index 281c1fee..00000000 --- a/src/api/types/ContextsOpenInferenceSpan.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * A single span in an OpenInference trace. - */ -export interface ContextsOpenInferenceSpan { - /** Human-readable span name. */ - name: string; - /** Unique span identifier. */ - spanId: string; - /** Parent span id, omitted for the root span. */ - parentSpanId?: string; - /** When the span started. */ - startTime: Date; - /** When the span ended; `null` if still in progress. */ - endTime?: Date | null; - /** OpenInference span attributes. Key names and structure follow the OpenInference semantic conventions. */ - attributes?: Record; -} diff --git a/src/api/types/ContextsTraceItem.ts b/src/api/types/ContextsTraceItem.ts deleted file mode 100644 index 886870a4..00000000 --- a/src/api/types/ContextsTraceItem.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A single trace with its inlined OpenInference spans. - */ -export interface ContextsTraceItem { - /** The trace-level record. */ - trace: Corti.ContextsTraceItemTrace; - /** Spans in this trace, ordered by start time. */ - spans: Corti.ContextsOpenInferenceSpan[]; -} diff --git a/src/api/types/ContextsTraceItemTrace.ts b/src/api/types/ContextsTraceItemTrace.ts deleted file mode 100644 index cf6a1384..00000000 --- a/src/api/types/ContextsTraceItemTrace.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * The trace-level record. - */ -export interface ContextsTraceItemTrace { - /** Trace identifier (OTel trace ID — 32-char hex). */ - id: string; - /** Human-readable trace name. */ - name: string; - /** When the trace started. */ - startTime: Date; - /** When the trace ended; `null` if still in progress. */ - endTime?: Date | null; - /** Trace-level input payload. */ - input?: Record; - /** Trace-level output payload. */ - output?: Record; - /** Free-form trace metadata. */ - metadata?: Record; - /** Trace tags. */ - tags?: string[]; - /** Thread/context identifier. */ - threadId: string; -} diff --git a/src/api/types/ContextsTraceResponse.ts b/src/api/types/ContextsTraceResponse.ts deleted file mode 100644 index 8f4aaef2..00000000 --- a/src/api/types/ContextsTraceResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of traces for a context in OpenInference format. Traces are - * ordered newest-first. - */ -export interface ContextsTraceResponse { - /** Traces for the context, newest first. */ - traces: Corti.ContextsTraceItem[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/FeedbackActor.ts b/src/api/types/FeedbackActor.ts deleted file mode 100644 index 135da226..00000000 --- a/src/api/types/FeedbackActor.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Customer-defined opaque identifier for the feedback submitter. - */ -export interface FeedbackActor { - /** - * Scoped to the authenticated customer; not globally unique and not - * independently verified. Should preferably be pseudonymous and must - * not contain names, emails, national identifiers, or medical record - * numbers. - */ - externalId: string; -} diff --git a/src/api/types/FeedbackIdValue.ts b/src/api/types/FeedbackIdValue.ts deleted file mode 100644 index 0ff14a45..00000000 --- a/src/api/types/FeedbackIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Feedback identifier. Accepts `fb.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type FeedbackIdValue = string; diff --git a/src/api/types/FeedbackLabel.ts b/src/api/types/FeedbackLabel.ts deleted file mode 100644 index 42fd846b..00000000 --- a/src/api/types/FeedbackLabel.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Structured observation about the result. Positive and negative labels - * share one taxonomy so customers can represent mixed feedback. - * - `correct` — factually and contextually correct (positive). - * - `complete` — included the important expected information (positive). - * - `helpful` — materially helped the user complete their task (positive). - * - `wellPresented` — clear, readable, appropriately structured (positive). - * - `efficient` — reached a useful result without unnecessary content (positive). - * - `incorrect` — one or more claims, conclusions, or actions were wrong (negative). - * - `missingInformation` — important or expected information was omitted (negative). - * - `irrelevant` — included content that did not address the request (negative). - * - `misunderstoodRequest` — the system responded to the wrong intent (negative). - * - `unsupportedClaim` — a claim not supported by available information (negative). - * - `unsafeOrInappropriate` — unsafe, disallowed, or unsuitable (negative). - * - `poorlyPresented` — difficult to read or unsuitably structured (negative). - * - `tooVerbose` — substantially more detail than useful (negative). - * - `other` — another observation described in `reason` (both). - */ -export const FeedbackLabel = { - Correct: "correct", - Complete: "complete", - Helpful: "helpful", - WellPresented: "wellPresented", - Efficient: "efficient", - Incorrect: "incorrect", - MissingInformation: "missingInformation", - Irrelevant: "irrelevant", - MisunderstoodRequest: "misunderstoodRequest", - UnsupportedClaim: "unsupportedClaim", - UnsafeOrInappropriate: "unsafeOrInappropriate", - PoorlyPresented: "poorlyPresented", - TooVerbose: "tooVerbose", - Other: "other", -} as const; -export type FeedbackLabel = (typeof FeedbackLabel)[keyof typeof FeedbackLabel]; diff --git a/src/api/types/FeedbackListResponse.ts b/src/api/types/FeedbackListResponse.ts deleted file mode 100644 index 54691bf9..00000000 --- a/src/api/types/FeedbackListResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * All feedback resources for a task, newest-first. Feedback is scoped to the authenticated user via row-level security. - */ -export interface FeedbackListResponse { - /** Feedback resources for the task. */ - feedbacks: Corti.FeedbackResponse[]; -} diff --git a/src/api/types/FeedbackMetadata.ts b/src/api/types/FeedbackMetadata.ts deleted file mode 100644 index 9492bd17..00000000 --- a/src/api/types/FeedbackMetadata.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Customer-provided provenance and correlation information. - */ -export interface FeedbackMetadata { - /** How the customer collected the feedback. Informational only; does not affect rating validation or normalization. */ - collectionMethod?: string; - /** - * Customer-defined reference to correlate the feedback with an object - * in the customer's own system. Not unique and does not provide - * idempotency. Should not contain sensitive information. - */ - clientReference?: string; - actor?: Corti.FeedbackActor; -} diff --git a/src/api/types/FeedbackRating.ts b/src/api/types/FeedbackRating.ts deleted file mode 100644 index 3c27151a..00000000 --- a/src/api/types/FeedbackRating.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * The original rating supplied by the customer. - */ -export interface FeedbackRating { - scale: Corti.FeedbackRatingScale; - /** The rating value on the selected scale. */ - value: number; -} diff --git a/src/api/types/FeedbackRatingScale.ts b/src/api/types/FeedbackRatingScale.ts deleted file mode 100644 index 3685fe8b..00000000 --- a/src/api/types/FeedbackRatingScale.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * The scale on which the rating was collected. - * - `binary` — 0 (negative) or 1 (positive). - * - * Planned (not yet available): `likert5` (integer 1–5), `continuous01` (number 0–1). - */ -export const FeedbackRatingScale = { - Binary: "binary", -} as const; -export type FeedbackRatingScale = (typeof FeedbackRatingScale)[keyof typeof FeedbackRatingScale]; diff --git a/src/api/types/FeedbackResponse.ts b/src/api/types/FeedbackResponse.ts deleted file mode 100644 index a336cc94..00000000 --- a/src/api/types/FeedbackResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A stored feedback resource. - */ -export interface FeedbackResponse { - id: Corti.FeedbackIdValue; - taskId: Corti.CommonTaskIdValue; - rating: Corti.FeedbackRating; - /** - * Corti-derived internal score between 0 and 1. The original scale and - * value are always retained alongside this score. - */ - normalizedScore: number; - /** Structured observations about the result. */ - labels: Corti.FeedbackLabel[]; - /** Free-text explanation of the rating or labels. */ - reason?: string; - target?: Corti.FeedbackTarget; - metadata?: Corti.FeedbackMetadata; - /** When the feedback was created. */ - createdAt?: Date; -} diff --git a/src/api/types/FeedbackTarget.ts b/src/api/types/FeedbackTarget.ts deleted file mode 100644 index 228e9b62..00000000 --- a/src/api/types/FeedbackTarget.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Identifies the specific user-visible response being evaluated. If - * omitted, the feedback applies to the task as a whole. - */ -export interface FeedbackTarget { - messageId: Corti.CommonMessageIdValue; -} diff --git a/src/api/types/RegistryConnectorCapabilities.ts b/src/api/types/RegistryConnectorCapabilities.ts deleted file mode 100644 index 5cc904b6..00000000 --- a/src/api/types/RegistryConnectorCapabilities.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * What the connector can do once attached. - */ -export interface RegistryConnectorCapabilities { - /** Emits incremental updates during a task. */ - streaming?: boolean; - /** Accepted input media types. */ - inputModes?: string[]; - /** Produced output media types. */ - outputModes?: string[]; - /** Names of tools the connector exposes to the agent. */ - tools?: string[]; -} diff --git a/src/api/types/RegistryConnectorListResponse.ts b/src/api/types/RegistryConnectorListResponse.ts deleted file mode 100644 index 05674681..00000000 --- a/src/api/types/RegistryConnectorListResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of registry connectors. - */ -export interface RegistryConnectorListResponse { - /** Registry connectors on the current page. */ - connectors: Corti.RegistryConnectorResponse[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/RegistryConnectorResponse.ts b/src/api/types/RegistryConnectorResponse.ts deleted file mode 100644 index b4fcbac7..00000000 --- a/src/api/types/RegistryConnectorResponse.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A discoverable, pre-built connector offered by the platform registry. - * Only `id`, `type`, `name`, `title`, `description`, and `configSchema` are populated by the server today. `version`, `provider`, `capabilities`, `tags`, and `documentationUrl` are declared for forward compatibility but are not yet returned. - */ -export interface RegistryConnectorResponse { - /** Stable, namespaced registry identifier; use as a `registry` connector's `name`. */ - id: string; - /** The connector kind this entry provisions when attached to an agent. */ - type: Corti.CommonConnectorType; - /** Programmatic name (MCP convention). */ - name: string; - /** Human-readable display name (MCP convention). */ - title?: string; - /** Description for list and detail views. May contain CommonMark. */ - description?: string; - /** Latest published version (SemVer recommended). */ - version?: string; - /** Display icons (MCP convention). */ - icons?: Corti.RegistryIcon[]; - /** Name of the publishing organisation. */ - provider?: string; - /** Connector homepage (MCP convention). */ - websiteUrl?: string; - /** Documentation URL for the connector. */ - documentationUrl?: string; - capabilities?: Corti.RegistryConnectorCapabilities; - /** Keywords for search and filtering. */ - tags?: string[]; - /** JSON Schema (draft 2020-12) describing the connector's accepted `config`. */ - configSchema?: Record; -} diff --git a/src/api/types/RegistryIcon.ts b/src/api/types/RegistryIcon.ts deleted file mode 100644 index cfea9234..00000000 --- a/src/api/types/RegistryIcon.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * An icon resource, following the MCP `Icon` shape. - */ -export interface RegistryIcon { - /** Icon source URL. */ - src: string; - /** MIME type of the icon resource. */ - mimeType?: string; - /** `WxH` size hints (e.g. `48x48`), or `any` for scalable icons. */ - sizes?: string[]; -} diff --git a/src/api/types/UsageBucket.ts b/src/api/types/UsageBucket.ts deleted file mode 100644 index 5d9f542a..00000000 --- a/src/api/types/UsageBucket.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Usage metrics for a single time bucket. - */ -export interface UsageBucket extends Corti.UsageMetrics { - /** Inclusive start of the bucket (UTC). */ - periodStart: Date; - /** Exclusive end of the bucket (UTC). */ - periodEnd: Date; -} diff --git a/src/api/types/UsageGranularity.ts b/src/api/types/UsageGranularity.ts deleted file mode 100644 index 05c67177..00000000 --- a/src/api/types/UsageGranularity.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The size of each usage reporting bucket. Only `day` is currently honored; `minute`, `hour`, and `week` are accepted but produce daily buckets (the server always returns `day`). */ -export const UsageGranularity = { - Minute: "minute", - Hour: "hour", - Day: "day", - Week: "week", -} as const; -export type UsageGranularity = (typeof UsageGranularity)[keyof typeof UsageGranularity]; diff --git a/src/api/types/UsageMetrics.ts b/src/api/types/UsageMetrics.ts deleted file mode 100644 index d10a21ac..00000000 --- a/src/api/types/UsageMetrics.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Invocation metrics for a single period. - */ -export interface UsageMetrics { - /** Number of agent invocations in the period. */ - invocations: number; - /** Number of distinct contexts invoked in the period. */ - uniqueContexts: number; -} diff --git a/src/api/types/UsageReportResponse.ts b/src/api/types/UsageReportResponse.ts deleted file mode 100644 index 117bfc7b..00000000 --- a/src/api/types/UsageReportResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An agent's bucketed usage over a date range, with range-wide totals. - */ -export interface UsageReportResponse { - granularity: Corti.UsageGranularity; - /** Resolved inclusive start of the range (UTC). */ - from: Date; - /** Resolved exclusive end of the range (UTC). */ - to: Date; - /** Aggregate metrics across the whole range. */ - totals: Corti.UsageMetrics; - /** One entry per period with activity, ordered oldest first. */ - buckets: Corti.UsageBucket[]; -} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 2ffaffbc..7ce73b9e 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,17 +1,3 @@ -export * from "./A2AjsonrpcResponse.js"; -export * from "./A2AjsonrpcResponseError.js"; -export * from "./A2AjsonrpcResponseId.js"; -export * from "./A2ASendMessageConfiguration.js"; -export * from "./A2ASendMessageRequest.js"; -export * from "./A2ASendMessageResponse.js"; -export * from "./A2AStreamEventResponse.js"; -export * from "./AgentCardResponse.js"; -export * from "./AgentCardResponseCapabilities.js"; -export * from "./AgentCardResponseProvider.js"; -export * from "./AgentCardResponseSignaturesItem.js"; -export * from "./AgentCardResponseSkillsItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; export * from "./AgentsAgent.js"; export * from "./AgentsAgentCapabilities.js"; export * from "./AgentsAgentCard.js"; @@ -45,9 +31,6 @@ export * from "./AgentsFilePartFile.js"; export * from "./AgentsFilePartKind.js"; export * from "./AgentsFileWithBytes.js"; export * from "./AgentsFileWithUri.js"; -export * from "./AgentsLabels.js"; -export * from "./AgentsLifecycle.js"; -export * from "./AgentsListResponse.js"; export * from "./AgentsMcpServer.js"; export * from "./AgentsMcpServerAuthorizationType.js"; export * from "./AgentsMcpServerTransportType.js"; @@ -62,7 +45,6 @@ export * from "./AgentsRegistryExpert.js"; export * from "./AgentsRegistryExpertsResponse.js"; export * from "./AgentsRegistryMcpServer.js"; export * from "./AgentsRegistryMcpServerAuthorizationType.js"; -export * from "./AgentsResponse.js"; export * from "./AgentsTask.js"; export * from "./AgentsTaskKind.js"; export * from "./AgentsTaskStatus.js"; @@ -70,8 +52,6 @@ export * from "./AgentsTaskStatusState.js"; export * from "./AgentsTextPart.js"; export * from "./AgentsTextPartKind.js"; export * from "./AgentsUpdateExpertReference.js"; -export * from "./AgentsUserIdValue.js"; -export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -83,67 +63,20 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; -export * from "./CommonA2AConnector.js"; -export * from "./CommonA2AConnectorCreate.js"; -export * from "./CommonAgentConnector.js"; -export * from "./CommonAgentConnectorCreate.js"; -export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; -export * from "./CommonArtifactIdValue.js"; -export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; -export * from "./CommonConnectorAuth.js"; -export * from "./CommonConnectorAuthType.js"; -export * from "./CommonConnectorCreateRequest.js"; -export * from "./CommonConnectorIdValue.js"; -export * from "./CommonConnectorResponse.js"; -export * from "./CommonConnectorType.js"; -export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; -export * from "./CommonErrorResponse.js"; -export * from "./CommonErrorResponseError.js"; -export * from "./CommonErrorResponseErrorDetails.js"; -export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; -export * from "./CommonMcpConnector.js"; -export * from "./CommonMcpConnectorCreate.js"; -export * from "./CommonMessage.js"; -export * from "./CommonMessageIdValue.js"; -export * from "./CommonNextPageToken.js"; -export * from "./CommonPart.js"; -export * from "./CommonRegistryConnectorCreate.js"; -export * from "./CommonRegistryConnectorProvisioned.js"; -export * from "./CommonRole.js"; -export * from "./CommonSchemaConnector.js"; -export * from "./CommonSchemaConnectorCreate.js"; -export * from "./CommonSchemaConnectorCreateTransition.js"; -export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; -export * from "./CommonTaskIdValue.js"; -export * from "./CommonTaskListResponse.js"; -export * from "./CommonTaskMetadata.js"; -export * from "./CommonTaskResponse.js"; -export * from "./CommonTaskState.js"; -export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; -export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; -export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; -export * from "./ConnectorsListResponse.js"; -export * from "./Contexts.js"; -export * from "./ContextsDetailResponse.js"; -export * from "./ContextsListResponse.js"; -export * from "./ContextsOpenInferenceSpan.js"; -export * from "./ContextsTraceItem.js"; -export * from "./ContextsTraceItemTrace.js"; -export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -179,15 +112,6 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; -export * from "./FeedbackActor.js"; -export * from "./FeedbackIdValue.js"; -export * from "./FeedbackLabel.js"; -export * from "./FeedbackListResponse.js"; -export * from "./FeedbackMetadata.js"; -export * from "./FeedbackRating.js"; -export * from "./FeedbackRatingScale.js"; -export * from "./FeedbackResponse.js"; -export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -263,10 +187,6 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; -export * from "./RegistryConnectorCapabilities.js"; -export * from "./RegistryConnectorListResponse.js"; -export * from "./RegistryConnectorResponse.js"; -export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -353,8 +273,4 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; -export * from "./UsageBucket.js"; -export * from "./UsageGranularity.js"; -export * from "./UsageMetrics.js"; -export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/src/core/index.ts b/src/core/index.ts index ede84012..e2aca287 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -6,7 +6,6 @@ export * as logging from "./logging/index.js"; export * from "./pagination/index.js"; export * from "./runtime/index.js"; export * as serialization from "./schemas/index.js"; -export * from "./stream/index.js"; export * as url from "./url/index.js"; export * from "./utils/index.js"; export * from "./websocket/index.js"; diff --git a/src/core/stream/Stream.ts b/src/core/stream/Stream.ts deleted file mode 100644 index 8ccdecf9..00000000 --- a/src/core/stream/Stream.ts +++ /dev/null @@ -1,235 +0,0 @@ -import { fromJson } from "../json.js"; -import { RUNTIME } from "../runtime/index.js"; - -export declare namespace Stream { - interface Args { - /** - * The HTTP response stream to read from. - */ - - stream: ReadableStream; - - /** - * The event shape to use for parsing the stream data. - */ - eventShape: JsonEvent | SseEvent; - /** - * An abort signal to stop the stream. - */ - signal?: AbortSignal; - } - - interface JsonEvent { - type: "json"; - messageTerminator: string; - } - - interface SseEvent { - type: "sse"; - streamTerminator?: string; - eventDiscriminator?: string; - } -} - -const DATA_PREFIX = "data:"; -const EVENT_PREFIX = "event:"; - -export class Stream implements AsyncIterable { - private stream: ReadableStream; - - private parse: (val: unknown) => Promise; - /** - * The prefix to use for each message. For example, - * for SSE, the prefix is "data: ". - */ - private prefix: string | undefined; - private messageTerminator: string; - private streamTerminator: string | undefined; - private eventDiscriminator: string | undefined; - private controller: AbortController = new AbortController(); - private decoder: TextDecoder | undefined; - - constructor({ stream, parse, eventShape, signal }: Stream.Args & { parse: (val: unknown) => Promise }) { - this.stream = stream; - this.parse = parse; - if (eventShape.type === "sse") { - this.prefix = DATA_PREFIX; - this.messageTerminator = "\n"; - this.streamTerminator = eventShape.streamTerminator; - this.eventDiscriminator = eventShape.eventDiscriminator; - } else { - this.messageTerminator = eventShape.messageTerminator; - } - signal?.addEventListener("abort", () => this.controller.abort()); - - // Initialize shared TextDecoder - if (typeof TextDecoder !== "undefined") { - this.decoder = new TextDecoder("utf-8"); - } - } - - private async *iterMessages(): AsyncGenerator { - if (this.eventDiscriminator != null) { - yield* this.iterSseEvents(); - } else { - yield* this.iterDataMessages(); - } - } - - private async *iterDataMessages(): AsyncGenerator { - const stream = readableStreamAsyncIterable(this.stream); - let buf = ""; - let prefixSeen = false; - for await (const chunk of stream) { - buf += this.decodeChunk(chunk); - - let terminatorIndex: number; - while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) { - let line = buf.slice(0, terminatorIndex); - buf = buf.slice(terminatorIndex + this.messageTerminator.length); - - if (!line.trim()) { - continue; - } - - if (!prefixSeen && this.prefix != null) { - const prefixIndex = line.indexOf(this.prefix); - if (prefixIndex === -1) { - continue; - } - prefixSeen = true; - line = line.slice(prefixIndex + this.prefix.length); - } - - if (this.streamTerminator != null && line.includes(this.streamTerminator)) { - return; - } - const message = await this.parse(fromJson(line)); - yield message; - prefixSeen = false; - } - } - } - - private async *iterSseEvents(): AsyncGenerator { - const stream = readableStreamAsyncIterable(this.stream); - let buf = ""; - let eventType: string | undefined; - let dataValue: string | undefined; - - for await (const chunk of stream) { - buf += this.decodeChunk(chunk); - - let terminatorIndex: number; - while ((terminatorIndex = buf.indexOf("\n")) >= 0) { - const line = buf.slice(0, terminatorIndex).replace(/\r$/, ""); - buf = buf.slice(terminatorIndex + 1); - - if (!line.trim()) { - if (dataValue != null) { - const message = await this.dispatchSseEvent(dataValue, eventType); - if (message == null) { - return; - } - yield message; - } - eventType = undefined; - dataValue = undefined; - continue; - } - - if (line.startsWith(EVENT_PREFIX)) { - eventType = line.slice(EVENT_PREFIX.length).trim(); - } else if (line.startsWith(DATA_PREFIX)) { - const val = line.slice(DATA_PREFIX.length).trim(); - dataValue = dataValue != null ? `${dataValue}\n${val}` : val; - } - } - } - - if (dataValue != null) { - const message = await this.dispatchSseEvent(dataValue, eventType); - if (message != null) { - yield message; - } - } - } - - /** - * Parses and returns a single SSE event, or returns null if the event is a stream terminator. - */ - private async dispatchSseEvent(dataValue: string, eventType: string | undefined): Promise { - if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) { - return null; - } - return this.parse(this.injectDiscriminator(fromJson(dataValue), eventType)); - } - - private injectDiscriminator(parsed: unknown, eventType: string | undefined): unknown { - if (this.eventDiscriminator == null || eventType == null) { - return parsed; - } - if (parsed == null || typeof parsed !== "object" || Array.isArray(parsed)) { - return parsed; - } - const obj = parsed as Record; - if (this.eventDiscriminator in obj) { - return parsed; - } - return { [this.eventDiscriminator]: eventType, ...obj }; - } - - async *[Symbol.asyncIterator](): AsyncIterator { - for await (const message of this.iterMessages()) { - yield message; - } - } - - private decodeChunk(chunk: any): string { - let decoded = ""; - // If TextDecoder is available, use the streaming decoder instance - if (this.decoder != null) { - decoded += this.decoder.decode(chunk, { stream: true }); - } - // Buffer is present in Node.js environment - else if (RUNTIME.type === "node" && typeof chunk !== "undefined") { - decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); - } - return decoded; - } -} - -/** - * Browser polyfill for ReadableStream - */ -// biome-ignore lint/suspicious/noExplicitAny: allow explicit any -export function readableStreamAsyncIterable(stream: any): AsyncIterableIterator { - if (stream[Symbol.asyncIterator]) { - return stream; - } - - const reader = stream.getReader(); - return { - async next() { - try { - const result = await reader.read(); - if (result?.done) { - reader.releaseLock(); - } // release lock when stream becomes closed - return result; - } catch (e) { - reader.releaseLock(); // release lock when stream becomes errored - throw e; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: undefined }; - }, - [Symbol.asyncIterator]() { - return this; - }, - }; -} diff --git a/src/core/stream/index.ts b/src/core/stream/index.ts deleted file mode 100644 index 4e28b34b..00000000 --- a/src/core/stream/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Stream } from "./Stream.js"; diff --git a/src/serialization/resources/agentic/client/index.ts b/src/serialization/resources/agentic/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts deleted file mode 100644 index 20e0706e..00000000 --- a/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import type * as serializers from "../../../../index.js"; -import { AgentsLabels } from "../../../../types/AgentsLabels.js"; -import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; -import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; -import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; - -export const AgentsCreateRequest: core.serialization.Schema< - serializers.AgentsCreateRequest.Raw, - Corti.AgentsCreateRequest -> = core.serialization.object({ - name: core.serialization.string(), - description: core.serialization.string().optional(), - systemPrompt: core.serialization.string().optional(), - model: core.serialization.string().optional(), - visibility: AgentsVisibility.optional(), - lifecycle: AgentsLifecycle.optional(), - connectors: core.serialization.list(CommonConnectorCreateRequest).optional(), - labels: AgentsLabels.optional(), -}); - -export declare namespace AgentsCreateRequest { - export interface Raw { - name: string; - description?: string | null; - systemPrompt?: string | null; - model?: string | null; - visibility?: AgentsVisibility.Raw | null; - lifecycle?: AgentsLifecycle.Raw | null; - connectors?: CommonConnectorCreateRequest.Raw[] | null; - labels?: AgentsLabels.Raw | null; - } -} diff --git a/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts deleted file mode 100644 index 0eb9f11e..00000000 --- a/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import type * as serializers from "../../../../index.js"; -import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; -import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; -import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; - -export const AgentsPatchRequest: core.serialization.Schema< - serializers.AgentsPatchRequest.Raw, - Corti.AgentsPatchRequest -> = core.serialization.object({ - name: core.serialization.string().optional(), - description: core.serialization.string().optionalNullable(), - systemPrompt: core.serialization.string().optionalNullable(), - model: core.serialization.string().optionalNullable(), - visibility: AgentsVisibility.optional(), - lifecycle: AgentsLifecycle.optional(), - connectors: core.serialization.list(CommonConnectorCreateRequest).optionalNullable(), - labels: core.serialization - .record(core.serialization.string(), core.serialization.string().nullable()) - .optionalNullable(), -}); - -export declare namespace AgentsPatchRequest { - export interface Raw { - name?: string | null; - description?: (string | null | undefined) | null; - systemPrompt?: (string | null | undefined) | null; - model?: (string | null | undefined) | null; - visibility?: AgentsVisibility.Raw | null; - lifecycle?: AgentsLifecycle.Raw | null; - connectors?: (CommonConnectorCreateRequest.Raw[] | null | undefined) | null; - labels?: (Record | null | undefined) | null; - } -} diff --git a/src/serialization/resources/agentic/client/requests/index.ts b/src/serialization/resources/agentic/client/requests/index.ts deleted file mode 100644 index d89fef23..00000000 --- a/src/serialization/resources/agentic/client/requests/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { AgentsCreateRequest } from "./AgentsCreateRequest.js"; -export { AgentsPatchRequest } from "./AgentsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/index.ts b/src/serialization/resources/agentic/index.ts deleted file mode 100644 index 9eb1192d..00000000 --- a/src/serialization/resources/agentic/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/client/index.ts b/src/serialization/resources/agentic/resources/a2A/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/resources/a2A/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts deleted file mode 100644 index 9828ab57..00000000 --- a/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../../api/index.js"; -import * as core from "../../../../../../../core/index.js"; -import type * as serializers from "../../../../../../index.js"; -import { A2AjsonrpcRequestId } from "../../types/A2AjsonrpcRequestId.js"; -import { A2AjsonrpcRequestMethod } from "../../types/A2AjsonrpcRequestMethod.js"; - -export const A2AjsonrpcRequest: core.serialization.Schema< - serializers.agentic.A2AjsonrpcRequest.Raw, - Corti.agentic.A2AjsonrpcRequest -> = core.serialization.object({ - id: A2AjsonrpcRequestId, - method: A2AjsonrpcRequestMethod, - params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace A2AjsonrpcRequest { - export interface Raw { - id: A2AjsonrpcRequestId.Raw; - method: A2AjsonrpcRequestMethod.Raw; - params?: Record | null; - } -} diff --git a/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts deleted file mode 100644 index 0d1476bd..00000000 --- a/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/index.ts b/src/serialization/resources/agentic/resources/a2A/index.ts deleted file mode 100644 index d9adb1af..00000000 --- a/src/serialization/resources/agentic/resources/a2A/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./types/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts deleted file mode 100644 index 5abc99c8..00000000 --- a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../api/index.js"; -import * as core from "../../../../../../core/index.js"; -import type * as serializers from "../../../../../index.js"; - -export const A2AjsonrpcRequestId: core.serialization.Schema< - serializers.agentic.A2AjsonrpcRequestId.Raw, - Corti.agentic.A2AjsonrpcRequestId -> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); - -export declare namespace A2AjsonrpcRequestId { - export type Raw = string | number; -} diff --git a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts deleted file mode 100644 index ed080991..00000000 --- a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../api/index.js"; -import * as core from "../../../../../../core/index.js"; -import type * as serializers from "../../../../../index.js"; - -export const A2AjsonrpcRequestMethod: core.serialization.Schema< - serializers.agentic.A2AjsonrpcRequestMethod.Raw, - Corti.agentic.A2AjsonrpcRequestMethod -> = core.serialization.enum_([ - "SendMessage", - "SendStreamingMessage", - "GetTask", - "ListTasks", - "CancelTask", - "SubscribeToTask", -]); - -export declare namespace A2AjsonrpcRequestMethod { - export type Raw = - | "SendMessage" - | "SendStreamingMessage" - | "GetTask" - | "ListTasks" - | "CancelTask" - | "SubscribeToTask"; -} diff --git a/src/serialization/resources/agentic/resources/a2A/types/index.ts b/src/serialization/resources/agentic/resources/a2A/types/index.ts deleted file mode 100644 index d506c662..00000000 --- a/src/serialization/resources/agentic/resources/a2A/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./A2AjsonrpcRequestId.js"; -export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/index.ts b/src/serialization/resources/agentic/resources/connectors/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/resources/connectors/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts deleted file mode 100644 index 95949c28..00000000 --- a/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../../api/index.js"; -import * as core from "../../../../../../../core/index.js"; -import type * as serializers from "../../../../../../index.js"; -import { CommonConnectorAuth } from "../../../../../../types/CommonConnectorAuth.js"; - -export const ConnectorsPatchRequest: core.serialization.Schema< - serializers.agentic.ConnectorsPatchRequest.Raw, - Corti.agentic.ConnectorsPatchRequest -> = core.serialization.object({ - enabled: core.serialization.boolean().optional(), - name: core.serialization.string().optional(), - url: core.serialization.string().optionalNullable(), - config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), - auth: CommonConnectorAuth.optionalNullable(), -}); - -export declare namespace ConnectorsPatchRequest { - export interface Raw { - enabled?: boolean | null; - name?: string | null; - url?: (string | null | undefined) | null; - config?: (Record | null | undefined) | null; - auth?: (CommonConnectorAuth.Raw | null | undefined) | null; - } -} diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts deleted file mode 100644 index fd257b20..00000000 --- a/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/index.ts b/src/serialization/resources/agentic/resources/connectors/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/serialization/resources/agentic/resources/connectors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/client/index.ts b/src/serialization/resources/agentic/resources/feedback/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/resources/feedback/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts deleted file mode 100644 index 81438c6a..00000000 --- a/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../../api/index.js"; -import * as core from "../../../../../../../core/index.js"; -import type * as serializers from "../../../../../../index.js"; -import { FeedbackLabel } from "../../../../../../types/FeedbackLabel.js"; -import { FeedbackMetadata } from "../../../../../../types/FeedbackMetadata.js"; -import { FeedbackRating } from "../../../../../../types/FeedbackRating.js"; -import { FeedbackTarget } from "../../../../../../types/FeedbackTarget.js"; - -export const FeedbackCreateRequest: core.serialization.Schema< - serializers.agentic.FeedbackCreateRequest.Raw, - Corti.agentic.FeedbackCreateRequest -> = core.serialization.object({ - rating: FeedbackRating, - labels: core.serialization.list(FeedbackLabel).optional(), - reason: core.serialization.string().optional(), - target: FeedbackTarget.optional(), - metadata: FeedbackMetadata.optional(), -}); - -export declare namespace FeedbackCreateRequest { - export interface Raw { - rating: FeedbackRating.Raw; - labels?: FeedbackLabel.Raw[] | null; - reason?: string | null; - target?: FeedbackTarget.Raw | null; - metadata?: FeedbackMetadata.Raw | null; - } -} diff --git a/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts deleted file mode 100644 index f8353681..00000000 --- a/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/index.ts b/src/serialization/resources/agentic/resources/feedback/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/serialization/resources/agentic/resources/feedback/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/agentic/resources/index.ts b/src/serialization/resources/agentic/resources/index.ts deleted file mode 100644 index 3165166f..00000000 --- a/src/serialization/resources/agentic/resources/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./a2A/client/requests/index.js"; -export * as a2A from "./a2A/index.js"; -export * from "./a2A/types/index.js"; -export * from "./connectors/client/requests/index.js"; -export * as connectors from "./connectors/index.js"; -export * from "./feedback/client/requests/index.js"; -export * as feedback from "./feedback/index.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index c3ebce10..c2b155f9 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,5 +1,3 @@ -export * from "./agentic/client/requests/index.js"; -export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; export * from "./agents/types/index.js"; diff --git a/src/serialization/types/A2ASendMessageConfiguration.ts b/src/serialization/types/A2ASendMessageConfiguration.ts deleted file mode 100644 index 8ce31b82..00000000 --- a/src/serialization/types/A2ASendMessageConfiguration.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2ASendMessageConfiguration: core.serialization.ObjectSchema< - serializers.A2ASendMessageConfiguration.Raw, - Corti.A2ASendMessageConfiguration -> = core.serialization.object({ - returnImmediately: core.serialization.boolean().optional(), - historyLength: core.serialization.number().optional(), - acceptedOutputModes: core.serialization.list(core.serialization.string()).optional(), -}); - -export declare namespace A2ASendMessageConfiguration { - export interface Raw { - returnImmediately?: boolean | null; - historyLength?: number | null; - acceptedOutputModes?: string[] | null; - } -} diff --git a/src/serialization/types/A2ASendMessageRequest.ts b/src/serialization/types/A2ASendMessageRequest.ts deleted file mode 100644 index d29c28b3..00000000 --- a/src/serialization/types/A2ASendMessageRequest.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { A2ASendMessageConfiguration } from "./A2ASendMessageConfiguration.js"; -import { CommonMessage } from "./CommonMessage.js"; - -export const A2ASendMessageRequest: core.serialization.ObjectSchema< - serializers.A2ASendMessageRequest.Raw, - Corti.A2ASendMessageRequest -> = core.serialization.object({ - message: CommonMessage, - configuration: A2ASendMessageConfiguration.optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - tenant: core.serialization.string().optional(), -}); - -export declare namespace A2ASendMessageRequest { - export interface Raw { - message: CommonMessage.Raw; - configuration?: A2ASendMessageConfiguration.Raw | null; - metadata?: Record | null; - tenant?: string | null; - } -} diff --git a/src/serialization/types/A2ASendMessageResponse.ts b/src/serialization/types/A2ASendMessageResponse.ts deleted file mode 100644 index 56e39b4a..00000000 --- a/src/serialization/types/A2ASendMessageResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2ASendMessageResponse: core.serialization.Schema< - serializers.A2ASendMessageResponse.Raw, - Corti.A2ASendMessageResponse -> = core.serialization.undiscriminatedUnion([core.serialization.unknown()]); - -export declare namespace A2ASendMessageResponse { - export type Raw = unknown; -} diff --git a/src/serialization/types/A2AStreamEventResponse.ts b/src/serialization/types/A2AStreamEventResponse.ts deleted file mode 100644 index 73657388..00000000 --- a/src/serialization/types/A2AStreamEventResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2AStreamEventResponse: core.serialization.ObjectSchema< - serializers.A2AStreamEventResponse.Raw, - Corti.A2AStreamEventResponse -> = core.serialization.object({ - data: core.serialization.string().optional(), - event: core.serialization.string().optional(), - id: core.serialization.string().optional(), - retry: core.serialization.number().optional(), -}); - -export declare namespace A2AStreamEventResponse { - export interface Raw { - data?: string | null; - event?: string | null; - id?: string | null; - retry?: number | null; - } -} diff --git a/src/serialization/types/A2AjsonrpcResponse.ts b/src/serialization/types/A2AjsonrpcResponse.ts deleted file mode 100644 index 1192314a..00000000 --- a/src/serialization/types/A2AjsonrpcResponse.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { A2AjsonrpcResponseError } from "./A2AjsonrpcResponseError.js"; -import { A2AjsonrpcResponseId } from "./A2AjsonrpcResponseId.js"; - -export const A2AjsonrpcResponse: core.serialization.ObjectSchema< - serializers.A2AjsonrpcResponse.Raw, - Corti.A2AjsonrpcResponse -> = core.serialization.object({ - jsonrpc: core.serialization.stringLiteral("2.0"), - id: A2AjsonrpcResponseId.nullable(), - result: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - error: A2AjsonrpcResponseError.optional(), -}); - -export declare namespace A2AjsonrpcResponse { - export interface Raw { - jsonrpc: "2.0"; - id?: A2AjsonrpcResponseId.Raw | null; - result?: Record | null; - error?: A2AjsonrpcResponseError.Raw | null; - } -} diff --git a/src/serialization/types/A2AjsonrpcResponseError.ts b/src/serialization/types/A2AjsonrpcResponseError.ts deleted file mode 100644 index a5c9e8ee..00000000 --- a/src/serialization/types/A2AjsonrpcResponseError.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2AjsonrpcResponseError: core.serialization.ObjectSchema< - serializers.A2AjsonrpcResponseError.Raw, - Corti.A2AjsonrpcResponseError -> = core.serialization.object({ - code: core.serialization.number(), - message: core.serialization.string(), - data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace A2AjsonrpcResponseError { - export interface Raw { - code: number; - message: string; - data?: Record | null; - } -} diff --git a/src/serialization/types/A2AjsonrpcResponseId.ts b/src/serialization/types/A2AjsonrpcResponseId.ts deleted file mode 100644 index 86944630..00000000 --- a/src/serialization/types/A2AjsonrpcResponseId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2AjsonrpcResponseId: core.serialization.Schema< - serializers.A2AjsonrpcResponseId.Raw, - Corti.A2AjsonrpcResponseId -> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); - -export declare namespace A2AjsonrpcResponseId { - export type Raw = string | number; -} diff --git a/src/serialization/types/AgentCardResponse.ts b/src/serialization/types/AgentCardResponse.ts deleted file mode 100644 index febe4c51..00000000 --- a/src/serialization/types/AgentCardResponse.ts +++ /dev/null @@ -1,51 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentCardResponseCapabilities } from "./AgentCardResponseCapabilities.js"; -import { AgentCardResponseProvider } from "./AgentCardResponseProvider.js"; -import { AgentCardResponseSignaturesItem } from "./AgentCardResponseSignaturesItem.js"; -import { AgentCardResponseSkillsItem } from "./AgentCardResponseSkillsItem.js"; -import { AgentCardResponseSupportedInterfacesItem } from "./AgentCardResponseSupportedInterfacesItem.js"; - -export const AgentCardResponse: core.serialization.ObjectSchema< - serializers.AgentCardResponse.Raw, - Corti.AgentCardResponse -> = core.serialization.object({ - name: core.serialization.string(), - description: core.serialization.string().optional(), - documentationUrl: core.serialization.string().optional(), - iconUrl: core.serialization.string().optional(), - version: core.serialization.string(), - capabilities: AgentCardResponseCapabilities, - defaultInputModes: core.serialization.list(core.serialization.string()).optional(), - defaultOutputModes: core.serialization.list(core.serialization.string()).optional(), - provider: AgentCardResponseProvider.optional(), - securityRequirements: core.serialization - .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) - .optional(), - securitySchemes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - signatures: core.serialization.list(AgentCardResponseSignaturesItem).optional(), - skills: core.serialization.list(AgentCardResponseSkillsItem).optional(), - supportedInterfaces: core.serialization.list(AgentCardResponseSupportedInterfacesItem), -}); - -export declare namespace AgentCardResponse { - export interface Raw { - name: string; - description?: string | null; - documentationUrl?: string | null; - iconUrl?: string | null; - version: string; - capabilities: AgentCardResponseCapabilities.Raw; - defaultInputModes?: string[] | null; - defaultOutputModes?: string[] | null; - provider?: AgentCardResponseProvider.Raw | null; - securityRequirements?: Record[] | null; - securitySchemes?: Record | null; - signatures?: AgentCardResponseSignaturesItem.Raw[] | null; - skills?: AgentCardResponseSkillsItem.Raw[] | null; - supportedInterfaces: AgentCardResponseSupportedInterfacesItem.Raw[]; - } -} diff --git a/src/serialization/types/AgentCardResponseCapabilities.ts b/src/serialization/types/AgentCardResponseCapabilities.ts deleted file mode 100644 index cba74d0f..00000000 --- a/src/serialization/types/AgentCardResponseCapabilities.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseCapabilities: core.serialization.ObjectSchema< - serializers.AgentCardResponseCapabilities.Raw, - Corti.AgentCardResponseCapabilities -> = core.serialization.object({ - streaming: core.serialization.boolean().optional(), - pushNotifications: core.serialization.boolean().optional(), -}); - -export declare namespace AgentCardResponseCapabilities { - export interface Raw { - streaming?: boolean | null; - pushNotifications?: boolean | null; - } -} diff --git a/src/serialization/types/AgentCardResponseProvider.ts b/src/serialization/types/AgentCardResponseProvider.ts deleted file mode 100644 index fb0d635e..00000000 --- a/src/serialization/types/AgentCardResponseProvider.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseProvider: core.serialization.ObjectSchema< - serializers.AgentCardResponseProvider.Raw, - Corti.AgentCardResponseProvider -> = core.serialization.object({ - organization: core.serialization.string().optional(), - url: core.serialization.string().optional(), -}); - -export declare namespace AgentCardResponseProvider { - export interface Raw { - organization?: string | null; - url?: string | null; - } -} diff --git a/src/serialization/types/AgentCardResponseSignaturesItem.ts b/src/serialization/types/AgentCardResponseSignaturesItem.ts deleted file mode 100644 index c86627a0..00000000 --- a/src/serialization/types/AgentCardResponseSignaturesItem.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseSignaturesItem: core.serialization.ObjectSchema< - serializers.AgentCardResponseSignaturesItem.Raw, - Corti.AgentCardResponseSignaturesItem -> = core.serialization.object({ - protected: core.serialization.string(), - header: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - signature: core.serialization.string(), -}); - -export declare namespace AgentCardResponseSignaturesItem { - export interface Raw { - protected: string; - header?: Record | null; - signature: string; - } -} diff --git a/src/serialization/types/AgentCardResponseSkillsItem.ts b/src/serialization/types/AgentCardResponseSkillsItem.ts deleted file mode 100644 index 839caaa2..00000000 --- a/src/serialization/types/AgentCardResponseSkillsItem.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseSkillsItem: core.serialization.ObjectSchema< - serializers.AgentCardResponseSkillsItem.Raw, - Corti.AgentCardResponseSkillsItem -> = core.serialization.object({ - id: core.serialization.string(), - name: core.serialization.string(), - description: core.serialization.string().optional(), - tags: core.serialization.list(core.serialization.string()).optional(), -}); - -export declare namespace AgentCardResponseSkillsItem { - export interface Raw { - id: string; - name: string; - description?: string | null; - tags?: string[] | null; - } -} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts deleted file mode 100644 index b9ce417c..00000000 --- a/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentCardResponseSupportedInterfacesItemProtocolBinding } from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; - -export const AgentCardResponseSupportedInterfacesItem: core.serialization.ObjectSchema< - serializers.AgentCardResponseSupportedInterfacesItem.Raw, - Corti.AgentCardResponseSupportedInterfacesItem -> = core.serialization.object({ - protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding, - protocolVersion: core.serialization.stringLiteral("1.0"), - url: core.serialization.string(), -}); - -export declare namespace AgentCardResponseSupportedInterfacesItem { - export interface Raw { - protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw; - protocolVersion: "1.0"; - url: string; - } -} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts deleted file mode 100644 index cd155f3e..00000000 --- a/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseSupportedInterfacesItemProtocolBinding: core.serialization.Schema< - serializers.AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw, - Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding -> = core.serialization.enum_(["JSONRPC", "HTTP+JSON"]); - -export declare namespace AgentCardResponseSupportedInterfacesItemProtocolBinding { - export type Raw = "JSONRPC" | "HTTP+JSON"; -} diff --git a/src/serialization/types/AgentsLabels.ts b/src/serialization/types/AgentsLabels.ts deleted file mode 100644 index a080d939..00000000 --- a/src/serialization/types/AgentsLabels.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsLabels: core.serialization.Schema = - core.serialization.record(core.serialization.string(), core.serialization.string()); - -export declare namespace AgentsLabels { - export type Raw = Record; -} diff --git a/src/serialization/types/AgentsLifecycle.ts b/src/serialization/types/AgentsLifecycle.ts deleted file mode 100644 index 5993ff67..00000000 --- a/src/serialization/types/AgentsLifecycle.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsLifecycle: core.serialization.Schema = - core.serialization.enum_(["ephemeral", "persistent"]); - -export declare namespace AgentsLifecycle { - export type Raw = "ephemeral" | "persistent"; -} diff --git a/src/serialization/types/AgentsListResponse.ts b/src/serialization/types/AgentsListResponse.ts deleted file mode 100644 index 2027987d..00000000 --- a/src/serialization/types/AgentsListResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsResponse } from "./AgentsResponse.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; - -export const AgentsListResponse: core.serialization.ObjectSchema< - serializers.AgentsListResponse.Raw, - Corti.AgentsListResponse -> = core.serialization.object({ - agents: core.serialization.list(AgentsResponse), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace AgentsListResponse { - export interface Raw { - agents: AgentsResponse.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/AgentsResponse.ts b/src/serialization/types/AgentsResponse.ts deleted file mode 100644 index fe2efda1..00000000 --- a/src/serialization/types/AgentsResponse.ts +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsLabels } from "./AgentsLabels.js"; -import { AgentsLifecycle } from "./AgentsLifecycle.js"; -import { AgentsUserIdValue } from "./AgentsUserIdValue.js"; -import { AgentsVisibility } from "./AgentsVisibility.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; -import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; - -export const AgentsResponse: core.serialization.ObjectSchema = - core.serialization.object({ - id: CommonAgentIdValue, - name: core.serialization.string(), - description: core.serialization.string().optionalNullable(), - systemPrompt: core.serialization.string().optionalNullable(), - model: core.serialization.string().optionalNullable(), - visibility: AgentsVisibility, - lifecycle: AgentsLifecycle, - connectors: core.serialization.list(CommonConnectorResponse), - labels: AgentsLabels.optional(), - createdAt: core.serialization.date().optional(), - updatedAt: core.serialization.date().optional(), - createdBy: AgentsUserIdValue.optional(), - }); - -export declare namespace AgentsResponse { - export interface Raw { - id: CommonAgentIdValue.Raw; - name: string; - description?: (string | null | undefined) | null; - systemPrompt?: (string | null | undefined) | null; - model?: (string | null | undefined) | null; - visibility: AgentsVisibility.Raw; - lifecycle: AgentsLifecycle.Raw; - connectors: CommonConnectorResponse.Raw[]; - labels?: AgentsLabels.Raw | null; - createdAt?: string | null; - updatedAt?: string | null; - createdBy?: AgentsUserIdValue.Raw | null; - } -} diff --git a/src/serialization/types/AgentsUserIdValue.ts b/src/serialization/types/AgentsUserIdValue.ts deleted file mode 100644 index 6782956b..00000000 --- a/src/serialization/types/AgentsUserIdValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsUserIdValue: core.serialization.Schema = - core.serialization.string(); - -export declare namespace AgentsUserIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/AgentsVisibility.ts b/src/serialization/types/AgentsVisibility.ts deleted file mode 100644 index 9d7fb839..00000000 --- a/src/serialization/types/AgentsVisibility.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsVisibility: core.serialization.Schema = - core.serialization.enum_(["private", "unlisted", "public"]); - -export declare namespace AgentsVisibility { - export type Raw = "private" | "unlisted" | "public"; -} diff --git a/src/serialization/types/CommonA2AConnector.ts b/src/serialization/types/CommonA2AConnector.ts deleted file mode 100644 index fb899433..00000000 --- a/src/serialization/types/CommonA2AConnector.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonA2AConnector: core.serialization.ObjectSchema< - serializers.CommonA2AConnector.Raw, - Corti.CommonA2AConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("a2a"), - name: core.serialization.string().optional(), - url: core.serialization.string(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonA2AConnector { - export interface Raw { - type: "a2a"; - name?: string | null; - url: string; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonA2AConnectorCreate.ts b/src/serialization/types/CommonA2AConnectorCreate.ts deleted file mode 100644 index 59699d10..00000000 --- a/src/serialization/types/CommonA2AConnectorCreate.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonA2AConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonA2AConnectorCreate.Raw, - Corti.CommonA2AConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("a2a"), - name: core.serialization.string().optional(), - url: core.serialization.string(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonA2AConnectorCreate { - export interface Raw { - type: "a2a"; - name?: string | null; - url: string; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonAgentConnector.ts b/src/serialization/types/CommonAgentConnector.ts deleted file mode 100644 index cb3dca8d..00000000 --- a/src/serialization/types/CommonAgentConnector.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonAgentConnector: core.serialization.ObjectSchema< - serializers.CommonAgentConnector.Raw, - Corti.CommonAgentConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("agent"), - agentId: CommonAgentIdValue, - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonAgentConnector { - export interface Raw { - type: "agent"; - agentId: CommonAgentIdValue.Raw; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonAgentConnectorCreate.ts b/src/serialization/types/CommonAgentConnectorCreate.ts deleted file mode 100644 index b000e3b7..00000000 --- a/src/serialization/types/CommonAgentConnectorCreate.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; - -export const CommonAgentConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonAgentConnectorCreate.Raw, - Corti.CommonAgentConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("agent"), - agentId: CommonAgentIdValue, - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonAgentConnectorCreate { - export interface Raw { - type: "agent"; - agentId: CommonAgentIdValue.Raw; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonAgentIdValue.ts b/src/serialization/types/CommonAgentIdValue.ts deleted file mode 100644 index f722a543..00000000 --- a/src/serialization/types/CommonAgentIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonAgentIdValue: core.serialization.Schema< - serializers.CommonAgentIdValue.Raw, - Corti.CommonAgentIdValue -> = core.serialization.string(); - -export declare namespace CommonAgentIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonArtifactIdValue.ts b/src/serialization/types/CommonArtifactIdValue.ts deleted file mode 100644 index a135e7e2..00000000 --- a/src/serialization/types/CommonArtifactIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonArtifactIdValue: core.serialization.Schema< - serializers.CommonArtifactIdValue.Raw, - Corti.CommonArtifactIdValue -> = core.serialization.string(); - -export declare namespace CommonArtifactIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonArtifactResponse.ts b/src/serialization/types/CommonArtifactResponse.ts deleted file mode 100644 index b2aa8f1f..00000000 --- a/src/serialization/types/CommonArtifactResponse.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonArtifactIdValue } from "./CommonArtifactIdValue.js"; -import { CommonPart } from "./CommonPart.js"; - -export const CommonArtifactResponse: core.serialization.ObjectSchema< - serializers.CommonArtifactResponse.Raw, - Corti.CommonArtifactResponse -> = core.serialization.object({ - artifactId: CommonArtifactIdValue, - name: core.serialization.string().optional(), - description: core.serialization.string().optional(), - extensions: core.serialization.list(core.serialization.string()).optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - parts: core.serialization.list(CommonPart), -}); - -export declare namespace CommonArtifactResponse { - export interface Raw { - artifactId: CommonArtifactIdValue.Raw; - name?: string | null; - description?: string | null; - extensions?: string[] | null; - metadata?: Record | null; - parts: CommonPart.Raw[]; - } -} diff --git a/src/serialization/types/CommonConnectorAuth.ts b/src/serialization/types/CommonConnectorAuth.ts deleted file mode 100644 index da6cc3d9..00000000 --- a/src/serialization/types/CommonConnectorAuth.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorAuthType } from "./CommonConnectorAuthType.js"; - -export const CommonConnectorAuth: core.serialization.ObjectSchema< - serializers.CommonConnectorAuth.Raw, - Corti.CommonConnectorAuth -> = core.serialization.object({ - type: CommonConnectorAuthType, - scope: core.serialization.string().optional(), - redirectUrl: core.serialization.string().optional(), - ref: core.serialization.string().optional(), -}); - -export declare namespace CommonConnectorAuth { - export interface Raw { - type: CommonConnectorAuthType.Raw; - scope?: string | null; - redirectUrl?: string | null; - ref?: string | null; - } -} diff --git a/src/serialization/types/CommonConnectorAuthType.ts b/src/serialization/types/CommonConnectorAuthType.ts deleted file mode 100644 index c9deff12..00000000 --- a/src/serialization/types/CommonConnectorAuthType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonConnectorAuthType: core.serialization.Schema< - serializers.CommonConnectorAuthType.Raw, - Corti.CommonConnectorAuthType -> = core.serialization.enum_(["none", "bearer", "apiKey", "oauth2"]); - -export declare namespace CommonConnectorAuthType { - export type Raw = "none" | "bearer" | "apiKey" | "oauth2"; -} diff --git a/src/serialization/types/CommonConnectorCreateRequest.ts b/src/serialization/types/CommonConnectorCreateRequest.ts deleted file mode 100644 index d95dc3bb..00000000 --- a/src/serialization/types/CommonConnectorCreateRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonA2AConnectorCreate } from "./CommonA2AConnectorCreate.js"; -import { CommonAgentConnectorCreate } from "./CommonAgentConnectorCreate.js"; -import { CommonMcpConnectorCreate } from "./CommonMcpConnectorCreate.js"; -import { CommonRegistryConnectorCreate } from "./CommonRegistryConnectorCreate.js"; -import { CommonSchemaConnectorCreate } from "./CommonSchemaConnectorCreate.js"; - -export const CommonConnectorCreateRequest: core.serialization.Schema< - serializers.CommonConnectorCreateRequest.Raw, - Corti.CommonConnectorCreateRequest -> = core.serialization.undiscriminatedUnion([ - CommonRegistryConnectorCreate, - CommonMcpConnectorCreate, - CommonAgentConnectorCreate, - CommonA2AConnectorCreate, - CommonSchemaConnectorCreate, -]); - -export declare namespace CommonConnectorCreateRequest { - export type Raw = - | CommonRegistryConnectorCreate.Raw - | CommonMcpConnectorCreate.Raw - | CommonAgentConnectorCreate.Raw - | CommonA2AConnectorCreate.Raw - | CommonSchemaConnectorCreate.Raw; -} diff --git a/src/serialization/types/CommonConnectorIdValue.ts b/src/serialization/types/CommonConnectorIdValue.ts deleted file mode 100644 index a87af807..00000000 --- a/src/serialization/types/CommonConnectorIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonConnectorIdValue: core.serialization.Schema< - serializers.CommonConnectorIdValue.Raw, - Corti.CommonConnectorIdValue -> = core.serialization.string(); - -export declare namespace CommonConnectorIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonConnectorResponse.ts b/src/serialization/types/CommonConnectorResponse.ts deleted file mode 100644 index 942e8438..00000000 --- a/src/serialization/types/CommonConnectorResponse.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonA2AConnector } from "./CommonA2AConnector.js"; -import { CommonAgentConnector } from "./CommonAgentConnector.js"; -import { CommonMcpConnector } from "./CommonMcpConnector.js"; -import { CommonRegistryConnectorProvisioned } from "./CommonRegistryConnectorProvisioned.js"; -import { CommonSchemaConnector } from "./CommonSchemaConnector.js"; - -export const CommonConnectorResponse: core.serialization.Schema< - serializers.CommonConnectorResponse.Raw, - Corti.CommonConnectorResponse -> = core.serialization.undiscriminatedUnion([ - CommonRegistryConnectorProvisioned, - CommonMcpConnector, - CommonAgentConnector, - CommonA2AConnector, - CommonSchemaConnector, -]); - -export declare namespace CommonConnectorResponse { - export type Raw = - | CommonRegistryConnectorProvisioned.Raw - | CommonMcpConnector.Raw - | CommonAgentConnector.Raw - | CommonA2AConnector.Raw - | CommonSchemaConnector.Raw; -} diff --git a/src/serialization/types/CommonConnectorType.ts b/src/serialization/types/CommonConnectorType.ts deleted file mode 100644 index fdea4339..00000000 --- a/src/serialization/types/CommonConnectorType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonConnectorType: core.serialization.Schema< - serializers.CommonConnectorType.Raw, - Corti.CommonConnectorType -> = core.serialization.enum_(["registry", "mcp", "agent", "a2a", "schema"]); - -export declare namespace CommonConnectorType { - export type Raw = "registry" | "mcp" | "agent" | "a2a" | "schema"; -} diff --git a/src/serialization/types/CommonContextIdValue.ts b/src/serialization/types/CommonContextIdValue.ts deleted file mode 100644 index 95ab2ae2..00000000 --- a/src/serialization/types/CommonContextIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonContextIdValue: core.serialization.Schema< - serializers.CommonContextIdValue.Raw, - Corti.CommonContextIdValue -> = core.serialization.string(); - -export declare namespace CommonContextIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonErrorResponse.ts b/src/serialization/types/CommonErrorResponse.ts deleted file mode 100644 index ca0e5b74..00000000 --- a/src/serialization/types/CommonErrorResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonErrorResponseError } from "./CommonErrorResponseError.js"; - -export const CommonErrorResponse: core.serialization.ObjectSchema< - serializers.CommonErrorResponse.Raw, - Corti.CommonErrorResponse -> = core.serialization.object({ - error: CommonErrorResponseError, -}); - -export declare namespace CommonErrorResponse { - export interface Raw { - error: CommonErrorResponseError.Raw; - } -} diff --git a/src/serialization/types/CommonErrorResponseError.ts b/src/serialization/types/CommonErrorResponseError.ts deleted file mode 100644 index 4b40f814..00000000 --- a/src/serialization/types/CommonErrorResponseError.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonErrorResponseErrorDetails } from "./CommonErrorResponseErrorDetails.js"; - -export const CommonErrorResponseError: core.serialization.ObjectSchema< - serializers.CommonErrorResponseError.Raw, - Corti.CommonErrorResponseError -> = core.serialization.object({ - code: core.serialization.string(), - message: core.serialization.string(), - howToFix: core.serialization.string().optional(), - details: CommonErrorResponseErrorDetails.optional(), - requestId: core.serialization.string().optional(), -}); - -export declare namespace CommonErrorResponseError { - export interface Raw { - code: string; - message: string; - howToFix?: string | null; - details?: CommonErrorResponseErrorDetails.Raw | null; - requestId?: string | null; - } -} diff --git a/src/serialization/types/CommonErrorResponseErrorDetails.ts b/src/serialization/types/CommonErrorResponseErrorDetails.ts deleted file mode 100644 index 79578cce..00000000 --- a/src/serialization/types/CommonErrorResponseErrorDetails.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonErrorResponseErrorDetailsValidationErrorsItem } from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; - -export const CommonErrorResponseErrorDetails: core.serialization.ObjectSchema< - serializers.CommonErrorResponseErrorDetails.Raw, - Corti.CommonErrorResponseErrorDetails -> = core.serialization - .object({ - validationErrors: core.serialization.list(CommonErrorResponseErrorDetailsValidationErrorsItem).optional(), - }) - .passthrough(); - -export declare namespace CommonErrorResponseErrorDetails { - export interface Raw { - validationErrors?: CommonErrorResponseErrorDetailsValidationErrorsItem.Raw[] | null; - [key: string]: any; - } -} diff --git a/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts deleted file mode 100644 index 31bf3888..00000000 --- a/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonErrorResponseErrorDetailsValidationErrorsItem: core.serialization.ObjectSchema< - serializers.CommonErrorResponseErrorDetailsValidationErrorsItem.Raw, - Corti.CommonErrorResponseErrorDetailsValidationErrorsItem -> = core.serialization.object({ - field: core.serialization.string(), - reason: core.serialization.string(), -}); - -export declare namespace CommonErrorResponseErrorDetailsValidationErrorsItem { - export interface Raw { - field: string; - reason: string; - } -} diff --git a/src/serialization/types/CommonMcpConnector.ts b/src/serialization/types/CommonMcpConnector.ts deleted file mode 100644 index 98b38046..00000000 --- a/src/serialization/types/CommonMcpConnector.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonMcpConnector: core.serialization.ObjectSchema< - serializers.CommonMcpConnector.Raw, - Corti.CommonMcpConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("mcp"), - name: core.serialization.string(), - url: core.serialization.string(), - auth: CommonConnectorAuth.optional(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonMcpConnector { - export interface Raw { - type: "mcp"; - name: string; - url: string; - auth?: CommonConnectorAuth.Raw | null; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonMcpConnectorCreate.ts b/src/serialization/types/CommonMcpConnectorCreate.ts deleted file mode 100644 index 6373c7b0..00000000 --- a/src/serialization/types/CommonMcpConnectorCreate.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; - -export const CommonMcpConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonMcpConnectorCreate.Raw, - Corti.CommonMcpConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("mcp"), - name: core.serialization.string(), - url: core.serialization.string(), - enabled: core.serialization.boolean().optional(), - auth: CommonConnectorAuth.optional(), -}); - -export declare namespace CommonMcpConnectorCreate { - export interface Raw { - type: "mcp"; - name: string; - url: string; - enabled?: boolean | null; - auth?: CommonConnectorAuth.Raw | null; - } -} diff --git a/src/serialization/types/CommonMessage.ts b/src/serialization/types/CommonMessage.ts deleted file mode 100644 index ebefe64c..00000000 --- a/src/serialization/types/CommonMessage.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonContextIdValue } from "./CommonContextIdValue.js"; -import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; -import { CommonPart } from "./CommonPart.js"; -import { CommonRole } from "./CommonRole.js"; -import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; - -export const CommonMessage: core.serialization.ObjectSchema = - core.serialization.object({ - messageId: CommonMessageIdValue.optional(), - contextId: CommonContextIdValue.optional(), - taskId: CommonTaskIdValue.optional(), - role: CommonRole, - parts: core.serialization.list(CommonPart), - referenceTaskIds: core.serialization.list(CommonTaskIdValue).optional(), - extensions: core.serialization.list(core.serialization.string()).optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }); - -export declare namespace CommonMessage { - export interface Raw { - messageId?: CommonMessageIdValue.Raw | null; - contextId?: CommonContextIdValue.Raw | null; - taskId?: CommonTaskIdValue.Raw | null; - role: CommonRole.Raw; - parts: CommonPart.Raw[]; - referenceTaskIds?: CommonTaskIdValue.Raw[] | null; - extensions?: string[] | null; - metadata?: Record | null; - } -} diff --git a/src/serialization/types/CommonMessageIdValue.ts b/src/serialization/types/CommonMessageIdValue.ts deleted file mode 100644 index 29d1b310..00000000 --- a/src/serialization/types/CommonMessageIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonMessageIdValue: core.serialization.Schema< - serializers.CommonMessageIdValue.Raw, - Corti.CommonMessageIdValue -> = core.serialization.string(); - -export declare namespace CommonMessageIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonNextPageToken.ts b/src/serialization/types/CommonNextPageToken.ts deleted file mode 100644 index 75f714c8..00000000 --- a/src/serialization/types/CommonNextPageToken.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonNextPageToken: core.serialization.Schema< - serializers.CommonNextPageToken.Raw, - Corti.CommonNextPageToken -> = core.serialization.string().nullable(); - -export declare namespace CommonNextPageToken { - export type Raw = string | null | undefined; -} diff --git a/src/serialization/types/CommonPart.ts b/src/serialization/types/CommonPart.ts deleted file mode 100644 index 87eed54a..00000000 --- a/src/serialization/types/CommonPart.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonPart: core.serialization.ObjectSchema = - core.serialization - .object({ - text: core.serialization.string().optional(), - data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - filename: core.serialization.string().optional(), - mediaType: core.serialization.string().optional(), - raw: core.serialization.string().optional(), - url: core.serialization.string().optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }) - .passthrough(); - -export declare namespace CommonPart { - export interface Raw { - text?: string | null; - data?: Record | null; - filename?: string | null; - mediaType?: string | null; - raw?: string | null; - url?: string | null; - metadata?: Record | null; - [key: string]: any; - } -} diff --git a/src/serialization/types/CommonRegistryConnectorCreate.ts b/src/serialization/types/CommonRegistryConnectorCreate.ts deleted file mode 100644 index 2fc6dc9e..00000000 --- a/src/serialization/types/CommonRegistryConnectorCreate.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonRegistryConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonRegistryConnectorCreate.Raw, - Corti.CommonRegistryConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("registry"), - name: core.serialization.string(), - enabled: core.serialization.boolean().optional(), - config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace CommonRegistryConnectorCreate { - export interface Raw { - type: "registry"; - name: string; - enabled?: boolean | null; - config?: Record | null; - } -} diff --git a/src/serialization/types/CommonRegistryConnectorProvisioned.ts b/src/serialization/types/CommonRegistryConnectorProvisioned.ts deleted file mode 100644 index ebb182db..00000000 --- a/src/serialization/types/CommonRegistryConnectorProvisioned.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonRegistryConnectorProvisioned: core.serialization.ObjectSchema< - serializers.CommonRegistryConnectorProvisioned.Raw, - Corti.CommonRegistryConnectorProvisioned -> = core.serialization.object({ - type: core.serialization.stringLiteral("registry"), - name: core.serialization.string(), - config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonRegistryConnectorProvisioned { - export interface Raw { - type: "registry"; - name: string; - config?: Record | null; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonRole.ts b/src/serialization/types/CommonRole.ts deleted file mode 100644 index 001aaac7..00000000 --- a/src/serialization/types/CommonRole.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonRole: core.serialization.Schema = - core.serialization.enum_(["ROLE_USER", "ROLE_AGENT"]); - -export declare namespace CommonRole { - export type Raw = "ROLE_USER" | "ROLE_AGENT"; -} diff --git a/src/serialization/types/CommonSchemaConnector.ts b/src/serialization/types/CommonSchemaConnector.ts deleted file mode 100644 index d596f08b..00000000 --- a/src/serialization/types/CommonSchemaConnector.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; -import { CommonSchemaConnectorTransition } from "./CommonSchemaConnectorTransition.js"; - -export const CommonSchemaConnector: core.serialization.ObjectSchema< - serializers.CommonSchemaConnector.Raw, - Corti.CommonSchemaConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("schema"), - name: core.serialization.string(), - description: core.serialization.string().optional(), - schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - transition: CommonSchemaConnectorTransition.optional(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonSchemaConnector { - export interface Raw { - type: "schema"; - name: string; - description?: string | null; - schema: Record; - transition?: CommonSchemaConnectorTransition.Raw | null; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonSchemaConnectorCreate.ts b/src/serialization/types/CommonSchemaConnectorCreate.ts deleted file mode 100644 index f37c77b7..00000000 --- a/src/serialization/types/CommonSchemaConnectorCreate.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonSchemaConnectorCreateTransition } from "./CommonSchemaConnectorCreateTransition.js"; - -export const CommonSchemaConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonSchemaConnectorCreate.Raw, - Corti.CommonSchemaConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("schema"), - name: core.serialization.string(), - description: core.serialization.string().optional(), - schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - transition: CommonSchemaConnectorCreateTransition.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonSchemaConnectorCreate { - export interface Raw { - type: "schema"; - name: string; - description?: string | null; - schema: Record; - transition?: CommonSchemaConnectorCreateTransition.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonSchemaConnectorCreateTransition.ts b/src/serialization/types/CommonSchemaConnectorCreateTransition.ts deleted file mode 100644 index 9fca7219..00000000 --- a/src/serialization/types/CommonSchemaConnectorCreateTransition.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonSchemaConnectorCreateTransition: core.serialization.Schema< - serializers.CommonSchemaConnectorCreateTransition.Raw, - Corti.CommonSchemaConnectorCreateTransition -> = core.serialization.enum_(["complete", "input_required"]); - -export declare namespace CommonSchemaConnectorCreateTransition { - export type Raw = "complete" | "input_required"; -} diff --git a/src/serialization/types/CommonSchemaConnectorTransition.ts b/src/serialization/types/CommonSchemaConnectorTransition.ts deleted file mode 100644 index 8e694c31..00000000 --- a/src/serialization/types/CommonSchemaConnectorTransition.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonSchemaConnectorTransition: core.serialization.Schema< - serializers.CommonSchemaConnectorTransition.Raw, - Corti.CommonSchemaConnectorTransition -> = core.serialization.enum_(["complete", "input_required"]); - -export declare namespace CommonSchemaConnectorTransition { - export type Raw = "complete" | "input_required"; -} diff --git a/src/serialization/types/CommonTaskIdValue.ts b/src/serialization/types/CommonTaskIdValue.ts deleted file mode 100644 index 2bc1386e..00000000 --- a/src/serialization/types/CommonTaskIdValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonTaskIdValue: core.serialization.Schema = - core.serialization.string(); - -export declare namespace CommonTaskIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonTaskListResponse.ts b/src/serialization/types/CommonTaskListResponse.ts deleted file mode 100644 index e23a8a73..00000000 --- a/src/serialization/types/CommonTaskListResponse.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTaskResponse } from "./CommonTaskResponse.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; - -export const CommonTaskListResponse: core.serialization.ObjectSchema< - serializers.CommonTaskListResponse.Raw, - Corti.CommonTaskListResponse -> = core.serialization.object({ - pageSize: core.serialization.number().optional(), - tasks: core.serialization.list(CommonTaskResponse), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace CommonTaskListResponse { - export interface Raw { - pageSize?: number | null; - tasks: CommonTaskResponse.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/CommonTaskMetadata.ts b/src/serialization/types/CommonTaskMetadata.ts deleted file mode 100644 index e7ce19ef..00000000 --- a/src/serialization/types/CommonTaskMetadata.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonUsage } from "./CommonUsage.js"; - -export const CommonTaskMetadata: core.serialization.ObjectSchema< - serializers.CommonTaskMetadata.Raw, - Corti.CommonTaskMetadata -> = core.serialization - .object({ - usage: core.serialization.property("$usage", CommonUsage.optional()), - }) - .passthrough(); - -export declare namespace CommonTaskMetadata { - export interface Raw { - $usage?: CommonUsage.Raw | null; - [key: string]: any; - } -} diff --git a/src/serialization/types/CommonTaskResponse.ts b/src/serialization/types/CommonTaskResponse.ts deleted file mode 100644 index 9603f2ea..00000000 --- a/src/serialization/types/CommonTaskResponse.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonArtifactResponse } from "./CommonArtifactResponse.js"; -import { CommonContextIdValue } from "./CommonContextIdValue.js"; -import { CommonMessage } from "./CommonMessage.js"; -import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; -import { CommonTaskMetadata } from "./CommonTaskMetadata.js"; -import { CommonTaskStatus } from "./CommonTaskStatus.js"; - -export const CommonTaskResponse: core.serialization.ObjectSchema< - serializers.CommonTaskResponse.Raw, - Corti.CommonTaskResponse -> = core.serialization.object({ - id: CommonTaskIdValue, - contextId: CommonContextIdValue, - status: CommonTaskStatus, - history: core.serialization.list(CommonMessage).optional(), - artifacts: core.serialization.list(CommonArtifactResponse).optional(), - metadata: CommonTaskMetadata.optional(), -}); - -export declare namespace CommonTaskResponse { - export interface Raw { - id: CommonTaskIdValue.Raw; - contextId: CommonContextIdValue.Raw; - status: CommonTaskStatus.Raw; - history?: CommonMessage.Raw[] | null; - artifacts?: CommonArtifactResponse.Raw[] | null; - metadata?: CommonTaskMetadata.Raw | null; - } -} diff --git a/src/serialization/types/CommonTaskState.ts b/src/serialization/types/CommonTaskState.ts deleted file mode 100644 index f5142fa4..00000000 --- a/src/serialization/types/CommonTaskState.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonTaskState: core.serialization.Schema = - core.serialization.enum_([ - "TASK_STATE_SUBMITTED", - "TASK_STATE_WORKING", - "TASK_STATE_COMPLETED", - "TASK_STATE_FAILED", - "TASK_STATE_CANCELED", - "TASK_STATE_INPUT_REQUIRED", - "TASK_STATE_REJECTED", - "TASK_STATE_AUTH_REQUIRED", - ]); - -export declare namespace CommonTaskState { - export type Raw = - | "TASK_STATE_SUBMITTED" - | "TASK_STATE_WORKING" - | "TASK_STATE_COMPLETED" - | "TASK_STATE_FAILED" - | "TASK_STATE_CANCELED" - | "TASK_STATE_INPUT_REQUIRED" - | "TASK_STATE_REJECTED" - | "TASK_STATE_AUTH_REQUIRED"; -} diff --git a/src/serialization/types/CommonTaskStatus.ts b/src/serialization/types/CommonTaskStatus.ts deleted file mode 100644 index 80c2e3ad..00000000 --- a/src/serialization/types/CommonTaskStatus.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonMessage } from "./CommonMessage.js"; -import { CommonTaskState } from "./CommonTaskState.js"; - -export const CommonTaskStatus: core.serialization.ObjectSchema< - serializers.CommonTaskStatus.Raw, - Corti.CommonTaskStatus -> = core.serialization.object({ - state: CommonTaskState, - message: CommonMessage.optional(), - timestamp: core.serialization.date().optional(), -}); - -export declare namespace CommonTaskStatus { - export interface Raw { - state: CommonTaskState.Raw; - message?: CommonMessage.Raw | null; - timestamp?: string | null; - } -} diff --git a/src/serialization/types/CommonTotalSize.ts b/src/serialization/types/CommonTotalSize.ts deleted file mode 100644 index c0ed29e6..00000000 --- a/src/serialization/types/CommonTotalSize.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonTotalSize: core.serialization.Schema = - core.serialization.number(); - -export declare namespace CommonTotalSize { - export type Raw = number; -} diff --git a/src/serialization/types/CommonUsage.ts b/src/serialization/types/CommonUsage.ts deleted file mode 100644 index 67699121..00000000 --- a/src/serialization/types/CommonUsage.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonUsage: core.serialization.ObjectSchema = - core.serialization.object({ - model: core.serialization.string().optional(), - inputTokens: core.serialization.number(), - outputTokens: core.serialization.number(), - cachedInputTokens: core.serialization.number().optional(), - cacheCreationInputTokens: core.serialization.number().optional(), - totalTokens: core.serialization.number(), - credits: core.serialization.number().optional(), - }); - -export declare namespace CommonUsage { - export interface Raw { - model?: string | null; - inputTokens: number; - outputTokens: number; - cachedInputTokens?: number | null; - cacheCreationInputTokens?: number | null; - totalTokens: number; - credits?: number | null; - } -} diff --git a/src/serialization/types/ConnectorsListResponse.ts b/src/serialization/types/ConnectorsListResponse.ts deleted file mode 100644 index 42c70c3b..00000000 --- a/src/serialization/types/ConnectorsListResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; - -export const ConnectorsListResponse: core.serialization.ObjectSchema< - serializers.ConnectorsListResponse.Raw, - Corti.ConnectorsListResponse -> = core.serialization.object({ - connectors: core.serialization.list(CommonConnectorResponse), -}); - -export declare namespace ConnectorsListResponse { - export interface Raw { - connectors: CommonConnectorResponse.Raw[]; - } -} diff --git a/src/serialization/types/Contexts.ts b/src/serialization/types/Contexts.ts deleted file mode 100644 index aa1c12dc..00000000 --- a/src/serialization/types/Contexts.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; -import { CommonContextIdValue } from "./CommonContextIdValue.js"; - -export const Contexts: core.serialization.ObjectSchema = - core.serialization.object({ - id: CommonContextIdValue, - agentId: CommonAgentIdValue.optional(), - taskCount: core.serialization.number().optional(), - createdAt: core.serialization.date().optional(), - updatedAt: core.serialization.date().optional(), - expiresAt: core.serialization.date().optionalNullable(), - }); - -export declare namespace Contexts { - export interface Raw { - id: CommonContextIdValue.Raw; - agentId?: CommonAgentIdValue.Raw | null; - taskCount?: number | null; - createdAt?: string | null; - updatedAt?: string | null; - expiresAt?: (string | null | undefined) | null; - } -} diff --git a/src/serialization/types/ContextsDetailResponse.ts b/src/serialization/types/ContextsDetailResponse.ts deleted file mode 100644 index 3057a895..00000000 --- a/src/serialization/types/ContextsDetailResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonTaskResponse } from "./CommonTaskResponse.js"; -import { Contexts } from "./Contexts.js"; - -export const ContextsDetailResponse: core.serialization.ObjectSchema< - serializers.ContextsDetailResponse.Raw, - Corti.ContextsDetailResponse -> = core.serialization - .object({ - tasks: core.serialization.list(CommonTaskResponse), - }) - .extend(Contexts); - -export declare namespace ContextsDetailResponse { - export interface Raw extends Contexts.Raw { - tasks: CommonTaskResponse.Raw[]; - } -} diff --git a/src/serialization/types/ContextsListResponse.ts b/src/serialization/types/ContextsListResponse.ts deleted file mode 100644 index e6765e17..00000000 --- a/src/serialization/types/ContextsListResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; -import { Contexts } from "./Contexts.js"; - -export const ContextsListResponse: core.serialization.ObjectSchema< - serializers.ContextsListResponse.Raw, - Corti.ContextsListResponse -> = core.serialization.object({ - contexts: core.serialization.list(Contexts), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace ContextsListResponse { - export interface Raw { - contexts: Contexts.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/ContextsOpenInferenceSpan.ts b/src/serialization/types/ContextsOpenInferenceSpan.ts deleted file mode 100644 index e8d958cd..00000000 --- a/src/serialization/types/ContextsOpenInferenceSpan.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const ContextsOpenInferenceSpan: core.serialization.ObjectSchema< - serializers.ContextsOpenInferenceSpan.Raw, - Corti.ContextsOpenInferenceSpan -> = core.serialization.object({ - name: core.serialization.string(), - spanId: core.serialization.property("span_id", core.serialization.string()), - parentSpanId: core.serialization.property("parent_span_id", core.serialization.string().optional()), - startTime: core.serialization.property("start_time", core.serialization.date()), - endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), - attributes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace ContextsOpenInferenceSpan { - export interface Raw { - name: string; - span_id: string; - parent_span_id?: string | null; - start_time: string; - end_time?: (string | null | undefined) | null; - attributes?: Record | null; - } -} diff --git a/src/serialization/types/ContextsTraceItem.ts b/src/serialization/types/ContextsTraceItem.ts deleted file mode 100644 index 7b2ec7f8..00000000 --- a/src/serialization/types/ContextsTraceItem.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { ContextsOpenInferenceSpan } from "./ContextsOpenInferenceSpan.js"; -import { ContextsTraceItemTrace } from "./ContextsTraceItemTrace.js"; - -export const ContextsTraceItem: core.serialization.ObjectSchema< - serializers.ContextsTraceItem.Raw, - Corti.ContextsTraceItem -> = core.serialization.object({ - trace: ContextsTraceItemTrace, - spans: core.serialization.list(ContextsOpenInferenceSpan), -}); - -export declare namespace ContextsTraceItem { - export interface Raw { - trace: ContextsTraceItemTrace.Raw; - spans: ContextsOpenInferenceSpan.Raw[]; - } -} diff --git a/src/serialization/types/ContextsTraceItemTrace.ts b/src/serialization/types/ContextsTraceItemTrace.ts deleted file mode 100644 index 75e2f533..00000000 --- a/src/serialization/types/ContextsTraceItemTrace.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const ContextsTraceItemTrace: core.serialization.ObjectSchema< - serializers.ContextsTraceItemTrace.Raw, - Corti.ContextsTraceItemTrace -> = core.serialization.object({ - id: core.serialization.string(), - name: core.serialization.string(), - startTime: core.serialization.property("start_time", core.serialization.date()), - endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), - input: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - output: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - tags: core.serialization.list(core.serialization.string()).optional(), - threadId: core.serialization.property("thread_id", core.serialization.string()), -}); - -export declare namespace ContextsTraceItemTrace { - export interface Raw { - id: string; - name: string; - start_time: string; - end_time?: (string | null | undefined) | null; - input?: Record | null; - output?: Record | null; - metadata?: Record | null; - tags?: string[] | null; - thread_id: string; - } -} diff --git a/src/serialization/types/ContextsTraceResponse.ts b/src/serialization/types/ContextsTraceResponse.ts deleted file mode 100644 index b06ecbc9..00000000 --- a/src/serialization/types/ContextsTraceResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; -import { ContextsTraceItem } from "./ContextsTraceItem.js"; - -export const ContextsTraceResponse: core.serialization.ObjectSchema< - serializers.ContextsTraceResponse.Raw, - Corti.ContextsTraceResponse -> = core.serialization.object({ - traces: core.serialization.list(ContextsTraceItem), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace ContextsTraceResponse { - export interface Raw { - traces: ContextsTraceItem.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/FeedbackActor.ts b/src/serialization/types/FeedbackActor.ts deleted file mode 100644 index feb0d51f..00000000 --- a/src/serialization/types/FeedbackActor.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackActor: core.serialization.ObjectSchema = - core.serialization.object({ - externalId: core.serialization.string(), - }); - -export declare namespace FeedbackActor { - export interface Raw { - externalId: string; - } -} diff --git a/src/serialization/types/FeedbackIdValue.ts b/src/serialization/types/FeedbackIdValue.ts deleted file mode 100644 index 21dfa05f..00000000 --- a/src/serialization/types/FeedbackIdValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackIdValue: core.serialization.Schema = - core.serialization.string(); - -export declare namespace FeedbackIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/FeedbackLabel.ts b/src/serialization/types/FeedbackLabel.ts deleted file mode 100644 index dee3b08b..00000000 --- a/src/serialization/types/FeedbackLabel.ts +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackLabel: core.serialization.Schema = - core.serialization.enum_([ - "correct", - "complete", - "helpful", - "wellPresented", - "efficient", - "incorrect", - "missingInformation", - "irrelevant", - "misunderstoodRequest", - "unsupportedClaim", - "unsafeOrInappropriate", - "poorlyPresented", - "tooVerbose", - "other", - ]); - -export declare namespace FeedbackLabel { - export type Raw = - | "correct" - | "complete" - | "helpful" - | "wellPresented" - | "efficient" - | "incorrect" - | "missingInformation" - | "irrelevant" - | "misunderstoodRequest" - | "unsupportedClaim" - | "unsafeOrInappropriate" - | "poorlyPresented" - | "tooVerbose" - | "other"; -} diff --git a/src/serialization/types/FeedbackListResponse.ts b/src/serialization/types/FeedbackListResponse.ts deleted file mode 100644 index 1a1cb098..00000000 --- a/src/serialization/types/FeedbackListResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { FeedbackResponse } from "./FeedbackResponse.js"; - -export const FeedbackListResponse: core.serialization.ObjectSchema< - serializers.FeedbackListResponse.Raw, - Corti.FeedbackListResponse -> = core.serialization.object({ - feedbacks: core.serialization.list(FeedbackResponse), -}); - -export declare namespace FeedbackListResponse { - export interface Raw { - feedbacks: FeedbackResponse.Raw[]; - } -} diff --git a/src/serialization/types/FeedbackMetadata.ts b/src/serialization/types/FeedbackMetadata.ts deleted file mode 100644 index 162c3f90..00000000 --- a/src/serialization/types/FeedbackMetadata.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { FeedbackActor } from "./FeedbackActor.js"; - -export const FeedbackMetadata: core.serialization.ObjectSchema< - serializers.FeedbackMetadata.Raw, - Corti.FeedbackMetadata -> = core.serialization.object({ - collectionMethod: core.serialization.string().optional(), - clientReference: core.serialization.string().optional(), - actor: FeedbackActor.optional(), -}); - -export declare namespace FeedbackMetadata { - export interface Raw { - collectionMethod?: string | null; - clientReference?: string | null; - actor?: FeedbackActor.Raw | null; - } -} diff --git a/src/serialization/types/FeedbackRating.ts b/src/serialization/types/FeedbackRating.ts deleted file mode 100644 index 87e5c7ca..00000000 --- a/src/serialization/types/FeedbackRating.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { FeedbackRatingScale } from "./FeedbackRatingScale.js"; - -export const FeedbackRating: core.serialization.ObjectSchema = - core.serialization.object({ - scale: FeedbackRatingScale, - value: core.serialization.number(), - }); - -export declare namespace FeedbackRating { - export interface Raw { - scale: FeedbackRatingScale.Raw; - value: number; - } -} diff --git a/src/serialization/types/FeedbackRatingScale.ts b/src/serialization/types/FeedbackRatingScale.ts deleted file mode 100644 index ebbeb7ba..00000000 --- a/src/serialization/types/FeedbackRatingScale.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackRatingScale: core.serialization.Schema< - serializers.FeedbackRatingScale.Raw, - Corti.FeedbackRatingScale -> = core.serialization.enum_(["binary"]); - -export declare namespace FeedbackRatingScale { - export type Raw = "binary"; -} diff --git a/src/serialization/types/FeedbackResponse.ts b/src/serialization/types/FeedbackResponse.ts deleted file mode 100644 index 975ea339..00000000 --- a/src/serialization/types/FeedbackResponse.ts +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; -import { FeedbackIdValue } from "./FeedbackIdValue.js"; -import { FeedbackLabel } from "./FeedbackLabel.js"; -import { FeedbackMetadata } from "./FeedbackMetadata.js"; -import { FeedbackRating } from "./FeedbackRating.js"; -import { FeedbackTarget } from "./FeedbackTarget.js"; - -export const FeedbackResponse: core.serialization.ObjectSchema< - serializers.FeedbackResponse.Raw, - Corti.FeedbackResponse -> = core.serialization.object({ - id: FeedbackIdValue, - taskId: CommonTaskIdValue, - rating: FeedbackRating, - normalizedScore: core.serialization.number(), - labels: core.serialization.list(FeedbackLabel), - reason: core.serialization.string().optional(), - target: FeedbackTarget.optional(), - metadata: FeedbackMetadata.optional(), - createdAt: core.serialization.date().optional(), -}); - -export declare namespace FeedbackResponse { - export interface Raw { - id: FeedbackIdValue.Raw; - taskId: CommonTaskIdValue.Raw; - rating: FeedbackRating.Raw; - normalizedScore: number; - labels: FeedbackLabel.Raw[]; - reason?: string | null; - target?: FeedbackTarget.Raw | null; - metadata?: FeedbackMetadata.Raw | null; - createdAt?: string | null; - } -} diff --git a/src/serialization/types/FeedbackTarget.ts b/src/serialization/types/FeedbackTarget.ts deleted file mode 100644 index fa3ed123..00000000 --- a/src/serialization/types/FeedbackTarget.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; - -export const FeedbackTarget: core.serialization.ObjectSchema = - core.serialization.object({ - messageId: CommonMessageIdValue, - }); - -export declare namespace FeedbackTarget { - export interface Raw { - messageId: CommonMessageIdValue.Raw; - } -} diff --git a/src/serialization/types/RegistryConnectorCapabilities.ts b/src/serialization/types/RegistryConnectorCapabilities.ts deleted file mode 100644 index fed6df20..00000000 --- a/src/serialization/types/RegistryConnectorCapabilities.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const RegistryConnectorCapabilities: core.serialization.ObjectSchema< - serializers.RegistryConnectorCapabilities.Raw, - Corti.RegistryConnectorCapabilities -> = core.serialization.object({ - streaming: core.serialization.boolean().optional(), - inputModes: core.serialization.list(core.serialization.string()).optional(), - outputModes: core.serialization.list(core.serialization.string()).optional(), - tools: core.serialization.list(core.serialization.string()).optional(), -}); - -export declare namespace RegistryConnectorCapabilities { - export interface Raw { - streaming?: boolean | null; - inputModes?: string[] | null; - outputModes?: string[] | null; - tools?: string[] | null; - } -} diff --git a/src/serialization/types/RegistryConnectorListResponse.ts b/src/serialization/types/RegistryConnectorListResponse.ts deleted file mode 100644 index f31cb6bb..00000000 --- a/src/serialization/types/RegistryConnectorListResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; -import { RegistryConnectorResponse } from "./RegistryConnectorResponse.js"; - -export const RegistryConnectorListResponse: core.serialization.ObjectSchema< - serializers.RegistryConnectorListResponse.Raw, - Corti.RegistryConnectorListResponse -> = core.serialization.object({ - connectors: core.serialization.list(RegistryConnectorResponse), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace RegistryConnectorListResponse { - export interface Raw { - connectors: RegistryConnectorResponse.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/RegistryConnectorResponse.ts b/src/serialization/types/RegistryConnectorResponse.ts deleted file mode 100644 index 40a2c9df..00000000 --- a/src/serialization/types/RegistryConnectorResponse.ts +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorType } from "./CommonConnectorType.js"; -import { RegistryConnectorCapabilities } from "./RegistryConnectorCapabilities.js"; -import { RegistryIcon } from "./RegistryIcon.js"; - -export const RegistryConnectorResponse: core.serialization.ObjectSchema< - serializers.RegistryConnectorResponse.Raw, - Corti.RegistryConnectorResponse -> = core.serialization.object({ - id: core.serialization.string(), - type: CommonConnectorType, - name: core.serialization.string(), - title: core.serialization.string().optional(), - description: core.serialization.string().optional(), - version: core.serialization.string().optional(), - icons: core.serialization.list(RegistryIcon).optional(), - provider: core.serialization.string().optional(), - websiteUrl: core.serialization.string().optional(), - documentationUrl: core.serialization.string().optional(), - capabilities: RegistryConnectorCapabilities.optional(), - tags: core.serialization.list(core.serialization.string()).optional(), - configSchema: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace RegistryConnectorResponse { - export interface Raw { - id: string; - type: CommonConnectorType.Raw; - name: string; - title?: string | null; - description?: string | null; - version?: string | null; - icons?: RegistryIcon.Raw[] | null; - provider?: string | null; - websiteUrl?: string | null; - documentationUrl?: string | null; - capabilities?: RegistryConnectorCapabilities.Raw | null; - tags?: string[] | null; - configSchema?: Record | null; - } -} diff --git a/src/serialization/types/RegistryIcon.ts b/src/serialization/types/RegistryIcon.ts deleted file mode 100644 index 775dc0fe..00000000 --- a/src/serialization/types/RegistryIcon.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const RegistryIcon: core.serialization.ObjectSchema = - core.serialization.object({ - src: core.serialization.string(), - mimeType: core.serialization.string().optional(), - sizes: core.serialization.list(core.serialization.string()).optional(), - }); - -export declare namespace RegistryIcon { - export interface Raw { - src: string; - mimeType?: string | null; - sizes?: string[] | null; - } -} diff --git a/src/serialization/types/UsageBucket.ts b/src/serialization/types/UsageBucket.ts deleted file mode 100644 index cd9c0006..00000000 --- a/src/serialization/types/UsageBucket.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { UsageMetrics } from "./UsageMetrics.js"; - -export const UsageBucket: core.serialization.ObjectSchema = - core.serialization - .object({ - periodStart: core.serialization.date(), - periodEnd: core.serialization.date(), - }) - .extend(UsageMetrics); - -export declare namespace UsageBucket { - export interface Raw extends UsageMetrics.Raw { - periodStart: string; - periodEnd: string; - } -} diff --git a/src/serialization/types/UsageGranularity.ts b/src/serialization/types/UsageGranularity.ts deleted file mode 100644 index 2f3edc3a..00000000 --- a/src/serialization/types/UsageGranularity.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const UsageGranularity: core.serialization.Schema = - core.serialization.enum_(["minute", "hour", "day", "week"]); - -export declare namespace UsageGranularity { - export type Raw = "minute" | "hour" | "day" | "week"; -} diff --git a/src/serialization/types/UsageMetrics.ts b/src/serialization/types/UsageMetrics.ts deleted file mode 100644 index dff2cb76..00000000 --- a/src/serialization/types/UsageMetrics.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const UsageMetrics: core.serialization.ObjectSchema = - core.serialization.object({ - invocations: core.serialization.number(), - uniqueContexts: core.serialization.number(), - }); - -export declare namespace UsageMetrics { - export interface Raw { - invocations: number; - uniqueContexts: number; - } -} diff --git a/src/serialization/types/UsageReportResponse.ts b/src/serialization/types/UsageReportResponse.ts deleted file mode 100644 index 564744e9..00000000 --- a/src/serialization/types/UsageReportResponse.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { UsageBucket } from "./UsageBucket.js"; -import { UsageGranularity } from "./UsageGranularity.js"; -import { UsageMetrics } from "./UsageMetrics.js"; - -export const UsageReportResponse: core.serialization.ObjectSchema< - serializers.UsageReportResponse.Raw, - Corti.UsageReportResponse -> = core.serialization.object({ - granularity: UsageGranularity, - from: core.serialization.date(), - to: core.serialization.date(), - totals: UsageMetrics, - buckets: core.serialization.list(UsageBucket), -}); - -export declare namespace UsageReportResponse { - export interface Raw { - granularity: UsageGranularity.Raw; - from: string; - to: string; - totals: UsageMetrics.Raw; - buckets: UsageBucket.Raw[]; - } -} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 2ffaffbc..7ce73b9e 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,17 +1,3 @@ -export * from "./A2AjsonrpcResponse.js"; -export * from "./A2AjsonrpcResponseError.js"; -export * from "./A2AjsonrpcResponseId.js"; -export * from "./A2ASendMessageConfiguration.js"; -export * from "./A2ASendMessageRequest.js"; -export * from "./A2ASendMessageResponse.js"; -export * from "./A2AStreamEventResponse.js"; -export * from "./AgentCardResponse.js"; -export * from "./AgentCardResponseCapabilities.js"; -export * from "./AgentCardResponseProvider.js"; -export * from "./AgentCardResponseSignaturesItem.js"; -export * from "./AgentCardResponseSkillsItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; export * from "./AgentsAgent.js"; export * from "./AgentsAgentCapabilities.js"; export * from "./AgentsAgentCard.js"; @@ -45,9 +31,6 @@ export * from "./AgentsFilePartFile.js"; export * from "./AgentsFilePartKind.js"; export * from "./AgentsFileWithBytes.js"; export * from "./AgentsFileWithUri.js"; -export * from "./AgentsLabels.js"; -export * from "./AgentsLifecycle.js"; -export * from "./AgentsListResponse.js"; export * from "./AgentsMcpServer.js"; export * from "./AgentsMcpServerAuthorizationType.js"; export * from "./AgentsMcpServerTransportType.js"; @@ -62,7 +45,6 @@ export * from "./AgentsRegistryExpert.js"; export * from "./AgentsRegistryExpertsResponse.js"; export * from "./AgentsRegistryMcpServer.js"; export * from "./AgentsRegistryMcpServerAuthorizationType.js"; -export * from "./AgentsResponse.js"; export * from "./AgentsTask.js"; export * from "./AgentsTaskKind.js"; export * from "./AgentsTaskStatus.js"; @@ -70,8 +52,6 @@ export * from "./AgentsTaskStatusState.js"; export * from "./AgentsTextPart.js"; export * from "./AgentsTextPartKind.js"; export * from "./AgentsUpdateExpertReference.js"; -export * from "./AgentsUserIdValue.js"; -export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -83,67 +63,20 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; -export * from "./CommonA2AConnector.js"; -export * from "./CommonA2AConnectorCreate.js"; -export * from "./CommonAgentConnector.js"; -export * from "./CommonAgentConnectorCreate.js"; -export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; -export * from "./CommonArtifactIdValue.js"; -export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; -export * from "./CommonConnectorAuth.js"; -export * from "./CommonConnectorAuthType.js"; -export * from "./CommonConnectorCreateRequest.js"; -export * from "./CommonConnectorIdValue.js"; -export * from "./CommonConnectorResponse.js"; -export * from "./CommonConnectorType.js"; -export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; -export * from "./CommonErrorResponse.js"; -export * from "./CommonErrorResponseError.js"; -export * from "./CommonErrorResponseErrorDetails.js"; -export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; -export * from "./CommonMcpConnector.js"; -export * from "./CommonMcpConnectorCreate.js"; -export * from "./CommonMessage.js"; -export * from "./CommonMessageIdValue.js"; -export * from "./CommonNextPageToken.js"; -export * from "./CommonPart.js"; -export * from "./CommonRegistryConnectorCreate.js"; -export * from "./CommonRegistryConnectorProvisioned.js"; -export * from "./CommonRole.js"; -export * from "./CommonSchemaConnector.js"; -export * from "./CommonSchemaConnectorCreate.js"; -export * from "./CommonSchemaConnectorCreateTransition.js"; -export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; -export * from "./CommonTaskIdValue.js"; -export * from "./CommonTaskListResponse.js"; -export * from "./CommonTaskMetadata.js"; -export * from "./CommonTaskResponse.js"; -export * from "./CommonTaskState.js"; -export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; -export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; -export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; -export * from "./ConnectorsListResponse.js"; -export * from "./Contexts.js"; -export * from "./ContextsDetailResponse.js"; -export * from "./ContextsListResponse.js"; -export * from "./ContextsOpenInferenceSpan.js"; -export * from "./ContextsTraceItem.js"; -export * from "./ContextsTraceItemTrace.js"; -export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -179,15 +112,6 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; -export * from "./FeedbackActor.js"; -export * from "./FeedbackIdValue.js"; -export * from "./FeedbackLabel.js"; -export * from "./FeedbackListResponse.js"; -export * from "./FeedbackMetadata.js"; -export * from "./FeedbackRating.js"; -export * from "./FeedbackRatingScale.js"; -export * from "./FeedbackResponse.js"; -export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -263,10 +187,6 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; -export * from "./RegistryConnectorCapabilities.js"; -export * from "./RegistryConnectorListResponse.js"; -export * from "./RegistryConnectorResponse.js"; -export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -353,8 +273,4 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; -export * from "./UsageBucket.js"; -export * from "./UsageGranularity.js"; -export * from "./UsageMetrics.js"; -export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/tests/unit/stream/Stream.test.ts b/tests/unit/stream/Stream.test.ts deleted file mode 100644 index 83575f07..00000000 --- a/tests/unit/stream/Stream.test.ts +++ /dev/null @@ -1,563 +0,0 @@ -import { Stream } from "../../../src/core/stream/Stream"; - -describe("Stream", () => { - describe("JSON streaming", () => { - it("should parse single JSON message", async () => { - const mockStream = createReadableStream(['{"value": 1}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should parse multiple JSON messages", async () => { - const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); - }); - - it("should handle messages split across chunks", async () => { - const mockStream = createReadableStream(['{"val', 'ue": 1}\n{"value":', " 2}\n"]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - - it("should skip empty lines", async () => { - const mockStream = createReadableStream(['{"value": 1}\n\n\n{"value": 2}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - - it("should handle custom message terminator", async () => { - const mockStream = createReadableStream(['{"value": 1}|||{"value": 2}|||']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "|||" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - }); - - describe("SSE streaming", () => { - it("should parse SSE data with prefix", async () => { - const mockStream = createReadableStream(['data: {"value": 1}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should parse multiple SSE events", async () => { - const mockStream = createReadableStream(['data: {"value": 1}\ndata: {"value": 2}\ndata: {"value": 3}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); - }); - - it("should stop at stream terminator", async () => { - const mockStream = createReadableStream(['data: {"value": 1}\ndata: [DONE]\ndata: {"value": 2}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse", streamTerminator: "[DONE]" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should skip lines without data prefix", async () => { - const mockStream = createReadableStream([ - 'event: message\ndata: {"value": 1}\nid: 123\ndata: {"value": 2}\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - }); - - describe("SSE event-level discrimination (inject discriminator)", () => { - it("should inject event type as discriminator into JSON data", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"content": "hello"}\n\nevent: completion\ndata: {"content": "world"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([ - { type: "completion", content: "hello" }, - { type: "completion", content: "world" }, - ]); - }); - - it("should inject different event types for mixed events", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"content": "hi"}\n\nevent: error\ndata: {"message": "fail"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "event" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([ - { event: "completion", content: "hi" }, - { event: "error", message: "fail" }, - ]); - }); - - it("should not inject if data already contains discriminator key", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"type": "existing", "content": "hello"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "existing", content: "hello" }]); - }); - - it("should not false-positive when discriminator key appears inside a value", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"description": "type: foo", "content": "hello"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", description: "type: foo", content: "hello" }]); - }); - - it("should not inject if no event field is present", async () => { - const mockStream = createReadableStream(['data: {"content": "hello"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ content: "hello" }]); - }); - - it("should handle empty JSON object", async () => { - const mockStream = createReadableStream(["event: heartbeat\ndata: {}\n\n"]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "heartbeat" }]); - }); - - it("should stop at stream terminator", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"content": "hi"}\n\nevent: done\ndata: [DONE]\n\nevent: completion\ndata: {"content": "bye"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type", streamTerminator: "[DONE]" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", content: "hi" }]); - }); - - it("should concatenate multiline data fields", async () => { - const mockStream = createReadableStream(['event: completion\ndata: {"delta":\ndata: "hello"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", delta: "hello" }]); - }); - - it("should handle events split across chunks", async () => { - const mockStream = createReadableStream(["event: comple", 'tion\ndata: {"con', 'tent": "hi"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", content: "hi" }]); - }); - - it("should handle last event without trailing blank line", async () => { - const mockStream = createReadableStream(['event: completion\ndata: {"content": "hi"}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", content: "hi" }]); - }); - - it("should handle CRLF line endings", async () => { - const mockStream = createReadableStream([ - 'event: completion\r\ndata: {"content": "hi"}\r\n\r\nevent: completion\r\ndata: {"content": "world"}\r\n\r\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([ - { type: "completion", content: "hi" }, - { type: "completion", content: "world" }, - ]); - }); - - it("should inject empty string discriminator when event field is present but empty", async () => { - const mockStream = createReadableStream(['event: \ndata: {"content": "hello"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "", content: "hello" }]); - }); - }); - - describe("encoding and decoding", () => { - it("should decode UTF-8 text using TextDecoder", async () => { - const encoder = new TextEncoder(); - const mockStream = createReadableStream([encoder.encode('{"text": "café"}\n')]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { text: string }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ text: "café" }]); - }); - - it("should decode emoji correctly", async () => { - const encoder = new TextEncoder(); - const mockStream = createReadableStream([encoder.encode('{"emoji": "🎉"}\n')]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { emoji: string }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ emoji: "🎉" }]); - }); - - it("should handle binary data chunks", async () => { - const encoder = new TextEncoder(); - const mockStream = createReadableStream([encoder.encode('{"val'), encoder.encode('ue": 1}\n')]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should handle multi-byte UTF-8 characters split across chunk boundaries", async () => { - // Test string with Japanese (3 bytes), Russian (2 bytes), German (2 bytes), and Chinese (3 bytes) - const testString = '{"text": "こんにちは Привет Größe 你好"}\n'; - const fullBytes = new TextEncoder().encode(testString); - - // Split the bytes in the middle of multi-byte characters - // Japanese "こ" starts at byte 11, is 3 bytes (E3 81 93) - // Split after first byte of "こ" to test mid-character splitting - const splitPoint = 12; // This splits "こ" in the middle - const chunk1 = fullBytes.slice(0, splitPoint); - const chunk2 = fullBytes.slice(splitPoint); - - const mockStream = createReadableStream([chunk1, chunk2]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { text: string }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ text: "こんにちは Привет Größe 你好" }]); - }); - }); - - describe("abort signal", () => { - it("should handle abort signal", async () => { - const controller = new AbortController(); - const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - signal: controller.signal, - }); - - const messages: unknown[] = []; - let count = 0; - for await (const message of stream) { - messages.push(message); - count++; - if (count === 2) { - controller.abort(); - break; - } - } - - expect(messages.length).toBe(2); - }); - }); - - describe("async iteration", () => { - it("should support async iterator protocol", async () => { - const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const iterator = stream[Symbol.asyncIterator](); - const first = await iterator.next(); - expect(first.done).toBe(false); - expect(first.value).toEqual({ value: 1 }); - - const second = await iterator.next(); - expect(second.done).toBe(false); - expect(second.value).toEqual({ value: 2 }); - - const third = await iterator.next(); - expect(third.done).toBe(true); - }); - }); - - describe("edge cases", () => { - it("should handle empty stream", async () => { - const mockStream = createReadableStream([]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([]); - }); - - it("should handle stream with only whitespace", async () => { - const mockStream = createReadableStream([" \n\n\t\n "]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([]); - }); - - it("should handle incomplete message at end of stream", async () => { - const mockStream = createReadableStream(['{"value": 1}\n{"incomplete']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - }); -}); - -// Helper function to create a ReadableStream from string chunks -function createReadableStream(chunks: (string | Uint8Array)[]): ReadableStream { - // For standard type, return ReadableStream - let index = 0; - return new ReadableStream({ - pull(controller) { - if (index < chunks.length) { - const chunk = chunks[index++]; - controller.enqueue(typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk); - } else { - controller.close(); - } - }, - }); -} diff --git a/tests/wire/agentic.test.ts b/tests/wire/agentic.test.ts deleted file mode 100644 index 1c5444ca..00000000 --- a/tests/wire/agentic.test.ts +++ /dev/null @@ -1,1089 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../src/api/index"; -import { CortiClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; -import { mockOAuth } from "./mockAuth"; - -describe("AgenticClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - agents: [ - { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "description", - systemPrompt: "systemPrompt", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - labels: { key: "value" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint({ once: false }) - .get("/v2/agentic/agents") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - agents: [ - { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "description", - systemPrompt: "systemPrompt", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - labels: { - key: "value", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - const page = await client.agentic.list({ - label: ["team=coding"], - q: "coder", - }); - - expect(expected.agents).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.agents).toEqual(nextPage.data); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.agentic.list(); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.agentic.list(); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("create (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { type: "registry", name: "@dedalus/coding-expert" }, - { - type: "mcp", - name: "policybot", - url: "https://mcp.example.com", - auth: { - type: "oauth2", - scope: "read:policies", - redirectUrl: "https://app.corti.ai/oauth/callback", - }, - }, - { - type: "schema", - name: "submit_code", - description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - schema: { - type: "object", - properties: { - code: { type: "string", description: "The selected ICD-10 code." }, - confidence: { type: "number", minimum: 0, maximum: 1 }, - }, - required: ["code"], - }, - transition: "complete", - }, - ], - labels: { team: "coding", env: "prod" }, - }; - const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.create({ - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - type: "registry", - name: "@dedalus/coding-expert", - }, - { - type: "mcp", - name: "policybot", - url: "https://mcp.example.com", - auth: { - type: "oauth2", - scope: "read:policies", - redirectUrl: "https://app.corti.ai/oauth/callback", - }, - }, - { - type: "schema", - name: "submit_code", - description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - schema: { - type: "object", - properties: { - code: { - type: "string", - description: "The selected ICD-10 code.", - }, - confidence: { - type: "number", - minimum: 0, - maximum: 1, - }, - }, - required: ["code"], - }, - transition: "complete", - }, - ], - labels: { - team: "coding", - env: "prod", - }, - }); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }); - }); - - test("create (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.ConflictError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.UnprocessableEntityError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.get("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.get("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.get("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("delete (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual(undefined); - }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.delete("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.delete("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.delete("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "coder-v2", connectors: [{ type: "registry", name: "@dedalus/coding-expert" }] }; - const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - name: "coder-v2", - connectors: [ - { - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - }); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }); - }); - - test("update (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.UnprocessableEntityError); - }); - - test("getCard (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - documentationUrl: "documentationUrl", - iconUrl: "iconUrl", - version: "0.1.0", - capabilities: { streaming: true, pushNotifications: false }, - defaultInputModes: ["text/plain"], - defaultOutputModes: ["text/plain"], - provider: { organization: "Corti", url: "https://corti.ai" }, - securityRequirements: [{ key: "value" }], - securitySchemes: { key: "value" }, - signatures: [{ protected: "protected", header: { key: "value" }, signature: "signature" }], - skills: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - name: "coding-expert", - description: "ICD-10 coding.", - tags: ["expert"], - }, - ], - supportedInterfaces: [ - { - protocolBinding: "JSONRPC", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - { - protocolBinding: "HTTP+JSON", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/.well-known/agent-card.json") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual({ - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - documentationUrl: "documentationUrl", - iconUrl: "iconUrl", - version: "0.1.0", - capabilities: { - streaming: true, - pushNotifications: false, - }, - defaultInputModes: ["text/plain"], - defaultOutputModes: ["text/plain"], - provider: { - organization: "Corti", - url: "https://corti.ai", - }, - securityRequirements: [ - { - key: "value", - }, - ], - securitySchemes: { - key: "value", - }, - signatures: [ - { - protected: "protected", - header: { - key: "value", - }, - signature: "signature", - }, - ], - skills: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - name: "coding-expert", - description: "ICD-10 coding.", - tags: ["expert"], - }, - ], - supportedInterfaces: [ - { - protocolBinding: "JSONRPC", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - { - protocolBinding: "HTTP+JSON", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - ], - }); - }); - - test("getCard (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.getCard("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("getCard (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.getCard("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/a2A.test.ts b/tests/wire/agentic/a2A.test.ts deleted file mode 100644 index f538c0d9..00000000 --- a/tests/wire/agentic/a2A.test.ts +++ /dev/null @@ -1,528 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("A2AClient", () => { - test("jsonRpc (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - jsonrpc: "2.0", - id: "1", - method: "SendMessage", - params: { - message: { - role: "ROLE_USER", - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - parts: [{ text: "Code this encounter." }], - }, - }, - }; - const rawResponseBody = { - jsonrpc: "2.0", - id: "msg-001", - result: { - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { state: "TASK_STATE_COMPLETED" }, - }, - }, - error: { code: -32600, message: "Invalid Request", data: { key: "value" } }, - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - id: "1", - method: "SendMessage", - params: { - message: { - role: "ROLE_USER", - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - parts: [ - { - text: "Code this encounter.", - }, - ], - }, - }, - }); - expect(response).toEqual({ - jsonrpc: "2.0", - id: "msg-001", - result: { - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - }, - }, - }, - error: { - code: -32600, - message: "Invalid Request", - data: { - key: "value", - }, - }, - }); - }); - - test("jsonRpc (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.jsonRpc("agentId", { - id: "id", - method: "SendMessage", - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("jsonRpc (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.jsonRpc("agentId", { - id: "id", - method: "SendMessage", - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("sendMessage (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [{ text: "What is the ICD-10 code for asthma?" }], - }, - }; - const rawResponseBody = { - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - timestamp: "2026-05-19T12:00:01Z", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - }, - }, - artifacts: [{ artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", parts: [{ text: "J45.909" }] }], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [ - { - text: "What is the ICD-10 code for asthma?", - }, - ], - }, - }); - expect(response).toEqual({ - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - timestamp: "2026-05-19T12:00:01Z", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - }, - }, - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - }); - }); - - test("sendMessage (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.sendMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("sendMessage (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.sendMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("sendMessage (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.sendMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("streamMessage (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [{ text: "What is the ICD-10 code for asthma?" }], - }, - }; - const rawResponseBody = - 'event: \ndata: {"data":"{\\"task\\":{\\"id\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_WORKING\\"}}}","event":"message","id":"id","retry":1}\n\n'; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .sseBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.streamMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [ - { - text: "What is the ICD-10 code for asthma?", - }, - ], - }, - }); - const events: unknown[] = []; - for await (const event of response) { - events.push(event); - } - expect(events).toEqual([ - { - data: '{"task":{"id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_WORKING"}}}', - event: "message", - id: "id", - retry: 1, - }, - ]); - }); - - test("streamMessage (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.streamMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("streamMessage (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.streamMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("streamMessage (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.streamMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/a2A/tasks.test.ts b/tests/wire/agentic/a2A/tasks.test.ts deleted file mode 100644 index 37719b87..00000000 --- a/tests/wire/agentic/a2A/tasks.test.ts +++ /dev/null @@ -1,706 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../../src/api/index"; -import { CortiClient } from "../../../../src/Client"; -import { mockServerPool } from "../../../mock-server/MockServerPool"; -import { mockOAuth } from "../../mockAuth"; - -describe("TasksClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint({ once: false }) - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - const page = await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - - expect(expected.tasks).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.tasks).toEqual(nextPage.data); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/a2a/tasks") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.list("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ) - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.tasks.get( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.get("agentId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.get("agentId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("cancel (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }; - - server - .mockEndpoint() - .post( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:cancel", - ) - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.tasks.cancel( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }); - }); - - test("cancel (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("cancel (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("cancel (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); - }).rejects.toThrow(Corti.ConflictError); - }); - - test("subscribe (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = - 'event: \ndata: {"data":"{\\"statusUpdate\\":{\\"taskId\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_COMPLETED\\",\\"timestamp\\":\\"2026-05-19T12:00:01Z\\"}}}","event":"event","id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","retry":1}\n\n'; - - server - .mockEndpoint() - .post( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:subscribe", - ) - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .sseBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.tasks.subscribe( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - const events: unknown[] = []; - for await (const event of response) { - events.push(event); - } - expect(events).toEqual([ - { - data: '{"statusUpdate":{"taskId":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_COMPLETED","timestamp":"2026-05-19T12:00:01Z"}}}', - event: "event", - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - retry: 1, - }, - ]); - }); - - test("subscribe (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("subscribe (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/artifacts.test.ts b/tests/wire/agentic/artifacts.test.ts deleted file mode 100644 index ef140243..00000000 --- a/tests/wire/agentic/artifacts.test.ts +++ /dev/null @@ -1,161 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("ArtifactsClient", () => { - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [ - { - text: "J45.909", - data: { key: "value" }, - filename: "filename", - mediaType: "mediaType", - raw: "raw", - url: "url", - metadata: { key: "value" }, - }, - ], - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/artifacts/art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.artifacts.get( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - ); - expect(response).toEqual({ - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - data: { - key: "value", - }, - filename: "filename", - mediaType: "mediaType", - raw: "raw", - url: "url", - metadata: { - key: "value", - }, - }, - ], - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/connectors.test.ts b/tests/wire/agentic/connectors.test.ts deleted file mode 100644 index 22533425..00000000 --- a/tests/wire/agentic/connectors.test.ts +++ /dev/null @@ -1,620 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("ConnectorsClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual({ - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.list("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.list("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("attach (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "@dedalus/coding-expert" }; - const rawResponseBody = { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - type: "registry", - name: "@dedalus/coding-expert", - }); - expect(response).toEqual({ - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }); - }); - - test("attach (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("attach (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("attach (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("attach (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.ConflictError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.get( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ); - expect(response).toEqual({ - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.get("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.get("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("remove (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.connectors.remove( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ); - expect(response).toEqual(undefined); - }); - - test("remove (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.remove("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("remove (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.remove("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { enabled: false }; - const rawResponseBody = { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }; - - server - .mockEndpoint() - .patch( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ) - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.update( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - { - enabled: false, - }, - ); - expect(response).toEqual({ - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }); - }); - - test("update (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { error: { code: "code", message: "message" } }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(501) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotImplementedError); - }); -}); diff --git a/tests/wire/agentic/contexts.test.ts b/tests/wire/agentic/contexts.test.ts deleted file mode 100644 index ebbbf710..00000000 --- a/tests/wire/agentic/contexts.test.ts +++ /dev/null @@ -1,533 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("ContextsClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - contexts: [ - { - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - expiresAt: "2024-01-15T09:30:00Z", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint({ once: false }) - .get("/v2/agentic/contexts") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - contexts: [ - { - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - expiresAt: new Date("2024-01-15T09:30:00.000Z"), - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - const page = await client.agentic.contexts.list(); - - expect(expected.contexts).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.contexts).toEqual(nextPage.data); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.list(); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:01Z", - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{ text: "Code this encounter: acute asthma exacerbation." }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.901" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [{ text: "J45.901" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - expect(response).toEqual({ - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:01.000Z"), - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [ - { - text: "Code this encounter: acute asthma exacerbation.", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.901", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [ - { - text: "J45.901", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.get("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.get("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("delete (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - expect(response).toEqual(undefined); - }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.delete("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.delete("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("getTrace (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - traces: [ - { - trace: { - id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", - name: "invoke_agent", - start_time: "2026-05-19T12:00:00Z", - thread_id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - }, - spans: [ - { - name: "invoke_llm", - span_id: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", - start_time: "2026-05-19T12:00:00Z", - }, - ], - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint({ once: false }) - .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/trace") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - traces: [ - { - trace: { - id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", - name: "invoke_agent", - startTime: new Date("2026-05-19T12:00:00.000Z"), - threadId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - }, - spans: [ - { - name: "invoke_llm", - spanId: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", - startTime: new Date("2026-05-19T12:00:00.000Z"), - }, - ], - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - const page = await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - - expect(expected.traces).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.traces).toEqual(nextPage.data); - }); - - test("getTrace (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/trace") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.getTrace("contextId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("getTrace (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/trace") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.getTrace("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("getTrace (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/trace") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.getTrace("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/contexts/tasks.test.ts b/tests/wire/agentic/contexts/tasks.test.ts deleted file mode 100644 index b0d73b0a..00000000 --- a/tests/wire/agentic/contexts/tasks.test.ts +++ /dev/null @@ -1,398 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../../src/api/index"; -import { CortiClient } from "../../../../src/Client"; -import { mockServerPool } from "../../../mock-server/MockServerPool"; -import { mockOAuth } from "../../mockAuth"; - -describe("TasksClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint({ once: false }) - .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - const page = await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - - expect(expected.tasks).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.tasks).toEqual(nextPage.data); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.list("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.list("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.contexts.tasks.get( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.get("contextId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.get("contextId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/feedback.test.ts b/tests/wire/agentic/feedback.test.ts deleted file mode 100644 index e7ac46f0..00000000 --- a/tests/wire/agentic/feedback.test.ts +++ /dev/null @@ -1,456 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("FeedbackClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - feedbacks: [ - { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { scale: "binary", value: 1 }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { collectionMethod: "thumbs" }, - createdAt: "2026-05-19T12:00:00Z", - }, - ], - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.feedback.list( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - feedbacks: [ - { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { - scale: "binary", - value: 1, - }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "thumbs", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - }, - ], - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.list("contextId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.list("contextId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("create (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1 } }; - const rawResponseBody = { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { scale: "binary", value: 1 }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { externalId: "externalId" }, - }, - createdAt: "2026-05-19T12:00:00Z", - }; - - server - .mockEndpoint() - .post( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", - ) - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.feedback.create( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - { - rating: { - scale: "binary", - value: 1, - }, - }, - ); - expect(response).toEqual({ - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { - scale: "binary", - value: 1, - }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { - externalId: "externalId", - }, - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - }); - }); - - test("create (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - rating: { scale: "binary", value: 0 }, - labels: ["unsupportedClaim"], - reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { - collectionMethod: "caseReview", - clientReference: "case-review-728193", - actor: { externalId: "clinician_4182" }, - }, - }; - const rawResponseBody = { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { scale: "binary", value: 1 }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { externalId: "externalId" }, - }, - createdAt: "2026-05-19T12:00:00Z", - }; - - server - .mockEndpoint() - .post( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", - ) - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.feedback.create( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - { - rating: { - scale: "binary", - value: 0, - }, - labels: ["unsupportedClaim"], - reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "caseReview", - clientReference: "case-review-728193", - actor: { - externalId: "clinician_4182", - }, - }, - }, - ); - expect(response).toEqual({ - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { - scale: "binary", - value: 1, - }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { - externalId: "externalId", - }, - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - }); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.UnprocessableEntityError); - }); - - test("delete", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", - ) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.feedback.delete( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual(undefined); - }); -}); diff --git a/tests/wire/agentic/registry.test.ts b/tests/wire/agentic/registry.test.ts deleted file mode 100644 index 7a353ce4..00000000 --- a/tests/wire/agentic/registry.test.ts +++ /dev/null @@ -1,244 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("RegistryClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - connectors: [ - { - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "description", - version: "1.4.2", - icons: [{ src: "src", mimeType: "image/svg+xml", sizes: ["48x48"] }], - provider: "Dedalus", - websiteUrl: "websiteUrl", - documentationUrl: "documentationUrl", - tags: ["tags"], - configSchema: { key: "value" }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint({ once: false }) - .get("/v2/agentic/registry/connectors") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - connectors: [ - { - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "description", - version: "1.4.2", - icons: [ - { - src: "src", - mimeType: "image/svg+xml", - sizes: ["48x48"], - }, - ], - provider: "Dedalus", - websiteUrl: "websiteUrl", - documentationUrl: "documentationUrl", - tags: ["tags"], - configSchema: { - key: "value", - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - const page = await client.agentic.registry.list(); - - expect(expected.connectors).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.connectors).toEqual(nextPage.data); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.registry.list(); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "Returns ICD-10 codes for a clinical encounter.", - version: "1.4.2", - icons: [ - { - src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", - mimeType: "image/svg+xml", - sizes: ["any"], - }, - ], - provider: "Dedalus", - websiteUrl: "https://dedalus.example.com/coding-expert", - documentationUrl: "https://docs.dedalus.example.com/coding-expert", - capabilities: { - streaming: true, - inputModes: ["text/plain"], - outputModes: ["text/plain", "application/json"], - tools: ["lookup_icd10", "validate_code"], - }, - tags: ["icd10", "billing", "expert"], - configSchema: { key: "value" }, - }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors/connectorId") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.registry.get("connectorId"); - expect(response).toEqual({ - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "Returns ICD-10 codes for a clinical encounter.", - version: "1.4.2", - icons: [ - { - src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", - mimeType: "image/svg+xml", - sizes: ["any"], - }, - ], - provider: "Dedalus", - websiteUrl: "https://dedalus.example.com/coding-expert", - documentationUrl: "https://docs.dedalus.example.com/coding-expert", - capabilities: { - streaming: true, - inputModes: ["text/plain"], - outputModes: ["text/plain", "application/json"], - tools: ["lookup_icd10", "validate_code"], - }, - tags: ["icd10", "billing", "expert"], - configSchema: { - key: "value", - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors/connectorId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.registry.get("connectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors/connectorId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.registry.get("connectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/usage.test.ts b/tests/wire/agentic/usage.test.ts deleted file mode 100644 index c7586319..00000000 --- a/tests/wire/agentic/usage.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("UsageClient", () => { - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - granularity: "day", - from: "2026-05-19T00:00:00Z", - to: "2026-05-21T00:00:00Z", - totals: { invocations: 15, uniqueContexts: 6 }, - buckets: [ - { - invocations: 12, - uniqueContexts: 5, - periodStart: "2026-05-19T00:00:00Z", - periodEnd: "2026-05-20T00:00:00Z", - }, - { - invocations: 3, - uniqueContexts: 2, - periodStart: "2026-05-20T00:00:00Z", - periodEnd: "2026-05-21T00:00:00Z", - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/usage") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - from: new Date("2026-05-19T00:00:00.000Z"), - to: new Date("2026-05-20T00:00:00.000Z"), - }); - expect(response).toEqual({ - granularity: "day", - from: new Date("2026-05-19T00:00:00.000Z"), - to: new Date("2026-05-21T00:00:00.000Z"), - totals: { - invocations: 15, - uniqueContexts: 6, - }, - buckets: [ - { - invocations: 12, - uniqueContexts: 5, - periodStart: new Date("2026-05-19T00:00:00.000Z"), - periodEnd: new Date("2026-05-20T00:00:00.000Z"), - }, - { - invocations: 3, - uniqueContexts: 2, - periodStart: new Date("2026-05-20T00:00:00.000Z"), - periodEnd: new Date("2026-05-21T00:00:00.000Z"), - }, - ], - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/usage") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.usage.get("agentId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/usage") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.usage.get("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/usage") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.usage.get("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); From a8b7c50023efaa81cce0f0f78acc4ee16ed83f43 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 14:30:44 +0000 Subject: [PATCH 10/18] SDK regeneration --- .fern/metadata.json | 2 +- src/Client.ts | 6 + src/api/errors/NotImplementedError.ts | 22 + src/api/errors/index.ts | 1 + src/api/resources/agentic/client/Client.ts | 654 ++++++++++ src/api/resources/agentic/client/index.ts | 1 + .../client/requests/AgentsCreateRequest.ts | 69 ++ .../client/requests/AgentsPatchRequest.ts | 30 + .../client/requests/ListAgenticRequest.ts | 25 + .../agentic/client/requests/index.ts | 3 + src/api/resources/agentic/index.ts | 2 + .../agentic/resources/a2A/client/Client.ts | 345 ++++++ .../agentic/resources/a2A/client/index.ts | 1 + .../a2A/client/requests/A2AjsonrpcRequest.ts | 29 + .../resources/a2A/client/requests/index.ts | 1 + .../resources/agentic/resources/a2A/index.ts | 3 + .../agentic/resources/a2A/resources/index.ts | 2 + .../a2A/resources/tasks/client/Client.ts | 382 ++++++ .../a2A/resources/tasks/client/index.ts | 1 + .../tasks/client/requests/GetTasksRequest.ts | 10 + .../tasks/client/requests/ListTasksRequest.ts | 14 + .../resources/tasks/client/requests/index.ts | 2 + .../resources/a2A/resources/tasks/index.ts | 1 + .../a2A/types/A2AjsonrpcRequestId.ts | 3 + .../a2A/types/A2AjsonrpcRequestMethod.ts | 12 + .../agentic/resources/a2A/types/index.ts | 2 + .../resources/artifacts/client/Client.ts | 115 ++ .../resources/artifacts/client/index.ts | 1 + .../agentic/resources/artifacts/index.ts | 1 + .../resources/connectors/client/Client.ts | 467 +++++++ .../resources/connectors/client/index.ts | 1 + .../client/requests/ConnectorsPatchRequest.ts | 21 + .../connectors/client/requests/index.ts | 1 + .../agentic/resources/connectors/index.ts | 1 + .../resources/contexts/client/Client.ts | 368 ++++++ .../resources/contexts/client/index.ts | 1 + .../client/requests/GetContextsRequest.ts | 10 + .../requests/GetTraceContextsRequest.ts | 12 + .../client/requests/ListContextsRequest.ts | 18 + .../contexts/client/requests/index.ts | 3 + .../agentic/resources/contexts/index.ts | 2 + .../resources/contexts/resources/index.ts | 2 + .../contexts/resources/tasks/client/Client.ts | 196 +++ .../contexts/resources/tasks/client/index.ts | 1 + .../tasks/client/requests/ListTasksRequest.ts | 12 + .../resources/tasks/client/requests/index.ts | 1 + .../contexts/resources/tasks/index.ts | 1 + .../resources/feedback/client/Client.ts | 313 +++++ .../resources/feedback/client/index.ts | 1 + .../client/requests/FeedbackCreateRequest.ts | 49 + .../feedback/client/requests/index.ts | 1 + .../agentic/resources/feedback/index.ts | 1 + src/api/resources/agentic/resources/index.ts | 14 + .../resources/registry/client/Client.ts | 185 +++ .../resources/registry/client/index.ts | 1 + .../client/requests/ListRegistryRequest.ts | 17 + .../registry/client/requests/index.ts | 1 + .../agentic/resources/registry/index.ts | 1 + .../agentic/resources/usage/client/Client.ts | 131 ++ .../agentic/resources/usage/client/index.ts | 1 + .../usage/client/requests/GetUsageRequest.ts | 25 + .../resources/usage/client/requests/index.ts | 1 + .../agentic/resources/usage/index.ts | 1 + src/api/resources/index.ts | 2 + src/api/types/A2ASendMessageConfiguration.ts | 13 + src/api/types/A2ASendMessageRequest.ts | 15 + src/api/types/A2ASendMessageResponse.ts | 6 + src/api/types/A2AStreamEventResponse.ts | 18 + src/api/types/A2AjsonrpcResponse.ts | 16 + src/api/types/A2AjsonrpcResponseError.ts | 13 + src/api/types/A2AjsonrpcResponseId.ts | 3 + src/api/types/AgentCardResponse.ts | 37 + .../types/AgentCardResponseCapabilities.ts | 14 + src/api/types/AgentCardResponseProvider.ts | 11 + .../types/AgentCardResponseSignaturesItem.ts | 10 + src/api/types/AgentCardResponseSkillsItem.ts | 12 + ...gentCardResponseSupportedInterfacesItem.ts | 12 + ...eSupportedInterfacesItemProtocolBinding.ts | 9 + src/api/types/AgentsLabels.ts | 6 + src/api/types/AgentsLifecycle.ts | 11 + src/api/types/AgentsListResponse.ts | 13 + src/api/types/AgentsResponse.ts | 32 + src/api/types/AgentsUserIdValue.ts | 6 + src/api/types/AgentsVisibility.ts | 13 + src/api/types/CommonA2AConnector.ts | 22 + src/api/types/CommonA2AConnectorCreate.ts | 14 + src/api/types/CommonAgentConnector.ts | 19 + src/api/types/CommonAgentConnectorCreate.ts | 13 + src/api/types/CommonAgentIdValue.ts | 6 + src/api/types/CommonArtifactIdValue.ts | 6 + src/api/types/CommonArtifactResponse.ts | 20 + src/api/types/CommonConnectorAuth.ts | 17 + src/api/types/CommonConnectorAuthType.ts | 10 + src/api/types/CommonConnectorCreateRequest.ts | 13 + src/api/types/CommonConnectorIdValue.ts | 6 + src/api/types/CommonConnectorResponse.ts | 13 + src/api/types/CommonConnectorType.ts | 15 + src/api/types/CommonContextIdValue.ts | 6 + src/api/types/CommonErrorResponse.ts | 24 + src/api/types/CommonErrorResponseError.ts | 25 + .../types/CommonErrorResponseErrorDetails.ts | 14 + ...esponseErrorDetailsValidationErrorsItem.ts | 8 + src/api/types/CommonMcpConnector.ts | 23 + src/api/types/CommonMcpConnectorCreate.ts | 17 + src/api/types/CommonMessage.ts | 27 + src/api/types/CommonMessageIdValue.ts | 6 + src/api/types/CommonNextPageToken.ts | 6 + src/api/types/CommonPart.ts | 23 + .../types/CommonRegistryConnectorCreate.ts | 14 + .../CommonRegistryConnectorProvisioned.ts | 22 + src/api/types/CommonRole.ts | 8 + src/api/types/CommonSchemaConnector.ts | 26 + src/api/types/CommonSchemaConnectorCreate.ts | 20 + .../CommonSchemaConnectorCreateTransition.ts | 9 + .../types/CommonSchemaConnectorTransition.ts | 9 + src/api/types/CommonTaskIdValue.ts | 6 + src/api/types/CommonTaskListResponse.ts | 15 + src/api/types/CommonTaskMetadata.ts | 15 + src/api/types/CommonTaskResponse.ts | 18 + src/api/types/CommonTaskState.ts | 14 + src/api/types/CommonTaskStatus.ts | 13 + src/api/types/CommonTotalSize.ts | 6 + src/api/types/CommonUsage.ts | 27 + src/api/types/ConnectorsListResponse.ts | 11 + src/api/types/Contexts.ts | 19 + src/api/types/ContextsDetailResponse.ts | 14 + src/api/types/ContextsListResponse.ts | 13 + src/api/types/ContextsOpenInferenceSpan.ts | 19 + src/api/types/ContextsTraceItem.ts | 13 + src/api/types/ContextsTraceItemTrace.ts | 25 + src/api/types/ContextsTraceResponse.ts | 14 + src/api/types/FeedbackActor.ts | 14 + src/api/types/FeedbackIdValue.ts | 6 + src/api/types/FeedbackLabel.ts | 37 + src/api/types/FeedbackListResponse.ts | 11 + src/api/types/FeedbackMetadata.ts | 18 + src/api/types/FeedbackRating.ts | 12 + src/api/types/FeedbackRatingScale.ts | 12 + src/api/types/FeedbackResponse.ts | 25 + src/api/types/FeedbackTarget.ts | 11 + .../types/RegistryConnectorCapabilities.ts | 15 + .../types/RegistryConnectorListResponse.ts | 13 + src/api/types/RegistryConnectorResponse.ts | 35 + src/api/types/RegistryIcon.ts | 13 + src/api/types/UsageBucket.ts | 13 + src/api/types/UsageGranularity.ts | 10 + src/api/types/UsageMetrics.ts | 11 + src/api/types/UsageReportResponse.ts | 18 + src/api/types/index.ts | 84 ++ src/core/index.ts | 1 + src/core/stream/Stream.ts | 235 ++++ src/core/stream/index.ts | 1 + .../resources/agentic/client/index.ts | 1 + .../client/requests/AgentsCreateRequest.ts | 36 + .../client/requests/AgentsPatchRequest.ts | 37 + .../agentic/client/requests/index.ts | 2 + src/serialization/resources/agentic/index.ts | 2 + .../agentic/resources/a2A/client/index.ts | 1 + .../a2A/client/requests/A2AjsonrpcRequest.ts | 24 + .../resources/a2A/client/requests/index.ts | 1 + .../resources/agentic/resources/a2A/index.ts | 2 + .../a2A/types/A2AjsonrpcRequestId.ts | 14 + .../a2A/types/A2AjsonrpcRequestMethod.ts | 27 + .../agentic/resources/a2A/types/index.ts | 2 + .../resources/connectors/client/index.ts | 1 + .../client/requests/ConnectorsPatchRequest.ts | 27 + .../connectors/client/requests/index.ts | 1 + .../agentic/resources/connectors/index.ts | 1 + .../resources/feedback/client/index.ts | 1 + .../client/requests/FeedbackCreateRequest.ts | 30 + .../feedback/client/requests/index.ts | 1 + .../agentic/resources/feedback/index.ts | 1 + .../resources/agentic/resources/index.ts | 7 + src/serialization/resources/index.ts | 2 + .../types/A2ASendMessageConfiguration.ts | 22 + .../types/A2ASendMessageRequest.ts | 26 + .../types/A2ASendMessageResponse.ts | 14 + .../types/A2AStreamEventResponse.ts | 24 + src/serialization/types/A2AjsonrpcResponse.ts | 26 + .../types/A2AjsonrpcResponseError.ts | 22 + .../types/A2AjsonrpcResponseId.ts | 14 + src/serialization/types/AgentCardResponse.ts | 51 + .../types/AgentCardResponseCapabilities.ts | 20 + .../types/AgentCardResponseProvider.ts | 20 + .../types/AgentCardResponseSignaturesItem.ts | 22 + .../types/AgentCardResponseSkillsItem.ts | 24 + ...gentCardResponseSupportedInterfacesItem.ts | 23 + ...eSupportedInterfacesItemProtocolBinding.ts | 14 + src/serialization/types/AgentsLabels.ts | 12 + src/serialization/types/AgentsLifecycle.ts | 12 + src/serialization/types/AgentsListResponse.ts | 25 + src/serialization/types/AgentsResponse.ts | 44 + src/serialization/types/AgentsUserIdValue.ts | 12 + src/serialization/types/AgentsVisibility.ts | 12 + src/serialization/types/CommonA2AConnector.ts | 27 + .../types/CommonA2AConnectorCreate.ts | 24 + .../types/CommonAgentConnector.ts | 26 + .../types/CommonAgentConnectorCreate.ts | 23 + src/serialization/types/CommonAgentIdValue.ts | 14 + .../types/CommonArtifactIdValue.ts | 14 + .../types/CommonArtifactResponse.ts | 30 + .../types/CommonConnectorAuth.ts | 25 + .../types/CommonConnectorAuthType.ts | 14 + .../types/CommonConnectorCreateRequest.ts | 30 + .../types/CommonConnectorIdValue.ts | 14 + .../types/CommonConnectorResponse.ts | 30 + .../types/CommonConnectorType.ts | 14 + .../types/CommonContextIdValue.ts | 14 + .../types/CommonErrorResponse.ts | 19 + .../types/CommonErrorResponseError.ts | 27 + .../types/CommonErrorResponseErrorDetails.ts | 22 + ...esponseErrorDetailsValidationErrorsItem.ts | 20 + src/serialization/types/CommonMcpConnector.ts | 30 + .../types/CommonMcpConnectorCreate.ts | 27 + src/serialization/types/CommonMessage.ts | 35 + .../types/CommonMessageIdValue.ts | 14 + .../types/CommonNextPageToken.ts | 14 + src/serialization/types/CommonPart.ts | 31 + .../types/CommonRegistryConnectorCreate.ts | 24 + .../CommonRegistryConnectorProvisioned.ts | 27 + src/serialization/types/CommonRole.ts | 12 + .../types/CommonSchemaConnector.ts | 32 + .../types/CommonSchemaConnectorCreate.ts | 29 + .../CommonSchemaConnectorCreateTransition.ts | 14 + .../types/CommonSchemaConnectorTransition.ts | 14 + src/serialization/types/CommonTaskIdValue.ts | 12 + .../types/CommonTaskListResponse.ts | 27 + src/serialization/types/CommonTaskMetadata.ts | 22 + src/serialization/types/CommonTaskResponse.ts | 34 + src/serialization/types/CommonTaskState.ts | 29 + src/serialization/types/CommonTaskStatus.ts | 24 + src/serialization/types/CommonTotalSize.ts | 12 + src/serialization/types/CommonUsage.ts | 28 + .../types/ConnectorsListResponse.ts | 19 + src/serialization/types/Contexts.ts | 28 + .../types/ContextsDetailResponse.ts | 22 + .../types/ContextsListResponse.ts | 25 + .../types/ContextsOpenInferenceSpan.ts | 28 + src/serialization/types/ContextsTraceItem.ts | 22 + .../types/ContextsTraceItemTrace.ts | 34 + .../types/ContextsTraceResponse.ts | 25 + src/serialization/types/FeedbackActor.ts | 16 + src/serialization/types/FeedbackIdValue.ts | 12 + src/serialization/types/FeedbackLabel.ts | 41 + .../types/FeedbackListResponse.ts | 19 + src/serialization/types/FeedbackMetadata.ts | 23 + src/serialization/types/FeedbackRating.ts | 19 + .../types/FeedbackRatingScale.ts | 14 + src/serialization/types/FeedbackResponse.ts | 40 + src/serialization/types/FeedbackTarget.ts | 17 + .../types/RegistryConnectorCapabilities.ts | 24 + .../types/RegistryConnectorListResponse.ts | 25 + .../types/RegistryConnectorResponse.ts | 45 + src/serialization/types/RegistryIcon.ts | 20 + src/serialization/types/UsageBucket.ts | 21 + src/serialization/types/UsageGranularity.ts | 12 + src/serialization/types/UsageMetrics.ts | 18 + .../types/UsageReportResponse.ts | 29 + src/serialization/types/index.ts | 84 ++ tests/unit/stream/Stream.test.ts | 563 +++++++++ tests/wire/agentic.test.ts | 1078 +++++++++++++++++ tests/wire/agentic/a2A.test.ts | 528 ++++++++ tests/wire/agentic/a2A/tasks.test.ts | 701 +++++++++++ tests/wire/agentic/artifacts.test.ts | 161 +++ tests/wire/agentic/connectors.test.ts | 620 ++++++++++ tests/wire/agentic/contexts.test.ts | 523 ++++++++ tests/wire/agentic/contexts/tasks.test.ts | 393 ++++++ tests/wire/agentic/feedback.test.ts | 511 ++++++++ tests/wire/agentic/registry.test.ts | 239 ++++ tests/wire/agentic/usage.test.ts | 159 +++ 270 files changed, 12866 insertions(+), 1 deletion(-) create mode 100644 src/api/errors/NotImplementedError.ts create mode 100644 src/api/resources/agentic/client/Client.ts create mode 100644 src/api/resources/agentic/client/index.ts create mode 100644 src/api/resources/agentic/client/requests/AgentsCreateRequest.ts create mode 100644 src/api/resources/agentic/client/requests/AgentsPatchRequest.ts create mode 100644 src/api/resources/agentic/client/requests/ListAgenticRequest.ts create mode 100644 src/api/resources/agentic/client/requests/index.ts create mode 100644 src/api/resources/agentic/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/client/Client.ts create mode 100644 src/api/resources/agentic/resources/a2A/client/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts create mode 100644 src/api/resources/agentic/resources/a2A/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/resources/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts create mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts create mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts create mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/index.ts create mode 100644 src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts create mode 100644 src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts create mode 100644 src/api/resources/agentic/resources/a2A/types/index.ts create mode 100644 src/api/resources/agentic/resources/artifacts/client/Client.ts create mode 100644 src/api/resources/agentic/resources/artifacts/client/index.ts create mode 100644 src/api/resources/agentic/resources/artifacts/index.ts create mode 100644 src/api/resources/agentic/resources/connectors/client/Client.ts create mode 100644 src/api/resources/agentic/resources/connectors/client/index.ts create mode 100644 src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts create mode 100644 src/api/resources/agentic/resources/connectors/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/connectors/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/client/Client.ts create mode 100644 src/api/resources/agentic/resources/contexts/client/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts create mode 100644 src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts create mode 100644 src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts create mode 100644 src/api/resources/agentic/resources/contexts/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/resources/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts create mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts create mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/index.ts create mode 100644 src/api/resources/agentic/resources/feedback/client/Client.ts create mode 100644 src/api/resources/agentic/resources/feedback/client/index.ts create mode 100644 src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts create mode 100644 src/api/resources/agentic/resources/feedback/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/feedback/index.ts create mode 100644 src/api/resources/agentic/resources/index.ts create mode 100644 src/api/resources/agentic/resources/registry/client/Client.ts create mode 100644 src/api/resources/agentic/resources/registry/client/index.ts create mode 100644 src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts create mode 100644 src/api/resources/agentic/resources/registry/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/registry/index.ts create mode 100644 src/api/resources/agentic/resources/usage/client/Client.ts create mode 100644 src/api/resources/agentic/resources/usage/client/index.ts create mode 100644 src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts create mode 100644 src/api/resources/agentic/resources/usage/client/requests/index.ts create mode 100644 src/api/resources/agentic/resources/usage/index.ts create mode 100644 src/api/types/A2ASendMessageConfiguration.ts create mode 100644 src/api/types/A2ASendMessageRequest.ts create mode 100644 src/api/types/A2ASendMessageResponse.ts create mode 100644 src/api/types/A2AStreamEventResponse.ts create mode 100644 src/api/types/A2AjsonrpcResponse.ts create mode 100644 src/api/types/A2AjsonrpcResponseError.ts create mode 100644 src/api/types/A2AjsonrpcResponseId.ts create mode 100644 src/api/types/AgentCardResponse.ts create mode 100644 src/api/types/AgentCardResponseCapabilities.ts create mode 100644 src/api/types/AgentCardResponseProvider.ts create mode 100644 src/api/types/AgentCardResponseSignaturesItem.ts create mode 100644 src/api/types/AgentCardResponseSkillsItem.ts create mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItem.ts create mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts create mode 100644 src/api/types/AgentsLabels.ts create mode 100644 src/api/types/AgentsLifecycle.ts create mode 100644 src/api/types/AgentsListResponse.ts create mode 100644 src/api/types/AgentsResponse.ts create mode 100644 src/api/types/AgentsUserIdValue.ts create mode 100644 src/api/types/AgentsVisibility.ts create mode 100644 src/api/types/CommonA2AConnector.ts create mode 100644 src/api/types/CommonA2AConnectorCreate.ts create mode 100644 src/api/types/CommonAgentConnector.ts create mode 100644 src/api/types/CommonAgentConnectorCreate.ts create mode 100644 src/api/types/CommonAgentIdValue.ts create mode 100644 src/api/types/CommonArtifactIdValue.ts create mode 100644 src/api/types/CommonArtifactResponse.ts create mode 100644 src/api/types/CommonConnectorAuth.ts create mode 100644 src/api/types/CommonConnectorAuthType.ts create mode 100644 src/api/types/CommonConnectorCreateRequest.ts create mode 100644 src/api/types/CommonConnectorIdValue.ts create mode 100644 src/api/types/CommonConnectorResponse.ts create mode 100644 src/api/types/CommonConnectorType.ts create mode 100644 src/api/types/CommonContextIdValue.ts create mode 100644 src/api/types/CommonErrorResponse.ts create mode 100644 src/api/types/CommonErrorResponseError.ts create mode 100644 src/api/types/CommonErrorResponseErrorDetails.ts create mode 100644 src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts create mode 100644 src/api/types/CommonMcpConnector.ts create mode 100644 src/api/types/CommonMcpConnectorCreate.ts create mode 100644 src/api/types/CommonMessage.ts create mode 100644 src/api/types/CommonMessageIdValue.ts create mode 100644 src/api/types/CommonNextPageToken.ts create mode 100644 src/api/types/CommonPart.ts create mode 100644 src/api/types/CommonRegistryConnectorCreate.ts create mode 100644 src/api/types/CommonRegistryConnectorProvisioned.ts create mode 100644 src/api/types/CommonRole.ts create mode 100644 src/api/types/CommonSchemaConnector.ts create mode 100644 src/api/types/CommonSchemaConnectorCreate.ts create mode 100644 src/api/types/CommonSchemaConnectorCreateTransition.ts create mode 100644 src/api/types/CommonSchemaConnectorTransition.ts create mode 100644 src/api/types/CommonTaskIdValue.ts create mode 100644 src/api/types/CommonTaskListResponse.ts create mode 100644 src/api/types/CommonTaskMetadata.ts create mode 100644 src/api/types/CommonTaskResponse.ts create mode 100644 src/api/types/CommonTaskState.ts create mode 100644 src/api/types/CommonTaskStatus.ts create mode 100644 src/api/types/CommonTotalSize.ts create mode 100644 src/api/types/CommonUsage.ts create mode 100644 src/api/types/ConnectorsListResponse.ts create mode 100644 src/api/types/Contexts.ts create mode 100644 src/api/types/ContextsDetailResponse.ts create mode 100644 src/api/types/ContextsListResponse.ts create mode 100644 src/api/types/ContextsOpenInferenceSpan.ts create mode 100644 src/api/types/ContextsTraceItem.ts create mode 100644 src/api/types/ContextsTraceItemTrace.ts create mode 100644 src/api/types/ContextsTraceResponse.ts create mode 100644 src/api/types/FeedbackActor.ts create mode 100644 src/api/types/FeedbackIdValue.ts create mode 100644 src/api/types/FeedbackLabel.ts create mode 100644 src/api/types/FeedbackListResponse.ts create mode 100644 src/api/types/FeedbackMetadata.ts create mode 100644 src/api/types/FeedbackRating.ts create mode 100644 src/api/types/FeedbackRatingScale.ts create mode 100644 src/api/types/FeedbackResponse.ts create mode 100644 src/api/types/FeedbackTarget.ts create mode 100644 src/api/types/RegistryConnectorCapabilities.ts create mode 100644 src/api/types/RegistryConnectorListResponse.ts create mode 100644 src/api/types/RegistryConnectorResponse.ts create mode 100644 src/api/types/RegistryIcon.ts create mode 100644 src/api/types/UsageBucket.ts create mode 100644 src/api/types/UsageGranularity.ts create mode 100644 src/api/types/UsageMetrics.ts create mode 100644 src/api/types/UsageReportResponse.ts create mode 100644 src/core/stream/Stream.ts create mode 100644 src/core/stream/index.ts create mode 100644 src/serialization/resources/agentic/client/index.ts create mode 100644 src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts create mode 100644 src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts create mode 100644 src/serialization/resources/agentic/client/requests/index.ts create mode 100644 src/serialization/resources/agentic/index.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/client/index.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/client/requests/index.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/index.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts create mode 100644 src/serialization/resources/agentic/resources/a2A/types/index.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/client/index.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/index.ts create mode 100644 src/serialization/resources/agentic/resources/connectors/index.ts create mode 100644 src/serialization/resources/agentic/resources/feedback/client/index.ts create mode 100644 src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts create mode 100644 src/serialization/resources/agentic/resources/feedback/client/requests/index.ts create mode 100644 src/serialization/resources/agentic/resources/feedback/index.ts create mode 100644 src/serialization/resources/agentic/resources/index.ts create mode 100644 src/serialization/types/A2ASendMessageConfiguration.ts create mode 100644 src/serialization/types/A2ASendMessageRequest.ts create mode 100644 src/serialization/types/A2ASendMessageResponse.ts create mode 100644 src/serialization/types/A2AStreamEventResponse.ts create mode 100644 src/serialization/types/A2AjsonrpcResponse.ts create mode 100644 src/serialization/types/A2AjsonrpcResponseError.ts create mode 100644 src/serialization/types/A2AjsonrpcResponseId.ts create mode 100644 src/serialization/types/AgentCardResponse.ts create mode 100644 src/serialization/types/AgentCardResponseCapabilities.ts create mode 100644 src/serialization/types/AgentCardResponseProvider.ts create mode 100644 src/serialization/types/AgentCardResponseSignaturesItem.ts create mode 100644 src/serialization/types/AgentCardResponseSkillsItem.ts create mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts create mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts create mode 100644 src/serialization/types/AgentsLabels.ts create mode 100644 src/serialization/types/AgentsLifecycle.ts create mode 100644 src/serialization/types/AgentsListResponse.ts create mode 100644 src/serialization/types/AgentsResponse.ts create mode 100644 src/serialization/types/AgentsUserIdValue.ts create mode 100644 src/serialization/types/AgentsVisibility.ts create mode 100644 src/serialization/types/CommonA2AConnector.ts create mode 100644 src/serialization/types/CommonA2AConnectorCreate.ts create mode 100644 src/serialization/types/CommonAgentConnector.ts create mode 100644 src/serialization/types/CommonAgentConnectorCreate.ts create mode 100644 src/serialization/types/CommonAgentIdValue.ts create mode 100644 src/serialization/types/CommonArtifactIdValue.ts create mode 100644 src/serialization/types/CommonArtifactResponse.ts create mode 100644 src/serialization/types/CommonConnectorAuth.ts create mode 100644 src/serialization/types/CommonConnectorAuthType.ts create mode 100644 src/serialization/types/CommonConnectorCreateRequest.ts create mode 100644 src/serialization/types/CommonConnectorIdValue.ts create mode 100644 src/serialization/types/CommonConnectorResponse.ts create mode 100644 src/serialization/types/CommonConnectorType.ts create mode 100644 src/serialization/types/CommonContextIdValue.ts create mode 100644 src/serialization/types/CommonErrorResponse.ts create mode 100644 src/serialization/types/CommonErrorResponseError.ts create mode 100644 src/serialization/types/CommonErrorResponseErrorDetails.ts create mode 100644 src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts create mode 100644 src/serialization/types/CommonMcpConnector.ts create mode 100644 src/serialization/types/CommonMcpConnectorCreate.ts create mode 100644 src/serialization/types/CommonMessage.ts create mode 100644 src/serialization/types/CommonMessageIdValue.ts create mode 100644 src/serialization/types/CommonNextPageToken.ts create mode 100644 src/serialization/types/CommonPart.ts create mode 100644 src/serialization/types/CommonRegistryConnectorCreate.ts create mode 100644 src/serialization/types/CommonRegistryConnectorProvisioned.ts create mode 100644 src/serialization/types/CommonRole.ts create mode 100644 src/serialization/types/CommonSchemaConnector.ts create mode 100644 src/serialization/types/CommonSchemaConnectorCreate.ts create mode 100644 src/serialization/types/CommonSchemaConnectorCreateTransition.ts create mode 100644 src/serialization/types/CommonSchemaConnectorTransition.ts create mode 100644 src/serialization/types/CommonTaskIdValue.ts create mode 100644 src/serialization/types/CommonTaskListResponse.ts create mode 100644 src/serialization/types/CommonTaskMetadata.ts create mode 100644 src/serialization/types/CommonTaskResponse.ts create mode 100644 src/serialization/types/CommonTaskState.ts create mode 100644 src/serialization/types/CommonTaskStatus.ts create mode 100644 src/serialization/types/CommonTotalSize.ts create mode 100644 src/serialization/types/CommonUsage.ts create mode 100644 src/serialization/types/ConnectorsListResponse.ts create mode 100644 src/serialization/types/Contexts.ts create mode 100644 src/serialization/types/ContextsDetailResponse.ts create mode 100644 src/serialization/types/ContextsListResponse.ts create mode 100644 src/serialization/types/ContextsOpenInferenceSpan.ts create mode 100644 src/serialization/types/ContextsTraceItem.ts create mode 100644 src/serialization/types/ContextsTraceItemTrace.ts create mode 100644 src/serialization/types/ContextsTraceResponse.ts create mode 100644 src/serialization/types/FeedbackActor.ts create mode 100644 src/serialization/types/FeedbackIdValue.ts create mode 100644 src/serialization/types/FeedbackLabel.ts create mode 100644 src/serialization/types/FeedbackListResponse.ts create mode 100644 src/serialization/types/FeedbackMetadata.ts create mode 100644 src/serialization/types/FeedbackRating.ts create mode 100644 src/serialization/types/FeedbackRatingScale.ts create mode 100644 src/serialization/types/FeedbackResponse.ts create mode 100644 src/serialization/types/FeedbackTarget.ts create mode 100644 src/serialization/types/RegistryConnectorCapabilities.ts create mode 100644 src/serialization/types/RegistryConnectorListResponse.ts create mode 100644 src/serialization/types/RegistryConnectorResponse.ts create mode 100644 src/serialization/types/RegistryIcon.ts create mode 100644 src/serialization/types/UsageBucket.ts create mode 100644 src/serialization/types/UsageGranularity.ts create mode 100644 src/serialization/types/UsageMetrics.ts create mode 100644 src/serialization/types/UsageReportResponse.ts create mode 100644 tests/unit/stream/Stream.test.ts create mode 100644 tests/wire/agentic.test.ts create mode 100644 tests/wire/agentic/a2A.test.ts create mode 100644 tests/wire/agentic/a2A/tasks.test.ts create mode 100644 tests/wire/agentic/artifacts.test.ts create mode 100644 tests/wire/agentic/connectors.test.ts create mode 100644 tests/wire/agentic/contexts.test.ts create mode 100644 tests/wire/agentic/contexts/tasks.test.ts create mode 100644 tests/wire/agentic/feedback.test.ts create mode 100644 tests/wire/agentic/registry.test.ts create mode 100644 tests/wire/agentic/usage.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index 0b137d8c..fea309f7 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "e823ff09435fdcb10253f674c070042b8a265d69", + "originGitCommit": "78b2888846615c82906cafa9fec69862daee2349", "sdkVersion": "0.0.0-dev" } diff --git a/src/Client.ts b/src/Client.ts index 2098b736..0b8928d0 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,5 +1,6 @@ // This file was auto-generated by Fern from our API Definition. +import { AgenticClient } from "./api/resources/agentic/client/Client.js"; import { AgentsClient } from "./api/resources/agents/client/Client.js"; import { AuthClient } from "./api/resources/auth/client/Client.js"; import { CodesClient } from "./api/resources/codes/client/Client.js"; @@ -33,6 +34,7 @@ export class CortiClient { protected _codes: CodesClient | undefined; protected _languages: LanguagesClient | undefined; protected _agents: AgentsClient | undefined; + protected _agentic: AgenticClient | undefined; protected _stream: StreamClient | undefined; protected _transcribe: TranscribeClient | undefined; @@ -80,6 +82,10 @@ export class CortiClient { return (this._agents ??= new AgentsClient(this._options)); } + public get agentic(): AgenticClient { + return (this._agentic ??= new AgenticClient(this._options)); + } + public get stream(): StreamClient { return (this._stream ??= new StreamClient(this._options)); } diff --git a/src/api/errors/NotImplementedError.ts b/src/api/errors/NotImplementedError.ts new file mode 100644 index 00000000..24387bb0 --- /dev/null +++ b/src/api/errors/NotImplementedError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Corti from "../index.js"; + +export class NotImplementedError extends errors.CortiError { + constructor(body: Corti.CommonErrorResponse, rawResponse?: core.RawResponse) { + super({ + message: "NotImplementedError", + statusCode: 501, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 7ce4a0f0..1cd5a26b 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -5,5 +5,6 @@ export * from "./ForbiddenError.js"; export * from "./GatewayTimeoutError.js"; export * from "./InternalServerError.js"; export * from "./NotFoundError.js"; +export * from "./NotImplementedError.js"; export * from "./UnauthorizedError.js"; export * from "./UnprocessableEntityError.js"; diff --git a/src/api/resources/agentic/client/Client.ts b/src/api/resources/agentic/client/Client.ts new file mode 100644 index 00000000..8b1983fe --- /dev/null +++ b/src/api/resources/agentic/client/Client.ts @@ -0,0 +1,654 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as Corti from "../../../index.js"; +import { A2AClient } from "../resources/a2A/client/Client.js"; +import { ArtifactsClient } from "../resources/artifacts/client/Client.js"; +import { ConnectorsClient } from "../resources/connectors/client/Client.js"; +import { ContextsClient } from "../resources/contexts/client/Client.js"; +import { FeedbackClient } from "../resources/feedback/client/Client.js"; +import { RegistryClient } from "../resources/registry/client/Client.js"; +import { UsageClient } from "../resources/usage/client/Client.js"; + +export declare namespace AgenticClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class AgenticClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + protected _a2A: A2AClient | undefined; + protected _usage: UsageClient | undefined; + protected _connectors: ConnectorsClient | undefined; + protected _contexts: ContextsClient | undefined; + protected _artifacts: ArtifactsClient | undefined; + protected _registry: RegistryClient | undefined; + protected _feedback: FeedbackClient | undefined; + + constructor(options: AgenticClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + public get a2A(): A2AClient { + return (this._a2A ??= new A2AClient(this._options)); + } + + public get usage(): UsageClient { + return (this._usage ??= new UsageClient(this._options)); + } + + public get connectors(): ConnectorsClient { + return (this._connectors ??= new ConnectorsClient(this._options)); + } + + public get contexts(): ContextsClient { + return (this._contexts ??= new ContextsClient(this._options)); + } + + public get artifacts(): ArtifactsClient { + return (this._artifacts ??= new ArtifactsClient(this._options)); + } + + public get registry(): RegistryClient { + return (this._registry ??= new RegistryClient(this._options)); + } + + public get feedback(): FeedbackClient { + return (this._feedback ??= new FeedbackClient(this._options)); + } + + /** + * Lists agents visible to the caller. `private` agents are visible only to + * their creator/service principal; `unlisted` agents are omitted (fetch by + * ID instead); `public` agents are listed tenant-wide. + * The `visibility`, `lifecycle`, `label`, and `q` filter parameters are accepted but not yet honored by the server; the response is unfiltered. + * + * @param {Corti.ListAgenticRequest} request + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agentic.list({ + * label: ["team=coding"], + * q: "coder" + * }) + */ + public list( + request: Corti.ListAgenticRequest = {}, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + + private async __list( + request: Corti.ListAgenticRequest = {}, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const { pageSize, pageToken, visibility, lifecycle, label, q } = request; + const _queryParams: Record = { + pageSize, + pageToken, + visibility: Array.isArray(visibility) + ? visibility.map((item) => + serializers.AgentsVisibility.jsonOrThrow(item, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + ) + : visibility != null + ? serializers.AgentsVisibility.jsonOrThrow(visibility, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + lifecycle: + lifecycle != null + ? serializers.AgentsLifecycle.jsonOrThrow(lifecycle, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + label, + q, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/agents", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents"); + } + + /** + * Creates a new agent. The server assigns the UUIDv7 `id`. + * + * @param {Corti.AgentsCreateRequest} request + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.ConflictError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agentic.create({ + * name: "coder", + * description: "Returns ICD-10 codes for a clinical encounter.", + * systemPrompt: "Respond with only the ICD-10 code.", + * model: "corti-default", + * visibility: "private", + * lifecycle: "persistent", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }, { + * type: "mcp", + * name: "policybot", + * url: "https://mcp.example.com", + * auth: { + * type: "oauth2", + * scope: "read:policies", + * redirectUrl: "https://app.corti.ai/oauth/callback" + * } + * }, { + * type: "schema", + * name: "submit_code", + * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + * schema: { + * "type": "object", + * "properties": { + * "code": { + * "type": "string", + * "description": "The selected ICD-10 code." + * }, + * "confidence": { + * "type": "number", + * "minimum": 0, + * "maximum": 1 + * } + * }, + * "required": [ + * "code" + * ] + * }, + * transition: "complete" + * }], + * labels: { + * "team": "coding", + * "env": "prod" + * } + * }) + */ + public create( + request: Corti.AgentsCreateRequest, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + + private async __create( + request: Corti.AgentsCreateRequest, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/agents", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.AgentsCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 409: + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/agentic/agents"); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public get( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents/{agentId}"); + } + + /** + * Deletes a `persistent` agent. `ephemeral` agents are expired in place. + * Idempotent: deleting an already-deleted agent returns `204`. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public delete( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(agentId, requestOptions)); + } + + private async __delete( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/agents/{agentId}", + ); + } + + /** + * Partially updates an agent using JSON Merge Patch (RFC 7386). + * Omitted fields are unchanged; `null` clears a field; arrays replace. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.AgentsPatchRequest} request + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * name: "coder-v2", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }] + * }) + */ + public update( + agentId: Corti.CommonAgentIdValue, + request: Corti.AgentsPatchRequest = {}, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(agentId, request, requestOptions)); + } + + private async __update( + agentId: Corti.CommonAgentIdValue, + request: Corti.AgentsPatchRequest = {}, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/merge-patch+json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.AgentsPatchRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/v2/agentic/agents/{agentId}", + ); + } + + /** + * Returns the A2A v1.0 agent card describing the agent's capabilities, + * skills, and supported protocol interfaces. Served at the standard + * `.well-known` location for agent discovery. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public getCard( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCard(agentId, requestOptions)); + } + + private async __getCard( + agentId: Corti.CommonAgentIdValue, + requestOptions?: AgenticClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/.well-known/agent-card.json`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.AgentCardResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/.well-known/agent-card.json", + ); + } +} diff --git a/src/api/resources/agentic/client/index.ts b/src/api/resources/agentic/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts b/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts new file mode 100644 index 00000000..76267264 --- /dev/null +++ b/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts @@ -0,0 +1,69 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * name: "coder", + * description: "Returns ICD-10 codes for a clinical encounter.", + * systemPrompt: "Respond with only the ICD-10 code.", + * model: "corti-default", + * visibility: "private", + * lifecycle: "persistent", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }, { + * type: "mcp", + * name: "policybot", + * url: "https://mcp.example.com", + * auth: { + * type: "oauth2", + * scope: "read:policies", + * redirectUrl: "https://app.corti.ai/oauth/callback" + * } + * }, { + * type: "schema", + * name: "submit_code", + * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + * schema: { + * "type": "object", + * "properties": { + * "code": { + * "type": "string", + * "description": "The selected ICD-10 code." + * }, + * "confidence": { + * "type": "number", + * "minimum": 0, + * "maximum": 1 + * } + * }, + * "required": [ + * "code" + * ] + * }, + * transition: "complete" + * }], + * labels: { + * "team": "coding", + * "env": "prod" + * } + * } + */ +export interface AgentsCreateRequest { + /** Human-readable, unique-per-tenant agent name. */ + name: string; + /** Free-form agent description. */ + description?: string; + /** System prompt prepended to every invocation. */ + systemPrompt?: string; + /** Tenant default if omitted. */ + model?: string; + visibility?: Corti.AgentsVisibility; + lifecycle?: Corti.AgentsLifecycle; + /** Connectors to attach at creation. Defaults to an empty array. */ + connectors?: Corti.CommonConnectorCreateRequest[]; + labels?: Corti.AgentsLabels; +} diff --git a/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts b/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts new file mode 100644 index 00000000..30cfd750 --- /dev/null +++ b/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * name: "coder-v2", + * connectors: [{ + * type: "registry", + * name: "@dedalus/coding-expert" + * }] + * } + */ +export interface AgentsPatchRequest { + /** New agent name. */ + name?: string; + /** New description; `null` clears it. */ + description?: string | null; + /** New system prompt; `null` clears it. */ + systemPrompt?: string | null; + /** New model identifier; `null` falls back to the tenant default. */ + model?: string | null; + visibility?: Corti.AgentsVisibility; + lifecycle?: Corti.AgentsLifecycle; + /** Replacement connector list; `null` clears connectors. */ + connectors?: Corti.CommonConnectorCreateRequest[] | null; + /** Replacement labels; `null` clears labels. */ + labels?: Record | null; +} diff --git a/src/api/resources/agentic/client/requests/ListAgenticRequest.ts b/src/api/resources/agentic/client/requests/ListAgenticRequest.ts new file mode 100644 index 00000000..5adb8943 --- /dev/null +++ b/src/api/resources/agentic/client/requests/ListAgenticRequest.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * label: ["team=coding"], + * q: "coder" + * } + */ +export interface ListAgenticRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; + /** Filter by one or more visibility levels. */ + visibility?: Corti.AgentsVisibility | Corti.AgentsVisibility[]; + /** Filter by lifecycle. */ + lifecycle?: Corti.AgentsLifecycle; + /** Filter by label equality, repeated `key=value` pairs (AND-combined). */ + label?: string | string[]; + /** Free-text search over `name` and `description`. */ + q?: string; +} diff --git a/src/api/resources/agentic/client/requests/index.ts b/src/api/resources/agentic/client/requests/index.ts new file mode 100644 index 00000000..040d53cb --- /dev/null +++ b/src/api/resources/agentic/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { AgentsCreateRequest } from "./AgentsCreateRequest.js"; +export type { AgentsPatchRequest } from "./AgentsPatchRequest.js"; +export type { ListAgenticRequest } from "./ListAgenticRequest.js"; diff --git a/src/api/resources/agentic/index.ts b/src/api/resources/agentic/index.ts new file mode 100644 index 00000000..9eb1192d --- /dev/null +++ b/src/api/resources/agentic/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/client/Client.ts b/src/api/resources/agentic/resources/a2A/client/Client.ts new file mode 100644 index 00000000..04b6729a --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/client/Client.ts @@ -0,0 +1,345 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; +import { TasksClient } from "../resources/tasks/client/Client.js"; + +export declare namespace A2AClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class A2AClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + protected _tasks: TasksClient | undefined; + + constructor(options: A2AClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + public get tasks(): TasksClient { + return (this._tasks ??= new TasksClient(this._options)); + } + + /** + * The `JSONRPC` protocol binding for A2A v1.0. Accepts a single JSON-RPC 2.0 + * request whose `method` is one of `SendMessage`, `SendStreamingMessage`, + * `GetTask`, `ListTasks`, `CancelTask`, or `SubscribeToTask`. + * + * Streaming methods (`SendStreamingMessage`, `SubscribeToTask`) respond with + * `text/event-stream`; all others respond with a single JSON-RPC response. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.agentic.A2AjsonrpcRequest} request + * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * id: "1", + * method: "SendMessage", + * params: { + * "message": { + * "role": "ROLE_USER", + * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + * "parts": [ + * { + * "text": "Code this encounter." + * } + * ] + * } + * } + * }) + */ + public jsonRpc( + agentId: Corti.CommonAgentIdValue, + request: Corti.agentic.A2AjsonrpcRequest, + requestOptions?: A2AClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__jsonRpc(agentId, request, requestOptions)); + } + + private async __jsonRpc( + agentId: Corti.CommonAgentIdValue, + request: Corti.agentic.A2AjsonrpcRequest, + requestOptions?: A2AClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: { + ...serializers.agentic.A2AjsonrpcRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + jsonrpc: "2.0", + }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.A2AjsonrpcResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a", + ); + } + + /** + * The `HTTP+JSON` binding of A2A `SendMessage`. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.A2ASendMessageRequest} request + * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * message: { + * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + * role: "ROLE_USER", + * parts: [{ + * text: "What is the ICD-10 code for asthma?" + * }] + * } + * }) + */ + public sendMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendMessage(agentId, request, requestOptions)); + } + + private async __sendMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:send`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.A2ASendMessageResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a/message:send", + ); + } + + /** + * The `HTTP+JSON` binding of A2A `SendStreamingMessage`. Responds with a + * `text/event-stream` of `Task`, `statusUpdate`, and `artifactUpdate` events. + */ + public streamMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): core.HttpResponsePromise> { + return core.HttpResponsePromise.fromPromise(this.__streamMessage(agentId, request, requestOptions)); + } + + private async __streamMessage( + agentId: Corti.CommonAgentIdValue, + request: Corti.A2ASendMessageRequest, + requestOptions?: A2AClient.RequestOptions, + ): Promise>> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:stream`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + responseType: "sse", + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: new core.Stream({ + stream: _response.body, + parse: async (data) => { + return serializers.A2AStreamEventResponse.parseOrThrow(data, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + }, + signal: requestOptions?.abortSignal, + eventShape: { + type: "sse", + }, + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a/message:stream", + ); + } +} diff --git a/src/api/resources/agentic/resources/a2A/client/index.ts b/src/api/resources/agentic/resources/a2A/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts new file mode 100644 index 00000000..2681a71b --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * id: "1", + * method: "SendMessage", + * params: { + * "message": { + * "role": "ROLE_USER", + * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + * "parts": [ + * { + * "text": "Code this encounter." + * } + * ] + * } + * } + * } + */ +export interface A2AjsonrpcRequest { + id: Corti.agentic.A2AjsonrpcRequestId; + /** JSON-RPC method name (PascalCase on the wire). */ + method: Corti.agentic.A2AjsonrpcRequestMethod; + /** JSON-RPC params object. */ + params?: Record; +} diff --git a/src/api/resources/agentic/resources/a2A/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/client/requests/index.ts new file mode 100644 index 00000000..23999406 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/client/requests/index.ts @@ -0,0 +1 @@ +export type { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/api/resources/agentic/resources/a2A/index.ts b/src/api/resources/agentic/resources/a2A/index.ts new file mode 100644 index 00000000..0ef16e76 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/index.ts @@ -0,0 +1,3 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/index.ts b/src/api/resources/agentic/resources/a2A/resources/index.ts new file mode 100644 index 00000000..a371e105 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/resources/index.ts @@ -0,0 +1,2 @@ +export * from "./tasks/client/requests/index.js"; +export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts new file mode 100644 index 00000000..df8fa963 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts @@ -0,0 +1,382 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; +import { + type NormalizedClientOptionsWithAuth, + normalizeClientOptionsWithAuth, +} from "../../../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; +import * as core from "../../../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../../../errors/index.js"; +import * as serializers from "../../../../../../../../serialization/index.js"; +import * as Corti from "../../../../../../../index.js"; + +export declare namespace TasksClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TasksClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TasksClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.agentic.a2A.ListTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public list( + agentId: Corti.CommonAgentIdValue, + request: Corti.agentic.a2A.ListTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(agentId, request, requestOptions)); + } + + private async __list( + agentId: Corti.CommonAgentIdValue, + request: Corti.agentic.a2A.ListTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { pageSize, pageToken, contextId } = request; + const _queryParams: Record = { + pageSize, + pageToken, + contextId, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/a2a/tasks", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {Corti.agentic.a2A.GetTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.a2A.tasks.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public get( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agentic.a2A.GetTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, taskId, request, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agentic.a2A.GetTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { historyLength } = request; + const _queryParams: Record = { + historyLength, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.ConflictError} + * + * @example + * await client.agentic.a2A.tasks.cancel("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public cancel( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__cancel(agentId, taskId, requestOptions)); + } + + private async __cancel( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:cancel`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:cancel", + ); + } + + /** + * Resubscribe to an in-flight task's event stream over SSE. + */ + public subscribe( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise> { + return core.HttpResponsePromise.fromPromise(this.__subscribe(agentId, taskId, requestOptions)); + } + + private async __subscribe( + agentId: Corti.CommonAgentIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): Promise>> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "A2A-Version": "1.0", + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:subscribe`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + responseType: "sse", + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: new core.Stream({ + stream: _response.body, + parse: async (data) => { + return serializers.A2AStreamEventResponse.parseOrThrow(data, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + }, + signal: requestOptions?.abortSignal, + eventShape: { + type: "sse", + }, + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:subscribe", + ); + } +} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts new file mode 100644 index 00000000..ea6be9c2 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetTasksRequest { + /** Cap the number of history messages returned. */ + historyLength?: number; +} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts new file mode 100644 index 00000000..c784ca5d --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListTasksRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; + /** Restrict to tasks within this context. */ + contextId?: string; +} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts new file mode 100644 index 00000000..508b914d --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts @@ -0,0 +1,2 @@ +export type { GetTasksRequest } from "./GetTasksRequest.js"; +export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts new file mode 100644 index 00000000..579038a0 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type A2AjsonrpcRequestId = string | number; diff --git a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts new file mode 100644 index 00000000..d6b216bb --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** JSON-RPC method name (PascalCase on the wire). */ +export const A2AjsonrpcRequestMethod = { + SendMessage: "SendMessage", + SendStreamingMessage: "SendStreamingMessage", + GetTask: "GetTask", + ListTasks: "ListTasks", + CancelTask: "CancelTask", + SubscribeToTask: "SubscribeToTask", +} as const; +export type A2AjsonrpcRequestMethod = (typeof A2AjsonrpcRequestMethod)[keyof typeof A2AjsonrpcRequestMethod]; diff --git a/src/api/resources/agentic/resources/a2A/types/index.ts b/src/api/resources/agentic/resources/a2A/types/index.ts new file mode 100644 index 00000000..d506c662 --- /dev/null +++ b/src/api/resources/agentic/resources/a2A/types/index.ts @@ -0,0 +1,2 @@ +export * from "./A2AjsonrpcRequestId.js"; +export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/api/resources/agentic/resources/artifacts/client/Client.ts b/src/api/resources/agentic/resources/artifacts/client/Client.ts new file mode 100644 index 00000000..dcd57c7f --- /dev/null +++ b/src/api/resources/agentic/resources/artifacts/client/Client.ts @@ -0,0 +1,115 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace ArtifactsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ArtifactsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ArtifactsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns an artifact produced by a task within a context. File parts may + * carry inline `bytes` or a `uri` to fetch the content out of band. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {Corti.CommonArtifactIdValue} artifactId - Artifact identifier (prefixed UUIDv7). + * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.ForbiddenError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.artifacts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84") + */ + public get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + artifactId: Corti.CommonArtifactIdValue, + requestOptions?: ArtifactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, artifactId, requestOptions)); + } + + private async __get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + artifactId: Corti.CommonArtifactIdValue, + requestOptions?: ArtifactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/artifacts/${core.url.encodePathParam(serializers.CommonArtifactIdValue.jsonOrThrow(artifactId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonArtifactResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/artifacts/{artifactId}", + ); + } +} diff --git a/src/api/resources/agentic/resources/artifacts/client/index.ts b/src/api/resources/agentic/resources/artifacts/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/agentic/resources/artifacts/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/agentic/resources/artifacts/index.ts b/src/api/resources/agentic/resources/artifacts/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agentic/resources/artifacts/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/connectors/client/Client.ts b/src/api/resources/agentic/resources/connectors/client/Client.ts new file mode 100644 index 00000000..fa6bc5d3 --- /dev/null +++ b/src/api/resources/agentic/resources/connectors/client/Client.ts @@ -0,0 +1,467 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace ConnectorsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ConnectorsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ConnectorsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + */ + public list( + agentId: Corti.CommonAgentIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions)); + } + + private async __list( + agentId: Corti.CommonAgentIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ConnectorsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/connectors", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorCreateRequest} request + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.ConflictError} + * + * @example + * await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * type: "registry", + * name: "@dedalus/coding-expert" + * }) + */ + public attach( + agentId: Corti.CommonAgentIdValue, + request: Corti.CommonConnectorCreateRequest, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__attach(agentId, request, requestOptions)); + } + + private async __attach( + agentId: Corti.CommonAgentIdValue, + request: Corti.CommonConnectorCreateRequest, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.CommonConnectorCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new Corti.ConflictError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/agents/{agentId}/connectors", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.connectors.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") + */ + public get( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, agentConnectorId, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", + ); + } + + /** + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.connectors.remove("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") + */ + public remove( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__remove(agentId, agentConnectorId, requestOptions)); + } + + private async __remove( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", + ); + } + + /** + * Partially updates an agent-scoped connector using JSON Merge Patch + * (RFC 7386). `type` is immutable. + * **Future scope**: not yet implemented; the server returns `501`. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). + * @param {Corti.agentic.ConnectorsPatchRequest} request + * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.NotImplementedError} + * + * @example + * await client.agentic.connectors.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", { + * enabled: false + * }) + */ + public update( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + request: Corti.agentic.ConnectorsPatchRequest = {}, + requestOptions?: ConnectorsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(agentId, agentConnectorId, request, requestOptions)); + } + + private async __update( + agentId: Corti.CommonAgentIdValue, + agentConnectorId: Corti.CommonConnectorIdValue, + request: Corti.agentic.ConnectorsPatchRequest = {}, + requestOptions?: ConnectorsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/merge-patch+json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.agentic.ConnectorsPatchRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 501: + throw new Corti.NotImplementedError( + serializers.CommonErrorResponse.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", + ); + } +} diff --git a/src/api/resources/agentic/resources/connectors/client/index.ts b/src/api/resources/agentic/resources/connectors/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/connectors/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts new file mode 100644 index 00000000..5094288b --- /dev/null +++ b/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * enabled: false + * } + */ +export interface ConnectorsPatchRequest { + /** Whether the connector is active. */ + enabled?: boolean; + /** New connector name. */ + name?: string; + /** New connector URL; `null` clears it. */ + url?: string | null; + /** New connector config; `null` clears it. */ + config?: Record | null; + auth?: Corti.CommonConnectorAuth | null; +} diff --git a/src/api/resources/agentic/resources/connectors/client/requests/index.ts b/src/api/resources/agentic/resources/connectors/client/requests/index.ts new file mode 100644 index 00000000..d39ed3f7 --- /dev/null +++ b/src/api/resources/agentic/resources/connectors/client/requests/index.ts @@ -0,0 +1 @@ +export type { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/api/resources/agentic/resources/connectors/index.ts b/src/api/resources/agentic/resources/connectors/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agentic/resources/connectors/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/client/Client.ts b/src/api/resources/agentic/resources/contexts/client/Client.ts new file mode 100644 index 00000000..9c746fc1 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/client/Client.ts @@ -0,0 +1,368 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; +import { TasksClient } from "../resources/tasks/client/Client.js"; + +export declare namespace ContextsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ContextsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + protected _tasks: TasksClient | undefined; + + constructor(options: ContextsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + public get tasks(): TasksClient { + return (this._tasks ??= new TasksClient(this._options)); + } + + /** + * Lists contexts matching the filters. + * **Future scope**: not yet implemented; the server currently returns an empty page and ignores all parameters. + * + * @param {Corti.agentic.ListContextsRequest} request + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agentic.contexts.list() + */ + public list( + request: Corti.agentic.ListContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + + private async __list( + request: Corti.agentic.ListContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const { agentId, from: from_, to, pageSize, pageToken } = request; + const _queryParams: Record = { + agentId, + from: from_ != null ? from_?.toISOString() : undefined, + to: to != null ? to?.toISOString() : undefined, + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/contexts", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ContextsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/contexts"); + } + + /** + * Returns the context's metadata together with its `tasks`, oldest first. + * Each task carries its full message `history`; the user's prompt for a + * task is the `ROLE_USER` message within that task's history (there is no + * separate top-level message list). + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.agentic.GetContextsRequest} request + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public get( + contextId: Corti.CommonContextIdValue, + request: Corti.agentic.GetContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(contextId, request, requestOptions)); + } + + private async __get( + contextId: Corti.CommonContextIdValue, + request: Corti.agentic.GetContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const { historyLength } = request; + const _queryParams: Record = { + historyLength, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ContextsDetailResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}", + ); + } + + /** + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public delete( + contextId: Corti.CommonContextIdValue, + requestOptions?: ContextsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(contextId, requestOptions)); + } + + private async __delete( + contextId: Corti.CommonContextIdValue, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/contexts/{contextId}", + ); + } + + /** + * Returns the execution traces for the context — LLM calls, tool + * executions, and token usage — in OpenInference format. Traces are + * ordered newest-first and paginated; each page returns up to `pageSize` + * traces with their spans inlined. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.agentic.GetTraceContextsRequest} request + * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public getTrace( + contextId: Corti.CommonContextIdValue, + request: Corti.agentic.GetTraceContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTrace(contextId, request, requestOptions)); + } + + private async __getTrace( + contextId: Corti.CommonContextIdValue, + request: Corti.agentic.GetTraceContextsRequest = {}, + requestOptions?: ContextsClient.RequestOptions, + ): Promise> { + const { pageSize, pageToken } = request; + const _queryParams: Record = { + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/trace`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ContextsTraceResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/trace", + ); + } +} diff --git a/src/api/resources/agentic/resources/contexts/client/index.ts b/src/api/resources/agentic/resources/contexts/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts new file mode 100644 index 00000000..ac1ae3a8 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetContextsRequest { + /** Cap the number of history messages returned per task. */ + historyLength?: number; +} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts new file mode 100644 index 00000000..e85c8b41 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetTraceContextsRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts new file mode 100644 index 00000000..111bb811 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListContextsRequest { + /** Restrict to contexts owned by this agent. */ + agentId?: string; + /** Inclusive lower bound on `createdAt` (RFC 3339). */ + from?: Date; + /** Exclusive upper bound on `createdAt` (RFC 3339). */ + to?: Date; + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/client/requests/index.ts new file mode 100644 index 00000000..db21c8ce --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { GetContextsRequest } from "./GetContextsRequest.js"; +export type { GetTraceContextsRequest } from "./GetTraceContextsRequest.js"; +export type { ListContextsRequest } from "./ListContextsRequest.js"; diff --git a/src/api/resources/agentic/resources/contexts/index.ts b/src/api/resources/agentic/resources/contexts/index.ts new file mode 100644 index 00000000..9eb1192d --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/index.ts b/src/api/resources/agentic/resources/contexts/resources/index.ts new file mode 100644 index 00000000..a371e105 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/resources/index.ts @@ -0,0 +1,2 @@ +export * from "./tasks/client/requests/index.js"; +export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts new file mode 100644 index 00000000..4a2d1042 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts @@ -0,0 +1,196 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; +import { + type NormalizedClientOptionsWithAuth, + normalizeClientOptionsWithAuth, +} from "../../../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; +import * as core from "../../../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../../../errors/index.js"; +import * as serializers from "../../../../../../../../serialization/index.js"; +import * as Corti from "../../../../../../../index.js"; + +export declare namespace TasksClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TasksClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TasksClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.agentic.contexts.ListTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + */ + public list( + contextId: Corti.CommonContextIdValue, + request: Corti.agentic.contexts.ListTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(contextId, request, requestOptions)); + } + + private async __list( + contextId: Corti.CommonContextIdValue, + request: Corti.agentic.contexts.ListTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { pageSize, pageToken } = request; + const _queryParams: Record = { + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks", + ); + } + + /** + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.contexts.tasks.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, requestOptions)); + } + + private async __get( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}", + ); + } +} diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts new file mode 100644 index 00000000..05240c95 --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListTasksRequest { + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts new file mode 100644 index 00000000..0e50f63c --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts @@ -0,0 +1 @@ +export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/feedback/client/Client.ts b/src/api/resources/agentic/resources/feedback/client/Client.ts new file mode 100644 index 00000000..c847b11f --- /dev/null +++ b/src/api/resources/agentic/resources/feedback/client/Client.ts @@ -0,0 +1,313 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace FeedbackClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class FeedbackClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: FeedbackClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns all feedback resources submitted for the task by the authenticated user, newest-first. The task must exist, belong to the supplied context, and belong to the authenticated customer. Feedback is scoped to the calling user via row-level security, so the response contains only that user's feedback. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.feedback.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") + */ + public list( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(contextId, taskId, requestOptions)); + } + + private async __list( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.FeedbackListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", + ); + } + + /** + * Submits feedback about a task as a whole or about a specific user-visible + * message within the task. The task must exist, belong to the supplied + * context, and belong to the authenticated customer. Multiple feedback + * resources may be submitted for the same task or message. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {Corti.agentic.FeedbackCreateRequest} request + * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * @throws {@link Corti.UnprocessableEntityError} + * + * @example + * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { + * rating: { + * scale: "binary", + * value: 1 + * } + * }) + * + * @example + * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { + * rating: { + * scale: "binary", + * value: 0 + * }, + * labels: ["unsupportedClaim"], + * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + * target: { + * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" + * }, + * metadata: { + * collectionMethod: "caseReview", + * clientReference: "case-review-728193", + * actor: { + * externalId: "clinician_4182" + * } + * } + * }) + */ + public create( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agentic.FeedbackCreateRequest, + requestOptions?: FeedbackClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__create(contextId, taskId, request, requestOptions)); + } + + private async __create( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + request: Corti.agentic.FeedbackCreateRequest, + requestOptions?: FeedbackClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.agentic.FeedbackCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.FeedbackResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", + ); + } + + /** + * Soft-deletes a single feedback resource the authenticated user submitted for the task. The task must exist, belong to the supplied context, and belong to the authenticated customer. Idempotent: deleting a feedback resource that does not exist (or has already been deleted) returns `204`. + * + * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). + * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). + * @param {Corti.FeedbackIdValue} feedbackId - Feedback identifier (prefixed UUIDv7). + * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.feedback.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "fb.0192f4c8-7e2a-7b3c-9d4e-5f6a7b8c9d01") + */ + public delete( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + feedbackId: Corti.FeedbackIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(contextId, taskId, feedbackId, requestOptions)); + } + + private async __delete( + contextId: Corti.CommonContextIdValue, + taskId: Corti.CommonTaskIdValue, + feedbackId: Corti.FeedbackIdValue, + requestOptions?: FeedbackClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback/${core.url.encodePathParam(serializers.FeedbackIdValue.jsonOrThrow(feedbackId, { omitUndefined: true }))}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback/{feedbackId}", + ); + } +} diff --git a/src/api/resources/agentic/resources/feedback/client/index.ts b/src/api/resources/agentic/resources/feedback/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/feedback/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts new file mode 100644 index 00000000..e427a0df --- /dev/null +++ b/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts @@ -0,0 +1,49 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * rating: { + * scale: "binary", + * value: 1 + * } + * } + * + * @example + * { + * rating: { + * scale: "binary", + * value: 0 + * }, + * labels: ["unsupportedClaim"], + * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + * target: { + * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" + * }, + * metadata: { + * collectionMethod: "caseReview", + * clientReference: "case-review-728193", + * actor: { + * externalId: "clinician_4182" + * } + * } + * } + */ +export interface FeedbackCreateRequest { + rating: Corti.FeedbackRating; + /** + * Structured observations about the result. Defaults to an empty array. + * Positive and negative labels may be combined. Duplicate labels are + * rejected. A maximum of five labels may be submitted. + */ + labels?: Corti.FeedbackLabel[]; + /** + * The user's explanation of the rating or labels. Required when `labels` + * contains `other`. + */ + reason?: string; + target?: Corti.FeedbackTarget; + metadata?: Corti.FeedbackMetadata; +} diff --git a/src/api/resources/agentic/resources/feedback/client/requests/index.ts b/src/api/resources/agentic/resources/feedback/client/requests/index.ts new file mode 100644 index 00000000..06c3ce4e --- /dev/null +++ b/src/api/resources/agentic/resources/feedback/client/requests/index.ts @@ -0,0 +1 @@ +export type { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/api/resources/agentic/resources/feedback/index.ts b/src/api/resources/agentic/resources/feedback/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agentic/resources/feedback/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/index.ts b/src/api/resources/agentic/resources/index.ts new file mode 100644 index 00000000..3fe97949 --- /dev/null +++ b/src/api/resources/agentic/resources/index.ts @@ -0,0 +1,14 @@ +export * from "./a2A/client/requests/index.js"; +export * as a2A from "./a2A/index.js"; +export * from "./a2A/types/index.js"; +export * as artifacts from "./artifacts/index.js"; +export * from "./connectors/client/requests/index.js"; +export * as connectors from "./connectors/index.js"; +export * from "./contexts/client/requests/index.js"; +export * as contexts from "./contexts/index.js"; +export * from "./feedback/client/requests/index.js"; +export * as feedback from "./feedback/index.js"; +export * from "./registry/client/requests/index.js"; +export * as registry from "./registry/index.js"; +export * from "./usage/client/requests/index.js"; +export * as usage from "./usage/index.js"; diff --git a/src/api/resources/agentic/resources/registry/client/Client.ts b/src/api/resources/agentic/resources/registry/client/Client.ts new file mode 100644 index 00000000..69f89855 --- /dev/null +++ b/src/api/resources/agentic/resources/registry/client/Client.ts @@ -0,0 +1,185 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace RegistryClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class RegistryClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: RegistryClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Corti.agentic.ListRegistryRequest} request + * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * + * @example + * await client.agentic.registry.list() + */ + public list( + request: Corti.agentic.ListRegistryRequest = {}, + requestOptions?: RegistryClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + + private async __list( + request: Corti.agentic.ListRegistryRequest = {}, + requestOptions?: RegistryClient.RequestOptions, + ): Promise> { + const { q, pageSize, pageToken } = request; + const _queryParams: Record = { + q, + pageSize, + pageToken, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + "v2/agentic/registry/connectors", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.RegistryConnectorListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/registry/connectors", + ); + } + + /** + * @param {string} connectorId - Registry connector identifier (e.g. `@dedalus/coding-expert`). + * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.registry.get("connectorId") + */ + public get( + connectorId: string, + requestOptions?: RegistryClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(connectorId, requestOptions)); + } + + private async __get( + connectorId: string, + requestOptions?: RegistryClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/registry/connectors/${core.url.encodePathParam(connectorId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.RegistryConnectorResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/registry/connectors/{connectorId}", + ); + } +} diff --git a/src/api/resources/agentic/resources/registry/client/index.ts b/src/api/resources/agentic/resources/registry/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/registry/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts b/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts new file mode 100644 index 00000000..8fb6c858 --- /dev/null +++ b/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ListRegistryRequest { + /** + * Free-text search over name and description. + * **Future scope**: not yet implemented; the server ignores this parameter and returns the unfiltered page. + */ + q?: string; + /** Maximum number of items per page. */ + pageSize?: number; + /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ + pageToken?: string; +} diff --git a/src/api/resources/agentic/resources/registry/client/requests/index.ts b/src/api/resources/agentic/resources/registry/client/requests/index.ts new file mode 100644 index 00000000..763983d1 --- /dev/null +++ b/src/api/resources/agentic/resources/registry/client/requests/index.ts @@ -0,0 +1 @@ +export type { ListRegistryRequest } from "./ListRegistryRequest.js"; diff --git a/src/api/resources/agentic/resources/registry/index.ts b/src/api/resources/agentic/resources/registry/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agentic/resources/registry/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/usage/client/Client.ts b/src/api/resources/agentic/resources/usage/client/Client.ts new file mode 100644 index 00000000..4d54539e --- /dev/null +++ b/src/api/resources/agentic/resources/usage/client/Client.ts @@ -0,0 +1,131 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../../../errors/index.js"; +import * as serializers from "../../../../../../serialization/index.js"; +import * as Corti from "../../../../../index.js"; + +export declare namespace UsageClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class UsageClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: UsageClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns invocation metrics for the agent over the half-open `[from, to)` + * time range (UTC), bucketed at the requested `granularity`. The response + * echoes the resolved range and granularity, a `totals` summary across the + * whole range, and one `buckets` entry per period that had activity (the + * array is empty when there was none). When `from`/`to` are omitted, the + * range defaults to the last 30 days. + * + * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). + * @param {Corti.agentic.GetUsageRequest} request + * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Corti.BadRequestError} + * @throws {@link Corti.UnauthorizedError} + * @throws {@link Corti.NotFoundError} + * + * @example + * await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + * from: new Date("2026-05-19T00:00:00.000Z"), + * to: new Date("2026-05-20T00:00:00.000Z") + * }) + */ + public get( + agentId: Corti.CommonAgentIdValue, + request: Corti.agentic.GetUsageRequest = {}, + requestOptions?: UsageClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(agentId, request, requestOptions)); + } + + private async __get( + agentId: Corti.CommonAgentIdValue, + request: Corti.agentic.GetUsageRequest = {}, + requestOptions?: UsageClient.RequestOptions, + ): Promise> { + const { from: from_, to, granularity } = request; + const _queryParams: Record = { + from: from_ != null ? from_?.toISOString() : undefined, + to: to != null ? to?.toISOString() : undefined, + granularity: + granularity != null + ? serializers.UsageGranularity.jsonOrThrow(granularity, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }) + : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)).agents, + `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/usage`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.UsageReportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); + case 404: + throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.CortiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v2/agentic/agents/{agentId}/usage", + ); + } +} diff --git a/src/api/resources/agentic/resources/usage/client/index.ts b/src/api/resources/agentic/resources/usage/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/agentic/resources/usage/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts b/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts new file mode 100644 index 00000000..c6f0d3f7 --- /dev/null +++ b/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../index.js"; + +/** + * @example + * { + * from: new Date("2026-05-19T00:00:00.000Z"), + * to: new Date("2026-05-20T00:00:00.000Z") + * } + */ +export interface GetUsageRequest { + /** + * Inclusive start of the range, as an RFC 3339 timestamp (UTC). + * Defaults to 30 days before `to`. Must not be after `to`. + */ + from?: Date; + /** + * Exclusive end of the range, as an RFC 3339 timestamp (UTC). + * Defaults to the current time. + */ + to?: Date; + /** Size of each reporting bucket. Defaults to `day`. */ + granularity?: Corti.UsageGranularity; +} diff --git a/src/api/resources/agentic/resources/usage/client/requests/index.ts b/src/api/resources/agentic/resources/usage/client/requests/index.ts new file mode 100644 index 00000000..6e62640f --- /dev/null +++ b/src/api/resources/agentic/resources/usage/client/requests/index.ts @@ -0,0 +1 @@ +export type { GetUsageRequest } from "./GetUsageRequest.js"; diff --git a/src/api/resources/agentic/resources/usage/index.ts b/src/api/resources/agentic/resources/usage/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/api/resources/agentic/resources/usage/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 2e1d98c8..554828ee 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,3 +1,5 @@ +export * from "./agentic/client/requests/index.js"; +export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; export * from "./agents/types/index.js"; diff --git a/src/api/types/A2ASendMessageConfiguration.ts b/src/api/types/A2ASendMessageConfiguration.ts new file mode 100644 index 00000000..b1fc30ed --- /dev/null +++ b/src/api/types/A2ASendMessageConfiguration.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Per-request options controlling how a message is processed. + */ +export interface A2ASendMessageConfiguration { + /** If `true`, return as soon as the task is submitted, even if processing is still in progress. If `false` (default), wait until the task reaches a terminal (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`) or interrupted (`INPUT_REQUIRED`, `AUTH_REQUIRED`) state. */ + returnImmediately?: boolean; + /** Maximum number of prior messages to include as context. */ + historyLength?: number; + /** Output media types the caller accepts. */ + acceptedOutputModes?: string[]; +} diff --git a/src/api/types/A2ASendMessageRequest.ts b/src/api/types/A2ASendMessageRequest.ts new file mode 100644 index 00000000..0b8fcc65 --- /dev/null +++ b/src/api/types/A2ASendMessageRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for sending a message to an agent. + */ +export interface A2ASendMessageRequest { + message: Corti.CommonMessage; + configuration?: Corti.A2ASendMessageConfiguration; + /** Free-form request metadata. */ + metadata?: Record; + /** Optional. Opaque routing identifier. Must match the `tenant` value from the selected `AgentInterface` in the Agent Card when that field is set. */ + tenant?: string; +} diff --git a/src/api/types/A2ASendMessageResponse.ts b/src/api/types/A2ASendMessageResponse.ts new file mode 100644 index 00000000..4b03d590 --- /dev/null +++ b/src/api/types/A2ASendMessageResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Exactly one of `task` or `message` is present. + */ +export type A2ASendMessageResponse = unknown; diff --git a/src/api/types/A2AStreamEventResponse.ts b/src/api/types/A2AStreamEventResponse.ts new file mode 100644 index 00000000..36e6af48 --- /dev/null +++ b/src/api/types/A2AStreamEventResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * An SSE event carrying an A2A `HTTP+JSON` streaming response. + */ +export interface A2AStreamEventResponse { + /** SSE payload: an A2A HTTP+JSON streaming response. */ + data?: string; + /** Event type. Absent for the default `message` event. */ + event?: string; + /** + * Opaque event id. Clients echo the most recent value in the + * `Last-Event-ID` header to resume a dropped stream. + */ + id?: string; + /** Reconnection time in milliseconds the client should use. */ + retry?: number; +} diff --git a/src/api/types/A2AjsonrpcResponse.ts b/src/api/types/A2AjsonrpcResponse.ts new file mode 100644 index 00000000..431728b4 --- /dev/null +++ b/src/api/types/A2AjsonrpcResponse.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A JSON-RPC 2.0 response envelope. + */ +export interface A2AjsonrpcResponse { + /** JSON-RPC protocol version; always `2.0`. */ + jsonrpc: "2.0"; + id: Corti.A2AjsonrpcResponseId | null; + /** JSON-RPC result object (present on success). */ + result?: Record; + /** JSON-RPC error object (present on failure). */ + error?: Corti.A2AjsonrpcResponseError; +} diff --git a/src/api/types/A2AjsonrpcResponseError.ts b/src/api/types/A2AjsonrpcResponseError.ts new file mode 100644 index 00000000..f649367d --- /dev/null +++ b/src/api/types/A2AjsonrpcResponseError.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * JSON-RPC error object (present on failure). + */ +export interface A2AjsonrpcResponseError { + /** JSON-RPC error code. */ + code: number; + /** Human-readable error message. */ + message: string; + /** Additional error details. */ + data?: Record; +} diff --git a/src/api/types/A2AjsonrpcResponseId.ts b/src/api/types/A2AjsonrpcResponseId.ts new file mode 100644 index 00000000..ef652a55 --- /dev/null +++ b/src/api/types/A2AjsonrpcResponseId.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type A2AjsonrpcResponseId = string | number; diff --git a/src/api/types/AgentCardResponse.ts b/src/api/types/AgentCardResponse.ts new file mode 100644 index 00000000..ecf4d1d7 --- /dev/null +++ b/src/api/types/AgentCardResponse.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An A2A agent card describing capabilities, skills, and supported interfaces. + */ +export interface AgentCardResponse { + /** Agent display name. */ + name: string; + /** Agent description. */ + description?: string; + /** A URL providing additional documentation about the agent. */ + documentationUrl?: string; + /** Optional URL to an icon for the agent. */ + iconUrl?: string; + /** Agent card version (SemVer). */ + version: string; + /** Agent capability flags (streaming, push notifications). */ + capabilities: Corti.AgentCardResponseCapabilities; + /** Default input media types. */ + defaultInputModes?: string[]; + /** Default output media types. */ + defaultOutputModes?: string[]; + /** Publishing organization and URL. */ + provider?: Corti.AgentCardResponseProvider; + /** Security requirements for contacting the agent. */ + securityRequirements?: Record[]; + /** The security scheme details used for authenticating with this agent. */ + securitySchemes?: Record; + /** JSON Web Signatures (JWS, RFC 7515) computed for this agent card. */ + signatures?: Corti.AgentCardResponseSignaturesItem[]; + /** Skills the agent exposes. */ + skills?: Corti.AgentCardResponseSkillsItem[]; + /** A2A protocol bindings. v2 advertises protocolVersion `1.0` only. */ + supportedInterfaces: Corti.AgentCardResponseSupportedInterfacesItem[]; +} diff --git a/src/api/types/AgentCardResponseCapabilities.ts b/src/api/types/AgentCardResponseCapabilities.ts new file mode 100644 index 00000000..a28f56e0 --- /dev/null +++ b/src/api/types/AgentCardResponseCapabilities.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Agent capability flags (streaming, push notifications). + */ +export interface AgentCardResponseCapabilities { + /** Whether the agent supports streaming responses. */ + streaming?: boolean; + /** + * Whether the agent can push task updates to a client-supplied webhook. + * **Future scope**: the `tasks/pushNotificationConfig/*` management endpoints are not yet implemented. Expect this to be `false` until they ship. + */ + pushNotifications?: boolean; +} diff --git a/src/api/types/AgentCardResponseProvider.ts b/src/api/types/AgentCardResponseProvider.ts new file mode 100644 index 00000000..4ddb0ec9 --- /dev/null +++ b/src/api/types/AgentCardResponseProvider.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Publishing organization and URL. + */ +export interface AgentCardResponseProvider { + /** Publishing organization name. */ + organization?: string; + /** Publishing organization URL. */ + url?: string; +} diff --git a/src/api/types/AgentCardResponseSignaturesItem.ts b/src/api/types/AgentCardResponseSignaturesItem.ts new file mode 100644 index 00000000..1e9cfd7e --- /dev/null +++ b/src/api/types/AgentCardResponseSignaturesItem.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentCardResponseSignaturesItem { + /** Base64url-encoded protected JWS header. */ + protected: string; + /** Unprotected JWS header values. */ + header?: Record; + /** Base64url-encoded signature. */ + signature: string; +} diff --git a/src/api/types/AgentCardResponseSkillsItem.ts b/src/api/types/AgentCardResponseSkillsItem.ts new file mode 100644 index 00000000..766ce4ce --- /dev/null +++ b/src/api/types/AgentCardResponseSkillsItem.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AgentCardResponseSkillsItem { + /** Skill identifier. */ + id: string; + /** Skill display name. */ + name: string; + /** Skill description. */ + description?: string; + /** Keywords for search and filtering. */ + tags?: string[]; +} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItem.ts b/src/api/types/AgentCardResponseSupportedInterfacesItem.ts new file mode 100644 index 00000000..345f16d8 --- /dev/null +++ b/src/api/types/AgentCardResponseSupportedInterfacesItem.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +export interface AgentCardResponseSupportedInterfacesItem { + /** A2A protocol binding type. */ + protocolBinding: Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding; + /** A2A protocol version; always `1.0`. */ + protocolVersion: "1.0"; + /** Endpoint URL for this protocol binding. */ + url: string; +} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts new file mode 100644 index 00000000..658ead3f --- /dev/null +++ b/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** A2A protocol binding type. */ +export const AgentCardResponseSupportedInterfacesItemProtocolBinding = { + Jsonrpc: "JSONRPC", + HttpJson: "HTTP+JSON", +} as const; +export type AgentCardResponseSupportedInterfacesItemProtocolBinding = + (typeof AgentCardResponseSupportedInterfacesItemProtocolBinding)[keyof typeof AgentCardResponseSupportedInterfacesItemProtocolBinding]; diff --git a/src/api/types/AgentsLabels.ts b/src/api/types/AgentsLabels.ts new file mode 100644 index 00000000..f7a70f75 --- /dev/null +++ b/src/api/types/AgentsLabels.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Free-form `string → string` metadata for filtering and organisation. Not used for routing or auth. + */ +export type AgentsLabels = Record; diff --git a/src/api/types/AgentsLifecycle.ts b/src/api/types/AgentsLifecycle.ts new file mode 100644 index 00000000..479e335b --- /dev/null +++ b/src/api/types/AgentsLifecycle.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * - `ephemeral` — short-lived; expired automatically. + * - `persistent` — retained until explicitly deleted. + */ +export const AgentsLifecycle = { + Ephemeral: "ephemeral", + Persistent: "persistent", +} as const; +export type AgentsLifecycle = (typeof AgentsLifecycle)[keyof typeof AgentsLifecycle]; diff --git a/src/api/types/AgentsListResponse.ts b/src/api/types/AgentsListResponse.ts new file mode 100644 index 00000000..3e2ede49 --- /dev/null +++ b/src/api/types/AgentsListResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of agents. + */ +export interface AgentsListResponse { + /** Agents on the current page. */ + agents: Corti.AgentsResponse[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/AgentsResponse.ts b/src/api/types/AgentsResponse.ts new file mode 100644 index 00000000..ff04c554 --- /dev/null +++ b/src/api/types/AgentsResponse.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A configured agent — its metadata, model, and attached connectors. + */ +export interface AgentsResponse { + id: Corti.CommonAgentIdValue; + /** Human-readable, unique-per-tenant agent name. */ + name: string; + /** Free-form agent description shown to users and in tooling. */ + description?: string | null; + /** System prompt prepended to every invocation. */ + systemPrompt?: string | null; + /** + * Model identifier. Tenant default if omitted or `null`. + * **Open question** — in the current implementation a model is configured per *expert*, not per *agent* (`Expert.modelName`), and an `Agent` has no model field at all. The desired end state is that there is **no distinction between an expert and an agent**, so `model` lives uniformly on this resource. Until that convergence lands, the precedence of an agent-level `model` over a connector/expert-level override is undecided and MUST be resolved before this field ships. + */ + model?: string | null; + visibility: Corti.AgentsVisibility; + lifecycle: Corti.AgentsLifecycle; + /** Connectors attached to the agent, discriminated by `type`. */ + connectors: Corti.CommonConnectorResponse[]; + labels?: Corti.AgentsLabels; + /** When the agent was created. */ + createdAt?: Date; + /** When the agent was last updated. */ + updatedAt?: Date; + /** Principal (user or service principal) that created the agent. */ + createdBy?: Corti.AgentsUserIdValue; +} diff --git a/src/api/types/AgentsUserIdValue.ts b/src/api/types/AgentsUserIdValue.ts new file mode 100644 index 00000000..1b1123af --- /dev/null +++ b/src/api/types/AgentsUserIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Principal identifier. Accepts `usr.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type AgentsUserIdValue = string; diff --git a/src/api/types/AgentsVisibility.ts b/src/api/types/AgentsVisibility.ts new file mode 100644 index 00000000..47ee0338 --- /dev/null +++ b/src/api/types/AgentsVisibility.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * - `private` — creator / service principal only. + * - `unlisted` — usable by ID, hidden from list results. + * - `public` — listed tenant-wide. + */ +export const AgentsVisibility = { + Private: "private", + Unlisted: "unlisted", + Public: "public", +} as const; +export type AgentsVisibility = (typeof AgentsVisibility)[keyof typeof AgentsVisibility]; diff --git a/src/api/types/CommonA2AConnector.ts b/src/api/types/CommonA2AConnector.ts new file mode 100644 index 00000000..66820c78 --- /dev/null +++ b/src/api/types/CommonA2AConnector.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector that delegates to a remote A2A agent by endpoint URL. + */ +export interface CommonA2AConnector { + type: "a2a"; + /** Optional display name for the remote A2A agent. */ + name?: string; + /** The remote agent's A2A endpoint (typically a `.well-known/agent-card.json`). */ + url: string; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonA2AConnectorCreate.ts b/src/api/types/CommonA2AConnectorCreate.ts new file mode 100644 index 00000000..206c2513 --- /dev/null +++ b/src/api/types/CommonA2AConnectorCreate.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Request body for attaching a remote A2A agent connector. + */ +export interface CommonA2AConnectorCreate { + type: "a2a"; + /** Optional display name for the remote A2A agent. */ + name?: string; + /** Remote agent A2A endpoint URL. */ + url: string; + /** Whether the connector is active for invocations. */ + enabled?: boolean; +} diff --git a/src/api/types/CommonAgentConnector.ts b/src/api/types/CommonAgentConnector.ts new file mode 100644 index 00000000..a07da86b --- /dev/null +++ b/src/api/types/CommonAgentConnector.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector that delegates to another agent. + */ +export interface CommonAgentConnector { + type: "agent"; + agentId: Corti.CommonAgentIdValue; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonAgentConnectorCreate.ts b/src/api/types/CommonAgentConnectorCreate.ts new file mode 100644 index 00000000..b88662df --- /dev/null +++ b/src/api/types/CommonAgentConnectorCreate.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for attaching an agent connector. + */ +export interface CommonAgentConnectorCreate { + type: "agent"; + agentId: Corti.CommonAgentIdValue; + /** Whether the connector is active for invocations. */ + enabled?: boolean; +} diff --git a/src/api/types/CommonAgentIdValue.ts b/src/api/types/CommonAgentIdValue.ts new file mode 100644 index 00000000..6a47de42 --- /dev/null +++ b/src/api/types/CommonAgentIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Agent identifier. Accepts `agt.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonAgentIdValue = string; diff --git a/src/api/types/CommonArtifactIdValue.ts b/src/api/types/CommonArtifactIdValue.ts new file mode 100644 index 00000000..c77bf933 --- /dev/null +++ b/src/api/types/CommonArtifactIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Artifact identifier. Accepts `art.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonArtifactIdValue = string; diff --git a/src/api/types/CommonArtifactResponse.ts b/src/api/types/CommonArtifactResponse.ts new file mode 100644 index 00000000..675a5c94 --- /dev/null +++ b/src/api/types/CommonArtifactResponse.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A named output produced by a task. + */ +export interface CommonArtifactResponse { + artifactId: Corti.CommonArtifactIdValue; + /** Optional artifact name. */ + name?: string; + /** A human-readable description of the artifact. */ + description?: string; + /** URIs of extensions that contributed to this artifact. */ + extensions?: string[]; + /** Optional metadata included with the artifact. */ + metadata?: Record; + /** Content parts of the artifact. */ + parts: Corti.CommonPart[]; +} diff --git a/src/api/types/CommonConnectorAuth.ts b/src/api/types/CommonConnectorAuth.ts new file mode 100644 index 00000000..74a0e61a --- /dev/null +++ b/src/api/types/CommonConnectorAuth.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Authentication configuration for an outbound connector. + */ +export interface CommonConnectorAuth { + /** Authentication mechanism. */ + type: Corti.CommonConnectorAuthType; + /** OAuth2 scope requested. */ + scope?: string; + /** OAuth2 redirect URL. */ + redirectUrl?: string; + /** Reference to a server-side stored secret. Mutually exclusive with inline credentials passed at call time. */ + ref?: string; +} diff --git a/src/api/types/CommonConnectorAuthType.ts b/src/api/types/CommonConnectorAuthType.ts new file mode 100644 index 00000000..2a11f3ff --- /dev/null +++ b/src/api/types/CommonConnectorAuthType.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Authentication mechanism. */ +export const CommonConnectorAuthType = { + None: "none", + Bearer: "bearer", + ApiKey: "apiKey", + Oauth2: "oauth2", +} as const; +export type CommonConnectorAuthType = (typeof CommonConnectorAuthType)[keyof typeof CommonConnectorAuthType]; diff --git a/src/api/types/CommonConnectorCreateRequest.ts b/src/api/types/CommonConnectorCreateRequest.ts new file mode 100644 index 00000000..bff44d16 --- /dev/null +++ b/src/api/types/CommonConnectorCreateRequest.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Same envelope as `Connector` but without the server-generated `id`. + */ +export type CommonConnectorCreateRequest = + | Corti.CommonRegistryConnectorCreate + | Corti.CommonMcpConnectorCreate + | Corti.CommonAgentConnectorCreate + | Corti.CommonA2AConnectorCreate + | Corti.CommonSchemaConnectorCreate; diff --git a/src/api/types/CommonConnectorIdValue.ts b/src/api/types/CommonConnectorIdValue.ts new file mode 100644 index 00000000..a4170444 --- /dev/null +++ b/src/api/types/CommonConnectorIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Connector identifier. Accepts `con.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonConnectorIdValue = string; diff --git a/src/api/types/CommonConnectorResponse.ts b/src/api/types/CommonConnectorResponse.ts new file mode 100644 index 00000000..05a8410f --- /dev/null +++ b/src/api/types/CommonConnectorResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector attached to an agent, discriminated by `type`. + */ +export type CommonConnectorResponse = + | Corti.CommonRegistryConnectorProvisioned + | Corti.CommonMcpConnector + | Corti.CommonAgentConnector + | Corti.CommonA2AConnector + | Corti.CommonSchemaConnector; diff --git a/src/api/types/CommonConnectorType.ts b/src/api/types/CommonConnectorType.ts new file mode 100644 index 00000000..88d075cd --- /dev/null +++ b/src/api/types/CommonConnectorType.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The connector discriminator. v2 ships `registry`, `mcp`, `agent`, + * `a2a`, and `schema`; `openapi` and `custom` are reserved for future + * minor versions. + */ +export const CommonConnectorType = { + Registry: "registry", + Mcp: "mcp", + Agent: "agent", + A2A: "a2a", + Schema: "schema", +} as const; +export type CommonConnectorType = (typeof CommonConnectorType)[keyof typeof CommonConnectorType]; diff --git a/src/api/types/CommonContextIdValue.ts b/src/api/types/CommonContextIdValue.ts new file mode 100644 index 00000000..c5ea5a8e --- /dev/null +++ b/src/api/types/CommonContextIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Context identifier. Accepts `ctx.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonContextIdValue = string; diff --git a/src/api/types/CommonErrorResponse.ts b/src/api/types/CommonErrorResponse.ts new file mode 100644 index 00000000..7ceeae50 --- /dev/null +++ b/src/api/types/CommonErrorResponse.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Corti management-plane error envelope, used by all non-A2A endpoints. + * + * - **Standard** — when the error chain contains at least one `PublicError`, + * `code` and `message` come from the outermost `PublicError` and `details` + * is merged across the whole chain (outer values take precedence). + * - **Fallback** — when the chain contains no `PublicError`, the response is + * a generic `500` carrying a `requestId` for support reference. + * - **Validation** — a single `PublicError` whose `details.validationErrors` + * lists the offending fields. + * + * Field names use camelCase on the wire (e.g. `requestId`, `howToFix`). + * The free-form `details` object may carry arbitrary caller-defined keys. + * + * Rate limiting (HTTP 429) is not yet implemented; the server does not emit a 429 response. + */ +export interface CommonErrorResponse { + /** The error object with code, message, and optional details. */ + error: Corti.CommonErrorResponseError; +} diff --git a/src/api/types/CommonErrorResponseError.ts b/src/api/types/CommonErrorResponseError.ts new file mode 100644 index 00000000..4e0ca42c --- /dev/null +++ b/src/api/types/CommonErrorResponseError.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * The error object with code, message, and optional details. + */ +export interface CommonErrorResponseError { + /** Stable, machine-readable, SCREAMING_SNAKE_CASE error code. */ + code: string; + /** Human-readable explanation. */ + message: string; + /** Optional guidance for the caller to resolve the error. */ + howToFix?: string; + /** + * Structured context, merged from every `PublicError` in the chain + * (outer values win). Omitted on the generic fallback response. + */ + details?: Corti.CommonErrorResponseErrorDetails; + /** + * Correlation ID from request middleware. Included only on the + * generic `500` fallback so consumers can quote it in support requests. + */ + requestId?: string; +} diff --git a/src/api/types/CommonErrorResponseErrorDetails.ts b/src/api/types/CommonErrorResponseErrorDetails.ts new file mode 100644 index 00000000..e20d410b --- /dev/null +++ b/src/api/types/CommonErrorResponseErrorDetails.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Structured context, merged from every `PublicError` in the chain + * (outer values win). Omitted on the generic fallback response. + */ +export interface CommonErrorResponseErrorDetails { + /** Present when `code` is `VALIDATION_FAILED`. */ + validationErrors?: Corti.CommonErrorResponseErrorDetailsValidationErrorsItem[]; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts new file mode 100644 index 00000000..541d42b2 --- /dev/null +++ b/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CommonErrorResponseErrorDetailsValidationErrorsItem { + /** The field that failed validation. */ + field: string; + /** Why the field failed validation. */ + reason: string; +} diff --git a/src/api/types/CommonMcpConnector.ts b/src/api/types/CommonMcpConnector.ts new file mode 100644 index 00000000..d64b84ef --- /dev/null +++ b/src/api/types/CommonMcpConnector.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector backed by a remote MCP server. + */ +export interface CommonMcpConnector { + type: "mcp"; + /** Display name for the MCP connector. */ + name: string; + /** MCP server endpoint URL. */ + url: string; + auth?: Corti.CommonConnectorAuth; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonMcpConnectorCreate.ts b/src/api/types/CommonMcpConnectorCreate.ts new file mode 100644 index 00000000..d553e5b5 --- /dev/null +++ b/src/api/types/CommonMcpConnectorCreate.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for attaching an MCP connector. + */ +export interface CommonMcpConnectorCreate { + type: "mcp"; + /** Display name for the MCP connector. */ + name: string; + /** MCP server endpoint URL. */ + url: string; + /** Whether the connector is active for invocations. */ + enabled?: boolean; + auth?: Corti.CommonConnectorAuth; +} diff --git a/src/api/types/CommonMessage.ts b/src/api/types/CommonMessage.ts new file mode 100644 index 00000000..444606cc --- /dev/null +++ b/src/api/types/CommonMessage.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An A2A message — an ordered list of content parts with a role. + */ +export interface CommonMessage { + messageId?: Corti.CommonMessageIdValue; + contextId?: Corti.CommonContextIdValue; + taskId?: Corti.CommonTaskIdValue; + role: Corti.CommonRole; + /** Ordered content parts of the message. */ + parts: Corti.CommonPart[]; + /** Task ids this message references (A2A v1.0 `Message.referenceTaskIds`). */ + referenceTaskIds?: Corti.CommonTaskIdValue[]; + /** URIs of A2A extensions that contributed to this message (A2A v1.0 `Message.extensions`). */ + extensions?: string[]; + /** + * Free-form A2A metadata. Corti's own first-party keys are prefixed + * with `$` (à la Mixpanel) to set them apart from caller-supplied keys. + * A2A defines no message-level timestamp, so Corti carries one as + * `$timestamp` (RFC 3339 / ISO 8601) — useful for timing *user* + * messages, which `TaskStatus.timestamp` cannot. + */ + metadata?: Record; +} diff --git a/src/api/types/CommonMessageIdValue.ts b/src/api/types/CommonMessageIdValue.ts new file mode 100644 index 00000000..698241f0 --- /dev/null +++ b/src/api/types/CommonMessageIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Message identifier. Accepts `msg.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonMessageIdValue = string; diff --git a/src/api/types/CommonNextPageToken.ts b/src/api/types/CommonNextPageToken.ts new file mode 100644 index 00000000..d6b4861e --- /dev/null +++ b/src/api/types/CommonNextPageToken.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Opaque cursor to request the next page, or `null` if there are no more pages. + */ +export type CommonNextPageToken = string | null; diff --git a/src/api/types/CommonPart.ts b/src/api/types/CommonPart.ts new file mode 100644 index 00000000..aef7692d --- /dev/null +++ b/src/api/types/CommonPart.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * A single content part of a message or artifact. + */ +export interface CommonPart { + /** The string content of the `text` part. */ + text?: string; + /** Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null). */ + data?: Record; + /** An optional `filename` for the file (e.g., `document.pdf`). */ + filename?: string; + /** The `media_type` (MIME type) of the part content (e.g., `text/plain`, `application/json`, `image/png`). */ + mediaType?: string; + /** The `raw` byte content of a file. Encoded as a base64 string. */ + raw?: string; + /** A `url` pointing to the file's content. */ + url?: string; + /** Optional metadata associated with this part. */ + metadata?: Record; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/types/CommonRegistryConnectorCreate.ts b/src/api/types/CommonRegistryConnectorCreate.ts new file mode 100644 index 00000000..a8442138 --- /dev/null +++ b/src/api/types/CommonRegistryConnectorCreate.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Request body for attaching a registry connector. + */ +export interface CommonRegistryConnectorCreate { + type: "registry"; + /** Registry connector name. */ + name: string; + /** Whether the connector is active for invocations. */ + enabled?: boolean; + /** Connector-specific configuration validated against the registry schema. Not yet persisted — the server currently drops `config` for registry connectors on create. */ + config?: Record; +} diff --git a/src/api/types/CommonRegistryConnectorProvisioned.ts b/src/api/types/CommonRegistryConnectorProvisioned.ts new file mode 100644 index 00000000..4b13e427 --- /dev/null +++ b/src/api/types/CommonRegistryConnectorProvisioned.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector provisioned from a registry entry. + */ +export interface CommonRegistryConnectorProvisioned { + type: "registry"; + /** Registry connector name. */ + name: string; + /** Connector-specific configuration validated against the registry schema. */ + config?: Record; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonRole.ts b/src/api/types/CommonRole.ts new file mode 100644 index 00000000..e3947086 --- /dev/null +++ b/src/api/types/CommonRole.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The author of a message. */ +export const CommonRole = { + RoleUser: "ROLE_USER", + RoleAgent: "ROLE_AGENT", +} as const; +export type CommonRole = (typeof CommonRole)[keyof typeof CommonRole]; diff --git a/src/api/types/CommonSchemaConnector.ts b/src/api/types/CommonSchemaConnector.ts new file mode 100644 index 00000000..2cae8b20 --- /dev/null +++ b/src/api/types/CommonSchemaConnector.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A connector backed by a schema definition. + */ +export interface CommonSchemaConnector { + type: "schema"; + /** Schema connector name. Used as the tool name the LLM calls. */ + name: string; + /** What the tool does. Read by the LLM to decide when to call it. */ + description?: string; + /** JSON Schema defining the tool's output shape. */ + schema: Record; + /** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ + transition?: Corti.CommonSchemaConnectorTransition; + /** + * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH + * replacements where the underlying spec is unchanged. Used by + * observability/HITL to reference a connector unambiguously. + */ + id?: Corti.CommonConnectorIdValue; + /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ + enabled?: boolean; +} diff --git a/src/api/types/CommonSchemaConnectorCreate.ts b/src/api/types/CommonSchemaConnectorCreate.ts new file mode 100644 index 00000000..5de599c1 --- /dev/null +++ b/src/api/types/CommonSchemaConnectorCreate.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Request body for attaching a schema connector. + */ +export interface CommonSchemaConnectorCreate { + type: "schema"; + /** Schema connector name. */ + name: string; + /** What the tool does. Read by the LLM to decide when to call it. */ + description?: string; + /** JSON Schema defining the tool's output shape. */ + schema: Record; + /** If set, calling this tool terminates the loop in the given state. */ + transition?: Corti.CommonSchemaConnectorCreateTransition; + /** Whether the connector is active for invocations. */ + enabled?: boolean; +} diff --git a/src/api/types/CommonSchemaConnectorCreateTransition.ts b/src/api/types/CommonSchemaConnectorCreateTransition.ts new file mode 100644 index 00000000..103aba0a --- /dev/null +++ b/src/api/types/CommonSchemaConnectorCreateTransition.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** If set, calling this tool terminates the loop in the given state. */ +export const CommonSchemaConnectorCreateTransition = { + Complete: "complete", + InputRequired: "input_required", +} as const; +export type CommonSchemaConnectorCreateTransition = + (typeof CommonSchemaConnectorCreateTransition)[keyof typeof CommonSchemaConnectorCreateTransition]; diff --git a/src/api/types/CommonSchemaConnectorTransition.ts b/src/api/types/CommonSchemaConnectorTransition.ts new file mode 100644 index 00000000..a169a64a --- /dev/null +++ b/src/api/types/CommonSchemaConnectorTransition.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ +export const CommonSchemaConnectorTransition = { + Complete: "complete", + InputRequired: "input_required", +} as const; +export type CommonSchemaConnectorTransition = + (typeof CommonSchemaConnectorTransition)[keyof typeof CommonSchemaConnectorTransition]; diff --git a/src/api/types/CommonTaskIdValue.ts b/src/api/types/CommonTaskIdValue.ts new file mode 100644 index 00000000..1bbf83f3 --- /dev/null +++ b/src/api/types/CommonTaskIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Task identifier. Accepts `task.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type CommonTaskIdValue = string; diff --git a/src/api/types/CommonTaskListResponse.ts b/src/api/types/CommonTaskListResponse.ts new file mode 100644 index 00000000..cd8c0aea --- /dev/null +++ b/src/api/types/CommonTaskListResponse.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of tasks. + */ +export interface CommonTaskListResponse { + /** The page size used for this response. */ + pageSize?: number; + /** Tasks on the current page. */ + tasks: Corti.CommonTaskResponse[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/CommonTaskMetadata.ts b/src/api/types/CommonTaskMetadata.ts new file mode 100644 index 00000000..df32e38b --- /dev/null +++ b/src/api/types/CommonTaskMetadata.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Free-form A2A task metadata. Corti's first-party keys are prefixed with + * `$` (à la Mixpanel) to set them apart from caller-supplied keys. Token and + * credit accounting is carried under `$usage`. Arbitrary additional keys are + * permitted. + */ +export interface CommonTaskMetadata { + usage?: Corti.CommonUsage; + /** Accepts any additional properties */ + [key: string]: any; +} diff --git a/src/api/types/CommonTaskResponse.ts b/src/api/types/CommonTaskResponse.ts new file mode 100644 index 00000000..877dc4c1 --- /dev/null +++ b/src/api/types/CommonTaskResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An A2A task — a unit of agent work with status, history, and artifacts. + */ +export interface CommonTaskResponse { + id: Corti.CommonTaskIdValue; + contextId: Corti.CommonContextIdValue; + status: Corti.CommonTaskStatus; + /** Messages exchanged during the task, oldest first. */ + history?: Corti.CommonMessage[]; + /** Artifacts produced by the task. */ + artifacts?: Corti.CommonArtifactResponse[]; + /** Task metadata, including `$usage` token/credit accounting. Not yet exposed through the REST binding (deferred); only the JSON-RPC binding populates this field. */ + metadata?: Corti.CommonTaskMetadata; +} diff --git a/src/api/types/CommonTaskState.ts b/src/api/types/CommonTaskState.ts new file mode 100644 index 00000000..0ee2d276 --- /dev/null +++ b/src/api/types/CommonTaskState.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The lifecycle state of a task. */ +export const CommonTaskState = { + TaskStateSubmitted: "TASK_STATE_SUBMITTED", + TaskStateWorking: "TASK_STATE_WORKING", + TaskStateCompleted: "TASK_STATE_COMPLETED", + TaskStateFailed: "TASK_STATE_FAILED", + TaskStateCanceled: "TASK_STATE_CANCELED", + TaskStateInputRequired: "TASK_STATE_INPUT_REQUIRED", + TaskStateRejected: "TASK_STATE_REJECTED", + TaskStateAuthRequired: "TASK_STATE_AUTH_REQUIRED", +} as const; +export type CommonTaskState = (typeof CommonTaskState)[keyof typeof CommonTaskState]; diff --git a/src/api/types/CommonTaskStatus.ts b/src/api/types/CommonTaskStatus.ts new file mode 100644 index 00000000..d2d4b371 --- /dev/null +++ b/src/api/types/CommonTaskStatus.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A task's current state, with an optional status message and timestamp. + */ +export interface CommonTaskStatus { + state: Corti.CommonTaskState; + message?: Corti.CommonMessage; + /** When the status was last updated. */ + timestamp?: Date; +} diff --git a/src/api/types/CommonTotalSize.ts b/src/api/types/CommonTotalSize.ts new file mode 100644 index 00000000..8dc035c2 --- /dev/null +++ b/src/api/types/CommonTotalSize.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Total number of items matching the query, when known. Not currently populated by the server; treat as absent. + */ +export type CommonTotalSize = number; diff --git a/src/api/types/CommonUsage.ts b/src/api/types/CommonUsage.ts new file mode 100644 index 00000000..da9f9b51 --- /dev/null +++ b/src/api/types/CommonUsage.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Token and credit accounting for a task, following the conventions used by + * major LLM providers. `inputTokens`/`outputTokens` count the prompt and + * completion respectively; `cachedInputTokens` is the subset of + * `inputTokens` served from the provider's prompt cache (a discount, not an + * addition), and `cacheCreationInputTokens` is the surcharge paid to + * *write* the cache. `totalTokens` is the all-in count. `credits` is the + * Corti billing unit charged for the task. + */ +export interface CommonUsage { + /** The model identifier that served the request. */ + model?: string; + /** Prompt tokens consumed. */ + inputTokens: number; + /** Completion tokens produced. */ + outputTokens: number; + /** Subset of `inputTokens` served from the prompt cache (cache read). */ + cachedInputTokens?: number; + /** Input tokens written to the prompt cache (cache-write surcharge). */ + cacheCreationInputTokens?: number; + /** Total tokens billed (`inputTokens` + `outputTokens`). */ + totalTokens: number; + /** Corti billing credits charged for the task. */ + credits?: number; +} diff --git a/src/api/types/ConnectorsListResponse.ts b/src/api/types/ConnectorsListResponse.ts new file mode 100644 index 00000000..b3974960 --- /dev/null +++ b/src/api/types/ConnectorsListResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An agent's attached connectors. + */ +export interface ConnectorsListResponse { + /** Connectors attached to the agent. */ + connectors: Corti.CommonConnectorResponse[]; +} diff --git a/src/api/types/Contexts.ts b/src/api/types/Contexts.ts new file mode 100644 index 00000000..1a17c5f1 --- /dev/null +++ b/src/api/types/Contexts.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Lightweight context metadata, as returned in list responses. Contexts are not first-class CRUD resources: there is no explicit create or update endpoint — a context is created implicitly on the first message send (or reused by client-supplied contextId), and list is not yet implemented. + */ +export interface Contexts { + id: Corti.CommonContextIdValue; + agentId?: Corti.CommonAgentIdValue; + /** Total number of tasks in the context. */ + taskCount?: number; + /** When the context was created. */ + createdAt?: Date; + /** When the context was last updated. */ + updatedAt?: Date; + /** When the context expires; `null` means it does not expire. Not yet implemented — the server always returns `null` and performs no TTL-based cleanup. */ + expiresAt?: Date | null; +} diff --git a/src/api/types/ContextsDetailResponse.ts b/src/api/types/ContextsDetailResponse.ts new file mode 100644 index 00000000..76b54a75 --- /dev/null +++ b/src/api/types/ContextsDetailResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A context together with its tasks. Returned by `GET /contexts/{id}`. + * Tasks are ordered oldest first and each carries its full message + * `history` — the user's prompt for a task is the `ROLE_USER` message + * within that task's history. + */ +export interface ContextsDetailResponse extends Corti.Contexts { + /** The context's tasks, oldest first, each with full message history. */ + tasks: Corti.CommonTaskResponse[]; +} diff --git a/src/api/types/ContextsListResponse.ts b/src/api/types/ContextsListResponse.ts new file mode 100644 index 00000000..48126c80 --- /dev/null +++ b/src/api/types/ContextsListResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of contexts. + */ +export interface ContextsListResponse { + /** Contexts on the current page. */ + contexts: Corti.Contexts[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/ContextsOpenInferenceSpan.ts b/src/api/types/ContextsOpenInferenceSpan.ts new file mode 100644 index 00000000..281c1fee --- /dev/null +++ b/src/api/types/ContextsOpenInferenceSpan.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * A single span in an OpenInference trace. + */ +export interface ContextsOpenInferenceSpan { + /** Human-readable span name. */ + name: string; + /** Unique span identifier. */ + spanId: string; + /** Parent span id, omitted for the root span. */ + parentSpanId?: string; + /** When the span started. */ + startTime: Date; + /** When the span ended; `null` if still in progress. */ + endTime?: Date | null; + /** OpenInference span attributes. Key names and structure follow the OpenInference semantic conventions. */ + attributes?: Record; +} diff --git a/src/api/types/ContextsTraceItem.ts b/src/api/types/ContextsTraceItem.ts new file mode 100644 index 00000000..886870a4 --- /dev/null +++ b/src/api/types/ContextsTraceItem.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A single trace with its inlined OpenInference spans. + */ +export interface ContextsTraceItem { + /** The trace-level record. */ + trace: Corti.ContextsTraceItemTrace; + /** Spans in this trace, ordered by start time. */ + spans: Corti.ContextsOpenInferenceSpan[]; +} diff --git a/src/api/types/ContextsTraceItemTrace.ts b/src/api/types/ContextsTraceItemTrace.ts new file mode 100644 index 00000000..cf6a1384 --- /dev/null +++ b/src/api/types/ContextsTraceItemTrace.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The trace-level record. + */ +export interface ContextsTraceItemTrace { + /** Trace identifier (OTel trace ID — 32-char hex). */ + id: string; + /** Human-readable trace name. */ + name: string; + /** When the trace started. */ + startTime: Date; + /** When the trace ended; `null` if still in progress. */ + endTime?: Date | null; + /** Trace-level input payload. */ + input?: Record; + /** Trace-level output payload. */ + output?: Record; + /** Free-form trace metadata. */ + metadata?: Record; + /** Trace tags. */ + tags?: string[]; + /** Thread/context identifier. */ + threadId: string; +} diff --git a/src/api/types/ContextsTraceResponse.ts b/src/api/types/ContextsTraceResponse.ts new file mode 100644 index 00000000..8f4aaef2 --- /dev/null +++ b/src/api/types/ContextsTraceResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of traces for a context in OpenInference format. Traces are + * ordered newest-first. + */ +export interface ContextsTraceResponse { + /** Traces for the context, newest first. */ + traces: Corti.ContextsTraceItem[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/FeedbackActor.ts b/src/api/types/FeedbackActor.ts new file mode 100644 index 00000000..135da226 --- /dev/null +++ b/src/api/types/FeedbackActor.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Customer-defined opaque identifier for the feedback submitter. + */ +export interface FeedbackActor { + /** + * Scoped to the authenticated customer; not globally unique and not + * independently verified. Should preferably be pseudonymous and must + * not contain names, emails, national identifiers, or medical record + * numbers. + */ + externalId: string; +} diff --git a/src/api/types/FeedbackIdValue.ts b/src/api/types/FeedbackIdValue.ts new file mode 100644 index 00000000..0ff14a45 --- /dev/null +++ b/src/api/types/FeedbackIdValue.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Feedback identifier. Accepts `fb.` or a bare UUIDv7 on input; always returned prefixed. + */ +export type FeedbackIdValue = string; diff --git a/src/api/types/FeedbackLabel.ts b/src/api/types/FeedbackLabel.ts new file mode 100644 index 00000000..42fd846b --- /dev/null +++ b/src/api/types/FeedbackLabel.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Structured observation about the result. Positive and negative labels + * share one taxonomy so customers can represent mixed feedback. + * - `correct` — factually and contextually correct (positive). + * - `complete` — included the important expected information (positive). + * - `helpful` — materially helped the user complete their task (positive). + * - `wellPresented` — clear, readable, appropriately structured (positive). + * - `efficient` — reached a useful result without unnecessary content (positive). + * - `incorrect` — one or more claims, conclusions, or actions were wrong (negative). + * - `missingInformation` — important or expected information was omitted (negative). + * - `irrelevant` — included content that did not address the request (negative). + * - `misunderstoodRequest` — the system responded to the wrong intent (negative). + * - `unsupportedClaim` — a claim not supported by available information (negative). + * - `unsafeOrInappropriate` — unsafe, disallowed, or unsuitable (negative). + * - `poorlyPresented` — difficult to read or unsuitably structured (negative). + * - `tooVerbose` — substantially more detail than useful (negative). + * - `other` — another observation described in `reason` (both). + */ +export const FeedbackLabel = { + Correct: "correct", + Complete: "complete", + Helpful: "helpful", + WellPresented: "wellPresented", + Efficient: "efficient", + Incorrect: "incorrect", + MissingInformation: "missingInformation", + Irrelevant: "irrelevant", + MisunderstoodRequest: "misunderstoodRequest", + UnsupportedClaim: "unsupportedClaim", + UnsafeOrInappropriate: "unsafeOrInappropriate", + PoorlyPresented: "poorlyPresented", + TooVerbose: "tooVerbose", + Other: "other", +} as const; +export type FeedbackLabel = (typeof FeedbackLabel)[keyof typeof FeedbackLabel]; diff --git a/src/api/types/FeedbackListResponse.ts b/src/api/types/FeedbackListResponse.ts new file mode 100644 index 00000000..54691bf9 --- /dev/null +++ b/src/api/types/FeedbackListResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * All feedback resources for a task, newest-first. Feedback is scoped to the authenticated user via row-level security. + */ +export interface FeedbackListResponse { + /** Feedback resources for the task. */ + feedbacks: Corti.FeedbackResponse[]; +} diff --git a/src/api/types/FeedbackMetadata.ts b/src/api/types/FeedbackMetadata.ts new file mode 100644 index 00000000..9492bd17 --- /dev/null +++ b/src/api/types/FeedbackMetadata.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Customer-provided provenance and correlation information. + */ +export interface FeedbackMetadata { + /** How the customer collected the feedback. Informational only; does not affect rating validation or normalization. */ + collectionMethod?: string; + /** + * Customer-defined reference to correlate the feedback with an object + * in the customer's own system. Not unique and does not provide + * idempotency. Should not contain sensitive information. + */ + clientReference?: string; + actor?: Corti.FeedbackActor; +} diff --git a/src/api/types/FeedbackRating.ts b/src/api/types/FeedbackRating.ts new file mode 100644 index 00000000..3c27151a --- /dev/null +++ b/src/api/types/FeedbackRating.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * The original rating supplied by the customer. + */ +export interface FeedbackRating { + scale: Corti.FeedbackRatingScale; + /** The rating value on the selected scale. */ + value: number; +} diff --git a/src/api/types/FeedbackRatingScale.ts b/src/api/types/FeedbackRatingScale.ts new file mode 100644 index 00000000..3685fe8b --- /dev/null +++ b/src/api/types/FeedbackRatingScale.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The scale on which the rating was collected. + * - `binary` — 0 (negative) or 1 (positive). + * + * Planned (not yet available): `likert5` (integer 1–5), `continuous01` (number 0–1). + */ +export const FeedbackRatingScale = { + Binary: "binary", +} as const; +export type FeedbackRatingScale = (typeof FeedbackRatingScale)[keyof typeof FeedbackRatingScale]; diff --git a/src/api/types/FeedbackResponse.ts b/src/api/types/FeedbackResponse.ts new file mode 100644 index 00000000..a336cc94 --- /dev/null +++ b/src/api/types/FeedbackResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A stored feedback resource. + */ +export interface FeedbackResponse { + id: Corti.FeedbackIdValue; + taskId: Corti.CommonTaskIdValue; + rating: Corti.FeedbackRating; + /** + * Corti-derived internal score between 0 and 1. The original scale and + * value are always retained alongside this score. + */ + normalizedScore: number; + /** Structured observations about the result. */ + labels: Corti.FeedbackLabel[]; + /** Free-text explanation of the rating or labels. */ + reason?: string; + target?: Corti.FeedbackTarget; + metadata?: Corti.FeedbackMetadata; + /** When the feedback was created. */ + createdAt?: Date; +} diff --git a/src/api/types/FeedbackTarget.ts b/src/api/types/FeedbackTarget.ts new file mode 100644 index 00000000..228e9b62 --- /dev/null +++ b/src/api/types/FeedbackTarget.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Identifies the specific user-visible response being evaluated. If + * omitted, the feedback applies to the task as a whole. + */ +export interface FeedbackTarget { + messageId: Corti.CommonMessageIdValue; +} diff --git a/src/api/types/RegistryConnectorCapabilities.ts b/src/api/types/RegistryConnectorCapabilities.ts new file mode 100644 index 00000000..5cc904b6 --- /dev/null +++ b/src/api/types/RegistryConnectorCapabilities.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * What the connector can do once attached. + */ +export interface RegistryConnectorCapabilities { + /** Emits incremental updates during a task. */ + streaming?: boolean; + /** Accepted input media types. */ + inputModes?: string[]; + /** Produced output media types. */ + outputModes?: string[]; + /** Names of tools the connector exposes to the agent. */ + tools?: string[]; +} diff --git a/src/api/types/RegistryConnectorListResponse.ts b/src/api/types/RegistryConnectorListResponse.ts new file mode 100644 index 00000000..05674681 --- /dev/null +++ b/src/api/types/RegistryConnectorListResponse.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A page of registry connectors. + */ +export interface RegistryConnectorListResponse { + /** Registry connectors on the current page. */ + connectors: Corti.RegistryConnectorResponse[]; + nextPageToken?: Corti.CommonNextPageToken | null; + totalSize?: Corti.CommonTotalSize; +} diff --git a/src/api/types/RegistryConnectorResponse.ts b/src/api/types/RegistryConnectorResponse.ts new file mode 100644 index 00000000..b4fcbac7 --- /dev/null +++ b/src/api/types/RegistryConnectorResponse.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * A discoverable, pre-built connector offered by the platform registry. + * Only `id`, `type`, `name`, `title`, `description`, and `configSchema` are populated by the server today. `version`, `provider`, `capabilities`, `tags`, and `documentationUrl` are declared for forward compatibility but are not yet returned. + */ +export interface RegistryConnectorResponse { + /** Stable, namespaced registry identifier; use as a `registry` connector's `name`. */ + id: string; + /** The connector kind this entry provisions when attached to an agent. */ + type: Corti.CommonConnectorType; + /** Programmatic name (MCP convention). */ + name: string; + /** Human-readable display name (MCP convention). */ + title?: string; + /** Description for list and detail views. May contain CommonMark. */ + description?: string; + /** Latest published version (SemVer recommended). */ + version?: string; + /** Display icons (MCP convention). */ + icons?: Corti.RegistryIcon[]; + /** Name of the publishing organisation. */ + provider?: string; + /** Connector homepage (MCP convention). */ + websiteUrl?: string; + /** Documentation URL for the connector. */ + documentationUrl?: string; + capabilities?: Corti.RegistryConnectorCapabilities; + /** Keywords for search and filtering. */ + tags?: string[]; + /** JSON Schema (draft 2020-12) describing the connector's accepted `config`. */ + configSchema?: Record; +} diff --git a/src/api/types/RegistryIcon.ts b/src/api/types/RegistryIcon.ts new file mode 100644 index 00000000..cfea9234 --- /dev/null +++ b/src/api/types/RegistryIcon.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * An icon resource, following the MCP `Icon` shape. + */ +export interface RegistryIcon { + /** Icon source URL. */ + src: string; + /** MIME type of the icon resource. */ + mimeType?: string; + /** `WxH` size hints (e.g. `48x48`), or `any` for scalable icons. */ + sizes?: string[]; +} diff --git a/src/api/types/UsageBucket.ts b/src/api/types/UsageBucket.ts new file mode 100644 index 00000000..5d9f542a --- /dev/null +++ b/src/api/types/UsageBucket.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Usage metrics for a single time bucket. + */ +export interface UsageBucket extends Corti.UsageMetrics { + /** Inclusive start of the bucket (UTC). */ + periodStart: Date; + /** Exclusive end of the bucket (UTC). */ + periodEnd: Date; +} diff --git a/src/api/types/UsageGranularity.ts b/src/api/types/UsageGranularity.ts new file mode 100644 index 00000000..05c67177 --- /dev/null +++ b/src/api/types/UsageGranularity.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The size of each usage reporting bucket. Only `day` is currently honored; `minute`, `hour`, and `week` are accepted but produce daily buckets (the server always returns `day`). */ +export const UsageGranularity = { + Minute: "minute", + Hour: "hour", + Day: "day", + Week: "week", +} as const; +export type UsageGranularity = (typeof UsageGranularity)[keyof typeof UsageGranularity]; diff --git a/src/api/types/UsageMetrics.ts b/src/api/types/UsageMetrics.ts new file mode 100644 index 00000000..d10a21ac --- /dev/null +++ b/src/api/types/UsageMetrics.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Invocation metrics for a single period. + */ +export interface UsageMetrics { + /** Number of agent invocations in the period. */ + invocations: number; + /** Number of distinct contexts invoked in the period. */ + uniqueContexts: number; +} diff --git a/src/api/types/UsageReportResponse.ts b/src/api/types/UsageReportResponse.ts new file mode 100644 index 00000000..117bfc7b --- /dev/null +++ b/src/api/types/UsageReportResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * An agent's bucketed usage over a date range, with range-wide totals. + */ +export interface UsageReportResponse { + granularity: Corti.UsageGranularity; + /** Resolved inclusive start of the range (UTC). */ + from: Date; + /** Resolved exclusive end of the range (UTC). */ + to: Date; + /** Aggregate metrics across the whole range. */ + totals: Corti.UsageMetrics; + /** One entry per period with activity, ordered oldest first. */ + buckets: Corti.UsageBucket[]; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 7ce73b9e..2ffaffbc 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,3 +1,17 @@ +export * from "./A2AjsonrpcResponse.js"; +export * from "./A2AjsonrpcResponseError.js"; +export * from "./A2AjsonrpcResponseId.js"; +export * from "./A2ASendMessageConfiguration.js"; +export * from "./A2ASendMessageRequest.js"; +export * from "./A2ASendMessageResponse.js"; +export * from "./A2AStreamEventResponse.js"; +export * from "./AgentCardResponse.js"; +export * from "./AgentCardResponseCapabilities.js"; +export * from "./AgentCardResponseProvider.js"; +export * from "./AgentCardResponseSignaturesItem.js"; +export * from "./AgentCardResponseSkillsItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; export * from "./AgentsAgent.js"; export * from "./AgentsAgentCapabilities.js"; export * from "./AgentsAgentCard.js"; @@ -31,6 +45,9 @@ export * from "./AgentsFilePartFile.js"; export * from "./AgentsFilePartKind.js"; export * from "./AgentsFileWithBytes.js"; export * from "./AgentsFileWithUri.js"; +export * from "./AgentsLabels.js"; +export * from "./AgentsLifecycle.js"; +export * from "./AgentsListResponse.js"; export * from "./AgentsMcpServer.js"; export * from "./AgentsMcpServerAuthorizationType.js"; export * from "./AgentsMcpServerTransportType.js"; @@ -45,6 +62,7 @@ export * from "./AgentsRegistryExpert.js"; export * from "./AgentsRegistryExpertsResponse.js"; export * from "./AgentsRegistryMcpServer.js"; export * from "./AgentsRegistryMcpServerAuthorizationType.js"; +export * from "./AgentsResponse.js"; export * from "./AgentsTask.js"; export * from "./AgentsTaskKind.js"; export * from "./AgentsTaskStatus.js"; @@ -52,6 +70,8 @@ export * from "./AgentsTaskStatusState.js"; export * from "./AgentsTextPart.js"; export * from "./AgentsTextPartKind.js"; export * from "./AgentsUpdateExpertReference.js"; +export * from "./AgentsUserIdValue.js"; +export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -63,20 +83,67 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; +export * from "./CommonA2AConnector.js"; +export * from "./CommonA2AConnectorCreate.js"; +export * from "./CommonAgentConnector.js"; +export * from "./CommonAgentConnectorCreate.js"; +export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; +export * from "./CommonArtifactIdValue.js"; +export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; +export * from "./CommonConnectorAuth.js"; +export * from "./CommonConnectorAuthType.js"; +export * from "./CommonConnectorCreateRequest.js"; +export * from "./CommonConnectorIdValue.js"; +export * from "./CommonConnectorResponse.js"; +export * from "./CommonConnectorType.js"; +export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; +export * from "./CommonErrorResponse.js"; +export * from "./CommonErrorResponseError.js"; +export * from "./CommonErrorResponseErrorDetails.js"; +export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; +export * from "./CommonMcpConnector.js"; +export * from "./CommonMcpConnectorCreate.js"; +export * from "./CommonMessage.js"; +export * from "./CommonMessageIdValue.js"; +export * from "./CommonNextPageToken.js"; +export * from "./CommonPart.js"; +export * from "./CommonRegistryConnectorCreate.js"; +export * from "./CommonRegistryConnectorProvisioned.js"; +export * from "./CommonRole.js"; +export * from "./CommonSchemaConnector.js"; +export * from "./CommonSchemaConnectorCreate.js"; +export * from "./CommonSchemaConnectorCreateTransition.js"; +export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; +export * from "./CommonTaskIdValue.js"; +export * from "./CommonTaskListResponse.js"; +export * from "./CommonTaskMetadata.js"; +export * from "./CommonTaskResponse.js"; +export * from "./CommonTaskState.js"; +export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; +export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; +export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; +export * from "./ConnectorsListResponse.js"; +export * from "./Contexts.js"; +export * from "./ContextsDetailResponse.js"; +export * from "./ContextsListResponse.js"; +export * from "./ContextsOpenInferenceSpan.js"; +export * from "./ContextsTraceItem.js"; +export * from "./ContextsTraceItemTrace.js"; +export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -112,6 +179,15 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; +export * from "./FeedbackActor.js"; +export * from "./FeedbackIdValue.js"; +export * from "./FeedbackLabel.js"; +export * from "./FeedbackListResponse.js"; +export * from "./FeedbackMetadata.js"; +export * from "./FeedbackRating.js"; +export * from "./FeedbackRatingScale.js"; +export * from "./FeedbackResponse.js"; +export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -187,6 +263,10 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; +export * from "./RegistryConnectorCapabilities.js"; +export * from "./RegistryConnectorListResponse.js"; +export * from "./RegistryConnectorResponse.js"; +export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -273,4 +353,8 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; +export * from "./UsageBucket.js"; +export * from "./UsageGranularity.js"; +export * from "./UsageMetrics.js"; +export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/src/core/index.ts b/src/core/index.ts index e2aca287..ede84012 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -6,6 +6,7 @@ export * as logging from "./logging/index.js"; export * from "./pagination/index.js"; export * from "./runtime/index.js"; export * as serialization from "./schemas/index.js"; +export * from "./stream/index.js"; export * as url from "./url/index.js"; export * from "./utils/index.js"; export * from "./websocket/index.js"; diff --git a/src/core/stream/Stream.ts b/src/core/stream/Stream.ts new file mode 100644 index 00000000..8ccdecf9 --- /dev/null +++ b/src/core/stream/Stream.ts @@ -0,0 +1,235 @@ +import { fromJson } from "../json.js"; +import { RUNTIME } from "../runtime/index.js"; + +export declare namespace Stream { + interface Args { + /** + * The HTTP response stream to read from. + */ + + stream: ReadableStream; + + /** + * The event shape to use for parsing the stream data. + */ + eventShape: JsonEvent | SseEvent; + /** + * An abort signal to stop the stream. + */ + signal?: AbortSignal; + } + + interface JsonEvent { + type: "json"; + messageTerminator: string; + } + + interface SseEvent { + type: "sse"; + streamTerminator?: string; + eventDiscriminator?: string; + } +} + +const DATA_PREFIX = "data:"; +const EVENT_PREFIX = "event:"; + +export class Stream implements AsyncIterable { + private stream: ReadableStream; + + private parse: (val: unknown) => Promise; + /** + * The prefix to use for each message. For example, + * for SSE, the prefix is "data: ". + */ + private prefix: string | undefined; + private messageTerminator: string; + private streamTerminator: string | undefined; + private eventDiscriminator: string | undefined; + private controller: AbortController = new AbortController(); + private decoder: TextDecoder | undefined; + + constructor({ stream, parse, eventShape, signal }: Stream.Args & { parse: (val: unknown) => Promise }) { + this.stream = stream; + this.parse = parse; + if (eventShape.type === "sse") { + this.prefix = DATA_PREFIX; + this.messageTerminator = "\n"; + this.streamTerminator = eventShape.streamTerminator; + this.eventDiscriminator = eventShape.eventDiscriminator; + } else { + this.messageTerminator = eventShape.messageTerminator; + } + signal?.addEventListener("abort", () => this.controller.abort()); + + // Initialize shared TextDecoder + if (typeof TextDecoder !== "undefined") { + this.decoder = new TextDecoder("utf-8"); + } + } + + private async *iterMessages(): AsyncGenerator { + if (this.eventDiscriminator != null) { + yield* this.iterSseEvents(); + } else { + yield* this.iterDataMessages(); + } + } + + private async *iterDataMessages(): AsyncGenerator { + const stream = readableStreamAsyncIterable(this.stream); + let buf = ""; + let prefixSeen = false; + for await (const chunk of stream) { + buf += this.decodeChunk(chunk); + + let terminatorIndex: number; + while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) { + let line = buf.slice(0, terminatorIndex); + buf = buf.slice(terminatorIndex + this.messageTerminator.length); + + if (!line.trim()) { + continue; + } + + if (!prefixSeen && this.prefix != null) { + const prefixIndex = line.indexOf(this.prefix); + if (prefixIndex === -1) { + continue; + } + prefixSeen = true; + line = line.slice(prefixIndex + this.prefix.length); + } + + if (this.streamTerminator != null && line.includes(this.streamTerminator)) { + return; + } + const message = await this.parse(fromJson(line)); + yield message; + prefixSeen = false; + } + } + } + + private async *iterSseEvents(): AsyncGenerator { + const stream = readableStreamAsyncIterable(this.stream); + let buf = ""; + let eventType: string | undefined; + let dataValue: string | undefined; + + for await (const chunk of stream) { + buf += this.decodeChunk(chunk); + + let terminatorIndex: number; + while ((terminatorIndex = buf.indexOf("\n")) >= 0) { + const line = buf.slice(0, terminatorIndex).replace(/\r$/, ""); + buf = buf.slice(terminatorIndex + 1); + + if (!line.trim()) { + if (dataValue != null) { + const message = await this.dispatchSseEvent(dataValue, eventType); + if (message == null) { + return; + } + yield message; + } + eventType = undefined; + dataValue = undefined; + continue; + } + + if (line.startsWith(EVENT_PREFIX)) { + eventType = line.slice(EVENT_PREFIX.length).trim(); + } else if (line.startsWith(DATA_PREFIX)) { + const val = line.slice(DATA_PREFIX.length).trim(); + dataValue = dataValue != null ? `${dataValue}\n${val}` : val; + } + } + } + + if (dataValue != null) { + const message = await this.dispatchSseEvent(dataValue, eventType); + if (message != null) { + yield message; + } + } + } + + /** + * Parses and returns a single SSE event, or returns null if the event is a stream terminator. + */ + private async dispatchSseEvent(dataValue: string, eventType: string | undefined): Promise { + if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) { + return null; + } + return this.parse(this.injectDiscriminator(fromJson(dataValue), eventType)); + } + + private injectDiscriminator(parsed: unknown, eventType: string | undefined): unknown { + if (this.eventDiscriminator == null || eventType == null) { + return parsed; + } + if (parsed == null || typeof parsed !== "object" || Array.isArray(parsed)) { + return parsed; + } + const obj = parsed as Record; + if (this.eventDiscriminator in obj) { + return parsed; + } + return { [this.eventDiscriminator]: eventType, ...obj }; + } + + async *[Symbol.asyncIterator](): AsyncIterator { + for await (const message of this.iterMessages()) { + yield message; + } + } + + private decodeChunk(chunk: any): string { + let decoded = ""; + // If TextDecoder is available, use the streaming decoder instance + if (this.decoder != null) { + decoded += this.decoder.decode(chunk, { stream: true }); + } + // Buffer is present in Node.js environment + else if (RUNTIME.type === "node" && typeof chunk !== "undefined") { + decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); + } + return decoded; + } +} + +/** + * Browser polyfill for ReadableStream + */ +// biome-ignore lint/suspicious/noExplicitAny: allow explicit any +export function readableStreamAsyncIterable(stream: any): AsyncIterableIterator { + if (stream[Symbol.asyncIterator]) { + return stream; + } + + const reader = stream.getReader(); + return { + async next() { + try { + const result = await reader.read(); + if (result?.done) { + reader.releaseLock(); + } // release lock when stream becomes closed + return result; + } catch (e) { + reader.releaseLock(); // release lock when stream becomes errored + throw e; + } + }, + async return() { + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; + return { done: true, value: undefined }; + }, + [Symbol.asyncIterator]() { + return this; + }, + }; +} diff --git a/src/core/stream/index.ts b/src/core/stream/index.ts new file mode 100644 index 00000000..4e28b34b --- /dev/null +++ b/src/core/stream/index.ts @@ -0,0 +1 @@ +export { Stream } from "./Stream.js"; diff --git a/src/serialization/resources/agentic/client/index.ts b/src/serialization/resources/agentic/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agentic/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts new file mode 100644 index 00000000..20e0706e --- /dev/null +++ b/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { AgentsLabels } from "../../../../types/AgentsLabels.js"; +import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; +import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; +import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; + +export const AgentsCreateRequest: core.serialization.Schema< + serializers.AgentsCreateRequest.Raw, + Corti.AgentsCreateRequest +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + systemPrompt: core.serialization.string().optional(), + model: core.serialization.string().optional(), + visibility: AgentsVisibility.optional(), + lifecycle: AgentsLifecycle.optional(), + connectors: core.serialization.list(CommonConnectorCreateRequest).optional(), + labels: AgentsLabels.optional(), +}); + +export declare namespace AgentsCreateRequest { + export interface Raw { + name: string; + description?: string | null; + systemPrompt?: string | null; + model?: string | null; + visibility?: AgentsVisibility.Raw | null; + lifecycle?: AgentsLifecycle.Raw | null; + connectors?: CommonConnectorCreateRequest.Raw[] | null; + labels?: AgentsLabels.Raw | null; + } +} diff --git a/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts new file mode 100644 index 00000000..0eb9f11e --- /dev/null +++ b/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; +import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; +import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; + +export const AgentsPatchRequest: core.serialization.Schema< + serializers.AgentsPatchRequest.Raw, + Corti.AgentsPatchRequest +> = core.serialization.object({ + name: core.serialization.string().optional(), + description: core.serialization.string().optionalNullable(), + systemPrompt: core.serialization.string().optionalNullable(), + model: core.serialization.string().optionalNullable(), + visibility: AgentsVisibility.optional(), + lifecycle: AgentsLifecycle.optional(), + connectors: core.serialization.list(CommonConnectorCreateRequest).optionalNullable(), + labels: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), +}); + +export declare namespace AgentsPatchRequest { + export interface Raw { + name?: string | null; + description?: (string | null | undefined) | null; + systemPrompt?: (string | null | undefined) | null; + model?: (string | null | undefined) | null; + visibility?: AgentsVisibility.Raw | null; + lifecycle?: AgentsLifecycle.Raw | null; + connectors?: (CommonConnectorCreateRequest.Raw[] | null | undefined) | null; + labels?: (Record | null | undefined) | null; + } +} diff --git a/src/serialization/resources/agentic/client/requests/index.ts b/src/serialization/resources/agentic/client/requests/index.ts new file mode 100644 index 00000000..d89fef23 --- /dev/null +++ b/src/serialization/resources/agentic/client/requests/index.ts @@ -0,0 +1,2 @@ +export { AgentsCreateRequest } from "./AgentsCreateRequest.js"; +export { AgentsPatchRequest } from "./AgentsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/index.ts b/src/serialization/resources/agentic/index.ts new file mode 100644 index 00000000..9eb1192d --- /dev/null +++ b/src/serialization/resources/agentic/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./resources/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/client/index.ts b/src/serialization/resources/agentic/resources/a2A/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts new file mode 100644 index 00000000..9828ab57 --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../../api/index.js"; +import * as core from "../../../../../../../core/index.js"; +import type * as serializers from "../../../../../../index.js"; +import { A2AjsonrpcRequestId } from "../../types/A2AjsonrpcRequestId.js"; +import { A2AjsonrpcRequestMethod } from "../../types/A2AjsonrpcRequestMethod.js"; + +export const A2AjsonrpcRequest: core.serialization.Schema< + serializers.agentic.A2AjsonrpcRequest.Raw, + Corti.agentic.A2AjsonrpcRequest +> = core.serialization.object({ + id: A2AjsonrpcRequestId, + method: A2AjsonrpcRequestMethod, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace A2AjsonrpcRequest { + export interface Raw { + id: A2AjsonrpcRequestId.Raw; + method: A2AjsonrpcRequestMethod.Raw; + params?: Record | null; + } +} diff --git a/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts new file mode 100644 index 00000000..0d1476bd --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts @@ -0,0 +1 @@ +export { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/index.ts b/src/serialization/resources/agentic/resources/a2A/index.ts new file mode 100644 index 00000000..d9adb1af --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts new file mode 100644 index 00000000..5abc99c8 --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../api/index.js"; +import * as core from "../../../../../../core/index.js"; +import type * as serializers from "../../../../../index.js"; + +export const A2AjsonrpcRequestId: core.serialization.Schema< + serializers.agentic.A2AjsonrpcRequestId.Raw, + Corti.agentic.A2AjsonrpcRequestId +> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); + +export declare namespace A2AjsonrpcRequestId { + export type Raw = string | number; +} diff --git a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts new file mode 100644 index 00000000..ed080991 --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../api/index.js"; +import * as core from "../../../../../../core/index.js"; +import type * as serializers from "../../../../../index.js"; + +export const A2AjsonrpcRequestMethod: core.serialization.Schema< + serializers.agentic.A2AjsonrpcRequestMethod.Raw, + Corti.agentic.A2AjsonrpcRequestMethod +> = core.serialization.enum_([ + "SendMessage", + "SendStreamingMessage", + "GetTask", + "ListTasks", + "CancelTask", + "SubscribeToTask", +]); + +export declare namespace A2AjsonrpcRequestMethod { + export type Raw = + | "SendMessage" + | "SendStreamingMessage" + | "GetTask" + | "ListTasks" + | "CancelTask" + | "SubscribeToTask"; +} diff --git a/src/serialization/resources/agentic/resources/a2A/types/index.ts b/src/serialization/resources/agentic/resources/a2A/types/index.ts new file mode 100644 index 00000000..d506c662 --- /dev/null +++ b/src/serialization/resources/agentic/resources/a2A/types/index.ts @@ -0,0 +1,2 @@ +export * from "./A2AjsonrpcRequestId.js"; +export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/index.ts b/src/serialization/resources/agentic/resources/connectors/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts new file mode 100644 index 00000000..95949c28 --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../../api/index.js"; +import * as core from "../../../../../../../core/index.js"; +import type * as serializers from "../../../../../../index.js"; +import { CommonConnectorAuth } from "../../../../../../types/CommonConnectorAuth.js"; + +export const ConnectorsPatchRequest: core.serialization.Schema< + serializers.agentic.ConnectorsPatchRequest.Raw, + Corti.agentic.ConnectorsPatchRequest +> = core.serialization.object({ + enabled: core.serialization.boolean().optional(), + name: core.serialization.string().optional(), + url: core.serialization.string().optionalNullable(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + auth: CommonConnectorAuth.optionalNullable(), +}); + +export declare namespace ConnectorsPatchRequest { + export interface Raw { + enabled?: boolean | null; + name?: string | null; + url?: (string | null | undefined) | null; + config?: (Record | null | undefined) | null; + auth?: (CommonConnectorAuth.Raw | null | undefined) | null; + } +} diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts new file mode 100644 index 00000000..fd257b20 --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts @@ -0,0 +1 @@ +export { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/index.ts b/src/serialization/resources/agentic/resources/connectors/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/serialization/resources/agentic/resources/connectors/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/client/index.ts b/src/serialization/resources/agentic/resources/feedback/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/agentic/resources/feedback/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts new file mode 100644 index 00000000..81438c6a --- /dev/null +++ b/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../../../../api/index.js"; +import * as core from "../../../../../../../core/index.js"; +import type * as serializers from "../../../../../../index.js"; +import { FeedbackLabel } from "../../../../../../types/FeedbackLabel.js"; +import { FeedbackMetadata } from "../../../../../../types/FeedbackMetadata.js"; +import { FeedbackRating } from "../../../../../../types/FeedbackRating.js"; +import { FeedbackTarget } from "../../../../../../types/FeedbackTarget.js"; + +export const FeedbackCreateRequest: core.serialization.Schema< + serializers.agentic.FeedbackCreateRequest.Raw, + Corti.agentic.FeedbackCreateRequest +> = core.serialization.object({ + rating: FeedbackRating, + labels: core.serialization.list(FeedbackLabel).optional(), + reason: core.serialization.string().optional(), + target: FeedbackTarget.optional(), + metadata: FeedbackMetadata.optional(), +}); + +export declare namespace FeedbackCreateRequest { + export interface Raw { + rating: FeedbackRating.Raw; + labels?: FeedbackLabel.Raw[] | null; + reason?: string | null; + target?: FeedbackTarget.Raw | null; + metadata?: FeedbackMetadata.Raw | null; + } +} diff --git a/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts new file mode 100644 index 00000000..f8353681 --- /dev/null +++ b/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts @@ -0,0 +1 @@ +export { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/index.ts b/src/serialization/resources/agentic/resources/feedback/index.ts new file mode 100644 index 00000000..914b8c3c --- /dev/null +++ b/src/serialization/resources/agentic/resources/feedback/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/serialization/resources/agentic/resources/index.ts b/src/serialization/resources/agentic/resources/index.ts new file mode 100644 index 00000000..3165166f --- /dev/null +++ b/src/serialization/resources/agentic/resources/index.ts @@ -0,0 +1,7 @@ +export * from "./a2A/client/requests/index.js"; +export * as a2A from "./a2A/index.js"; +export * from "./a2A/types/index.js"; +export * from "./connectors/client/requests/index.js"; +export * as connectors from "./connectors/index.js"; +export * from "./feedback/client/requests/index.js"; +export * as feedback from "./feedback/index.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index c2b155f9..c3ebce10 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,3 +1,5 @@ +export * from "./agentic/client/requests/index.js"; +export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; export * from "./agents/types/index.js"; diff --git a/src/serialization/types/A2ASendMessageConfiguration.ts b/src/serialization/types/A2ASendMessageConfiguration.ts new file mode 100644 index 00000000..8ce31b82 --- /dev/null +++ b/src/serialization/types/A2ASendMessageConfiguration.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2ASendMessageConfiguration: core.serialization.ObjectSchema< + serializers.A2ASendMessageConfiguration.Raw, + Corti.A2ASendMessageConfiguration +> = core.serialization.object({ + returnImmediately: core.serialization.boolean().optional(), + historyLength: core.serialization.number().optional(), + acceptedOutputModes: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace A2ASendMessageConfiguration { + export interface Raw { + returnImmediately?: boolean | null; + historyLength?: number | null; + acceptedOutputModes?: string[] | null; + } +} diff --git a/src/serialization/types/A2ASendMessageRequest.ts b/src/serialization/types/A2ASendMessageRequest.ts new file mode 100644 index 00000000..d29c28b3 --- /dev/null +++ b/src/serialization/types/A2ASendMessageRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { A2ASendMessageConfiguration } from "./A2ASendMessageConfiguration.js"; +import { CommonMessage } from "./CommonMessage.js"; + +export const A2ASendMessageRequest: core.serialization.ObjectSchema< + serializers.A2ASendMessageRequest.Raw, + Corti.A2ASendMessageRequest +> = core.serialization.object({ + message: CommonMessage, + configuration: A2ASendMessageConfiguration.optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + tenant: core.serialization.string().optional(), +}); + +export declare namespace A2ASendMessageRequest { + export interface Raw { + message: CommonMessage.Raw; + configuration?: A2ASendMessageConfiguration.Raw | null; + metadata?: Record | null; + tenant?: string | null; + } +} diff --git a/src/serialization/types/A2ASendMessageResponse.ts b/src/serialization/types/A2ASendMessageResponse.ts new file mode 100644 index 00000000..56e39b4a --- /dev/null +++ b/src/serialization/types/A2ASendMessageResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2ASendMessageResponse: core.serialization.Schema< + serializers.A2ASendMessageResponse.Raw, + Corti.A2ASendMessageResponse +> = core.serialization.undiscriminatedUnion([core.serialization.unknown()]); + +export declare namespace A2ASendMessageResponse { + export type Raw = unknown; +} diff --git a/src/serialization/types/A2AStreamEventResponse.ts b/src/serialization/types/A2AStreamEventResponse.ts new file mode 100644 index 00000000..73657388 --- /dev/null +++ b/src/serialization/types/A2AStreamEventResponse.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2AStreamEventResponse: core.serialization.ObjectSchema< + serializers.A2AStreamEventResponse.Raw, + Corti.A2AStreamEventResponse +> = core.serialization.object({ + data: core.serialization.string().optional(), + event: core.serialization.string().optional(), + id: core.serialization.string().optional(), + retry: core.serialization.number().optional(), +}); + +export declare namespace A2AStreamEventResponse { + export interface Raw { + data?: string | null; + event?: string | null; + id?: string | null; + retry?: number | null; + } +} diff --git a/src/serialization/types/A2AjsonrpcResponse.ts b/src/serialization/types/A2AjsonrpcResponse.ts new file mode 100644 index 00000000..1192314a --- /dev/null +++ b/src/serialization/types/A2AjsonrpcResponse.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { A2AjsonrpcResponseError } from "./A2AjsonrpcResponseError.js"; +import { A2AjsonrpcResponseId } from "./A2AjsonrpcResponseId.js"; + +export const A2AjsonrpcResponse: core.serialization.ObjectSchema< + serializers.A2AjsonrpcResponse.Raw, + Corti.A2AjsonrpcResponse +> = core.serialization.object({ + jsonrpc: core.serialization.stringLiteral("2.0"), + id: A2AjsonrpcResponseId.nullable(), + result: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + error: A2AjsonrpcResponseError.optional(), +}); + +export declare namespace A2AjsonrpcResponse { + export interface Raw { + jsonrpc: "2.0"; + id?: A2AjsonrpcResponseId.Raw | null; + result?: Record | null; + error?: A2AjsonrpcResponseError.Raw | null; + } +} diff --git a/src/serialization/types/A2AjsonrpcResponseError.ts b/src/serialization/types/A2AjsonrpcResponseError.ts new file mode 100644 index 00000000..a5c9e8ee --- /dev/null +++ b/src/serialization/types/A2AjsonrpcResponseError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2AjsonrpcResponseError: core.serialization.ObjectSchema< + serializers.A2AjsonrpcResponseError.Raw, + Corti.A2AjsonrpcResponseError +> = core.serialization.object({ + code: core.serialization.number(), + message: core.serialization.string(), + data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace A2AjsonrpcResponseError { + export interface Raw { + code: number; + message: string; + data?: Record | null; + } +} diff --git a/src/serialization/types/A2AjsonrpcResponseId.ts b/src/serialization/types/A2AjsonrpcResponseId.ts new file mode 100644 index 00000000..86944630 --- /dev/null +++ b/src/serialization/types/A2AjsonrpcResponseId.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const A2AjsonrpcResponseId: core.serialization.Schema< + serializers.A2AjsonrpcResponseId.Raw, + Corti.A2AjsonrpcResponseId +> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); + +export declare namespace A2AjsonrpcResponseId { + export type Raw = string | number; +} diff --git a/src/serialization/types/AgentCardResponse.ts b/src/serialization/types/AgentCardResponse.ts new file mode 100644 index 00000000..febe4c51 --- /dev/null +++ b/src/serialization/types/AgentCardResponse.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentCardResponseCapabilities } from "./AgentCardResponseCapabilities.js"; +import { AgentCardResponseProvider } from "./AgentCardResponseProvider.js"; +import { AgentCardResponseSignaturesItem } from "./AgentCardResponseSignaturesItem.js"; +import { AgentCardResponseSkillsItem } from "./AgentCardResponseSkillsItem.js"; +import { AgentCardResponseSupportedInterfacesItem } from "./AgentCardResponseSupportedInterfacesItem.js"; + +export const AgentCardResponse: core.serialization.ObjectSchema< + serializers.AgentCardResponse.Raw, + Corti.AgentCardResponse +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + documentationUrl: core.serialization.string().optional(), + iconUrl: core.serialization.string().optional(), + version: core.serialization.string(), + capabilities: AgentCardResponseCapabilities, + defaultInputModes: core.serialization.list(core.serialization.string()).optional(), + defaultOutputModes: core.serialization.list(core.serialization.string()).optional(), + provider: AgentCardResponseProvider.optional(), + securityRequirements: core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optional(), + securitySchemes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + signatures: core.serialization.list(AgentCardResponseSignaturesItem).optional(), + skills: core.serialization.list(AgentCardResponseSkillsItem).optional(), + supportedInterfaces: core.serialization.list(AgentCardResponseSupportedInterfacesItem), +}); + +export declare namespace AgentCardResponse { + export interface Raw { + name: string; + description?: string | null; + documentationUrl?: string | null; + iconUrl?: string | null; + version: string; + capabilities: AgentCardResponseCapabilities.Raw; + defaultInputModes?: string[] | null; + defaultOutputModes?: string[] | null; + provider?: AgentCardResponseProvider.Raw | null; + securityRequirements?: Record[] | null; + securitySchemes?: Record | null; + signatures?: AgentCardResponseSignaturesItem.Raw[] | null; + skills?: AgentCardResponseSkillsItem.Raw[] | null; + supportedInterfaces: AgentCardResponseSupportedInterfacesItem.Raw[]; + } +} diff --git a/src/serialization/types/AgentCardResponseCapabilities.ts b/src/serialization/types/AgentCardResponseCapabilities.ts new file mode 100644 index 00000000..cba74d0f --- /dev/null +++ b/src/serialization/types/AgentCardResponseCapabilities.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseCapabilities: core.serialization.ObjectSchema< + serializers.AgentCardResponseCapabilities.Raw, + Corti.AgentCardResponseCapabilities +> = core.serialization.object({ + streaming: core.serialization.boolean().optional(), + pushNotifications: core.serialization.boolean().optional(), +}); + +export declare namespace AgentCardResponseCapabilities { + export interface Raw { + streaming?: boolean | null; + pushNotifications?: boolean | null; + } +} diff --git a/src/serialization/types/AgentCardResponseProvider.ts b/src/serialization/types/AgentCardResponseProvider.ts new file mode 100644 index 00000000..fb0d635e --- /dev/null +++ b/src/serialization/types/AgentCardResponseProvider.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseProvider: core.serialization.ObjectSchema< + serializers.AgentCardResponseProvider.Raw, + Corti.AgentCardResponseProvider +> = core.serialization.object({ + organization: core.serialization.string().optional(), + url: core.serialization.string().optional(), +}); + +export declare namespace AgentCardResponseProvider { + export interface Raw { + organization?: string | null; + url?: string | null; + } +} diff --git a/src/serialization/types/AgentCardResponseSignaturesItem.ts b/src/serialization/types/AgentCardResponseSignaturesItem.ts new file mode 100644 index 00000000..c86627a0 --- /dev/null +++ b/src/serialization/types/AgentCardResponseSignaturesItem.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseSignaturesItem: core.serialization.ObjectSchema< + serializers.AgentCardResponseSignaturesItem.Raw, + Corti.AgentCardResponseSignaturesItem +> = core.serialization.object({ + protected: core.serialization.string(), + header: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + signature: core.serialization.string(), +}); + +export declare namespace AgentCardResponseSignaturesItem { + export interface Raw { + protected: string; + header?: Record | null; + signature: string; + } +} diff --git a/src/serialization/types/AgentCardResponseSkillsItem.ts b/src/serialization/types/AgentCardResponseSkillsItem.ts new file mode 100644 index 00000000..839caaa2 --- /dev/null +++ b/src/serialization/types/AgentCardResponseSkillsItem.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseSkillsItem: core.serialization.ObjectSchema< + serializers.AgentCardResponseSkillsItem.Raw, + Corti.AgentCardResponseSkillsItem +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string().optional(), + tags: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace AgentCardResponseSkillsItem { + export interface Raw { + id: string; + name: string; + description?: string | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts new file mode 100644 index 00000000..b9ce417c --- /dev/null +++ b/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentCardResponseSupportedInterfacesItemProtocolBinding } from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; + +export const AgentCardResponseSupportedInterfacesItem: core.serialization.ObjectSchema< + serializers.AgentCardResponseSupportedInterfacesItem.Raw, + Corti.AgentCardResponseSupportedInterfacesItem +> = core.serialization.object({ + protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding, + protocolVersion: core.serialization.stringLiteral("1.0"), + url: core.serialization.string(), +}); + +export declare namespace AgentCardResponseSupportedInterfacesItem { + export interface Raw { + protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw; + protocolVersion: "1.0"; + url: string; + } +} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts new file mode 100644 index 00000000..cd155f3e --- /dev/null +++ b/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentCardResponseSupportedInterfacesItemProtocolBinding: core.serialization.Schema< + serializers.AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw, + Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding +> = core.serialization.enum_(["JSONRPC", "HTTP+JSON"]); + +export declare namespace AgentCardResponseSupportedInterfacesItemProtocolBinding { + export type Raw = "JSONRPC" | "HTTP+JSON"; +} diff --git a/src/serialization/types/AgentsLabels.ts b/src/serialization/types/AgentsLabels.ts new file mode 100644 index 00000000..a080d939 --- /dev/null +++ b/src/serialization/types/AgentsLabels.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsLabels: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.string()); + +export declare namespace AgentsLabels { + export type Raw = Record; +} diff --git a/src/serialization/types/AgentsLifecycle.ts b/src/serialization/types/AgentsLifecycle.ts new file mode 100644 index 00000000..5993ff67 --- /dev/null +++ b/src/serialization/types/AgentsLifecycle.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsLifecycle: core.serialization.Schema = + core.serialization.enum_(["ephemeral", "persistent"]); + +export declare namespace AgentsLifecycle { + export type Raw = "ephemeral" | "persistent"; +} diff --git a/src/serialization/types/AgentsListResponse.ts b/src/serialization/types/AgentsListResponse.ts new file mode 100644 index 00000000..2027987d --- /dev/null +++ b/src/serialization/types/AgentsListResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsResponse } from "./AgentsResponse.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; + +export const AgentsListResponse: core.serialization.ObjectSchema< + serializers.AgentsListResponse.Raw, + Corti.AgentsListResponse +> = core.serialization.object({ + agents: core.serialization.list(AgentsResponse), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace AgentsListResponse { + export interface Raw { + agents: AgentsResponse.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/AgentsResponse.ts b/src/serialization/types/AgentsResponse.ts new file mode 100644 index 00000000..fe2efda1 --- /dev/null +++ b/src/serialization/types/AgentsResponse.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentsLabels } from "./AgentsLabels.js"; +import { AgentsLifecycle } from "./AgentsLifecycle.js"; +import { AgentsUserIdValue } from "./AgentsUserIdValue.js"; +import { AgentsVisibility } from "./AgentsVisibility.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; +import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; + +export const AgentsResponse: core.serialization.ObjectSchema = + core.serialization.object({ + id: CommonAgentIdValue, + name: core.serialization.string(), + description: core.serialization.string().optionalNullable(), + systemPrompt: core.serialization.string().optionalNullable(), + model: core.serialization.string().optionalNullable(), + visibility: AgentsVisibility, + lifecycle: AgentsLifecycle, + connectors: core.serialization.list(CommonConnectorResponse), + labels: AgentsLabels.optional(), + createdAt: core.serialization.date().optional(), + updatedAt: core.serialization.date().optional(), + createdBy: AgentsUserIdValue.optional(), + }); + +export declare namespace AgentsResponse { + export interface Raw { + id: CommonAgentIdValue.Raw; + name: string; + description?: (string | null | undefined) | null; + systemPrompt?: (string | null | undefined) | null; + model?: (string | null | undefined) | null; + visibility: AgentsVisibility.Raw; + lifecycle: AgentsLifecycle.Raw; + connectors: CommonConnectorResponse.Raw[]; + labels?: AgentsLabels.Raw | null; + createdAt?: string | null; + updatedAt?: string | null; + createdBy?: AgentsUserIdValue.Raw | null; + } +} diff --git a/src/serialization/types/AgentsUserIdValue.ts b/src/serialization/types/AgentsUserIdValue.ts new file mode 100644 index 00000000..6782956b --- /dev/null +++ b/src/serialization/types/AgentsUserIdValue.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsUserIdValue: core.serialization.Schema = + core.serialization.string(); + +export declare namespace AgentsUserIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/AgentsVisibility.ts b/src/serialization/types/AgentsVisibility.ts new file mode 100644 index 00000000..9d7fb839 --- /dev/null +++ b/src/serialization/types/AgentsVisibility.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentsVisibility: core.serialization.Schema = + core.serialization.enum_(["private", "unlisted", "public"]); + +export declare namespace AgentsVisibility { + export type Raw = "private" | "unlisted" | "public"; +} diff --git a/src/serialization/types/CommonA2AConnector.ts b/src/serialization/types/CommonA2AConnector.ts new file mode 100644 index 00000000..fb899433 --- /dev/null +++ b/src/serialization/types/CommonA2AConnector.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonA2AConnector: core.serialization.ObjectSchema< + serializers.CommonA2AConnector.Raw, + Corti.CommonA2AConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("a2a"), + name: core.serialization.string().optional(), + url: core.serialization.string(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonA2AConnector { + export interface Raw { + type: "a2a"; + name?: string | null; + url: string; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonA2AConnectorCreate.ts b/src/serialization/types/CommonA2AConnectorCreate.ts new file mode 100644 index 00000000..59699d10 --- /dev/null +++ b/src/serialization/types/CommonA2AConnectorCreate.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonA2AConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonA2AConnectorCreate.Raw, + Corti.CommonA2AConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("a2a"), + name: core.serialization.string().optional(), + url: core.serialization.string(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonA2AConnectorCreate { + export interface Raw { + type: "a2a"; + name?: string | null; + url: string; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonAgentConnector.ts b/src/serialization/types/CommonAgentConnector.ts new file mode 100644 index 00000000..cb3dca8d --- /dev/null +++ b/src/serialization/types/CommonAgentConnector.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonAgentConnector: core.serialization.ObjectSchema< + serializers.CommonAgentConnector.Raw, + Corti.CommonAgentConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("agent"), + agentId: CommonAgentIdValue, + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonAgentConnector { + export interface Raw { + type: "agent"; + agentId: CommonAgentIdValue.Raw; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonAgentConnectorCreate.ts b/src/serialization/types/CommonAgentConnectorCreate.ts new file mode 100644 index 00000000..b000e3b7 --- /dev/null +++ b/src/serialization/types/CommonAgentConnectorCreate.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; + +export const CommonAgentConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonAgentConnectorCreate.Raw, + Corti.CommonAgentConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("agent"), + agentId: CommonAgentIdValue, + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonAgentConnectorCreate { + export interface Raw { + type: "agent"; + agentId: CommonAgentIdValue.Raw; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonAgentIdValue.ts b/src/serialization/types/CommonAgentIdValue.ts new file mode 100644 index 00000000..f722a543 --- /dev/null +++ b/src/serialization/types/CommonAgentIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonAgentIdValue: core.serialization.Schema< + serializers.CommonAgentIdValue.Raw, + Corti.CommonAgentIdValue +> = core.serialization.string(); + +export declare namespace CommonAgentIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonArtifactIdValue.ts b/src/serialization/types/CommonArtifactIdValue.ts new file mode 100644 index 00000000..a135e7e2 --- /dev/null +++ b/src/serialization/types/CommonArtifactIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonArtifactIdValue: core.serialization.Schema< + serializers.CommonArtifactIdValue.Raw, + Corti.CommonArtifactIdValue +> = core.serialization.string(); + +export declare namespace CommonArtifactIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonArtifactResponse.ts b/src/serialization/types/CommonArtifactResponse.ts new file mode 100644 index 00000000..b2aa8f1f --- /dev/null +++ b/src/serialization/types/CommonArtifactResponse.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonArtifactIdValue } from "./CommonArtifactIdValue.js"; +import { CommonPart } from "./CommonPart.js"; + +export const CommonArtifactResponse: core.serialization.ObjectSchema< + serializers.CommonArtifactResponse.Raw, + Corti.CommonArtifactResponse +> = core.serialization.object({ + artifactId: CommonArtifactIdValue, + name: core.serialization.string().optional(), + description: core.serialization.string().optional(), + extensions: core.serialization.list(core.serialization.string()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + parts: core.serialization.list(CommonPart), +}); + +export declare namespace CommonArtifactResponse { + export interface Raw { + artifactId: CommonArtifactIdValue.Raw; + name?: string | null; + description?: string | null; + extensions?: string[] | null; + metadata?: Record | null; + parts: CommonPart.Raw[]; + } +} diff --git a/src/serialization/types/CommonConnectorAuth.ts b/src/serialization/types/CommonConnectorAuth.ts new file mode 100644 index 00000000..da6cc3d9 --- /dev/null +++ b/src/serialization/types/CommonConnectorAuth.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorAuthType } from "./CommonConnectorAuthType.js"; + +export const CommonConnectorAuth: core.serialization.ObjectSchema< + serializers.CommonConnectorAuth.Raw, + Corti.CommonConnectorAuth +> = core.serialization.object({ + type: CommonConnectorAuthType, + scope: core.serialization.string().optional(), + redirectUrl: core.serialization.string().optional(), + ref: core.serialization.string().optional(), +}); + +export declare namespace CommonConnectorAuth { + export interface Raw { + type: CommonConnectorAuthType.Raw; + scope?: string | null; + redirectUrl?: string | null; + ref?: string | null; + } +} diff --git a/src/serialization/types/CommonConnectorAuthType.ts b/src/serialization/types/CommonConnectorAuthType.ts new file mode 100644 index 00000000..c9deff12 --- /dev/null +++ b/src/serialization/types/CommonConnectorAuthType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonConnectorAuthType: core.serialization.Schema< + serializers.CommonConnectorAuthType.Raw, + Corti.CommonConnectorAuthType +> = core.serialization.enum_(["none", "bearer", "apiKey", "oauth2"]); + +export declare namespace CommonConnectorAuthType { + export type Raw = "none" | "bearer" | "apiKey" | "oauth2"; +} diff --git a/src/serialization/types/CommonConnectorCreateRequest.ts b/src/serialization/types/CommonConnectorCreateRequest.ts new file mode 100644 index 00000000..d95dc3bb --- /dev/null +++ b/src/serialization/types/CommonConnectorCreateRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonA2AConnectorCreate } from "./CommonA2AConnectorCreate.js"; +import { CommonAgentConnectorCreate } from "./CommonAgentConnectorCreate.js"; +import { CommonMcpConnectorCreate } from "./CommonMcpConnectorCreate.js"; +import { CommonRegistryConnectorCreate } from "./CommonRegistryConnectorCreate.js"; +import { CommonSchemaConnectorCreate } from "./CommonSchemaConnectorCreate.js"; + +export const CommonConnectorCreateRequest: core.serialization.Schema< + serializers.CommonConnectorCreateRequest.Raw, + Corti.CommonConnectorCreateRequest +> = core.serialization.undiscriminatedUnion([ + CommonRegistryConnectorCreate, + CommonMcpConnectorCreate, + CommonAgentConnectorCreate, + CommonA2AConnectorCreate, + CommonSchemaConnectorCreate, +]); + +export declare namespace CommonConnectorCreateRequest { + export type Raw = + | CommonRegistryConnectorCreate.Raw + | CommonMcpConnectorCreate.Raw + | CommonAgentConnectorCreate.Raw + | CommonA2AConnectorCreate.Raw + | CommonSchemaConnectorCreate.Raw; +} diff --git a/src/serialization/types/CommonConnectorIdValue.ts b/src/serialization/types/CommonConnectorIdValue.ts new file mode 100644 index 00000000..a87af807 --- /dev/null +++ b/src/serialization/types/CommonConnectorIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonConnectorIdValue: core.serialization.Schema< + serializers.CommonConnectorIdValue.Raw, + Corti.CommonConnectorIdValue +> = core.serialization.string(); + +export declare namespace CommonConnectorIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonConnectorResponse.ts b/src/serialization/types/CommonConnectorResponse.ts new file mode 100644 index 00000000..942e8438 --- /dev/null +++ b/src/serialization/types/CommonConnectorResponse.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonA2AConnector } from "./CommonA2AConnector.js"; +import { CommonAgentConnector } from "./CommonAgentConnector.js"; +import { CommonMcpConnector } from "./CommonMcpConnector.js"; +import { CommonRegistryConnectorProvisioned } from "./CommonRegistryConnectorProvisioned.js"; +import { CommonSchemaConnector } from "./CommonSchemaConnector.js"; + +export const CommonConnectorResponse: core.serialization.Schema< + serializers.CommonConnectorResponse.Raw, + Corti.CommonConnectorResponse +> = core.serialization.undiscriminatedUnion([ + CommonRegistryConnectorProvisioned, + CommonMcpConnector, + CommonAgentConnector, + CommonA2AConnector, + CommonSchemaConnector, +]); + +export declare namespace CommonConnectorResponse { + export type Raw = + | CommonRegistryConnectorProvisioned.Raw + | CommonMcpConnector.Raw + | CommonAgentConnector.Raw + | CommonA2AConnector.Raw + | CommonSchemaConnector.Raw; +} diff --git a/src/serialization/types/CommonConnectorType.ts b/src/serialization/types/CommonConnectorType.ts new file mode 100644 index 00000000..fdea4339 --- /dev/null +++ b/src/serialization/types/CommonConnectorType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonConnectorType: core.serialization.Schema< + serializers.CommonConnectorType.Raw, + Corti.CommonConnectorType +> = core.serialization.enum_(["registry", "mcp", "agent", "a2a", "schema"]); + +export declare namespace CommonConnectorType { + export type Raw = "registry" | "mcp" | "agent" | "a2a" | "schema"; +} diff --git a/src/serialization/types/CommonContextIdValue.ts b/src/serialization/types/CommonContextIdValue.ts new file mode 100644 index 00000000..95ab2ae2 --- /dev/null +++ b/src/serialization/types/CommonContextIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonContextIdValue: core.serialization.Schema< + serializers.CommonContextIdValue.Raw, + Corti.CommonContextIdValue +> = core.serialization.string(); + +export declare namespace CommonContextIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonErrorResponse.ts b/src/serialization/types/CommonErrorResponse.ts new file mode 100644 index 00000000..ca0e5b74 --- /dev/null +++ b/src/serialization/types/CommonErrorResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonErrorResponseError } from "./CommonErrorResponseError.js"; + +export const CommonErrorResponse: core.serialization.ObjectSchema< + serializers.CommonErrorResponse.Raw, + Corti.CommonErrorResponse +> = core.serialization.object({ + error: CommonErrorResponseError, +}); + +export declare namespace CommonErrorResponse { + export interface Raw { + error: CommonErrorResponseError.Raw; + } +} diff --git a/src/serialization/types/CommonErrorResponseError.ts b/src/serialization/types/CommonErrorResponseError.ts new file mode 100644 index 00000000..4b40f814 --- /dev/null +++ b/src/serialization/types/CommonErrorResponseError.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonErrorResponseErrorDetails } from "./CommonErrorResponseErrorDetails.js"; + +export const CommonErrorResponseError: core.serialization.ObjectSchema< + serializers.CommonErrorResponseError.Raw, + Corti.CommonErrorResponseError +> = core.serialization.object({ + code: core.serialization.string(), + message: core.serialization.string(), + howToFix: core.serialization.string().optional(), + details: CommonErrorResponseErrorDetails.optional(), + requestId: core.serialization.string().optional(), +}); + +export declare namespace CommonErrorResponseError { + export interface Raw { + code: string; + message: string; + howToFix?: string | null; + details?: CommonErrorResponseErrorDetails.Raw | null; + requestId?: string | null; + } +} diff --git a/src/serialization/types/CommonErrorResponseErrorDetails.ts b/src/serialization/types/CommonErrorResponseErrorDetails.ts new file mode 100644 index 00000000..79578cce --- /dev/null +++ b/src/serialization/types/CommonErrorResponseErrorDetails.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonErrorResponseErrorDetailsValidationErrorsItem } from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; + +export const CommonErrorResponseErrorDetails: core.serialization.ObjectSchema< + serializers.CommonErrorResponseErrorDetails.Raw, + Corti.CommonErrorResponseErrorDetails +> = core.serialization + .object({ + validationErrors: core.serialization.list(CommonErrorResponseErrorDetailsValidationErrorsItem).optional(), + }) + .passthrough(); + +export declare namespace CommonErrorResponseErrorDetails { + export interface Raw { + validationErrors?: CommonErrorResponseErrorDetailsValidationErrorsItem.Raw[] | null; + [key: string]: any; + } +} diff --git a/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts new file mode 100644 index 00000000..31bf3888 --- /dev/null +++ b/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonErrorResponseErrorDetailsValidationErrorsItem: core.serialization.ObjectSchema< + serializers.CommonErrorResponseErrorDetailsValidationErrorsItem.Raw, + Corti.CommonErrorResponseErrorDetailsValidationErrorsItem +> = core.serialization.object({ + field: core.serialization.string(), + reason: core.serialization.string(), +}); + +export declare namespace CommonErrorResponseErrorDetailsValidationErrorsItem { + export interface Raw { + field: string; + reason: string; + } +} diff --git a/src/serialization/types/CommonMcpConnector.ts b/src/serialization/types/CommonMcpConnector.ts new file mode 100644 index 00000000..98b38046 --- /dev/null +++ b/src/serialization/types/CommonMcpConnector.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonMcpConnector: core.serialization.ObjectSchema< + serializers.CommonMcpConnector.Raw, + Corti.CommonMcpConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp"), + name: core.serialization.string(), + url: core.serialization.string(), + auth: CommonConnectorAuth.optional(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonMcpConnector { + export interface Raw { + type: "mcp"; + name: string; + url: string; + auth?: CommonConnectorAuth.Raw | null; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonMcpConnectorCreate.ts b/src/serialization/types/CommonMcpConnectorCreate.ts new file mode 100644 index 00000000..6373c7b0 --- /dev/null +++ b/src/serialization/types/CommonMcpConnectorCreate.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; + +export const CommonMcpConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonMcpConnectorCreate.Raw, + Corti.CommonMcpConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp"), + name: core.serialization.string(), + url: core.serialization.string(), + enabled: core.serialization.boolean().optional(), + auth: CommonConnectorAuth.optional(), +}); + +export declare namespace CommonMcpConnectorCreate { + export interface Raw { + type: "mcp"; + name: string; + url: string; + enabled?: boolean | null; + auth?: CommonConnectorAuth.Raw | null; + } +} diff --git a/src/serialization/types/CommonMessage.ts b/src/serialization/types/CommonMessage.ts new file mode 100644 index 00000000..ebefe64c --- /dev/null +++ b/src/serialization/types/CommonMessage.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonContextIdValue } from "./CommonContextIdValue.js"; +import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; +import { CommonPart } from "./CommonPart.js"; +import { CommonRole } from "./CommonRole.js"; +import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; + +export const CommonMessage: core.serialization.ObjectSchema = + core.serialization.object({ + messageId: CommonMessageIdValue.optional(), + contextId: CommonContextIdValue.optional(), + taskId: CommonTaskIdValue.optional(), + role: CommonRole, + parts: core.serialization.list(CommonPart), + referenceTaskIds: core.serialization.list(CommonTaskIdValue).optional(), + extensions: core.serialization.list(core.serialization.string()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + }); + +export declare namespace CommonMessage { + export interface Raw { + messageId?: CommonMessageIdValue.Raw | null; + contextId?: CommonContextIdValue.Raw | null; + taskId?: CommonTaskIdValue.Raw | null; + role: CommonRole.Raw; + parts: CommonPart.Raw[]; + referenceTaskIds?: CommonTaskIdValue.Raw[] | null; + extensions?: string[] | null; + metadata?: Record | null; + } +} diff --git a/src/serialization/types/CommonMessageIdValue.ts b/src/serialization/types/CommonMessageIdValue.ts new file mode 100644 index 00000000..29d1b310 --- /dev/null +++ b/src/serialization/types/CommonMessageIdValue.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonMessageIdValue: core.serialization.Schema< + serializers.CommonMessageIdValue.Raw, + Corti.CommonMessageIdValue +> = core.serialization.string(); + +export declare namespace CommonMessageIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonNextPageToken.ts b/src/serialization/types/CommonNextPageToken.ts new file mode 100644 index 00000000..75f714c8 --- /dev/null +++ b/src/serialization/types/CommonNextPageToken.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonNextPageToken: core.serialization.Schema< + serializers.CommonNextPageToken.Raw, + Corti.CommonNextPageToken +> = core.serialization.string().nullable(); + +export declare namespace CommonNextPageToken { + export type Raw = string | null | undefined; +} diff --git a/src/serialization/types/CommonPart.ts b/src/serialization/types/CommonPart.ts new file mode 100644 index 00000000..87eed54a --- /dev/null +++ b/src/serialization/types/CommonPart.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonPart: core.serialization.ObjectSchema = + core.serialization + .object({ + text: core.serialization.string().optional(), + data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + filename: core.serialization.string().optional(), + mediaType: core.serialization.string().optional(), + raw: core.serialization.string().optional(), + url: core.serialization.string().optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + }) + .passthrough(); + +export declare namespace CommonPart { + export interface Raw { + text?: string | null; + data?: Record | null; + filename?: string | null; + mediaType?: string | null; + raw?: string | null; + url?: string | null; + metadata?: Record | null; + [key: string]: any; + } +} diff --git a/src/serialization/types/CommonRegistryConnectorCreate.ts b/src/serialization/types/CommonRegistryConnectorCreate.ts new file mode 100644 index 00000000..2fc6dc9e --- /dev/null +++ b/src/serialization/types/CommonRegistryConnectorCreate.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonRegistryConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonRegistryConnectorCreate.Raw, + Corti.CommonRegistryConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("registry"), + name: core.serialization.string(), + enabled: core.serialization.boolean().optional(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace CommonRegistryConnectorCreate { + export interface Raw { + type: "registry"; + name: string; + enabled?: boolean | null; + config?: Record | null; + } +} diff --git a/src/serialization/types/CommonRegistryConnectorProvisioned.ts b/src/serialization/types/CommonRegistryConnectorProvisioned.ts new file mode 100644 index 00000000..ebb182db --- /dev/null +++ b/src/serialization/types/CommonRegistryConnectorProvisioned.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; + +export const CommonRegistryConnectorProvisioned: core.serialization.ObjectSchema< + serializers.CommonRegistryConnectorProvisioned.Raw, + Corti.CommonRegistryConnectorProvisioned +> = core.serialization.object({ + type: core.serialization.stringLiteral("registry"), + name: core.serialization.string(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonRegistryConnectorProvisioned { + export interface Raw { + type: "registry"; + name: string; + config?: Record | null; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonRole.ts b/src/serialization/types/CommonRole.ts new file mode 100644 index 00000000..001aaac7 --- /dev/null +++ b/src/serialization/types/CommonRole.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonRole: core.serialization.Schema = + core.serialization.enum_(["ROLE_USER", "ROLE_AGENT"]); + +export declare namespace CommonRole { + export type Raw = "ROLE_USER" | "ROLE_AGENT"; +} diff --git a/src/serialization/types/CommonSchemaConnector.ts b/src/serialization/types/CommonSchemaConnector.ts new file mode 100644 index 00000000..d596f08b --- /dev/null +++ b/src/serialization/types/CommonSchemaConnector.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; +import { CommonSchemaConnectorTransition } from "./CommonSchemaConnectorTransition.js"; + +export const CommonSchemaConnector: core.serialization.ObjectSchema< + serializers.CommonSchemaConnector.Raw, + Corti.CommonSchemaConnector +> = core.serialization.object({ + type: core.serialization.stringLiteral("schema"), + name: core.serialization.string(), + description: core.serialization.string().optional(), + schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + transition: CommonSchemaConnectorTransition.optional(), + id: CommonConnectorIdValue.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonSchemaConnector { + export interface Raw { + type: "schema"; + name: string; + description?: string | null; + schema: Record; + transition?: CommonSchemaConnectorTransition.Raw | null; + id?: CommonConnectorIdValue.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonSchemaConnectorCreate.ts b/src/serialization/types/CommonSchemaConnectorCreate.ts new file mode 100644 index 00000000..f37c77b7 --- /dev/null +++ b/src/serialization/types/CommonSchemaConnectorCreate.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonSchemaConnectorCreateTransition } from "./CommonSchemaConnectorCreateTransition.js"; + +export const CommonSchemaConnectorCreate: core.serialization.ObjectSchema< + serializers.CommonSchemaConnectorCreate.Raw, + Corti.CommonSchemaConnectorCreate +> = core.serialization.object({ + type: core.serialization.stringLiteral("schema"), + name: core.serialization.string(), + description: core.serialization.string().optional(), + schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + transition: CommonSchemaConnectorCreateTransition.optional(), + enabled: core.serialization.boolean().optional(), +}); + +export declare namespace CommonSchemaConnectorCreate { + export interface Raw { + type: "schema"; + name: string; + description?: string | null; + schema: Record; + transition?: CommonSchemaConnectorCreateTransition.Raw | null; + enabled?: boolean | null; + } +} diff --git a/src/serialization/types/CommonSchemaConnectorCreateTransition.ts b/src/serialization/types/CommonSchemaConnectorCreateTransition.ts new file mode 100644 index 00000000..9fca7219 --- /dev/null +++ b/src/serialization/types/CommonSchemaConnectorCreateTransition.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonSchemaConnectorCreateTransition: core.serialization.Schema< + serializers.CommonSchemaConnectorCreateTransition.Raw, + Corti.CommonSchemaConnectorCreateTransition +> = core.serialization.enum_(["complete", "input_required"]); + +export declare namespace CommonSchemaConnectorCreateTransition { + export type Raw = "complete" | "input_required"; +} diff --git a/src/serialization/types/CommonSchemaConnectorTransition.ts b/src/serialization/types/CommonSchemaConnectorTransition.ts new file mode 100644 index 00000000..8e694c31 --- /dev/null +++ b/src/serialization/types/CommonSchemaConnectorTransition.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonSchemaConnectorTransition: core.serialization.Schema< + serializers.CommonSchemaConnectorTransition.Raw, + Corti.CommonSchemaConnectorTransition +> = core.serialization.enum_(["complete", "input_required"]); + +export declare namespace CommonSchemaConnectorTransition { + export type Raw = "complete" | "input_required"; +} diff --git a/src/serialization/types/CommonTaskIdValue.ts b/src/serialization/types/CommonTaskIdValue.ts new file mode 100644 index 00000000..2bc1386e --- /dev/null +++ b/src/serialization/types/CommonTaskIdValue.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonTaskIdValue: core.serialization.Schema = + core.serialization.string(); + +export declare namespace CommonTaskIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/CommonTaskListResponse.ts b/src/serialization/types/CommonTaskListResponse.ts new file mode 100644 index 00000000..e23a8a73 --- /dev/null +++ b/src/serialization/types/CommonTaskListResponse.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTaskResponse } from "./CommonTaskResponse.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; + +export const CommonTaskListResponse: core.serialization.ObjectSchema< + serializers.CommonTaskListResponse.Raw, + Corti.CommonTaskListResponse +> = core.serialization.object({ + pageSize: core.serialization.number().optional(), + tasks: core.serialization.list(CommonTaskResponse), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace CommonTaskListResponse { + export interface Raw { + pageSize?: number | null; + tasks: CommonTaskResponse.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/CommonTaskMetadata.ts b/src/serialization/types/CommonTaskMetadata.ts new file mode 100644 index 00000000..e7ce19ef --- /dev/null +++ b/src/serialization/types/CommonTaskMetadata.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonUsage } from "./CommonUsage.js"; + +export const CommonTaskMetadata: core.serialization.ObjectSchema< + serializers.CommonTaskMetadata.Raw, + Corti.CommonTaskMetadata +> = core.serialization + .object({ + usage: core.serialization.property("$usage", CommonUsage.optional()), + }) + .passthrough(); + +export declare namespace CommonTaskMetadata { + export interface Raw { + $usage?: CommonUsage.Raw | null; + [key: string]: any; + } +} diff --git a/src/serialization/types/CommonTaskResponse.ts b/src/serialization/types/CommonTaskResponse.ts new file mode 100644 index 00000000..9603f2ea --- /dev/null +++ b/src/serialization/types/CommonTaskResponse.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonArtifactResponse } from "./CommonArtifactResponse.js"; +import { CommonContextIdValue } from "./CommonContextIdValue.js"; +import { CommonMessage } from "./CommonMessage.js"; +import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; +import { CommonTaskMetadata } from "./CommonTaskMetadata.js"; +import { CommonTaskStatus } from "./CommonTaskStatus.js"; + +export const CommonTaskResponse: core.serialization.ObjectSchema< + serializers.CommonTaskResponse.Raw, + Corti.CommonTaskResponse +> = core.serialization.object({ + id: CommonTaskIdValue, + contextId: CommonContextIdValue, + status: CommonTaskStatus, + history: core.serialization.list(CommonMessage).optional(), + artifacts: core.serialization.list(CommonArtifactResponse).optional(), + metadata: CommonTaskMetadata.optional(), +}); + +export declare namespace CommonTaskResponse { + export interface Raw { + id: CommonTaskIdValue.Raw; + contextId: CommonContextIdValue.Raw; + status: CommonTaskStatus.Raw; + history?: CommonMessage.Raw[] | null; + artifacts?: CommonArtifactResponse.Raw[] | null; + metadata?: CommonTaskMetadata.Raw | null; + } +} diff --git a/src/serialization/types/CommonTaskState.ts b/src/serialization/types/CommonTaskState.ts new file mode 100644 index 00000000..f5142fa4 --- /dev/null +++ b/src/serialization/types/CommonTaskState.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonTaskState: core.serialization.Schema = + core.serialization.enum_([ + "TASK_STATE_SUBMITTED", + "TASK_STATE_WORKING", + "TASK_STATE_COMPLETED", + "TASK_STATE_FAILED", + "TASK_STATE_CANCELED", + "TASK_STATE_INPUT_REQUIRED", + "TASK_STATE_REJECTED", + "TASK_STATE_AUTH_REQUIRED", + ]); + +export declare namespace CommonTaskState { + export type Raw = + | "TASK_STATE_SUBMITTED" + | "TASK_STATE_WORKING" + | "TASK_STATE_COMPLETED" + | "TASK_STATE_FAILED" + | "TASK_STATE_CANCELED" + | "TASK_STATE_INPUT_REQUIRED" + | "TASK_STATE_REJECTED" + | "TASK_STATE_AUTH_REQUIRED"; +} diff --git a/src/serialization/types/CommonTaskStatus.ts b/src/serialization/types/CommonTaskStatus.ts new file mode 100644 index 00000000..80c2e3ad --- /dev/null +++ b/src/serialization/types/CommonTaskStatus.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonMessage } from "./CommonMessage.js"; +import { CommonTaskState } from "./CommonTaskState.js"; + +export const CommonTaskStatus: core.serialization.ObjectSchema< + serializers.CommonTaskStatus.Raw, + Corti.CommonTaskStatus +> = core.serialization.object({ + state: CommonTaskState, + message: CommonMessage.optional(), + timestamp: core.serialization.date().optional(), +}); + +export declare namespace CommonTaskStatus { + export interface Raw { + state: CommonTaskState.Raw; + message?: CommonMessage.Raw | null; + timestamp?: string | null; + } +} diff --git a/src/serialization/types/CommonTotalSize.ts b/src/serialization/types/CommonTotalSize.ts new file mode 100644 index 00000000..c0ed29e6 --- /dev/null +++ b/src/serialization/types/CommonTotalSize.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonTotalSize: core.serialization.Schema = + core.serialization.number(); + +export declare namespace CommonTotalSize { + export type Raw = number; +} diff --git a/src/serialization/types/CommonUsage.ts b/src/serialization/types/CommonUsage.ts new file mode 100644 index 00000000..67699121 --- /dev/null +++ b/src/serialization/types/CommonUsage.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CommonUsage: core.serialization.ObjectSchema = + core.serialization.object({ + model: core.serialization.string().optional(), + inputTokens: core.serialization.number(), + outputTokens: core.serialization.number(), + cachedInputTokens: core.serialization.number().optional(), + cacheCreationInputTokens: core.serialization.number().optional(), + totalTokens: core.serialization.number(), + credits: core.serialization.number().optional(), + }); + +export declare namespace CommonUsage { + export interface Raw { + model?: string | null; + inputTokens: number; + outputTokens: number; + cachedInputTokens?: number | null; + cacheCreationInputTokens?: number | null; + totalTokens: number; + credits?: number | null; + } +} diff --git a/src/serialization/types/ConnectorsListResponse.ts b/src/serialization/types/ConnectorsListResponse.ts new file mode 100644 index 00000000..42c70c3b --- /dev/null +++ b/src/serialization/types/ConnectorsListResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; + +export const ConnectorsListResponse: core.serialization.ObjectSchema< + serializers.ConnectorsListResponse.Raw, + Corti.ConnectorsListResponse +> = core.serialization.object({ + connectors: core.serialization.list(CommonConnectorResponse), +}); + +export declare namespace ConnectorsListResponse { + export interface Raw { + connectors: CommonConnectorResponse.Raw[]; + } +} diff --git a/src/serialization/types/Contexts.ts b/src/serialization/types/Contexts.ts new file mode 100644 index 00000000..aa1c12dc --- /dev/null +++ b/src/serialization/types/Contexts.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; +import { CommonContextIdValue } from "./CommonContextIdValue.js"; + +export const Contexts: core.serialization.ObjectSchema = + core.serialization.object({ + id: CommonContextIdValue, + agentId: CommonAgentIdValue.optional(), + taskCount: core.serialization.number().optional(), + createdAt: core.serialization.date().optional(), + updatedAt: core.serialization.date().optional(), + expiresAt: core.serialization.date().optionalNullable(), + }); + +export declare namespace Contexts { + export interface Raw { + id: CommonContextIdValue.Raw; + agentId?: CommonAgentIdValue.Raw | null; + taskCount?: number | null; + createdAt?: string | null; + updatedAt?: string | null; + expiresAt?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/ContextsDetailResponse.ts b/src/serialization/types/ContextsDetailResponse.ts new file mode 100644 index 00000000..3057a895 --- /dev/null +++ b/src/serialization/types/ContextsDetailResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonTaskResponse } from "./CommonTaskResponse.js"; +import { Contexts } from "./Contexts.js"; + +export const ContextsDetailResponse: core.serialization.ObjectSchema< + serializers.ContextsDetailResponse.Raw, + Corti.ContextsDetailResponse +> = core.serialization + .object({ + tasks: core.serialization.list(CommonTaskResponse), + }) + .extend(Contexts); + +export declare namespace ContextsDetailResponse { + export interface Raw extends Contexts.Raw { + tasks: CommonTaskResponse.Raw[]; + } +} diff --git a/src/serialization/types/ContextsListResponse.ts b/src/serialization/types/ContextsListResponse.ts new file mode 100644 index 00000000..e6765e17 --- /dev/null +++ b/src/serialization/types/ContextsListResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; +import { Contexts } from "./Contexts.js"; + +export const ContextsListResponse: core.serialization.ObjectSchema< + serializers.ContextsListResponse.Raw, + Corti.ContextsListResponse +> = core.serialization.object({ + contexts: core.serialization.list(Contexts), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace ContextsListResponse { + export interface Raw { + contexts: Contexts.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/ContextsOpenInferenceSpan.ts b/src/serialization/types/ContextsOpenInferenceSpan.ts new file mode 100644 index 00000000..e8d958cd --- /dev/null +++ b/src/serialization/types/ContextsOpenInferenceSpan.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ContextsOpenInferenceSpan: core.serialization.ObjectSchema< + serializers.ContextsOpenInferenceSpan.Raw, + Corti.ContextsOpenInferenceSpan +> = core.serialization.object({ + name: core.serialization.string(), + spanId: core.serialization.property("span_id", core.serialization.string()), + parentSpanId: core.serialization.property("parent_span_id", core.serialization.string().optional()), + startTime: core.serialization.property("start_time", core.serialization.date()), + endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), + attributes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace ContextsOpenInferenceSpan { + export interface Raw { + name: string; + span_id: string; + parent_span_id?: string | null; + start_time: string; + end_time?: (string | null | undefined) | null; + attributes?: Record | null; + } +} diff --git a/src/serialization/types/ContextsTraceItem.ts b/src/serialization/types/ContextsTraceItem.ts new file mode 100644 index 00000000..7b2ec7f8 --- /dev/null +++ b/src/serialization/types/ContextsTraceItem.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ContextsOpenInferenceSpan } from "./ContextsOpenInferenceSpan.js"; +import { ContextsTraceItemTrace } from "./ContextsTraceItemTrace.js"; + +export const ContextsTraceItem: core.serialization.ObjectSchema< + serializers.ContextsTraceItem.Raw, + Corti.ContextsTraceItem +> = core.serialization.object({ + trace: ContextsTraceItemTrace, + spans: core.serialization.list(ContextsOpenInferenceSpan), +}); + +export declare namespace ContextsTraceItem { + export interface Raw { + trace: ContextsTraceItemTrace.Raw; + spans: ContextsOpenInferenceSpan.Raw[]; + } +} diff --git a/src/serialization/types/ContextsTraceItemTrace.ts b/src/serialization/types/ContextsTraceItemTrace.ts new file mode 100644 index 00000000..75e2f533 --- /dev/null +++ b/src/serialization/types/ContextsTraceItemTrace.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ContextsTraceItemTrace: core.serialization.ObjectSchema< + serializers.ContextsTraceItemTrace.Raw, + Corti.ContextsTraceItemTrace +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + startTime: core.serialization.property("start_time", core.serialization.date()), + endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), + input: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + output: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + threadId: core.serialization.property("thread_id", core.serialization.string()), +}); + +export declare namespace ContextsTraceItemTrace { + export interface Raw { + id: string; + name: string; + start_time: string; + end_time?: (string | null | undefined) | null; + input?: Record | null; + output?: Record | null; + metadata?: Record | null; + tags?: string[] | null; + thread_id: string; + } +} diff --git a/src/serialization/types/ContextsTraceResponse.ts b/src/serialization/types/ContextsTraceResponse.ts new file mode 100644 index 00000000..b06ecbc9 --- /dev/null +++ b/src/serialization/types/ContextsTraceResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; +import { ContextsTraceItem } from "./ContextsTraceItem.js"; + +export const ContextsTraceResponse: core.serialization.ObjectSchema< + serializers.ContextsTraceResponse.Raw, + Corti.ContextsTraceResponse +> = core.serialization.object({ + traces: core.serialization.list(ContextsTraceItem), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace ContextsTraceResponse { + export interface Raw { + traces: ContextsTraceItem.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/FeedbackActor.ts b/src/serialization/types/FeedbackActor.ts new file mode 100644 index 00000000..feb0d51f --- /dev/null +++ b/src/serialization/types/FeedbackActor.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackActor: core.serialization.ObjectSchema = + core.serialization.object({ + externalId: core.serialization.string(), + }); + +export declare namespace FeedbackActor { + export interface Raw { + externalId: string; + } +} diff --git a/src/serialization/types/FeedbackIdValue.ts b/src/serialization/types/FeedbackIdValue.ts new file mode 100644 index 00000000..21dfa05f --- /dev/null +++ b/src/serialization/types/FeedbackIdValue.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackIdValue: core.serialization.Schema = + core.serialization.string(); + +export declare namespace FeedbackIdValue { + export type Raw = string; +} diff --git a/src/serialization/types/FeedbackLabel.ts b/src/serialization/types/FeedbackLabel.ts new file mode 100644 index 00000000..dee3b08b --- /dev/null +++ b/src/serialization/types/FeedbackLabel.ts @@ -0,0 +1,41 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackLabel: core.serialization.Schema = + core.serialization.enum_([ + "correct", + "complete", + "helpful", + "wellPresented", + "efficient", + "incorrect", + "missingInformation", + "irrelevant", + "misunderstoodRequest", + "unsupportedClaim", + "unsafeOrInappropriate", + "poorlyPresented", + "tooVerbose", + "other", + ]); + +export declare namespace FeedbackLabel { + export type Raw = + | "correct" + | "complete" + | "helpful" + | "wellPresented" + | "efficient" + | "incorrect" + | "missingInformation" + | "irrelevant" + | "misunderstoodRequest" + | "unsupportedClaim" + | "unsafeOrInappropriate" + | "poorlyPresented" + | "tooVerbose" + | "other"; +} diff --git a/src/serialization/types/FeedbackListResponse.ts b/src/serialization/types/FeedbackListResponse.ts new file mode 100644 index 00000000..1a1cb098 --- /dev/null +++ b/src/serialization/types/FeedbackListResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { FeedbackResponse } from "./FeedbackResponse.js"; + +export const FeedbackListResponse: core.serialization.ObjectSchema< + serializers.FeedbackListResponse.Raw, + Corti.FeedbackListResponse +> = core.serialization.object({ + feedbacks: core.serialization.list(FeedbackResponse), +}); + +export declare namespace FeedbackListResponse { + export interface Raw { + feedbacks: FeedbackResponse.Raw[]; + } +} diff --git a/src/serialization/types/FeedbackMetadata.ts b/src/serialization/types/FeedbackMetadata.ts new file mode 100644 index 00000000..162c3f90 --- /dev/null +++ b/src/serialization/types/FeedbackMetadata.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { FeedbackActor } from "./FeedbackActor.js"; + +export const FeedbackMetadata: core.serialization.ObjectSchema< + serializers.FeedbackMetadata.Raw, + Corti.FeedbackMetadata +> = core.serialization.object({ + collectionMethod: core.serialization.string().optional(), + clientReference: core.serialization.string().optional(), + actor: FeedbackActor.optional(), +}); + +export declare namespace FeedbackMetadata { + export interface Raw { + collectionMethod?: string | null; + clientReference?: string | null; + actor?: FeedbackActor.Raw | null; + } +} diff --git a/src/serialization/types/FeedbackRating.ts b/src/serialization/types/FeedbackRating.ts new file mode 100644 index 00000000..87e5c7ca --- /dev/null +++ b/src/serialization/types/FeedbackRating.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { FeedbackRatingScale } from "./FeedbackRatingScale.js"; + +export const FeedbackRating: core.serialization.ObjectSchema = + core.serialization.object({ + scale: FeedbackRatingScale, + value: core.serialization.number(), + }); + +export declare namespace FeedbackRating { + export interface Raw { + scale: FeedbackRatingScale.Raw; + value: number; + } +} diff --git a/src/serialization/types/FeedbackRatingScale.ts b/src/serialization/types/FeedbackRatingScale.ts new file mode 100644 index 00000000..ebbeb7ba --- /dev/null +++ b/src/serialization/types/FeedbackRatingScale.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const FeedbackRatingScale: core.serialization.Schema< + serializers.FeedbackRatingScale.Raw, + Corti.FeedbackRatingScale +> = core.serialization.enum_(["binary"]); + +export declare namespace FeedbackRatingScale { + export type Raw = "binary"; +} diff --git a/src/serialization/types/FeedbackResponse.ts b/src/serialization/types/FeedbackResponse.ts new file mode 100644 index 00000000..975ea339 --- /dev/null +++ b/src/serialization/types/FeedbackResponse.ts @@ -0,0 +1,40 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; +import { FeedbackIdValue } from "./FeedbackIdValue.js"; +import { FeedbackLabel } from "./FeedbackLabel.js"; +import { FeedbackMetadata } from "./FeedbackMetadata.js"; +import { FeedbackRating } from "./FeedbackRating.js"; +import { FeedbackTarget } from "./FeedbackTarget.js"; + +export const FeedbackResponse: core.serialization.ObjectSchema< + serializers.FeedbackResponse.Raw, + Corti.FeedbackResponse +> = core.serialization.object({ + id: FeedbackIdValue, + taskId: CommonTaskIdValue, + rating: FeedbackRating, + normalizedScore: core.serialization.number(), + labels: core.serialization.list(FeedbackLabel), + reason: core.serialization.string().optional(), + target: FeedbackTarget.optional(), + metadata: FeedbackMetadata.optional(), + createdAt: core.serialization.date().optional(), +}); + +export declare namespace FeedbackResponse { + export interface Raw { + id: FeedbackIdValue.Raw; + taskId: CommonTaskIdValue.Raw; + rating: FeedbackRating.Raw; + normalizedScore: number; + labels: FeedbackLabel.Raw[]; + reason?: string | null; + target?: FeedbackTarget.Raw | null; + metadata?: FeedbackMetadata.Raw | null; + createdAt?: string | null; + } +} diff --git a/src/serialization/types/FeedbackTarget.ts b/src/serialization/types/FeedbackTarget.ts new file mode 100644 index 00000000..fa3ed123 --- /dev/null +++ b/src/serialization/types/FeedbackTarget.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; + +export const FeedbackTarget: core.serialization.ObjectSchema = + core.serialization.object({ + messageId: CommonMessageIdValue, + }); + +export declare namespace FeedbackTarget { + export interface Raw { + messageId: CommonMessageIdValue.Raw; + } +} diff --git a/src/serialization/types/RegistryConnectorCapabilities.ts b/src/serialization/types/RegistryConnectorCapabilities.ts new file mode 100644 index 00000000..fed6df20 --- /dev/null +++ b/src/serialization/types/RegistryConnectorCapabilities.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const RegistryConnectorCapabilities: core.serialization.ObjectSchema< + serializers.RegistryConnectorCapabilities.Raw, + Corti.RegistryConnectorCapabilities +> = core.serialization.object({ + streaming: core.serialization.boolean().optional(), + inputModes: core.serialization.list(core.serialization.string()).optional(), + outputModes: core.serialization.list(core.serialization.string()).optional(), + tools: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace RegistryConnectorCapabilities { + export interface Raw { + streaming?: boolean | null; + inputModes?: string[] | null; + outputModes?: string[] | null; + tools?: string[] | null; + } +} diff --git a/src/serialization/types/RegistryConnectorListResponse.ts b/src/serialization/types/RegistryConnectorListResponse.ts new file mode 100644 index 00000000..f31cb6bb --- /dev/null +++ b/src/serialization/types/RegistryConnectorListResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonNextPageToken } from "./CommonNextPageToken.js"; +import { CommonTotalSize } from "./CommonTotalSize.js"; +import { RegistryConnectorResponse } from "./RegistryConnectorResponse.js"; + +export const RegistryConnectorListResponse: core.serialization.ObjectSchema< + serializers.RegistryConnectorListResponse.Raw, + Corti.RegistryConnectorListResponse +> = core.serialization.object({ + connectors: core.serialization.list(RegistryConnectorResponse), + nextPageToken: CommonNextPageToken.optionalNullable(), + totalSize: CommonTotalSize.optional(), +}); + +export declare namespace RegistryConnectorListResponse { + export interface Raw { + connectors: RegistryConnectorResponse.Raw[]; + nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; + totalSize?: CommonTotalSize.Raw | null; + } +} diff --git a/src/serialization/types/RegistryConnectorResponse.ts b/src/serialization/types/RegistryConnectorResponse.ts new file mode 100644 index 00000000..40a2c9df --- /dev/null +++ b/src/serialization/types/RegistryConnectorResponse.ts @@ -0,0 +1,45 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CommonConnectorType } from "./CommonConnectorType.js"; +import { RegistryConnectorCapabilities } from "./RegistryConnectorCapabilities.js"; +import { RegistryIcon } from "./RegistryIcon.js"; + +export const RegistryConnectorResponse: core.serialization.ObjectSchema< + serializers.RegistryConnectorResponse.Raw, + Corti.RegistryConnectorResponse +> = core.serialization.object({ + id: core.serialization.string(), + type: CommonConnectorType, + name: core.serialization.string(), + title: core.serialization.string().optional(), + description: core.serialization.string().optional(), + version: core.serialization.string().optional(), + icons: core.serialization.list(RegistryIcon).optional(), + provider: core.serialization.string().optional(), + websiteUrl: core.serialization.string().optional(), + documentationUrl: core.serialization.string().optional(), + capabilities: RegistryConnectorCapabilities.optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + configSchema: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); + +export declare namespace RegistryConnectorResponse { + export interface Raw { + id: string; + type: CommonConnectorType.Raw; + name: string; + title?: string | null; + description?: string | null; + version?: string | null; + icons?: RegistryIcon.Raw[] | null; + provider?: string | null; + websiteUrl?: string | null; + documentationUrl?: string | null; + capabilities?: RegistryConnectorCapabilities.Raw | null; + tags?: string[] | null; + configSchema?: Record | null; + } +} diff --git a/src/serialization/types/RegistryIcon.ts b/src/serialization/types/RegistryIcon.ts new file mode 100644 index 00000000..775dc0fe --- /dev/null +++ b/src/serialization/types/RegistryIcon.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const RegistryIcon: core.serialization.ObjectSchema = + core.serialization.object({ + src: core.serialization.string(), + mimeType: core.serialization.string().optional(), + sizes: core.serialization.list(core.serialization.string()).optional(), + }); + +export declare namespace RegistryIcon { + export interface Raw { + src: string; + mimeType?: string | null; + sizes?: string[] | null; + } +} diff --git a/src/serialization/types/UsageBucket.ts b/src/serialization/types/UsageBucket.ts new file mode 100644 index 00000000..cd9c0006 --- /dev/null +++ b/src/serialization/types/UsageBucket.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { UsageMetrics } from "./UsageMetrics.js"; + +export const UsageBucket: core.serialization.ObjectSchema = + core.serialization + .object({ + periodStart: core.serialization.date(), + periodEnd: core.serialization.date(), + }) + .extend(UsageMetrics); + +export declare namespace UsageBucket { + export interface Raw extends UsageMetrics.Raw { + periodStart: string; + periodEnd: string; + } +} diff --git a/src/serialization/types/UsageGranularity.ts b/src/serialization/types/UsageGranularity.ts new file mode 100644 index 00000000..2f3edc3a --- /dev/null +++ b/src/serialization/types/UsageGranularity.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const UsageGranularity: core.serialization.Schema = + core.serialization.enum_(["minute", "hour", "day", "week"]); + +export declare namespace UsageGranularity { + export type Raw = "minute" | "hour" | "day" | "week"; +} diff --git a/src/serialization/types/UsageMetrics.ts b/src/serialization/types/UsageMetrics.ts new file mode 100644 index 00000000..dff2cb76 --- /dev/null +++ b/src/serialization/types/UsageMetrics.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const UsageMetrics: core.serialization.ObjectSchema = + core.serialization.object({ + invocations: core.serialization.number(), + uniqueContexts: core.serialization.number(), + }); + +export declare namespace UsageMetrics { + export interface Raw { + invocations: number; + uniqueContexts: number; + } +} diff --git a/src/serialization/types/UsageReportResponse.ts b/src/serialization/types/UsageReportResponse.ts new file mode 100644 index 00000000..564744e9 --- /dev/null +++ b/src/serialization/types/UsageReportResponse.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { UsageBucket } from "./UsageBucket.js"; +import { UsageGranularity } from "./UsageGranularity.js"; +import { UsageMetrics } from "./UsageMetrics.js"; + +export const UsageReportResponse: core.serialization.ObjectSchema< + serializers.UsageReportResponse.Raw, + Corti.UsageReportResponse +> = core.serialization.object({ + granularity: UsageGranularity, + from: core.serialization.date(), + to: core.serialization.date(), + totals: UsageMetrics, + buckets: core.serialization.list(UsageBucket), +}); + +export declare namespace UsageReportResponse { + export interface Raw { + granularity: UsageGranularity.Raw; + from: string; + to: string; + totals: UsageMetrics.Raw; + buckets: UsageBucket.Raw[]; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 7ce73b9e..2ffaffbc 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,3 +1,17 @@ +export * from "./A2AjsonrpcResponse.js"; +export * from "./A2AjsonrpcResponseError.js"; +export * from "./A2AjsonrpcResponseId.js"; +export * from "./A2ASendMessageConfiguration.js"; +export * from "./A2ASendMessageRequest.js"; +export * from "./A2ASendMessageResponse.js"; +export * from "./A2AStreamEventResponse.js"; +export * from "./AgentCardResponse.js"; +export * from "./AgentCardResponseCapabilities.js"; +export * from "./AgentCardResponseProvider.js"; +export * from "./AgentCardResponseSignaturesItem.js"; +export * from "./AgentCardResponseSkillsItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItem.js"; +export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; export * from "./AgentsAgent.js"; export * from "./AgentsAgentCapabilities.js"; export * from "./AgentsAgentCard.js"; @@ -31,6 +45,9 @@ export * from "./AgentsFilePartFile.js"; export * from "./AgentsFilePartKind.js"; export * from "./AgentsFileWithBytes.js"; export * from "./AgentsFileWithUri.js"; +export * from "./AgentsLabels.js"; +export * from "./AgentsLifecycle.js"; +export * from "./AgentsListResponse.js"; export * from "./AgentsMcpServer.js"; export * from "./AgentsMcpServerAuthorizationType.js"; export * from "./AgentsMcpServerTransportType.js"; @@ -45,6 +62,7 @@ export * from "./AgentsRegistryExpert.js"; export * from "./AgentsRegistryExpertsResponse.js"; export * from "./AgentsRegistryMcpServer.js"; export * from "./AgentsRegistryMcpServerAuthorizationType.js"; +export * from "./AgentsResponse.js"; export * from "./AgentsTask.js"; export * from "./AgentsTaskKind.js"; export * from "./AgentsTaskStatus.js"; @@ -52,6 +70,8 @@ export * from "./AgentsTaskStatusState.js"; export * from "./AgentsTextPart.js"; export * from "./AgentsTextPartKind.js"; export * from "./AgentsUpdateExpertReference.js"; +export * from "./AgentsUserIdValue.js"; +export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -63,20 +83,67 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; +export * from "./CommonA2AConnector.js"; +export * from "./CommonA2AConnectorCreate.js"; +export * from "./CommonAgentConnector.js"; +export * from "./CommonAgentConnectorCreate.js"; +export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; +export * from "./CommonArtifactIdValue.js"; +export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; +export * from "./CommonConnectorAuth.js"; +export * from "./CommonConnectorAuthType.js"; +export * from "./CommonConnectorCreateRequest.js"; +export * from "./CommonConnectorIdValue.js"; +export * from "./CommonConnectorResponse.js"; +export * from "./CommonConnectorType.js"; +export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; +export * from "./CommonErrorResponse.js"; +export * from "./CommonErrorResponseError.js"; +export * from "./CommonErrorResponseErrorDetails.js"; +export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; +export * from "./CommonMcpConnector.js"; +export * from "./CommonMcpConnectorCreate.js"; +export * from "./CommonMessage.js"; +export * from "./CommonMessageIdValue.js"; +export * from "./CommonNextPageToken.js"; +export * from "./CommonPart.js"; +export * from "./CommonRegistryConnectorCreate.js"; +export * from "./CommonRegistryConnectorProvisioned.js"; +export * from "./CommonRole.js"; +export * from "./CommonSchemaConnector.js"; +export * from "./CommonSchemaConnectorCreate.js"; +export * from "./CommonSchemaConnectorCreateTransition.js"; +export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; +export * from "./CommonTaskIdValue.js"; +export * from "./CommonTaskListResponse.js"; +export * from "./CommonTaskMetadata.js"; +export * from "./CommonTaskResponse.js"; +export * from "./CommonTaskState.js"; +export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; +export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; +export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; +export * from "./ConnectorsListResponse.js"; +export * from "./Contexts.js"; +export * from "./ContextsDetailResponse.js"; +export * from "./ContextsListResponse.js"; +export * from "./ContextsOpenInferenceSpan.js"; +export * from "./ContextsTraceItem.js"; +export * from "./ContextsTraceItemTrace.js"; +export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -112,6 +179,15 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; +export * from "./FeedbackActor.js"; +export * from "./FeedbackIdValue.js"; +export * from "./FeedbackLabel.js"; +export * from "./FeedbackListResponse.js"; +export * from "./FeedbackMetadata.js"; +export * from "./FeedbackRating.js"; +export * from "./FeedbackRatingScale.js"; +export * from "./FeedbackResponse.js"; +export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -187,6 +263,10 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; +export * from "./RegistryConnectorCapabilities.js"; +export * from "./RegistryConnectorListResponse.js"; +export * from "./RegistryConnectorResponse.js"; +export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -273,4 +353,8 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; +export * from "./UsageBucket.js"; +export * from "./UsageGranularity.js"; +export * from "./UsageMetrics.js"; +export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/tests/unit/stream/Stream.test.ts b/tests/unit/stream/Stream.test.ts new file mode 100644 index 00000000..83575f07 --- /dev/null +++ b/tests/unit/stream/Stream.test.ts @@ -0,0 +1,563 @@ +import { Stream } from "../../../src/core/stream/Stream"; + +describe("Stream", () => { + describe("JSON streaming", () => { + it("should parse single JSON message", async () => { + const mockStream = createReadableStream(['{"value": 1}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should parse multiple JSON messages", async () => { + const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); + }); + + it("should handle messages split across chunks", async () => { + const mockStream = createReadableStream(['{"val', 'ue": 1}\n{"value":', " 2}\n"]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + + it("should skip empty lines", async () => { + const mockStream = createReadableStream(['{"value": 1}\n\n\n{"value": 2}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + + it("should handle custom message terminator", async () => { + const mockStream = createReadableStream(['{"value": 1}|||{"value": 2}|||']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "|||" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + }); + + describe("SSE streaming", () => { + it("should parse SSE data with prefix", async () => { + const mockStream = createReadableStream(['data: {"value": 1}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should parse multiple SSE events", async () => { + const mockStream = createReadableStream(['data: {"value": 1}\ndata: {"value": 2}\ndata: {"value": 3}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); + }); + + it("should stop at stream terminator", async () => { + const mockStream = createReadableStream(['data: {"value": 1}\ndata: [DONE]\ndata: {"value": 2}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse", streamTerminator: "[DONE]" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should skip lines without data prefix", async () => { + const mockStream = createReadableStream([ + 'event: message\ndata: {"value": 1}\nid: 123\ndata: {"value": 2}\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "sse" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }, { value: 2 }]); + }); + }); + + describe("SSE event-level discrimination (inject discriminator)", () => { + it("should inject event type as discriminator into JSON data", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"content": "hello"}\n\nevent: completion\ndata: {"content": "world"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([ + { type: "completion", content: "hello" }, + { type: "completion", content: "world" }, + ]); + }); + + it("should inject different event types for mixed events", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"content": "hi"}\n\nevent: error\ndata: {"message": "fail"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "event" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([ + { event: "completion", content: "hi" }, + { event: "error", message: "fail" }, + ]); + }); + + it("should not inject if data already contains discriminator key", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"type": "existing", "content": "hello"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "existing", content: "hello" }]); + }); + + it("should not false-positive when discriminator key appears inside a value", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"description": "type: foo", "content": "hello"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", description: "type: foo", content: "hello" }]); + }); + + it("should not inject if no event field is present", async () => { + const mockStream = createReadableStream(['data: {"content": "hello"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ content: "hello" }]); + }); + + it("should handle empty JSON object", async () => { + const mockStream = createReadableStream(["event: heartbeat\ndata: {}\n\n"]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "heartbeat" }]); + }); + + it("should stop at stream terminator", async () => { + const mockStream = createReadableStream([ + 'event: completion\ndata: {"content": "hi"}\n\nevent: done\ndata: [DONE]\n\nevent: completion\ndata: {"content": "bye"}\n\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type", streamTerminator: "[DONE]" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", content: "hi" }]); + }); + + it("should concatenate multiline data fields", async () => { + const mockStream = createReadableStream(['event: completion\ndata: {"delta":\ndata: "hello"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", delta: "hello" }]); + }); + + it("should handle events split across chunks", async () => { + const mockStream = createReadableStream(["event: comple", 'tion\ndata: {"con', 'tent": "hi"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", content: "hi" }]); + }); + + it("should handle last event without trailing blank line", async () => { + const mockStream = createReadableStream(['event: completion\ndata: {"content": "hi"}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "completion", content: "hi" }]); + }); + + it("should handle CRLF line endings", async () => { + const mockStream = createReadableStream([ + 'event: completion\r\ndata: {"content": "hi"}\r\n\r\nevent: completion\r\ndata: {"content": "world"}\r\n\r\n', + ]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([ + { type: "completion", content: "hi" }, + { type: "completion", content: "world" }, + ]); + }); + + it("should inject empty string discriminator when event field is present but empty", async () => { + const mockStream = createReadableStream(['event: \ndata: {"content": "hello"}\n\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val, + eventShape: { type: "sse", eventDiscriminator: "type" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ type: "", content: "hello" }]); + }); + }); + + describe("encoding and decoding", () => { + it("should decode UTF-8 text using TextDecoder", async () => { + const encoder = new TextEncoder(); + const mockStream = createReadableStream([encoder.encode('{"text": "café"}\n')]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { text: string }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ text: "café" }]); + }); + + it("should decode emoji correctly", async () => { + const encoder = new TextEncoder(); + const mockStream = createReadableStream([encoder.encode('{"emoji": "🎉"}\n')]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { emoji: string }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ emoji: "🎉" }]); + }); + + it("should handle binary data chunks", async () => { + const encoder = new TextEncoder(); + const mockStream = createReadableStream([encoder.encode('{"val'), encoder.encode('ue": 1}\n')]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + + it("should handle multi-byte UTF-8 characters split across chunk boundaries", async () => { + // Test string with Japanese (3 bytes), Russian (2 bytes), German (2 bytes), and Chinese (3 bytes) + const testString = '{"text": "こんにちは Привет Größe 你好"}\n'; + const fullBytes = new TextEncoder().encode(testString); + + // Split the bytes in the middle of multi-byte characters + // Japanese "こ" starts at byte 11, is 3 bytes (E3 81 93) + // Split after first byte of "こ" to test mid-character splitting + const splitPoint = 12; // This splits "こ" in the middle + const chunk1 = fullBytes.slice(0, splitPoint); + const chunk2 = fullBytes.slice(splitPoint); + + const mockStream = createReadableStream([chunk1, chunk2]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { text: string }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ text: "こんにちは Привет Größe 你好" }]); + }); + }); + + describe("abort signal", () => { + it("should handle abort signal", async () => { + const controller = new AbortController(); + const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + signal: controller.signal, + }); + + const messages: unknown[] = []; + let count = 0; + for await (const message of stream) { + messages.push(message); + count++; + if (count === 2) { + controller.abort(); + break; + } + } + + expect(messages.length).toBe(2); + }); + }); + + describe("async iteration", () => { + it("should support async iterator protocol", async () => { + const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const iterator = stream[Symbol.asyncIterator](); + const first = await iterator.next(); + expect(first.done).toBe(false); + expect(first.value).toEqual({ value: 1 }); + + const second = await iterator.next(); + expect(second.done).toBe(false); + expect(second.value).toEqual({ value: 2 }); + + const third = await iterator.next(); + expect(third.done).toBe(true); + }); + }); + + describe("edge cases", () => { + it("should handle empty stream", async () => { + const mockStream = createReadableStream([]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([]); + }); + + it("should handle stream with only whitespace", async () => { + const mockStream = createReadableStream([" \n\n\t\n "]); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([]); + }); + + it("should handle incomplete message at end of stream", async () => { + const mockStream = createReadableStream(['{"value": 1}\n{"incomplete']); + const stream = new Stream({ + stream: mockStream, + parse: async (val: unknown) => val as { value: number }, + eventShape: { type: "json", messageTerminator: "\n" }, + }); + + const messages: unknown[] = []; + for await (const message of stream) { + messages.push(message); + } + + expect(messages).toEqual([{ value: 1 }]); + }); + }); +}); + +// Helper function to create a ReadableStream from string chunks +function createReadableStream(chunks: (string | Uint8Array)[]): ReadableStream { + // For standard type, return ReadableStream + let index = 0; + return new ReadableStream({ + pull(controller) { + if (index < chunks.length) { + const chunk = chunks[index++]; + controller.enqueue(typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk); + } else { + controller.close(); + } + }, + }); +} diff --git a/tests/wire/agentic.test.ts b/tests/wire/agentic.test.ts new file mode 100644 index 00000000..eae6116b --- /dev/null +++ b/tests/wire/agentic.test.ts @@ -0,0 +1,1078 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../src/api/index"; +import { CortiClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; +import { mockOAuth } from "./mockAuth"; + +describe("AgenticClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + agents: [ + { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "description", + systemPrompt: "systemPrompt", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + labels: { key: "value" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.agentic.list({ + label: ["team=coding"], + q: "coder", + }); + expect(response).toEqual({ + agents: [ + { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "description", + systemPrompt: "systemPrompt", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + labels: { + key: "value", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.agentic.list(); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.agentic.list(); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("create (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { type: "registry", name: "@dedalus/coding-expert" }, + { + type: "mcp", + name: "policybot", + url: "https://mcp.example.com", + auth: { + type: "oauth2", + scope: "read:policies", + redirectUrl: "https://app.corti.ai/oauth/callback", + }, + }, + { + type: "schema", + name: "submit_code", + description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + schema: { + type: "object", + properties: { + code: { type: "string", description: "The selected ICD-10 code." }, + confidence: { type: "number", minimum: 0, maximum: 1 }, + }, + required: ["code"], + }, + transition: "complete", + }, + ], + labels: { team: "coding", env: "prod" }, + }; + const rawResponseBody = { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.create({ + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + type: "registry", + name: "@dedalus/coding-expert", + }, + { + type: "mcp", + name: "policybot", + url: "https://mcp.example.com", + auth: { + type: "oauth2", + scope: "read:policies", + redirectUrl: "https://app.corti.ai/oauth/callback", + }, + }, + { + type: "schema", + name: "submit_code", + description: "Submit the final ICD-10 code for the encounter along with a confidence score.", + schema: { + type: "object", + properties: { + code: { + type: "string", + description: "The selected ICD-10 code.", + }, + confidence: { + type: "number", + minimum: 0, + maximum: 1, + }, + }, + required: ["code"], + }, + transition: "complete", + }, + ], + labels: { + team: "coding", + env: "prod", + }, + }); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }); + }); + + test("create (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.ConflictError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.create({ + name: "x", + }); + }).rejects.toThrow(Corti.UnprocessableEntityError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.get("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.get("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.get("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.delete("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.delete("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.delete("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("update (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { name: "coder-v2", connectors: [{ type: "registry", name: "@dedalus/coding-expert" }] }; + const rawResponseBody = { + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + labels: { team: "coding", env: "prod" }, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:00Z", + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + name: "coder-v2", + connectors: [ + { + type: "registry", + name: "@dedalus/coding-expert", + }, + ], + }); + expect(response).toEqual({ + id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + systemPrompt: "Respond with only the ICD-10 code.", + model: "corti-default", + visibility: "private", + lifecycle: "persistent", + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + labels: { + team: "coding", + env: "prod", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:00.000Z"), + createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", + }); + }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("update (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.update("agentId"); + }).rejects.toThrow(Corti.UnprocessableEntityError); + }); + + test("getCard (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + documentationUrl: "documentationUrl", + iconUrl: "iconUrl", + version: "0.1.0", + capabilities: { streaming: true, pushNotifications: false }, + defaultInputModes: ["text/plain"], + defaultOutputModes: ["text/plain"], + provider: { organization: "Corti", url: "https://corti.ai" }, + securityRequirements: [{ key: "value" }], + securitySchemes: { key: "value" }, + signatures: [{ protected: "protected", header: { key: "value" }, signature: "signature" }], + skills: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + name: "coding-expert", + description: "ICD-10 coding.", + tags: ["expert"], + }, + ], + supportedInterfaces: [ + { + protocolBinding: "JSONRPC", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + { + protocolBinding: "HTTP+JSON", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/.well-known/agent-card.json") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual({ + name: "coder", + description: "Returns ICD-10 codes for a clinical encounter.", + documentationUrl: "documentationUrl", + iconUrl: "iconUrl", + version: "0.1.0", + capabilities: { + streaming: true, + pushNotifications: false, + }, + defaultInputModes: ["text/plain"], + defaultOutputModes: ["text/plain"], + provider: { + organization: "Corti", + url: "https://corti.ai", + }, + securityRequirements: [ + { + key: "value", + }, + ], + securitySchemes: { + key: "value", + }, + signatures: [ + { + protected: "protected", + header: { + key: "value", + }, + signature: "signature", + }, + ], + skills: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + name: "coding-expert", + description: "ICD-10 coding.", + tags: ["expert"], + }, + ], + supportedInterfaces: [ + { + protocolBinding: "JSONRPC", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + { + protocolBinding: "HTTP+JSON", + protocolVersion: "1.0", + url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", + }, + ], + }); + }); + + test("getCard (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.getCard("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("getCard (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.getCard("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/a2A.test.ts b/tests/wire/agentic/a2A.test.ts new file mode 100644 index 00000000..f538c0d9 --- /dev/null +++ b/tests/wire/agentic/a2A.test.ts @@ -0,0 +1,528 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("A2AClient", () => { + test("jsonRpc (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + jsonrpc: "2.0", + id: "1", + method: "SendMessage", + params: { + message: { + role: "ROLE_USER", + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + parts: [{ text: "Code this encounter." }], + }, + }, + }; + const rawResponseBody = { + jsonrpc: "2.0", + id: "msg-001", + result: { + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { state: "TASK_STATE_COMPLETED" }, + }, + }, + error: { code: -32600, message: "Invalid Request", data: { key: "value" } }, + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + id: "1", + method: "SendMessage", + params: { + message: { + role: "ROLE_USER", + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + parts: [ + { + text: "Code this encounter.", + }, + ], + }, + }, + }); + expect(response).toEqual({ + jsonrpc: "2.0", + id: "msg-001", + result: { + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + }, + }, + }, + error: { + code: -32600, + message: "Invalid Request", + data: { + key: "value", + }, + }, + }); + }); + + test("jsonRpc (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.jsonRpc("agentId", { + id: "id", + method: "SendMessage", + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("jsonRpc (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.jsonRpc("agentId", { + id: "id", + method: "SendMessage", + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("sendMessage (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [{ text: "What is the ICD-10 code for asthma?" }], + }, + }; + const rawResponseBody = { + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + timestamp: "2026-05-19T12:00:01Z", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + }, + }, + artifacts: [{ artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", parts: [{ text: "J45.909" }] }], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [ + { + text: "What is the ICD-10 code for asthma?", + }, + ], + }, + }); + expect(response).toEqual({ + task: { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + timestamp: "2026-05-19T12:00:01Z", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + }, + }, + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + }); + }); + + test("sendMessage (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.sendMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("sendMessage (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.sendMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("sendMessage (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:send") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.sendMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("streamMessage (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [{ text: "What is the ICD-10 code for asthma?" }], + }, + }; + const rawResponseBody = + 'event: \ndata: {"data":"{\\"task\\":{\\"id\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_WORKING\\"}}}","event":"message","id":"id","retry":1}\n\n'; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .sseBody(rawResponseBody) + .build(); + + const response = await client.agentic.a2A.streamMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + role: "ROLE_USER", + parts: [ + { + text: "What is the ICD-10 code for asthma?", + }, + ], + }, + }); + const events: unknown[] = []; + for await (const event of response) { + events.push(event); + } + expect(events).toEqual([ + { + data: '{"task":{"id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_WORKING"}}}', + event: "message", + id: "id", + retry: 1, + }, + ]); + }); + + test("streamMessage (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.streamMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("streamMessage (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.streamMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("streamMessage (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/message:stream") + .header("A2A-Version", "1.0") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.streamMessage("agentId", { + message: { + role: "ROLE_USER", + parts: [{}, {}], + }, + }); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/a2A/tasks.test.ts b/tests/wire/agentic/a2A/tasks.test.ts new file mode 100644 index 00000000..3f2f6bef --- /dev/null +++ b/tests/wire/agentic/a2A/tasks.test.ts @@ -0,0 +1,701 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../../src/api/index"; +import { CortiClient } from "../../../../src/Client"; +import { mockServerPool } from "../../../mock-server/MockServerPool"; +import { mockOAuth } from "../../mockAuth"; + +describe("TasksClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual({ + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/a2a/tasks") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.list("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ) + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.a2A.tasks.get( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.get("agentId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.get("agentId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("cancel (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }; + + server + .mockEndpoint() + .post( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:cancel", + ) + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.a2A.tasks.cancel( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }); + }); + + test("cancel (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("cancel (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("cancel (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); + }).rejects.toThrow(Corti.ConflictError); + }); + + test("subscribe (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = + 'event: \ndata: {"data":"{\\"statusUpdate\\":{\\"taskId\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_COMPLETED\\",\\"timestamp\\":\\"2026-05-19T12:00:01Z\\"}}}","event":"event","id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","retry":1}\n\n'; + + server + .mockEndpoint() + .post( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:subscribe", + ) + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(200) + .sseBody(rawResponseBody) + .build(); + + const response = await client.agentic.a2A.tasks.subscribe( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + const events: unknown[] = []; + for await (const event of response) { + events.push(event); + } + expect(events).toEqual([ + { + data: '{"statusUpdate":{"taskId":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_COMPLETED","timestamp":"2026-05-19T12:00:01Z"}}}', + event: "event", + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + retry: 1, + }, + ]); + }); + + test("subscribe (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("subscribe (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") + .header("A2A-Version", "1.0") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/artifacts.test.ts b/tests/wire/agentic/artifacts.test.ts new file mode 100644 index 00000000..ef140243 --- /dev/null +++ b/tests/wire/agentic/artifacts.test.ts @@ -0,0 +1,161 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("ArtifactsClient", () => { + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [ + { + text: "J45.909", + data: { key: "value" }, + filename: "filename", + mediaType: "mediaType", + raw: "raw", + url: "url", + metadata: { key: "value" }, + }, + ], + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/artifacts/art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.artifacts.get( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + ); + expect(response).toEqual({ + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + data: { + key: "value", + }, + filename: "filename", + mediaType: "mediaType", + raw: "raw", + url: "url", + metadata: { + key: "value", + }, + }, + ], + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); + }).rejects.toThrow(Corti.ForbiddenError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/connectors.test.ts b/tests/wire/agentic/connectors.test.ts new file mode 100644 index 00000000..22533425 --- /dev/null +++ b/tests/wire/agentic/connectors.test.ts @@ -0,0 +1,620 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("ConnectorsClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); + expect(response).toEqual({ + connectors: [ + { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }, + ], + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.list("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.list("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("attach (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "@dedalus/coding-expert" }; + const rawResponseBody = { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + type: "registry", + name: "@dedalus/coding-expert", + }); + expect(response).toEqual({ + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }); + }); + + test("attach (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("attach (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("attach (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("attach (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { type: "registry", name: "name" }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/agents/agentId/connectors") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.attach("agentId", { + type: "registry", + name: "name", + }); + }).rejects.toThrow(Corti.ConflictError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.connectors.get( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ); + expect(response).toEqual({ + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.get("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.get("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("remove (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agentic.connectors.remove( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ); + expect(response).toEqual(undefined); + }); + + test("remove (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.remove("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("remove (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.remove("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("update (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { enabled: false }; + const rawResponseBody = { + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { key: "value" }, + }; + + server + .mockEndpoint() + .patch( + "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + ) + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.connectors.update( + "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + { + enabled: false, + }, + ); + expect(response).toEqual({ + id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", + type: "registry", + enabled: true, + name: "@dedalus/coding-expert", + config: { + key: "value", + }, + }); + }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = {}; + const rawResponseBody = { error: { code: "code", message: "message" } }; + + server + .mockEndpoint() + .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(501) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.connectors.update("agentId", "agentConnectorId"); + }).rejects.toThrow(Corti.NotImplementedError); + }); +}); diff --git a/tests/wire/agentic/contexts.test.ts b/tests/wire/agentic/contexts.test.ts new file mode 100644 index 00000000..9cb00a4b --- /dev/null +++ b/tests/wire/agentic/contexts.test.ts @@ -0,0 +1,523 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("ContextsClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + contexts: [ + { + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + expiresAt: "2024-01-15T09:30:00Z", + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.contexts.list(); + expect(response).toEqual({ + contexts: [ + { + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + expiresAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.list(); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: "2026-05-19T12:00:00Z", + updatedAt: "2026-05-19T12:00:01Z", + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{ text: "Code this encounter: acute asthma exacerbation." }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.901" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [{ text: "J45.901" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + expect(response).toEqual({ + id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", + taskCount: 1, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + updatedAt: new Date("2026-05-19T12:00:01.000Z"), + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [ + { + text: "Code this encounter: acute asthma exacerbation.", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.901", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [ + { + text: "J45.901", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.get("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.get("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.delete("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.delete("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("getTrace (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + traces: [ + { + trace: { + id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", + name: "invoke_agent", + start_time: "2026-05-19T12:00:00Z", + thread_id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + }, + spans: [ + { + name: "invoke_llm", + span_id: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", + start_time: "2026-05-19T12:00:00Z", + }, + ], + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/trace") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + expect(response).toEqual({ + traces: [ + { + trace: { + id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", + name: "invoke_agent", + startTime: new Date("2026-05-19T12:00:00.000Z"), + threadId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + }, + spans: [ + { + name: "invoke_llm", + spanId: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", + startTime: new Date("2026-05-19T12:00:00.000Z"), + }, + ], + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }); + }); + + test("getTrace (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/trace") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.getTrace("contextId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("getTrace (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/trace") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.getTrace("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("getTrace (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/trace") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.getTrace("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/contexts/tasks.test.ts b/tests/wire/agentic/contexts/tasks.test.ts new file mode 100644 index 00000000..97a70d33 --- /dev/null +++ b/tests/wire/agentic/contexts/tasks.test.ts @@ -0,0 +1,393 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../../src/api/index"; +import { CortiClient } from "../../../../src/Client"; +import { mockServerPool } from "../../../mock-server/MockServerPool"; +import { mockOAuth } from "../../mockAuth"; + +describe("TasksClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); + expect(response).toEqual({ + pageSize: 1, + tasks: [ + { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.tasks.list("contextId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.tasks.list("contextId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + timestamp: "2026-05-19T12:00:01Z", + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [{ text: "J45.909" }], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { key: "value" }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { key: "value" }, + parts: [{ text: "J45.909" }], + }, + ], + metadata: { + $usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.contexts.tasks.get( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + status: { + state: "TASK_STATE_COMPLETED", + message: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_USER", + parts: [{}], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + timestamp: new Date("2026-05-19T12:00:01.000Z"), + }, + history: [ + { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + role: "ROLE_AGENT", + parts: [ + { + text: "J45.909", + }, + ], + referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], + extensions: ["extensions"], + metadata: { + key: "value", + }, + }, + ], + artifacts: [ + { + artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", + name: "icd10-result", + description: "description", + extensions: ["extensions"], + metadata: { + key: "value", + }, + parts: [ + { + text: "J45.909", + }, + ], + }, + ], + metadata: { + usage: { + model: "corti-default", + inputTokens: 100, + outputTokens: 20, + cachedInputTokens: 64, + cacheCreationInputTokens: 0, + totalTokens: 120, + credits: 1.2, + }, + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.tasks.get("contextId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.contexts.tasks.get("contextId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/feedback.test.ts b/tests/wire/agentic/feedback.test.ts new file mode 100644 index 00000000..e911afb5 --- /dev/null +++ b/tests/wire/agentic/feedback.test.ts @@ -0,0 +1,511 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("FeedbackClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + feedbacks: [ + { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { scale: "binary", value: 1 }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { collectionMethod: "thumbs" }, + createdAt: "2026-05-19T12:00:00Z", + }, + ], + }; + + server + .mockEndpoint() + .get( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", + ) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.feedback.list( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + ); + expect(response).toEqual({ + feedbacks: [ + { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { + scale: "binary", + value: 1, + }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "thumbs", + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + }, + ], + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.list("contextId", "taskId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.list("contextId", "taskId"); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("create (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1 } }; + const rawResponseBody = { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { scale: "binary", value: 1 }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { externalId: "externalId" }, + }, + createdAt: "2026-05-19T12:00:00Z", + }; + + server + .mockEndpoint() + .post( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", + ) + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.feedback.create( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + { + rating: { + scale: "binary", + value: 1, + }, + }, + ); + expect(response).toEqual({ + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { + scale: "binary", + value: 1, + }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { + externalId: "externalId", + }, + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + }); + }); + + test("create (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { + rating: { scale: "binary", value: 0 }, + labels: ["unsupportedClaim"], + reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { + collectionMethod: "caseReview", + clientReference: "case-review-728193", + actor: { externalId: "clinician_4182" }, + }, + }; + const rawResponseBody = { + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { scale: "binary", value: 1 }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { externalId: "externalId" }, + }, + createdAt: "2026-05-19T12:00:00Z", + }; + + server + .mockEndpoint() + .post( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", + ) + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.feedback.create( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + { + rating: { + scale: "binary", + value: 0, + }, + labels: ["unsupportedClaim"], + reason: "The response stated that the patient had diabetes, but this was not present in the available data.", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "caseReview", + clientReference: "case-review-728193", + actor: { + externalId: "clinician_4182", + }, + }, + }, + ); + expect(response).toEqual({ + id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", + taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + rating: { + scale: "binary", + value: 1, + }, + normalizedScore: 1, + labels: ["correct", "helpful"], + reason: "The response stated the patient had diabetes", + target: { + messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", + }, + metadata: { + collectionMethod: "thumbs", + clientReference: "clientReference", + actor: { + externalId: "externalId", + }, + }, + createdAt: new Date("2026-05-19T12:00:00.000Z"), + }); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.NotFoundError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.create("contextId", "taskId", { + rating: { + scale: "binary", + value: 1.1, + }, + }); + }).rejects.toThrow(Corti.UnprocessableEntityError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + server + .mockEndpoint() + .delete( + "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback/fb.0192f4c8-7e2a-7b3c-9d4e-5f6a7b8c9d01", + ) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agentic.feedback.delete( + "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", + "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", + "fb.0192f4c8-7e2a-7b3c-9d4e-5f6a7b8c9d01", + ); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback/feedbackId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.delete("contextId", "taskId", "feedbackId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback/feedbackId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.feedback.delete("contextId", "taskId", "feedbackId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/registry.test.ts b/tests/wire/agentic/registry.test.ts new file mode 100644 index 00000000..582607aa --- /dev/null +++ b/tests/wire/agentic/registry.test.ts @@ -0,0 +1,239 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("RegistryClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + connectors: [ + { + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "description", + version: "1.4.2", + icons: [{ src: "src", mimeType: "image/svg+xml", sizes: ["48x48"] }], + provider: "Dedalus", + websiteUrl: "websiteUrl", + documentationUrl: "documentationUrl", + tags: ["tags"], + configSchema: { key: "value" }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.registry.list(); + expect(response).toEqual({ + connectors: [ + { + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "description", + version: "1.4.2", + icons: [ + { + src: "src", + mimeType: "image/svg+xml", + sizes: ["48x48"], + }, + ], + provider: "Dedalus", + websiteUrl: "websiteUrl", + documentationUrl: "documentationUrl", + tags: ["tags"], + configSchema: { + key: "value", + }, + }, + ], + nextPageToken: "nextPageToken", + totalSize: 42, + }); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.registry.list(); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "Returns ICD-10 codes for a clinical encounter.", + version: "1.4.2", + icons: [ + { + src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", + mimeType: "image/svg+xml", + sizes: ["any"], + }, + ], + provider: "Dedalus", + websiteUrl: "https://dedalus.example.com/coding-expert", + documentationUrl: "https://docs.dedalus.example.com/coding-expert", + capabilities: { + streaming: true, + inputModes: ["text/plain"], + outputModes: ["text/plain", "application/json"], + tools: ["lookup_icd10", "validate_code"], + }, + tags: ["icd10", "billing", "expert"], + configSchema: { key: "value" }, + }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors/connectorId") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.registry.get("connectorId"); + expect(response).toEqual({ + id: "@dedalus/coding-expert", + type: "registry", + name: "coding-expert", + title: "ICD-10 Coding Expert", + description: "Returns ICD-10 codes for a clinical encounter.", + version: "1.4.2", + icons: [ + { + src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", + mimeType: "image/svg+xml", + sizes: ["any"], + }, + ], + provider: "Dedalus", + websiteUrl: "https://dedalus.example.com/coding-expert", + documentationUrl: "https://docs.dedalus.example.com/coding-expert", + capabilities: { + streaming: true, + inputModes: ["text/plain"], + outputModes: ["text/plain", "application/json"], + tools: ["lookup_icd10", "validate_code"], + }, + tags: ["icd10", "billing", "expert"], + configSchema: { + key: "value", + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors/connectorId") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.registry.get("connectorId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/registry/connectors/connectorId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.registry.get("connectorId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); diff --git a/tests/wire/agentic/usage.test.ts b/tests/wire/agentic/usage.test.ts new file mode 100644 index 00000000..c7586319 --- /dev/null +++ b/tests/wire/agentic/usage.test.ts @@ -0,0 +1,159 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Corti from "../../../src/api/index"; +import { CortiClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; +import { mockOAuth } from "../mockAuth"; + +describe("UsageClient", () => { + test("get (1)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { + granularity: "day", + from: "2026-05-19T00:00:00Z", + to: "2026-05-21T00:00:00Z", + totals: { invocations: 15, uniqueContexts: 6 }, + buckets: [ + { + invocations: 12, + uniqueContexts: 5, + periodStart: "2026-05-19T00:00:00Z", + periodEnd: "2026-05-20T00:00:00Z", + }, + { + invocations: 3, + uniqueContexts: 2, + periodStart: "2026-05-20T00:00:00Z", + periodEnd: "2026-05-21T00:00:00Z", + }, + ], + }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/usage") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { + from: new Date("2026-05-19T00:00:00.000Z"), + to: new Date("2026-05-20T00:00:00.000Z"), + }); + expect(response).toEqual({ + granularity: "day", + from: new Date("2026-05-19T00:00:00.000Z"), + to: new Date("2026-05-21T00:00:00.000Z"), + totals: { + invocations: 15, + uniqueContexts: 6, + }, + buckets: [ + { + invocations: 12, + uniqueContexts: 5, + periodStart: new Date("2026-05-19T00:00:00.000Z"), + periodEnd: new Date("2026-05-20T00:00:00.000Z"), + }, + { + invocations: 3, + uniqueContexts: 2, + periodStart: new Date("2026-05-20T00:00:00.000Z"), + periodEnd: new Date("2026-05-21T00:00:00.000Z"), + }, + ], + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/usage") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.usage.get("agentId"); + }).rejects.toThrow(Corti.BadRequestError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/usage") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.usage.get("agentId"); + }).rejects.toThrow(Corti.UnauthorizedError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + mockOAuth(server); + + const client = new CortiClient({ + maxRetries: 0, + clientId: "client_id", + clientSecret: "client_secret", + tenantName: "test", + environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v2/agentic/agents/agentId/usage") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentic.usage.get("agentId"); + }).rejects.toThrow(Corti.NotFoundError); + }); +}); From 2cd03d0019ba42a0641601810559e95da5264fc7 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 14:52:43 +0000 Subject: [PATCH 11/18] SDK regeneration --- .fern/metadata.json | 2 +- src/Client.ts | 6 - src/api/errors/NotImplementedError.ts | 22 - src/api/errors/index.ts | 1 - src/api/resources/agentic/client/Client.ts | 654 ---------- src/api/resources/agentic/client/index.ts | 1 - .../client/requests/AgentsCreateRequest.ts | 69 -- .../client/requests/AgentsPatchRequest.ts | 30 - .../client/requests/ListAgenticRequest.ts | 25 - .../agentic/client/requests/index.ts | 3 - src/api/resources/agentic/index.ts | 2 - .../agentic/resources/a2A/client/Client.ts | 345 ------ .../agentic/resources/a2A/client/index.ts | 1 - .../a2A/client/requests/A2AjsonrpcRequest.ts | 29 - .../resources/a2A/client/requests/index.ts | 1 - .../resources/agentic/resources/a2A/index.ts | 3 - .../agentic/resources/a2A/resources/index.ts | 2 - .../a2A/resources/tasks/client/Client.ts | 382 ------ .../a2A/resources/tasks/client/index.ts | 1 - .../tasks/client/requests/GetTasksRequest.ts | 10 - .../tasks/client/requests/ListTasksRequest.ts | 14 - .../resources/tasks/client/requests/index.ts | 2 - .../resources/a2A/resources/tasks/index.ts | 1 - .../a2A/types/A2AjsonrpcRequestId.ts | 3 - .../a2A/types/A2AjsonrpcRequestMethod.ts | 12 - .../agentic/resources/a2A/types/index.ts | 2 - .../resources/artifacts/client/Client.ts | 115 -- .../resources/artifacts/client/index.ts | 1 - .../agentic/resources/artifacts/index.ts | 1 - .../resources/connectors/client/Client.ts | 467 ------- .../resources/connectors/client/index.ts | 1 - .../client/requests/ConnectorsPatchRequest.ts | 21 - .../connectors/client/requests/index.ts | 1 - .../agentic/resources/connectors/index.ts | 1 - .../resources/contexts/client/Client.ts | 368 ------ .../resources/contexts/client/index.ts | 1 - .../client/requests/GetContextsRequest.ts | 10 - .../requests/GetTraceContextsRequest.ts | 12 - .../client/requests/ListContextsRequest.ts | 18 - .../contexts/client/requests/index.ts | 3 - .../agentic/resources/contexts/index.ts | 2 - .../resources/contexts/resources/index.ts | 2 - .../contexts/resources/tasks/client/Client.ts | 196 --- .../contexts/resources/tasks/client/index.ts | 1 - .../tasks/client/requests/ListTasksRequest.ts | 12 - .../resources/tasks/client/requests/index.ts | 1 - .../contexts/resources/tasks/index.ts | 1 - .../resources/feedback/client/Client.ts | 313 ----- .../resources/feedback/client/index.ts | 1 - .../client/requests/FeedbackCreateRequest.ts | 49 - .../feedback/client/requests/index.ts | 1 - .../agentic/resources/feedback/index.ts | 1 - src/api/resources/agentic/resources/index.ts | 14 - .../resources/registry/client/Client.ts | 185 --- .../resources/registry/client/index.ts | 1 - .../client/requests/ListRegistryRequest.ts | 17 - .../registry/client/requests/index.ts | 1 - .../agentic/resources/registry/index.ts | 1 - .../agentic/resources/usage/client/Client.ts | 131 -- .../agentic/resources/usage/client/index.ts | 1 - .../usage/client/requests/GetUsageRequest.ts | 25 - .../resources/usage/client/requests/index.ts | 1 - .../agentic/resources/usage/index.ts | 1 - src/api/resources/index.ts | 2 - src/api/types/A2ASendMessageConfiguration.ts | 13 - src/api/types/A2ASendMessageRequest.ts | 15 - src/api/types/A2ASendMessageResponse.ts | 6 - src/api/types/A2AStreamEventResponse.ts | 18 - src/api/types/A2AjsonrpcResponse.ts | 16 - src/api/types/A2AjsonrpcResponseError.ts | 13 - src/api/types/A2AjsonrpcResponseId.ts | 3 - src/api/types/AgentCardResponse.ts | 37 - .../types/AgentCardResponseCapabilities.ts | 14 - src/api/types/AgentCardResponseProvider.ts | 11 - .../types/AgentCardResponseSignaturesItem.ts | 10 - src/api/types/AgentCardResponseSkillsItem.ts | 12 - ...gentCardResponseSupportedInterfacesItem.ts | 12 - ...eSupportedInterfacesItemProtocolBinding.ts | 9 - src/api/types/AgentsLabels.ts | 6 - src/api/types/AgentsLifecycle.ts | 11 - src/api/types/AgentsListResponse.ts | 13 - src/api/types/AgentsResponse.ts | 32 - src/api/types/AgentsUserIdValue.ts | 6 - src/api/types/AgentsVisibility.ts | 13 - src/api/types/CommonA2AConnector.ts | 22 - src/api/types/CommonA2AConnectorCreate.ts | 14 - src/api/types/CommonAgentConnector.ts | 19 - src/api/types/CommonAgentConnectorCreate.ts | 13 - src/api/types/CommonAgentIdValue.ts | 6 - src/api/types/CommonArtifactIdValue.ts | 6 - src/api/types/CommonArtifactResponse.ts | 20 - src/api/types/CommonConnectorAuth.ts | 17 - src/api/types/CommonConnectorAuthType.ts | 10 - src/api/types/CommonConnectorCreateRequest.ts | 13 - src/api/types/CommonConnectorIdValue.ts | 6 - src/api/types/CommonConnectorResponse.ts | 13 - src/api/types/CommonConnectorType.ts | 15 - src/api/types/CommonContextIdValue.ts | 6 - src/api/types/CommonErrorResponse.ts | 24 - src/api/types/CommonErrorResponseError.ts | 25 - .../types/CommonErrorResponseErrorDetails.ts | 14 - ...esponseErrorDetailsValidationErrorsItem.ts | 8 - src/api/types/CommonMcpConnector.ts | 23 - src/api/types/CommonMcpConnectorCreate.ts | 17 - src/api/types/CommonMessage.ts | 27 - src/api/types/CommonMessageIdValue.ts | 6 - src/api/types/CommonNextPageToken.ts | 6 - src/api/types/CommonPart.ts | 23 - .../types/CommonRegistryConnectorCreate.ts | 14 - .../CommonRegistryConnectorProvisioned.ts | 22 - src/api/types/CommonRole.ts | 8 - src/api/types/CommonSchemaConnector.ts | 26 - src/api/types/CommonSchemaConnectorCreate.ts | 20 - .../CommonSchemaConnectorCreateTransition.ts | 9 - .../types/CommonSchemaConnectorTransition.ts | 9 - src/api/types/CommonTaskIdValue.ts | 6 - src/api/types/CommonTaskListResponse.ts | 15 - src/api/types/CommonTaskMetadata.ts | 15 - src/api/types/CommonTaskResponse.ts | 18 - src/api/types/CommonTaskState.ts | 14 - src/api/types/CommonTaskStatus.ts | 13 - src/api/types/CommonTotalSize.ts | 6 - src/api/types/CommonUsage.ts | 27 - src/api/types/ConnectorsListResponse.ts | 11 - src/api/types/Contexts.ts | 19 - src/api/types/ContextsDetailResponse.ts | 14 - src/api/types/ContextsListResponse.ts | 13 - src/api/types/ContextsOpenInferenceSpan.ts | 19 - src/api/types/ContextsTraceItem.ts | 13 - src/api/types/ContextsTraceItemTrace.ts | 25 - src/api/types/ContextsTraceResponse.ts | 14 - src/api/types/FeedbackActor.ts | 14 - src/api/types/FeedbackIdValue.ts | 6 - src/api/types/FeedbackLabel.ts | 37 - src/api/types/FeedbackListResponse.ts | 11 - src/api/types/FeedbackMetadata.ts | 18 - src/api/types/FeedbackRating.ts | 12 - src/api/types/FeedbackRatingScale.ts | 12 - src/api/types/FeedbackResponse.ts | 25 - src/api/types/FeedbackTarget.ts | 11 - .../types/RegistryConnectorCapabilities.ts | 15 - .../types/RegistryConnectorListResponse.ts | 13 - src/api/types/RegistryConnectorResponse.ts | 35 - src/api/types/RegistryIcon.ts | 13 - src/api/types/UsageBucket.ts | 13 - src/api/types/UsageGranularity.ts | 10 - src/api/types/UsageMetrics.ts | 11 - src/api/types/UsageReportResponse.ts | 18 - src/api/types/index.ts | 84 -- src/core/index.ts | 1 - src/core/stream/Stream.ts | 235 ---- src/core/stream/index.ts | 1 - .../resources/agentic/client/index.ts | 1 - .../client/requests/AgentsCreateRequest.ts | 36 - .../client/requests/AgentsPatchRequest.ts | 37 - .../agentic/client/requests/index.ts | 2 - src/serialization/resources/agentic/index.ts | 2 - .../agentic/resources/a2A/client/index.ts | 1 - .../a2A/client/requests/A2AjsonrpcRequest.ts | 24 - .../resources/a2A/client/requests/index.ts | 1 - .../resources/agentic/resources/a2A/index.ts | 2 - .../a2A/types/A2AjsonrpcRequestId.ts | 14 - .../a2A/types/A2AjsonrpcRequestMethod.ts | 27 - .../agentic/resources/a2A/types/index.ts | 2 - .../resources/connectors/client/index.ts | 1 - .../client/requests/ConnectorsPatchRequest.ts | 27 - .../connectors/client/requests/index.ts | 1 - .../agentic/resources/connectors/index.ts | 1 - .../resources/feedback/client/index.ts | 1 - .../client/requests/FeedbackCreateRequest.ts | 30 - .../feedback/client/requests/index.ts | 1 - .../agentic/resources/feedback/index.ts | 1 - .../resources/agentic/resources/index.ts | 7 - src/serialization/resources/index.ts | 2 - .../types/A2ASendMessageConfiguration.ts | 22 - .../types/A2ASendMessageRequest.ts | 26 - .../types/A2ASendMessageResponse.ts | 14 - .../types/A2AStreamEventResponse.ts | 24 - src/serialization/types/A2AjsonrpcResponse.ts | 26 - .../types/A2AjsonrpcResponseError.ts | 22 - .../types/A2AjsonrpcResponseId.ts | 14 - src/serialization/types/AgentCardResponse.ts | 51 - .../types/AgentCardResponseCapabilities.ts | 20 - .../types/AgentCardResponseProvider.ts | 20 - .../types/AgentCardResponseSignaturesItem.ts | 22 - .../types/AgentCardResponseSkillsItem.ts | 24 - ...gentCardResponseSupportedInterfacesItem.ts | 23 - ...eSupportedInterfacesItemProtocolBinding.ts | 14 - src/serialization/types/AgentsLabels.ts | 12 - src/serialization/types/AgentsLifecycle.ts | 12 - src/serialization/types/AgentsListResponse.ts | 25 - src/serialization/types/AgentsResponse.ts | 44 - src/serialization/types/AgentsUserIdValue.ts | 12 - src/serialization/types/AgentsVisibility.ts | 12 - src/serialization/types/CommonA2AConnector.ts | 27 - .../types/CommonA2AConnectorCreate.ts | 24 - .../types/CommonAgentConnector.ts | 26 - .../types/CommonAgentConnectorCreate.ts | 23 - src/serialization/types/CommonAgentIdValue.ts | 14 - .../types/CommonArtifactIdValue.ts | 14 - .../types/CommonArtifactResponse.ts | 30 - .../types/CommonConnectorAuth.ts | 25 - .../types/CommonConnectorAuthType.ts | 14 - .../types/CommonConnectorCreateRequest.ts | 30 - .../types/CommonConnectorIdValue.ts | 14 - .../types/CommonConnectorResponse.ts | 30 - .../types/CommonConnectorType.ts | 14 - .../types/CommonContextIdValue.ts | 14 - .../types/CommonErrorResponse.ts | 19 - .../types/CommonErrorResponseError.ts | 27 - .../types/CommonErrorResponseErrorDetails.ts | 22 - ...esponseErrorDetailsValidationErrorsItem.ts | 20 - src/serialization/types/CommonMcpConnector.ts | 30 - .../types/CommonMcpConnectorCreate.ts | 27 - src/serialization/types/CommonMessage.ts | 35 - .../types/CommonMessageIdValue.ts | 14 - .../types/CommonNextPageToken.ts | 14 - src/serialization/types/CommonPart.ts | 31 - .../types/CommonRegistryConnectorCreate.ts | 24 - .../CommonRegistryConnectorProvisioned.ts | 27 - src/serialization/types/CommonRole.ts | 12 - .../types/CommonSchemaConnector.ts | 32 - .../types/CommonSchemaConnectorCreate.ts | 29 - .../CommonSchemaConnectorCreateTransition.ts | 14 - .../types/CommonSchemaConnectorTransition.ts | 14 - src/serialization/types/CommonTaskIdValue.ts | 12 - .../types/CommonTaskListResponse.ts | 27 - src/serialization/types/CommonTaskMetadata.ts | 22 - src/serialization/types/CommonTaskResponse.ts | 34 - src/serialization/types/CommonTaskState.ts | 29 - src/serialization/types/CommonTaskStatus.ts | 24 - src/serialization/types/CommonTotalSize.ts | 12 - src/serialization/types/CommonUsage.ts | 28 - .../types/ConnectorsListResponse.ts | 19 - src/serialization/types/Contexts.ts | 28 - .../types/ContextsDetailResponse.ts | 22 - .../types/ContextsListResponse.ts | 25 - .../types/ContextsOpenInferenceSpan.ts | 28 - src/serialization/types/ContextsTraceItem.ts | 22 - .../types/ContextsTraceItemTrace.ts | 34 - .../types/ContextsTraceResponse.ts | 25 - src/serialization/types/FeedbackActor.ts | 16 - src/serialization/types/FeedbackIdValue.ts | 12 - src/serialization/types/FeedbackLabel.ts | 41 - .../types/FeedbackListResponse.ts | 19 - src/serialization/types/FeedbackMetadata.ts | 23 - src/serialization/types/FeedbackRating.ts | 19 - .../types/FeedbackRatingScale.ts | 14 - src/serialization/types/FeedbackResponse.ts | 40 - src/serialization/types/FeedbackTarget.ts | 17 - .../types/RegistryConnectorCapabilities.ts | 24 - .../types/RegistryConnectorListResponse.ts | 25 - .../types/RegistryConnectorResponse.ts | 45 - src/serialization/types/RegistryIcon.ts | 20 - src/serialization/types/UsageBucket.ts | 21 - src/serialization/types/UsageGranularity.ts | 12 - src/serialization/types/UsageMetrics.ts | 18 - .../types/UsageReportResponse.ts | 29 - src/serialization/types/index.ts | 84 -- tests/unit/stream/Stream.test.ts | 563 --------- tests/wire/agentic.test.ts | 1078 ----------------- tests/wire/agentic/a2A.test.ts | 528 -------- tests/wire/agentic/a2A/tasks.test.ts | 701 ----------- tests/wire/agentic/artifacts.test.ts | 161 --- tests/wire/agentic/connectors.test.ts | 620 ---------- tests/wire/agentic/contexts.test.ts | 523 -------- tests/wire/agentic/contexts/tasks.test.ts | 393 ------ tests/wire/agentic/feedback.test.ts | 511 -------- tests/wire/agentic/registry.test.ts | 239 ---- tests/wire/agentic/usage.test.ts | 159 --- 270 files changed, 1 insertion(+), 12866 deletions(-) delete mode 100644 src/api/errors/NotImplementedError.ts delete mode 100644 src/api/resources/agentic/client/Client.ts delete mode 100644 src/api/resources/agentic/client/index.ts delete mode 100644 src/api/resources/agentic/client/requests/AgentsCreateRequest.ts delete mode 100644 src/api/resources/agentic/client/requests/AgentsPatchRequest.ts delete mode 100644 src/api/resources/agentic/client/requests/ListAgenticRequest.ts delete mode 100644 src/api/resources/agentic/client/requests/index.ts delete mode 100644 src/api/resources/agentic/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts delete mode 100644 src/api/resources/agentic/resources/a2A/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/resources/tasks/index.ts delete mode 100644 src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts delete mode 100644 src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts delete mode 100644 src/api/resources/agentic/resources/a2A/types/index.ts delete mode 100644 src/api/resources/agentic/resources/artifacts/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/artifacts/client/index.ts delete mode 100644 src/api/resources/agentic/resources/artifacts/index.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/index.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts delete mode 100644 src/api/resources/agentic/resources/connectors/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/connectors/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/contexts/resources/tasks/index.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/index.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts delete mode 100644 src/api/resources/agentic/resources/feedback/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/feedback/index.ts delete mode 100644 src/api/resources/agentic/resources/index.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/index.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts delete mode 100644 src/api/resources/agentic/resources/registry/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/registry/index.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/Client.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/index.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts delete mode 100644 src/api/resources/agentic/resources/usage/client/requests/index.ts delete mode 100644 src/api/resources/agentic/resources/usage/index.ts delete mode 100644 src/api/types/A2ASendMessageConfiguration.ts delete mode 100644 src/api/types/A2ASendMessageRequest.ts delete mode 100644 src/api/types/A2ASendMessageResponse.ts delete mode 100644 src/api/types/A2AStreamEventResponse.ts delete mode 100644 src/api/types/A2AjsonrpcResponse.ts delete mode 100644 src/api/types/A2AjsonrpcResponseError.ts delete mode 100644 src/api/types/A2AjsonrpcResponseId.ts delete mode 100644 src/api/types/AgentCardResponse.ts delete mode 100644 src/api/types/AgentCardResponseCapabilities.ts delete mode 100644 src/api/types/AgentCardResponseProvider.ts delete mode 100644 src/api/types/AgentCardResponseSignaturesItem.ts delete mode 100644 src/api/types/AgentCardResponseSkillsItem.ts delete mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItem.ts delete mode 100644 src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts delete mode 100644 src/api/types/AgentsLabels.ts delete mode 100644 src/api/types/AgentsLifecycle.ts delete mode 100644 src/api/types/AgentsListResponse.ts delete mode 100644 src/api/types/AgentsResponse.ts delete mode 100644 src/api/types/AgentsUserIdValue.ts delete mode 100644 src/api/types/AgentsVisibility.ts delete mode 100644 src/api/types/CommonA2AConnector.ts delete mode 100644 src/api/types/CommonA2AConnectorCreate.ts delete mode 100644 src/api/types/CommonAgentConnector.ts delete mode 100644 src/api/types/CommonAgentConnectorCreate.ts delete mode 100644 src/api/types/CommonAgentIdValue.ts delete mode 100644 src/api/types/CommonArtifactIdValue.ts delete mode 100644 src/api/types/CommonArtifactResponse.ts delete mode 100644 src/api/types/CommonConnectorAuth.ts delete mode 100644 src/api/types/CommonConnectorAuthType.ts delete mode 100644 src/api/types/CommonConnectorCreateRequest.ts delete mode 100644 src/api/types/CommonConnectorIdValue.ts delete mode 100644 src/api/types/CommonConnectorResponse.ts delete mode 100644 src/api/types/CommonConnectorType.ts delete mode 100644 src/api/types/CommonContextIdValue.ts delete mode 100644 src/api/types/CommonErrorResponse.ts delete mode 100644 src/api/types/CommonErrorResponseError.ts delete mode 100644 src/api/types/CommonErrorResponseErrorDetails.ts delete mode 100644 src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts delete mode 100644 src/api/types/CommonMcpConnector.ts delete mode 100644 src/api/types/CommonMcpConnectorCreate.ts delete mode 100644 src/api/types/CommonMessage.ts delete mode 100644 src/api/types/CommonMessageIdValue.ts delete mode 100644 src/api/types/CommonNextPageToken.ts delete mode 100644 src/api/types/CommonPart.ts delete mode 100644 src/api/types/CommonRegistryConnectorCreate.ts delete mode 100644 src/api/types/CommonRegistryConnectorProvisioned.ts delete mode 100644 src/api/types/CommonRole.ts delete mode 100644 src/api/types/CommonSchemaConnector.ts delete mode 100644 src/api/types/CommonSchemaConnectorCreate.ts delete mode 100644 src/api/types/CommonSchemaConnectorCreateTransition.ts delete mode 100644 src/api/types/CommonSchemaConnectorTransition.ts delete mode 100644 src/api/types/CommonTaskIdValue.ts delete mode 100644 src/api/types/CommonTaskListResponse.ts delete mode 100644 src/api/types/CommonTaskMetadata.ts delete mode 100644 src/api/types/CommonTaskResponse.ts delete mode 100644 src/api/types/CommonTaskState.ts delete mode 100644 src/api/types/CommonTaskStatus.ts delete mode 100644 src/api/types/CommonTotalSize.ts delete mode 100644 src/api/types/CommonUsage.ts delete mode 100644 src/api/types/ConnectorsListResponse.ts delete mode 100644 src/api/types/Contexts.ts delete mode 100644 src/api/types/ContextsDetailResponse.ts delete mode 100644 src/api/types/ContextsListResponse.ts delete mode 100644 src/api/types/ContextsOpenInferenceSpan.ts delete mode 100644 src/api/types/ContextsTraceItem.ts delete mode 100644 src/api/types/ContextsTraceItemTrace.ts delete mode 100644 src/api/types/ContextsTraceResponse.ts delete mode 100644 src/api/types/FeedbackActor.ts delete mode 100644 src/api/types/FeedbackIdValue.ts delete mode 100644 src/api/types/FeedbackLabel.ts delete mode 100644 src/api/types/FeedbackListResponse.ts delete mode 100644 src/api/types/FeedbackMetadata.ts delete mode 100644 src/api/types/FeedbackRating.ts delete mode 100644 src/api/types/FeedbackRatingScale.ts delete mode 100644 src/api/types/FeedbackResponse.ts delete mode 100644 src/api/types/FeedbackTarget.ts delete mode 100644 src/api/types/RegistryConnectorCapabilities.ts delete mode 100644 src/api/types/RegistryConnectorListResponse.ts delete mode 100644 src/api/types/RegistryConnectorResponse.ts delete mode 100644 src/api/types/RegistryIcon.ts delete mode 100644 src/api/types/UsageBucket.ts delete mode 100644 src/api/types/UsageGranularity.ts delete mode 100644 src/api/types/UsageMetrics.ts delete mode 100644 src/api/types/UsageReportResponse.ts delete mode 100644 src/core/stream/Stream.ts delete mode 100644 src/core/stream/index.ts delete mode 100644 src/serialization/resources/agentic/client/index.ts delete mode 100644 src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts delete mode 100644 src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts delete mode 100644 src/serialization/resources/agentic/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/client/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/index.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts delete mode 100644 src/serialization/resources/agentic/resources/a2A/types/index.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/client/index.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/resources/connectors/index.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/client/index.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/client/requests/index.ts delete mode 100644 src/serialization/resources/agentic/resources/feedback/index.ts delete mode 100644 src/serialization/resources/agentic/resources/index.ts delete mode 100644 src/serialization/types/A2ASendMessageConfiguration.ts delete mode 100644 src/serialization/types/A2ASendMessageRequest.ts delete mode 100644 src/serialization/types/A2ASendMessageResponse.ts delete mode 100644 src/serialization/types/A2AStreamEventResponse.ts delete mode 100644 src/serialization/types/A2AjsonrpcResponse.ts delete mode 100644 src/serialization/types/A2AjsonrpcResponseError.ts delete mode 100644 src/serialization/types/A2AjsonrpcResponseId.ts delete mode 100644 src/serialization/types/AgentCardResponse.ts delete mode 100644 src/serialization/types/AgentCardResponseCapabilities.ts delete mode 100644 src/serialization/types/AgentCardResponseProvider.ts delete mode 100644 src/serialization/types/AgentCardResponseSignaturesItem.ts delete mode 100644 src/serialization/types/AgentCardResponseSkillsItem.ts delete mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts delete mode 100644 src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts delete mode 100644 src/serialization/types/AgentsLabels.ts delete mode 100644 src/serialization/types/AgentsLifecycle.ts delete mode 100644 src/serialization/types/AgentsListResponse.ts delete mode 100644 src/serialization/types/AgentsResponse.ts delete mode 100644 src/serialization/types/AgentsUserIdValue.ts delete mode 100644 src/serialization/types/AgentsVisibility.ts delete mode 100644 src/serialization/types/CommonA2AConnector.ts delete mode 100644 src/serialization/types/CommonA2AConnectorCreate.ts delete mode 100644 src/serialization/types/CommonAgentConnector.ts delete mode 100644 src/serialization/types/CommonAgentConnectorCreate.ts delete mode 100644 src/serialization/types/CommonAgentIdValue.ts delete mode 100644 src/serialization/types/CommonArtifactIdValue.ts delete mode 100644 src/serialization/types/CommonArtifactResponse.ts delete mode 100644 src/serialization/types/CommonConnectorAuth.ts delete mode 100644 src/serialization/types/CommonConnectorAuthType.ts delete mode 100644 src/serialization/types/CommonConnectorCreateRequest.ts delete mode 100644 src/serialization/types/CommonConnectorIdValue.ts delete mode 100644 src/serialization/types/CommonConnectorResponse.ts delete mode 100644 src/serialization/types/CommonConnectorType.ts delete mode 100644 src/serialization/types/CommonContextIdValue.ts delete mode 100644 src/serialization/types/CommonErrorResponse.ts delete mode 100644 src/serialization/types/CommonErrorResponseError.ts delete mode 100644 src/serialization/types/CommonErrorResponseErrorDetails.ts delete mode 100644 src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts delete mode 100644 src/serialization/types/CommonMcpConnector.ts delete mode 100644 src/serialization/types/CommonMcpConnectorCreate.ts delete mode 100644 src/serialization/types/CommonMessage.ts delete mode 100644 src/serialization/types/CommonMessageIdValue.ts delete mode 100644 src/serialization/types/CommonNextPageToken.ts delete mode 100644 src/serialization/types/CommonPart.ts delete mode 100644 src/serialization/types/CommonRegistryConnectorCreate.ts delete mode 100644 src/serialization/types/CommonRegistryConnectorProvisioned.ts delete mode 100644 src/serialization/types/CommonRole.ts delete mode 100644 src/serialization/types/CommonSchemaConnector.ts delete mode 100644 src/serialization/types/CommonSchemaConnectorCreate.ts delete mode 100644 src/serialization/types/CommonSchemaConnectorCreateTransition.ts delete mode 100644 src/serialization/types/CommonSchemaConnectorTransition.ts delete mode 100644 src/serialization/types/CommonTaskIdValue.ts delete mode 100644 src/serialization/types/CommonTaskListResponse.ts delete mode 100644 src/serialization/types/CommonTaskMetadata.ts delete mode 100644 src/serialization/types/CommonTaskResponse.ts delete mode 100644 src/serialization/types/CommonTaskState.ts delete mode 100644 src/serialization/types/CommonTaskStatus.ts delete mode 100644 src/serialization/types/CommonTotalSize.ts delete mode 100644 src/serialization/types/CommonUsage.ts delete mode 100644 src/serialization/types/ConnectorsListResponse.ts delete mode 100644 src/serialization/types/Contexts.ts delete mode 100644 src/serialization/types/ContextsDetailResponse.ts delete mode 100644 src/serialization/types/ContextsListResponse.ts delete mode 100644 src/serialization/types/ContextsOpenInferenceSpan.ts delete mode 100644 src/serialization/types/ContextsTraceItem.ts delete mode 100644 src/serialization/types/ContextsTraceItemTrace.ts delete mode 100644 src/serialization/types/ContextsTraceResponse.ts delete mode 100644 src/serialization/types/FeedbackActor.ts delete mode 100644 src/serialization/types/FeedbackIdValue.ts delete mode 100644 src/serialization/types/FeedbackLabel.ts delete mode 100644 src/serialization/types/FeedbackListResponse.ts delete mode 100644 src/serialization/types/FeedbackMetadata.ts delete mode 100644 src/serialization/types/FeedbackRating.ts delete mode 100644 src/serialization/types/FeedbackRatingScale.ts delete mode 100644 src/serialization/types/FeedbackResponse.ts delete mode 100644 src/serialization/types/FeedbackTarget.ts delete mode 100644 src/serialization/types/RegistryConnectorCapabilities.ts delete mode 100644 src/serialization/types/RegistryConnectorListResponse.ts delete mode 100644 src/serialization/types/RegistryConnectorResponse.ts delete mode 100644 src/serialization/types/RegistryIcon.ts delete mode 100644 src/serialization/types/UsageBucket.ts delete mode 100644 src/serialization/types/UsageGranularity.ts delete mode 100644 src/serialization/types/UsageMetrics.ts delete mode 100644 src/serialization/types/UsageReportResponse.ts delete mode 100644 tests/unit/stream/Stream.test.ts delete mode 100644 tests/wire/agentic.test.ts delete mode 100644 tests/wire/agentic/a2A.test.ts delete mode 100644 tests/wire/agentic/a2A/tasks.test.ts delete mode 100644 tests/wire/agentic/artifacts.test.ts delete mode 100644 tests/wire/agentic/connectors.test.ts delete mode 100644 tests/wire/agentic/contexts.test.ts delete mode 100644 tests/wire/agentic/contexts/tasks.test.ts delete mode 100644 tests/wire/agentic/feedback.test.ts delete mode 100644 tests/wire/agentic/registry.test.ts delete mode 100644 tests/wire/agentic/usage.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index fea309f7..3d9a15aa 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "78b2888846615c82906cafa9fec69862daee2349", + "originGitCommit": "0e0a17b9a349bf6fce6186765bca1ab0273fbd73", "sdkVersion": "0.0.0-dev" } diff --git a/src/Client.ts b/src/Client.ts index 0b8928d0..2098b736 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,6 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import { AgenticClient } from "./api/resources/agentic/client/Client.js"; import { AgentsClient } from "./api/resources/agents/client/Client.js"; import { AuthClient } from "./api/resources/auth/client/Client.js"; import { CodesClient } from "./api/resources/codes/client/Client.js"; @@ -34,7 +33,6 @@ export class CortiClient { protected _codes: CodesClient | undefined; protected _languages: LanguagesClient | undefined; protected _agents: AgentsClient | undefined; - protected _agentic: AgenticClient | undefined; protected _stream: StreamClient | undefined; protected _transcribe: TranscribeClient | undefined; @@ -82,10 +80,6 @@ export class CortiClient { return (this._agents ??= new AgentsClient(this._options)); } - public get agentic(): AgenticClient { - return (this._agentic ??= new AgenticClient(this._options)); - } - public get stream(): StreamClient { return (this._stream ??= new StreamClient(this._options)); } diff --git a/src/api/errors/NotImplementedError.ts b/src/api/errors/NotImplementedError.ts deleted file mode 100644 index 24387bb0..00000000 --- a/src/api/errors/NotImplementedError.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as core from "../../core/index.js"; -import * as errors from "../../errors/index.js"; -import type * as Corti from "../index.js"; - -export class NotImplementedError extends errors.CortiError { - constructor(body: Corti.CommonErrorResponse, rawResponse?: core.RawResponse) { - super({ - message: "NotImplementedError", - statusCode: 501, - body: body, - rawResponse: rawResponse, - }); - Object.setPrototypeOf(this, new.target.prototype); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = this.constructor.name; - } -} diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 1cd5a26b..7ce4a0f0 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -5,6 +5,5 @@ export * from "./ForbiddenError.js"; export * from "./GatewayTimeoutError.js"; export * from "./InternalServerError.js"; export * from "./NotFoundError.js"; -export * from "./NotImplementedError.js"; export * from "./UnauthorizedError.js"; export * from "./UnprocessableEntityError.js"; diff --git a/src/api/resources/agentic/client/Client.ts b/src/api/resources/agentic/client/Client.ts deleted file mode 100644 index 8b1983fe..00000000 --- a/src/api/resources/agentic/client/Client.ts +++ /dev/null @@ -1,654 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; -import * as core from "../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../errors/index.js"; -import * as serializers from "../../../../serialization/index.js"; -import * as Corti from "../../../index.js"; -import { A2AClient } from "../resources/a2A/client/Client.js"; -import { ArtifactsClient } from "../resources/artifacts/client/Client.js"; -import { ConnectorsClient } from "../resources/connectors/client/Client.js"; -import { ContextsClient } from "../resources/contexts/client/Client.js"; -import { FeedbackClient } from "../resources/feedback/client/Client.js"; -import { RegistryClient } from "../resources/registry/client/Client.js"; -import { UsageClient } from "../resources/usage/client/Client.js"; - -export declare namespace AgenticClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class AgenticClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _a2A: A2AClient | undefined; - protected _usage: UsageClient | undefined; - protected _connectors: ConnectorsClient | undefined; - protected _contexts: ContextsClient | undefined; - protected _artifacts: ArtifactsClient | undefined; - protected _registry: RegistryClient | undefined; - protected _feedback: FeedbackClient | undefined; - - constructor(options: AgenticClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get a2A(): A2AClient { - return (this._a2A ??= new A2AClient(this._options)); - } - - public get usage(): UsageClient { - return (this._usage ??= new UsageClient(this._options)); - } - - public get connectors(): ConnectorsClient { - return (this._connectors ??= new ConnectorsClient(this._options)); - } - - public get contexts(): ContextsClient { - return (this._contexts ??= new ContextsClient(this._options)); - } - - public get artifacts(): ArtifactsClient { - return (this._artifacts ??= new ArtifactsClient(this._options)); - } - - public get registry(): RegistryClient { - return (this._registry ??= new RegistryClient(this._options)); - } - - public get feedback(): FeedbackClient { - return (this._feedback ??= new FeedbackClient(this._options)); - } - - /** - * Lists agents visible to the caller. `private` agents are visible only to - * their creator/service principal; `unlisted` agents are omitted (fetch by - * ID instead); `public` agents are listed tenant-wide. - * The `visibility`, `lifecycle`, `label`, and `q` filter parameters are accepted but not yet honored by the server; the response is unfiltered. - * - * @param {Corti.ListAgenticRequest} request - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.list({ - * label: ["team=coding"], - * q: "coder" - * }) - */ - public list( - request: Corti.ListAgenticRequest = {}, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - - private async __list( - request: Corti.ListAgenticRequest = {}, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const { pageSize, pageToken, visibility, lifecycle, label, q } = request; - const _queryParams: Record = { - pageSize, - pageToken, - visibility: Array.isArray(visibility) - ? visibility.map((item) => - serializers.AgentsVisibility.jsonOrThrow(item, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - ) - : visibility != null - ? serializers.AgentsVisibility.jsonOrThrow(visibility, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - lifecycle: - lifecycle != null - ? serializers.AgentsLifecycle.jsonOrThrow(lifecycle, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - label, - q, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/agents", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents"); - } - - /** - * Creates a new agent. The server assigns the UUIDv7 `id`. - * - * @param {Corti.AgentsCreateRequest} request - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.ConflictError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agentic.create({ - * name: "coder", - * description: "Returns ICD-10 codes for a clinical encounter.", - * systemPrompt: "Respond with only the ICD-10 code.", - * model: "corti-default", - * visibility: "private", - * lifecycle: "persistent", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }, { - * type: "mcp", - * name: "policybot", - * url: "https://mcp.example.com", - * auth: { - * type: "oauth2", - * scope: "read:policies", - * redirectUrl: "https://app.corti.ai/oauth/callback" - * } - * }, { - * type: "schema", - * name: "submit_code", - * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - * schema: { - * "type": "object", - * "properties": { - * "code": { - * "type": "string", - * "description": "The selected ICD-10 code." - * }, - * "confidence": { - * "type": "number", - * "minimum": 0, - * "maximum": 1 - * } - * }, - * "required": [ - * "code" - * ] - * }, - * transition: "complete" - * }], - * labels: { - * "team": "coding", - * "env": "prod" - * } - * }) - */ - public create( - request: Corti.AgentsCreateRequest, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: Corti.AgentsCreateRequest, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/agents", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.AgentsCreateRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 409: - throw new Corti.ConflictError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/agentic/agents"); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public get( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/agents/{agentId}"); - } - - /** - * Deletes a `persistent` agent. `ephemeral` agents are expired in place. - * Idempotent: deleting an already-deleted agent returns `204`. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public delete( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(agentId, requestOptions)); - } - - private async __delete( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/agents/{agentId}", - ); - } - - /** - * Partially updates an agent using JSON Merge Patch (RFC 7386). - * Omitted fields are unchanged; `null` clears a field; arrays replace. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.AgentsPatchRequest} request - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * name: "coder-v2", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }] - * }) - */ - public update( - agentId: Corti.CommonAgentIdValue, - request: Corti.AgentsPatchRequest = {}, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(agentId, request, requestOptions)); - } - - private async __update( - agentId: Corti.CommonAgentIdValue, - request: Corti.AgentsPatchRequest = {}, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}`, - ), - method: "PATCH", - headers: _headers, - contentType: "application/merge-patch+json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.AgentsPatchRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "PATCH", - "/v2/agentic/agents/{agentId}", - ); - } - - /** - * Returns the A2A v1.0 agent card describing the agent's capabilities, - * skills, and supported protocol interfaces. Served at the standard - * `.well-known` location for agent discovery. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {AgenticClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public getCard( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getCard(agentId, requestOptions)); - } - - private async __getCard( - agentId: Corti.CommonAgentIdValue, - requestOptions?: AgenticClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/.well-known/agent-card.json`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.AgentCardResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/.well-known/agent-card.json", - ); - } -} diff --git a/src/api/resources/agentic/client/index.ts b/src/api/resources/agentic/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts b/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts deleted file mode 100644 index 76267264..00000000 --- a/src/api/resources/agentic/client/requests/AgentsCreateRequest.ts +++ /dev/null @@ -1,69 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * name: "coder", - * description: "Returns ICD-10 codes for a clinical encounter.", - * systemPrompt: "Respond with only the ICD-10 code.", - * model: "corti-default", - * visibility: "private", - * lifecycle: "persistent", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }, { - * type: "mcp", - * name: "policybot", - * url: "https://mcp.example.com", - * auth: { - * type: "oauth2", - * scope: "read:policies", - * redirectUrl: "https://app.corti.ai/oauth/callback" - * } - * }, { - * type: "schema", - * name: "submit_code", - * description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - * schema: { - * "type": "object", - * "properties": { - * "code": { - * "type": "string", - * "description": "The selected ICD-10 code." - * }, - * "confidence": { - * "type": "number", - * "minimum": 0, - * "maximum": 1 - * } - * }, - * "required": [ - * "code" - * ] - * }, - * transition: "complete" - * }], - * labels: { - * "team": "coding", - * "env": "prod" - * } - * } - */ -export interface AgentsCreateRequest { - /** Human-readable, unique-per-tenant agent name. */ - name: string; - /** Free-form agent description. */ - description?: string; - /** System prompt prepended to every invocation. */ - systemPrompt?: string; - /** Tenant default if omitted. */ - model?: string; - visibility?: Corti.AgentsVisibility; - lifecycle?: Corti.AgentsLifecycle; - /** Connectors to attach at creation. Defaults to an empty array. */ - connectors?: Corti.CommonConnectorCreateRequest[]; - labels?: Corti.AgentsLabels; -} diff --git a/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts b/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts deleted file mode 100644 index 30cfd750..00000000 --- a/src/api/resources/agentic/client/requests/AgentsPatchRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * name: "coder-v2", - * connectors: [{ - * type: "registry", - * name: "@dedalus/coding-expert" - * }] - * } - */ -export interface AgentsPatchRequest { - /** New agent name. */ - name?: string; - /** New description; `null` clears it. */ - description?: string | null; - /** New system prompt; `null` clears it. */ - systemPrompt?: string | null; - /** New model identifier; `null` falls back to the tenant default. */ - model?: string | null; - visibility?: Corti.AgentsVisibility; - lifecycle?: Corti.AgentsLifecycle; - /** Replacement connector list; `null` clears connectors. */ - connectors?: Corti.CommonConnectorCreateRequest[] | null; - /** Replacement labels; `null` clears labels. */ - labels?: Record | null; -} diff --git a/src/api/resources/agentic/client/requests/ListAgenticRequest.ts b/src/api/resources/agentic/client/requests/ListAgenticRequest.ts deleted file mode 100644 index 5adb8943..00000000 --- a/src/api/resources/agentic/client/requests/ListAgenticRequest.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../index.js"; - -/** - * @example - * { - * label: ["team=coding"], - * q: "coder" - * } - */ -export interface ListAgenticRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; - /** Filter by one or more visibility levels. */ - visibility?: Corti.AgentsVisibility | Corti.AgentsVisibility[]; - /** Filter by lifecycle. */ - lifecycle?: Corti.AgentsLifecycle; - /** Filter by label equality, repeated `key=value` pairs (AND-combined). */ - label?: string | string[]; - /** Free-text search over `name` and `description`. */ - q?: string; -} diff --git a/src/api/resources/agentic/client/requests/index.ts b/src/api/resources/agentic/client/requests/index.ts deleted file mode 100644 index 040d53cb..00000000 --- a/src/api/resources/agentic/client/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { AgentsCreateRequest } from "./AgentsCreateRequest.js"; -export type { AgentsPatchRequest } from "./AgentsPatchRequest.js"; -export type { ListAgenticRequest } from "./ListAgenticRequest.js"; diff --git a/src/api/resources/agentic/index.ts b/src/api/resources/agentic/index.ts deleted file mode 100644 index 9eb1192d..00000000 --- a/src/api/resources/agentic/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/client/Client.ts b/src/api/resources/agentic/resources/a2A/client/Client.ts deleted file mode 100644 index 04b6729a..00000000 --- a/src/api/resources/agentic/resources/a2A/client/Client.ts +++ /dev/null @@ -1,345 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; -import { TasksClient } from "../resources/tasks/client/Client.js"; - -export declare namespace A2AClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class A2AClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _tasks: TasksClient | undefined; - - constructor(options: A2AClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get tasks(): TasksClient { - return (this._tasks ??= new TasksClient(this._options)); - } - - /** - * The `JSONRPC` protocol binding for A2A v1.0. Accepts a single JSON-RPC 2.0 - * request whose `method` is one of `SendMessage`, `SendStreamingMessage`, - * `GetTask`, `ListTasks`, `CancelTask`, or `SubscribeToTask`. - * - * Streaming methods (`SendStreamingMessage`, `SubscribeToTask`) respond with - * `text/event-stream`; all others respond with a single JSON-RPC response. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agentic.A2AjsonrpcRequest} request - * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * id: "1", - * method: "SendMessage", - * params: { - * "message": { - * "role": "ROLE_USER", - * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - * "parts": [ - * { - * "text": "Code this encounter." - * } - * ] - * } - * } - * }) - */ - public jsonRpc( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.A2AjsonrpcRequest, - requestOptions?: A2AClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__jsonRpc(agentId, request, requestOptions)); - } - - private async __jsonRpc( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.A2AjsonrpcRequest, - requestOptions?: A2AClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: { - ...serializers.agentic.A2AjsonrpcRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - jsonrpc: "2.0", - }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.A2AjsonrpcResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a", - ); - } - - /** - * The `HTTP+JSON` binding of A2A `SendMessage`. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.A2ASendMessageRequest} request - * @param {A2AClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * message: { - * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - * role: "ROLE_USER", - * parts: [{ - * text: "What is the ICD-10 code for asthma?" - * }] - * } - * }) - */ - public sendMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__sendMessage(agentId, request, requestOptions)); - } - - private async __sendMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:send`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.A2ASendMessageResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/message:send", - ); - } - - /** - * The `HTTP+JSON` binding of A2A `SendStreamingMessage`. Responds with a - * `text/event-stream` of `Task`, `statusUpdate`, and `artifactUpdate` events. - */ - public streamMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): core.HttpResponsePromise> { - return core.HttpResponsePromise.fromPromise(this.__streamMessage(agentId, request, requestOptions)); - } - - private async __streamMessage( - agentId: Corti.CommonAgentIdValue, - request: Corti.A2ASendMessageRequest, - requestOptions?: A2AClient.RequestOptions, - ): Promise>> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/message:stream`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.A2ASendMessageRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - responseType: "sse", - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: new core.Stream({ - stream: _response.body, - parse: async (data) => { - return serializers.A2AStreamEventResponse.parseOrThrow(data, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - }, - signal: requestOptions?.abortSignal, - eventShape: { - type: "sse", - }, - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/message:stream", - ); - } -} diff --git a/src/api/resources/agentic/resources/a2A/client/index.ts b/src/api/resources/agentic/resources/a2A/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/a2A/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts deleted file mode 100644 index 2681a71b..00000000 --- a/src/api/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * id: "1", - * method: "SendMessage", - * params: { - * "message": { - * "role": "ROLE_USER", - * "messageId": "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - * "parts": [ - * { - * "text": "Code this encounter." - * } - * ] - * } - * } - * } - */ -export interface A2AjsonrpcRequest { - id: Corti.agentic.A2AjsonrpcRequestId; - /** JSON-RPC method name (PascalCase on the wire). */ - method: Corti.agentic.A2AjsonrpcRequestMethod; - /** JSON-RPC params object. */ - params?: Record; -} diff --git a/src/api/resources/agentic/resources/a2A/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/client/requests/index.ts deleted file mode 100644 index 23999406..00000000 --- a/src/api/resources/agentic/resources/a2A/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/api/resources/agentic/resources/a2A/index.ts b/src/api/resources/agentic/resources/a2A/index.ts deleted file mode 100644 index 0ef16e76..00000000 --- a/src/api/resources/agentic/resources/a2A/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; -export * from "./types/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/index.ts b/src/api/resources/agentic/resources/a2A/resources/index.ts deleted file mode 100644 index a371e105..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./tasks/client/requests/index.js"; -export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts deleted file mode 100644 index df8fa963..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/Client.ts +++ /dev/null @@ -1,382 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; -import { - type NormalizedClientOptionsWithAuth, - normalizeClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; -import * as core from "../../../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../errors/index.js"; -import * as serializers from "../../../../../../../../serialization/index.js"; -import * as Corti from "../../../../../../../index.js"; - -export declare namespace TasksClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class TasksClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: TasksClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agentic.a2A.ListTasksRequest} request - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public list( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.a2A.ListTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(agentId, request, requestOptions)); - } - - private async __list( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.a2A.ListTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const { pageSize, pageToken, contextId } = request; - const _queryParams: Record = { - pageSize, - pageToken, - contextId, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/a2a/tasks", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.agentic.a2A.GetTasksRequest} request - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.a2A.tasks.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public get( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.a2A.GetTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, taskId, request, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.a2A.GetTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const { historyLength } = request; - const _queryParams: Record = { - historyLength, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.ConflictError} - * - * @example - * await client.agentic.a2A.tasks.cancel("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public cancel( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__cancel(agentId, taskId, requestOptions)); - } - - private async __cancel( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:cancel`, - ), - method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 409: - throw new Corti.ConflictError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:cancel", - ); - } - - /** - * Resubscribe to an in-flight task's event stream over SSE. - */ - public subscribe( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise> { - return core.HttpResponsePromise.fromPromise(this.__subscribe(agentId, taskId, requestOptions)); - } - - private async __subscribe( - agentId: Corti.CommonAgentIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): Promise>> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ - "A2A-Version": "1.0", - "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, - }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/a2a/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}:subscribe`, - ), - method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - responseType: "sse", - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: new core.Stream({ - stream: _response.body, - parse: async (data) => { - return serializers.A2AStreamEventResponse.parseOrThrow(data, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - }, - signal: requestOptions?.abortSignal, - eventShape: { - type: "sse", - }, - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/a2a/tasks/{taskId}/:subscribe", - ); - } -} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts deleted file mode 100644 index ea6be9c2..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/GetTasksRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface GetTasksRequest { - /** Cap the number of history messages returned. */ - historyLength?: number; -} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts deleted file mode 100644 index c784ca5d..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/ListTasksRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListTasksRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; - /** Restrict to tasks within this context. */ - contextId?: string; -} diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts deleted file mode 100644 index 508b914d..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/client/requests/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { GetTasksRequest } from "./GetTasksRequest.js"; -export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts b/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/a2A/resources/tasks/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts deleted file mode 100644 index 579038a0..00000000 --- a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export type A2AjsonrpcRequestId = string | number; diff --git a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts deleted file mode 100644 index d6b216bb..00000000 --- a/src/api/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** JSON-RPC method name (PascalCase on the wire). */ -export const A2AjsonrpcRequestMethod = { - SendMessage: "SendMessage", - SendStreamingMessage: "SendStreamingMessage", - GetTask: "GetTask", - ListTasks: "ListTasks", - CancelTask: "CancelTask", - SubscribeToTask: "SubscribeToTask", -} as const; -export type A2AjsonrpcRequestMethod = (typeof A2AjsonrpcRequestMethod)[keyof typeof A2AjsonrpcRequestMethod]; diff --git a/src/api/resources/agentic/resources/a2A/types/index.ts b/src/api/resources/agentic/resources/a2A/types/index.ts deleted file mode 100644 index d506c662..00000000 --- a/src/api/resources/agentic/resources/a2A/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./A2AjsonrpcRequestId.js"; -export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/api/resources/agentic/resources/artifacts/client/Client.ts b/src/api/resources/agentic/resources/artifacts/client/Client.ts deleted file mode 100644 index dcd57c7f..00000000 --- a/src/api/resources/agentic/resources/artifacts/client/Client.ts +++ /dev/null @@ -1,115 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace ArtifactsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class ArtifactsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: ArtifactsClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * Returns an artifact produced by a task within a context. File parts may - * carry inline `bytes` or a `uri` to fetch the content out of band. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.CommonArtifactIdValue} artifactId - Artifact identifier (prefixed UUIDv7). - * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.ForbiddenError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.artifacts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84") - */ - public get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - artifactId: Corti.CommonArtifactIdValue, - requestOptions?: ArtifactsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, artifactId, requestOptions)); - } - - private async __get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - artifactId: Corti.CommonArtifactIdValue, - requestOptions?: ArtifactsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/artifacts/${core.url.encodePathParam(serializers.CommonArtifactIdValue.jsonOrThrow(artifactId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonArtifactResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: - throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/artifacts/{artifactId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/artifacts/client/index.ts b/src/api/resources/agentic/resources/artifacts/client/index.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/src/api/resources/agentic/resources/artifacts/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/src/api/resources/agentic/resources/artifacts/index.ts b/src/api/resources/agentic/resources/artifacts/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/artifacts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/connectors/client/Client.ts b/src/api/resources/agentic/resources/connectors/client/Client.ts deleted file mode 100644 index fa6bc5d3..00000000 --- a/src/api/resources/agentic/resources/connectors/client/Client.ts +++ /dev/null @@ -1,467 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace ConnectorsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class ConnectorsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: ConnectorsClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - */ - public list( - agentId: Corti.CommonAgentIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions)); - } - - private async __list( - agentId: Corti.CommonAgentIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ConnectorsListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/connectors", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorCreateRequest} request - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.ConflictError} - * - * @example - * await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * type: "registry", - * name: "@dedalus/coding-expert" - * }) - */ - public attach( - agentId: Corti.CommonAgentIdValue, - request: Corti.CommonConnectorCreateRequest, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__attach(agentId, request, requestOptions)); - } - - private async __attach( - agentId: Corti.CommonAgentIdValue, - request: Corti.CommonConnectorCreateRequest, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.CommonConnectorCreateRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 409: - throw new Corti.ConflictError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/agents/{agentId}/connectors", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.connectors.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") - */ - public get( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, agentConnectorId, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", - ); - } - - /** - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.connectors.remove("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95") - */ - public remove( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__remove(agentId, agentConnectorId, requestOptions)); - } - - private async __remove( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", - ); - } - - /** - * Partially updates an agent-scoped connector using JSON Merge Patch - * (RFC 7386). `type` is immutable. - * **Future scope**: not yet implemented; the server returns `501`. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.CommonConnectorIdValue} agentConnectorId - Agent-scoped connector identifier (prefixed UUIDv7). - * @param {Corti.agentic.ConnectorsPatchRequest} request - * @param {ConnectorsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.NotImplementedError} - * - * @example - * await client.agentic.connectors.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", { - * enabled: false - * }) - */ - public update( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - request: Corti.agentic.ConnectorsPatchRequest = {}, - requestOptions?: ConnectorsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(agentId, agentConnectorId, request, requestOptions)); - } - - private async __update( - agentId: Corti.CommonAgentIdValue, - agentConnectorId: Corti.CommonConnectorIdValue, - request: Corti.agentic.ConnectorsPatchRequest = {}, - requestOptions?: ConnectorsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/connectors/${core.url.encodePathParam(serializers.CommonConnectorIdValue.jsonOrThrow(agentConnectorId, { omitUndefined: true }))}`, - ), - method: "PATCH", - headers: _headers, - contentType: "application/merge-patch+json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.agentic.ConnectorsPatchRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 501: - throw new Corti.NotImplementedError( - serializers.CommonErrorResponse.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "PATCH", - "/v2/agentic/agents/{agentId}/connectors/{agentConnectorId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/connectors/client/index.ts b/src/api/resources/agentic/resources/connectors/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/connectors/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts deleted file mode 100644 index 5094288b..00000000 --- a/src/api/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * enabled: false - * } - */ -export interface ConnectorsPatchRequest { - /** Whether the connector is active. */ - enabled?: boolean; - /** New connector name. */ - name?: string; - /** New connector URL; `null` clears it. */ - url?: string | null; - /** New connector config; `null` clears it. */ - config?: Record | null; - auth?: Corti.CommonConnectorAuth | null; -} diff --git a/src/api/resources/agentic/resources/connectors/client/requests/index.ts b/src/api/resources/agentic/resources/connectors/client/requests/index.ts deleted file mode 100644 index d39ed3f7..00000000 --- a/src/api/resources/agentic/resources/connectors/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/api/resources/agentic/resources/connectors/index.ts b/src/api/resources/agentic/resources/connectors/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/connectors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/client/Client.ts b/src/api/resources/agentic/resources/contexts/client/Client.ts deleted file mode 100644 index 9c746fc1..00000000 --- a/src/api/resources/agentic/resources/contexts/client/Client.ts +++ /dev/null @@ -1,368 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; -import { TasksClient } from "../resources/tasks/client/Client.js"; - -export declare namespace ContextsClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class ContextsClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - protected _tasks: TasksClient | undefined; - - constructor(options: ContextsClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - public get tasks(): TasksClient { - return (this._tasks ??= new TasksClient(this._options)); - } - - /** - * Lists contexts matching the filters. - * **Future scope**: not yet implemented; the server currently returns an empty page and ignores all parameters. - * - * @param {Corti.agentic.ListContextsRequest} request - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.contexts.list() - */ - public list( - request: Corti.agentic.ListContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - - private async __list( - request: Corti.agentic.ListContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const { agentId, from: from_, to, pageSize, pageToken } = request; - const _queryParams: Record = { - agentId, - from: from_ != null ? from_?.toISOString() : undefined, - to: to != null ? to?.toISOString() : undefined, - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/contexts", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ContextsListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/agentic/contexts"); - } - - /** - * Returns the context's metadata together with its `tasks`, oldest first. - * Each task carries its full message `history`; the user's prompt for a - * task is the `ROLE_USER` message within that task's history (there is no - * separate top-level message list). - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agentic.GetContextsRequest} request - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public get( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.GetContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(contextId, request, requestOptions)); - } - - private async __get( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.GetContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const { historyLength } = request; - const _queryParams: Record = { - historyLength, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ContextsDetailResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}", - ); - } - - /** - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public delete( - contextId: Corti.CommonContextIdValue, - requestOptions?: ContextsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(contextId, requestOptions)); - } - - private async __delete( - contextId: Corti.CommonContextIdValue, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/contexts/{contextId}", - ); - } - - /** - * Returns the execution traces for the context — LLM calls, tool - * executions, and token usage — in OpenInference format. Traces are - * ordered newest-first and paginated; each page returns up to `pageSize` - * traces with their spans inlined. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agentic.GetTraceContextsRequest} request - * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public getTrace( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.GetTraceContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__getTrace(contextId, request, requestOptions)); - } - - private async __getTrace( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.GetTraceContextsRequest = {}, - requestOptions?: ContextsClient.RequestOptions, - ): Promise> { - const { pageSize, pageToken } = request; - const _queryParams: Record = { - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/trace`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ContextsTraceResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/trace", - ); - } -} diff --git a/src/api/resources/agentic/resources/contexts/client/index.ts b/src/api/resources/agentic/resources/contexts/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/contexts/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts deleted file mode 100644 index ac1ae3a8..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/GetContextsRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface GetContextsRequest { - /** Cap the number of history messages returned per task. */ - historyLength?: number; -} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts deleted file mode 100644 index e85c8b41..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/GetTraceContextsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface GetTraceContextsRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts b/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts deleted file mode 100644 index 111bb811..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/ListContextsRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListContextsRequest { - /** Restrict to contexts owned by this agent. */ - agentId?: string; - /** Inclusive lower bound on `createdAt` (RFC 3339). */ - from?: Date; - /** Exclusive upper bound on `createdAt` (RFC 3339). */ - to?: Date; - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/contexts/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/client/requests/index.ts deleted file mode 100644 index db21c8ce..00000000 --- a/src/api/resources/agentic/resources/contexts/client/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { GetContextsRequest } from "./GetContextsRequest.js"; -export type { GetTraceContextsRequest } from "./GetTraceContextsRequest.js"; -export type { ListContextsRequest } from "./ListContextsRequest.js"; diff --git a/src/api/resources/agentic/resources/contexts/index.ts b/src/api/resources/agentic/resources/contexts/index.ts deleted file mode 100644 index 9eb1192d..00000000 --- a/src/api/resources/agentic/resources/contexts/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/index.ts b/src/api/resources/agentic/resources/contexts/resources/index.ts deleted file mode 100644 index a371e105..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./tasks/client/requests/index.js"; -export * as tasks from "./tasks/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts deleted file mode 100644 index 4a2d1042..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/Client.ts +++ /dev/null @@ -1,196 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js"; -import { - type NormalizedClientOptionsWithAuth, - normalizeClientOptionsWithAuth, -} from "../../../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; -import * as core from "../../../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../../../errors/index.js"; -import * as serializers from "../../../../../../../../serialization/index.js"; -import * as Corti from "../../../../../../../index.js"; - -export declare namespace TasksClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class TasksClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: TasksClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.agentic.contexts.ListTasksRequest} request - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - */ - public list( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.contexts.ListTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(contextId, request, requestOptions)); - } - - private async __list( - contextId: Corti.CommonContextIdValue, - request: Corti.agentic.contexts.ListTasksRequest = {}, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const { pageSize, pageToken } = request; - const _queryParams: Record = { - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks", - ); - } - - /** - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.contexts.tasks.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(contextId, taskId, requestOptions)); - } - - private async __get( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: TasksClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CommonTaskResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts deleted file mode 100644 index 05240c95..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/ListTasksRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListTasksRequest { - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts deleted file mode 100644 index 0e50f63c..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ListTasksRequest } from "./ListTasksRequest.js"; diff --git a/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts b/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/contexts/resources/tasks/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/feedback/client/Client.ts b/src/api/resources/agentic/resources/feedback/client/Client.ts deleted file mode 100644 index c847b11f..00000000 --- a/src/api/resources/agentic/resources/feedback/client/Client.ts +++ /dev/null @@ -1,313 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace FeedbackClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class FeedbackClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: FeedbackClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * Returns all feedback resources submitted for the task by the authenticated user, newest-first. The task must exist, belong to the supplied context, and belong to the authenticated customer. Feedback is scoped to the calling user via row-level security, so the response contains only that user's feedback. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.feedback.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62") - */ - public list( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(contextId, taskId, requestOptions)); - } - - private async __list( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.FeedbackListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", - ); - } - - /** - * Submits feedback about a task as a whole or about a specific user-visible - * message within the task. The task must exist, belong to the supplied - * context, and belong to the authenticated customer. Multiple feedback - * resources may be submitted for the same task or message. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.agentic.FeedbackCreateRequest} request - * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * @throws {@link Corti.UnprocessableEntityError} - * - * @example - * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { - * rating: { - * scale: "binary", - * value: 1 - * } - * }) - * - * @example - * await client.agentic.feedback.create("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", { - * rating: { - * scale: "binary", - * value: 0 - * }, - * labels: ["unsupportedClaim"], - * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - * target: { - * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" - * }, - * metadata: { - * collectionMethod: "caseReview", - * clientReference: "case-review-728193", - * actor: { - * externalId: "clinician_4182" - * } - * } - * }) - */ - public create( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.FeedbackCreateRequest, - requestOptions?: FeedbackClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(contextId, taskId, request, requestOptions)); - } - - private async __create( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - request: Corti.agentic.FeedbackCreateRequest, - requestOptions?: FeedbackClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.agentic.FeedbackCreateRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.FeedbackResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - case 422: - throw new Corti.UnprocessableEntityError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "POST", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback", - ); - } - - /** - * Soft-deletes a single feedback resource the authenticated user submitted for the task. The task must exist, belong to the supplied context, and belong to the authenticated customer. Idempotent: deleting a feedback resource that does not exist (or has already been deleted) returns `204`. - * - * @param {Corti.CommonContextIdValue} contextId - Context identifier (prefixed UUIDv7). - * @param {Corti.CommonTaskIdValue} taskId - Task identifier (prefixed UUIDv7). - * @param {Corti.FeedbackIdValue} feedbackId - Feedback identifier (prefixed UUIDv7). - * @param {FeedbackClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.feedback.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", "fb.0192f4c8-7e2a-7b3c-9d4e-5f6a7b8c9d01") - */ - public delete( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - feedbackId: Corti.FeedbackIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(contextId, taskId, feedbackId, requestOptions)); - } - - private async __delete( - contextId: Corti.CommonContextIdValue, - taskId: Corti.CommonTaskIdValue, - feedbackId: Corti.FeedbackIdValue, - requestOptions?: FeedbackClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/contexts/${core.url.encodePathParam(serializers.CommonContextIdValue.jsonOrThrow(contextId, { omitUndefined: true }))}/tasks/${core.url.encodePathParam(serializers.CommonTaskIdValue.jsonOrThrow(taskId, { omitUndefined: true }))}/feedback/${core.url.encodePathParam(serializers.FeedbackIdValue.jsonOrThrow(feedbackId, { omitUndefined: true }))}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/v2/agentic/contexts/{contextId}/tasks/{taskId}/feedback/{feedbackId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/feedback/client/index.ts b/src/api/resources/agentic/resources/feedback/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/feedback/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts deleted file mode 100644 index e427a0df..00000000 --- a/src/api/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts +++ /dev/null @@ -1,49 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * rating: { - * scale: "binary", - * value: 1 - * } - * } - * - * @example - * { - * rating: { - * scale: "binary", - * value: 0 - * }, - * labels: ["unsupportedClaim"], - * reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - * target: { - * messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" - * }, - * metadata: { - * collectionMethod: "caseReview", - * clientReference: "case-review-728193", - * actor: { - * externalId: "clinician_4182" - * } - * } - * } - */ -export interface FeedbackCreateRequest { - rating: Corti.FeedbackRating; - /** - * Structured observations about the result. Defaults to an empty array. - * Positive and negative labels may be combined. Duplicate labels are - * rejected. A maximum of five labels may be submitted. - */ - labels?: Corti.FeedbackLabel[]; - /** - * The user's explanation of the rating or labels. Required when `labels` - * contains `other`. - */ - reason?: string; - target?: Corti.FeedbackTarget; - metadata?: Corti.FeedbackMetadata; -} diff --git a/src/api/resources/agentic/resources/feedback/client/requests/index.ts b/src/api/resources/agentic/resources/feedback/client/requests/index.ts deleted file mode 100644 index 06c3ce4e..00000000 --- a/src/api/resources/agentic/resources/feedback/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/api/resources/agentic/resources/feedback/index.ts b/src/api/resources/agentic/resources/feedback/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/feedback/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/index.ts b/src/api/resources/agentic/resources/index.ts deleted file mode 100644 index 3fe97949..00000000 --- a/src/api/resources/agentic/resources/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from "./a2A/client/requests/index.js"; -export * as a2A from "./a2A/index.js"; -export * from "./a2A/types/index.js"; -export * as artifacts from "./artifacts/index.js"; -export * from "./connectors/client/requests/index.js"; -export * as connectors from "./connectors/index.js"; -export * from "./contexts/client/requests/index.js"; -export * as contexts from "./contexts/index.js"; -export * from "./feedback/client/requests/index.js"; -export * as feedback from "./feedback/index.js"; -export * from "./registry/client/requests/index.js"; -export * as registry from "./registry/index.js"; -export * from "./usage/client/requests/index.js"; -export * as usage from "./usage/index.js"; diff --git a/src/api/resources/agentic/resources/registry/client/Client.ts b/src/api/resources/agentic/resources/registry/client/Client.ts deleted file mode 100644 index 69f89855..00000000 --- a/src/api/resources/agentic/resources/registry/client/Client.ts +++ /dev/null @@ -1,185 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace RegistryClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class RegistryClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: RegistryClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * @param {Corti.agentic.ListRegistryRequest} request - * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * - * @example - * await client.agentic.registry.list() - */ - public list( - request: Corti.agentic.ListRegistryRequest = {}, - requestOptions?: RegistryClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - - private async __list( - request: Corti.agentic.ListRegistryRequest = {}, - requestOptions?: RegistryClient.RequestOptions, - ): Promise> { - const { q, pageSize, pageToken } = request; - const _queryParams: Record = { - q, - pageSize, - pageToken, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - "v2/agentic/registry/connectors", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.RegistryConnectorListResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/registry/connectors", - ); - } - - /** - * @param {string} connectorId - Registry connector identifier (e.g. `@dedalus/coding-expert`). - * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.registry.get("connectorId") - */ - public get( - connectorId: string, - requestOptions?: RegistryClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(connectorId, requestOptions)); - } - - private async __get( - connectorId: string, - requestOptions?: RegistryClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/registry/connectors/${core.url.encodePathParam(connectorId)}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.RegistryConnectorResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/registry/connectors/{connectorId}", - ); - } -} diff --git a/src/api/resources/agentic/resources/registry/client/index.ts b/src/api/resources/agentic/resources/registry/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/registry/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts b/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts deleted file mode 100644 index 8fb6c858..00000000 --- a/src/api/resources/agentic/resources/registry/client/requests/ListRegistryRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * {} - */ -export interface ListRegistryRequest { - /** - * Free-text search over name and description. - * **Future scope**: not yet implemented; the server ignores this parameter and returns the unfiltered page. - */ - q?: string; - /** Maximum number of items per page. */ - pageSize?: number; - /** Opaque cursor from a prior response's `nextPageToken`. Omit on the first request. */ - pageToken?: string; -} diff --git a/src/api/resources/agentic/resources/registry/client/requests/index.ts b/src/api/resources/agentic/resources/registry/client/requests/index.ts deleted file mode 100644 index 763983d1..00000000 --- a/src/api/resources/agentic/resources/registry/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ListRegistryRequest } from "./ListRegistryRequest.js"; diff --git a/src/api/resources/agentic/resources/registry/index.ts b/src/api/resources/agentic/resources/registry/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/registry/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/agentic/resources/usage/client/Client.ts b/src/api/resources/agentic/resources/usage/client/Client.ts deleted file mode 100644 index 4d54539e..00000000 --- a/src/api/resources/agentic/resources/usage/client/Client.ts +++ /dev/null @@ -1,131 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; -import * as core from "../../../../../../core/index.js"; -import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; -import * as errors from "../../../../../../errors/index.js"; -import * as serializers from "../../../../../../serialization/index.js"; -import * as Corti from "../../../../../index.js"; - -export declare namespace UsageClient { - export type Options = BaseClientOptions; - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class UsageClient { - protected readonly _options: NormalizedClientOptionsWithAuth; - - constructor(options: UsageClient.Options) { - this._options = normalizeClientOptionsWithAuth(options); - } - - /** - * Returns invocation metrics for the agent over the half-open `[from, to)` - * time range (UTC), bucketed at the requested `granularity`. The response - * echoes the resolved range and granularity, a `totals` summary across the - * whole range, and one `buckets` entry per period that had activity (the - * array is empty when there was none). When `from`/`to` are omitted, the - * range defaults to the last 30 days. - * - * @param {Corti.CommonAgentIdValue} agentId - Agent identifier (prefixed UUIDv7). - * @param {Corti.agentic.GetUsageRequest} request - * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Corti.BadRequestError} - * @throws {@link Corti.UnauthorizedError} - * @throws {@link Corti.NotFoundError} - * - * @example - * await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - * from: new Date("2026-05-19T00:00:00.000Z"), - * to: new Date("2026-05-20T00:00:00.000Z") - * }) - */ - public get( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.GetUsageRequest = {}, - requestOptions?: UsageClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(agentId, request, requestOptions)); - } - - private async __get( - agentId: Corti.CommonAgentIdValue, - request: Corti.agentic.GetUsageRequest = {}, - requestOptions?: UsageClient.RequestOptions, - ): Promise> { - const { from: from_, to, granularity } = request; - const _queryParams: Record = { - from: from_ != null ? from_?.toISOString() : undefined, - to: to != null ? to?.toISOString() : undefined, - granularity: - granularity != null - ? serializers.UsageGranularity.jsonOrThrow(granularity, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }) - : undefined, - }; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)).agents, - `v2/agentic/agents/${core.url.encodePathParam(serializers.CommonAgentIdValue.jsonOrThrow(agentId, { omitUndefined: true }))}/usage`, - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.UsageReportResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Corti.BadRequestError(_response.error.body, _response.rawResponse); - case 401: - throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse); - case 404: - throw new Corti.NotFoundError(_response.error.body, _response.rawResponse); - default: - throw new errors.CortiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "GET", - "/v2/agentic/agents/{agentId}/usage", - ); - } -} diff --git a/src/api/resources/agentic/resources/usage/client/index.ts b/src/api/resources/agentic/resources/usage/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/api/resources/agentic/resources/usage/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts b/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts deleted file mode 100644 index c6f0d3f7..00000000 --- a/src/api/resources/agentic/resources/usage/client/requests/GetUsageRequest.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../index.js"; - -/** - * @example - * { - * from: new Date("2026-05-19T00:00:00.000Z"), - * to: new Date("2026-05-20T00:00:00.000Z") - * } - */ -export interface GetUsageRequest { - /** - * Inclusive start of the range, as an RFC 3339 timestamp (UTC). - * Defaults to 30 days before `to`. Must not be after `to`. - */ - from?: Date; - /** - * Exclusive end of the range, as an RFC 3339 timestamp (UTC). - * Defaults to the current time. - */ - to?: Date; - /** Size of each reporting bucket. Defaults to `day`. */ - granularity?: Corti.UsageGranularity; -} diff --git a/src/api/resources/agentic/resources/usage/client/requests/index.ts b/src/api/resources/agentic/resources/usage/client/requests/index.ts deleted file mode 100644 index 6e62640f..00000000 --- a/src/api/resources/agentic/resources/usage/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { GetUsageRequest } from "./GetUsageRequest.js"; diff --git a/src/api/resources/agentic/resources/usage/index.ts b/src/api/resources/agentic/resources/usage/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/api/resources/agentic/resources/usage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 554828ee..2e1d98c8 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,5 +1,3 @@ -export * from "./agentic/client/requests/index.js"; -export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; export * from "./agents/types/index.js"; diff --git a/src/api/types/A2ASendMessageConfiguration.ts b/src/api/types/A2ASendMessageConfiguration.ts deleted file mode 100644 index b1fc30ed..00000000 --- a/src/api/types/A2ASendMessageConfiguration.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Per-request options controlling how a message is processed. - */ -export interface A2ASendMessageConfiguration { - /** If `true`, return as soon as the task is submitted, even if processing is still in progress. If `false` (default), wait until the task reaches a terminal (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`) or interrupted (`INPUT_REQUIRED`, `AUTH_REQUIRED`) state. */ - returnImmediately?: boolean; - /** Maximum number of prior messages to include as context. */ - historyLength?: number; - /** Output media types the caller accepts. */ - acceptedOutputModes?: string[]; -} diff --git a/src/api/types/A2ASendMessageRequest.ts b/src/api/types/A2ASendMessageRequest.ts deleted file mode 100644 index 0b8fcc65..00000000 --- a/src/api/types/A2ASendMessageRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for sending a message to an agent. - */ -export interface A2ASendMessageRequest { - message: Corti.CommonMessage; - configuration?: Corti.A2ASendMessageConfiguration; - /** Free-form request metadata. */ - metadata?: Record; - /** Optional. Opaque routing identifier. Must match the `tenant` value from the selected `AgentInterface` in the Agent Card when that field is set. */ - tenant?: string; -} diff --git a/src/api/types/A2ASendMessageResponse.ts b/src/api/types/A2ASendMessageResponse.ts deleted file mode 100644 index 4b03d590..00000000 --- a/src/api/types/A2ASendMessageResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Exactly one of `task` or `message` is present. - */ -export type A2ASendMessageResponse = unknown; diff --git a/src/api/types/A2AStreamEventResponse.ts b/src/api/types/A2AStreamEventResponse.ts deleted file mode 100644 index 36e6af48..00000000 --- a/src/api/types/A2AStreamEventResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * An SSE event carrying an A2A `HTTP+JSON` streaming response. - */ -export interface A2AStreamEventResponse { - /** SSE payload: an A2A HTTP+JSON streaming response. */ - data?: string; - /** Event type. Absent for the default `message` event. */ - event?: string; - /** - * Opaque event id. Clients echo the most recent value in the - * `Last-Event-ID` header to resume a dropped stream. - */ - id?: string; - /** Reconnection time in milliseconds the client should use. */ - retry?: number; -} diff --git a/src/api/types/A2AjsonrpcResponse.ts b/src/api/types/A2AjsonrpcResponse.ts deleted file mode 100644 index 431728b4..00000000 --- a/src/api/types/A2AjsonrpcResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A JSON-RPC 2.0 response envelope. - */ -export interface A2AjsonrpcResponse { - /** JSON-RPC protocol version; always `2.0`. */ - jsonrpc: "2.0"; - id: Corti.A2AjsonrpcResponseId | null; - /** JSON-RPC result object (present on success). */ - result?: Record; - /** JSON-RPC error object (present on failure). */ - error?: Corti.A2AjsonrpcResponseError; -} diff --git a/src/api/types/A2AjsonrpcResponseError.ts b/src/api/types/A2AjsonrpcResponseError.ts deleted file mode 100644 index f649367d..00000000 --- a/src/api/types/A2AjsonrpcResponseError.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * JSON-RPC error object (present on failure). - */ -export interface A2AjsonrpcResponseError { - /** JSON-RPC error code. */ - code: number; - /** Human-readable error message. */ - message: string; - /** Additional error details. */ - data?: Record; -} diff --git a/src/api/types/A2AjsonrpcResponseId.ts b/src/api/types/A2AjsonrpcResponseId.ts deleted file mode 100644 index ef652a55..00000000 --- a/src/api/types/A2AjsonrpcResponseId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export type A2AjsonrpcResponseId = string | number; diff --git a/src/api/types/AgentCardResponse.ts b/src/api/types/AgentCardResponse.ts deleted file mode 100644 index ecf4d1d7..00000000 --- a/src/api/types/AgentCardResponse.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An A2A agent card describing capabilities, skills, and supported interfaces. - */ -export interface AgentCardResponse { - /** Agent display name. */ - name: string; - /** Agent description. */ - description?: string; - /** A URL providing additional documentation about the agent. */ - documentationUrl?: string; - /** Optional URL to an icon for the agent. */ - iconUrl?: string; - /** Agent card version (SemVer). */ - version: string; - /** Agent capability flags (streaming, push notifications). */ - capabilities: Corti.AgentCardResponseCapabilities; - /** Default input media types. */ - defaultInputModes?: string[]; - /** Default output media types. */ - defaultOutputModes?: string[]; - /** Publishing organization and URL. */ - provider?: Corti.AgentCardResponseProvider; - /** Security requirements for contacting the agent. */ - securityRequirements?: Record[]; - /** The security scheme details used for authenticating with this agent. */ - securitySchemes?: Record; - /** JSON Web Signatures (JWS, RFC 7515) computed for this agent card. */ - signatures?: Corti.AgentCardResponseSignaturesItem[]; - /** Skills the agent exposes. */ - skills?: Corti.AgentCardResponseSkillsItem[]; - /** A2A protocol bindings. v2 advertises protocolVersion `1.0` only. */ - supportedInterfaces: Corti.AgentCardResponseSupportedInterfacesItem[]; -} diff --git a/src/api/types/AgentCardResponseCapabilities.ts b/src/api/types/AgentCardResponseCapabilities.ts deleted file mode 100644 index a28f56e0..00000000 --- a/src/api/types/AgentCardResponseCapabilities.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Agent capability flags (streaming, push notifications). - */ -export interface AgentCardResponseCapabilities { - /** Whether the agent supports streaming responses. */ - streaming?: boolean; - /** - * Whether the agent can push task updates to a client-supplied webhook. - * **Future scope**: the `tasks/pushNotificationConfig/*` management endpoints are not yet implemented. Expect this to be `false` until they ship. - */ - pushNotifications?: boolean; -} diff --git a/src/api/types/AgentCardResponseProvider.ts b/src/api/types/AgentCardResponseProvider.ts deleted file mode 100644 index 4ddb0ec9..00000000 --- a/src/api/types/AgentCardResponseProvider.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Publishing organization and URL. - */ -export interface AgentCardResponseProvider { - /** Publishing organization name. */ - organization?: string; - /** Publishing organization URL. */ - url?: string; -} diff --git a/src/api/types/AgentCardResponseSignaturesItem.ts b/src/api/types/AgentCardResponseSignaturesItem.ts deleted file mode 100644 index 1e9cfd7e..00000000 --- a/src/api/types/AgentCardResponseSignaturesItem.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentCardResponseSignaturesItem { - /** Base64url-encoded protected JWS header. */ - protected: string; - /** Unprotected JWS header values. */ - header?: Record; - /** Base64url-encoded signature. */ - signature: string; -} diff --git a/src/api/types/AgentCardResponseSkillsItem.ts b/src/api/types/AgentCardResponseSkillsItem.ts deleted file mode 100644 index 766ce4ce..00000000 --- a/src/api/types/AgentCardResponseSkillsItem.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface AgentCardResponseSkillsItem { - /** Skill identifier. */ - id: string; - /** Skill display name. */ - name: string; - /** Skill description. */ - description?: string; - /** Keywords for search and filtering. */ - tags?: string[]; -} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItem.ts b/src/api/types/AgentCardResponseSupportedInterfacesItem.ts deleted file mode 100644 index 345f16d8..00000000 --- a/src/api/types/AgentCardResponseSupportedInterfacesItem.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -export interface AgentCardResponseSupportedInterfacesItem { - /** A2A protocol binding type. */ - protocolBinding: Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding; - /** A2A protocol version; always `1.0`. */ - protocolVersion: "1.0"; - /** Endpoint URL for this protocol binding. */ - url: string; -} diff --git a/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts deleted file mode 100644 index 658ead3f..00000000 --- a/src/api/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** A2A protocol binding type. */ -export const AgentCardResponseSupportedInterfacesItemProtocolBinding = { - Jsonrpc: "JSONRPC", - HttpJson: "HTTP+JSON", -} as const; -export type AgentCardResponseSupportedInterfacesItemProtocolBinding = - (typeof AgentCardResponseSupportedInterfacesItemProtocolBinding)[keyof typeof AgentCardResponseSupportedInterfacesItemProtocolBinding]; diff --git a/src/api/types/AgentsLabels.ts b/src/api/types/AgentsLabels.ts deleted file mode 100644 index f7a70f75..00000000 --- a/src/api/types/AgentsLabels.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Free-form `string → string` metadata for filtering and organisation. Not used for routing or auth. - */ -export type AgentsLabels = Record; diff --git a/src/api/types/AgentsLifecycle.ts b/src/api/types/AgentsLifecycle.ts deleted file mode 100644 index 479e335b..00000000 --- a/src/api/types/AgentsLifecycle.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * - `ephemeral` — short-lived; expired automatically. - * - `persistent` — retained until explicitly deleted. - */ -export const AgentsLifecycle = { - Ephemeral: "ephemeral", - Persistent: "persistent", -} as const; -export type AgentsLifecycle = (typeof AgentsLifecycle)[keyof typeof AgentsLifecycle]; diff --git a/src/api/types/AgentsListResponse.ts b/src/api/types/AgentsListResponse.ts deleted file mode 100644 index 3e2ede49..00000000 --- a/src/api/types/AgentsListResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of agents. - */ -export interface AgentsListResponse { - /** Agents on the current page. */ - agents: Corti.AgentsResponse[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/AgentsResponse.ts b/src/api/types/AgentsResponse.ts deleted file mode 100644 index ff04c554..00000000 --- a/src/api/types/AgentsResponse.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A configured agent — its metadata, model, and attached connectors. - */ -export interface AgentsResponse { - id: Corti.CommonAgentIdValue; - /** Human-readable, unique-per-tenant agent name. */ - name: string; - /** Free-form agent description shown to users and in tooling. */ - description?: string | null; - /** System prompt prepended to every invocation. */ - systemPrompt?: string | null; - /** - * Model identifier. Tenant default if omitted or `null`. - * **Open question** — in the current implementation a model is configured per *expert*, not per *agent* (`Expert.modelName`), and an `Agent` has no model field at all. The desired end state is that there is **no distinction between an expert and an agent**, so `model` lives uniformly on this resource. Until that convergence lands, the precedence of an agent-level `model` over a connector/expert-level override is undecided and MUST be resolved before this field ships. - */ - model?: string | null; - visibility: Corti.AgentsVisibility; - lifecycle: Corti.AgentsLifecycle; - /** Connectors attached to the agent, discriminated by `type`. */ - connectors: Corti.CommonConnectorResponse[]; - labels?: Corti.AgentsLabels; - /** When the agent was created. */ - createdAt?: Date; - /** When the agent was last updated. */ - updatedAt?: Date; - /** Principal (user or service principal) that created the agent. */ - createdBy?: Corti.AgentsUserIdValue; -} diff --git a/src/api/types/AgentsUserIdValue.ts b/src/api/types/AgentsUserIdValue.ts deleted file mode 100644 index 1b1123af..00000000 --- a/src/api/types/AgentsUserIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Principal identifier. Accepts `usr.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type AgentsUserIdValue = string; diff --git a/src/api/types/AgentsVisibility.ts b/src/api/types/AgentsVisibility.ts deleted file mode 100644 index 47ee0338..00000000 --- a/src/api/types/AgentsVisibility.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * - `private` — creator / service principal only. - * - `unlisted` — usable by ID, hidden from list results. - * - `public` — listed tenant-wide. - */ -export const AgentsVisibility = { - Private: "private", - Unlisted: "unlisted", - Public: "public", -} as const; -export type AgentsVisibility = (typeof AgentsVisibility)[keyof typeof AgentsVisibility]; diff --git a/src/api/types/CommonA2AConnector.ts b/src/api/types/CommonA2AConnector.ts deleted file mode 100644 index 66820c78..00000000 --- a/src/api/types/CommonA2AConnector.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector that delegates to a remote A2A agent by endpoint URL. - */ -export interface CommonA2AConnector { - type: "a2a"; - /** Optional display name for the remote A2A agent. */ - name?: string; - /** The remote agent's A2A endpoint (typically a `.well-known/agent-card.json`). */ - url: string; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonA2AConnectorCreate.ts b/src/api/types/CommonA2AConnectorCreate.ts deleted file mode 100644 index 206c2513..00000000 --- a/src/api/types/CommonA2AConnectorCreate.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Request body for attaching a remote A2A agent connector. - */ -export interface CommonA2AConnectorCreate { - type: "a2a"; - /** Optional display name for the remote A2A agent. */ - name?: string; - /** Remote agent A2A endpoint URL. */ - url: string; - /** Whether the connector is active for invocations. */ - enabled?: boolean; -} diff --git a/src/api/types/CommonAgentConnector.ts b/src/api/types/CommonAgentConnector.ts deleted file mode 100644 index a07da86b..00000000 --- a/src/api/types/CommonAgentConnector.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector that delegates to another agent. - */ -export interface CommonAgentConnector { - type: "agent"; - agentId: Corti.CommonAgentIdValue; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonAgentConnectorCreate.ts b/src/api/types/CommonAgentConnectorCreate.ts deleted file mode 100644 index b88662df..00000000 --- a/src/api/types/CommonAgentConnectorCreate.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for attaching an agent connector. - */ -export interface CommonAgentConnectorCreate { - type: "agent"; - agentId: Corti.CommonAgentIdValue; - /** Whether the connector is active for invocations. */ - enabled?: boolean; -} diff --git a/src/api/types/CommonAgentIdValue.ts b/src/api/types/CommonAgentIdValue.ts deleted file mode 100644 index 6a47de42..00000000 --- a/src/api/types/CommonAgentIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Agent identifier. Accepts `agt.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonAgentIdValue = string; diff --git a/src/api/types/CommonArtifactIdValue.ts b/src/api/types/CommonArtifactIdValue.ts deleted file mode 100644 index c77bf933..00000000 --- a/src/api/types/CommonArtifactIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Artifact identifier. Accepts `art.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonArtifactIdValue = string; diff --git a/src/api/types/CommonArtifactResponse.ts b/src/api/types/CommonArtifactResponse.ts deleted file mode 100644 index 675a5c94..00000000 --- a/src/api/types/CommonArtifactResponse.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A named output produced by a task. - */ -export interface CommonArtifactResponse { - artifactId: Corti.CommonArtifactIdValue; - /** Optional artifact name. */ - name?: string; - /** A human-readable description of the artifact. */ - description?: string; - /** URIs of extensions that contributed to this artifact. */ - extensions?: string[]; - /** Optional metadata included with the artifact. */ - metadata?: Record; - /** Content parts of the artifact. */ - parts: Corti.CommonPart[]; -} diff --git a/src/api/types/CommonConnectorAuth.ts b/src/api/types/CommonConnectorAuth.ts deleted file mode 100644 index 74a0e61a..00000000 --- a/src/api/types/CommonConnectorAuth.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Authentication configuration for an outbound connector. - */ -export interface CommonConnectorAuth { - /** Authentication mechanism. */ - type: Corti.CommonConnectorAuthType; - /** OAuth2 scope requested. */ - scope?: string; - /** OAuth2 redirect URL. */ - redirectUrl?: string; - /** Reference to a server-side stored secret. Mutually exclusive with inline credentials passed at call time. */ - ref?: string; -} diff --git a/src/api/types/CommonConnectorAuthType.ts b/src/api/types/CommonConnectorAuthType.ts deleted file mode 100644 index 2a11f3ff..00000000 --- a/src/api/types/CommonConnectorAuthType.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Authentication mechanism. */ -export const CommonConnectorAuthType = { - None: "none", - Bearer: "bearer", - ApiKey: "apiKey", - Oauth2: "oauth2", -} as const; -export type CommonConnectorAuthType = (typeof CommonConnectorAuthType)[keyof typeof CommonConnectorAuthType]; diff --git a/src/api/types/CommonConnectorCreateRequest.ts b/src/api/types/CommonConnectorCreateRequest.ts deleted file mode 100644 index bff44d16..00000000 --- a/src/api/types/CommonConnectorCreateRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Same envelope as `Connector` but without the server-generated `id`. - */ -export type CommonConnectorCreateRequest = - | Corti.CommonRegistryConnectorCreate - | Corti.CommonMcpConnectorCreate - | Corti.CommonAgentConnectorCreate - | Corti.CommonA2AConnectorCreate - | Corti.CommonSchemaConnectorCreate; diff --git a/src/api/types/CommonConnectorIdValue.ts b/src/api/types/CommonConnectorIdValue.ts deleted file mode 100644 index a4170444..00000000 --- a/src/api/types/CommonConnectorIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Connector identifier. Accepts `con.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonConnectorIdValue = string; diff --git a/src/api/types/CommonConnectorResponse.ts b/src/api/types/CommonConnectorResponse.ts deleted file mode 100644 index 05a8410f..00000000 --- a/src/api/types/CommonConnectorResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector attached to an agent, discriminated by `type`. - */ -export type CommonConnectorResponse = - | Corti.CommonRegistryConnectorProvisioned - | Corti.CommonMcpConnector - | Corti.CommonAgentConnector - | Corti.CommonA2AConnector - | Corti.CommonSchemaConnector; diff --git a/src/api/types/CommonConnectorType.ts b/src/api/types/CommonConnectorType.ts deleted file mode 100644 index 88d075cd..00000000 --- a/src/api/types/CommonConnectorType.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * The connector discriminator. v2 ships `registry`, `mcp`, `agent`, - * `a2a`, and `schema`; `openapi` and `custom` are reserved for future - * minor versions. - */ -export const CommonConnectorType = { - Registry: "registry", - Mcp: "mcp", - Agent: "agent", - A2A: "a2a", - Schema: "schema", -} as const; -export type CommonConnectorType = (typeof CommonConnectorType)[keyof typeof CommonConnectorType]; diff --git a/src/api/types/CommonContextIdValue.ts b/src/api/types/CommonContextIdValue.ts deleted file mode 100644 index c5ea5a8e..00000000 --- a/src/api/types/CommonContextIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Context identifier. Accepts `ctx.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonContextIdValue = string; diff --git a/src/api/types/CommonErrorResponse.ts b/src/api/types/CommonErrorResponse.ts deleted file mode 100644 index 7ceeae50..00000000 --- a/src/api/types/CommonErrorResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Corti management-plane error envelope, used by all non-A2A endpoints. - * - * - **Standard** — when the error chain contains at least one `PublicError`, - * `code` and `message` come from the outermost `PublicError` and `details` - * is merged across the whole chain (outer values take precedence). - * - **Fallback** — when the chain contains no `PublicError`, the response is - * a generic `500` carrying a `requestId` for support reference. - * - **Validation** — a single `PublicError` whose `details.validationErrors` - * lists the offending fields. - * - * Field names use camelCase on the wire (e.g. `requestId`, `howToFix`). - * The free-form `details` object may carry arbitrary caller-defined keys. - * - * Rate limiting (HTTP 429) is not yet implemented; the server does not emit a 429 response. - */ -export interface CommonErrorResponse { - /** The error object with code, message, and optional details. */ - error: Corti.CommonErrorResponseError; -} diff --git a/src/api/types/CommonErrorResponseError.ts b/src/api/types/CommonErrorResponseError.ts deleted file mode 100644 index 4e0ca42c..00000000 --- a/src/api/types/CommonErrorResponseError.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * The error object with code, message, and optional details. - */ -export interface CommonErrorResponseError { - /** Stable, machine-readable, SCREAMING_SNAKE_CASE error code. */ - code: string; - /** Human-readable explanation. */ - message: string; - /** Optional guidance for the caller to resolve the error. */ - howToFix?: string; - /** - * Structured context, merged from every `PublicError` in the chain - * (outer values win). Omitted on the generic fallback response. - */ - details?: Corti.CommonErrorResponseErrorDetails; - /** - * Correlation ID from request middleware. Included only on the - * generic `500` fallback so consumers can quote it in support requests. - */ - requestId?: string; -} diff --git a/src/api/types/CommonErrorResponseErrorDetails.ts b/src/api/types/CommonErrorResponseErrorDetails.ts deleted file mode 100644 index e20d410b..00000000 --- a/src/api/types/CommonErrorResponseErrorDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Structured context, merged from every `PublicError` in the chain - * (outer values win). Omitted on the generic fallback response. - */ -export interface CommonErrorResponseErrorDetails { - /** Present when `code` is `VALIDATION_FAILED`. */ - validationErrors?: Corti.CommonErrorResponseErrorDetailsValidationErrorsItem[]; - /** Accepts any additional properties */ - [key: string]: any; -} diff --git a/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts deleted file mode 100644 index 541d42b2..00000000 --- a/src/api/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface CommonErrorResponseErrorDetailsValidationErrorsItem { - /** The field that failed validation. */ - field: string; - /** Why the field failed validation. */ - reason: string; -} diff --git a/src/api/types/CommonMcpConnector.ts b/src/api/types/CommonMcpConnector.ts deleted file mode 100644 index d64b84ef..00000000 --- a/src/api/types/CommonMcpConnector.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector backed by a remote MCP server. - */ -export interface CommonMcpConnector { - type: "mcp"; - /** Display name for the MCP connector. */ - name: string; - /** MCP server endpoint URL. */ - url: string; - auth?: Corti.CommonConnectorAuth; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonMcpConnectorCreate.ts b/src/api/types/CommonMcpConnectorCreate.ts deleted file mode 100644 index d553e5b5..00000000 --- a/src/api/types/CommonMcpConnectorCreate.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for attaching an MCP connector. - */ -export interface CommonMcpConnectorCreate { - type: "mcp"; - /** Display name for the MCP connector. */ - name: string; - /** MCP server endpoint URL. */ - url: string; - /** Whether the connector is active for invocations. */ - enabled?: boolean; - auth?: Corti.CommonConnectorAuth; -} diff --git a/src/api/types/CommonMessage.ts b/src/api/types/CommonMessage.ts deleted file mode 100644 index 444606cc..00000000 --- a/src/api/types/CommonMessage.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An A2A message — an ordered list of content parts with a role. - */ -export interface CommonMessage { - messageId?: Corti.CommonMessageIdValue; - contextId?: Corti.CommonContextIdValue; - taskId?: Corti.CommonTaskIdValue; - role: Corti.CommonRole; - /** Ordered content parts of the message. */ - parts: Corti.CommonPart[]; - /** Task ids this message references (A2A v1.0 `Message.referenceTaskIds`). */ - referenceTaskIds?: Corti.CommonTaskIdValue[]; - /** URIs of A2A extensions that contributed to this message (A2A v1.0 `Message.extensions`). */ - extensions?: string[]; - /** - * Free-form A2A metadata. Corti's own first-party keys are prefixed - * with `$` (à la Mixpanel) to set them apart from caller-supplied keys. - * A2A defines no message-level timestamp, so Corti carries one as - * `$timestamp` (RFC 3339 / ISO 8601) — useful for timing *user* - * messages, which `TaskStatus.timestamp` cannot. - */ - metadata?: Record; -} diff --git a/src/api/types/CommonMessageIdValue.ts b/src/api/types/CommonMessageIdValue.ts deleted file mode 100644 index 698241f0..00000000 --- a/src/api/types/CommonMessageIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Message identifier. Accepts `msg.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonMessageIdValue = string; diff --git a/src/api/types/CommonNextPageToken.ts b/src/api/types/CommonNextPageToken.ts deleted file mode 100644 index d6b4861e..00000000 --- a/src/api/types/CommonNextPageToken.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Opaque cursor to request the next page, or `null` if there are no more pages. - */ -export type CommonNextPageToken = string | null; diff --git a/src/api/types/CommonPart.ts b/src/api/types/CommonPart.ts deleted file mode 100644 index aef7692d..00000000 --- a/src/api/types/CommonPart.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * A single content part of a message or artifact. - */ -export interface CommonPart { - /** The string content of the `text` part. */ - text?: string; - /** Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null). */ - data?: Record; - /** An optional `filename` for the file (e.g., `document.pdf`). */ - filename?: string; - /** The `media_type` (MIME type) of the part content (e.g., `text/plain`, `application/json`, `image/png`). */ - mediaType?: string; - /** The `raw` byte content of a file. Encoded as a base64 string. */ - raw?: string; - /** A `url` pointing to the file's content. */ - url?: string; - /** Optional metadata associated with this part. */ - metadata?: Record; - /** Accepts any additional properties */ - [key: string]: any; -} diff --git a/src/api/types/CommonRegistryConnectorCreate.ts b/src/api/types/CommonRegistryConnectorCreate.ts deleted file mode 100644 index a8442138..00000000 --- a/src/api/types/CommonRegistryConnectorCreate.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Request body for attaching a registry connector. - */ -export interface CommonRegistryConnectorCreate { - type: "registry"; - /** Registry connector name. */ - name: string; - /** Whether the connector is active for invocations. */ - enabled?: boolean; - /** Connector-specific configuration validated against the registry schema. Not yet persisted — the server currently drops `config` for registry connectors on create. */ - config?: Record; -} diff --git a/src/api/types/CommonRegistryConnectorProvisioned.ts b/src/api/types/CommonRegistryConnectorProvisioned.ts deleted file mode 100644 index 4b13e427..00000000 --- a/src/api/types/CommonRegistryConnectorProvisioned.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector provisioned from a registry entry. - */ -export interface CommonRegistryConnectorProvisioned { - type: "registry"; - /** Registry connector name. */ - name: string; - /** Connector-specific configuration validated against the registry schema. */ - config?: Record; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonRole.ts b/src/api/types/CommonRole.ts deleted file mode 100644 index e3947086..00000000 --- a/src/api/types/CommonRole.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The author of a message. */ -export const CommonRole = { - RoleUser: "ROLE_USER", - RoleAgent: "ROLE_AGENT", -} as const; -export type CommonRole = (typeof CommonRole)[keyof typeof CommonRole]; diff --git a/src/api/types/CommonSchemaConnector.ts b/src/api/types/CommonSchemaConnector.ts deleted file mode 100644 index 2cae8b20..00000000 --- a/src/api/types/CommonSchemaConnector.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A connector backed by a schema definition. - */ -export interface CommonSchemaConnector { - type: "schema"; - /** Schema connector name. Used as the tool name the LLM calls. */ - name: string; - /** What the tool does. Read by the LLM to decide when to call it. */ - description?: string; - /** JSON Schema defining the tool's output shape. */ - schema: Record; - /** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ - transition?: Corti.CommonSchemaConnectorTransition; - /** - * Server-generated connector identifier (prefixed UUIDv7). Stable across PATCH - * replacements where the underlying spec is unchanged. Used by - * observability/HITL to reference a connector unambiguously. - */ - id?: Corti.CommonConnectorIdValue; - /** Whether the connector is active for invocations. Only `schema` connectors return this field today; `mcp`, `registry`, `agent`, and `a2a` connectors omit it (treat as enabled). */ - enabled?: boolean; -} diff --git a/src/api/types/CommonSchemaConnectorCreate.ts b/src/api/types/CommonSchemaConnectorCreate.ts deleted file mode 100644 index 5de599c1..00000000 --- a/src/api/types/CommonSchemaConnectorCreate.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Request body for attaching a schema connector. - */ -export interface CommonSchemaConnectorCreate { - type: "schema"; - /** Schema connector name. */ - name: string; - /** What the tool does. Read by the LLM to decide when to call it. */ - description?: string; - /** JSON Schema defining the tool's output shape. */ - schema: Record; - /** If set, calling this tool terminates the loop in the given state. */ - transition?: Corti.CommonSchemaConnectorCreateTransition; - /** Whether the connector is active for invocations. */ - enabled?: boolean; -} diff --git a/src/api/types/CommonSchemaConnectorCreateTransition.ts b/src/api/types/CommonSchemaConnectorCreateTransition.ts deleted file mode 100644 index 103aba0a..00000000 --- a/src/api/types/CommonSchemaConnectorCreateTransition.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** If set, calling this tool terminates the loop in the given state. */ -export const CommonSchemaConnectorCreateTransition = { - Complete: "complete", - InputRequired: "input_required", -} as const; -export type CommonSchemaConnectorCreateTransition = - (typeof CommonSchemaConnectorCreateTransition)[keyof typeof CommonSchemaConnectorCreateTransition]; diff --git a/src/api/types/CommonSchemaConnectorTransition.ts b/src/api/types/CommonSchemaConnectorTransition.ts deleted file mode 100644 index a169a64a..00000000 --- a/src/api/types/CommonSchemaConnectorTransition.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** If set, calling this tool terminates the loop in the given state after validating and storing the data part. No further LLM call. */ -export const CommonSchemaConnectorTransition = { - Complete: "complete", - InputRequired: "input_required", -} as const; -export type CommonSchemaConnectorTransition = - (typeof CommonSchemaConnectorTransition)[keyof typeof CommonSchemaConnectorTransition]; diff --git a/src/api/types/CommonTaskIdValue.ts b/src/api/types/CommonTaskIdValue.ts deleted file mode 100644 index 1bbf83f3..00000000 --- a/src/api/types/CommonTaskIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Task identifier. Accepts `task.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type CommonTaskIdValue = string; diff --git a/src/api/types/CommonTaskListResponse.ts b/src/api/types/CommonTaskListResponse.ts deleted file mode 100644 index cd8c0aea..00000000 --- a/src/api/types/CommonTaskListResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of tasks. - */ -export interface CommonTaskListResponse { - /** The page size used for this response. */ - pageSize?: number; - /** Tasks on the current page. */ - tasks: Corti.CommonTaskResponse[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/CommonTaskMetadata.ts b/src/api/types/CommonTaskMetadata.ts deleted file mode 100644 index df32e38b..00000000 --- a/src/api/types/CommonTaskMetadata.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Free-form A2A task metadata. Corti's first-party keys are prefixed with - * `$` (à la Mixpanel) to set them apart from caller-supplied keys. Token and - * credit accounting is carried under `$usage`. Arbitrary additional keys are - * permitted. - */ -export interface CommonTaskMetadata { - usage?: Corti.CommonUsage; - /** Accepts any additional properties */ - [key: string]: any; -} diff --git a/src/api/types/CommonTaskResponse.ts b/src/api/types/CommonTaskResponse.ts deleted file mode 100644 index 877dc4c1..00000000 --- a/src/api/types/CommonTaskResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An A2A task — a unit of agent work with status, history, and artifacts. - */ -export interface CommonTaskResponse { - id: Corti.CommonTaskIdValue; - contextId: Corti.CommonContextIdValue; - status: Corti.CommonTaskStatus; - /** Messages exchanged during the task, oldest first. */ - history?: Corti.CommonMessage[]; - /** Artifacts produced by the task. */ - artifacts?: Corti.CommonArtifactResponse[]; - /** Task metadata, including `$usage` token/credit accounting. Not yet exposed through the REST binding (deferred); only the JSON-RPC binding populates this field. */ - metadata?: Corti.CommonTaskMetadata; -} diff --git a/src/api/types/CommonTaskState.ts b/src/api/types/CommonTaskState.ts deleted file mode 100644 index 0ee2d276..00000000 --- a/src/api/types/CommonTaskState.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The lifecycle state of a task. */ -export const CommonTaskState = { - TaskStateSubmitted: "TASK_STATE_SUBMITTED", - TaskStateWorking: "TASK_STATE_WORKING", - TaskStateCompleted: "TASK_STATE_COMPLETED", - TaskStateFailed: "TASK_STATE_FAILED", - TaskStateCanceled: "TASK_STATE_CANCELED", - TaskStateInputRequired: "TASK_STATE_INPUT_REQUIRED", - TaskStateRejected: "TASK_STATE_REJECTED", - TaskStateAuthRequired: "TASK_STATE_AUTH_REQUIRED", -} as const; -export type CommonTaskState = (typeof CommonTaskState)[keyof typeof CommonTaskState]; diff --git a/src/api/types/CommonTaskStatus.ts b/src/api/types/CommonTaskStatus.ts deleted file mode 100644 index d2d4b371..00000000 --- a/src/api/types/CommonTaskStatus.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A task's current state, with an optional status message and timestamp. - */ -export interface CommonTaskStatus { - state: Corti.CommonTaskState; - message?: Corti.CommonMessage; - /** When the status was last updated. */ - timestamp?: Date; -} diff --git a/src/api/types/CommonTotalSize.ts b/src/api/types/CommonTotalSize.ts deleted file mode 100644 index 8dc035c2..00000000 --- a/src/api/types/CommonTotalSize.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Total number of items matching the query, when known. Not currently populated by the server; treat as absent. - */ -export type CommonTotalSize = number; diff --git a/src/api/types/CommonUsage.ts b/src/api/types/CommonUsage.ts deleted file mode 100644 index da9f9b51..00000000 --- a/src/api/types/CommonUsage.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Token and credit accounting for a task, following the conventions used by - * major LLM providers. `inputTokens`/`outputTokens` count the prompt and - * completion respectively; `cachedInputTokens` is the subset of - * `inputTokens` served from the provider's prompt cache (a discount, not an - * addition), and `cacheCreationInputTokens` is the surcharge paid to - * *write* the cache. `totalTokens` is the all-in count. `credits` is the - * Corti billing unit charged for the task. - */ -export interface CommonUsage { - /** The model identifier that served the request. */ - model?: string; - /** Prompt tokens consumed. */ - inputTokens: number; - /** Completion tokens produced. */ - outputTokens: number; - /** Subset of `inputTokens` served from the prompt cache (cache read). */ - cachedInputTokens?: number; - /** Input tokens written to the prompt cache (cache-write surcharge). */ - cacheCreationInputTokens?: number; - /** Total tokens billed (`inputTokens` + `outputTokens`). */ - totalTokens: number; - /** Corti billing credits charged for the task. */ - credits?: number; -} diff --git a/src/api/types/ConnectorsListResponse.ts b/src/api/types/ConnectorsListResponse.ts deleted file mode 100644 index b3974960..00000000 --- a/src/api/types/ConnectorsListResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An agent's attached connectors. - */ -export interface ConnectorsListResponse { - /** Connectors attached to the agent. */ - connectors: Corti.CommonConnectorResponse[]; -} diff --git a/src/api/types/Contexts.ts b/src/api/types/Contexts.ts deleted file mode 100644 index 1a17c5f1..00000000 --- a/src/api/types/Contexts.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Lightweight context metadata, as returned in list responses. Contexts are not first-class CRUD resources: there is no explicit create or update endpoint — a context is created implicitly on the first message send (or reused by client-supplied contextId), and list is not yet implemented. - */ -export interface Contexts { - id: Corti.CommonContextIdValue; - agentId?: Corti.CommonAgentIdValue; - /** Total number of tasks in the context. */ - taskCount?: number; - /** When the context was created. */ - createdAt?: Date; - /** When the context was last updated. */ - updatedAt?: Date; - /** When the context expires; `null` means it does not expire. Not yet implemented — the server always returns `null` and performs no TTL-based cleanup. */ - expiresAt?: Date | null; -} diff --git a/src/api/types/ContextsDetailResponse.ts b/src/api/types/ContextsDetailResponse.ts deleted file mode 100644 index 76b54a75..00000000 --- a/src/api/types/ContextsDetailResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A context together with its tasks. Returned by `GET /contexts/{id}`. - * Tasks are ordered oldest first and each carries its full message - * `history` — the user's prompt for a task is the `ROLE_USER` message - * within that task's history. - */ -export interface ContextsDetailResponse extends Corti.Contexts { - /** The context's tasks, oldest first, each with full message history. */ - tasks: Corti.CommonTaskResponse[]; -} diff --git a/src/api/types/ContextsListResponse.ts b/src/api/types/ContextsListResponse.ts deleted file mode 100644 index 48126c80..00000000 --- a/src/api/types/ContextsListResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of contexts. - */ -export interface ContextsListResponse { - /** Contexts on the current page. */ - contexts: Corti.Contexts[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/ContextsOpenInferenceSpan.ts b/src/api/types/ContextsOpenInferenceSpan.ts deleted file mode 100644 index 281c1fee..00000000 --- a/src/api/types/ContextsOpenInferenceSpan.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * A single span in an OpenInference trace. - */ -export interface ContextsOpenInferenceSpan { - /** Human-readable span name. */ - name: string; - /** Unique span identifier. */ - spanId: string; - /** Parent span id, omitted for the root span. */ - parentSpanId?: string; - /** When the span started. */ - startTime: Date; - /** When the span ended; `null` if still in progress. */ - endTime?: Date | null; - /** OpenInference span attributes. Key names and structure follow the OpenInference semantic conventions. */ - attributes?: Record; -} diff --git a/src/api/types/ContextsTraceItem.ts b/src/api/types/ContextsTraceItem.ts deleted file mode 100644 index 886870a4..00000000 --- a/src/api/types/ContextsTraceItem.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A single trace with its inlined OpenInference spans. - */ -export interface ContextsTraceItem { - /** The trace-level record. */ - trace: Corti.ContextsTraceItemTrace; - /** Spans in this trace, ordered by start time. */ - spans: Corti.ContextsOpenInferenceSpan[]; -} diff --git a/src/api/types/ContextsTraceItemTrace.ts b/src/api/types/ContextsTraceItemTrace.ts deleted file mode 100644 index cf6a1384..00000000 --- a/src/api/types/ContextsTraceItemTrace.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * The trace-level record. - */ -export interface ContextsTraceItemTrace { - /** Trace identifier (OTel trace ID — 32-char hex). */ - id: string; - /** Human-readable trace name. */ - name: string; - /** When the trace started. */ - startTime: Date; - /** When the trace ended; `null` if still in progress. */ - endTime?: Date | null; - /** Trace-level input payload. */ - input?: Record; - /** Trace-level output payload. */ - output?: Record; - /** Free-form trace metadata. */ - metadata?: Record; - /** Trace tags. */ - tags?: string[]; - /** Thread/context identifier. */ - threadId: string; -} diff --git a/src/api/types/ContextsTraceResponse.ts b/src/api/types/ContextsTraceResponse.ts deleted file mode 100644 index 8f4aaef2..00000000 --- a/src/api/types/ContextsTraceResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of traces for a context in OpenInference format. Traces are - * ordered newest-first. - */ -export interface ContextsTraceResponse { - /** Traces for the context, newest first. */ - traces: Corti.ContextsTraceItem[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/FeedbackActor.ts b/src/api/types/FeedbackActor.ts deleted file mode 100644 index 135da226..00000000 --- a/src/api/types/FeedbackActor.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Customer-defined opaque identifier for the feedback submitter. - */ -export interface FeedbackActor { - /** - * Scoped to the authenticated customer; not globally unique and not - * independently verified. Should preferably be pseudonymous and must - * not contain names, emails, national identifiers, or medical record - * numbers. - */ - externalId: string; -} diff --git a/src/api/types/FeedbackIdValue.ts b/src/api/types/FeedbackIdValue.ts deleted file mode 100644 index 0ff14a45..00000000 --- a/src/api/types/FeedbackIdValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Feedback identifier. Accepts `fb.` or a bare UUIDv7 on input; always returned prefixed. - */ -export type FeedbackIdValue = string; diff --git a/src/api/types/FeedbackLabel.ts b/src/api/types/FeedbackLabel.ts deleted file mode 100644 index 42fd846b..00000000 --- a/src/api/types/FeedbackLabel.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Structured observation about the result. Positive and negative labels - * share one taxonomy so customers can represent mixed feedback. - * - `correct` — factually and contextually correct (positive). - * - `complete` — included the important expected information (positive). - * - `helpful` — materially helped the user complete their task (positive). - * - `wellPresented` — clear, readable, appropriately structured (positive). - * - `efficient` — reached a useful result without unnecessary content (positive). - * - `incorrect` — one or more claims, conclusions, or actions were wrong (negative). - * - `missingInformation` — important or expected information was omitted (negative). - * - `irrelevant` — included content that did not address the request (negative). - * - `misunderstoodRequest` — the system responded to the wrong intent (negative). - * - `unsupportedClaim` — a claim not supported by available information (negative). - * - `unsafeOrInappropriate` — unsafe, disallowed, or unsuitable (negative). - * - `poorlyPresented` — difficult to read or unsuitably structured (negative). - * - `tooVerbose` — substantially more detail than useful (negative). - * - `other` — another observation described in `reason` (both). - */ -export const FeedbackLabel = { - Correct: "correct", - Complete: "complete", - Helpful: "helpful", - WellPresented: "wellPresented", - Efficient: "efficient", - Incorrect: "incorrect", - MissingInformation: "missingInformation", - Irrelevant: "irrelevant", - MisunderstoodRequest: "misunderstoodRequest", - UnsupportedClaim: "unsupportedClaim", - UnsafeOrInappropriate: "unsafeOrInappropriate", - PoorlyPresented: "poorlyPresented", - TooVerbose: "tooVerbose", - Other: "other", -} as const; -export type FeedbackLabel = (typeof FeedbackLabel)[keyof typeof FeedbackLabel]; diff --git a/src/api/types/FeedbackListResponse.ts b/src/api/types/FeedbackListResponse.ts deleted file mode 100644 index 54691bf9..00000000 --- a/src/api/types/FeedbackListResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * All feedback resources for a task, newest-first. Feedback is scoped to the authenticated user via row-level security. - */ -export interface FeedbackListResponse { - /** Feedback resources for the task. */ - feedbacks: Corti.FeedbackResponse[]; -} diff --git a/src/api/types/FeedbackMetadata.ts b/src/api/types/FeedbackMetadata.ts deleted file mode 100644 index 9492bd17..00000000 --- a/src/api/types/FeedbackMetadata.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Customer-provided provenance and correlation information. - */ -export interface FeedbackMetadata { - /** How the customer collected the feedback. Informational only; does not affect rating validation or normalization. */ - collectionMethod?: string; - /** - * Customer-defined reference to correlate the feedback with an object - * in the customer's own system. Not unique and does not provide - * idempotency. Should not contain sensitive information. - */ - clientReference?: string; - actor?: Corti.FeedbackActor; -} diff --git a/src/api/types/FeedbackRating.ts b/src/api/types/FeedbackRating.ts deleted file mode 100644 index 3c27151a..00000000 --- a/src/api/types/FeedbackRating.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * The original rating supplied by the customer. - */ -export interface FeedbackRating { - scale: Corti.FeedbackRatingScale; - /** The rating value on the selected scale. */ - value: number; -} diff --git a/src/api/types/FeedbackRatingScale.ts b/src/api/types/FeedbackRatingScale.ts deleted file mode 100644 index 3685fe8b..00000000 --- a/src/api/types/FeedbackRatingScale.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * The scale on which the rating was collected. - * - `binary` — 0 (negative) or 1 (positive). - * - * Planned (not yet available): `likert5` (integer 1–5), `continuous01` (number 0–1). - */ -export const FeedbackRatingScale = { - Binary: "binary", -} as const; -export type FeedbackRatingScale = (typeof FeedbackRatingScale)[keyof typeof FeedbackRatingScale]; diff --git a/src/api/types/FeedbackResponse.ts b/src/api/types/FeedbackResponse.ts deleted file mode 100644 index a336cc94..00000000 --- a/src/api/types/FeedbackResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A stored feedback resource. - */ -export interface FeedbackResponse { - id: Corti.FeedbackIdValue; - taskId: Corti.CommonTaskIdValue; - rating: Corti.FeedbackRating; - /** - * Corti-derived internal score between 0 and 1. The original scale and - * value are always retained alongside this score. - */ - normalizedScore: number; - /** Structured observations about the result. */ - labels: Corti.FeedbackLabel[]; - /** Free-text explanation of the rating or labels. */ - reason?: string; - target?: Corti.FeedbackTarget; - metadata?: Corti.FeedbackMetadata; - /** When the feedback was created. */ - createdAt?: Date; -} diff --git a/src/api/types/FeedbackTarget.ts b/src/api/types/FeedbackTarget.ts deleted file mode 100644 index 228e9b62..00000000 --- a/src/api/types/FeedbackTarget.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Identifies the specific user-visible response being evaluated. If - * omitted, the feedback applies to the task as a whole. - */ -export interface FeedbackTarget { - messageId: Corti.CommonMessageIdValue; -} diff --git a/src/api/types/RegistryConnectorCapabilities.ts b/src/api/types/RegistryConnectorCapabilities.ts deleted file mode 100644 index 5cc904b6..00000000 --- a/src/api/types/RegistryConnectorCapabilities.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * What the connector can do once attached. - */ -export interface RegistryConnectorCapabilities { - /** Emits incremental updates during a task. */ - streaming?: boolean; - /** Accepted input media types. */ - inputModes?: string[]; - /** Produced output media types. */ - outputModes?: string[]; - /** Names of tools the connector exposes to the agent. */ - tools?: string[]; -} diff --git a/src/api/types/RegistryConnectorListResponse.ts b/src/api/types/RegistryConnectorListResponse.ts deleted file mode 100644 index 05674681..00000000 --- a/src/api/types/RegistryConnectorListResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A page of registry connectors. - */ -export interface RegistryConnectorListResponse { - /** Registry connectors on the current page. */ - connectors: Corti.RegistryConnectorResponse[]; - nextPageToken?: Corti.CommonNextPageToken | null; - totalSize?: Corti.CommonTotalSize; -} diff --git a/src/api/types/RegistryConnectorResponse.ts b/src/api/types/RegistryConnectorResponse.ts deleted file mode 100644 index b4fcbac7..00000000 --- a/src/api/types/RegistryConnectorResponse.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * A discoverable, pre-built connector offered by the platform registry. - * Only `id`, `type`, `name`, `title`, `description`, and `configSchema` are populated by the server today. `version`, `provider`, `capabilities`, `tags`, and `documentationUrl` are declared for forward compatibility but are not yet returned. - */ -export interface RegistryConnectorResponse { - /** Stable, namespaced registry identifier; use as a `registry` connector's `name`. */ - id: string; - /** The connector kind this entry provisions when attached to an agent. */ - type: Corti.CommonConnectorType; - /** Programmatic name (MCP convention). */ - name: string; - /** Human-readable display name (MCP convention). */ - title?: string; - /** Description for list and detail views. May contain CommonMark. */ - description?: string; - /** Latest published version (SemVer recommended). */ - version?: string; - /** Display icons (MCP convention). */ - icons?: Corti.RegistryIcon[]; - /** Name of the publishing organisation. */ - provider?: string; - /** Connector homepage (MCP convention). */ - websiteUrl?: string; - /** Documentation URL for the connector. */ - documentationUrl?: string; - capabilities?: Corti.RegistryConnectorCapabilities; - /** Keywords for search and filtering. */ - tags?: string[]; - /** JSON Schema (draft 2020-12) describing the connector's accepted `config`. */ - configSchema?: Record; -} diff --git a/src/api/types/RegistryIcon.ts b/src/api/types/RegistryIcon.ts deleted file mode 100644 index cfea9234..00000000 --- a/src/api/types/RegistryIcon.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * An icon resource, following the MCP `Icon` shape. - */ -export interface RegistryIcon { - /** Icon source URL. */ - src: string; - /** MIME type of the icon resource. */ - mimeType?: string; - /** `WxH` size hints (e.g. `48x48`), or `any` for scalable icons. */ - sizes?: string[]; -} diff --git a/src/api/types/UsageBucket.ts b/src/api/types/UsageBucket.ts deleted file mode 100644 index 5d9f542a..00000000 --- a/src/api/types/UsageBucket.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * Usage metrics for a single time bucket. - */ -export interface UsageBucket extends Corti.UsageMetrics { - /** Inclusive start of the bucket (UTC). */ - periodStart: Date; - /** Exclusive end of the bucket (UTC). */ - periodEnd: Date; -} diff --git a/src/api/types/UsageGranularity.ts b/src/api/types/UsageGranularity.ts deleted file mode 100644 index 05c67177..00000000 --- a/src/api/types/UsageGranularity.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The size of each usage reporting bucket. Only `day` is currently honored; `minute`, `hour`, and `week` are accepted but produce daily buckets (the server always returns `day`). */ -export const UsageGranularity = { - Minute: "minute", - Hour: "hour", - Day: "day", - Week: "week", -} as const; -export type UsageGranularity = (typeof UsageGranularity)[keyof typeof UsageGranularity]; diff --git a/src/api/types/UsageMetrics.ts b/src/api/types/UsageMetrics.ts deleted file mode 100644 index d10a21ac..00000000 --- a/src/api/types/UsageMetrics.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Invocation metrics for a single period. - */ -export interface UsageMetrics { - /** Number of agent invocations in the period. */ - invocations: number; - /** Number of distinct contexts invoked in the period. */ - uniqueContexts: number; -} diff --git a/src/api/types/UsageReportResponse.ts b/src/api/types/UsageReportResponse.ts deleted file mode 100644 index 117bfc7b..00000000 --- a/src/api/types/UsageReportResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../index.js"; - -/** - * An agent's bucketed usage over a date range, with range-wide totals. - */ -export interface UsageReportResponse { - granularity: Corti.UsageGranularity; - /** Resolved inclusive start of the range (UTC). */ - from: Date; - /** Resolved exclusive end of the range (UTC). */ - to: Date; - /** Aggregate metrics across the whole range. */ - totals: Corti.UsageMetrics; - /** One entry per period with activity, ordered oldest first. */ - buckets: Corti.UsageBucket[]; -} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 2ffaffbc..7ce73b9e 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,17 +1,3 @@ -export * from "./A2AjsonrpcResponse.js"; -export * from "./A2AjsonrpcResponseError.js"; -export * from "./A2AjsonrpcResponseId.js"; -export * from "./A2ASendMessageConfiguration.js"; -export * from "./A2ASendMessageRequest.js"; -export * from "./A2ASendMessageResponse.js"; -export * from "./A2AStreamEventResponse.js"; -export * from "./AgentCardResponse.js"; -export * from "./AgentCardResponseCapabilities.js"; -export * from "./AgentCardResponseProvider.js"; -export * from "./AgentCardResponseSignaturesItem.js"; -export * from "./AgentCardResponseSkillsItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; export * from "./AgentsAgent.js"; export * from "./AgentsAgentCapabilities.js"; export * from "./AgentsAgentCard.js"; @@ -45,9 +31,6 @@ export * from "./AgentsFilePartFile.js"; export * from "./AgentsFilePartKind.js"; export * from "./AgentsFileWithBytes.js"; export * from "./AgentsFileWithUri.js"; -export * from "./AgentsLabels.js"; -export * from "./AgentsLifecycle.js"; -export * from "./AgentsListResponse.js"; export * from "./AgentsMcpServer.js"; export * from "./AgentsMcpServerAuthorizationType.js"; export * from "./AgentsMcpServerTransportType.js"; @@ -62,7 +45,6 @@ export * from "./AgentsRegistryExpert.js"; export * from "./AgentsRegistryExpertsResponse.js"; export * from "./AgentsRegistryMcpServer.js"; export * from "./AgentsRegistryMcpServerAuthorizationType.js"; -export * from "./AgentsResponse.js"; export * from "./AgentsTask.js"; export * from "./AgentsTaskKind.js"; export * from "./AgentsTaskStatus.js"; @@ -70,8 +52,6 @@ export * from "./AgentsTaskStatusState.js"; export * from "./AgentsTextPart.js"; export * from "./AgentsTextPartKind.js"; export * from "./AgentsUpdateExpertReference.js"; -export * from "./AgentsUserIdValue.js"; -export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -83,67 +63,20 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; -export * from "./CommonA2AConnector.js"; -export * from "./CommonA2AConnectorCreate.js"; -export * from "./CommonAgentConnector.js"; -export * from "./CommonAgentConnectorCreate.js"; -export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; -export * from "./CommonArtifactIdValue.js"; -export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; -export * from "./CommonConnectorAuth.js"; -export * from "./CommonConnectorAuthType.js"; -export * from "./CommonConnectorCreateRequest.js"; -export * from "./CommonConnectorIdValue.js"; -export * from "./CommonConnectorResponse.js"; -export * from "./CommonConnectorType.js"; -export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; -export * from "./CommonErrorResponse.js"; -export * from "./CommonErrorResponseError.js"; -export * from "./CommonErrorResponseErrorDetails.js"; -export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; -export * from "./CommonMcpConnector.js"; -export * from "./CommonMcpConnectorCreate.js"; -export * from "./CommonMessage.js"; -export * from "./CommonMessageIdValue.js"; -export * from "./CommonNextPageToken.js"; -export * from "./CommonPart.js"; -export * from "./CommonRegistryConnectorCreate.js"; -export * from "./CommonRegistryConnectorProvisioned.js"; -export * from "./CommonRole.js"; -export * from "./CommonSchemaConnector.js"; -export * from "./CommonSchemaConnectorCreate.js"; -export * from "./CommonSchemaConnectorCreateTransition.js"; -export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; -export * from "./CommonTaskIdValue.js"; -export * from "./CommonTaskListResponse.js"; -export * from "./CommonTaskMetadata.js"; -export * from "./CommonTaskResponse.js"; -export * from "./CommonTaskState.js"; -export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; -export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; -export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; -export * from "./ConnectorsListResponse.js"; -export * from "./Contexts.js"; -export * from "./ContextsDetailResponse.js"; -export * from "./ContextsListResponse.js"; -export * from "./ContextsOpenInferenceSpan.js"; -export * from "./ContextsTraceItem.js"; -export * from "./ContextsTraceItemTrace.js"; -export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -179,15 +112,6 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; -export * from "./FeedbackActor.js"; -export * from "./FeedbackIdValue.js"; -export * from "./FeedbackLabel.js"; -export * from "./FeedbackListResponse.js"; -export * from "./FeedbackMetadata.js"; -export * from "./FeedbackRating.js"; -export * from "./FeedbackRatingScale.js"; -export * from "./FeedbackResponse.js"; -export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -263,10 +187,6 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; -export * from "./RegistryConnectorCapabilities.js"; -export * from "./RegistryConnectorListResponse.js"; -export * from "./RegistryConnectorResponse.js"; -export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -353,8 +273,4 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; -export * from "./UsageBucket.js"; -export * from "./UsageGranularity.js"; -export * from "./UsageMetrics.js"; -export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/src/core/index.ts b/src/core/index.ts index ede84012..e2aca287 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -6,7 +6,6 @@ export * as logging from "./logging/index.js"; export * from "./pagination/index.js"; export * from "./runtime/index.js"; export * as serialization from "./schemas/index.js"; -export * from "./stream/index.js"; export * as url from "./url/index.js"; export * from "./utils/index.js"; export * from "./websocket/index.js"; diff --git a/src/core/stream/Stream.ts b/src/core/stream/Stream.ts deleted file mode 100644 index 8ccdecf9..00000000 --- a/src/core/stream/Stream.ts +++ /dev/null @@ -1,235 +0,0 @@ -import { fromJson } from "../json.js"; -import { RUNTIME } from "../runtime/index.js"; - -export declare namespace Stream { - interface Args { - /** - * The HTTP response stream to read from. - */ - - stream: ReadableStream; - - /** - * The event shape to use for parsing the stream data. - */ - eventShape: JsonEvent | SseEvent; - /** - * An abort signal to stop the stream. - */ - signal?: AbortSignal; - } - - interface JsonEvent { - type: "json"; - messageTerminator: string; - } - - interface SseEvent { - type: "sse"; - streamTerminator?: string; - eventDiscriminator?: string; - } -} - -const DATA_PREFIX = "data:"; -const EVENT_PREFIX = "event:"; - -export class Stream implements AsyncIterable { - private stream: ReadableStream; - - private parse: (val: unknown) => Promise; - /** - * The prefix to use for each message. For example, - * for SSE, the prefix is "data: ". - */ - private prefix: string | undefined; - private messageTerminator: string; - private streamTerminator: string | undefined; - private eventDiscriminator: string | undefined; - private controller: AbortController = new AbortController(); - private decoder: TextDecoder | undefined; - - constructor({ stream, parse, eventShape, signal }: Stream.Args & { parse: (val: unknown) => Promise }) { - this.stream = stream; - this.parse = parse; - if (eventShape.type === "sse") { - this.prefix = DATA_PREFIX; - this.messageTerminator = "\n"; - this.streamTerminator = eventShape.streamTerminator; - this.eventDiscriminator = eventShape.eventDiscriminator; - } else { - this.messageTerminator = eventShape.messageTerminator; - } - signal?.addEventListener("abort", () => this.controller.abort()); - - // Initialize shared TextDecoder - if (typeof TextDecoder !== "undefined") { - this.decoder = new TextDecoder("utf-8"); - } - } - - private async *iterMessages(): AsyncGenerator { - if (this.eventDiscriminator != null) { - yield* this.iterSseEvents(); - } else { - yield* this.iterDataMessages(); - } - } - - private async *iterDataMessages(): AsyncGenerator { - const stream = readableStreamAsyncIterable(this.stream); - let buf = ""; - let prefixSeen = false; - for await (const chunk of stream) { - buf += this.decodeChunk(chunk); - - let terminatorIndex: number; - while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) { - let line = buf.slice(0, terminatorIndex); - buf = buf.slice(terminatorIndex + this.messageTerminator.length); - - if (!line.trim()) { - continue; - } - - if (!prefixSeen && this.prefix != null) { - const prefixIndex = line.indexOf(this.prefix); - if (prefixIndex === -1) { - continue; - } - prefixSeen = true; - line = line.slice(prefixIndex + this.prefix.length); - } - - if (this.streamTerminator != null && line.includes(this.streamTerminator)) { - return; - } - const message = await this.parse(fromJson(line)); - yield message; - prefixSeen = false; - } - } - } - - private async *iterSseEvents(): AsyncGenerator { - const stream = readableStreamAsyncIterable(this.stream); - let buf = ""; - let eventType: string | undefined; - let dataValue: string | undefined; - - for await (const chunk of stream) { - buf += this.decodeChunk(chunk); - - let terminatorIndex: number; - while ((terminatorIndex = buf.indexOf("\n")) >= 0) { - const line = buf.slice(0, terminatorIndex).replace(/\r$/, ""); - buf = buf.slice(terminatorIndex + 1); - - if (!line.trim()) { - if (dataValue != null) { - const message = await this.dispatchSseEvent(dataValue, eventType); - if (message == null) { - return; - } - yield message; - } - eventType = undefined; - dataValue = undefined; - continue; - } - - if (line.startsWith(EVENT_PREFIX)) { - eventType = line.slice(EVENT_PREFIX.length).trim(); - } else if (line.startsWith(DATA_PREFIX)) { - const val = line.slice(DATA_PREFIX.length).trim(); - dataValue = dataValue != null ? `${dataValue}\n${val}` : val; - } - } - } - - if (dataValue != null) { - const message = await this.dispatchSseEvent(dataValue, eventType); - if (message != null) { - yield message; - } - } - } - - /** - * Parses and returns a single SSE event, or returns null if the event is a stream terminator. - */ - private async dispatchSseEvent(dataValue: string, eventType: string | undefined): Promise { - if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) { - return null; - } - return this.parse(this.injectDiscriminator(fromJson(dataValue), eventType)); - } - - private injectDiscriminator(parsed: unknown, eventType: string | undefined): unknown { - if (this.eventDiscriminator == null || eventType == null) { - return parsed; - } - if (parsed == null || typeof parsed !== "object" || Array.isArray(parsed)) { - return parsed; - } - const obj = parsed as Record; - if (this.eventDiscriminator in obj) { - return parsed; - } - return { [this.eventDiscriminator]: eventType, ...obj }; - } - - async *[Symbol.asyncIterator](): AsyncIterator { - for await (const message of this.iterMessages()) { - yield message; - } - } - - private decodeChunk(chunk: any): string { - let decoded = ""; - // If TextDecoder is available, use the streaming decoder instance - if (this.decoder != null) { - decoded += this.decoder.decode(chunk, { stream: true }); - } - // Buffer is present in Node.js environment - else if (RUNTIME.type === "node" && typeof chunk !== "undefined") { - decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); - } - return decoded; - } -} - -/** - * Browser polyfill for ReadableStream - */ -// biome-ignore lint/suspicious/noExplicitAny: allow explicit any -export function readableStreamAsyncIterable(stream: any): AsyncIterableIterator { - if (stream[Symbol.asyncIterator]) { - return stream; - } - - const reader = stream.getReader(); - return { - async next() { - try { - const result = await reader.read(); - if (result?.done) { - reader.releaseLock(); - } // release lock when stream becomes closed - return result; - } catch (e) { - reader.releaseLock(); // release lock when stream becomes errored - throw e; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: undefined }; - }, - [Symbol.asyncIterator]() { - return this; - }, - }; -} diff --git a/src/core/stream/index.ts b/src/core/stream/index.ts deleted file mode 100644 index 4e28b34b..00000000 --- a/src/core/stream/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Stream } from "./Stream.js"; diff --git a/src/serialization/resources/agentic/client/index.ts b/src/serialization/resources/agentic/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts deleted file mode 100644 index 20e0706e..00000000 --- a/src/serialization/resources/agentic/client/requests/AgentsCreateRequest.ts +++ /dev/null @@ -1,36 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import type * as serializers from "../../../../index.js"; -import { AgentsLabels } from "../../../../types/AgentsLabels.js"; -import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; -import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; -import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; - -export const AgentsCreateRequest: core.serialization.Schema< - serializers.AgentsCreateRequest.Raw, - Corti.AgentsCreateRequest -> = core.serialization.object({ - name: core.serialization.string(), - description: core.serialization.string().optional(), - systemPrompt: core.serialization.string().optional(), - model: core.serialization.string().optional(), - visibility: AgentsVisibility.optional(), - lifecycle: AgentsLifecycle.optional(), - connectors: core.serialization.list(CommonConnectorCreateRequest).optional(), - labels: AgentsLabels.optional(), -}); - -export declare namespace AgentsCreateRequest { - export interface Raw { - name: string; - description?: string | null; - systemPrompt?: string | null; - model?: string | null; - visibility?: AgentsVisibility.Raw | null; - lifecycle?: AgentsLifecycle.Raw | null; - connectors?: CommonConnectorCreateRequest.Raw[] | null; - labels?: AgentsLabels.Raw | null; - } -} diff --git a/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts b/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts deleted file mode 100644 index 0eb9f11e..00000000 --- a/src/serialization/resources/agentic/client/requests/AgentsPatchRequest.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../api/index.js"; -import * as core from "../../../../../core/index.js"; -import type * as serializers from "../../../../index.js"; -import { AgentsLifecycle } from "../../../../types/AgentsLifecycle.js"; -import { AgentsVisibility } from "../../../../types/AgentsVisibility.js"; -import { CommonConnectorCreateRequest } from "../../../../types/CommonConnectorCreateRequest.js"; - -export const AgentsPatchRequest: core.serialization.Schema< - serializers.AgentsPatchRequest.Raw, - Corti.AgentsPatchRequest -> = core.serialization.object({ - name: core.serialization.string().optional(), - description: core.serialization.string().optionalNullable(), - systemPrompt: core.serialization.string().optionalNullable(), - model: core.serialization.string().optionalNullable(), - visibility: AgentsVisibility.optional(), - lifecycle: AgentsLifecycle.optional(), - connectors: core.serialization.list(CommonConnectorCreateRequest).optionalNullable(), - labels: core.serialization - .record(core.serialization.string(), core.serialization.string().nullable()) - .optionalNullable(), -}); - -export declare namespace AgentsPatchRequest { - export interface Raw { - name?: string | null; - description?: (string | null | undefined) | null; - systemPrompt?: (string | null | undefined) | null; - model?: (string | null | undefined) | null; - visibility?: AgentsVisibility.Raw | null; - lifecycle?: AgentsLifecycle.Raw | null; - connectors?: (CommonConnectorCreateRequest.Raw[] | null | undefined) | null; - labels?: (Record | null | undefined) | null; - } -} diff --git a/src/serialization/resources/agentic/client/requests/index.ts b/src/serialization/resources/agentic/client/requests/index.ts deleted file mode 100644 index d89fef23..00000000 --- a/src/serialization/resources/agentic/client/requests/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { AgentsCreateRequest } from "./AgentsCreateRequest.js"; -export { AgentsPatchRequest } from "./AgentsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/index.ts b/src/serialization/resources/agentic/index.ts deleted file mode 100644 index 9eb1192d..00000000 --- a/src/serialization/resources/agentic/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./resources/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/client/index.ts b/src/serialization/resources/agentic/resources/a2A/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/resources/a2A/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts deleted file mode 100644 index 9828ab57..00000000 --- a/src/serialization/resources/agentic/resources/a2A/client/requests/A2AjsonrpcRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../../api/index.js"; -import * as core from "../../../../../../../core/index.js"; -import type * as serializers from "../../../../../../index.js"; -import { A2AjsonrpcRequestId } from "../../types/A2AjsonrpcRequestId.js"; -import { A2AjsonrpcRequestMethod } from "../../types/A2AjsonrpcRequestMethod.js"; - -export const A2AjsonrpcRequest: core.serialization.Schema< - serializers.agentic.A2AjsonrpcRequest.Raw, - Corti.agentic.A2AjsonrpcRequest -> = core.serialization.object({ - id: A2AjsonrpcRequestId, - method: A2AjsonrpcRequestMethod, - params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace A2AjsonrpcRequest { - export interface Raw { - id: A2AjsonrpcRequestId.Raw; - method: A2AjsonrpcRequestMethod.Raw; - params?: Record | null; - } -} diff --git a/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts b/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts deleted file mode 100644 index 0d1476bd..00000000 --- a/src/serialization/resources/agentic/resources/a2A/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { A2AjsonrpcRequest } from "./A2AjsonrpcRequest.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/index.ts b/src/serialization/resources/agentic/resources/a2A/index.ts deleted file mode 100644 index d9adb1af..00000000 --- a/src/serialization/resources/agentic/resources/a2A/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./client/index.js"; -export * from "./types/index.js"; diff --git a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts deleted file mode 100644 index 5abc99c8..00000000 --- a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../api/index.js"; -import * as core from "../../../../../../core/index.js"; -import type * as serializers from "../../../../../index.js"; - -export const A2AjsonrpcRequestId: core.serialization.Schema< - serializers.agentic.A2AjsonrpcRequestId.Raw, - Corti.agentic.A2AjsonrpcRequestId -> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); - -export declare namespace A2AjsonrpcRequestId { - export type Raw = string | number; -} diff --git a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts b/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts deleted file mode 100644 index ed080991..00000000 --- a/src/serialization/resources/agentic/resources/a2A/types/A2AjsonrpcRequestMethod.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../api/index.js"; -import * as core from "../../../../../../core/index.js"; -import type * as serializers from "../../../../../index.js"; - -export const A2AjsonrpcRequestMethod: core.serialization.Schema< - serializers.agentic.A2AjsonrpcRequestMethod.Raw, - Corti.agentic.A2AjsonrpcRequestMethod -> = core.serialization.enum_([ - "SendMessage", - "SendStreamingMessage", - "GetTask", - "ListTasks", - "CancelTask", - "SubscribeToTask", -]); - -export declare namespace A2AjsonrpcRequestMethod { - export type Raw = - | "SendMessage" - | "SendStreamingMessage" - | "GetTask" - | "ListTasks" - | "CancelTask" - | "SubscribeToTask"; -} diff --git a/src/serialization/resources/agentic/resources/a2A/types/index.ts b/src/serialization/resources/agentic/resources/a2A/types/index.ts deleted file mode 100644 index d506c662..00000000 --- a/src/serialization/resources/agentic/resources/a2A/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./A2AjsonrpcRequestId.js"; -export * from "./A2AjsonrpcRequestMethod.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/index.ts b/src/serialization/resources/agentic/resources/connectors/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/resources/connectors/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts deleted file mode 100644 index 95949c28..00000000 --- a/src/serialization/resources/agentic/resources/connectors/client/requests/ConnectorsPatchRequest.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../../api/index.js"; -import * as core from "../../../../../../../core/index.js"; -import type * as serializers from "../../../../../../index.js"; -import { CommonConnectorAuth } from "../../../../../../types/CommonConnectorAuth.js"; - -export const ConnectorsPatchRequest: core.serialization.Schema< - serializers.agentic.ConnectorsPatchRequest.Raw, - Corti.agentic.ConnectorsPatchRequest -> = core.serialization.object({ - enabled: core.serialization.boolean().optional(), - name: core.serialization.string().optional(), - url: core.serialization.string().optionalNullable(), - config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), - auth: CommonConnectorAuth.optionalNullable(), -}); - -export declare namespace ConnectorsPatchRequest { - export interface Raw { - enabled?: boolean | null; - name?: string | null; - url?: (string | null | undefined) | null; - config?: (Record | null | undefined) | null; - auth?: (CommonConnectorAuth.Raw | null | undefined) | null; - } -} diff --git a/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts b/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts deleted file mode 100644 index fd257b20..00000000 --- a/src/serialization/resources/agentic/resources/connectors/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ConnectorsPatchRequest } from "./ConnectorsPatchRequest.js"; diff --git a/src/serialization/resources/agentic/resources/connectors/index.ts b/src/serialization/resources/agentic/resources/connectors/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/serialization/resources/agentic/resources/connectors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/client/index.ts b/src/serialization/resources/agentic/resources/feedback/client/index.ts deleted file mode 100644 index 195f9aa8..00000000 --- a/src/serialization/resources/agentic/resources/feedback/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests/index.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts deleted file mode 100644 index 81438c6a..00000000 --- a/src/serialization/resources/agentic/resources/feedback/client/requests/FeedbackCreateRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../../../../../../api/index.js"; -import * as core from "../../../../../../../core/index.js"; -import type * as serializers from "../../../../../../index.js"; -import { FeedbackLabel } from "../../../../../../types/FeedbackLabel.js"; -import { FeedbackMetadata } from "../../../../../../types/FeedbackMetadata.js"; -import { FeedbackRating } from "../../../../../../types/FeedbackRating.js"; -import { FeedbackTarget } from "../../../../../../types/FeedbackTarget.js"; - -export const FeedbackCreateRequest: core.serialization.Schema< - serializers.agentic.FeedbackCreateRequest.Raw, - Corti.agentic.FeedbackCreateRequest -> = core.serialization.object({ - rating: FeedbackRating, - labels: core.serialization.list(FeedbackLabel).optional(), - reason: core.serialization.string().optional(), - target: FeedbackTarget.optional(), - metadata: FeedbackMetadata.optional(), -}); - -export declare namespace FeedbackCreateRequest { - export interface Raw { - rating: FeedbackRating.Raw; - labels?: FeedbackLabel.Raw[] | null; - reason?: string | null; - target?: FeedbackTarget.Raw | null; - metadata?: FeedbackMetadata.Raw | null; - } -} diff --git a/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts b/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts deleted file mode 100644 index f8353681..00000000 --- a/src/serialization/resources/agentic/resources/feedback/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { FeedbackCreateRequest } from "./FeedbackCreateRequest.js"; diff --git a/src/serialization/resources/agentic/resources/feedback/index.ts b/src/serialization/resources/agentic/resources/feedback/index.ts deleted file mode 100644 index 914b8c3c..00000000 --- a/src/serialization/resources/agentic/resources/feedback/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client/index.js"; diff --git a/src/serialization/resources/agentic/resources/index.ts b/src/serialization/resources/agentic/resources/index.ts deleted file mode 100644 index 3165166f..00000000 --- a/src/serialization/resources/agentic/resources/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./a2A/client/requests/index.js"; -export * as a2A from "./a2A/index.js"; -export * from "./a2A/types/index.js"; -export * from "./connectors/client/requests/index.js"; -export * as connectors from "./connectors/index.js"; -export * from "./feedback/client/requests/index.js"; -export * as feedback from "./feedback/index.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index c3ebce10..c2b155f9 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,5 +1,3 @@ -export * from "./agentic/client/requests/index.js"; -export * as agentic from "./agentic/index.js"; export * from "./agents/client/requests/index.js"; export * as agents from "./agents/index.js"; export * from "./agents/types/index.js"; diff --git a/src/serialization/types/A2ASendMessageConfiguration.ts b/src/serialization/types/A2ASendMessageConfiguration.ts deleted file mode 100644 index 8ce31b82..00000000 --- a/src/serialization/types/A2ASendMessageConfiguration.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2ASendMessageConfiguration: core.serialization.ObjectSchema< - serializers.A2ASendMessageConfiguration.Raw, - Corti.A2ASendMessageConfiguration -> = core.serialization.object({ - returnImmediately: core.serialization.boolean().optional(), - historyLength: core.serialization.number().optional(), - acceptedOutputModes: core.serialization.list(core.serialization.string()).optional(), -}); - -export declare namespace A2ASendMessageConfiguration { - export interface Raw { - returnImmediately?: boolean | null; - historyLength?: number | null; - acceptedOutputModes?: string[] | null; - } -} diff --git a/src/serialization/types/A2ASendMessageRequest.ts b/src/serialization/types/A2ASendMessageRequest.ts deleted file mode 100644 index d29c28b3..00000000 --- a/src/serialization/types/A2ASendMessageRequest.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { A2ASendMessageConfiguration } from "./A2ASendMessageConfiguration.js"; -import { CommonMessage } from "./CommonMessage.js"; - -export const A2ASendMessageRequest: core.serialization.ObjectSchema< - serializers.A2ASendMessageRequest.Raw, - Corti.A2ASendMessageRequest -> = core.serialization.object({ - message: CommonMessage, - configuration: A2ASendMessageConfiguration.optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - tenant: core.serialization.string().optional(), -}); - -export declare namespace A2ASendMessageRequest { - export interface Raw { - message: CommonMessage.Raw; - configuration?: A2ASendMessageConfiguration.Raw | null; - metadata?: Record | null; - tenant?: string | null; - } -} diff --git a/src/serialization/types/A2ASendMessageResponse.ts b/src/serialization/types/A2ASendMessageResponse.ts deleted file mode 100644 index 56e39b4a..00000000 --- a/src/serialization/types/A2ASendMessageResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2ASendMessageResponse: core.serialization.Schema< - serializers.A2ASendMessageResponse.Raw, - Corti.A2ASendMessageResponse -> = core.serialization.undiscriminatedUnion([core.serialization.unknown()]); - -export declare namespace A2ASendMessageResponse { - export type Raw = unknown; -} diff --git a/src/serialization/types/A2AStreamEventResponse.ts b/src/serialization/types/A2AStreamEventResponse.ts deleted file mode 100644 index 73657388..00000000 --- a/src/serialization/types/A2AStreamEventResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2AStreamEventResponse: core.serialization.ObjectSchema< - serializers.A2AStreamEventResponse.Raw, - Corti.A2AStreamEventResponse -> = core.serialization.object({ - data: core.serialization.string().optional(), - event: core.serialization.string().optional(), - id: core.serialization.string().optional(), - retry: core.serialization.number().optional(), -}); - -export declare namespace A2AStreamEventResponse { - export interface Raw { - data?: string | null; - event?: string | null; - id?: string | null; - retry?: number | null; - } -} diff --git a/src/serialization/types/A2AjsonrpcResponse.ts b/src/serialization/types/A2AjsonrpcResponse.ts deleted file mode 100644 index 1192314a..00000000 --- a/src/serialization/types/A2AjsonrpcResponse.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { A2AjsonrpcResponseError } from "./A2AjsonrpcResponseError.js"; -import { A2AjsonrpcResponseId } from "./A2AjsonrpcResponseId.js"; - -export const A2AjsonrpcResponse: core.serialization.ObjectSchema< - serializers.A2AjsonrpcResponse.Raw, - Corti.A2AjsonrpcResponse -> = core.serialization.object({ - jsonrpc: core.serialization.stringLiteral("2.0"), - id: A2AjsonrpcResponseId.nullable(), - result: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - error: A2AjsonrpcResponseError.optional(), -}); - -export declare namespace A2AjsonrpcResponse { - export interface Raw { - jsonrpc: "2.0"; - id?: A2AjsonrpcResponseId.Raw | null; - result?: Record | null; - error?: A2AjsonrpcResponseError.Raw | null; - } -} diff --git a/src/serialization/types/A2AjsonrpcResponseError.ts b/src/serialization/types/A2AjsonrpcResponseError.ts deleted file mode 100644 index a5c9e8ee..00000000 --- a/src/serialization/types/A2AjsonrpcResponseError.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2AjsonrpcResponseError: core.serialization.ObjectSchema< - serializers.A2AjsonrpcResponseError.Raw, - Corti.A2AjsonrpcResponseError -> = core.serialization.object({ - code: core.serialization.number(), - message: core.serialization.string(), - data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace A2AjsonrpcResponseError { - export interface Raw { - code: number; - message: string; - data?: Record | null; - } -} diff --git a/src/serialization/types/A2AjsonrpcResponseId.ts b/src/serialization/types/A2AjsonrpcResponseId.ts deleted file mode 100644 index 86944630..00000000 --- a/src/serialization/types/A2AjsonrpcResponseId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const A2AjsonrpcResponseId: core.serialization.Schema< - serializers.A2AjsonrpcResponseId.Raw, - Corti.A2AjsonrpcResponseId -> = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number()]); - -export declare namespace A2AjsonrpcResponseId { - export type Raw = string | number; -} diff --git a/src/serialization/types/AgentCardResponse.ts b/src/serialization/types/AgentCardResponse.ts deleted file mode 100644 index febe4c51..00000000 --- a/src/serialization/types/AgentCardResponse.ts +++ /dev/null @@ -1,51 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentCardResponseCapabilities } from "./AgentCardResponseCapabilities.js"; -import { AgentCardResponseProvider } from "./AgentCardResponseProvider.js"; -import { AgentCardResponseSignaturesItem } from "./AgentCardResponseSignaturesItem.js"; -import { AgentCardResponseSkillsItem } from "./AgentCardResponseSkillsItem.js"; -import { AgentCardResponseSupportedInterfacesItem } from "./AgentCardResponseSupportedInterfacesItem.js"; - -export const AgentCardResponse: core.serialization.ObjectSchema< - serializers.AgentCardResponse.Raw, - Corti.AgentCardResponse -> = core.serialization.object({ - name: core.serialization.string(), - description: core.serialization.string().optional(), - documentationUrl: core.serialization.string().optional(), - iconUrl: core.serialization.string().optional(), - version: core.serialization.string(), - capabilities: AgentCardResponseCapabilities, - defaultInputModes: core.serialization.list(core.serialization.string()).optional(), - defaultOutputModes: core.serialization.list(core.serialization.string()).optional(), - provider: AgentCardResponseProvider.optional(), - securityRequirements: core.serialization - .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) - .optional(), - securitySchemes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - signatures: core.serialization.list(AgentCardResponseSignaturesItem).optional(), - skills: core.serialization.list(AgentCardResponseSkillsItem).optional(), - supportedInterfaces: core.serialization.list(AgentCardResponseSupportedInterfacesItem), -}); - -export declare namespace AgentCardResponse { - export interface Raw { - name: string; - description?: string | null; - documentationUrl?: string | null; - iconUrl?: string | null; - version: string; - capabilities: AgentCardResponseCapabilities.Raw; - defaultInputModes?: string[] | null; - defaultOutputModes?: string[] | null; - provider?: AgentCardResponseProvider.Raw | null; - securityRequirements?: Record[] | null; - securitySchemes?: Record | null; - signatures?: AgentCardResponseSignaturesItem.Raw[] | null; - skills?: AgentCardResponseSkillsItem.Raw[] | null; - supportedInterfaces: AgentCardResponseSupportedInterfacesItem.Raw[]; - } -} diff --git a/src/serialization/types/AgentCardResponseCapabilities.ts b/src/serialization/types/AgentCardResponseCapabilities.ts deleted file mode 100644 index cba74d0f..00000000 --- a/src/serialization/types/AgentCardResponseCapabilities.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseCapabilities: core.serialization.ObjectSchema< - serializers.AgentCardResponseCapabilities.Raw, - Corti.AgentCardResponseCapabilities -> = core.serialization.object({ - streaming: core.serialization.boolean().optional(), - pushNotifications: core.serialization.boolean().optional(), -}); - -export declare namespace AgentCardResponseCapabilities { - export interface Raw { - streaming?: boolean | null; - pushNotifications?: boolean | null; - } -} diff --git a/src/serialization/types/AgentCardResponseProvider.ts b/src/serialization/types/AgentCardResponseProvider.ts deleted file mode 100644 index fb0d635e..00000000 --- a/src/serialization/types/AgentCardResponseProvider.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseProvider: core.serialization.ObjectSchema< - serializers.AgentCardResponseProvider.Raw, - Corti.AgentCardResponseProvider -> = core.serialization.object({ - organization: core.serialization.string().optional(), - url: core.serialization.string().optional(), -}); - -export declare namespace AgentCardResponseProvider { - export interface Raw { - organization?: string | null; - url?: string | null; - } -} diff --git a/src/serialization/types/AgentCardResponseSignaturesItem.ts b/src/serialization/types/AgentCardResponseSignaturesItem.ts deleted file mode 100644 index c86627a0..00000000 --- a/src/serialization/types/AgentCardResponseSignaturesItem.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseSignaturesItem: core.serialization.ObjectSchema< - serializers.AgentCardResponseSignaturesItem.Raw, - Corti.AgentCardResponseSignaturesItem -> = core.serialization.object({ - protected: core.serialization.string(), - header: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - signature: core.serialization.string(), -}); - -export declare namespace AgentCardResponseSignaturesItem { - export interface Raw { - protected: string; - header?: Record | null; - signature: string; - } -} diff --git a/src/serialization/types/AgentCardResponseSkillsItem.ts b/src/serialization/types/AgentCardResponseSkillsItem.ts deleted file mode 100644 index 839caaa2..00000000 --- a/src/serialization/types/AgentCardResponseSkillsItem.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseSkillsItem: core.serialization.ObjectSchema< - serializers.AgentCardResponseSkillsItem.Raw, - Corti.AgentCardResponseSkillsItem -> = core.serialization.object({ - id: core.serialization.string(), - name: core.serialization.string(), - description: core.serialization.string().optional(), - tags: core.serialization.list(core.serialization.string()).optional(), -}); - -export declare namespace AgentCardResponseSkillsItem { - export interface Raw { - id: string; - name: string; - description?: string | null; - tags?: string[] | null; - } -} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts deleted file mode 100644 index b9ce417c..00000000 --- a/src/serialization/types/AgentCardResponseSupportedInterfacesItem.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentCardResponseSupportedInterfacesItemProtocolBinding } from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; - -export const AgentCardResponseSupportedInterfacesItem: core.serialization.ObjectSchema< - serializers.AgentCardResponseSupportedInterfacesItem.Raw, - Corti.AgentCardResponseSupportedInterfacesItem -> = core.serialization.object({ - protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding, - protocolVersion: core.serialization.stringLiteral("1.0"), - url: core.serialization.string(), -}); - -export declare namespace AgentCardResponseSupportedInterfacesItem { - export interface Raw { - protocolBinding: AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw; - protocolVersion: "1.0"; - url: string; - } -} diff --git a/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts b/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts deleted file mode 100644 index cd155f3e..00000000 --- a/src/serialization/types/AgentCardResponseSupportedInterfacesItemProtocolBinding.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentCardResponseSupportedInterfacesItemProtocolBinding: core.serialization.Schema< - serializers.AgentCardResponseSupportedInterfacesItemProtocolBinding.Raw, - Corti.AgentCardResponseSupportedInterfacesItemProtocolBinding -> = core.serialization.enum_(["JSONRPC", "HTTP+JSON"]); - -export declare namespace AgentCardResponseSupportedInterfacesItemProtocolBinding { - export type Raw = "JSONRPC" | "HTTP+JSON"; -} diff --git a/src/serialization/types/AgentsLabels.ts b/src/serialization/types/AgentsLabels.ts deleted file mode 100644 index a080d939..00000000 --- a/src/serialization/types/AgentsLabels.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsLabels: core.serialization.Schema = - core.serialization.record(core.serialization.string(), core.serialization.string()); - -export declare namespace AgentsLabels { - export type Raw = Record; -} diff --git a/src/serialization/types/AgentsLifecycle.ts b/src/serialization/types/AgentsLifecycle.ts deleted file mode 100644 index 5993ff67..00000000 --- a/src/serialization/types/AgentsLifecycle.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsLifecycle: core.serialization.Schema = - core.serialization.enum_(["ephemeral", "persistent"]); - -export declare namespace AgentsLifecycle { - export type Raw = "ephemeral" | "persistent"; -} diff --git a/src/serialization/types/AgentsListResponse.ts b/src/serialization/types/AgentsListResponse.ts deleted file mode 100644 index 2027987d..00000000 --- a/src/serialization/types/AgentsListResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsResponse } from "./AgentsResponse.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; - -export const AgentsListResponse: core.serialization.ObjectSchema< - serializers.AgentsListResponse.Raw, - Corti.AgentsListResponse -> = core.serialization.object({ - agents: core.serialization.list(AgentsResponse), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace AgentsListResponse { - export interface Raw { - agents: AgentsResponse.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/AgentsResponse.ts b/src/serialization/types/AgentsResponse.ts deleted file mode 100644 index fe2efda1..00000000 --- a/src/serialization/types/AgentsResponse.ts +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { AgentsLabels } from "./AgentsLabels.js"; -import { AgentsLifecycle } from "./AgentsLifecycle.js"; -import { AgentsUserIdValue } from "./AgentsUserIdValue.js"; -import { AgentsVisibility } from "./AgentsVisibility.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; -import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; - -export const AgentsResponse: core.serialization.ObjectSchema = - core.serialization.object({ - id: CommonAgentIdValue, - name: core.serialization.string(), - description: core.serialization.string().optionalNullable(), - systemPrompt: core.serialization.string().optionalNullable(), - model: core.serialization.string().optionalNullable(), - visibility: AgentsVisibility, - lifecycle: AgentsLifecycle, - connectors: core.serialization.list(CommonConnectorResponse), - labels: AgentsLabels.optional(), - createdAt: core.serialization.date().optional(), - updatedAt: core.serialization.date().optional(), - createdBy: AgentsUserIdValue.optional(), - }); - -export declare namespace AgentsResponse { - export interface Raw { - id: CommonAgentIdValue.Raw; - name: string; - description?: (string | null | undefined) | null; - systemPrompt?: (string | null | undefined) | null; - model?: (string | null | undefined) | null; - visibility: AgentsVisibility.Raw; - lifecycle: AgentsLifecycle.Raw; - connectors: CommonConnectorResponse.Raw[]; - labels?: AgentsLabels.Raw | null; - createdAt?: string | null; - updatedAt?: string | null; - createdBy?: AgentsUserIdValue.Raw | null; - } -} diff --git a/src/serialization/types/AgentsUserIdValue.ts b/src/serialization/types/AgentsUserIdValue.ts deleted file mode 100644 index 6782956b..00000000 --- a/src/serialization/types/AgentsUserIdValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsUserIdValue: core.serialization.Schema = - core.serialization.string(); - -export declare namespace AgentsUserIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/AgentsVisibility.ts b/src/serialization/types/AgentsVisibility.ts deleted file mode 100644 index 9d7fb839..00000000 --- a/src/serialization/types/AgentsVisibility.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const AgentsVisibility: core.serialization.Schema = - core.serialization.enum_(["private", "unlisted", "public"]); - -export declare namespace AgentsVisibility { - export type Raw = "private" | "unlisted" | "public"; -} diff --git a/src/serialization/types/CommonA2AConnector.ts b/src/serialization/types/CommonA2AConnector.ts deleted file mode 100644 index fb899433..00000000 --- a/src/serialization/types/CommonA2AConnector.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonA2AConnector: core.serialization.ObjectSchema< - serializers.CommonA2AConnector.Raw, - Corti.CommonA2AConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("a2a"), - name: core.serialization.string().optional(), - url: core.serialization.string(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonA2AConnector { - export interface Raw { - type: "a2a"; - name?: string | null; - url: string; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonA2AConnectorCreate.ts b/src/serialization/types/CommonA2AConnectorCreate.ts deleted file mode 100644 index 59699d10..00000000 --- a/src/serialization/types/CommonA2AConnectorCreate.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonA2AConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonA2AConnectorCreate.Raw, - Corti.CommonA2AConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("a2a"), - name: core.serialization.string().optional(), - url: core.serialization.string(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonA2AConnectorCreate { - export interface Raw { - type: "a2a"; - name?: string | null; - url: string; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonAgentConnector.ts b/src/serialization/types/CommonAgentConnector.ts deleted file mode 100644 index cb3dca8d..00000000 --- a/src/serialization/types/CommonAgentConnector.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonAgentConnector: core.serialization.ObjectSchema< - serializers.CommonAgentConnector.Raw, - Corti.CommonAgentConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("agent"), - agentId: CommonAgentIdValue, - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonAgentConnector { - export interface Raw { - type: "agent"; - agentId: CommonAgentIdValue.Raw; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonAgentConnectorCreate.ts b/src/serialization/types/CommonAgentConnectorCreate.ts deleted file mode 100644 index b000e3b7..00000000 --- a/src/serialization/types/CommonAgentConnectorCreate.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; - -export const CommonAgentConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonAgentConnectorCreate.Raw, - Corti.CommonAgentConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("agent"), - agentId: CommonAgentIdValue, - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonAgentConnectorCreate { - export interface Raw { - type: "agent"; - agentId: CommonAgentIdValue.Raw; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonAgentIdValue.ts b/src/serialization/types/CommonAgentIdValue.ts deleted file mode 100644 index f722a543..00000000 --- a/src/serialization/types/CommonAgentIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonAgentIdValue: core.serialization.Schema< - serializers.CommonAgentIdValue.Raw, - Corti.CommonAgentIdValue -> = core.serialization.string(); - -export declare namespace CommonAgentIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonArtifactIdValue.ts b/src/serialization/types/CommonArtifactIdValue.ts deleted file mode 100644 index a135e7e2..00000000 --- a/src/serialization/types/CommonArtifactIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonArtifactIdValue: core.serialization.Schema< - serializers.CommonArtifactIdValue.Raw, - Corti.CommonArtifactIdValue -> = core.serialization.string(); - -export declare namespace CommonArtifactIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonArtifactResponse.ts b/src/serialization/types/CommonArtifactResponse.ts deleted file mode 100644 index b2aa8f1f..00000000 --- a/src/serialization/types/CommonArtifactResponse.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonArtifactIdValue } from "./CommonArtifactIdValue.js"; -import { CommonPart } from "./CommonPart.js"; - -export const CommonArtifactResponse: core.serialization.ObjectSchema< - serializers.CommonArtifactResponse.Raw, - Corti.CommonArtifactResponse -> = core.serialization.object({ - artifactId: CommonArtifactIdValue, - name: core.serialization.string().optional(), - description: core.serialization.string().optional(), - extensions: core.serialization.list(core.serialization.string()).optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - parts: core.serialization.list(CommonPart), -}); - -export declare namespace CommonArtifactResponse { - export interface Raw { - artifactId: CommonArtifactIdValue.Raw; - name?: string | null; - description?: string | null; - extensions?: string[] | null; - metadata?: Record | null; - parts: CommonPart.Raw[]; - } -} diff --git a/src/serialization/types/CommonConnectorAuth.ts b/src/serialization/types/CommonConnectorAuth.ts deleted file mode 100644 index da6cc3d9..00000000 --- a/src/serialization/types/CommonConnectorAuth.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorAuthType } from "./CommonConnectorAuthType.js"; - -export const CommonConnectorAuth: core.serialization.ObjectSchema< - serializers.CommonConnectorAuth.Raw, - Corti.CommonConnectorAuth -> = core.serialization.object({ - type: CommonConnectorAuthType, - scope: core.serialization.string().optional(), - redirectUrl: core.serialization.string().optional(), - ref: core.serialization.string().optional(), -}); - -export declare namespace CommonConnectorAuth { - export interface Raw { - type: CommonConnectorAuthType.Raw; - scope?: string | null; - redirectUrl?: string | null; - ref?: string | null; - } -} diff --git a/src/serialization/types/CommonConnectorAuthType.ts b/src/serialization/types/CommonConnectorAuthType.ts deleted file mode 100644 index c9deff12..00000000 --- a/src/serialization/types/CommonConnectorAuthType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonConnectorAuthType: core.serialization.Schema< - serializers.CommonConnectorAuthType.Raw, - Corti.CommonConnectorAuthType -> = core.serialization.enum_(["none", "bearer", "apiKey", "oauth2"]); - -export declare namespace CommonConnectorAuthType { - export type Raw = "none" | "bearer" | "apiKey" | "oauth2"; -} diff --git a/src/serialization/types/CommonConnectorCreateRequest.ts b/src/serialization/types/CommonConnectorCreateRequest.ts deleted file mode 100644 index d95dc3bb..00000000 --- a/src/serialization/types/CommonConnectorCreateRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonA2AConnectorCreate } from "./CommonA2AConnectorCreate.js"; -import { CommonAgentConnectorCreate } from "./CommonAgentConnectorCreate.js"; -import { CommonMcpConnectorCreate } from "./CommonMcpConnectorCreate.js"; -import { CommonRegistryConnectorCreate } from "./CommonRegistryConnectorCreate.js"; -import { CommonSchemaConnectorCreate } from "./CommonSchemaConnectorCreate.js"; - -export const CommonConnectorCreateRequest: core.serialization.Schema< - serializers.CommonConnectorCreateRequest.Raw, - Corti.CommonConnectorCreateRequest -> = core.serialization.undiscriminatedUnion([ - CommonRegistryConnectorCreate, - CommonMcpConnectorCreate, - CommonAgentConnectorCreate, - CommonA2AConnectorCreate, - CommonSchemaConnectorCreate, -]); - -export declare namespace CommonConnectorCreateRequest { - export type Raw = - | CommonRegistryConnectorCreate.Raw - | CommonMcpConnectorCreate.Raw - | CommonAgentConnectorCreate.Raw - | CommonA2AConnectorCreate.Raw - | CommonSchemaConnectorCreate.Raw; -} diff --git a/src/serialization/types/CommonConnectorIdValue.ts b/src/serialization/types/CommonConnectorIdValue.ts deleted file mode 100644 index a87af807..00000000 --- a/src/serialization/types/CommonConnectorIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonConnectorIdValue: core.serialization.Schema< - serializers.CommonConnectorIdValue.Raw, - Corti.CommonConnectorIdValue -> = core.serialization.string(); - -export declare namespace CommonConnectorIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonConnectorResponse.ts b/src/serialization/types/CommonConnectorResponse.ts deleted file mode 100644 index 942e8438..00000000 --- a/src/serialization/types/CommonConnectorResponse.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonA2AConnector } from "./CommonA2AConnector.js"; -import { CommonAgentConnector } from "./CommonAgentConnector.js"; -import { CommonMcpConnector } from "./CommonMcpConnector.js"; -import { CommonRegistryConnectorProvisioned } from "./CommonRegistryConnectorProvisioned.js"; -import { CommonSchemaConnector } from "./CommonSchemaConnector.js"; - -export const CommonConnectorResponse: core.serialization.Schema< - serializers.CommonConnectorResponse.Raw, - Corti.CommonConnectorResponse -> = core.serialization.undiscriminatedUnion([ - CommonRegistryConnectorProvisioned, - CommonMcpConnector, - CommonAgentConnector, - CommonA2AConnector, - CommonSchemaConnector, -]); - -export declare namespace CommonConnectorResponse { - export type Raw = - | CommonRegistryConnectorProvisioned.Raw - | CommonMcpConnector.Raw - | CommonAgentConnector.Raw - | CommonA2AConnector.Raw - | CommonSchemaConnector.Raw; -} diff --git a/src/serialization/types/CommonConnectorType.ts b/src/serialization/types/CommonConnectorType.ts deleted file mode 100644 index fdea4339..00000000 --- a/src/serialization/types/CommonConnectorType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonConnectorType: core.serialization.Schema< - serializers.CommonConnectorType.Raw, - Corti.CommonConnectorType -> = core.serialization.enum_(["registry", "mcp", "agent", "a2a", "schema"]); - -export declare namespace CommonConnectorType { - export type Raw = "registry" | "mcp" | "agent" | "a2a" | "schema"; -} diff --git a/src/serialization/types/CommonContextIdValue.ts b/src/serialization/types/CommonContextIdValue.ts deleted file mode 100644 index 95ab2ae2..00000000 --- a/src/serialization/types/CommonContextIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonContextIdValue: core.serialization.Schema< - serializers.CommonContextIdValue.Raw, - Corti.CommonContextIdValue -> = core.serialization.string(); - -export declare namespace CommonContextIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonErrorResponse.ts b/src/serialization/types/CommonErrorResponse.ts deleted file mode 100644 index ca0e5b74..00000000 --- a/src/serialization/types/CommonErrorResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonErrorResponseError } from "./CommonErrorResponseError.js"; - -export const CommonErrorResponse: core.serialization.ObjectSchema< - serializers.CommonErrorResponse.Raw, - Corti.CommonErrorResponse -> = core.serialization.object({ - error: CommonErrorResponseError, -}); - -export declare namespace CommonErrorResponse { - export interface Raw { - error: CommonErrorResponseError.Raw; - } -} diff --git a/src/serialization/types/CommonErrorResponseError.ts b/src/serialization/types/CommonErrorResponseError.ts deleted file mode 100644 index 4b40f814..00000000 --- a/src/serialization/types/CommonErrorResponseError.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonErrorResponseErrorDetails } from "./CommonErrorResponseErrorDetails.js"; - -export const CommonErrorResponseError: core.serialization.ObjectSchema< - serializers.CommonErrorResponseError.Raw, - Corti.CommonErrorResponseError -> = core.serialization.object({ - code: core.serialization.string(), - message: core.serialization.string(), - howToFix: core.serialization.string().optional(), - details: CommonErrorResponseErrorDetails.optional(), - requestId: core.serialization.string().optional(), -}); - -export declare namespace CommonErrorResponseError { - export interface Raw { - code: string; - message: string; - howToFix?: string | null; - details?: CommonErrorResponseErrorDetails.Raw | null; - requestId?: string | null; - } -} diff --git a/src/serialization/types/CommonErrorResponseErrorDetails.ts b/src/serialization/types/CommonErrorResponseErrorDetails.ts deleted file mode 100644 index 79578cce..00000000 --- a/src/serialization/types/CommonErrorResponseErrorDetails.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonErrorResponseErrorDetailsValidationErrorsItem } from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; - -export const CommonErrorResponseErrorDetails: core.serialization.ObjectSchema< - serializers.CommonErrorResponseErrorDetails.Raw, - Corti.CommonErrorResponseErrorDetails -> = core.serialization - .object({ - validationErrors: core.serialization.list(CommonErrorResponseErrorDetailsValidationErrorsItem).optional(), - }) - .passthrough(); - -export declare namespace CommonErrorResponseErrorDetails { - export interface Raw { - validationErrors?: CommonErrorResponseErrorDetailsValidationErrorsItem.Raw[] | null; - [key: string]: any; - } -} diff --git a/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts b/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts deleted file mode 100644 index 31bf3888..00000000 --- a/src/serialization/types/CommonErrorResponseErrorDetailsValidationErrorsItem.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonErrorResponseErrorDetailsValidationErrorsItem: core.serialization.ObjectSchema< - serializers.CommonErrorResponseErrorDetailsValidationErrorsItem.Raw, - Corti.CommonErrorResponseErrorDetailsValidationErrorsItem -> = core.serialization.object({ - field: core.serialization.string(), - reason: core.serialization.string(), -}); - -export declare namespace CommonErrorResponseErrorDetailsValidationErrorsItem { - export interface Raw { - field: string; - reason: string; - } -} diff --git a/src/serialization/types/CommonMcpConnector.ts b/src/serialization/types/CommonMcpConnector.ts deleted file mode 100644 index 98b38046..00000000 --- a/src/serialization/types/CommonMcpConnector.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonMcpConnector: core.serialization.ObjectSchema< - serializers.CommonMcpConnector.Raw, - Corti.CommonMcpConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("mcp"), - name: core.serialization.string(), - url: core.serialization.string(), - auth: CommonConnectorAuth.optional(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonMcpConnector { - export interface Raw { - type: "mcp"; - name: string; - url: string; - auth?: CommonConnectorAuth.Raw | null; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonMcpConnectorCreate.ts b/src/serialization/types/CommonMcpConnectorCreate.ts deleted file mode 100644 index 6373c7b0..00000000 --- a/src/serialization/types/CommonMcpConnectorCreate.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorAuth } from "./CommonConnectorAuth.js"; - -export const CommonMcpConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonMcpConnectorCreate.Raw, - Corti.CommonMcpConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("mcp"), - name: core.serialization.string(), - url: core.serialization.string(), - enabled: core.serialization.boolean().optional(), - auth: CommonConnectorAuth.optional(), -}); - -export declare namespace CommonMcpConnectorCreate { - export interface Raw { - type: "mcp"; - name: string; - url: string; - enabled?: boolean | null; - auth?: CommonConnectorAuth.Raw | null; - } -} diff --git a/src/serialization/types/CommonMessage.ts b/src/serialization/types/CommonMessage.ts deleted file mode 100644 index ebefe64c..00000000 --- a/src/serialization/types/CommonMessage.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonContextIdValue } from "./CommonContextIdValue.js"; -import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; -import { CommonPart } from "./CommonPart.js"; -import { CommonRole } from "./CommonRole.js"; -import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; - -export const CommonMessage: core.serialization.ObjectSchema = - core.serialization.object({ - messageId: CommonMessageIdValue.optional(), - contextId: CommonContextIdValue.optional(), - taskId: CommonTaskIdValue.optional(), - role: CommonRole, - parts: core.serialization.list(CommonPart), - referenceTaskIds: core.serialization.list(CommonTaskIdValue).optional(), - extensions: core.serialization.list(core.serialization.string()).optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }); - -export declare namespace CommonMessage { - export interface Raw { - messageId?: CommonMessageIdValue.Raw | null; - contextId?: CommonContextIdValue.Raw | null; - taskId?: CommonTaskIdValue.Raw | null; - role: CommonRole.Raw; - parts: CommonPart.Raw[]; - referenceTaskIds?: CommonTaskIdValue.Raw[] | null; - extensions?: string[] | null; - metadata?: Record | null; - } -} diff --git a/src/serialization/types/CommonMessageIdValue.ts b/src/serialization/types/CommonMessageIdValue.ts deleted file mode 100644 index 29d1b310..00000000 --- a/src/serialization/types/CommonMessageIdValue.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonMessageIdValue: core.serialization.Schema< - serializers.CommonMessageIdValue.Raw, - Corti.CommonMessageIdValue -> = core.serialization.string(); - -export declare namespace CommonMessageIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonNextPageToken.ts b/src/serialization/types/CommonNextPageToken.ts deleted file mode 100644 index 75f714c8..00000000 --- a/src/serialization/types/CommonNextPageToken.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonNextPageToken: core.serialization.Schema< - serializers.CommonNextPageToken.Raw, - Corti.CommonNextPageToken -> = core.serialization.string().nullable(); - -export declare namespace CommonNextPageToken { - export type Raw = string | null | undefined; -} diff --git a/src/serialization/types/CommonPart.ts b/src/serialization/types/CommonPart.ts deleted file mode 100644 index 87eed54a..00000000 --- a/src/serialization/types/CommonPart.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonPart: core.serialization.ObjectSchema = - core.serialization - .object({ - text: core.serialization.string().optional(), - data: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - filename: core.serialization.string().optional(), - mediaType: core.serialization.string().optional(), - raw: core.serialization.string().optional(), - url: core.serialization.string().optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - }) - .passthrough(); - -export declare namespace CommonPart { - export interface Raw { - text?: string | null; - data?: Record | null; - filename?: string | null; - mediaType?: string | null; - raw?: string | null; - url?: string | null; - metadata?: Record | null; - [key: string]: any; - } -} diff --git a/src/serialization/types/CommonRegistryConnectorCreate.ts b/src/serialization/types/CommonRegistryConnectorCreate.ts deleted file mode 100644 index 2fc6dc9e..00000000 --- a/src/serialization/types/CommonRegistryConnectorCreate.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonRegistryConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonRegistryConnectorCreate.Raw, - Corti.CommonRegistryConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("registry"), - name: core.serialization.string(), - enabled: core.serialization.boolean().optional(), - config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace CommonRegistryConnectorCreate { - export interface Raw { - type: "registry"; - name: string; - enabled?: boolean | null; - config?: Record | null; - } -} diff --git a/src/serialization/types/CommonRegistryConnectorProvisioned.ts b/src/serialization/types/CommonRegistryConnectorProvisioned.ts deleted file mode 100644 index ebb182db..00000000 --- a/src/serialization/types/CommonRegistryConnectorProvisioned.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; - -export const CommonRegistryConnectorProvisioned: core.serialization.ObjectSchema< - serializers.CommonRegistryConnectorProvisioned.Raw, - Corti.CommonRegistryConnectorProvisioned -> = core.serialization.object({ - type: core.serialization.stringLiteral("registry"), - name: core.serialization.string(), - config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonRegistryConnectorProvisioned { - export interface Raw { - type: "registry"; - name: string; - config?: Record | null; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonRole.ts b/src/serialization/types/CommonRole.ts deleted file mode 100644 index 001aaac7..00000000 --- a/src/serialization/types/CommonRole.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonRole: core.serialization.Schema = - core.serialization.enum_(["ROLE_USER", "ROLE_AGENT"]); - -export declare namespace CommonRole { - export type Raw = "ROLE_USER" | "ROLE_AGENT"; -} diff --git a/src/serialization/types/CommonSchemaConnector.ts b/src/serialization/types/CommonSchemaConnector.ts deleted file mode 100644 index d596f08b..00000000 --- a/src/serialization/types/CommonSchemaConnector.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorIdValue } from "./CommonConnectorIdValue.js"; -import { CommonSchemaConnectorTransition } from "./CommonSchemaConnectorTransition.js"; - -export const CommonSchemaConnector: core.serialization.ObjectSchema< - serializers.CommonSchemaConnector.Raw, - Corti.CommonSchemaConnector -> = core.serialization.object({ - type: core.serialization.stringLiteral("schema"), - name: core.serialization.string(), - description: core.serialization.string().optional(), - schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - transition: CommonSchemaConnectorTransition.optional(), - id: CommonConnectorIdValue.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonSchemaConnector { - export interface Raw { - type: "schema"; - name: string; - description?: string | null; - schema: Record; - transition?: CommonSchemaConnectorTransition.Raw | null; - id?: CommonConnectorIdValue.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonSchemaConnectorCreate.ts b/src/serialization/types/CommonSchemaConnectorCreate.ts deleted file mode 100644 index f37c77b7..00000000 --- a/src/serialization/types/CommonSchemaConnectorCreate.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonSchemaConnectorCreateTransition } from "./CommonSchemaConnectorCreateTransition.js"; - -export const CommonSchemaConnectorCreate: core.serialization.ObjectSchema< - serializers.CommonSchemaConnectorCreate.Raw, - Corti.CommonSchemaConnectorCreate -> = core.serialization.object({ - type: core.serialization.stringLiteral("schema"), - name: core.serialization.string(), - description: core.serialization.string().optional(), - schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - transition: CommonSchemaConnectorCreateTransition.optional(), - enabled: core.serialization.boolean().optional(), -}); - -export declare namespace CommonSchemaConnectorCreate { - export interface Raw { - type: "schema"; - name: string; - description?: string | null; - schema: Record; - transition?: CommonSchemaConnectorCreateTransition.Raw | null; - enabled?: boolean | null; - } -} diff --git a/src/serialization/types/CommonSchemaConnectorCreateTransition.ts b/src/serialization/types/CommonSchemaConnectorCreateTransition.ts deleted file mode 100644 index 9fca7219..00000000 --- a/src/serialization/types/CommonSchemaConnectorCreateTransition.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonSchemaConnectorCreateTransition: core.serialization.Schema< - serializers.CommonSchemaConnectorCreateTransition.Raw, - Corti.CommonSchemaConnectorCreateTransition -> = core.serialization.enum_(["complete", "input_required"]); - -export declare namespace CommonSchemaConnectorCreateTransition { - export type Raw = "complete" | "input_required"; -} diff --git a/src/serialization/types/CommonSchemaConnectorTransition.ts b/src/serialization/types/CommonSchemaConnectorTransition.ts deleted file mode 100644 index 8e694c31..00000000 --- a/src/serialization/types/CommonSchemaConnectorTransition.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonSchemaConnectorTransition: core.serialization.Schema< - serializers.CommonSchemaConnectorTransition.Raw, - Corti.CommonSchemaConnectorTransition -> = core.serialization.enum_(["complete", "input_required"]); - -export declare namespace CommonSchemaConnectorTransition { - export type Raw = "complete" | "input_required"; -} diff --git a/src/serialization/types/CommonTaskIdValue.ts b/src/serialization/types/CommonTaskIdValue.ts deleted file mode 100644 index 2bc1386e..00000000 --- a/src/serialization/types/CommonTaskIdValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonTaskIdValue: core.serialization.Schema = - core.serialization.string(); - -export declare namespace CommonTaskIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/CommonTaskListResponse.ts b/src/serialization/types/CommonTaskListResponse.ts deleted file mode 100644 index e23a8a73..00000000 --- a/src/serialization/types/CommonTaskListResponse.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTaskResponse } from "./CommonTaskResponse.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; - -export const CommonTaskListResponse: core.serialization.ObjectSchema< - serializers.CommonTaskListResponse.Raw, - Corti.CommonTaskListResponse -> = core.serialization.object({ - pageSize: core.serialization.number().optional(), - tasks: core.serialization.list(CommonTaskResponse), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace CommonTaskListResponse { - export interface Raw { - pageSize?: number | null; - tasks: CommonTaskResponse.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/CommonTaskMetadata.ts b/src/serialization/types/CommonTaskMetadata.ts deleted file mode 100644 index e7ce19ef..00000000 --- a/src/serialization/types/CommonTaskMetadata.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonUsage } from "./CommonUsage.js"; - -export const CommonTaskMetadata: core.serialization.ObjectSchema< - serializers.CommonTaskMetadata.Raw, - Corti.CommonTaskMetadata -> = core.serialization - .object({ - usage: core.serialization.property("$usage", CommonUsage.optional()), - }) - .passthrough(); - -export declare namespace CommonTaskMetadata { - export interface Raw { - $usage?: CommonUsage.Raw | null; - [key: string]: any; - } -} diff --git a/src/serialization/types/CommonTaskResponse.ts b/src/serialization/types/CommonTaskResponse.ts deleted file mode 100644 index 9603f2ea..00000000 --- a/src/serialization/types/CommonTaskResponse.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonArtifactResponse } from "./CommonArtifactResponse.js"; -import { CommonContextIdValue } from "./CommonContextIdValue.js"; -import { CommonMessage } from "./CommonMessage.js"; -import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; -import { CommonTaskMetadata } from "./CommonTaskMetadata.js"; -import { CommonTaskStatus } from "./CommonTaskStatus.js"; - -export const CommonTaskResponse: core.serialization.ObjectSchema< - serializers.CommonTaskResponse.Raw, - Corti.CommonTaskResponse -> = core.serialization.object({ - id: CommonTaskIdValue, - contextId: CommonContextIdValue, - status: CommonTaskStatus, - history: core.serialization.list(CommonMessage).optional(), - artifacts: core.serialization.list(CommonArtifactResponse).optional(), - metadata: CommonTaskMetadata.optional(), -}); - -export declare namespace CommonTaskResponse { - export interface Raw { - id: CommonTaskIdValue.Raw; - contextId: CommonContextIdValue.Raw; - status: CommonTaskStatus.Raw; - history?: CommonMessage.Raw[] | null; - artifacts?: CommonArtifactResponse.Raw[] | null; - metadata?: CommonTaskMetadata.Raw | null; - } -} diff --git a/src/serialization/types/CommonTaskState.ts b/src/serialization/types/CommonTaskState.ts deleted file mode 100644 index f5142fa4..00000000 --- a/src/serialization/types/CommonTaskState.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonTaskState: core.serialization.Schema = - core.serialization.enum_([ - "TASK_STATE_SUBMITTED", - "TASK_STATE_WORKING", - "TASK_STATE_COMPLETED", - "TASK_STATE_FAILED", - "TASK_STATE_CANCELED", - "TASK_STATE_INPUT_REQUIRED", - "TASK_STATE_REJECTED", - "TASK_STATE_AUTH_REQUIRED", - ]); - -export declare namespace CommonTaskState { - export type Raw = - | "TASK_STATE_SUBMITTED" - | "TASK_STATE_WORKING" - | "TASK_STATE_COMPLETED" - | "TASK_STATE_FAILED" - | "TASK_STATE_CANCELED" - | "TASK_STATE_INPUT_REQUIRED" - | "TASK_STATE_REJECTED" - | "TASK_STATE_AUTH_REQUIRED"; -} diff --git a/src/serialization/types/CommonTaskStatus.ts b/src/serialization/types/CommonTaskStatus.ts deleted file mode 100644 index 80c2e3ad..00000000 --- a/src/serialization/types/CommonTaskStatus.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonMessage } from "./CommonMessage.js"; -import { CommonTaskState } from "./CommonTaskState.js"; - -export const CommonTaskStatus: core.serialization.ObjectSchema< - serializers.CommonTaskStatus.Raw, - Corti.CommonTaskStatus -> = core.serialization.object({ - state: CommonTaskState, - message: CommonMessage.optional(), - timestamp: core.serialization.date().optional(), -}); - -export declare namespace CommonTaskStatus { - export interface Raw { - state: CommonTaskState.Raw; - message?: CommonMessage.Raw | null; - timestamp?: string | null; - } -} diff --git a/src/serialization/types/CommonTotalSize.ts b/src/serialization/types/CommonTotalSize.ts deleted file mode 100644 index c0ed29e6..00000000 --- a/src/serialization/types/CommonTotalSize.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonTotalSize: core.serialization.Schema = - core.serialization.number(); - -export declare namespace CommonTotalSize { - export type Raw = number; -} diff --git a/src/serialization/types/CommonUsage.ts b/src/serialization/types/CommonUsage.ts deleted file mode 100644 index 67699121..00000000 --- a/src/serialization/types/CommonUsage.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const CommonUsage: core.serialization.ObjectSchema = - core.serialization.object({ - model: core.serialization.string().optional(), - inputTokens: core.serialization.number(), - outputTokens: core.serialization.number(), - cachedInputTokens: core.serialization.number().optional(), - cacheCreationInputTokens: core.serialization.number().optional(), - totalTokens: core.serialization.number(), - credits: core.serialization.number().optional(), - }); - -export declare namespace CommonUsage { - export interface Raw { - model?: string | null; - inputTokens: number; - outputTokens: number; - cachedInputTokens?: number | null; - cacheCreationInputTokens?: number | null; - totalTokens: number; - credits?: number | null; - } -} diff --git a/src/serialization/types/ConnectorsListResponse.ts b/src/serialization/types/ConnectorsListResponse.ts deleted file mode 100644 index 42c70c3b..00000000 --- a/src/serialization/types/ConnectorsListResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorResponse } from "./CommonConnectorResponse.js"; - -export const ConnectorsListResponse: core.serialization.ObjectSchema< - serializers.ConnectorsListResponse.Raw, - Corti.ConnectorsListResponse -> = core.serialization.object({ - connectors: core.serialization.list(CommonConnectorResponse), -}); - -export declare namespace ConnectorsListResponse { - export interface Raw { - connectors: CommonConnectorResponse.Raw[]; - } -} diff --git a/src/serialization/types/Contexts.ts b/src/serialization/types/Contexts.ts deleted file mode 100644 index aa1c12dc..00000000 --- a/src/serialization/types/Contexts.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonAgentIdValue } from "./CommonAgentIdValue.js"; -import { CommonContextIdValue } from "./CommonContextIdValue.js"; - -export const Contexts: core.serialization.ObjectSchema = - core.serialization.object({ - id: CommonContextIdValue, - agentId: CommonAgentIdValue.optional(), - taskCount: core.serialization.number().optional(), - createdAt: core.serialization.date().optional(), - updatedAt: core.serialization.date().optional(), - expiresAt: core.serialization.date().optionalNullable(), - }); - -export declare namespace Contexts { - export interface Raw { - id: CommonContextIdValue.Raw; - agentId?: CommonAgentIdValue.Raw | null; - taskCount?: number | null; - createdAt?: string | null; - updatedAt?: string | null; - expiresAt?: (string | null | undefined) | null; - } -} diff --git a/src/serialization/types/ContextsDetailResponse.ts b/src/serialization/types/ContextsDetailResponse.ts deleted file mode 100644 index 3057a895..00000000 --- a/src/serialization/types/ContextsDetailResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonTaskResponse } from "./CommonTaskResponse.js"; -import { Contexts } from "./Contexts.js"; - -export const ContextsDetailResponse: core.serialization.ObjectSchema< - serializers.ContextsDetailResponse.Raw, - Corti.ContextsDetailResponse -> = core.serialization - .object({ - tasks: core.serialization.list(CommonTaskResponse), - }) - .extend(Contexts); - -export declare namespace ContextsDetailResponse { - export interface Raw extends Contexts.Raw { - tasks: CommonTaskResponse.Raw[]; - } -} diff --git a/src/serialization/types/ContextsListResponse.ts b/src/serialization/types/ContextsListResponse.ts deleted file mode 100644 index e6765e17..00000000 --- a/src/serialization/types/ContextsListResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; -import { Contexts } from "./Contexts.js"; - -export const ContextsListResponse: core.serialization.ObjectSchema< - serializers.ContextsListResponse.Raw, - Corti.ContextsListResponse -> = core.serialization.object({ - contexts: core.serialization.list(Contexts), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace ContextsListResponse { - export interface Raw { - contexts: Contexts.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/ContextsOpenInferenceSpan.ts b/src/serialization/types/ContextsOpenInferenceSpan.ts deleted file mode 100644 index e8d958cd..00000000 --- a/src/serialization/types/ContextsOpenInferenceSpan.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const ContextsOpenInferenceSpan: core.serialization.ObjectSchema< - serializers.ContextsOpenInferenceSpan.Raw, - Corti.ContextsOpenInferenceSpan -> = core.serialization.object({ - name: core.serialization.string(), - spanId: core.serialization.property("span_id", core.serialization.string()), - parentSpanId: core.serialization.property("parent_span_id", core.serialization.string().optional()), - startTime: core.serialization.property("start_time", core.serialization.date()), - endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), - attributes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace ContextsOpenInferenceSpan { - export interface Raw { - name: string; - span_id: string; - parent_span_id?: string | null; - start_time: string; - end_time?: (string | null | undefined) | null; - attributes?: Record | null; - } -} diff --git a/src/serialization/types/ContextsTraceItem.ts b/src/serialization/types/ContextsTraceItem.ts deleted file mode 100644 index 7b2ec7f8..00000000 --- a/src/serialization/types/ContextsTraceItem.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { ContextsOpenInferenceSpan } from "./ContextsOpenInferenceSpan.js"; -import { ContextsTraceItemTrace } from "./ContextsTraceItemTrace.js"; - -export const ContextsTraceItem: core.serialization.ObjectSchema< - serializers.ContextsTraceItem.Raw, - Corti.ContextsTraceItem -> = core.serialization.object({ - trace: ContextsTraceItemTrace, - spans: core.serialization.list(ContextsOpenInferenceSpan), -}); - -export declare namespace ContextsTraceItem { - export interface Raw { - trace: ContextsTraceItemTrace.Raw; - spans: ContextsOpenInferenceSpan.Raw[]; - } -} diff --git a/src/serialization/types/ContextsTraceItemTrace.ts b/src/serialization/types/ContextsTraceItemTrace.ts deleted file mode 100644 index 75e2f533..00000000 --- a/src/serialization/types/ContextsTraceItemTrace.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const ContextsTraceItemTrace: core.serialization.ObjectSchema< - serializers.ContextsTraceItemTrace.Raw, - Corti.ContextsTraceItemTrace -> = core.serialization.object({ - id: core.serialization.string(), - name: core.serialization.string(), - startTime: core.serialization.property("start_time", core.serialization.date()), - endTime: core.serialization.property("end_time", core.serialization.date().optionalNullable()), - input: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - output: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - tags: core.serialization.list(core.serialization.string()).optional(), - threadId: core.serialization.property("thread_id", core.serialization.string()), -}); - -export declare namespace ContextsTraceItemTrace { - export interface Raw { - id: string; - name: string; - start_time: string; - end_time?: (string | null | undefined) | null; - input?: Record | null; - output?: Record | null; - metadata?: Record | null; - tags?: string[] | null; - thread_id: string; - } -} diff --git a/src/serialization/types/ContextsTraceResponse.ts b/src/serialization/types/ContextsTraceResponse.ts deleted file mode 100644 index b06ecbc9..00000000 --- a/src/serialization/types/ContextsTraceResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; -import { ContextsTraceItem } from "./ContextsTraceItem.js"; - -export const ContextsTraceResponse: core.serialization.ObjectSchema< - serializers.ContextsTraceResponse.Raw, - Corti.ContextsTraceResponse -> = core.serialization.object({ - traces: core.serialization.list(ContextsTraceItem), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace ContextsTraceResponse { - export interface Raw { - traces: ContextsTraceItem.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/FeedbackActor.ts b/src/serialization/types/FeedbackActor.ts deleted file mode 100644 index feb0d51f..00000000 --- a/src/serialization/types/FeedbackActor.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackActor: core.serialization.ObjectSchema = - core.serialization.object({ - externalId: core.serialization.string(), - }); - -export declare namespace FeedbackActor { - export interface Raw { - externalId: string; - } -} diff --git a/src/serialization/types/FeedbackIdValue.ts b/src/serialization/types/FeedbackIdValue.ts deleted file mode 100644 index 21dfa05f..00000000 --- a/src/serialization/types/FeedbackIdValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackIdValue: core.serialization.Schema = - core.serialization.string(); - -export declare namespace FeedbackIdValue { - export type Raw = string; -} diff --git a/src/serialization/types/FeedbackLabel.ts b/src/serialization/types/FeedbackLabel.ts deleted file mode 100644 index dee3b08b..00000000 --- a/src/serialization/types/FeedbackLabel.ts +++ /dev/null @@ -1,41 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackLabel: core.serialization.Schema = - core.serialization.enum_([ - "correct", - "complete", - "helpful", - "wellPresented", - "efficient", - "incorrect", - "missingInformation", - "irrelevant", - "misunderstoodRequest", - "unsupportedClaim", - "unsafeOrInappropriate", - "poorlyPresented", - "tooVerbose", - "other", - ]); - -export declare namespace FeedbackLabel { - export type Raw = - | "correct" - | "complete" - | "helpful" - | "wellPresented" - | "efficient" - | "incorrect" - | "missingInformation" - | "irrelevant" - | "misunderstoodRequest" - | "unsupportedClaim" - | "unsafeOrInappropriate" - | "poorlyPresented" - | "tooVerbose" - | "other"; -} diff --git a/src/serialization/types/FeedbackListResponse.ts b/src/serialization/types/FeedbackListResponse.ts deleted file mode 100644 index 1a1cb098..00000000 --- a/src/serialization/types/FeedbackListResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { FeedbackResponse } from "./FeedbackResponse.js"; - -export const FeedbackListResponse: core.serialization.ObjectSchema< - serializers.FeedbackListResponse.Raw, - Corti.FeedbackListResponse -> = core.serialization.object({ - feedbacks: core.serialization.list(FeedbackResponse), -}); - -export declare namespace FeedbackListResponse { - export interface Raw { - feedbacks: FeedbackResponse.Raw[]; - } -} diff --git a/src/serialization/types/FeedbackMetadata.ts b/src/serialization/types/FeedbackMetadata.ts deleted file mode 100644 index 162c3f90..00000000 --- a/src/serialization/types/FeedbackMetadata.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { FeedbackActor } from "./FeedbackActor.js"; - -export const FeedbackMetadata: core.serialization.ObjectSchema< - serializers.FeedbackMetadata.Raw, - Corti.FeedbackMetadata -> = core.serialization.object({ - collectionMethod: core.serialization.string().optional(), - clientReference: core.serialization.string().optional(), - actor: FeedbackActor.optional(), -}); - -export declare namespace FeedbackMetadata { - export interface Raw { - collectionMethod?: string | null; - clientReference?: string | null; - actor?: FeedbackActor.Raw | null; - } -} diff --git a/src/serialization/types/FeedbackRating.ts b/src/serialization/types/FeedbackRating.ts deleted file mode 100644 index 87e5c7ca..00000000 --- a/src/serialization/types/FeedbackRating.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { FeedbackRatingScale } from "./FeedbackRatingScale.js"; - -export const FeedbackRating: core.serialization.ObjectSchema = - core.serialization.object({ - scale: FeedbackRatingScale, - value: core.serialization.number(), - }); - -export declare namespace FeedbackRating { - export interface Raw { - scale: FeedbackRatingScale.Raw; - value: number; - } -} diff --git a/src/serialization/types/FeedbackRatingScale.ts b/src/serialization/types/FeedbackRatingScale.ts deleted file mode 100644 index ebbeb7ba..00000000 --- a/src/serialization/types/FeedbackRatingScale.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const FeedbackRatingScale: core.serialization.Schema< - serializers.FeedbackRatingScale.Raw, - Corti.FeedbackRatingScale -> = core.serialization.enum_(["binary"]); - -export declare namespace FeedbackRatingScale { - export type Raw = "binary"; -} diff --git a/src/serialization/types/FeedbackResponse.ts b/src/serialization/types/FeedbackResponse.ts deleted file mode 100644 index 975ea339..00000000 --- a/src/serialization/types/FeedbackResponse.ts +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonTaskIdValue } from "./CommonTaskIdValue.js"; -import { FeedbackIdValue } from "./FeedbackIdValue.js"; -import { FeedbackLabel } from "./FeedbackLabel.js"; -import { FeedbackMetadata } from "./FeedbackMetadata.js"; -import { FeedbackRating } from "./FeedbackRating.js"; -import { FeedbackTarget } from "./FeedbackTarget.js"; - -export const FeedbackResponse: core.serialization.ObjectSchema< - serializers.FeedbackResponse.Raw, - Corti.FeedbackResponse -> = core.serialization.object({ - id: FeedbackIdValue, - taskId: CommonTaskIdValue, - rating: FeedbackRating, - normalizedScore: core.serialization.number(), - labels: core.serialization.list(FeedbackLabel), - reason: core.serialization.string().optional(), - target: FeedbackTarget.optional(), - metadata: FeedbackMetadata.optional(), - createdAt: core.serialization.date().optional(), -}); - -export declare namespace FeedbackResponse { - export interface Raw { - id: FeedbackIdValue.Raw; - taskId: CommonTaskIdValue.Raw; - rating: FeedbackRating.Raw; - normalizedScore: number; - labels: FeedbackLabel.Raw[]; - reason?: string | null; - target?: FeedbackTarget.Raw | null; - metadata?: FeedbackMetadata.Raw | null; - createdAt?: string | null; - } -} diff --git a/src/serialization/types/FeedbackTarget.ts b/src/serialization/types/FeedbackTarget.ts deleted file mode 100644 index fa3ed123..00000000 --- a/src/serialization/types/FeedbackTarget.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonMessageIdValue } from "./CommonMessageIdValue.js"; - -export const FeedbackTarget: core.serialization.ObjectSchema = - core.serialization.object({ - messageId: CommonMessageIdValue, - }); - -export declare namespace FeedbackTarget { - export interface Raw { - messageId: CommonMessageIdValue.Raw; - } -} diff --git a/src/serialization/types/RegistryConnectorCapabilities.ts b/src/serialization/types/RegistryConnectorCapabilities.ts deleted file mode 100644 index fed6df20..00000000 --- a/src/serialization/types/RegistryConnectorCapabilities.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const RegistryConnectorCapabilities: core.serialization.ObjectSchema< - serializers.RegistryConnectorCapabilities.Raw, - Corti.RegistryConnectorCapabilities -> = core.serialization.object({ - streaming: core.serialization.boolean().optional(), - inputModes: core.serialization.list(core.serialization.string()).optional(), - outputModes: core.serialization.list(core.serialization.string()).optional(), - tools: core.serialization.list(core.serialization.string()).optional(), -}); - -export declare namespace RegistryConnectorCapabilities { - export interface Raw { - streaming?: boolean | null; - inputModes?: string[] | null; - outputModes?: string[] | null; - tools?: string[] | null; - } -} diff --git a/src/serialization/types/RegistryConnectorListResponse.ts b/src/serialization/types/RegistryConnectorListResponse.ts deleted file mode 100644 index f31cb6bb..00000000 --- a/src/serialization/types/RegistryConnectorListResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonNextPageToken } from "./CommonNextPageToken.js"; -import { CommonTotalSize } from "./CommonTotalSize.js"; -import { RegistryConnectorResponse } from "./RegistryConnectorResponse.js"; - -export const RegistryConnectorListResponse: core.serialization.ObjectSchema< - serializers.RegistryConnectorListResponse.Raw, - Corti.RegistryConnectorListResponse -> = core.serialization.object({ - connectors: core.serialization.list(RegistryConnectorResponse), - nextPageToken: CommonNextPageToken.optionalNullable(), - totalSize: CommonTotalSize.optional(), -}); - -export declare namespace RegistryConnectorListResponse { - export interface Raw { - connectors: RegistryConnectorResponse.Raw[]; - nextPageToken?: ((CommonNextPageToken.Raw | undefined) | null | undefined) | null; - totalSize?: CommonTotalSize.Raw | null; - } -} diff --git a/src/serialization/types/RegistryConnectorResponse.ts b/src/serialization/types/RegistryConnectorResponse.ts deleted file mode 100644 index 40a2c9df..00000000 --- a/src/serialization/types/RegistryConnectorResponse.ts +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { CommonConnectorType } from "./CommonConnectorType.js"; -import { RegistryConnectorCapabilities } from "./RegistryConnectorCapabilities.js"; -import { RegistryIcon } from "./RegistryIcon.js"; - -export const RegistryConnectorResponse: core.serialization.ObjectSchema< - serializers.RegistryConnectorResponse.Raw, - Corti.RegistryConnectorResponse -> = core.serialization.object({ - id: core.serialization.string(), - type: CommonConnectorType, - name: core.serialization.string(), - title: core.serialization.string().optional(), - description: core.serialization.string().optional(), - version: core.serialization.string().optional(), - icons: core.serialization.list(RegistryIcon).optional(), - provider: core.serialization.string().optional(), - websiteUrl: core.serialization.string().optional(), - documentationUrl: core.serialization.string().optional(), - capabilities: RegistryConnectorCapabilities.optional(), - tags: core.serialization.list(core.serialization.string()).optional(), - configSchema: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), -}); - -export declare namespace RegistryConnectorResponse { - export interface Raw { - id: string; - type: CommonConnectorType.Raw; - name: string; - title?: string | null; - description?: string | null; - version?: string | null; - icons?: RegistryIcon.Raw[] | null; - provider?: string | null; - websiteUrl?: string | null; - documentationUrl?: string | null; - capabilities?: RegistryConnectorCapabilities.Raw | null; - tags?: string[] | null; - configSchema?: Record | null; - } -} diff --git a/src/serialization/types/RegistryIcon.ts b/src/serialization/types/RegistryIcon.ts deleted file mode 100644 index 775dc0fe..00000000 --- a/src/serialization/types/RegistryIcon.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const RegistryIcon: core.serialization.ObjectSchema = - core.serialization.object({ - src: core.serialization.string(), - mimeType: core.serialization.string().optional(), - sizes: core.serialization.list(core.serialization.string()).optional(), - }); - -export declare namespace RegistryIcon { - export interface Raw { - src: string; - mimeType?: string | null; - sizes?: string[] | null; - } -} diff --git a/src/serialization/types/UsageBucket.ts b/src/serialization/types/UsageBucket.ts deleted file mode 100644 index cd9c0006..00000000 --- a/src/serialization/types/UsageBucket.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { UsageMetrics } from "./UsageMetrics.js"; - -export const UsageBucket: core.serialization.ObjectSchema = - core.serialization - .object({ - periodStart: core.serialization.date(), - periodEnd: core.serialization.date(), - }) - .extend(UsageMetrics); - -export declare namespace UsageBucket { - export interface Raw extends UsageMetrics.Raw { - periodStart: string; - periodEnd: string; - } -} diff --git a/src/serialization/types/UsageGranularity.ts b/src/serialization/types/UsageGranularity.ts deleted file mode 100644 index 2f3edc3a..00000000 --- a/src/serialization/types/UsageGranularity.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const UsageGranularity: core.serialization.Schema = - core.serialization.enum_(["minute", "hour", "day", "week"]); - -export declare namespace UsageGranularity { - export type Raw = "minute" | "hour" | "day" | "week"; -} diff --git a/src/serialization/types/UsageMetrics.ts b/src/serialization/types/UsageMetrics.ts deleted file mode 100644 index dff2cb76..00000000 --- a/src/serialization/types/UsageMetrics.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; - -export const UsageMetrics: core.serialization.ObjectSchema = - core.serialization.object({ - invocations: core.serialization.number(), - uniqueContexts: core.serialization.number(), - }); - -export declare namespace UsageMetrics { - export interface Raw { - invocations: number; - uniqueContexts: number; - } -} diff --git a/src/serialization/types/UsageReportResponse.ts b/src/serialization/types/UsageReportResponse.ts deleted file mode 100644 index 564744e9..00000000 --- a/src/serialization/types/UsageReportResponse.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Corti from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { UsageBucket } from "./UsageBucket.js"; -import { UsageGranularity } from "./UsageGranularity.js"; -import { UsageMetrics } from "./UsageMetrics.js"; - -export const UsageReportResponse: core.serialization.ObjectSchema< - serializers.UsageReportResponse.Raw, - Corti.UsageReportResponse -> = core.serialization.object({ - granularity: UsageGranularity, - from: core.serialization.date(), - to: core.serialization.date(), - totals: UsageMetrics, - buckets: core.serialization.list(UsageBucket), -}); - -export declare namespace UsageReportResponse { - export interface Raw { - granularity: UsageGranularity.Raw; - from: string; - to: string; - totals: UsageMetrics.Raw; - buckets: UsageBucket.Raw[]; - } -} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 2ffaffbc..7ce73b9e 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,17 +1,3 @@ -export * from "./A2AjsonrpcResponse.js"; -export * from "./A2AjsonrpcResponseError.js"; -export * from "./A2AjsonrpcResponseId.js"; -export * from "./A2ASendMessageConfiguration.js"; -export * from "./A2ASendMessageRequest.js"; -export * from "./A2ASendMessageResponse.js"; -export * from "./A2AStreamEventResponse.js"; -export * from "./AgentCardResponse.js"; -export * from "./AgentCardResponseCapabilities.js"; -export * from "./AgentCardResponseProvider.js"; -export * from "./AgentCardResponseSignaturesItem.js"; -export * from "./AgentCardResponseSkillsItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItem.js"; -export * from "./AgentCardResponseSupportedInterfacesItemProtocolBinding.js"; export * from "./AgentsAgent.js"; export * from "./AgentsAgentCapabilities.js"; export * from "./AgentsAgentCard.js"; @@ -45,9 +31,6 @@ export * from "./AgentsFilePartFile.js"; export * from "./AgentsFilePartKind.js"; export * from "./AgentsFileWithBytes.js"; export * from "./AgentsFileWithUri.js"; -export * from "./AgentsLabels.js"; -export * from "./AgentsLifecycle.js"; -export * from "./AgentsListResponse.js"; export * from "./AgentsMcpServer.js"; export * from "./AgentsMcpServerAuthorizationType.js"; export * from "./AgentsMcpServerTransportType.js"; @@ -62,7 +45,6 @@ export * from "./AgentsRegistryExpert.js"; export * from "./AgentsRegistryExpertsResponse.js"; export * from "./AgentsRegistryMcpServer.js"; export * from "./AgentsRegistryMcpServerAuthorizationType.js"; -export * from "./AgentsResponse.js"; export * from "./AgentsTask.js"; export * from "./AgentsTaskKind.js"; export * from "./AgentsTaskStatus.js"; @@ -70,8 +52,6 @@ export * from "./AgentsTaskStatusState.js"; export * from "./AgentsTextPart.js"; export * from "./AgentsTextPartKind.js"; export * from "./AgentsUpdateExpertReference.js"; -export * from "./AgentsUserIdValue.js"; -export * from "./AgentsVisibility.js"; export * from "./AuthTokenRequestAuthorizationCode.js"; export * from "./AuthTokenRequestAuthorizationPkce.js"; export * from "./AuthTokenRequestClientCredentials.js"; @@ -83,67 +63,20 @@ export * from "./CodesGeneralReadResponse.js"; export * from "./CodesGeneralReadResponseAlternativesItem.js"; export * from "./CodesGeneralReadResponseEvidencesItem.js"; export * from "./CodesGeneralResponse.js"; -export * from "./CommonA2AConnector.js"; -export * from "./CommonA2AConnectorCreate.js"; -export * from "./CommonAgentConnector.js"; -export * from "./CommonAgentConnectorCreate.js"; -export * from "./CommonAgentIdValue.js"; export * from "./CommonAiContext.js"; -export * from "./CommonArtifactIdValue.js"; -export * from "./CommonArtifactResponse.js"; export * from "./CommonCodingSystemEnum.js"; -export * from "./CommonConnectorAuth.js"; -export * from "./CommonConnectorAuthType.js"; -export * from "./CommonConnectorCreateRequest.js"; -export * from "./CommonConnectorIdValue.js"; -export * from "./CommonConnectorResponse.js"; -export * from "./CommonConnectorType.js"; -export * from "./CommonContextIdValue.js"; export * from "./CommonDocumentationEvidence.js"; export * from "./CommonDocumentIdContext.js"; export * from "./CommonDocumentIdContextType.js"; -export * from "./CommonErrorResponse.js"; -export * from "./CommonErrorResponseError.js"; -export * from "./CommonErrorResponseErrorDetails.js"; -export * from "./CommonErrorResponseErrorDetailsValidationErrorsItem.js"; export * from "./CommonFactsContext.js"; -export * from "./CommonMcpConnector.js"; -export * from "./CommonMcpConnectorCreate.js"; -export * from "./CommonMessage.js"; -export * from "./CommonMessageIdValue.js"; -export * from "./CommonNextPageToken.js"; -export * from "./CommonPart.js"; -export * from "./CommonRegistryConnectorCreate.js"; -export * from "./CommonRegistryConnectorProvisioned.js"; -export * from "./CommonRole.js"; -export * from "./CommonSchemaConnector.js"; -export * from "./CommonSchemaConnectorCreate.js"; -export * from "./CommonSchemaConnectorCreateTransition.js"; -export * from "./CommonSchemaConnectorTransition.js"; export * from "./CommonSortingDirectionEnum.js"; export * from "./CommonSourceEnum.js"; export * from "./CommonStatusResponse.js"; -export * from "./CommonTaskIdValue.js"; -export * from "./CommonTaskListResponse.js"; -export * from "./CommonTaskMetadata.js"; -export * from "./CommonTaskResponse.js"; -export * from "./CommonTaskState.js"; -export * from "./CommonTaskStatus.js"; export * from "./CommonTextContext.js"; -export * from "./CommonTotalSize.js"; export * from "./CommonTranscriptContext.js"; export * from "./CommonTranscriptRequest.js"; export * from "./CommonTranscriptResponse.js"; -export * from "./CommonUsage.js"; export * from "./CommonUsageInfo.js"; -export * from "./ConnectorsListResponse.js"; -export * from "./Contexts.js"; -export * from "./ContextsDetailResponse.js"; -export * from "./ContextsListResponse.js"; -export * from "./ContextsOpenInferenceSpan.js"; -export * from "./ContextsTraceItem.js"; -export * from "./ContextsTraceItemTrace.js"; -export * from "./ContextsTraceResponse.js"; export * from "./DocumentsContext.js"; export * from "./DocumentsContextWithFacts.js"; export * from "./DocumentsContextWithFactsType.js"; @@ -179,15 +112,6 @@ export * from "./FactsFactGroupsListResponse.js"; export * from "./FactsListItem.js"; export * from "./FactsListResponse.js"; export * from "./FactsUpdateResponse.js"; -export * from "./FeedbackActor.js"; -export * from "./FeedbackIdValue.js"; -export * from "./FeedbackLabel.js"; -export * from "./FeedbackListResponse.js"; -export * from "./FeedbackMetadata.js"; -export * from "./FeedbackRating.js"; -export * from "./FeedbackRatingScale.js"; -export * from "./FeedbackResponse.js"; -export * from "./FeedbackTarget.js"; export * from "./GuidedArrayNode.js"; export * from "./GuidedAssemblyRequest.js"; export * from "./GuidedAssemblySectionRef.js"; @@ -263,10 +187,6 @@ export * from "./LanguagesListResponse.js"; export * from "./OAuthTokenRequest.js"; export * from "./RecordingsCreateResponse.js"; export * from "./RecordingsListResponse.js"; -export * from "./RegistryConnectorCapabilities.js"; -export * from "./RegistryConnectorListResponse.js"; -export * from "./RegistryConnectorResponse.js"; -export * from "./RegistryIcon.js"; export * from "./StreamAudioEventData.js"; export * from "./StreamAudioEventDataEvent.js"; export * from "./StreamAudioEventMessage.js"; @@ -353,8 +273,4 @@ export * from "./TranscriptsParticipantRoleEnum.js"; export * from "./TranscriptsResponse.js"; export * from "./TranscriptsStatusEnum.js"; export * from "./TranscriptsStatusResponse.js"; -export * from "./UsageBucket.js"; -export * from "./UsageGranularity.js"; -export * from "./UsageMetrics.js"; -export * from "./UsageReportResponse.js"; export * from "./Uuid.js"; diff --git a/tests/unit/stream/Stream.test.ts b/tests/unit/stream/Stream.test.ts deleted file mode 100644 index 83575f07..00000000 --- a/tests/unit/stream/Stream.test.ts +++ /dev/null @@ -1,563 +0,0 @@ -import { Stream } from "../../../src/core/stream/Stream"; - -describe("Stream", () => { - describe("JSON streaming", () => { - it("should parse single JSON message", async () => { - const mockStream = createReadableStream(['{"value": 1}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should parse multiple JSON messages", async () => { - const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); - }); - - it("should handle messages split across chunks", async () => { - const mockStream = createReadableStream(['{"val', 'ue": 1}\n{"value":', " 2}\n"]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - - it("should skip empty lines", async () => { - const mockStream = createReadableStream(['{"value": 1}\n\n\n{"value": 2}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - - it("should handle custom message terminator", async () => { - const mockStream = createReadableStream(['{"value": 1}|||{"value": 2}|||']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "|||" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - }); - - describe("SSE streaming", () => { - it("should parse SSE data with prefix", async () => { - const mockStream = createReadableStream(['data: {"value": 1}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should parse multiple SSE events", async () => { - const mockStream = createReadableStream(['data: {"value": 1}\ndata: {"value": 2}\ndata: {"value": 3}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }, { value: 3 }]); - }); - - it("should stop at stream terminator", async () => { - const mockStream = createReadableStream(['data: {"value": 1}\ndata: [DONE]\ndata: {"value": 2}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse", streamTerminator: "[DONE]" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should skip lines without data prefix", async () => { - const mockStream = createReadableStream([ - 'event: message\ndata: {"value": 1}\nid: 123\ndata: {"value": 2}\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "sse" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }, { value: 2 }]); - }); - }); - - describe("SSE event-level discrimination (inject discriminator)", () => { - it("should inject event type as discriminator into JSON data", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"content": "hello"}\n\nevent: completion\ndata: {"content": "world"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([ - { type: "completion", content: "hello" }, - { type: "completion", content: "world" }, - ]); - }); - - it("should inject different event types for mixed events", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"content": "hi"}\n\nevent: error\ndata: {"message": "fail"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "event" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([ - { event: "completion", content: "hi" }, - { event: "error", message: "fail" }, - ]); - }); - - it("should not inject if data already contains discriminator key", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"type": "existing", "content": "hello"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "existing", content: "hello" }]); - }); - - it("should not false-positive when discriminator key appears inside a value", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"description": "type: foo", "content": "hello"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", description: "type: foo", content: "hello" }]); - }); - - it("should not inject if no event field is present", async () => { - const mockStream = createReadableStream(['data: {"content": "hello"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ content: "hello" }]); - }); - - it("should handle empty JSON object", async () => { - const mockStream = createReadableStream(["event: heartbeat\ndata: {}\n\n"]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "heartbeat" }]); - }); - - it("should stop at stream terminator", async () => { - const mockStream = createReadableStream([ - 'event: completion\ndata: {"content": "hi"}\n\nevent: done\ndata: [DONE]\n\nevent: completion\ndata: {"content": "bye"}\n\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type", streamTerminator: "[DONE]" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", content: "hi" }]); - }); - - it("should concatenate multiline data fields", async () => { - const mockStream = createReadableStream(['event: completion\ndata: {"delta":\ndata: "hello"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", delta: "hello" }]); - }); - - it("should handle events split across chunks", async () => { - const mockStream = createReadableStream(["event: comple", 'tion\ndata: {"con', 'tent": "hi"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", content: "hi" }]); - }); - - it("should handle last event without trailing blank line", async () => { - const mockStream = createReadableStream(['event: completion\ndata: {"content": "hi"}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "completion", content: "hi" }]); - }); - - it("should handle CRLF line endings", async () => { - const mockStream = createReadableStream([ - 'event: completion\r\ndata: {"content": "hi"}\r\n\r\nevent: completion\r\ndata: {"content": "world"}\r\n\r\n', - ]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([ - { type: "completion", content: "hi" }, - { type: "completion", content: "world" }, - ]); - }); - - it("should inject empty string discriminator when event field is present but empty", async () => { - const mockStream = createReadableStream(['event: \ndata: {"content": "hello"}\n\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val, - eventShape: { type: "sse", eventDiscriminator: "type" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ type: "", content: "hello" }]); - }); - }); - - describe("encoding and decoding", () => { - it("should decode UTF-8 text using TextDecoder", async () => { - const encoder = new TextEncoder(); - const mockStream = createReadableStream([encoder.encode('{"text": "café"}\n')]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { text: string }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ text: "café" }]); - }); - - it("should decode emoji correctly", async () => { - const encoder = new TextEncoder(); - const mockStream = createReadableStream([encoder.encode('{"emoji": "🎉"}\n')]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { emoji: string }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ emoji: "🎉" }]); - }); - - it("should handle binary data chunks", async () => { - const encoder = new TextEncoder(); - const mockStream = createReadableStream([encoder.encode('{"val'), encoder.encode('ue": 1}\n')]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - - it("should handle multi-byte UTF-8 characters split across chunk boundaries", async () => { - // Test string with Japanese (3 bytes), Russian (2 bytes), German (2 bytes), and Chinese (3 bytes) - const testString = '{"text": "こんにちは Привет Größe 你好"}\n'; - const fullBytes = new TextEncoder().encode(testString); - - // Split the bytes in the middle of multi-byte characters - // Japanese "こ" starts at byte 11, is 3 bytes (E3 81 93) - // Split after first byte of "こ" to test mid-character splitting - const splitPoint = 12; // This splits "こ" in the middle - const chunk1 = fullBytes.slice(0, splitPoint); - const chunk2 = fullBytes.slice(splitPoint); - - const mockStream = createReadableStream([chunk1, chunk2]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { text: string }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ text: "こんにちは Привет Größe 你好" }]); - }); - }); - - describe("abort signal", () => { - it("should handle abort signal", async () => { - const controller = new AbortController(); - const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n{"value": 3}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - signal: controller.signal, - }); - - const messages: unknown[] = []; - let count = 0; - for await (const message of stream) { - messages.push(message); - count++; - if (count === 2) { - controller.abort(); - break; - } - } - - expect(messages.length).toBe(2); - }); - }); - - describe("async iteration", () => { - it("should support async iterator protocol", async () => { - const mockStream = createReadableStream(['{"value": 1}\n{"value": 2}\n']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const iterator = stream[Symbol.asyncIterator](); - const first = await iterator.next(); - expect(first.done).toBe(false); - expect(first.value).toEqual({ value: 1 }); - - const second = await iterator.next(); - expect(second.done).toBe(false); - expect(second.value).toEqual({ value: 2 }); - - const third = await iterator.next(); - expect(third.done).toBe(true); - }); - }); - - describe("edge cases", () => { - it("should handle empty stream", async () => { - const mockStream = createReadableStream([]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([]); - }); - - it("should handle stream with only whitespace", async () => { - const mockStream = createReadableStream([" \n\n\t\n "]); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([]); - }); - - it("should handle incomplete message at end of stream", async () => { - const mockStream = createReadableStream(['{"value": 1}\n{"incomplete']); - const stream = new Stream({ - stream: mockStream, - parse: async (val: unknown) => val as { value: number }, - eventShape: { type: "json", messageTerminator: "\n" }, - }); - - const messages: unknown[] = []; - for await (const message of stream) { - messages.push(message); - } - - expect(messages).toEqual([{ value: 1 }]); - }); - }); -}); - -// Helper function to create a ReadableStream from string chunks -function createReadableStream(chunks: (string | Uint8Array)[]): ReadableStream { - // For standard type, return ReadableStream - let index = 0; - return new ReadableStream({ - pull(controller) { - if (index < chunks.length) { - const chunk = chunks[index++]; - controller.enqueue(typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk); - } else { - controller.close(); - } - }, - }); -} diff --git a/tests/wire/agentic.test.ts b/tests/wire/agentic.test.ts deleted file mode 100644 index eae6116b..00000000 --- a/tests/wire/agentic.test.ts +++ /dev/null @@ -1,1078 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../src/api/index"; -import { CortiClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; -import { mockOAuth } from "./mockAuth"; - -describe("AgenticClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - agents: [ - { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "description", - systemPrompt: "systemPrompt", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - labels: { key: "value" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.agentic.list({ - label: ["team=coding"], - q: "coder", - }); - expect(response).toEqual({ - agents: [ - { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "description", - systemPrompt: "systemPrompt", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - labels: { - key: "value", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.agentic.list(); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server.mockEndpoint().get("/v2/agentic/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.agentic.list(); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("create (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { type: "registry", name: "@dedalus/coding-expert" }, - { - type: "mcp", - name: "policybot", - url: "https://mcp.example.com", - auth: { - type: "oauth2", - scope: "read:policies", - redirectUrl: "https://app.corti.ai/oauth/callback", - }, - }, - { - type: "schema", - name: "submit_code", - description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - schema: { - type: "object", - properties: { - code: { type: "string", description: "The selected ICD-10 code." }, - confidence: { type: "number", minimum: 0, maximum: 1 }, - }, - required: ["code"], - }, - transition: "complete", - }, - ], - labels: { team: "coding", env: "prod" }, - }; - const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.create({ - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - type: "registry", - name: "@dedalus/coding-expert", - }, - { - type: "mcp", - name: "policybot", - url: "https://mcp.example.com", - auth: { - type: "oauth2", - scope: "read:policies", - redirectUrl: "https://app.corti.ai/oauth/callback", - }, - }, - { - type: "schema", - name: "submit_code", - description: "Submit the final ICD-10 code for the encounter along with a confidence score.", - schema: { - type: "object", - properties: { - code: { - type: "string", - description: "The selected ICD-10 code.", - }, - confidence: { - type: "number", - minimum: 0, - maximum: 1, - }, - }, - required: ["code"], - }, - transition: "complete", - }, - ], - labels: { - team: "coding", - env: "prod", - }, - }); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }); - }); - - test("create (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.ConflictError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "x" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.create({ - name: "x", - }); - }).rejects.toThrow(Corti.UnprocessableEntityError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.get("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.get("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.get("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("delete (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.delete("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual(undefined); - }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.delete("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.delete("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.delete("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { name: "coder-v2", connectors: [{ type: "registry", name: "@dedalus/coding-expert" }] }; - const rawResponseBody = { - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - labels: { team: "coding", env: "prod" }, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:00Z", - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.update("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - name: "coder-v2", - connectors: [ - { - type: "registry", - name: "@dedalus/coding-expert", - }, - ], - }); - expect(response).toEqual({ - id: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - systemPrompt: "Respond with only the ICD-10 code.", - model: "corti-default", - visibility: "private", - lifecycle: "persistent", - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - labels: { - team: "coding", - env: "prod", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:00.000Z"), - createdBy: "usr.0192f4c8-8bc0-7194-8570-92e3ce81d0a6", - }); - }); - - test("update (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.update("agentId"); - }).rejects.toThrow(Corti.UnprocessableEntityError); - }); - - test("getCard (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - documentationUrl: "documentationUrl", - iconUrl: "iconUrl", - version: "0.1.0", - capabilities: { streaming: true, pushNotifications: false }, - defaultInputModes: ["text/plain"], - defaultOutputModes: ["text/plain"], - provider: { organization: "Corti", url: "https://corti.ai" }, - securityRequirements: [{ key: "value" }], - securitySchemes: { key: "value" }, - signatures: [{ protected: "protected", header: { key: "value" }, signature: "signature" }], - skills: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - name: "coding-expert", - description: "ICD-10 coding.", - tags: ["expert"], - }, - ], - supportedInterfaces: [ - { - protocolBinding: "JSONRPC", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - { - protocolBinding: "HTTP+JSON", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/.well-known/agent-card.json") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.getCard("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual({ - name: "coder", - description: "Returns ICD-10 codes for a clinical encounter.", - documentationUrl: "documentationUrl", - iconUrl: "iconUrl", - version: "0.1.0", - capabilities: { - streaming: true, - pushNotifications: false, - }, - defaultInputModes: ["text/plain"], - defaultOutputModes: ["text/plain"], - provider: { - organization: "Corti", - url: "https://corti.ai", - }, - securityRequirements: [ - { - key: "value", - }, - ], - securitySchemes: { - key: "value", - }, - signatures: [ - { - protected: "protected", - header: { - key: "value", - }, - signature: "signature", - }, - ], - skills: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - name: "coding-expert", - description: "ICD-10 coding.", - tags: ["expert"], - }, - ], - supportedInterfaces: [ - { - protocolBinding: "JSONRPC", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - { - protocolBinding: "HTTP+JSON", - protocolVersion: "1.0", - url: "https://api.eu.corti.app/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a", - }, - ], - }); - }); - - test("getCard (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.getCard("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("getCard (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/.well-known/agent-card.json") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.getCard("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/a2A.test.ts b/tests/wire/agentic/a2A.test.ts deleted file mode 100644 index f538c0d9..00000000 --- a/tests/wire/agentic/a2A.test.ts +++ /dev/null @@ -1,528 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("A2AClient", () => { - test("jsonRpc (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - jsonrpc: "2.0", - id: "1", - method: "SendMessage", - params: { - message: { - role: "ROLE_USER", - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - parts: [{ text: "Code this encounter." }], - }, - }, - }; - const rawResponseBody = { - jsonrpc: "2.0", - id: "msg-001", - result: { - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { state: "TASK_STATE_COMPLETED" }, - }, - }, - error: { code: -32600, message: "Invalid Request", data: { key: "value" } }, - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.jsonRpc("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - id: "1", - method: "SendMessage", - params: { - message: { - role: "ROLE_USER", - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - parts: [ - { - text: "Code this encounter.", - }, - ], - }, - }, - }); - expect(response).toEqual({ - jsonrpc: "2.0", - id: "msg-001", - result: { - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - }, - }, - }, - error: { - code: -32600, - message: "Invalid Request", - data: { - key: "value", - }, - }, - }); - }); - - test("jsonRpc (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.jsonRpc("agentId", { - id: "id", - method: "SendMessage", - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("jsonRpc (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { jsonrpc: "2.0", id: "id", method: "SendMessage" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.jsonRpc("agentId", { - id: "id", - method: "SendMessage", - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("sendMessage (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [{ text: "What is the ICD-10 code for asthma?" }], - }, - }; - const rawResponseBody = { - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - timestamp: "2026-05-19T12:00:01Z", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - }, - }, - artifacts: [{ artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", parts: [{ text: "J45.909" }] }], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.sendMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [ - { - text: "What is the ICD-10 code for asthma?", - }, - ], - }, - }); - expect(response).toEqual({ - task: { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - timestamp: "2026-05-19T12:00:01Z", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - }, - }, - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - }); - }); - - test("sendMessage (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.sendMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("sendMessage (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.sendMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("sendMessage (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:send") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.sendMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("streamMessage (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [{ text: "What is the ICD-10 code for asthma?" }], - }, - }; - const rawResponseBody = - 'event: \ndata: {"data":"{\\"task\\":{\\"id\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_WORKING\\"}}}","event":"message","id":"id","retry":1}\n\n'; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .sseBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.streamMessage("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - role: "ROLE_USER", - parts: [ - { - text: "What is the ICD-10 code for asthma?", - }, - ], - }, - }); - const events: unknown[] = []; - for await (const event of response) { - events.push(event); - } - expect(events).toEqual([ - { - data: '{"task":{"id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_WORKING"}}}', - event: "message", - id: "id", - retry: 1, - }, - ]); - }); - - test("streamMessage (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.streamMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("streamMessage (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.streamMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("streamMessage (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { message: { role: "ROLE_USER", parts: [{}, {}] } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/message:stream") - .header("A2A-Version", "1.0") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.streamMessage("agentId", { - message: { - role: "ROLE_USER", - parts: [{}, {}], - }, - }); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/a2A/tasks.test.ts b/tests/wire/agentic/a2A/tasks.test.ts deleted file mode 100644 index 3f2f6bef..00000000 --- a/tests/wire/agentic/a2A/tasks.test.ts +++ /dev/null @@ -1,701 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../../src/api/index"; -import { CortiClient } from "../../../../src/Client"; -import { mockServerPool } from "../../../mock-server/MockServerPool"; -import { mockOAuth } from "../../mockAuth"; - -describe("TasksClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.tasks.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual({ - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/a2a/tasks") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.list("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ) - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.tasks.get( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.get("agentId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/a2a/tasks/taskId") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.get("agentId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("cancel (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }; - - server - .mockEndpoint() - .post( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:cancel", - ) - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.tasks.cancel( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }); - }); - - test("cancel (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("cancel (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("cancel (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:cancel") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.cancel("agentId", "taskId"); - }).rejects.toThrow(Corti.ConflictError); - }); - - test("subscribe (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = - 'event: \ndata: {"data":"{\\"statusUpdate\\":{\\"taskId\\":\\"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62\\",\\"contextId\\":\\"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51\\",\\"status\\":{\\"state\\":\\"TASK_STATE_COMPLETED\\",\\"timestamp\\":\\"2026-05-19T12:00:01Z\\"}}}","event":"event","id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","retry":1}\n\n'; - - server - .mockEndpoint() - .post( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/a2a/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62:subscribe", - ) - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(200) - .sseBody(rawResponseBody) - .build(); - - const response = await client.agentic.a2A.tasks.subscribe( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - const events: unknown[] = []; - for await (const event of response) { - events.push(event); - } - expect(events).toEqual([ - { - data: '{"statusUpdate":{"taskId":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_COMPLETED","timestamp":"2026-05-19T12:00:01Z"}}}', - event: "event", - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - retry: 1, - }, - ]); - }); - - test("subscribe (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("subscribe (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/a2a/tasks/taskId:subscribe") - .header("A2A-Version", "1.0") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.a2A.tasks.subscribe("agentId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/artifacts.test.ts b/tests/wire/agentic/artifacts.test.ts deleted file mode 100644 index ef140243..00000000 --- a/tests/wire/agentic/artifacts.test.ts +++ /dev/null @@ -1,161 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("ArtifactsClient", () => { - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [ - { - text: "J45.909", - data: { key: "value" }, - filename: "filename", - mediaType: "mediaType", - raw: "raw", - url: "url", - metadata: { key: "value" }, - }, - ], - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/artifacts/art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.artifacts.get( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - ); - expect(response).toEqual({ - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - data: { - key: "value", - }, - filename: "filename", - mediaType: "mediaType", - raw: "raw", - url: "url", - metadata: { - key: "value", - }, - }, - ], - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); - }).rejects.toThrow(Corti.ForbiddenError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/artifacts/artifactId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.artifacts.get("contextId", "taskId", "artifactId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/connectors.test.ts b/tests/wire/agentic/connectors.test.ts deleted file mode 100644 index 22533425..00000000 --- a/tests/wire/agentic/connectors.test.ts +++ /dev/null @@ -1,620 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("ConnectorsClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.list("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40"); - expect(response).toEqual({ - connectors: [ - { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }, - ], - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.list("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.list("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("attach (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "@dedalus/coding-expert" }; - const rawResponseBody = { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.attach("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - type: "registry", - name: "@dedalus/coding-expert", - }); - expect(response).toEqual({ - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }); - }); - - test("attach (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("attach (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("attach (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("attach (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { type: "registry", name: "name" }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/agents/agentId/connectors") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.attach("agentId", { - type: "registry", - name: "name", - }); - }).rejects.toThrow(Corti.ConflictError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.get( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ); - expect(response).toEqual({ - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.get("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.get("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("remove (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.connectors.remove( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ); - expect(response).toEqual(undefined); - }); - - test("remove (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.remove("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("remove (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.remove("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { enabled: false }; - const rawResponseBody = { - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { key: "value" }, - }; - - server - .mockEndpoint() - .patch( - "/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/connectors/con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - ) - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.connectors.update( - "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - { - enabled: false, - }, - ); - expect(response).toEqual({ - id: "con.0192f4c8-7baf-7083-a46f-81d2bd70cf95", - type: "registry", - enabled: true, - name: "@dedalus/coding-expert", - config: { - key: "value", - }, - }); - }); - - test("update (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { error: { code: "code", message: "message" } }; - - server - .mockEndpoint() - .patch("/v2/agentic/agents/agentId/connectors/agentConnectorId") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(501) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.connectors.update("agentId", "agentConnectorId"); - }).rejects.toThrow(Corti.NotImplementedError); - }); -}); diff --git a/tests/wire/agentic/contexts.test.ts b/tests/wire/agentic/contexts.test.ts deleted file mode 100644 index 9cb00a4b..00000000 --- a/tests/wire/agentic/contexts.test.ts +++ /dev/null @@ -1,523 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("ContextsClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - contexts: [ - { - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - expiresAt: "2024-01-15T09:30:00Z", - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.contexts.list(); - expect(response).toEqual({ - contexts: [ - { - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - expiresAt: new Date("2024-01-15T09:30:00.000Z"), - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.list(); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: "2026-05-19T12:00:00Z", - updatedAt: "2026-05-19T12:00:01Z", - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{ text: "Code this encounter: acute asthma exacerbation." }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.901" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [{ text: "J45.901" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.contexts.get("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - expect(response).toEqual({ - id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - agentId: "agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", - taskCount: 1, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - updatedAt: new Date("2026-05-19T12:00:01.000Z"), - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5a01-7c10-8a2b-1f3c5d7e9b00", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [ - { - text: "Code this encounter: acute asthma exacerbation.", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.901", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [ - { - text: "J45.901", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.get("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.get("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("delete (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.contexts.delete("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - expect(response).toEqual(undefined); - }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.delete("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.delete("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("getTrace (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - traces: [ - { - trace: { - id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", - name: "invoke_agent", - start_time: "2026-05-19T12:00:00Z", - thread_id: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - }, - spans: [ - { - name: "invoke_llm", - span_id: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", - start_time: "2026-05-19T12:00:00Z", - }, - ], - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/trace") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.contexts.getTrace("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - expect(response).toEqual({ - traces: [ - { - trace: { - id: "0192f4c85f3a7e8ab1c23d4e5f6a7b8c", - name: "invoke_agent", - startTime: new Date("2026-05-19T12:00:00.000Z"), - threadId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - }, - spans: [ - { - name: "invoke_llm", - spanId: "span.0192f4c8-6e1a-7f2b-9c3d-4e5f6a7b8c9d", - startTime: new Date("2026-05-19T12:00:00.000Z"), - }, - ], - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }); - }); - - test("getTrace (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/trace") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.getTrace("contextId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("getTrace (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/trace") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.getTrace("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("getTrace (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/trace") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.getTrace("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/contexts/tasks.test.ts b/tests/wire/agentic/contexts/tasks.test.ts deleted file mode 100644 index 97a70d33..00000000 --- a/tests/wire/agentic/contexts/tasks.test.ts +++ /dev/null @@ -1,393 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../../src/api/index"; -import { CortiClient } from "../../../../src/Client"; -import { mockServerPool } from "../../../mock-server/MockServerPool"; -import { mockOAuth } from "../../mockAuth"; - -describe("TasksClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.contexts.tasks.list("ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51"); - expect(response).toEqual({ - pageSize: 1, - tasks: [ - { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.list("contextId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.list("contextId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - timestamp: "2026-05-19T12:00:01Z", - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [{ text: "J45.909" }], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { key: "value" }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { key: "value" }, - parts: [{ text: "J45.909" }], - }, - ], - metadata: { - $usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.contexts.tasks.get( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - id: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - status: { - state: "TASK_STATE_COMPLETED", - message: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_USER", - parts: [{}], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - timestamp: new Date("2026-05-19T12:00:01.000Z"), - }, - history: [ - { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - contextId: "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - role: "ROLE_AGENT", - parts: [ - { - text: "J45.909", - }, - ], - referenceTaskIds: ["task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62"], - extensions: ["extensions"], - metadata: { - key: "value", - }, - }, - ], - artifacts: [ - { - artifactId: "art.0192f4c8-6a9e-7f72-a35e-70c1ac6fbe84", - name: "icd10-result", - description: "description", - extensions: ["extensions"], - metadata: { - key: "value", - }, - parts: [ - { - text: "J45.909", - }, - ], - }, - ], - metadata: { - usage: { - model: "corti-default", - inputTokens: 100, - outputTokens: 20, - cachedInputTokens: 64, - cacheCreationInputTokens: 0, - totalTokens: 120, - credits: 1.2, - }, - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.get("contextId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.contexts.tasks.get("contextId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/feedback.test.ts b/tests/wire/agentic/feedback.test.ts deleted file mode 100644 index e911afb5..00000000 --- a/tests/wire/agentic/feedback.test.ts +++ /dev/null @@ -1,511 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("FeedbackClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - feedbacks: [ - { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { scale: "binary", value: 1 }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { collectionMethod: "thumbs" }, - createdAt: "2026-05-19T12:00:00Z", - }, - ], - }; - - server - .mockEndpoint() - .get( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", - ) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.feedback.list( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - ); - expect(response).toEqual({ - feedbacks: [ - { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { - scale: "binary", - value: 1, - }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "thumbs", - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - }, - ], - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.list("contextId", "taskId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.list("contextId", "taskId"); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("create (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1 } }; - const rawResponseBody = { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { scale: "binary", value: 1 }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { externalId: "externalId" }, - }, - createdAt: "2026-05-19T12:00:00Z", - }; - - server - .mockEndpoint() - .post( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", - ) - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.feedback.create( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - { - rating: { - scale: "binary", - value: 1, - }, - }, - ); - expect(response).toEqual({ - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { - scale: "binary", - value: 1, - }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { - externalId: "externalId", - }, - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - }); - }); - - test("create (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { - rating: { scale: "binary", value: 0 }, - labels: ["unsupportedClaim"], - reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { - collectionMethod: "caseReview", - clientReference: "case-review-728193", - actor: { externalId: "clinician_4182" }, - }, - }; - const rawResponseBody = { - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { scale: "binary", value: 1 }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73" }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { externalId: "externalId" }, - }, - createdAt: "2026-05-19T12:00:00Z", - }; - - server - .mockEndpoint() - .post( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback", - ) - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.feedback.create( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - { - rating: { - scale: "binary", - value: 0, - }, - labels: ["unsupportedClaim"], - reason: "The response stated that the patient had diabetes, but this was not present in the available data.", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "caseReview", - clientReference: "case-review-728193", - actor: { - externalId: "clinician_4182", - }, - }, - }, - ); - expect(response).toEqual({ - id: "fb.0192f4c8-9a3b-7e2f-9c4d-5a6b7c8d9e0f", - taskId: "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - rating: { - scale: "binary", - value: 1, - }, - normalizedScore: 1, - labels: ["correct", "helpful"], - reason: "The response stated the patient had diabetes", - target: { - messageId: "msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73", - }, - metadata: { - collectionMethod: "thumbs", - clientReference: "clientReference", - actor: { - externalId: "externalId", - }, - }, - createdAt: new Date("2026-05-19T12:00:00.000Z"), - }); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.NotFoundError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - const rawRequestBody = { rating: { scale: "binary", value: 1.1 } }; - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .post("/v2/agentic/contexts/contextId/tasks/taskId/feedback") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.create("contextId", "taskId", { - rating: { - scale: "binary", - value: 1.1, - }, - }); - }).rejects.toThrow(Corti.UnprocessableEntityError); - }); - - test("delete (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete( - "/v2/agentic/contexts/ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51/tasks/task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62/feedback/fb.0192f4c8-7e2a-7b3c-9d4e-5f6a7b8c9d01", - ) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.agentic.feedback.delete( - "ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51", - "task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62", - "fb.0192f4c8-7e2a-7b3c-9d4e-5f6a7b8c9d01", - ); - expect(response).toEqual(undefined); - }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback/feedbackId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.delete("contextId", "taskId", "feedbackId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .delete("/v2/agentic/contexts/contextId/tasks/taskId/feedback/feedbackId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.feedback.delete("contextId", "taskId", "feedbackId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/registry.test.ts b/tests/wire/agentic/registry.test.ts deleted file mode 100644 index 582607aa..00000000 --- a/tests/wire/agentic/registry.test.ts +++ /dev/null @@ -1,239 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("RegistryClient", () => { - test("list (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - connectors: [ - { - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "description", - version: "1.4.2", - icons: [{ src: "src", mimeType: "image/svg+xml", sizes: ["48x48"] }], - provider: "Dedalus", - websiteUrl: "websiteUrl", - documentationUrl: "documentationUrl", - tags: ["tags"], - configSchema: { key: "value" }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.registry.list(); - expect(response).toEqual({ - connectors: [ - { - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "description", - version: "1.4.2", - icons: [ - { - src: "src", - mimeType: "image/svg+xml", - sizes: ["48x48"], - }, - ], - provider: "Dedalus", - websiteUrl: "websiteUrl", - documentationUrl: "documentationUrl", - tags: ["tags"], - configSchema: { - key: "value", - }, - }, - ], - nextPageToken: "nextPageToken", - totalSize: 42, - }); - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.registry.list(); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "Returns ICD-10 codes for a clinical encounter.", - version: "1.4.2", - icons: [ - { - src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", - mimeType: "image/svg+xml", - sizes: ["any"], - }, - ], - provider: "Dedalus", - websiteUrl: "https://dedalus.example.com/coding-expert", - documentationUrl: "https://docs.dedalus.example.com/coding-expert", - capabilities: { - streaming: true, - inputModes: ["text/plain"], - outputModes: ["text/plain", "application/json"], - tools: ["lookup_icd10", "validate_code"], - }, - tags: ["icd10", "billing", "expert"], - configSchema: { key: "value" }, - }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors/connectorId") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.registry.get("connectorId"); - expect(response).toEqual({ - id: "@dedalus/coding-expert", - type: "registry", - name: "coding-expert", - title: "ICD-10 Coding Expert", - description: "Returns ICD-10 codes for a clinical encounter.", - version: "1.4.2", - icons: [ - { - src: "https://cdn.corti.ai/registry/dedalus/coding-expert.svg", - mimeType: "image/svg+xml", - sizes: ["any"], - }, - ], - provider: "Dedalus", - websiteUrl: "https://dedalus.example.com/coding-expert", - documentationUrl: "https://docs.dedalus.example.com/coding-expert", - capabilities: { - streaming: true, - inputModes: ["text/plain"], - outputModes: ["text/plain", "application/json"], - tools: ["lookup_icd10", "validate_code"], - }, - tags: ["icd10", "billing", "expert"], - configSchema: { - key: "value", - }, - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors/connectorId") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.registry.get("connectorId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/registry/connectors/connectorId") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.registry.get("connectorId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); diff --git a/tests/wire/agentic/usage.test.ts b/tests/wire/agentic/usage.test.ts deleted file mode 100644 index c7586319..00000000 --- a/tests/wire/agentic/usage.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as Corti from "../../../src/api/index"; -import { CortiClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; -import { mockOAuth } from "../mockAuth"; - -describe("UsageClient", () => { - test("get (1)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { - granularity: "day", - from: "2026-05-19T00:00:00Z", - to: "2026-05-21T00:00:00Z", - totals: { invocations: 15, uniqueContexts: 6 }, - buckets: [ - { - invocations: 12, - uniqueContexts: 5, - periodStart: "2026-05-19T00:00:00Z", - periodEnd: "2026-05-20T00:00:00Z", - }, - { - invocations: 3, - uniqueContexts: 2, - periodStart: "2026-05-20T00:00:00Z", - periodEnd: "2026-05-21T00:00:00Z", - }, - ], - }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40/usage") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.agentic.usage.get("agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40", { - from: new Date("2026-05-19T00:00:00.000Z"), - to: new Date("2026-05-20T00:00:00.000Z"), - }); - expect(response).toEqual({ - granularity: "day", - from: new Date("2026-05-19T00:00:00.000Z"), - to: new Date("2026-05-21T00:00:00.000Z"), - totals: { - invocations: 15, - uniqueContexts: 6, - }, - buckets: [ - { - invocations: 12, - uniqueContexts: 5, - periodStart: new Date("2026-05-19T00:00:00.000Z"), - periodEnd: new Date("2026-05-20T00:00:00.000Z"), - }, - { - invocations: 3, - uniqueContexts: 2, - periodStart: new Date("2026-05-20T00:00:00.000Z"), - periodEnd: new Date("2026-05-21T00:00:00.000Z"), - }, - ], - }); - }); - - test("get (2)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/usage") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.usage.get("agentId"); - }).rejects.toThrow(Corti.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/usage") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.usage.get("agentId"); - }).rejects.toThrow(Corti.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - mockOAuth(server); - - const client = new CortiClient({ - maxRetries: 0, - clientId: "client_id", - clientSecret: "client_secret", - tenantName: "test", - environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - - server - .mockEndpoint() - .get("/v2/agentic/agents/agentId/usage") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.agentic.usage.get("agentId"); - }).rejects.toThrow(Corti.NotFoundError); - }); -}); From 0271ea3236d06af9ee8d4ee304f51597555fcdd1 Mon Sep 17 00:00:00 2001 From: markitosha Date: Wed, 29 Jul 2026 16:56:02 +0200 Subject: [PATCH 12/18] revert(agents): remove CustomAgentic wrapper layer Drop the v2 agentic custom client and restore agents helpers without deprecation toward agentic. --- src/custom/CortiClient.ts | 7 ------- src/custom/agents/CustomAgentic.ts | 27 --------------------------- src/custom/agents/CustomAgents.ts | 5 +---- 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 src/custom/agents/CustomAgentic.ts diff --git a/src/custom/CortiClient.ts b/src/custom/CortiClient.ts index 34646a89..d39323e8 100644 --- a/src/custom/CortiClient.ts +++ b/src/custom/CortiClient.ts @@ -1,7 +1,6 @@ import { CortiClient as BaseCortiClient } from "../Client.js"; import * as core from "../core/index.js"; import type * as environments from "../environments.js"; -import { CustomAgentic } from "./agents/CustomAgentic.js"; import { CustomAgents } from "./agents/CustomAgents.js"; import { CortiAuth } from "./auth/CortiAuth.js"; import { CustomStream } from "./stream/CustomStream.js"; @@ -46,7 +45,6 @@ export class CortiClient extends BaseCortiClient { protected override _stream: CustomStream | undefined; protected override _transcribe: CustomTranscribe | undefined; protected override _agents: CustomAgents | undefined; - protected override _agentic: CustomAgentic | undefined; private readonly _encodeHeadersAsWsProtocols: boolean | undefined; @@ -89,15 +87,10 @@ export class CortiClient extends BaseCortiClient { })); } - /** @deprecated Use {@link CortiClient.agentic} (Agents API v2) instead. */ public override get agents(): CustomAgents { return (this._agents ??= new CustomAgents(this._options)); } - public override get agentic(): CustomAgentic { - return (this._agentic ??= new CustomAgentic(this._options)); - } - /** * Returns the full set of URLs the client is configured to use. * diff --git a/src/custom/agents/CustomAgentic.ts b/src/custom/agents/CustomAgentic.ts deleted file mode 100644 index 81bf63cf..00000000 --- a/src/custom/agents/CustomAgentic.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Custom implementation of the Agentic client (src/api/resources/agentic/client/Client.ts). - * Extends the auto-generated AgenticClient with helper methods for Agents API v2. - */ - -import { AgenticClient } from "../../api/resources/agentic/client/Client.js"; -import * as core from "../../core/index.js"; - -export class CustomAgentic extends AgenticClient { - /** - * Returns the URL for the agent card JSON file (A2A well-known path). - * - * @param {string} agentId - The ID of the agent - * @returns {Promise} A Promise that resolves to the URL for the agent card - * - * @example - * const url = await client.agentic.getCardUrl("agent-123"); - */ - public getCardUrl = async (agentId: string): Promise => { - const encodedAgentId = encodeURIComponent(agentId); - - return new URL( - `/v2/agentic/agents/${encodedAgentId}/.well-known/agent-card.json`, - (await core.Supplier.get(this._options.environment)).agents, - ); - }; -} diff --git a/src/custom/agents/CustomAgents.ts b/src/custom/agents/CustomAgents.ts index 166767ed..07e02229 100644 --- a/src/custom/agents/CustomAgents.ts +++ b/src/custom/agents/CustomAgents.ts @@ -3,13 +3,12 @@ * * It extends the auto-generated Agents class and adds custom helper methods. * - * @deprecated Use {@link CustomAgentic} / `client.agentic` (Agents API v2) instead. + * All the patches marked with `// Patch: ...` comments. */ import { AgentsClient } from "../../api/resources/agents/client/Client.js"; import * as core from "../../core/index.js"; -/** @deprecated Use `client.agentic` (Agents API v2) instead. */ export class CustomAgents extends AgentsClient { /** * Returns the URL for the agent card JSON file. @@ -17,8 +16,6 @@ export class CustomAgents extends AgentsClient { * @param {string} agentId - The ID of the agent * @returns {Promise} A Promise that resolves to the URL for the agent card * - * @deprecated Use `client.agentic.getCardUrl` instead. - * * @example * const url = await client.agents.getCardUrl("agent-123"); */ From 1911d84b082dd6956de6b5f22e03162d1f00dfed Mon Sep 17 00:00:00 2001 From: markitosha Date: Wed, 29 Jul 2026 16:57:44 +0200 Subject: [PATCH 13/18] revert(custom): drop optional tenantName coercion Restore required-tenantName handling in CortiClient, CortiAuth, stream, and transcribe after the Agents v2 workaround. --- src/custom/CortiClient.ts | 2 +- src/custom/auth/CortiAuth.ts | 4 +++- src/custom/stream/CustomStream.ts | 2 +- src/custom/transcribe/CustomTranscribe.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/custom/CortiClient.ts b/src/custom/CortiClient.ts index d39323e8..67b80128 100644 --- a/src/custom/CortiClient.ts +++ b/src/custom/CortiClient.ts @@ -133,7 +133,7 @@ export class CortiClient extends BaseCortiClient { return new Headers({ ...(req.headers ?? {}), - "Tenant-Name": (await core.Supplier.get(this._options.tenantName)) ?? "", + "Tenant-Name": await core.Supplier.get(this._options.tenantName), }); }; } diff --git a/src/custom/auth/CortiAuth.ts b/src/custom/auth/CortiAuth.ts index 8f103ed7..84cf945a 100644 --- a/src/custom/auth/CortiAuth.ts +++ b/src/custom/auth/CortiAuth.ts @@ -113,11 +113,13 @@ export class CortiAuth extends AuthClient { const { environment, tenantName, ...rest } = options; super({ ...rest, + // @ts-expect-error it suppose to be required, but we need to filter out header without rewriting too much + tenantName: null, environment: getEnvironment(environment), token: options.token ?? (() => ""), }); - this._tenantName = async () => (await core.Supplier.get(tenantName)) ?? ""; + this._tenantName = tenantName; this._options.authProvider = new core.NoOpAuthProvider(); /** Stripping Fern headers to bypass CORS on authentication requests */ diff --git a/src/custom/stream/CustomStream.ts b/src/custom/stream/CustomStream.ts index d5557814..62e5c1f1 100644 --- a/src/custom/stream/CustomStream.ts +++ b/src/custom/stream/CustomStream.ts @@ -63,7 +63,7 @@ export class CustomStream extends StreamClient { await super.connect({ ...rest, token: (await this._options.authProvider?.getAuthRequest())?.headers.Authorization || "", - tenantName: (await core.Supplier.get(this._options.tenantName)) ?? "", + tenantName: await core.Supplier.get(this._options.tenantName), }) ).socket; diff --git a/src/custom/transcribe/CustomTranscribe.ts b/src/custom/transcribe/CustomTranscribe.ts index a93ae0a5..ce6d7909 100644 --- a/src/custom/transcribe/CustomTranscribe.ts +++ b/src/custom/transcribe/CustomTranscribe.ts @@ -62,7 +62,7 @@ export class CustomTranscribe extends TranscribeClient { await super.connect({ ...rest, token: (await this._options.authProvider?.getAuthRequest())?.headers.Authorization || "", - tenantName: (await core.Supplier.get(this._options.tenantName)) ?? "", + tenantName: await core.Supplier.get(this._options.tenantName), }) ).socket; From a9d3829a4cd8f510a757fdc2c3d4de3b13d760b7 Mon Sep 17 00:00:00 2001 From: markitosha Date: Wed, 29 Jul 2026 16:59:34 +0200 Subject: [PATCH 14/18] deprecate(agents): mark CustomAgents and client.agents deprecated Align custom agents helpers with the deprecated Agents API v1 surface. --- src/custom/CortiClient.ts | 1 + src/custom/agents/CustomAgents.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/custom/CortiClient.ts b/src/custom/CortiClient.ts index 67b80128..213d1e09 100644 --- a/src/custom/CortiClient.ts +++ b/src/custom/CortiClient.ts @@ -87,6 +87,7 @@ export class CortiClient extends BaseCortiClient { })); } + /** @deprecated */ public override get agents(): CustomAgents { return (this._agents ??= new CustomAgents(this._options)); } diff --git a/src/custom/agents/CustomAgents.ts b/src/custom/agents/CustomAgents.ts index 07e02229..f106aadd 100644 --- a/src/custom/agents/CustomAgents.ts +++ b/src/custom/agents/CustomAgents.ts @@ -3,12 +3,13 @@ * * It extends the auto-generated Agents class and adds custom helper methods. * - * All the patches marked with `// Patch: ...` comments. + * @deprecated */ import { AgentsClient } from "../../api/resources/agents/client/Client.js"; import * as core from "../../core/index.js"; +/** @deprecated */ export class CustomAgents extends AgentsClient { /** * Returns the URL for the agent card JSON file. @@ -16,6 +17,8 @@ export class CustomAgents extends AgentsClient { * @param {string} agentId - The ID of the agent * @returns {Promise} A Promise that resolves to the URL for the agent card * + * @deprecated + * * @example * const url = await client.agents.getCardUrl("agent-123"); */ From 854f7633ffe9034ecd80078bdd828c6990f18c8d Mon Sep 17 00:00:00 2001 From: markitosha Date: Wed, 29 Jul 2026 17:00:51 +0200 Subject: [PATCH 15/18] =?UTF-8?q?docs(agents):=20point=20deprecation=20to?= =?UTF-8?q?=20v1=E2=86=92v2=20migration=20guide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/custom/CortiClient.ts | 2 +- src/custom/agents/CustomAgents.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/custom/CortiClient.ts b/src/custom/CortiClient.ts index 213d1e09..3474f68a 100644 --- a/src/custom/CortiClient.ts +++ b/src/custom/CortiClient.ts @@ -87,7 +87,7 @@ export class CortiClient extends BaseCortiClient { })); } - /** @deprecated */ + /** @deprecated Migrate to the Agentic API v2. See https://docs.corti.ai/agentic/guides/migrate-v1-to-v2 */ public override get agents(): CustomAgents { return (this._agents ??= new CustomAgents(this._options)); } diff --git a/src/custom/agents/CustomAgents.ts b/src/custom/agents/CustomAgents.ts index f106aadd..8a1b9d34 100644 --- a/src/custom/agents/CustomAgents.ts +++ b/src/custom/agents/CustomAgents.ts @@ -3,13 +3,13 @@ * * It extends the auto-generated Agents class and adds custom helper methods. * - * @deprecated + * @deprecated Migrate to the Agentic API v2. See https://docs.corti.ai/agentic/guides/migrate-v1-to-v2 */ import { AgentsClient } from "../../api/resources/agents/client/Client.js"; import * as core from "../../core/index.js"; -/** @deprecated */ +/** @deprecated Migrate to the Agentic API v2. See https://docs.corti.ai/agentic/guides/migrate-v1-to-v2 */ export class CustomAgents extends AgentsClient { /** * Returns the URL for the agent card JSON file. @@ -17,7 +17,7 @@ export class CustomAgents extends AgentsClient { * @param {string} agentId - The ID of the agent * @returns {Promise} A Promise that resolves to the URL for the agent card * - * @deprecated + * @deprecated Migrate to the Agentic API v2. See https://docs.corti.ai/agentic/guides/migrate-v1-to-v2 * * @example * const url = await client.agents.getCardUrl("agent-123"); From 43c518628859933bc29c07287d01e8705e36b8e4 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:03:36 +0000 Subject: [PATCH 16/18] SDK regeneration --- .fern/metadata.json | 2 +- src/api/resources/agents/client/Client.ts | 8 ++++---- ...gentsMessageSendParams.ts => AgentsMessageSendBody.ts} | 2 +- src/api/resources/agents/client/requests/index.ts | 2 +- ...gentsMessageSendParams.ts => AgentsMessageSendBody.ts} | 8 ++++---- .../resources/agents/client/requests/index.ts | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) rename src/api/resources/agents/client/requests/{AgentsMessageSendParams.ts => AgentsMessageSendBody.ts} (93%) rename src/serialization/resources/agents/client/requests/{AgentsMessageSendParams.ts => AgentsMessageSendBody.ts} (81%) diff --git a/.fern/metadata.json b/.fern/metadata.json index 3d9a15aa..fd56fc29 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "0e0a17b9a349bf6fce6186765bca1ab0273fbd73", + "originGitCommit": "cca970992e22fc2f1118c5f5254bbab052d7a745", "sdkVersion": "0.0.0-dev" } diff --git a/src/api/resources/agents/client/Client.ts b/src/api/resources/agents/client/Client.ts index f3b9e853..9fe90217 100644 --- a/src/api/resources/agents/client/Client.ts +++ b/src/api/resources/agents/client/Client.ts @@ -533,7 +533,7 @@ export class AgentsClient { * This endpoint sends a message to the specified agent to start or continue a task. The agent processes the message and returns a response. If the message contains a task ID that matches an ongoing task, the agent will continue that task; otherwise, it will start a new task. * * @param {string} id - The identifier of the agent associated with the context. - * @param {Corti.AgentsMessageSendParams} request + * @param {Corti.AgentsMessageSendBody} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -557,7 +557,7 @@ export class AgentsClient { */ public messageSend( id: string, - request: Corti.AgentsMessageSendParams, + request: Corti.AgentsMessageSendBody, requestOptions?: AgentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__messageSend(id, request, requestOptions)); @@ -565,7 +565,7 @@ export class AgentsClient { private async __messageSend( id: string, - request: Corti.AgentsMessageSendParams, + request: Corti.AgentsMessageSendBody, requestOptions?: AgentsClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -586,7 +586,7 @@ export class AgentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.AgentsMessageSendParams.jsonOrThrow(request, { + body: serializers.AgentsMessageSendBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/agents/client/requests/AgentsMessageSendParams.ts b/src/api/resources/agents/client/requests/AgentsMessageSendBody.ts similarity index 93% rename from src/api/resources/agents/client/requests/AgentsMessageSendParams.ts rename to src/api/resources/agents/client/requests/AgentsMessageSendBody.ts index 53f9cf2e..922b0bda 100644 --- a/src/api/resources/agents/client/requests/AgentsMessageSendParams.ts +++ b/src/api/resources/agents/client/requests/AgentsMessageSendBody.ts @@ -16,7 +16,7 @@ import type * as Corti from "../../../../index.js"; * } * } */ -export interface AgentsMessageSendParams { +export interface AgentsMessageSendBody { message: Corti.AgentsMessage; configuration?: Corti.AgentsMessageSendConfiguration; /** Optional metadata that will be associated with the message. */ diff --git a/src/api/resources/agents/client/requests/index.ts b/src/api/resources/agents/client/requests/index.ts index e43b0bbc..dbc8bcb0 100644 --- a/src/api/resources/agents/client/requests/index.ts +++ b/src/api/resources/agents/client/requests/index.ts @@ -3,5 +3,5 @@ export type { AgentsGetContextRequest } from "./AgentsGetContextRequest.js"; export type { AgentsGetRegistryExpertsRequest } from "./AgentsGetRegistryExpertsRequest.js"; export type { AgentsGetTaskRequest } from "./AgentsGetTaskRequest.js"; export type { AgentsListRequest } from "./AgentsListRequest.js"; -export type { AgentsMessageSendParams } from "./AgentsMessageSendParams.js"; +export type { AgentsMessageSendBody } from "./AgentsMessageSendBody.js"; export type { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; diff --git a/src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts b/src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts similarity index 81% rename from src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts rename to src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts index 24247fb7..0fc3860b 100644 --- a/src/serialization/resources/agents/client/requests/AgentsMessageSendParams.ts +++ b/src/serialization/resources/agents/client/requests/AgentsMessageSendBody.ts @@ -6,16 +6,16 @@ import type * as serializers from "../../../../index.js"; import { AgentsMessage } from "../../../../types/AgentsMessage.js"; import { AgentsMessageSendConfiguration } from "../../../../types/AgentsMessageSendConfiguration.js"; -export const AgentsMessageSendParams: core.serialization.Schema< - serializers.AgentsMessageSendParams.Raw, - Corti.AgentsMessageSendParams +export const AgentsMessageSendBody: core.serialization.Schema< + serializers.AgentsMessageSendBody.Raw, + Corti.AgentsMessageSendBody > = core.serialization.object({ message: AgentsMessage, configuration: AgentsMessageSendConfiguration.optional(), metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), }); -export declare namespace AgentsMessageSendParams { +export declare namespace AgentsMessageSendBody { export interface Raw { message: AgentsMessage.Raw; configuration?: AgentsMessageSendConfiguration.Raw | null; diff --git a/src/serialization/resources/agents/client/requests/index.ts b/src/serialization/resources/agents/client/requests/index.ts index 36d03a60..2ec1ca0a 100644 --- a/src/serialization/resources/agents/client/requests/index.ts +++ b/src/serialization/resources/agents/client/requests/index.ts @@ -1,3 +1,3 @@ export { AgentsCreateAgent } from "./AgentsCreateAgent.js"; -export { AgentsMessageSendParams } from "./AgentsMessageSendParams.js"; +export { AgentsMessageSendBody } from "./AgentsMessageSendBody.js"; export { AgentsUpdateAgent } from "./AgentsUpdateAgent.js"; From a8bd08c1eaacfc6e5a8223c1e7be6ba41c82ff63 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:15:10 +0000 Subject: [PATCH 17/18] SDK regeneration --- .fern/metadata.json | 2 +- src/BaseClient.ts | 5 - src/api/resources/agents/client/Client.ts | 13 +- src/api/resources/auth/client/Client.ts | 17 +- ...okenRequestBody.ts => AuthTokenRequest.ts} | 2 +- src/api/resources/auth/types/index.ts | 2 +- src/api/resources/codes/client/Client.ts | 3 +- src/api/resources/documents/client/Client.ts | 52 +-- .../client/requests/CreateDocumentsRequest.ts | 24 ++ .../requests/GenerateDocumentsRequest.ts | 20 ++ .../documents/client/requests/index.ts | 2 + src/api/resources/documents/index.ts | 1 + .../resources/sections/client/Client.ts | 7 +- .../resources/versions/client/Client.ts | 7 +- .../resources/templates/client/Client.ts | 7 +- .../resources/versions/client/Client.ts | 7 +- ...teDocumentsRequestXCortiRetentionPolicy.ts | 7 + ...teDocumentsRequestXCortiRetentionPolicy.ts | 7 + src/api/resources/documents/types/index.ts | 2 + src/api/resources/facts/client/Client.ts | 8 +- src/api/resources/index.ts | 1 + .../resources/interactions/client/Client.ts | 7 +- src/api/resources/languages/client/Client.ts | 3 +- src/api/resources/recordings/client/Client.ts | 6 +- src/api/resources/templates/client/Client.ts | 5 +- .../resources/transcripts/client/Client.ts | 7 +- ...okenRequestBody.ts => AuthTokenRequest.ts} | 20 +- .../resources/auth/types/index.ts | 2 +- .../resources/documents/index.ts | 1 + ...teDocumentsRequestXCortiRetentionPolicy.ts | 14 + ...teDocumentsRequestXCortiRetentionPolicy.ts | 14 + .../resources/documents/types/index.ts | 2 + src/serialization/resources/index.ts | 1 + tests/wire/agents.test.ts | 47 --- tests/wire/auth.test.ts | 4 - tests/wire/codes.test.ts | 7 - tests/wire/documents.test.ts | 312 +++++++++--------- tests/wire/documents/sections.test.ts | 11 - .../wire/documents/sections/versions.test.ts | 11 - tests/wire/documents/templates.test.ts | 11 - .../wire/documents/templates/versions.test.ts | 11 - tests/wire/facts.test.ts | 12 - tests/wire/interactions.test.ts | 17 - tests/wire/languages.test.ts | 3 - tests/wire/recordings.test.ts | 10 - tests/wire/templates.test.ts | 9 - tests/wire/transcripts.test.ts | 26 -- 47 files changed, 305 insertions(+), 464 deletions(-) rename src/api/resources/auth/types/{AuthTokenRequestBody.ts => AuthTokenRequest.ts} (90%) create mode 100644 src/api/resources/documents/client/requests/CreateDocumentsRequest.ts create mode 100644 src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts create mode 100644 src/api/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts create mode 100644 src/api/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts create mode 100644 src/api/resources/documents/types/index.ts rename src/serialization/resources/auth/types/{AuthTokenRequestBody.ts => AuthTokenRequest.ts} (70%) create mode 100644 src/serialization/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts create mode 100644 src/serialization/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts create mode 100644 src/serialization/resources/documents/types/index.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index fd56fc29..71b03082 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "cca970992e22fc2f1118c5f5254bbab052d7a745", + "originGitCommit": "9561e1d4e7fbac710c5706080074443c598630f2", "sdkVersion": "0.0.0-dev" } diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 1b76cbaa..50d2b1af 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -9,8 +9,6 @@ export type BaseClientOptions = { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - /** Override the Tenant-Name header */ - tenantName: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | null | undefined>; /** The default maximum time to wait for a response in seconds. */ @@ -30,8 +28,6 @@ export interface BaseRequestOptions { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; - /** Override the Tenant-Name header */ - tenantName?: string; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ @@ -59,7 +55,6 @@ export function normalizeClientOptions> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), - requestOptions?.headers, - ); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -98,7 +94,7 @@ export class AuthClient { * authorization_code (with client_secret), authorization_code with PKCE (code_verifier), password (ROPC), or refresh_token. Use the returned access_token in the Authorization header when calling the Corti API. * * @param {string} tenantName - * @param {Corti.AuthTokenRequestBody} request + * @param {Corti.AuthTokenRequest} request * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -113,7 +109,7 @@ export class AuthClient { */ public token( tenantName: string, - request: Corti.AuthTokenRequestBody, + request: Corti.AuthTokenRequest, requestOptions?: AuthClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__token(tenantName, request, requestOptions)); @@ -121,14 +117,13 @@ export class AuthClient { private async __token( tenantName: string, - request: Corti.AuthTokenRequestBody, + request: Corti.AuthTokenRequest, requestOptions?: AuthClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -142,7 +137,7 @@ export class AuthClient { contentType: "application/x-www-form-urlencoded", queryParameters: requestOptions?.queryParams, requestType: "form", - body: serializers.AuthTokenRequestBody.jsonOrThrow(request, { + body: serializers.AuthTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/auth/types/AuthTokenRequestBody.ts b/src/api/resources/auth/types/AuthTokenRequest.ts similarity index 90% rename from src/api/resources/auth/types/AuthTokenRequestBody.ts rename to src/api/resources/auth/types/AuthTokenRequest.ts index 17aeb485..62bc3cad 100644 --- a/src/api/resources/auth/types/AuthTokenRequestBody.ts +++ b/src/api/resources/auth/types/AuthTokenRequest.ts @@ -2,7 +2,7 @@ import type * as Corti from "../../../index.js"; -export type AuthTokenRequestBody = +export type AuthTokenRequest = | Corti.AuthTokenRequestClientCredentials | Corti.AuthTokenRequestAuthorizationCode | Corti.AuthTokenRequestAuthorizationPkce diff --git a/src/api/resources/auth/types/index.ts b/src/api/resources/auth/types/index.ts index 536709bd..c07e19c2 100644 --- a/src/api/resources/auth/types/index.ts +++ b/src/api/resources/auth/types/index.ts @@ -1 +1 @@ -export * from "./AuthTokenRequestBody.js"; +export * from "./AuthTokenRequest.js"; diff --git a/src/api/resources/codes/client/Client.ts b/src/api/resources/codes/client/Client.ts index fc372036..6a9188be 100644 --- a/src/api/resources/codes/client/Client.ts +++ b/src/api/resources/codes/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -71,7 +71,6 @@ export class CodesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/client/Client.ts b/src/api/resources/documents/client/Client.ts index ed2310bb..abbc8eba 100644 --- a/src/api/resources/documents/client/Client.ts +++ b/src/api/resources/documents/client/Client.ts @@ -65,7 +65,6 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -142,7 +141,7 @@ export class DocumentsClient { * This endpoint offers different ways to generate a document. Find guides to document generation [here](/textgen/documents-standard). * * @param {Corti.Uuid} id - The unique identifier of the interaction. Must be a valid UUID. - * @param {Corti.DocumentsCreateRequest} request + * @param {Corti.CreateDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -152,19 +151,21 @@ export class DocumentsClient { * * @example * await client.documents.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - * context: [{ - * type: "facts", - * data: [{ - * text: "text" - * }] - * }], - * templateKey: "templateKey", - * outputLanguage: "outputLanguage" + * body: { + * context: [{ + * type: "facts", + * data: [{ + * text: "text" + * }] + * }], + * templateKey: "templateKey", + * outputLanguage: "outputLanguage" + * } * }) */ public create( id: Corti.Uuid, - request: Corti.DocumentsCreateRequest, + request: Corti.CreateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(id, request, requestOptions)); @@ -172,14 +173,15 @@ export class DocumentsClient { private async __create( id: Corti.Uuid, - request: Corti.DocumentsCreateRequest, + request: Corti.CreateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { cortiRetentionPolicy, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "X-Corti-Retention-Policy": cortiRetentionPolicy }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -193,7 +195,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.DocumentsCreateRequest.jsonOrThrow(request, { + body: serializers.DocumentsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), @@ -295,7 +297,6 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -403,7 +404,6 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -505,7 +505,6 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -592,7 +591,7 @@ export class DocumentsClient { * Context can combine different types or reference an interactionId to automatically fetch existing context to pass to the LLM. Note that discarded facts are not passed to the LLM. * With the exception of the plain `templateRef` path (no overrides), every call creates a new auto-generated template aggregate that snapshots the resolved prompts as a drift-proof receipt, persisted for 30 days. * - * @param {Corti.GuidedDocumentsGenerateRequest} request + * @param {Corti.GenerateDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Corti.BadRequestError} @@ -602,28 +601,31 @@ export class DocumentsClient { * * @example * await client.documents.generate({ - * outputLanguage: "outputLanguage", - * templateRef: { - * templateId: "templateId" + * body: { + * outputLanguage: "outputLanguage", + * templateRef: { + * templateId: "templateId" + * } * } * }) */ public generate( - request: Corti.GuidedDocumentsGenerateRequest, + request: Corti.GenerateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__generate(request, requestOptions)); } private async __generate( - request: Corti.GuidedDocumentsGenerateRequest, + request: Corti.GenerateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions, ): Promise> { + const { cortiRetentionPolicy, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + mergeOnlyDefinedHeaders({ "X-Corti-Retention-Policy": cortiRetentionPolicy }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -637,7 +639,7 @@ export class DocumentsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.GuidedDocumentsGenerateRequest.jsonOrThrow(request, { + body: serializers.GuidedDocumentsGenerateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), diff --git a/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts b/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts new file mode 100644 index 00000000..617419df --- /dev/null +++ b/src/api/resources/documents/client/requests/CreateDocumentsRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * body: { + * context: [{ + * type: "facts", + * data: [{ + * text: "text" + * }] + * }], + * templateKey: "templateKey", + * outputLanguage: "outputLanguage" + * } + * } + */ +export interface CreateDocumentsRequest { + /** With the optional header `X-Corti-Retention-Policy:none` the API will generate and return the document as expected, but the generated document will not be saved to the database. The response will include the header `X-Corti-Retention-Policy:acknowledged` to confirm that your retention preference was respected. If the header is omitted or set to any other value, the default retention policy will apply, and the document will be stored in the database. */ + cortiRetentionPolicy?: Corti.CreateDocumentsRequestXCortiRetentionPolicy; + body: Corti.DocumentsCreateRequest; +} diff --git a/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts b/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts new file mode 100644 index 00000000..eedcad3e --- /dev/null +++ b/src/api/resources/documents/client/requests/GenerateDocumentsRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../index.js"; + +/** + * @example + * { + * body: { + * outputLanguage: "outputLanguage", + * templateRef: { + * templateId: "templateId" + * } + * } + * } + */ +export interface GenerateDocumentsRequest { + /** Pass the optional `X-Corti-Retention-Policy: none` header to generate and return the document without saving it to the database. The response will be 200 with `GuidedDocumentsCreateEphemeralResponse`. Without the header the document is saved and the response is 201 with `GuidedDocumentsCreateResponse`. */ + cortiRetentionPolicy?: Corti.GenerateDocumentsRequestXCortiRetentionPolicy; + body: Corti.GuidedDocumentsGenerateRequest; +} diff --git a/src/api/resources/documents/client/requests/index.ts b/src/api/resources/documents/client/requests/index.ts index d86bd2d7..84e7f011 100644 --- a/src/api/resources/documents/client/requests/index.ts +++ b/src/api/resources/documents/client/requests/index.ts @@ -1 +1,3 @@ +export type { CreateDocumentsRequest } from "./CreateDocumentsRequest.js"; export type { DocumentsUpdateRequest } from "./DocumentsUpdateRequest.js"; +export type { GenerateDocumentsRequest } from "./GenerateDocumentsRequest.js"; diff --git a/src/api/resources/documents/index.ts b/src/api/resources/documents/index.ts index 9eb1192d..0ef16e76 100644 --- a/src/api/resources/documents/index.ts +++ b/src/api/resources/documents/index.ts @@ -1,2 +1,3 @@ export * from "./client/index.js"; export * from "./resources/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/documents/resources/sections/client/Client.ts b/src/api/resources/documents/resources/sections/client/Client.ts index 8454ef68..e0255e16 100644 --- a/src/api/resources/documents/resources/sections/client/Client.ts +++ b/src/api/resources/documents/resources/sections/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -68,7 +68,6 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -141,7 +140,6 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -222,7 +220,6 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -298,7 +295,6 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -374,7 +370,6 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts index 447c2d53..95bee49d 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts @@ -5,7 +5,7 @@ import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; +import { mergeHeaders } from "../../../../../../../../core/headers.js"; import * as core from "../../../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../../../errors/index.js"; @@ -51,7 +51,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -135,7 +134,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -224,7 +222,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -305,7 +302,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -377,7 +373,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/templates/client/Client.ts b/src/api/resources/documents/resources/templates/client/Client.ts index 1dbead5a..b2a571b7 100644 --- a/src/api/resources/documents/resources/templates/client/Client.ts +++ b/src/api/resources/documents/resources/templates/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -68,7 +68,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -141,7 +140,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -222,7 +220,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -298,7 +295,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -375,7 +371,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts index 305583a4..a638a35e 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts @@ -5,7 +5,7 @@ import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; +import { mergeHeaders } from "../../../../../../../../core/headers.js"; import * as core from "../../../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../../../errors/index.js"; @@ -52,7 +52,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -136,7 +135,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -226,7 +224,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -307,7 +304,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -379,7 +375,6 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts b/src/api/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts new file mode 100644 index 00000000..80d0814b --- /dev/null +++ b/src/api/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const CreateDocumentsRequestXCortiRetentionPolicy = { + None: "none", +} as const; +export type CreateDocumentsRequestXCortiRetentionPolicy = + (typeof CreateDocumentsRequestXCortiRetentionPolicy)[keyof typeof CreateDocumentsRequestXCortiRetentionPolicy]; diff --git a/src/api/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts b/src/api/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts new file mode 100644 index 00000000..d74cbfe4 --- /dev/null +++ b/src/api/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GenerateDocumentsRequestXCortiRetentionPolicy = { + None: "none", +} as const; +export type GenerateDocumentsRequestXCortiRetentionPolicy = + (typeof GenerateDocumentsRequestXCortiRetentionPolicy)[keyof typeof GenerateDocumentsRequestXCortiRetentionPolicy]; diff --git a/src/api/resources/documents/types/index.ts b/src/api/resources/documents/types/index.ts new file mode 100644 index 00000000..f7abb7fb --- /dev/null +++ b/src/api/resources/documents/types/index.ts @@ -0,0 +1,2 @@ +export * from "./CreateDocumentsRequestXCortiRetentionPolicy.js"; +export * from "./GenerateDocumentsRequestXCortiRetentionPolicy.js"; diff --git a/src/api/resources/facts/client/Client.ts b/src/api/resources/facts/client/Client.ts index 684f256e..154be601 100644 --- a/src/api/resources/facts/client/Client.ts +++ b/src/api/resources/facts/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -45,7 +45,6 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -127,7 +126,6 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -217,7 +215,6 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -312,7 +309,6 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -406,7 +402,6 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -505,7 +500,6 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 2e1d98c8..208f2a23 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -7,6 +7,7 @@ export * from "./codes/client/requests/index.js"; export * as codes from "./codes/index.js"; export * from "./documents/client/requests/index.js"; export * as documents from "./documents/index.js"; +export * from "./documents/types/index.js"; export * from "./facts/client/requests/index.js"; export * as facts from "./facts/index.js"; export * from "./interactions/client/requests/index.js"; diff --git a/src/api/resources/interactions/client/Client.ts b/src/api/resources/interactions/client/Client.ts index 4c5256ac..0785a18d 100644 --- a/src/api/resources/interactions/client/Client.ts +++ b/src/api/resources/interactions/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -79,7 +79,6 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -184,7 +183,6 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -288,7 +286,6 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -370,7 +367,6 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -449,7 +445,6 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/languages/client/Client.ts b/src/api/resources/languages/client/Client.ts index 08ecca82..190152bb 100644 --- a/src/api/resources/languages/client/Client.ts +++ b/src/api/resources/languages/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -59,7 +59,6 @@ export class LanguagesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/recordings/client/Client.ts b/src/api/resources/recordings/client/Client.ts index 92364ec0..b46cddb2 100644 --- a/src/api/resources/recordings/client/Client.ts +++ b/src/api/resources/recordings/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -51,7 +51,6 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -157,7 +156,6 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), _binaryUploadRequest.headers, requestOptions?.headers, ); @@ -264,7 +262,6 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -366,7 +363,6 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/templates/client/Client.ts b/src/api/resources/templates/client/Client.ts index 3a109232..66579be1 100644 --- a/src/api/resources/templates/client/Client.ts +++ b/src/api/resources/templates/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -54,7 +54,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -145,7 +144,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -230,7 +228,6 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/transcripts/client/Client.ts b/src/api/resources/transcripts/client/Client.ts index 1c3f7c1d..febac80c 100644 --- a/src/api/resources/transcripts/client/Client.ts +++ b/src/api/resources/transcripts/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import { mergeHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -59,7 +59,6 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -173,7 +172,6 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -290,7 +288,6 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -401,7 +398,6 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -499,7 +495,6 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/serialization/resources/auth/types/AuthTokenRequestBody.ts b/src/serialization/resources/auth/types/AuthTokenRequest.ts similarity index 70% rename from src/serialization/resources/auth/types/AuthTokenRequestBody.ts rename to src/serialization/resources/auth/types/AuthTokenRequest.ts index cd65369e..9bb52270 100644 --- a/src/serialization/resources/auth/types/AuthTokenRequestBody.ts +++ b/src/serialization/resources/auth/types/AuthTokenRequest.ts @@ -9,18 +9,16 @@ import { AuthTokenRequestClientCredentials } from "../../../types/AuthTokenReque import { AuthTokenRequestRefresh } from "../../../types/AuthTokenRequestRefresh.js"; import { AuthTokenRequestRopc } from "../../../types/AuthTokenRequestRopc.js"; -export const AuthTokenRequestBody: core.serialization.Schema< - serializers.AuthTokenRequestBody.Raw, - Corti.AuthTokenRequestBody -> = core.serialization.undiscriminatedUnion([ - AuthTokenRequestClientCredentials, - AuthTokenRequestAuthorizationCode, - AuthTokenRequestAuthorizationPkce, - AuthTokenRequestRopc, - AuthTokenRequestRefresh, -]); +export const AuthTokenRequest: core.serialization.Schema = + core.serialization.undiscriminatedUnion([ + AuthTokenRequestClientCredentials, + AuthTokenRequestAuthorizationCode, + AuthTokenRequestAuthorizationPkce, + AuthTokenRequestRopc, + AuthTokenRequestRefresh, + ]); -export declare namespace AuthTokenRequestBody { +export declare namespace AuthTokenRequest { export type Raw = | AuthTokenRequestClientCredentials.Raw | AuthTokenRequestAuthorizationCode.Raw diff --git a/src/serialization/resources/auth/types/index.ts b/src/serialization/resources/auth/types/index.ts index 536709bd..c07e19c2 100644 --- a/src/serialization/resources/auth/types/index.ts +++ b/src/serialization/resources/auth/types/index.ts @@ -1 +1 @@ -export * from "./AuthTokenRequestBody.js"; +export * from "./AuthTokenRequest.js"; diff --git a/src/serialization/resources/documents/index.ts b/src/serialization/resources/documents/index.ts index 9eb1192d..0ef16e76 100644 --- a/src/serialization/resources/documents/index.ts +++ b/src/serialization/resources/documents/index.ts @@ -1,2 +1,3 @@ export * from "./client/index.js"; export * from "./resources/index.js"; +export * from "./types/index.js"; diff --git a/src/serialization/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts b/src/serialization/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts new file mode 100644 index 00000000..dbcc804a --- /dev/null +++ b/src/serialization/resources/documents/types/CreateDocumentsRequestXCortiRetentionPolicy.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const CreateDocumentsRequestXCortiRetentionPolicy: core.serialization.Schema< + serializers.CreateDocumentsRequestXCortiRetentionPolicy.Raw, + Corti.CreateDocumentsRequestXCortiRetentionPolicy +> = core.serialization.enum_(["none"]); + +export declare namespace CreateDocumentsRequestXCortiRetentionPolicy { + export type Raw = "none"; +} diff --git a/src/serialization/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts b/src/serialization/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts new file mode 100644 index 00000000..8dd3fd0f --- /dev/null +++ b/src/serialization/resources/documents/types/GenerateDocumentsRequestXCortiRetentionPolicy.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const GenerateDocumentsRequestXCortiRetentionPolicy: core.serialization.Schema< + serializers.GenerateDocumentsRequestXCortiRetentionPolicy.Raw, + Corti.GenerateDocumentsRequestXCortiRetentionPolicy +> = core.serialization.enum_(["none"]); + +export declare namespace GenerateDocumentsRequestXCortiRetentionPolicy { + export type Raw = "none"; +} diff --git a/src/serialization/resources/documents/types/index.ts b/src/serialization/resources/documents/types/index.ts new file mode 100644 index 00000000..f7abb7fb --- /dev/null +++ b/src/serialization/resources/documents/types/index.ts @@ -0,0 +1,2 @@ +export * from "./CreateDocumentsRequestXCortiRetentionPolicy.js"; +export * from "./GenerateDocumentsRequestXCortiRetentionPolicy.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index c2b155f9..30b99be7 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -7,6 +7,7 @@ export * from "./codes/client/requests/index.js"; export * as codes from "./codes/index.js"; export * from "./documents/client/requests/index.js"; export * as documents from "./documents/index.js"; +export * from "./documents/types/index.js"; export * from "./facts/client/requests/index.js"; export * as facts from "./facts/index.js"; export * from "./interactions/client/requests/index.js"; diff --git a/tests/wire/agents.test.ts b/tests/wire/agents.test.ts index 9e0692d2..85caecbf 100644 --- a/tests/wire/agents.test.ts +++ b/tests/wire/agents.test.ts @@ -14,7 +14,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -76,7 +75,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -97,7 +95,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -118,7 +115,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -210,7 +206,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -241,7 +236,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -272,7 +266,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -303,7 +296,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -391,7 +383,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -412,7 +403,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -433,7 +423,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -454,7 +443,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -477,7 +465,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -498,7 +485,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -519,7 +505,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -540,7 +525,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -629,7 +613,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -657,7 +640,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -685,7 +667,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -713,7 +694,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -741,7 +721,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -882,7 +861,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -909,7 +887,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -936,7 +913,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -963,7 +939,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1102,7 +1077,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1156,7 +1130,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1210,7 +1183,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1264,7 +1236,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1318,7 +1289,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1372,7 +1342,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1507,7 +1476,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1534,7 +1502,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1561,7 +1528,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1588,7 +1554,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1615,7 +1580,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1700,7 +1664,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1727,7 +1690,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1754,7 +1716,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1781,7 +1742,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1804,7 +1764,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1831,7 +1790,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1858,7 +1816,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1885,7 +1842,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1943,7 +1899,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1970,7 +1925,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1997,7 +1951,6 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/auth.test.ts b/tests/wire/auth.test.ts index 0ce6a587..77d046b1 100644 --- a/tests/wire/auth.test.ts +++ b/tests/wire/auth.test.ts @@ -14,7 +14,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { client_id: "client_id", client_secret: "client_secret" }; @@ -64,7 +63,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -119,7 +117,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -155,7 +152,6 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/codes.test.ts b/tests/wire/codes.test.ts index d3909f46..57f9a7b9 100644 --- a/tests/wire/codes.test.ts +++ b/tests/wire/codes.test.ts @@ -14,7 +14,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -134,7 +133,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -259,7 +257,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -305,7 +302,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -351,7 +347,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -397,7 +392,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -443,7 +437,6 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/documents.test.ts b/tests/wire/documents.test.ts index 1f3e4b3e..bec719de 100644 --- a/tests/wire/documents.test.ts +++ b/tests/wire/documents.test.ts @@ -14,7 +14,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -88,7 +87,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -115,7 +113,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -142,7 +139,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -169,7 +165,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -196,7 +191,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -235,18 +229,20 @@ describe("DocumentsClient", () => { .build(); const response = await client.documents.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); expect(response).toEqual({ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", @@ -280,7 +276,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -304,32 +299,34 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -342,7 +339,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -366,32 +362,34 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.ForbiddenError); }); @@ -404,7 +402,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -428,32 +425,34 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.InternalServerError); }); @@ -466,7 +465,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -490,32 +488,34 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.create("id", { - context: [ - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - { - type: "facts", - data: [ - { - text: "text", - }, - { - text: "text", - }, - ], - }, - ], - templateKey: "templateKey", - outputLanguage: "outputLanguage", + body: { + context: [ + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + { + type: "facts", + data: [ + { + text: "text", + }, + { + text: "text", + }, + ], + }, + ], + templateKey: "templateKey", + outputLanguage: "outputLanguage", + }, }); }).rejects.toThrow(Corti.GatewayTimeoutError); }); @@ -528,7 +528,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -597,7 +596,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -624,7 +622,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -651,7 +648,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -678,7 +674,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -705,7 +700,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -731,7 +725,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -758,7 +751,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -785,7 +777,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -812,7 +803,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -839,7 +829,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -909,7 +898,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -937,7 +925,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -965,7 +952,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -993,7 +979,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -1021,7 +1006,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { outputLanguage: "outputLanguage", templateRef: { templateId: "templateId" } }; @@ -1049,9 +1033,11 @@ describe("DocumentsClient", () => { .build(); const response = await client.documents.generate({ - outputLanguage: "outputLanguage", - templateRef: { - templateId: "templateId", + body: { + outputLanguage: "outputLanguage", + templateRef: { + templateId: "templateId", + }, }, }); expect(response).toEqual({ @@ -1088,7 +1074,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1105,10 +1090,12 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.BadRequestError); }); @@ -1121,7 +1108,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1138,10 +1124,12 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.NotFoundError); }); @@ -1154,7 +1142,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1171,10 +1158,12 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.UnprocessableEntityError); }); @@ -1187,7 +1176,6 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1204,10 +1192,12 @@ describe("DocumentsClient", () => { await expect(async () => { return await client.documents.generate({ - templateRef: { - templateId: "templateId", + body: { + templateRef: { + templateId: "templateId", + }, + outputLanguage: "outputLanguage", }, - outputLanguage: "outputLanguage", }); }).rejects.toThrow(Corti.InternalServerError); }); diff --git a/tests/wire/documents/sections.test.ts b/tests/wire/documents/sections.test.ts index fd570ae6..c95f6b71 100644 --- a/tests/wire/documents/sections.test.ts +++ b/tests/wire/documents/sections.test.ts @@ -14,7 +14,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -79,7 +78,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -168,7 +166,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -199,7 +196,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -284,7 +280,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -311,7 +306,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -329,7 +323,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -356,7 +349,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -383,7 +375,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -469,7 +460,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -497,7 +487,6 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; diff --git a/tests/wire/documents/sections/versions.test.ts b/tests/wire/documents/sections/versions.test.ts index fb0f2ec1..9b82f433 100644 --- a/tests/wire/documents/sections/versions.test.ts +++ b/tests/wire/documents/sections/versions.test.ts @@ -14,7 +14,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -66,7 +65,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -93,7 +91,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -160,7 +157,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -190,7 +186,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -220,7 +215,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -284,7 +278,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -311,7 +304,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -334,7 +326,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -361,7 +352,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -397,7 +387,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/documents/templates.test.ts b/tests/wire/documents/templates.test.ts index 499cb608..705eed21 100644 --- a/tests/wire/documents/templates.test.ts +++ b/tests/wire/documents/templates.test.ts @@ -14,7 +14,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -79,7 +78,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -213,7 +211,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -244,7 +241,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -374,7 +370,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -401,7 +396,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -419,7 +413,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -446,7 +439,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -473,7 +465,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -604,7 +595,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -632,7 +622,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; diff --git a/tests/wire/documents/templates/versions.test.ts b/tests/wire/documents/templates/versions.test.ts index bc156b08..22c3c536 100644 --- a/tests/wire/documents/templates/versions.test.ts +++ b/tests/wire/documents/templates/versions.test.ts @@ -14,7 +14,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -67,7 +66,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -94,7 +92,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -143,7 +140,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -173,7 +169,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -203,7 +198,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -249,7 +243,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -276,7 +269,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -299,7 +291,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -326,7 +317,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -362,7 +352,6 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/facts.test.ts b/tests/wire/facts.test.ts index 09c2a7ef..3892c960 100644 --- a/tests/wire/facts.test.ts +++ b/tests/wire/facts.test.ts @@ -14,7 +14,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -44,7 +43,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -65,7 +63,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -119,7 +116,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -146,7 +142,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ text: "text", group: "other" }] }; @@ -204,7 +199,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -248,7 +242,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" }] }; @@ -307,7 +300,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "factId" }, { factId: "factId" }] }; @@ -344,7 +336,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -392,7 +383,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -420,7 +410,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { context: [{ type: "text", text: "text" }], outputLanguage: "outputLanguage" }; @@ -471,7 +460,6 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/interactions.test.ts b/tests/wire/interactions.test.ts index e7853a48..fa4bc9ec 100644 --- a/tests/wire/interactions.test.ts +++ b/tests/wire/interactions.test.ts @@ -14,7 +14,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -87,7 +86,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -114,7 +112,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -141,7 +138,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -179,7 +175,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -215,7 +210,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -251,7 +245,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -287,7 +280,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -323,7 +315,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -396,7 +387,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -417,7 +407,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -438,7 +427,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -461,7 +449,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -488,7 +475,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -515,7 +501,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -589,7 +574,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -617,7 +601,6 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; diff --git a/tests/wire/languages.test.ts b/tests/wire/languages.test.ts index 61b40a6c..840be327 100644 --- a/tests/wire/languages.test.ts +++ b/tests/wire/languages.test.ts @@ -14,7 +14,6 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -38,7 +37,6 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -59,7 +57,6 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/recordings.test.ts b/tests/wire/recordings.test.ts index c7f405a7..eec7c096 100644 --- a/tests/wire/recordings.test.ts +++ b/tests/wire/recordings.test.ts @@ -14,7 +14,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -42,7 +41,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -69,7 +67,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -96,7 +93,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -123,7 +119,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -150,7 +145,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -178,7 +172,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -205,7 +198,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -232,7 +224,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -259,7 +250,6 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/templates.test.ts b/tests/wire/templates.test.ts index f81356be..13359e4c 100644 --- a/tests/wire/templates.test.ts +++ b/tests/wire/templates.test.ts @@ -14,7 +14,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -74,7 +73,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -95,7 +93,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -116,7 +113,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -198,7 +194,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -219,7 +214,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -240,7 +234,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -316,7 +309,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -337,7 +329,6 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/transcripts.test.ts b/tests/wire/transcripts.test.ts index ea5be3b4..f6c73efe 100644 --- a/tests/wire/transcripts.test.ts +++ b/tests/wire/transcripts.test.ts @@ -14,7 +14,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -71,7 +70,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -98,7 +96,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -125,7 +122,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -152,7 +148,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -179,7 +174,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -206,7 +200,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", primaryLanguage: "en" }; @@ -268,7 +261,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -299,7 +291,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -330,7 +321,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -361,7 +351,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -392,7 +381,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -423,7 +411,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -484,7 +471,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -511,7 +497,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -538,7 +523,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -565,7 +549,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -592,7 +575,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -619,7 +601,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -647,7 +628,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -674,7 +654,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -701,7 +680,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -728,7 +706,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -755,7 +732,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -782,7 +758,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -815,7 +790,6 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", - tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); From 1cefeb7a010e292566120dfe0dfa36f31bc06edc Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:22:39 +0000 Subject: [PATCH 18/18] SDK regeneration --- .fern/metadata.json | 2 +- src/BaseClient.ts | 5 ++ src/api/resources/agents/client/Client.ts | 13 ++++- src/api/resources/auth/client/Client.ts | 9 +++- src/api/resources/codes/client/Client.ts | 3 +- src/api/resources/documents/client/Client.ts | 14 +++++- .../resources/sections/client/Client.ts | 7 ++- .../resources/versions/client/Client.ts | 7 ++- .../resources/templates/client/Client.ts | 7 ++- .../resources/versions/client/Client.ts | 7 ++- src/api/resources/facts/client/Client.ts | 8 +++- .../resources/interactions/client/Client.ts | 7 ++- src/api/resources/languages/client/Client.ts | 3 +- src/api/resources/recordings/client/Client.ts | 6 ++- src/api/resources/templates/client/Client.ts | 5 +- .../resources/transcripts/client/Client.ts | 7 ++- tests/wire/agents.test.ts | 47 +++++++++++++++++++ tests/wire/auth.test.ts | 4 ++ tests/wire/codes.test.ts | 7 +++ tests/wire/documents.test.ts | 30 ++++++++++++ tests/wire/documents/sections.test.ts | 11 +++++ .../wire/documents/sections/versions.test.ts | 11 +++++ tests/wire/documents/templates.test.ts | 11 +++++ .../wire/documents/templates/versions.test.ts | 11 +++++ tests/wire/facts.test.ts | 12 +++++ tests/wire/interactions.test.ts | 17 +++++++ tests/wire/languages.test.ts | 3 ++ tests/wire/recordings.test.ts | 10 ++++ tests/wire/templates.test.ts | 9 ++++ tests/wire/transcripts.test.ts | 26 ++++++++++ 30 files changed, 302 insertions(+), 17 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 71b03082..a7f41802 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "9561e1d4e7fbac710c5706080074443c598630f2", + "originGitCommit": "e051149eeb3680e201b74bc59dac5132de3df262", "sdkVersion": "0.0.0-dev" } diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 50d2b1af..1b76cbaa 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -9,6 +9,8 @@ export type BaseClientOptions = { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; + /** Override the Tenant-Name header */ + tenantName: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | null | undefined>; /** The default maximum time to wait for a response in seconds. */ @@ -28,6 +30,8 @@ export interface BaseRequestOptions { maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; + /** Override the Tenant-Name header */ + tenantName?: string; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ @@ -55,6 +59,7 @@ export function normalizeClientOptions> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), + requestOptions?.headers, + ); const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -124,6 +128,7 @@ export class AuthClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/codes/client/Client.ts b/src/api/resources/codes/client/Client.ts index 6a9188be..fc372036 100644 --- a/src/api/resources/codes/client/Client.ts +++ b/src/api/resources/codes/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -71,6 +71,7 @@ export class CodesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/client/Client.ts b/src/api/resources/documents/client/Client.ts index abbc8eba..b399cd18 100644 --- a/src/api/resources/documents/client/Client.ts +++ b/src/api/resources/documents/client/Client.ts @@ -65,6 +65,7 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -181,7 +182,10 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "X-Corti-Retention-Policy": cortiRetentionPolicy }), + mergeOnlyDefinedHeaders({ + "X-Corti-Retention-Policy": cortiRetentionPolicy, + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -297,6 +301,7 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -404,6 +409,7 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -505,6 +511,7 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -625,7 +632,10 @@ export class DocumentsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, - mergeOnlyDefinedHeaders({ "X-Corti-Retention-Policy": cortiRetentionPolicy }), + mergeOnlyDefinedHeaders({ + "X-Corti-Retention-Policy": cortiRetentionPolicy, + "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName, + }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/sections/client/Client.ts b/src/api/resources/documents/resources/sections/client/Client.ts index e0255e16..8454ef68 100644 --- a/src/api/resources/documents/resources/sections/client/Client.ts +++ b/src/api/resources/documents/resources/sections/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -68,6 +68,7 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -140,6 +141,7 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -220,6 +222,7 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -295,6 +298,7 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -370,6 +374,7 @@ export class SectionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts index 95bee49d..447c2d53 100644 --- a/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/sections/resources/versions/client/Client.ts @@ -5,7 +5,7 @@ import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; import * as core from "../../../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../../../errors/index.js"; @@ -51,6 +51,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -134,6 +135,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -222,6 +224,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -302,6 +305,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -373,6 +377,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/templates/client/Client.ts b/src/api/resources/documents/resources/templates/client/Client.ts index b2a571b7..1dbead5a 100644 --- a/src/api/resources/documents/resources/templates/client/Client.ts +++ b/src/api/resources/documents/resources/templates/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; @@ -68,6 +68,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -140,6 +141,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -220,6 +222,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -295,6 +298,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -371,6 +375,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts index a638a35e..305583a4 100644 --- a/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts +++ b/src/api/resources/documents/resources/templates/resources/versions/client/Client.ts @@ -5,7 +5,7 @@ import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js"; import * as core from "../../../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../../../errors/index.js"; @@ -52,6 +52,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -135,6 +136,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -224,6 +226,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -304,6 +307,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -375,6 +379,7 @@ export class VersionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/facts/client/Client.ts b/src/api/resources/facts/client/Client.ts index 154be601..684f256e 100644 --- a/src/api/resources/facts/client/Client.ts +++ b/src/api/resources/facts/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -45,6 +45,7 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -126,6 +127,7 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -215,6 +217,7 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -309,6 +312,7 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -402,6 +406,7 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -500,6 +505,7 @@ export class FactsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/interactions/client/Client.ts b/src/api/resources/interactions/client/Client.ts index 0785a18d..4c5256ac 100644 --- a/src/api/resources/interactions/client/Client.ts +++ b/src/api/resources/interactions/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -79,6 +79,7 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -183,6 +184,7 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -286,6 +288,7 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -367,6 +370,7 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -445,6 +449,7 @@ export class InteractionsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/languages/client/Client.ts b/src/api/resources/languages/client/Client.ts index 190152bb..08ecca82 100644 --- a/src/api/resources/languages/client/Client.ts +++ b/src/api/resources/languages/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -59,6 +59,7 @@ export class LanguagesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/recordings/client/Client.ts b/src/api/resources/recordings/client/Client.ts index b46cddb2..92364ec0 100644 --- a/src/api/resources/recordings/client/Client.ts +++ b/src/api/resources/recordings/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -51,6 +51,7 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -156,6 +157,7 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), _binaryUploadRequest.headers, requestOptions?.headers, ); @@ -262,6 +264,7 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -363,6 +366,7 @@ export class RecordingsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/templates/client/Client.ts b/src/api/resources/templates/client/Client.ts index 66579be1..3a109232 100644 --- a/src/api/resources/templates/client/Client.ts +++ b/src/api/resources/templates/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -54,6 +54,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -144,6 +145,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -228,6 +230,7 @@ export class TemplatesClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/src/api/resources/transcripts/client/Client.ts b/src/api/resources/transcripts/client/Client.ts index febac80c..1c3f7c1d 100644 --- a/src/api/resources/transcripts/client/Client.ts +++ b/src/api/resources/transcripts/client/Client.ts @@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; -import { mergeHeaders } from "../../../../core/headers.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; @@ -59,6 +59,7 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -172,6 +173,7 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -288,6 +290,7 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -398,6 +401,7 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -495,6 +499,7 @@ export class TranscriptsClient { const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "Tenant-Name": requestOptions?.tenantName ?? this._options?.tenantName }), requestOptions?.headers, ); const _response = await core.fetcher({ diff --git a/tests/wire/agents.test.ts b/tests/wire/agents.test.ts index 85caecbf..9e0692d2 100644 --- a/tests/wire/agents.test.ts +++ b/tests/wire/agents.test.ts @@ -14,6 +14,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -75,6 +76,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -95,6 +97,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -115,6 +118,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -206,6 +210,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -236,6 +241,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -266,6 +272,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", description: "description" }; @@ -296,6 +303,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -383,6 +391,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -403,6 +412,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -423,6 +433,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -443,6 +454,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -465,6 +477,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -485,6 +498,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -505,6 +519,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -525,6 +540,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -613,6 +629,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -640,6 +657,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -667,6 +685,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -694,6 +713,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -721,6 +741,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -861,6 +882,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -887,6 +909,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -913,6 +936,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -939,6 +963,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1077,6 +1102,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1130,6 +1156,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1183,6 +1210,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1236,6 +1264,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1289,6 +1318,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -1342,6 +1372,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1476,6 +1507,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1502,6 +1534,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1528,6 +1561,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1554,6 +1588,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1580,6 +1615,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1664,6 +1700,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1690,6 +1727,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1716,6 +1754,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1742,6 +1781,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1764,6 +1804,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1790,6 +1831,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1816,6 +1858,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1842,6 +1885,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1899,6 +1943,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1925,6 +1970,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -1951,6 +1997,7 @@ describe("AgentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/auth.test.ts b/tests/wire/auth.test.ts index 77d046b1..0ce6a587 100644 --- a/tests/wire/auth.test.ts +++ b/tests/wire/auth.test.ts @@ -14,6 +14,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { client_id: "client_id", client_secret: "client_secret" }; @@ -63,6 +64,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -117,6 +119,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -152,6 +155,7 @@ describe("AuthClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/codes.test.ts b/tests/wire/codes.test.ts index 57f9a7b9..d3909f46 100644 --- a/tests/wire/codes.test.ts +++ b/tests/wire/codes.test.ts @@ -14,6 +14,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -133,6 +134,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -257,6 +259,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -302,6 +305,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -347,6 +351,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -392,6 +397,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -437,6 +443,7 @@ describe("CodesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/documents.test.ts b/tests/wire/documents.test.ts index bec719de..e2be10d7 100644 --- a/tests/wire/documents.test.ts +++ b/tests/wire/documents.test.ts @@ -14,6 +14,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -87,6 +88,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -113,6 +115,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -139,6 +142,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -165,6 +169,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -191,6 +196,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -276,6 +282,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -339,6 +346,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -402,6 +410,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -465,6 +474,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -528,6 +538,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -596,6 +607,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -622,6 +634,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -648,6 +661,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -674,6 +688,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -700,6 +715,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -725,6 +741,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -751,6 +768,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -777,6 +795,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -803,6 +822,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -829,6 +849,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -898,6 +919,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -925,6 +947,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -952,6 +975,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -979,6 +1003,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -1006,6 +1031,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { outputLanguage: "outputLanguage", templateRef: { templateId: "templateId" } }; @@ -1074,6 +1100,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1108,6 +1135,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1142,6 +1170,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; @@ -1176,6 +1205,7 @@ describe("DocumentsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { templateRef: { templateId: "templateId" }, outputLanguage: "outputLanguage" }; diff --git a/tests/wire/documents/sections.test.ts b/tests/wire/documents/sections.test.ts index c95f6b71..fd570ae6 100644 --- a/tests/wire/documents/sections.test.ts +++ b/tests/wire/documents/sections.test.ts @@ -14,6 +14,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -78,6 +79,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -166,6 +168,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -196,6 +199,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -280,6 +284,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -306,6 +311,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -323,6 +329,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -349,6 +356,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -375,6 +383,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -460,6 +469,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -487,6 +497,7 @@ describe("SectionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; diff --git a/tests/wire/documents/sections/versions.test.ts b/tests/wire/documents/sections/versions.test.ts index 9b82f433..fb0f2ec1 100644 --- a/tests/wire/documents/sections/versions.test.ts +++ b/tests/wire/documents/sections/versions.test.ts @@ -14,6 +14,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -65,6 +66,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -91,6 +93,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -157,6 +160,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -186,6 +190,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -215,6 +220,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -278,6 +284,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -304,6 +311,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -326,6 +334,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -352,6 +361,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -387,6 +397,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/documents/templates.test.ts b/tests/wire/documents/templates.test.ts index 705eed21..499cb608 100644 --- a/tests/wire/documents/templates.test.ts +++ b/tests/wire/documents/templates.test.ts @@ -14,6 +14,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -78,6 +79,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { name: "name", inheritFromId: "inheritFromId" }; @@ -211,6 +213,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { inheritFromId: "inheritFromId", name: "name" }; @@ -241,6 +244,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -370,6 +374,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -396,6 +401,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -413,6 +419,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -439,6 +446,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -465,6 +473,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -595,6 +604,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -622,6 +632,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; diff --git a/tests/wire/documents/templates/versions.test.ts b/tests/wire/documents/templates/versions.test.ts index 22c3c536..bc156b08 100644 --- a/tests/wire/documents/templates/versions.test.ts +++ b/tests/wire/documents/templates/versions.test.ts @@ -14,6 +14,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -66,6 +67,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -92,6 +94,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -140,6 +143,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -169,6 +173,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { generation: {} }; @@ -198,6 +203,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -243,6 +249,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -269,6 +276,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -291,6 +299,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -317,6 +326,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -352,6 +362,7 @@ describe("VersionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/facts.test.ts b/tests/wire/facts.test.ts index 3892c960..09c2a7ef 100644 --- a/tests/wire/facts.test.ts +++ b/tests/wire/facts.test.ts @@ -14,6 +14,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -43,6 +44,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -63,6 +65,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -116,6 +119,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -142,6 +146,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ text: "text", group: "other" }] }; @@ -199,6 +204,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -242,6 +248,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "3c9d8a12-7f44-4b3e-9e6f-9271c2bbfa08" }] }; @@ -300,6 +307,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { facts: [{ factId: "factId" }, { factId: "factId" }] }; @@ -336,6 +344,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -383,6 +392,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -410,6 +420,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { context: [{ type: "text", text: "text" }], outputLanguage: "outputLanguage" }; @@ -460,6 +471,7 @@ describe("FactsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { diff --git a/tests/wire/interactions.test.ts b/tests/wire/interactions.test.ts index fa4bc9ec..e7853a48 100644 --- a/tests/wire/interactions.test.ts +++ b/tests/wire/interactions.test.ts @@ -14,6 +14,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -86,6 +87,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -112,6 +114,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -138,6 +141,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -175,6 +179,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -210,6 +215,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -245,6 +251,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -280,6 +287,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { @@ -315,6 +323,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -387,6 +396,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -407,6 +417,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -427,6 +438,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -449,6 +461,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -475,6 +488,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -501,6 +515,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -574,6 +589,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; @@ -601,6 +617,7 @@ describe("InteractionsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = {}; diff --git a/tests/wire/languages.test.ts b/tests/wire/languages.test.ts index 840be327..61b40a6c 100644 --- a/tests/wire/languages.test.ts +++ b/tests/wire/languages.test.ts @@ -14,6 +14,7 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -37,6 +38,7 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -57,6 +59,7 @@ describe("LanguagesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/recordings.test.ts b/tests/wire/recordings.test.ts index eec7c096..c7f405a7 100644 --- a/tests/wire/recordings.test.ts +++ b/tests/wire/recordings.test.ts @@ -14,6 +14,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -41,6 +42,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -67,6 +69,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -93,6 +96,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -119,6 +123,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -145,6 +150,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -172,6 +178,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -198,6 +205,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -224,6 +232,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -250,6 +259,7 @@ describe("RecordingsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/templates.test.ts b/tests/wire/templates.test.ts index 13359e4c..f81356be 100644 --- a/tests/wire/templates.test.ts +++ b/tests/wire/templates.test.ts @@ -14,6 +14,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -73,6 +74,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -93,6 +95,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -113,6 +116,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -194,6 +198,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -214,6 +219,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -234,6 +240,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -309,6 +316,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -329,6 +337,7 @@ describe("TemplatesClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); diff --git a/tests/wire/transcripts.test.ts b/tests/wire/transcripts.test.ts index f6c73efe..ea5be3b4 100644 --- a/tests/wire/transcripts.test.ts +++ b/tests/wire/transcripts.test.ts @@ -14,6 +14,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -70,6 +71,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -96,6 +98,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -122,6 +125,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -148,6 +152,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -174,6 +179,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -200,6 +206,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", primaryLanguage: "en" }; @@ -261,6 +268,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -291,6 +299,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -321,6 +330,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -351,6 +361,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -381,6 +392,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); const rawRequestBody = { recordingId: "recordingId", primaryLanguage: "primaryLanguage" }; @@ -411,6 +423,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -471,6 +484,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -497,6 +511,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -523,6 +538,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -549,6 +565,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -575,6 +592,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -601,6 +619,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -628,6 +647,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -654,6 +674,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -680,6 +701,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -706,6 +728,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -732,6 +755,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -758,6 +782,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, }); @@ -790,6 +815,7 @@ describe("TranscriptsClient", () => { maxRetries: 0, clientId: "client_id", clientSecret: "client_secret", + tenantName: "test", environment: { base: server.baseUrl, wss: server.baseUrl, login: server.baseUrl, agents: server.baseUrl }, });