diff --git a/.sdk-source.json b/.sdk-source.json index 331a1ea..1698d39 100644 --- a/.sdk-source.json +++ b/.sdk-source.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "sourceCommit": "a7ac050030bc0a5bb06bf0a423db0f91cb82bfea", + "sourceCommit": "9bdddf7cd74217dcb7fc79ee83db55408060a80d", "contract": "contracts/2026.07/public-sdk-contract.json", "packages": [ "typescript" diff --git a/typescript/README.md b/typescript/README.md index fa835ec..ced1ea4 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -10,11 +10,14 @@ TypeScript SDK for your licensed or self-hosted IgnitionRAG deployment. Zero dep ## Installation ```bash -npm install @ignitionai/sdk +npm install @ignitionai/sdk@next # or -bun add @ignitionai/sdk +bun add @ignitionai/sdk@next ``` +The `0.3.0-rc.3` release candidate is published under the `next` tag. The +`latest` tag remains on the stable `0.2.x` line until the official promotion. + ## Setup ```typescript @@ -170,6 +173,26 @@ for await (const event of stream) { } ``` +## Deep Research + +Monitor and cancel a Deep Research run that was started by an agent. Closing +the stream only stops the local listener; call `cancel()` to stop the remote +execution. + +```typescript +const current = await client.deepResearch.status("agent_xxxx"); + +if (current) { + console.log(current.execution.status, current.execution.tokenCount); +} + +for await (const event of client.deepResearch.stream("agent_xxxx")) { + console.log(event.type, event.data); +} + +await client.deepResearch.cancel("agent_xxxx"); +``` + ## Agents ```typescript @@ -216,6 +239,70 @@ await client.agents.delete("agent_xxxx"); await client.agents.delete("agent_xxxx", true); ``` +## Workflows + +```typescript +const validation = await client.workflows.validate("workflow_xxxx"); +if (!validation.valid) { + console.error(validation.errors); +} + +const run = await client.workflows.execute("workflow_xxxx", { + input: { question: "Summarize the latest customer feedback" }, +}); + +const execution = await client.workflows.getExecution(run.executionId); +console.log(execution.status, execution.output); + +const history = await client.workflows.listExecutions("workflow_xxxx", { + limit: 20, +}); + +if (execution.status === "running") { + await client.workflows.cancelExecution(execution.id); +} +``` + +Aborting the HTTP request does not cancel a remote workflow execution. Use +`cancelExecution()` when the execution itself must stop. + +## Data Chat + +Query collections and external data connectors through the same governed +request. Run the precheck first when you want to surface incompatible or +unavailable sources before execution. + +```typescript +const resources = [ + { type: "collection" as const, id: "coll_xxxx" }, + { type: "data_connector" as const, id: "connector_xxxx" }, +]; + +const precheck = await client.dataChat.precheck({ + llmConfigId: "llm_xxxx", + resources, +}); + +if (!precheck.compatible) { + console.warn(precheck.resources.filter((resource) => !resource.compatible)); +} + +const response = await client.dataChat.send({ + query: "Compare Q2 revenue with the signed customer reports", + llmConfigId: "llm_xxxx", + resources, +}); + +console.log(response.answer); +if (response.completeness === "partial") { + console.warn("Missing sources:", response.missingSources); +} +``` + +Every source reports its own outcome and provenance. A failed connector can +therefore produce an explicit partial response instead of hiding the failure or +discarding successful results from the other sources. + ## Collections ```typescript diff --git a/typescript/package.json b/typescript/package.json index 4e73113..29efe1a 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@ignitionai/sdk", - "version": "0.3.0-rc.2", + "version": "0.3.0-rc.3", "description": "TypeScript SDK for licensed and self-hosted IgnitionRAG deployments", "type": "module", "main": "./dist/cjs/index.js", diff --git a/typescript/src/version.ts b/typescript/src/version.ts index 473fefa..0309754 100644 --- a/typescript/src/version.ts +++ b/typescript/src/version.ts @@ -1 +1 @@ -export const VERSION = "0.3.0-rc.2"; +export const VERSION = "0.3.0-rc.3"; diff --git a/typescript/tests/readme-contract.test.ts b/typescript/tests/readme-contract.test.ts index b49dc85..dbd020a 100644 --- a/typescript/tests/readme-contract.test.ts +++ b/typescript/tests/readme-contract.test.ts @@ -7,6 +7,9 @@ const readme = readFileSync(join(root, "README.md"), "utf8"); const clientSource = readFileSync(join(root, "src/client.ts"), "utf8"); const typesSource = readFileSync(join(root, "src/types.ts"), "utf8"); const mcpSource = readFileSync(join(root, "src/resources/mcp.ts"), "utf8"); +const dataChatSource = readFileSync(join(root, "src/resources/data-chat.ts"), "utf8"); +const workflowsSource = readFileSync(join(root, "src/resources/workflows.ts"), "utf8"); +const deepResearchSource = readFileSync(join(root, "src/resources/deep-research.ts"), "utf8"); describe("README contract snippets", () => { test("documents the SDK timeout default from source", () => { @@ -22,4 +25,27 @@ describe("README contract snippets", () => { expect(readme).toContain("MCP compatibility (deprecated)"); expect(readme).not.toContain("client.mcp.prompts"); }); + + test("documents the release-candidate install channel", () => { + expect(readme).toContain("npm install @ignitionai/sdk@next"); + expect(readme).toContain("bun add @ignitionai/sdk@next"); + expect(readme).toContain("`latest` tag remains on the stable `0.2.x` line"); + }); + + test("documents every first-class execution surface", () => { + expect(dataChatSource).toContain("precheck("); + expect(dataChatSource).toContain("send("); + expect(workflowsSource).toContain("cancelExecution("); + expect(deepResearchSource).toContain("cancel(agentId:"); + + expect(readme).toContain("## Data Chat"); + expect(readme).toContain("client.dataChat.precheck"); + expect(readme).toContain("client.dataChat.send"); + expect(readme).toContain('response.completeness === "partial"'); + expect(readme).toContain("## Workflows"); + expect(readme).toContain("client.workflows.cancelExecution"); + expect(readme).toContain("## Deep Research"); + expect(readme).toContain("client.deepResearch.stream"); + expect(readme).toContain("client.deepResearch.cancel"); + }); });