exa-js 2.22.2 → 2.23.0

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/README.md CHANGED
@@ -223,17 +223,14 @@ console.log(
223
223
  );
224
224
  ```
225
225
 
226
- For Agent Max, use the beta namespace and pass the beta token explicitly:
226
+ For Agent Ultra, set `effort: "ultra"`:
227
227
 
228
228
  ```ts
229
- import { AGENT_MAX_EFFORT_BETA } from "exa-js";
230
-
231
- const maxRun = await exa.beta.agent.runs.create({
229
+ const ultraRun = await exa.agent.runs.create({
232
230
  query:
233
231
  "Find all companies building browser automation tools in the United States.",
234
- effort: "max",
232
+ effort: "ultra",
235
233
  budget: { maxCostDollars: 10 },
236
- betas: [AGENT_MAX_EFFORT_BETA],
237
234
  });
238
235
  ```
239
236
 
package/dist/index.d.mts CHANGED
@@ -18,17 +18,21 @@ interface AgentBetaOptions {
18
18
  betas?: string[];
19
19
  }
20
20
  type AgentRunStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
21
- type AgentStopReason = "schema_satisfied" | "budget_reached" | "stopped" | "error" | "cancelled";
21
+ type AgentStopReason = "schema_satisfied" | "budget_reached" | "time_limit_reached" | "stopped" | "error" | "cancelled";
22
22
  type AgentConfidence = "low" | "medium" | "high";
23
- type AgentEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | "auto" | "max";
24
- /** Per-run spend ceiling for the metered `auto` and `max` efforts. */
23
+ type AgentEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | "auto" | "ultra" | "max";
24
+ /** Per-run spend ceiling for the metered `auto` and `ultra` efforts. */
25
25
  interface AgentBudget {
26
26
  /**
27
27
  * Maximum spend for the run in US dollars.
28
- * Only accepted by the API for `auto` and `max`; the server validates the
28
+ * Only accepted by the API for `auto` and `ultra`; the server validates the
29
29
  * allowed range and applies defaults when omitted.
30
30
  */
31
31
  maxCostDollars?: number;
32
+ /**
33
+ * Soft wall-clock ceiling in seconds (300–10,800). Only accepted for `ultra`.
34
+ */
35
+ maxDurationSeconds?: number;
32
36
  }
33
37
  /**
34
38
  * Identifier of an Exa Connect data provider, e.g. `"fiber_ai"`,
@@ -657,6 +661,11 @@ declare class AgentRunsClient extends AgentBaseClient {
657
661
  * Cancel a queued or running Agent run.
658
662
  */
659
663
  cancel(runId: string): Promise<AgentRun>;
664
+ /**
665
+ * Stop a running Agent run, completing it early with the results
666
+ * gathered so far. Only supported for `ultra` effort runs.
667
+ */
668
+ stop(runId: string): Promise<AgentRun>;
660
669
  /**
661
670
  * Delete a stored Agent run.
662
671
  */
@@ -710,7 +719,7 @@ declare class AgentBetaRunsClient extends AgentRunsClient {
710
719
  cancel(runId: string, options?: AgentBetaOptions): Promise<AgentRun>;
711
720
  /**
712
721
  * Stop a running Agent run, completing it early with the results
713
- * gathered so far. Only supported for `max` effort runs.
722
+ * gathered so far. Only supported for `ultra` effort runs.
714
723
  */
715
724
  stop(runId: string, options?: AgentBetaOptions): Promise<AgentRun>;
716
725
  delete(runId: string, options?: AgentBetaOptions): Promise<DeletedAgentRun>;
package/dist/index.d.ts CHANGED
@@ -18,17 +18,21 @@ interface AgentBetaOptions {
18
18
  betas?: string[];
19
19
  }
20
20
  type AgentRunStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
21
- type AgentStopReason = "schema_satisfied" | "budget_reached" | "stopped" | "error" | "cancelled";
21
+ type AgentStopReason = "schema_satisfied" | "budget_reached" | "time_limit_reached" | "stopped" | "error" | "cancelled";
22
22
  type AgentConfidence = "low" | "medium" | "high";
23
- type AgentEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | "auto" | "max";
24
- /** Per-run spend ceiling for the metered `auto` and `max` efforts. */
23
+ type AgentEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | "auto" | "ultra" | "max";
24
+ /** Per-run spend ceiling for the metered `auto` and `ultra` efforts. */
25
25
  interface AgentBudget {
26
26
  /**
27
27
  * Maximum spend for the run in US dollars.
28
- * Only accepted by the API for `auto` and `max`; the server validates the
28
+ * Only accepted by the API for `auto` and `ultra`; the server validates the
29
29
  * allowed range and applies defaults when omitted.
30
30
  */
31
31
  maxCostDollars?: number;
32
+ /**
33
+ * Soft wall-clock ceiling in seconds (300–10,800). Only accepted for `ultra`.
34
+ */
35
+ maxDurationSeconds?: number;
32
36
  }
33
37
  /**
34
38
  * Identifier of an Exa Connect data provider, e.g. `"fiber_ai"`,
@@ -657,6 +661,11 @@ declare class AgentRunsClient extends AgentBaseClient {
657
661
  * Cancel a queued or running Agent run.
658
662
  */
659
663
  cancel(runId: string): Promise<AgentRun>;
664
+ /**
665
+ * Stop a running Agent run, completing it early with the results
666
+ * gathered so far. Only supported for `ultra` effort runs.
667
+ */
668
+ stop(runId: string): Promise<AgentRun>;
660
669
  /**
661
670
  * Delete a stored Agent run.
662
671
  */
@@ -710,7 +719,7 @@ declare class AgentBetaRunsClient extends AgentRunsClient {
710
719
  cancel(runId: string, options?: AgentBetaOptions): Promise<AgentRun>;
711
720
  /**
712
721
  * Stop a running Agent run, completing it early with the results
713
- * gathered so far. Only supported for `max` effort runs.
722
+ * gathered so far. Only supported for `ultra` effort runs.
714
723
  */
715
724
  stop(runId: string, options?: AgentBetaOptions): Promise<AgentRun>;
716
725
  delete(runId: string, options?: AgentBetaOptions): Promise<DeletedAgentRun>;
package/dist/index.js CHANGED
@@ -100,7 +100,7 @@ var import_cross_fetch = __toESM(require("cross-fetch"));
100
100
  // package.json
101
101
  var package_default = {
102
102
  name: "exa-js",
103
- version: "2.22.2",
103
+ version: "2.23.0",
104
104
  description: "Exa SDK for Node.js and the browser",
105
105
  publishConfig: {
106
106
  access: "public"
@@ -768,6 +768,13 @@ var AgentRunsClient = class extends AgentBaseClient {
768
768
  async cancel(runId) {
769
769
  return this.request(`/${runId}/cancel`, "POST");
770
770
  }
771
+ /**
772
+ * Stop a running Agent run, completing it early with the results
773
+ * gathered so far. Only supported for `ultra` effort runs.
774
+ */
775
+ async stop(runId) {
776
+ return this.request(`/${runId}/stop`, "POST");
777
+ }
771
778
  /**
772
779
  * Delete a stored Agent run.
773
780
  */
@@ -920,7 +927,7 @@ var AgentBetaRunsClient = class extends AgentRunsClient {
920
927
  }
921
928
  /**
922
929
  * Stop a running Agent run, completing it early with the results
923
- * gathered so far. Only supported for `max` effort runs.
930
+ * gathered so far. Only supported for `ultra` effort runs.
924
931
  */
925
932
  async stop(runId, options) {
926
933
  return this.request(