exa-js 2.22.2 → 2.24.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>;
@@ -4007,6 +4016,7 @@ type ToolNamespace = {
4007
4016
  };
4008
4017
  type SearchArgs = {
4009
4018
  query: string;
4019
+ objective?: string;
4010
4020
  };
4011
4021
  type GetContentsArgs = {
4012
4022
  urls: string[];
@@ -4015,6 +4025,8 @@ type WebSearchTool = ExaToolSpec<SearchArgs, SearchResponse<ContentsOptions>>;
4015
4025
  type GetContentsTool = ExaToolSpec<GetContentsArgs, SearchResponse<ContentsOptions>>;
4016
4026
  declare const DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION = "Search the web for up-to-date, relevant information. Describe the ideal page rather than listing keywords.";
4017
4027
  declare const DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION = "Read the full contents of web pages you already have URLs for, such as pages returned by a search or mentioned by the user.";
4028
+ /** Model-facing description of the `objective` search tool parameter. */
4029
+ declare const SEARCH_OBJECTIVE_TOOL_DESCRIPTION = "Goal for this search turn; say which documents should rank first, which should be excluded, and what specific facts or figures to pull from them.";
4018
4030
  /** Create a `web_search` tool. Defaults to `type: "auto"` and highlights. */
4019
4031
  declare function createWebSearchTool(exa: Exa, registry: ToolRegistry, config?: WebSearchToolConfig): WebSearchTool;
4020
4032
  /**
@@ -4331,6 +4343,14 @@ type BaseSearchOptions = {
4331
4343
  * Base search options shared across all search types
4332
4344
  */
4333
4345
  type BaseRegularSearchOptions = BaseSearchOptions & {
4346
+ /**
4347
+ * The broader goal this search serves: the task the caller is working on,
4348
+ * beyond the query itself. When an agent picks the query as one step of a
4349
+ * larger task, pass the goal of that step — which documents should rank
4350
+ * first, which should be excluded, and what to pull from them. Up to 4096
4351
+ * characters.
4352
+ */
4353
+ objective?: string;
4334
4354
  /**
4335
4355
  * If true, the search results are moderated for safety.
4336
4356
  */
@@ -4767,10 +4787,17 @@ type SearchResponse<T extends ContentsOptions> = {
4767
4787
  resolvedSearchType?: string;
4768
4788
  searchTime?: number;
4769
4789
  };
4790
+ /** Error details for a failed content retrieval. */
4791
+ type ContentStatusError = {
4792
+ tag?: string;
4793
+ httpStatusCode?: number | null;
4794
+ };
4795
+ /** Status information for a requested URL. */
4770
4796
  type Status = {
4771
4797
  id: string;
4772
4798
  status: string;
4773
- source: string;
4799
+ source?: string;
4800
+ error?: ContentStatusError | null;
4774
4801
  };
4775
4802
  /**
4776
4803
  * Options for the answer endpoint
@@ -5145,4 +5172,4 @@ declare class Exa {
5145
5172
  private parseSSEStream;
5146
5173
  }
5147
5174
 
5148
- export { AGENT_BETA_HEADER, AGENT_MAX_EFFORT_BETA, AGENT_MONITORS_BETA_HEADER, type AddAgentMonitorEntitiesParams, AgentBetaClient, type AgentBetaOptions, type AgentBudget, AgentClient, type AgentConfidence, type AgentCostDollars, type AgentCreateOptions, type AgentDataSource, type AgentDataSourceProvider, type AgentEffort, type AgentError, type AgentEvent, type AgentGroundingCitation, type AgentGroundingEntry, type AgentInput, type AgentMonitor, type AgentMonitorBacktest, type AgentMonitorBacktestContent, type AgentMonitorBacktestEntity, AgentMonitorBacktestFailedError, type AgentMonitorBacktestResult, type AgentMonitorBacktestStatus, type AgentMonitorBacktestWaitOptions, AgentMonitorBacktestsClient, type AgentMonitorChange, type AgentMonitorChangeEntity, type AgentMonitorChangeField, AgentMonitorChangesClient, type AgentMonitorCitation, type AgentMonitorContent, type AgentMonitorCreation, AgentMonitorEntitiesClient, type AgentMonitorEntity, type AgentMonitorEntityView, type AgentMonitorField, type AgentMonitorFieldMode, type AgentMonitorFieldValueType, type AgentMonitorRefresh, type AgentMonitorStatus, type AgentMonitorUsage, type AgentMonitorsBetaOptions, AgentMonitorsClient, type AgentOutput, type AgentRun, AgentRunCancelledError, AgentRunEventsClient, AgentRunFailedError, type AgentRunStatus, type AgentRunTyped, AgentRunsClient, type AgentStopReason, type AgentUsage, type AgentWaitOptions, type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type AnthropicToolResult, AnthropicTools, type ArticleEntity, type BaseSearchOptions, BetaClient, type BetaOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateAgentMonitorBacktestParams, type CreateAgentMonitorEntityParams, type CreateAgentMonitorFieldParams, type CreateAgentMonitorOptions, type CreateAgentMonitorParams, type CreateAgentRunParams, type CreateAgentRunParamsTyped, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateSearchMonitorParams, type CreateSearchMonitorResponse, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION, DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION, DYNAMIC_HIGHLIGHTS_BETA, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type DeletedAgentMonitor, type DeletedAgentRun, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExaErrorEnvelope, type ExaToolSpec, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetContentsTool, type GetContentsToolConfig, type GetWebsetResponse, type GroundingCitation, type GroundingEntry, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListAgentMonitorChangesParams, type ListAgentMonitorChangesResponse, type ListAgentMonitorEntitiesParams, type ListAgentMonitorEntitiesResponse, type ListAgentMonitorsParams, type ListAgentMonitorsResponse, type ListAgentRunEventsParams, type ListAgentRunEventsResponse, type ListAgentRunsParams, type ListAgentRunsResponse, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListSearchMonitorRunsParams, type ListSearchMonitorRunsResponse, type ListSearchMonitorsParams, type ListSearchMonitorsResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, OpenAIResponsesTools, type OpenAIToolMessage, OpenAITools, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type ResponsesFunctionCallOutput, type SearchMonitor, type SearchMonitorRun, type SearchMonitorRunFailReason, type SearchMonitorRunOutput, type SearchMonitorRunStatus, SearchMonitorRunsClient, type SearchMonitorSearch, type SearchMonitorStatus, type SearchMonitorTrigger, type SearchMonitorWebhook, type SearchMonitorWebhookEvent, SearchMonitorsClient, type SearchResponse, type SearchResult, type SearchStreamChunk, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type ToolDefinition, type ToolJsonSchema, type ToolNamespace, ToolRegistry, type TriggerSearchMonitorResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateSearchMonitorParams, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type WebSearchTool, type WebSearchToolConfig, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, createGetContentsTool, createWebSearchTool, Exa as default };
5175
+ export { AGENT_BETA_HEADER, AGENT_MAX_EFFORT_BETA, AGENT_MONITORS_BETA_HEADER, type AddAgentMonitorEntitiesParams, AgentBetaClient, type AgentBetaOptions, type AgentBudget, AgentClient, type AgentConfidence, type AgentCostDollars, type AgentCreateOptions, type AgentDataSource, type AgentDataSourceProvider, type AgentEffort, type AgentError, type AgentEvent, type AgentGroundingCitation, type AgentGroundingEntry, type AgentInput, type AgentMonitor, type AgentMonitorBacktest, type AgentMonitorBacktestContent, type AgentMonitorBacktestEntity, AgentMonitorBacktestFailedError, type AgentMonitorBacktestResult, type AgentMonitorBacktestStatus, type AgentMonitorBacktestWaitOptions, AgentMonitorBacktestsClient, type AgentMonitorChange, type AgentMonitorChangeEntity, type AgentMonitorChangeField, AgentMonitorChangesClient, type AgentMonitorCitation, type AgentMonitorContent, type AgentMonitorCreation, AgentMonitorEntitiesClient, type AgentMonitorEntity, type AgentMonitorEntityView, type AgentMonitorField, type AgentMonitorFieldMode, type AgentMonitorFieldValueType, type AgentMonitorRefresh, type AgentMonitorStatus, type AgentMonitorUsage, type AgentMonitorsBetaOptions, AgentMonitorsClient, type AgentOutput, type AgentRun, AgentRunCancelledError, AgentRunEventsClient, AgentRunFailedError, type AgentRunStatus, type AgentRunTyped, AgentRunsClient, type AgentStopReason, type AgentUsage, type AgentWaitOptions, type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type AnthropicToolResult, AnthropicTools, type ArticleEntity, type BaseSearchOptions, BetaClient, type BetaOptions, type CompanyEntity, type ContentStatusError, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateAgentMonitorBacktestParams, type CreateAgentMonitorEntityParams, type CreateAgentMonitorFieldParams, type CreateAgentMonitorOptions, type CreateAgentMonitorParams, type CreateAgentRunParams, type CreateAgentRunParamsTyped, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateSearchMonitorParams, type CreateSearchMonitorResponse, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION, DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION, DYNAMIC_HIGHLIGHTS_BETA, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type DeletedAgentMonitor, type DeletedAgentRun, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExaErrorEnvelope, type ExaToolSpec, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetContentsTool, type GetContentsToolConfig, type GetWebsetResponse, type GroundingCitation, type GroundingEntry, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListAgentMonitorChangesParams, type ListAgentMonitorChangesResponse, type ListAgentMonitorEntitiesParams, type ListAgentMonitorEntitiesResponse, type ListAgentMonitorsParams, type ListAgentMonitorsResponse, type ListAgentRunEventsParams, type ListAgentRunEventsResponse, type ListAgentRunsParams, type ListAgentRunsResponse, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListSearchMonitorRunsParams, type ListSearchMonitorRunsResponse, type ListSearchMonitorsParams, type ListSearchMonitorsResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, OpenAIResponsesTools, type OpenAIToolMessage, OpenAITools, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type ResponsesFunctionCallOutput, SEARCH_OBJECTIVE_TOOL_DESCRIPTION, type SearchMonitor, type SearchMonitorRun, type SearchMonitorRunFailReason, type SearchMonitorRunOutput, type SearchMonitorRunStatus, SearchMonitorRunsClient, type SearchMonitorSearch, type SearchMonitorStatus, type SearchMonitorTrigger, type SearchMonitorWebhook, type SearchMonitorWebhookEvent, SearchMonitorsClient, type SearchResponse, type SearchResult, type SearchStreamChunk, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type ToolDefinition, type ToolJsonSchema, type ToolNamespace, ToolRegistry, type TriggerSearchMonitorResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateSearchMonitorParams, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type WebSearchTool, type WebSearchToolConfig, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, createGetContentsTool, createWebSearchTool, Exa as default };
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>;
@@ -4007,6 +4016,7 @@ type ToolNamespace = {
4007
4016
  };
4008
4017
  type SearchArgs = {
4009
4018
  query: string;
4019
+ objective?: string;
4010
4020
  };
4011
4021
  type GetContentsArgs = {
4012
4022
  urls: string[];
@@ -4015,6 +4025,8 @@ type WebSearchTool = ExaToolSpec<SearchArgs, SearchResponse<ContentsOptions>>;
4015
4025
  type GetContentsTool = ExaToolSpec<GetContentsArgs, SearchResponse<ContentsOptions>>;
4016
4026
  declare const DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION = "Search the web for up-to-date, relevant information. Describe the ideal page rather than listing keywords.";
4017
4027
  declare const DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION = "Read the full contents of web pages you already have URLs for, such as pages returned by a search or mentioned by the user.";
4028
+ /** Model-facing description of the `objective` search tool parameter. */
4029
+ declare const SEARCH_OBJECTIVE_TOOL_DESCRIPTION = "Goal for this search turn; say which documents should rank first, which should be excluded, and what specific facts or figures to pull from them.";
4018
4030
  /** Create a `web_search` tool. Defaults to `type: "auto"` and highlights. */
4019
4031
  declare function createWebSearchTool(exa: Exa, registry: ToolRegistry, config?: WebSearchToolConfig): WebSearchTool;
4020
4032
  /**
@@ -4331,6 +4343,14 @@ type BaseSearchOptions = {
4331
4343
  * Base search options shared across all search types
4332
4344
  */
4333
4345
  type BaseRegularSearchOptions = BaseSearchOptions & {
4346
+ /**
4347
+ * The broader goal this search serves: the task the caller is working on,
4348
+ * beyond the query itself. When an agent picks the query as one step of a
4349
+ * larger task, pass the goal of that step — which documents should rank
4350
+ * first, which should be excluded, and what to pull from them. Up to 4096
4351
+ * characters.
4352
+ */
4353
+ objective?: string;
4334
4354
  /**
4335
4355
  * If true, the search results are moderated for safety.
4336
4356
  */
@@ -4767,10 +4787,17 @@ type SearchResponse<T extends ContentsOptions> = {
4767
4787
  resolvedSearchType?: string;
4768
4788
  searchTime?: number;
4769
4789
  };
4790
+ /** Error details for a failed content retrieval. */
4791
+ type ContentStatusError = {
4792
+ tag?: string;
4793
+ httpStatusCode?: number | null;
4794
+ };
4795
+ /** Status information for a requested URL. */
4770
4796
  type Status = {
4771
4797
  id: string;
4772
4798
  status: string;
4773
- source: string;
4799
+ source?: string;
4800
+ error?: ContentStatusError | null;
4774
4801
  };
4775
4802
  /**
4776
4803
  * Options for the answer endpoint
@@ -5145,4 +5172,4 @@ declare class Exa {
5145
5172
  private parseSSEStream;
5146
5173
  }
5147
5174
 
5148
- export { AGENT_BETA_HEADER, AGENT_MAX_EFFORT_BETA, AGENT_MONITORS_BETA_HEADER, type AddAgentMonitorEntitiesParams, AgentBetaClient, type AgentBetaOptions, type AgentBudget, AgentClient, type AgentConfidence, type AgentCostDollars, type AgentCreateOptions, type AgentDataSource, type AgentDataSourceProvider, type AgentEffort, type AgentError, type AgentEvent, type AgentGroundingCitation, type AgentGroundingEntry, type AgentInput, type AgentMonitor, type AgentMonitorBacktest, type AgentMonitorBacktestContent, type AgentMonitorBacktestEntity, AgentMonitorBacktestFailedError, type AgentMonitorBacktestResult, type AgentMonitorBacktestStatus, type AgentMonitorBacktestWaitOptions, AgentMonitorBacktestsClient, type AgentMonitorChange, type AgentMonitorChangeEntity, type AgentMonitorChangeField, AgentMonitorChangesClient, type AgentMonitorCitation, type AgentMonitorContent, type AgentMonitorCreation, AgentMonitorEntitiesClient, type AgentMonitorEntity, type AgentMonitorEntityView, type AgentMonitorField, type AgentMonitorFieldMode, type AgentMonitorFieldValueType, type AgentMonitorRefresh, type AgentMonitorStatus, type AgentMonitorUsage, type AgentMonitorsBetaOptions, AgentMonitorsClient, type AgentOutput, type AgentRun, AgentRunCancelledError, AgentRunEventsClient, AgentRunFailedError, type AgentRunStatus, type AgentRunTyped, AgentRunsClient, type AgentStopReason, type AgentUsage, type AgentWaitOptions, type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type AnthropicToolResult, AnthropicTools, type ArticleEntity, type BaseSearchOptions, BetaClient, type BetaOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateAgentMonitorBacktestParams, type CreateAgentMonitorEntityParams, type CreateAgentMonitorFieldParams, type CreateAgentMonitorOptions, type CreateAgentMonitorParams, type CreateAgentRunParams, type CreateAgentRunParamsTyped, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateSearchMonitorParams, type CreateSearchMonitorResponse, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION, DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION, DYNAMIC_HIGHLIGHTS_BETA, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type DeletedAgentMonitor, type DeletedAgentRun, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExaErrorEnvelope, type ExaToolSpec, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetContentsTool, type GetContentsToolConfig, type GetWebsetResponse, type GroundingCitation, type GroundingEntry, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListAgentMonitorChangesParams, type ListAgentMonitorChangesResponse, type ListAgentMonitorEntitiesParams, type ListAgentMonitorEntitiesResponse, type ListAgentMonitorsParams, type ListAgentMonitorsResponse, type ListAgentRunEventsParams, type ListAgentRunEventsResponse, type ListAgentRunsParams, type ListAgentRunsResponse, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListSearchMonitorRunsParams, type ListSearchMonitorRunsResponse, type ListSearchMonitorsParams, type ListSearchMonitorsResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, OpenAIResponsesTools, type OpenAIToolMessage, OpenAITools, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type ResponsesFunctionCallOutput, type SearchMonitor, type SearchMonitorRun, type SearchMonitorRunFailReason, type SearchMonitorRunOutput, type SearchMonitorRunStatus, SearchMonitorRunsClient, type SearchMonitorSearch, type SearchMonitorStatus, type SearchMonitorTrigger, type SearchMonitorWebhook, type SearchMonitorWebhookEvent, SearchMonitorsClient, type SearchResponse, type SearchResult, type SearchStreamChunk, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type ToolDefinition, type ToolJsonSchema, type ToolNamespace, ToolRegistry, type TriggerSearchMonitorResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateSearchMonitorParams, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type WebSearchTool, type WebSearchToolConfig, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, createGetContentsTool, createWebSearchTool, Exa as default };
5175
+ export { AGENT_BETA_HEADER, AGENT_MAX_EFFORT_BETA, AGENT_MONITORS_BETA_HEADER, type AddAgentMonitorEntitiesParams, AgentBetaClient, type AgentBetaOptions, type AgentBudget, AgentClient, type AgentConfidence, type AgentCostDollars, type AgentCreateOptions, type AgentDataSource, type AgentDataSourceProvider, type AgentEffort, type AgentError, type AgentEvent, type AgentGroundingCitation, type AgentGroundingEntry, type AgentInput, type AgentMonitor, type AgentMonitorBacktest, type AgentMonitorBacktestContent, type AgentMonitorBacktestEntity, AgentMonitorBacktestFailedError, type AgentMonitorBacktestResult, type AgentMonitorBacktestStatus, type AgentMonitorBacktestWaitOptions, AgentMonitorBacktestsClient, type AgentMonitorChange, type AgentMonitorChangeEntity, type AgentMonitorChangeField, AgentMonitorChangesClient, type AgentMonitorCitation, type AgentMonitorContent, type AgentMonitorCreation, AgentMonitorEntitiesClient, type AgentMonitorEntity, type AgentMonitorEntityView, type AgentMonitorField, type AgentMonitorFieldMode, type AgentMonitorFieldValueType, type AgentMonitorRefresh, type AgentMonitorStatus, type AgentMonitorUsage, type AgentMonitorsBetaOptions, AgentMonitorsClient, type AgentOutput, type AgentRun, AgentRunCancelledError, AgentRunEventsClient, AgentRunFailedError, type AgentRunStatus, type AgentRunTyped, AgentRunsClient, type AgentStopReason, type AgentUsage, type AgentWaitOptions, type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type AnthropicToolResult, AnthropicTools, type ArticleEntity, type BaseSearchOptions, BetaClient, type BetaOptions, type CompanyEntity, type ContentStatusError, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateAgentMonitorBacktestParams, type CreateAgentMonitorEntityParams, type CreateAgentMonitorFieldParams, type CreateAgentMonitorOptions, type CreateAgentMonitorParams, type CreateAgentRunParams, type CreateAgentRunParamsTyped, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateSearchMonitorParams, type CreateSearchMonitorResponse, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION, DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION, DYNAMIC_HIGHLIGHTS_BETA, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type DeletedAgentMonitor, type DeletedAgentRun, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExaErrorEnvelope, type ExaToolSpec, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetContentsTool, type GetContentsToolConfig, type GetWebsetResponse, type GroundingCitation, type GroundingEntry, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListAgentMonitorChangesParams, type ListAgentMonitorChangesResponse, type ListAgentMonitorEntitiesParams, type ListAgentMonitorEntitiesResponse, type ListAgentMonitorsParams, type ListAgentMonitorsResponse, type ListAgentRunEventsParams, type ListAgentRunEventsResponse, type ListAgentRunsParams, type ListAgentRunsResponse, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListSearchMonitorRunsParams, type ListSearchMonitorRunsResponse, type ListSearchMonitorsParams, type ListSearchMonitorsResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, OpenAIResponsesTools, type OpenAIToolMessage, OpenAITools, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type ResponsesFunctionCallOutput, SEARCH_OBJECTIVE_TOOL_DESCRIPTION, type SearchMonitor, type SearchMonitorRun, type SearchMonitorRunFailReason, type SearchMonitorRunOutput, type SearchMonitorRunStatus, SearchMonitorRunsClient, type SearchMonitorSearch, type SearchMonitorStatus, type SearchMonitorTrigger, type SearchMonitorWebhook, type SearchMonitorWebhookEvent, SearchMonitorsClient, type SearchResponse, type SearchResult, type SearchStreamChunk, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type ToolDefinition, type ToolJsonSchema, type ToolNamespace, ToolRegistry, type TriggerSearchMonitorResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateSearchMonitorParams, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type WebSearchTool, type WebSearchToolConfig, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, createGetContentsTool, createWebSearchTool, Exa as default };
package/dist/index.js CHANGED
@@ -68,6 +68,7 @@ __export(index_exports, {
68
68
  MonitorStatus: () => MonitorStatus,
69
69
  OpenAIResponsesTools: () => OpenAIResponsesTools,
70
70
  OpenAITools: () => OpenAITools,
71
+ SEARCH_OBJECTIVE_TOOL_DESCRIPTION: () => SEARCH_OBJECTIVE_TOOL_DESCRIPTION,
71
72
  SearchMonitorRunsClient: () => SearchMonitorRunsClient,
72
73
  SearchMonitorsClient: () => SearchMonitorsClient,
73
74
  ToolRegistry: () => ToolRegistry,
@@ -100,7 +101,7 @@ var import_cross_fetch = __toESM(require("cross-fetch"));
100
101
  // package.json
101
102
  var package_default = {
102
103
  name: "exa-js",
103
- version: "2.22.2",
104
+ version: "2.24.0",
104
105
  description: "Exa SDK for Node.js and the browser",
105
106
  publishConfig: {
106
107
  access: "public"
@@ -768,6 +769,13 @@ var AgentRunsClient = class extends AgentBaseClient {
768
769
  async cancel(runId) {
769
770
  return this.request(`/${runId}/cancel`, "POST");
770
771
  }
772
+ /**
773
+ * Stop a running Agent run, completing it early with the results
774
+ * gathered so far. Only supported for `ultra` effort runs.
775
+ */
776
+ async stop(runId) {
777
+ return this.request(`/${runId}/stop`, "POST");
778
+ }
771
779
  /**
772
780
  * Delete a stored Agent run.
773
781
  */
@@ -920,7 +928,7 @@ var AgentBetaRunsClient = class extends AgentRunsClient {
920
928
  }
921
929
  /**
922
930
  * Stop a running Agent run, completing it early with the results
923
- * gathered so far. Only supported for `max` effort runs.
931
+ * gathered so far. Only supported for `ultra` effort runs.
924
932
  */
925
933
  async stop(runId, options) {
926
934
  return this.request(
@@ -2420,6 +2428,8 @@ var WebsetsClient = class extends WebsetsBaseClient {
2420
2428
  var import_zod2 = require("zod");
2421
2429
  var DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION = "Search the web for up-to-date, relevant information. Describe the ideal page rather than listing keywords.";
2422
2430
  var DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION = "Read the full contents of web pages you already have URLs for, such as pages returned by a search or mentioned by the user.";
2431
+ var SEARCH_OBJECTIVE_TOOL_DESCRIPTION = "Goal for this search turn; say which documents should rank first, which should be excluded, and what specific facts or figures to pull from them.";
2432
+ var MAX_OBJECTIVE_LENGTH = 4096;
2423
2433
  function formatResults(response, emptyMessage) {
2424
2434
  const formatted = response.results.map((result) => {
2425
2435
  const lines = [
@@ -2473,6 +2483,17 @@ function createTool(registry, params) {
2473
2483
  };
2474
2484
  return registerTool(registry, tool);
2475
2485
  }
2486
+ var AdvertisedRequiredOptional = class extends import_zod2.z.ZodOptional {
2487
+ isOptional() {
2488
+ return false;
2489
+ }
2490
+ };
2491
+ function advertisedRequired(inner) {
2492
+ return new AdvertisedRequiredOptional({
2493
+ innerType: inner,
2494
+ typeName: import_zod2.z.ZodFirstPartyTypeKind.ZodOptional
2495
+ });
2496
+ }
2476
2497
  function createWebSearchTool(exa, registry, config = {}) {
2477
2498
  const {
2478
2499
  name = "web_search",
@@ -2482,7 +2503,15 @@ function createWebSearchTool(exa, registry, config = {}) {
2482
2503
  const inputSchema = import_zod2.z.object({
2483
2504
  query: import_zod2.z.string().describe(
2484
2505
  "Natural language search query. Should be a semantically rich description of the ideal page, not just keywords."
2485
- )
2506
+ ),
2507
+ // Length limits are validated but not advertised: strict tool use on some
2508
+ // providers rejects `minLength`/`maxLength` in the schema.
2509
+ objective: advertisedRequired(
2510
+ import_zod2.z.string().trim().refine((value) => value.length > 0, "objective must not be empty").refine(
2511
+ (value) => value.length <= MAX_OBJECTIVE_LENGTH,
2512
+ `objective must be at most ${MAX_OBJECTIVE_LENGTH} characters`
2513
+ )
2514
+ ).describe(SEARCH_OBJECTIVE_TOOL_DESCRIPTION)
2486
2515
  });
2487
2516
  const jsonSchema = zodToJsonSchema(inputSchema);
2488
2517
  delete jsonSchema.$schema;
@@ -2496,12 +2525,13 @@ function createWebSearchTool(exa, registry, config = {}) {
2496
2525
  description,
2497
2526
  parameters: jsonSchema
2498
2527
  },
2499
- execute: ({ query }) => {
2528
+ execute: ({ query, objective }) => {
2500
2529
  const options = {
2501
2530
  type: "auto",
2502
2531
  numResults: 10,
2503
2532
  contents: { highlights: true },
2504
- ...searchOptions
2533
+ ...searchOptions,
2534
+ ...objective !== void 0 && { objective }
2505
2535
  };
2506
2536
  return exa.search(query, options);
2507
2537
  },
@@ -3425,6 +3455,7 @@ var index_default = Exa2;
3425
3455
  MonitorStatus,
3426
3456
  OpenAIResponsesTools,
3427
3457
  OpenAITools,
3458
+ SEARCH_OBJECTIVE_TOOL_DESCRIPTION,
3428
3459
  SearchMonitorRunsClient,
3429
3460
  SearchMonitorsClient,
3430
3461
  ToolRegistry,