@happyrobot-ai/sdk 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/chat-client.js CHANGED
@@ -26,7 +26,8 @@
26
26
  */
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.HappyRobotChatClient = void 0;
29
- const DEFAULT_BASE_URL = "https://platform.happyrobot.ai/api/v2";
29
+ const http_1 = require("./core/http");
30
+ const DEFAULT_BASE_URL = http_1.CLUSTER_URLS.us;
30
31
  class HappyRobotChatClient {
31
32
  token;
32
33
  baseUrl;
@@ -36,12 +37,16 @@ class HappyRobotChatClient {
36
37
  throw new Error("token is required");
37
38
  }
38
39
  this.token = config.token;
39
- const customBaseUrl = config.baseUrl;
40
+ const customBaseUrl = config
41
+ .baseUrl;
40
42
  const isTesting = typeof process !== "undefined" && process.env?.HR_TESTING === "true";
41
43
  if (customBaseUrl && !isTesting) {
42
44
  throw new Error("baseUrl can not be overridden");
43
45
  }
44
- this.baseUrl = (customBaseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
46
+ const clusterUrl = config.cluster
47
+ ? http_1.CLUSTER_URLS[config.cluster]
48
+ : undefined;
49
+ this.baseUrl = (customBaseUrl ?? clusterUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
45
50
  this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
46
51
  }
47
52
  /** Create a new chat session. */
package/client.d.ts CHANGED
@@ -10,31 +10,31 @@
10
10
  * ```
11
11
  */
12
12
  import type { ClientConfig } from "./core/types";
13
- import { WorkflowsResource } from "./resources/workflows";
14
- import { VersionsResource } from "./resources/versions";
15
- import { NodesResource } from "./resources/nodes";
16
- import { RunsResource } from "./resources/runs";
17
- import { SessionsResource } from "./resources/sessions";
18
- import { MessagesResource } from "./resources/messages";
19
- import { VariablesResource } from "./resources/variables";
20
- import { PhoneNumbersResource } from "./resources/phone-numbers";
21
- import { SipTrunksResource } from "./resources/sip-trunks";
22
- import { IntegrationsResource } from "./resources/integrations";
23
- import { ContactsResource } from "./resources/contacts";
24
- import { KnowledgeBasesResource } from "./resources/knowledge-bases";
25
- import { WorkflowFoldersResource } from "./resources/workflow-folders";
26
- import { MCPResource } from "./resources/mcp";
27
- import { BillingResource } from "./resources/billing";
28
- import { ApiKeyResource } from "./resources/api-key";
29
13
  import { AdversarialSuitesResource } from "./resources/adversarial-suites";
30
14
  import { AdversarialTestsResource } from "./resources/adversarial-tests";
31
- import { NorthstarsResource } from "./resources/northstars";
32
- import { CustomEvalsResource } from "./resources/custom-evals";
33
- import { IssuesResource } from "./resources/issues";
15
+ import { ApiKeyResource } from "./resources/api-key";
16
+ import { ArtifactsResource } from "./resources/artifacts";
34
17
  import { AuditRemarksResource } from "./resources/audit-remarks";
18
+ import { BillingResource } from "./resources/billing";
35
19
  import { ChatResource } from "./resources/chat";
36
- import { ArtifactsResource } from "./resources/artifacts";
20
+ import { ContactsResource } from "./resources/contacts";
21
+ import { CustomEvalsResource } from "./resources/custom-evals";
22
+ import { IntegrationsResource } from "./resources/integrations";
23
+ import { IssuesResource } from "./resources/issues";
24
+ import { KnowledgeBasesResource } from "./resources/knowledge-bases";
25
+ import { MCPResource } from "./resources/mcp";
26
+ import { MessagesResource } from "./resources/messages";
27
+ import { NodesResource } from "./resources/nodes";
28
+ import { NorthstarsResource } from "./resources/northstars";
29
+ import { PhoneNumbersResource } from "./resources/phone-numbers";
30
+ import { RunsResource } from "./resources/runs";
31
+ import { SessionsResource } from "./resources/sessions";
32
+ import { SipTrunksResource } from "./resources/sip-trunks";
33
+ import { VariablesResource } from "./resources/variables";
34
+ import { VersionsResource } from "./resources/versions";
37
35
  import { VoiceResource } from "./resources/voice";
36
+ import { WorkflowFoldersResource } from "./resources/workflow-folders";
37
+ import { WorkflowsResource } from "./resources/workflows";
38
38
  export declare class HappyRobotClient {
39
39
  private readonly http;
40
40
  /** Workflow CRUD, publishing, runs, and templates. */
package/client.js CHANGED
@@ -13,31 +13,31 @@
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.HappyRobotClient = void 0;
15
15
  const http_1 = require("./core/http");
16
- const workflows_1 = require("./resources/workflows");
17
- const versions_1 = require("./resources/versions");
18
- const nodes_1 = require("./resources/nodes");
19
- const runs_1 = require("./resources/runs");
20
- const sessions_1 = require("./resources/sessions");
21
- const messages_1 = require("./resources/messages");
22
- const variables_1 = require("./resources/variables");
23
- const phone_numbers_1 = require("./resources/phone-numbers");
24
- const sip_trunks_1 = require("./resources/sip-trunks");
25
- const integrations_1 = require("./resources/integrations");
26
- const contacts_1 = require("./resources/contacts");
27
- const knowledge_bases_1 = require("./resources/knowledge-bases");
28
- const workflow_folders_1 = require("./resources/workflow-folders");
29
- const mcp_1 = require("./resources/mcp");
30
- const billing_1 = require("./resources/billing");
31
- const api_key_1 = require("./resources/api-key");
32
16
  const adversarial_suites_1 = require("./resources/adversarial-suites");
33
17
  const adversarial_tests_1 = require("./resources/adversarial-tests");
34
- const northstars_1 = require("./resources/northstars");
35
- const custom_evals_1 = require("./resources/custom-evals");
36
- const issues_1 = require("./resources/issues");
18
+ const api_key_1 = require("./resources/api-key");
19
+ const artifacts_1 = require("./resources/artifacts");
37
20
  const audit_remarks_1 = require("./resources/audit-remarks");
21
+ const billing_1 = require("./resources/billing");
38
22
  const chat_1 = require("./resources/chat");
39
- const artifacts_1 = require("./resources/artifacts");
23
+ const contacts_1 = require("./resources/contacts");
24
+ const custom_evals_1 = require("./resources/custom-evals");
25
+ const integrations_1 = require("./resources/integrations");
26
+ const issues_1 = require("./resources/issues");
27
+ const knowledge_bases_1 = require("./resources/knowledge-bases");
28
+ const mcp_1 = require("./resources/mcp");
29
+ const messages_1 = require("./resources/messages");
30
+ const nodes_1 = require("./resources/nodes");
31
+ const northstars_1 = require("./resources/northstars");
32
+ const phone_numbers_1 = require("./resources/phone-numbers");
33
+ const runs_1 = require("./resources/runs");
34
+ const sessions_1 = require("./resources/sessions");
35
+ const sip_trunks_1 = require("./resources/sip-trunks");
36
+ const variables_1 = require("./resources/variables");
37
+ const versions_1 = require("./resources/versions");
40
38
  const voice_1 = require("./resources/voice");
39
+ const workflow_folders_1 = require("./resources/workflow-folders");
40
+ const workflows_1 = require("./resources/workflows");
41
41
  class HappyRobotClient {
42
42
  http;
43
43
  /** Workflow CRUD, publishing, runs, and templates. */
package/core/http.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  * Uses native fetch with auth, retry (exponential backoff), and timeout.
4
4
  */
5
5
  import type { ClientConfig, RequestConfig } from "./types";
6
+ export declare const CLUSTER_URLS: Record<string, string>;
6
7
  export declare class HttpClient {
7
8
  private readonly apiKey;
8
9
  private readonly baseUrl;
package/core/http.js CHANGED
@@ -4,9 +4,13 @@
4
4
  * Uses native fetch with auth, retry (exponential backoff), and timeout.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.HttpClient = void 0;
7
+ exports.HttpClient = exports.CLUSTER_URLS = void 0;
8
8
  const errors_1 = require("./errors");
9
- const DEFAULT_BASE_URL = "https://platform.happyrobot.ai/api/v2";
9
+ exports.CLUSTER_URLS = {
10
+ us: "https://platform.happyrobot.ai/api/v2",
11
+ eu: "https://platform.eu.happyrobot.ai/api/v2",
12
+ };
13
+ const DEFAULT_BASE_URL = exports.CLUSTER_URLS.us;
10
14
  const DEFAULT_TIMEOUT = 30_000;
11
15
  const DEFAULT_MAX_RETRIES = 2;
12
16
  const INITIAL_BACKOFF_MS = 500;
@@ -21,12 +25,16 @@ class HttpClient {
21
25
  throw new Error("apiKey is required");
22
26
  }
23
27
  this.apiKey = config.apiKey;
24
- const customBaseUrl = config.baseUrl;
28
+ const customBaseUrl = config
29
+ .baseUrl;
25
30
  const isTesting = typeof process !== "undefined" && process.env?.HR_TESTING === "true";
26
31
  if (customBaseUrl && !isTesting) {
27
32
  throw new Error("baseUrl can not be overridden");
28
33
  }
29
- this.baseUrl = (customBaseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
34
+ const clusterUrl = config.cluster
35
+ ? exports.CLUSTER_URLS[config.cluster]
36
+ : undefined;
37
+ this.baseUrl = (customBaseUrl ?? clusterUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
30
38
  this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
31
39
  this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
32
40
  this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
@@ -68,7 +76,9 @@ class HttpClient {
68
76
  const response = await this.fetchWithTimeout(url, {
69
77
  method: config.method,
70
78
  headers,
71
- body: config.body !== undefined ? JSON.stringify(config.body) : undefined,
79
+ body: config.body !== undefined
80
+ ? JSON.stringify(config.body)
81
+ : undefined,
72
82
  }, timeout);
73
83
  if (response.ok) {
74
84
  if (response.status === 204) {
package/core/http.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import * as _cjs from "./http.js";
2
- const { HttpClient } = _cjs;
3
- export { HttpClient };
2
+ const { HttpClient, CLUSTER_URLS } = _cjs;
3
+ export { HttpClient, CLUSTER_URLS };
package/core/sse.js CHANGED
@@ -65,7 +65,9 @@ async function* iterateSSE(response) {
65
65
  continue;
66
66
  const field = line.slice(0, colonIdx);
67
67
  // Strip optional leading space after colon per SSE spec
68
- const val = line[colonIdx + 1] === " " ? line.slice(colonIdx + 2) : line.slice(colonIdx + 1);
68
+ const val = line[colonIdx + 1] === " "
69
+ ? line.slice(colonIdx + 2)
70
+ : line.slice(colonIdx + 1);
69
71
  switch (field) {
70
72
  case "event":
71
73
  currentEvent = val;
package/core/types.d.ts CHANGED
@@ -4,6 +4,8 @@
4
4
  export interface ClientConfig {
5
5
  /** API key (sk_live_... or sk_test_...). Required. */
6
6
  apiKey: string;
7
+ /** Cluster to connect to. Determines the base URL. Defaults to "us". */
8
+ cluster?: "us" | "eu";
7
9
  /** Request timeout in milliseconds. Defaults to 30000. */
8
10
  timeout?: number;
9
11
  /** Max retries on 429/5xx. Defaults to 2. Uses exponential backoff. */
@@ -7,10 +7,10 @@
7
7
  * ```
8
8
  */
9
9
  export { createVoiceAgent } from "./voice-agent";
10
- export type { CreateVoiceAgentOptions, CreateVoiceAgentResult } from "./voice-agent";
10
+ export type { CreateVoiceAgentOptions, CreateVoiceAgentResult, } from "./voice-agent";
11
11
  export { triggerAndWait } from "./trigger-and-wait";
12
- export type { TriggerAndWaitOptions, TriggerAndWaitResult } from "./trigger-and-wait";
12
+ export type { TriggerAndWaitOptions, TriggerAndWaitResult, } from "./trigger-and-wait";
13
13
  export { triggerAndWaitForNodeOutput } from "./trigger-and-wait-for-node-output";
14
14
  export type { TriggerAndWaitForNodeOutputOptions, TriggerAndWaitForNodeOutputResult, } from "./trigger-and-wait-for-node-output";
15
15
  export { createFromTemplate } from "./template-workflows";
16
- export type { CreateFromTemplateOptions, CreateFromTemplateResult } from "./template-workflows";
16
+ export type { CreateFromTemplateOptions, CreateFromTemplateResult, } from "./template-workflows";
@@ -42,7 +42,9 @@ async function triggerAndWaitForNodeOutput(client, options) {
42
42
  });
43
43
  const matchingNodes = nodes.data.filter((item) => item.node_persistent_id === nodePersistentId);
44
44
  const node = pickLatestNodeExecution(matchingNodes);
45
- if (node?.output_id && node.status && NODE_READY_STATUSES.has(node.status)) {
45
+ if (node?.output_id &&
46
+ node.status &&
47
+ NODE_READY_STATUSES.has(node.status)) {
46
48
  const output = await client.runs.getOutput(run_id, node.output_id);
47
49
  return {
48
50
  ok: true,
package/index.d.ts CHANGED
@@ -22,7 +22,8 @@
22
22
  * ```
23
23
  */
24
24
  export { HappyRobotClient } from "./client";
25
- export type { ClientConfig, RequestConfig, PaginatedResponse, PaginationMetadata, PaginationQuery } from "./core/types";
25
+ export type { ClientConfig, RequestConfig, PaginatedResponse, PaginationMetadata, PaginationQuery, } from "./core/types";
26
+ export { CLUSTER_URLS } from "./core/http";
26
27
  export { HappyRobotError, ApiError, AuthenticationError, NotFoundError, ValidationError, RateLimitError, TimeoutError, NetworkError, } from "./core/errors";
27
28
  export type { ApiErrorBody } from "./core/errors";
28
29
  export { paginate } from "./core/pagination";
@@ -31,7 +32,7 @@ export type { SSEEvent } from "./core/sse";
31
32
  export { WorkflowsResource } from "./resources/workflows";
32
33
  export { VersionsResource } from "./resources/versions";
33
34
  export { NodesResource } from "./resources/nodes";
34
- export type { TestNodeBody, TestNodeOutput, TestNodeResponse } from "./resources/nodes";
35
+ export type { TestNodeBody, TestNodeOutput, TestNodeResponse, } from "./resources/nodes";
35
36
  export { RunsResource } from "./resources/runs";
36
37
  export { SessionsResource } from "./resources/sessions";
37
38
  export { MessagesResource } from "./resources/messages";
package/index.js CHANGED
@@ -23,10 +23,12 @@
23
23
  * ```
24
24
  */
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.VoiceResource = exports.ArtifactsResource = exports.ChatResource = exports.AuditRemarksResource = exports.IssuesResource = exports.CustomEvalsResource = exports.NorthstarsResource = exports.AdversarialTestsResource = exports.AdversarialSuitesResource = exports.ApiKeyResource = exports.BillingResource = exports.MCPResource = exports.WorkflowFoldersResource = exports.KnowledgeBasesResource = exports.ContactsResource = exports.IntegrationsResource = exports.SipTrunksResource = exports.PhoneNumbersResource = exports.VariablesResource = exports.MessagesResource = exports.SessionsResource = exports.RunsResource = exports.NodesResource = exports.VersionsResource = exports.WorkflowsResource = exports.iterateSSE = exports.paginate = exports.NetworkError = exports.TimeoutError = exports.RateLimitError = exports.ValidationError = exports.NotFoundError = exports.AuthenticationError = exports.ApiError = exports.HappyRobotError = exports.HappyRobotClient = void 0;
26
+ exports.VoiceResource = exports.ArtifactsResource = exports.ChatResource = exports.AuditRemarksResource = exports.IssuesResource = exports.CustomEvalsResource = exports.NorthstarsResource = exports.AdversarialTestsResource = exports.AdversarialSuitesResource = exports.ApiKeyResource = exports.BillingResource = exports.MCPResource = exports.WorkflowFoldersResource = exports.KnowledgeBasesResource = exports.ContactsResource = exports.IntegrationsResource = exports.SipTrunksResource = exports.PhoneNumbersResource = exports.VariablesResource = exports.MessagesResource = exports.SessionsResource = exports.RunsResource = exports.NodesResource = exports.VersionsResource = exports.WorkflowsResource = exports.iterateSSE = exports.paginate = exports.NetworkError = exports.TimeoutError = exports.RateLimitError = exports.ValidationError = exports.NotFoundError = exports.AuthenticationError = exports.ApiError = exports.HappyRobotError = exports.CLUSTER_URLS = exports.HappyRobotClient = void 0;
27
27
  // ── Clients ──
28
28
  var client_1 = require("./client");
29
29
  Object.defineProperty(exports, "HappyRobotClient", { enumerable: true, get: function () { return client_1.HappyRobotClient; } });
30
+ var http_1 = require("./core/http");
31
+ Object.defineProperty(exports, "CLUSTER_URLS", { enumerable: true, get: function () { return http_1.CLUSTER_URLS; } });
30
32
  var errors_1 = require("./core/errors");
31
33
  Object.defineProperty(exports, "HappyRobotError", { enumerable: true, get: function () { return errors_1.HappyRobotError; } });
32
34
  Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return errors_1.ApiError; } });
package/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import * as _cjs from "./index.js";
2
- const { HappyRobotClient, HappyRobotError, ApiError, AuthenticationError, NotFoundError, ValidationError, RateLimitError, TimeoutError, NetworkError, paginate, iterateSSE, WorkflowsResource, VersionsResource, NodesResource, RunsResource, SessionsResource, MessagesResource, VariablesResource, PhoneNumbersResource, SipTrunksResource, IntegrationsResource, ContactsResource, KnowledgeBasesResource, WorkflowFoldersResource, MCPResource, BillingResource, ApiKeyResource, AdversarialSuitesResource, AdversarialTestsResource, NorthstarsResource, CustomEvalsResource, IssuesResource, AuditRemarksResource, ChatResource, ArtifactsResource, VoiceResource } = _cjs;
3
- export { HappyRobotClient, HappyRobotError, ApiError, AuthenticationError, NotFoundError, ValidationError, RateLimitError, TimeoutError, NetworkError, paginate, iterateSSE, WorkflowsResource, VersionsResource, NodesResource, RunsResource, SessionsResource, MessagesResource, VariablesResource, PhoneNumbersResource, SipTrunksResource, IntegrationsResource, ContactsResource, KnowledgeBasesResource, WorkflowFoldersResource, MCPResource, BillingResource, ApiKeyResource, AdversarialSuitesResource, AdversarialTestsResource, NorthstarsResource, CustomEvalsResource, IssuesResource, AuditRemarksResource, ChatResource, ArtifactsResource, VoiceResource };
2
+ const { HappyRobotClient, CLUSTER_URLS, HappyRobotError, ApiError, AuthenticationError, NotFoundError, ValidationError, RateLimitError, TimeoutError, NetworkError, paginate, iterateSSE, WorkflowsResource, VersionsResource, NodesResource, RunsResource, SessionsResource, MessagesResource, VariablesResource, PhoneNumbersResource, SipTrunksResource, IntegrationsResource, ContactsResource, KnowledgeBasesResource, WorkflowFoldersResource, MCPResource, BillingResource, ApiKeyResource, AdversarialSuitesResource, AdversarialTestsResource, NorthstarsResource, CustomEvalsResource, IssuesResource, AuditRemarksResource, ChatResource, ArtifactsResource, VoiceResource } = _cjs;
3
+ export { HappyRobotClient, CLUSTER_URLS, HappyRobotError, ApiError, AuthenticationError, NotFoundError, ValidationError, RateLimitError, TimeoutError, NetworkError, paginate, iterateSSE, WorkflowsResource, VersionsResource, NodesResource, RunsResource, SessionsResource, MessagesResource, VariablesResource, PhoneNumbersResource, SipTrunksResource, IntegrationsResource, ContactsResource, KnowledgeBasesResource, WorkflowFoldersResource, MCPResource, BillingResource, ApiKeyResource, AdversarialSuitesResource, AdversarialTestsResource, NorthstarsResource, CustomEvalsResource, IssuesResource, AuditRemarksResource, ChatResource, ArtifactsResource, VoiceResource };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyrobot-ai/sdk",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "TypeScript SDK for the HappyRobot Public API",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
@@ -35,23 +35,11 @@
35
35
  "optional": true
36
36
  }
37
37
  },
38
- "files": [
39
- "**/*.js",
40
- "**/*.mjs",
41
- "**/*.d.ts",
42
- "**/*.d.ts.map",
43
- "README.md"
44
- ],
38
+ "files": ["**/*.js", "**/*.mjs", "**/*.d.ts", "**/*.d.ts.map", "README.md"],
45
39
  "engines": {
46
40
  "node": ">=18"
47
41
  },
48
- "keywords": [
49
- "happyrobot",
50
- "sdk",
51
- "api",
52
- "voice-ai",
53
- "workflows"
54
- ],
42
+ "keywords": ["happyrobot", "sdk", "api", "voice-ai", "workflows"],
55
43
  "license": "MIT",
56
44
  "repository": {
57
45
  "type": "git",
@@ -59,4 +47,4 @@
59
47
  "directory": "packages/public_api"
60
48
  },
61
49
  "dependencies": {}
62
- }
50
+ }
@@ -12,8 +12,8 @@
12
12
  * POST /versions/:version_id/nodes/:node_id/test
13
13
  */
14
14
  import type { HttpClient } from "../core/http";
15
- import type { ListNodesResponse, AddNodesBody, AddNodesResponse, UpdateNodeBody, GetSingleNodeResponse } from "../types/versions.types";
16
15
  import type { AvailableVarsResponse, ConfigSchemaResponse } from "../types/nodes.types";
16
+ import type { ListNodesResponse, AddNodesBody, AddNodesResponse, UpdateNodeBody, GetSingleNodeResponse } from "../types/versions.types";
17
17
  export interface TestNodeBody {
18
18
  environment?: "production" | "staging" | "development";
19
19
  }
@@ -17,8 +17,8 @@
17
17
  * POST /workflows/:workflow_id/runs
18
18
  */
19
19
  import type { HttpClient } from "../core/http";
20
- import type { ListWorkflowsQuery, WorkflowListItem, PaginatedWorkflowsResponse, CreateWorkflowBody, CreateWorkflowResponse, WorkflowDetailResponse, UpdateWorkflowBody, UpdateWorkflowResponse, DuplicateWorkflowBody, DuplicateWorkflowResponse, ListTemplatesQuery, PaginatedTemplatesResponse, WorkflowPublishResponse, WorkflowUnpublishResponse, CancelRunsResponse, ListWorkflowVersionsQuery, PaginatedWorkflowVersionsResponse } from "../types/workflows.types";
21
20
  import type { WorkflowRunsQuery, PaginatedWorkflowRunsResponse, TriggerRunBody, TriggerRunResponse } from "../types/runs.types";
21
+ import type { ListWorkflowsQuery, WorkflowListItem, PaginatedWorkflowsResponse, CreateWorkflowBody, CreateWorkflowResponse, WorkflowDetailResponse, UpdateWorkflowBody, UpdateWorkflowResponse, DuplicateWorkflowBody, DuplicateWorkflowResponse, ListTemplatesQuery, PaginatedTemplatesResponse, WorkflowPublishResponse, WorkflowUnpublishResponse, CancelRunsResponse, ListWorkflowVersionsQuery, PaginatedWorkflowVersionsResponse } from "../types/workflows.types";
22
22
  export declare class WorkflowsResource {
23
23
  private readonly http;
24
24
  constructor(http: HttpClient);
@@ -2,14 +2,14 @@
2
2
  * Adversarial suite types extracted from Zod schemas.
3
3
  */
4
4
  import type { z } from "zod";
5
- import type { AdversarialSuiteApiSchema } from "../../routes/nodes/:node_id/adversarial-suites/get";
5
+ import type { GenerateAdversarialSuiteGraphBodySchema, GenerateAdversarialSuiteGraphResponseSchema } from "../../routes/adversarial-suites/generate-graph/post";
6
+ import type { GenerateAdversarialSuiteTestsBodySchema, GenerateAdversarialSuiteTestsResponseSchema } from "../../routes/adversarial-suites/generate/post";
6
7
  import type { GetAdversarialSuiteByIdResponseSchema } from "../../routes/adversarial-suites/get";
7
8
  import type { PatchAdversarialSuiteBodySchema, PatchAdversarialSuiteResponseSchema } from "../../routes/adversarial-suites/patch";
8
9
  import type { RunAdversarialSuiteBodySchema, RunAdversarialSuiteResponseSchema } from "../../routes/adversarial-suites/run/post";
9
- import type { AdversarialSuiteRunApiSchema, GetAdversarialSuiteRunsResponseSchema } from "../../routes/adversarial-suites/runs/get";
10
10
  import type { AdversarialSuiteTestRunItemSchema, GetAdversarialSuiteRunTestRunsResponseSchema } from "../../routes/adversarial-suites/runs/:suite_run_id/test-runs/get";
11
- import type { GenerateAdversarialSuiteTestsBodySchema, GenerateAdversarialSuiteTestsResponseSchema } from "../../routes/adversarial-suites/generate/post";
12
- import type { GenerateAdversarialSuiteGraphBodySchema, GenerateAdversarialSuiteGraphResponseSchema } from "../../routes/adversarial-suites/generate-graph/post";
11
+ import type { AdversarialSuiteRunApiSchema, GetAdversarialSuiteRunsResponseSchema } from "../../routes/adversarial-suites/runs/get";
12
+ import type { AdversarialSuiteApiSchema } from "../../routes/nodes/:node_id/adversarial-suites/get";
13
13
  export type AdversarialSuite = z.infer<typeof AdversarialSuiteApiSchema>;
14
14
  export type GetAdversarialSuiteResponse = z.infer<typeof GetAdversarialSuiteByIdResponseSchema>;
15
15
  export type PatchAdversarialSuiteBody = z.input<typeof PatchAdversarialSuiteBodySchema>;
@@ -2,12 +2,12 @@
2
2
  * Adversarial test types extracted from Zod schemas.
3
3
  */
4
4
  import type { z } from "zod";
5
- import type { AdversarialTestApiSchema } from "../../routes/nodes/:node_id/adversarial-tests/get";
6
5
  import type { GetAdversarialTestByIdResponseSchema } from "../../routes/adversarial-tests/get";
7
6
  import type { PatchAdversarialTestBodySchema, PatchAdversarialTestResponseSchema } from "../../routes/adversarial-tests/patch";
8
7
  import type { RunAdversarialTestBodySchema, RunAdversarialTestResponseSchema } from "../../routes/adversarial-tests/run/post";
9
- import type { AuditRemarkApiSchema, AdversarialTestRunApiSchema, GetAdversarialTestRunsResponseSchema } from "../../routes/adversarial-tests/runs/get";
10
8
  import type { AdversarialTestRunMessageSchema, GetAdversarialTestRunMessagesResponseSchema } from "../../routes/adversarial-tests/runs/:run_id/messages/get";
9
+ import type { AuditRemarkApiSchema, AdversarialTestRunApiSchema, GetAdversarialTestRunsResponseSchema } from "../../routes/adversarial-tests/runs/get";
10
+ import type { AdversarialTestApiSchema } from "../../routes/nodes/:node_id/adversarial-tests/get";
11
11
  export type AdversarialTest = z.infer<typeof AdversarialTestApiSchema>;
12
12
  export type GetAdversarialTestResponse = z.infer<typeof GetAdversarialTestByIdResponseSchema>;
13
13
  export type PatchAdversarialTestBody = z.input<typeof PatchAdversarialTestBodySchema>;
@@ -94,6 +94,8 @@ export interface CompleteUploadResponse {
94
94
  export interface ChatClientConfig {
95
95
  /** Scoped client token from `client.chat.createToken()`. */
96
96
  token: string;
97
+ /** Cluster to connect to. Determines the base URL. Defaults to "us". */
98
+ cluster?: "us" | "eu";
97
99
  /** Custom fetch implementation. Defaults to `globalThis.fetch`. */
98
100
  fetch?: typeof globalThis.fetch;
99
101
  }
@@ -2,11 +2,11 @@
2
2
  * Custom eval types extracted from Zod schemas.
3
3
  */
4
4
  import type { z } from "zod";
5
- import type { CustomTestApiSchema, TestMessageSchema, ExpectedToolCallSchema } from "../../routes/nodes/:node_id/custom-evals/get";
6
5
  import type { GetCustomEvalByIdResponseSchema } from "../../routes/custom-evals/get";
7
6
  import type { PatchCustomEvalBodySchema, PatchCustomEvalResponseSchema } from "../../routes/custom-evals/patch";
8
7
  import type { RunCustomEvalBodySchema, RunCustomEvalResponseSchema } from "../../routes/custom-evals/run/post";
9
8
  import type { CustomEvalRunItemSchema, GetCustomEvalRunsResponseSchema } from "../../routes/custom-evals/runs/get";
9
+ import type { CustomTestApiSchema, TestMessageSchema, ExpectedToolCallSchema } from "../../routes/nodes/:node_id/custom-evals/get";
10
10
  export type CustomEval = z.infer<typeof CustomTestApiSchema>;
11
11
  export type TestMessage = z.infer<typeof TestMessageSchema>;
12
12
  export type ExpectedToolCall = z.infer<typeof ExpectedToolCallSchema>;
@@ -2,8 +2,8 @@
2
2
  * Integration types extracted from Zod schemas.
3
3
  */
4
4
  import type { z } from "zod";
5
- import type { IntegrationSchema, EventSchema, CredentialSchema, ListIntegrationsQuerySchema, ListIntegrationsResponseSchema, CreateCredentialBodySchema, CreateCredentialResponseSchema } from "../../routes/integrations/schemas";
6
5
  import type { ResourceListResponseSchema, ResourceListWithDescriptionResponseSchema, WhatsAppTemplateListResponseSchema } from "../../routes/integrations/resources-schemas";
6
+ import type { IntegrationSchema, EventSchema, CredentialSchema, ListIntegrationsQuerySchema, ListIntegrationsResponseSchema, CreateCredentialBodySchema, CreateCredentialResponseSchema } from "../../routes/integrations/schemas";
7
7
  export type Integration = z.infer<typeof IntegrationSchema>;
8
8
  export type IntegrationEvent = z.infer<typeof EventSchema>;
9
9
  export type Credential = z.infer<typeof CredentialSchema>;
@@ -2,9 +2,9 @@
2
2
  * Node types extracted from Zod schemas.
3
3
  */
4
4
  import type { z } from "zod";
5
- import type { NodeResponseSchema, AddNodeResponseSchema, NodeInputSchema as VersionNodeInputSchema } from "../../routes/versions/:version_id/schemas";
6
5
  import type { AvailableVarsResponseSchema } from "../../routes/versions/:version_id/nodes/:node_id/available-vars/schemas";
7
6
  import type { ConfigSchemaResponseSchema } from "../../routes/versions/:version_id/nodes/:node_id/config-schema/schemas";
7
+ import type { NodeResponseSchema, AddNodeResponseSchema, NodeInputSchema as VersionNodeInputSchema } from "../../routes/versions/:version_id/schemas";
8
8
  export type NodeResponse = z.infer<typeof NodeResponseSchema>;
9
9
  export type AddNodeResponse = z.infer<typeof AddNodeResponseSchema>;
10
10
  export type NodeInput = z.input<typeof VersionNodeInputSchema>;
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import type { z } from "zod";
5
5
  import type { NorthstarApiSchema, NorthstarFeedbackApiSchema } from "../../routes/nodes/:node_id/northstars/get";
6
+ import type { SubmitNorthstarFeedbackBodySchema, NorthstarFeedbackItemSchema, SubmitNorthstarFeedbackResponseSchema } from "../../routes/northstars/feedback/post";
6
7
  import type { GetNorthstarByIdResponseSchema } from "../../routes/northstars/get";
7
- import type { PatchNorthstarBodySchema, PatchNorthstarResponseSchema } from "../../routes/northstars/patch";
8
8
  import type { GetNorthstarHistoryResponseSchema } from "../../routes/northstars/history/get";
9
- import type { SubmitNorthstarFeedbackBodySchema, NorthstarFeedbackItemSchema, SubmitNorthstarFeedbackResponseSchema } from "../../routes/northstars/feedback/post";
9
+ import type { PatchNorthstarBodySchema, PatchNorthstarResponseSchema } from "../../routes/northstars/patch";
10
10
  export type Northstar = z.infer<typeof NorthstarApiSchema>;
11
11
  export type NorthstarFeedback = z.infer<typeof NorthstarFeedbackApiSchema>;
12
12
  export type GetNorthstarResponse = z.infer<typeof GetNorthstarByIdResponseSchema>;
@@ -2,8 +2,8 @@
2
2
  * Version types extracted from Zod schemas.
3
3
  */
4
4
  import type { z } from "zod";
5
- import type { VersionWithNodesSummarySchema, UpdateVersionBodySchema, UpdateVersionResponseSchema, ForkVersionResponseSchema, PublishBodySchema, PublishResponseSchema, PublishErrorResponseSchema, VersionStatusResponseSchema, ListNodesResponseSchema, AddNodesBodySchema, AddNodesResponseSchema, UpdateNodeBodySchema, GetSingleNodeResponseSchema } from "../../routes/versions/:version_id/schemas";
6
5
  import type { PromptIssuesResponseSchema, PromptNodeIssuesSchema, PromptIssueSchema } from "../../routes/versions/:version_id/prompt-issues/get";
6
+ import type { VersionWithNodesSummarySchema, UpdateVersionBodySchema, UpdateVersionResponseSchema, ForkVersionResponseSchema, PublishBodySchema, PublishResponseSchema, PublishErrorResponseSchema, VersionStatusResponseSchema, ListNodesResponseSchema, AddNodesBodySchema, AddNodesResponseSchema, UpdateNodeBodySchema, GetSingleNodeResponseSchema } from "../../routes/versions/:version_id/schemas";
7
7
  export type VersionWithNodesSummary = z.infer<typeof VersionWithNodesSummarySchema>;
8
8
  export type UpdateVersionBody = z.input<typeof UpdateVersionBodySchema>;
9
9
  export type UpdateVersionResponse = z.infer<typeof UpdateVersionResponseSchema>;