agent0-js 0.0.13 → 0.0.15

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/dist/index.d.ts CHANGED
@@ -3,7 +3,12 @@ import type { Agent0Config, EmbedManyOptions, EmbedManyResponse, EmbedOptions, E
3
3
  export declare class Agent0 {
4
4
  private apiKey;
5
5
  private baseUrl;
6
+ private environment?;
6
7
  constructor(config: Agent0Config);
8
+ /**
9
+ * Resolve the environment to use: run-level > constructor-level > default 'production'
10
+ */
11
+ private resolveEnvironment;
7
12
  private fetchApi;
8
13
  generate(options: RunOptions): Promise<GenerateResponse>;
9
14
  stream(options: RunOptions): AsyncGenerator<TextStreamPart<ToolSet>, void, unknown>;
package/dist/index.js CHANGED
@@ -5,6 +5,13 @@ class Agent0 {
5
5
  constructor(config) {
6
6
  this.apiKey = config.apiKey;
7
7
  this.baseUrl = config.baseUrl || "https://app.agent0.com"; // Default URL, can be overridden
8
+ this.environment = config.environment;
9
+ }
10
+ /**
11
+ * Resolve the environment to use: run-level > constructor-level > default 'production'
12
+ */
13
+ resolveEnvironment(runEnvironment) {
14
+ return runEnvironment ?? this.environment ?? "production";
8
15
  }
9
16
  async fetchApi(endpoint, body) {
10
17
  const url = `${this.baseUrl}${endpoint}`;
@@ -27,7 +34,7 @@ class Agent0 {
27
34
  async generate(options) {
28
35
  const response = await this.fetchApi("/api/v1/run", {
29
36
  agent_id: options.agentId,
30
- environment: options.environment,
37
+ environment: this.resolveEnvironment(options.environment),
31
38
  variables: options.variables,
32
39
  overrides: options.overrides,
33
40
  extra_messages: options.extraMessages,
@@ -39,7 +46,7 @@ class Agent0 {
39
46
  async *stream(options) {
40
47
  const response = await this.fetchApi("/api/v1/run", {
41
48
  agent_id: options.agentId,
42
- environment: options.environment,
49
+ environment: this.resolveEnvironment(options.environment),
43
50
  variables: options.variables,
44
51
  overrides: options.overrides,
45
52
  extra_messages: options.extraMessages,
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { BedrockProviderOptions } from "@ai-sdk/amazon-bedrock";
1
2
  import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
2
3
  import type { OpenAIResponsesProviderOptions } from "@ai-sdk/openai";
3
4
  import type { XaiProviderOptions } from "@ai-sdk/xai";
@@ -5,6 +6,8 @@ import type { embed, embedMany, ModelMessage } from "ai";
5
6
  export interface Agent0Config {
6
7
  apiKey: string;
7
8
  baseUrl?: string;
9
+ /** Default environment to use for all runs. Can be overridden per-run. Defaults to 'production'. */
10
+ environment?: Environment;
8
11
  }
9
12
  /**
10
13
  * Provider-specific options for reasoning/thinking configuration.
@@ -17,6 +20,8 @@ export interface ProviderOptions {
17
20
  xai?: XaiProviderOptions;
18
21
  /** Google/Vertex thinking configuration */
19
22
  google?: GoogleGenerativeAIProviderOptions;
23
+ /** Amazon Bedrock thinking configuration */
24
+ bedrock?: BedrockProviderOptions;
20
25
  }
21
26
  /**
22
27
  * Model configuration overrides for runtime customization.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent0-js",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "TypeScript SDK for Agent0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,6 +17,7 @@
17
17
  "typescript": "^5.0.0"
18
18
  },
19
19
  "dependencies": {
20
+ "@ai-sdk/amazon-bedrock": "^3.0.72",
20
21
  "@ai-sdk/google": "3.0.0",
21
22
  "@ai-sdk/openai": "3.0.0",
22
23
  "@ai-sdk/xai": "3.0.0",
package/src/types.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { BedrockProviderOptions } from "@ai-sdk/amazon-bedrock";
1
2
  import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
2
3
  import type { OpenAIResponsesProviderOptions } from "@ai-sdk/openai";
3
4
  import type { XaiProviderOptions } from "@ai-sdk/xai";
@@ -21,6 +22,8 @@ export interface ProviderOptions {
21
22
  xai?: XaiProviderOptions;
22
23
  /** Google/Vertex thinking configuration */
23
24
  google?: GoogleGenerativeAIProviderOptions;
25
+ /** Amazon Bedrock thinking configuration */
26
+ bedrock?: BedrockProviderOptions;
24
27
  }
25
28
 
26
29
  /**