exa-ai 0.14.0 → 0.15.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4aa92257e4c27dbbd7cd5db638d95d40e76c8d75a92209069a769f1404ace64f
4
- data.tar.gz: 33b82648f530fd688751fd2f48808b332efc420fcf4f7fd8360f9a2fca476da1
3
+ metadata.gz: 72c23508be312974a2ba67df65b3aa1cd24c183cf6db67787bc797c4381bf965
4
+ data.tar.gz: fc4fae56ae5ef045b2349066f3055878aab34a443f014ee04ee2c54a938603d1
5
5
  SHA512:
6
- metadata.gz: 4127f458266b07c9f6989eca0a5b8333d98775fa488692af84488ebacfb3104dd23b5eaa5f72f3ab9d606d7ea76746bcb15598d213dc8b7e2154ff6a74f288e7
7
- data.tar.gz: e8ada14ef4109d77e7c2bbb7647520b441005e68fb4a16c491464877d13d6a80d904b318a6ed8cbe4563de3bfcefd3f26c0c2e85a5f20b6a6eb34bdea18a453b
6
+ metadata.gz: 57b11369ccdb3eb61c0e639dd64bb162b07fc3f012049f33004e3540730b89d0dca90a92bd0b7cf4f4021718a60a79ebb8a5ef23034a054fa7f183c110866ef8
7
+ data.tar.gz: 0c6d345677f78a11912a695ab358f1115dc2ad039cf0860242bbcf1cf23de994cd6ab4d1c2d884603ffc99177a317c53ef431bbc9a20a46c0d3b24a896ce0e22
data/CHANGELOG.md ADDED
@@ -0,0 +1,516 @@
1
+ # Changelog
2
+
3
+ All notable changes to the exa-ai gem will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.15.0] - 2026-11-17
9
+
10
+ ### Added
11
+ - **CHANGELOG.md ships in the gem** - the installed `exa-ai` gem now includes this changelog, so you can see what changed (deprecations, removed categories) without going online
12
+ - **`--print-request`** - `exa-ai search` and `exa-ai get-contents` take `--print-request`. It writes the JSON request body sent to the API to stderr as one line, then sends the request as usual. The body is one line on stderr. A deprecation warning for each deprecated flag comes before it; API warnings and error messages come after it. With `--strict`, a deprecated flag stops the command before any request, so no body is printed. Headers and the API key are never printed.
13
+ - **Flag list for wrappers** - `exa-ai search --flags-json` and `exa-ai get-contents --flags-json` print every flag the command accepts as JSON: the flag, the API field it sets, whether it is deprecated, what to type instead, and the reason when there is no replacement. They need no API key and send no request. The same data is in `Exa::CLI::SearchParser::FLAGS` and `Exa::CLI::GetContents::FLAGS`. The constants and the JSON are public API that wrappers can rely on
14
+ - **Deprecation warnings and `--strict`** - `exa-ai search` and `exa-ai get-contents` print one stderr line for each deprecated flag given, before the request is sent: `Warning: --livecrawl is deprecated; use --max-age-hours 0 --livecrawl-timeout 5000`, or the reason when the flag has no replacement. `--include-text` and `--exclude-text` have neither, so their line says only `is deprecated`. stdout does not change. With `--strict`, the same lines start with `Error:`, the command exits 1 and sends no request, so wrappers can refuse deprecated flags without a list of their own. The deprecated flags and their replacements come from the flag list. `exa-ai find-similar` does not warn and does not take `--strict`
15
+
16
+ ### Deprecated
17
+ - **`exa-ai --livecrawl` flag** - help text and docs for `exa-ai search` and `exa-ai find-similar` now mark `--livecrawl` deprecated. Use `--max-age-hours 0 --livecrawl-timeout 5000`. The flag still works and sends the same request: `maxAgeHours: 0` and `livecrawlTimeout: 5000`, not the API's deprecated `livecrawl` field
18
+
19
+ ### Fixed
20
+ - **`exa-ai agent-run-*` leading unknown flag** - `agent-run-get`, `agent-run-cancel`, `agent-run-delete`, `agent-run-events` and `agent-run-stop` now stop at an unknown flag in the run ID position with `Unknown option: <flag>`, exit 1 and send no request. Before, `exa-ai agent-run-get --bogus` sent a request for the run `--bogus`
21
+ - **`exa-ai get-contents` missing values** - when `--snapshot-as-of`, `--summary-query`, `--highlights-query` or `--subpage-target` has no value, or the next argument is another flag, `get-contents` now stops with one error line and sends no request. Before, it sent the request without the value. `get-contents` now reads its contents flags with the same code as `search` and `find-similar`, so the `--text-verbosity` error text is now the same as on `search`
22
+ - **`exa-ai get-contents` unknown flags** - `get-contents` now stops at a flag it does not know with `Error: unknown option <flag>` and sends no request. This includes `--livecrawl`, `--highlights-num-sentences` and `--highlights-per-url`, which `search` and `find-similar` take but `get-contents` does not. Before, `get-contents` dropped an unknown flag in silence, or used it as the URL when it came first
23
+ - **`exa-ai get-contents` own flag values and one-dash options** - when `--ids`, `--api-key`, `--output-format` or `--user-identifier` has no value, or the next argument is another flag, `get-contents` now stops with `Error: <flag> needs a value` and sends no request. An argument that starts with one dash, such as `-t`, now stops with `Error: unknown option <arg>`; `-h` still prints help. Before, `get-contents` used the next flag as the value, and used a one-dash argument as the URL
24
+ - **`exa-ai get-contents` with several URLs and with commas in a URL** - `get-contents` now takes several URLs as separate arguments: `exa-ai get-contents https://exa.ai https://www.anthropic.com/research`. Before, it dropped every URL after the first in silence. A URL that contains a comma, such as `https://example.com/maps/@40.7,-74.0`, is now sent as one URL. Before, `get-contents` cut it at the comma and sent the pieces as separate URLs. One argument is now cut only at a comma that comes right before `http://` or `https://`, so `https://exa.ai,https://www.anthropic.com/research` still sends two URLs. An argument with no `://` in it is cut at every comma, as before. `--ids` follows the same rule
25
+ - **Sub-option flags without their parent flag** - on `exa-ai search`, `exa-ai find-similar` and `exa-ai get-contents`, a sub-option flag now turns its parent on. For example, `--text-max-characters 3000` alone sends `text: {maxCharacters: 3000}`, the same as `--text --text-max-characters 3000`. This applies to the sub-options of `--text`, `--summary`, `--context` and `--highlights`. Before, the command accepted the sub-option and sent nothing for it. With the parent flag given, the request does not change. A command line that gave a sub-option alone got no content before and now gets that content, so Exa can charge more for it
26
+ - **`exa-ai search` `--api-key` and `--output-format` values** - when `--api-key` or `--output-format` has no value, or the next argument is another flag, `search` now stops with `Error: <flag> needs a value` and sends no request. Before, `search` used the next flag as the value: `--api-key --print-request` sent `--print-request` as the API key and did not print the request
27
+ - **Every flag value on `exa-ai search`, `get-contents` and `find-similar`** - when a flag that takes a value has no value, or the next argument is another flag, the command now stops with one `Error:` line that names the flag, exits 1 and sends no request. This adds the check to `--objective`, `--system-prompt`, `--user-identifier`, `--user-location`, `--additional-queries`, the four date flags, `--include-text`, `--exclude-text`, `--include-domains`, `--exclude-domains`, `--type`, `--category`, `--compliance`, `--text-verbosity` and `--highlights-verbosity`, and to `--api-key` and `--output-format` on `find-similar`. Before, the command used the next flag as the value: `--objective --strict` sent `--strict` as the objective and turned strict mode off. `exa-ai search --user-location` with no value now stops with an error; before, the flag was skipped. A free-text value that starts with `--` and contains a space, such as `--objective "--seed stage only"`, still works
28
+ - **Invalid choice values on `exa-ai search` and `find-similar`** - an invalid value for `--type`, `--category`, `--compliance` or `--text-verbosity` on `search`, or for `--text-verbosity` on `find-similar`, now stops with one line such as `Error: --type must be one of: auto, lite, ...`, exits 1 and sends no request. Before, the command printed `Unexpected error: Search type must be one of: ...` or a line that did not name the flag. The `--category` line on `find-similar` and the `--text-verbosity` line on `get-contents` now also name the flag. `exa-ai search` with no query now prints `Error: Query is required` instead of `Unexpected error: Query is required`
29
+ - **Every flag value on the other `exa-ai` commands** - on `answer`, `context`, `agent-run-create` and the other `agent-run-*` commands, and every `search-monitor-*` command, a flag that takes a value now stops the command with one `Error: <flag> needs a value` line, exit 1 and no request when the value is missing or the next argument is another flag. Before, the command used the next flag as the value or dropped the flag in silence: `exa-ai answer "..." --system-prompt --output-format json` sent `--output-format` as the system prompt, and `search-monitor-create --include-domains --webhook-url URL` sent `["--webhook-url"]` as the domain list. `exa-ai answer --user-location` with no value now stops with an error; before, the flag was skipped. A free-text value that starts with `--` and contains a space, such as `--system-prompt "--terse answers only"`, still works
30
+ - **Error lines on stderr when Ruby warnings are off** - `exa-ai context` now prints its error lines (`Error: Query argument required`, API errors and `Unexpected error:`) on stderr. Before, it printed them on stdout, so a script that read stdout got the error text as the result. The `agent-run-*` and `search-monitor-*` commands now print their error and warning lines with `$stderr.puts` instead of `warn`, with the same text. Before, these lines printed nothing when Ruby warnings were off (`RUBYOPT=-W0`), and only the exit status showed the error
31
+ - **Unknown options and `-h` as a value** - `exa-ai answer`, `exa-ai agent-run-create` and `exa-ai context` now stop at an unknown option that starts with `--` with `Error: unknown option <option>`, exit 1 and send no request. Before, `answer` added the option to the query text, and `agent-run-create` and `context` dropped it in silence. A query word that starts with `--` is now not possible on `answer`, the same as on `search`. On every command, `-h` given where a flag's value is expected now stops the command with `Error: <flag> needs a value (got the flag -h)` and sends no request. Before, the command sent `-h` as the value: `exa-ai answer "..." --system-prompt -h` sent `systemPrompt: "-h"`. `exa-ai search` still prints help and exits 0 for `-h` anywhere on the command line
32
+
33
+ ## [0.14.0] - 2026-11-16
34
+
35
+ ### Removed
36
+ - **Websets support (breaking change)** - every command and client method that calls `https://api.exa.ai/websets/v0/` is gone, with no deprecation release first. Code that uses them must change before it upgrades
37
+ - Commands removed (30): `exa-ai webset-*` (create, get, list, update, delete, cancel), `exa-ai webset-search-*` (create, get, cancel), `exa-ai webset-item-*` (list, get, delete), `exa-ai enrichment-*` (create, get, list, update, delete, cancel), `exa-ai import-*` (create, list, get, update, delete) and the Websets monitor commands `exa-ai monitor-*` (create, get, list, update, delete, runs-list, runs-get)
38
+ - Client methods removed: websets (`list_websets`, `get_webset`, `create_webset`, `update_webset`, `delete_webset`, `cancel_webset`), webset searches (`create_webset_search`, `get_webset_search`, `cancel_webset_search`), webset items (`list_items`, `get_item`, `delete_item`), enrichments (`create_enrichment`, `get_enrichment`, `update_enrichment`, `delete_enrichment`, `cancel_enrichment`), imports (`list_imports`, `create_import`, `upload_import`, `get_import`, `update_import`, `delete_import`) and Websets monitors and their runs (`create_monitor`, `list_monitors`, `get_monitor`, `update_monitor`, `delete_monitor`, `list_monitor_runs`, `get_monitor_run`)
39
+ - Classes removed: the `Exa::Services::Websets` services, `Exa::Constants::Websets`, the `Webset*`, `Import*`, `Monitor`, `MonitorCollection`, `MonitorRun` and `MonitorRunCollection` resources, and their CLI formatters
40
+ - Instead: to build and enrich lists, use the Agent API (`agent_run_create` and the other `agent_run_*` methods, `exa-ai agent-run-*`). To run a search on a schedule and get new results, use search monitors (`search_monitor_*`, `exa-ai search-monitor-*`), which stay
41
+
42
+ ### Added
43
+ - **`exa-ai find-similar` contents flags** - `find-similar` now takes every Content Extraction flag that `search` takes. The 16 new flags are `--text-verbosity`, `--context`, `--context-max-characters`, `--subpages`, `--subpage-target`, `--links`, `--image-links`, `--highlights`, `--highlights-max-characters`, `--highlights-num-sentences`, `--highlights-per-url`, `--highlights-query`, `--livecrawl`, `--livecrawl-timeout`, `--max-age-hours` and `--snapshot-as-of`. Both commands share one implementation in `Exa::CLI::ContentsFlags`
44
+ - **Monitors API** - `search_monitor_create`, `_list`, `_get`, `_update`, `_delete`, `_trigger`, `_batch`, `_runs_list` and `_runs_get` cover the `/monitors` API: scheduled searches that post new results to a webhook. CLI commands `exa-ai search-monitor-*`.
45
+ - **Agent run errors** - `AgentRun#error` holds the `{type, code, message}` the API returns for a failed run, and `to_h` includes it. The CLI prints it for a failed run
46
+ - **`lite` and `deep-lite` search types** - `search(type: "lite")` and `type: "deep-lite"`, also on `exa-ai search --type`. `lite` accepts only a limited set of parameters; the API rejects a request with any other
47
+ - **Search warnings, notices and search time** - `SearchResult#warnings`, `#notices` and `#search_time`; `ContentsResult#search_time` and `FindSimilarResult#search_time`. `exa-ai search` prints each warning to stderr as `Warning: <message> (<path>)` and shows notices in `pretty` and `text` output
48
+ - **`Answer#request_id`** - from the API's `requestId`, also in `to_h`
49
+ - **New content options** - `snapshot_as_of` and `crawled_before_date` on search and find-similar go under `contents`. New flat keys `text_link_style`, `text_include_sections`, `text_exclude_sections`, `highlights_verbosity`, `highlights_dynamic` and `rich_image_links` fold under `text`, `highlights` and `extras`
50
+ - **Dynamic highlights header** - when a request sets `highlights.dynamic` or `highlights.verbosity`, `search`, `find_similar`, `get_contents` and `search_stream` send the header `Exa-Beta: dynamic-highlights-2026-08-28`, which the API requires for these options
51
+ - **`search_stream`** - `client.search_stream(query, output_schema:, **params) { |chunk| ... }` yields each server-sent event (`text-delta`, `grounding`, `results`, `stream-reset`, `done`). It requires `output_schema`, because the API streams search only with one. An `error` event raises `Exa::Error`
52
+ - **Answer stream errors** - an `ERROR` event in an `answer_stream` raises `Exa::Error` with the API's message
53
+ - **`get_contents` with document IDs** - `client.get_contents(ids: [...])` sends only `ids`; `urls` is sent only when given
54
+ - **`exa-ai search` flags** - `--objective`, `--user-identifier`, `--compliance hipaa` and `--snapshot-as-of`. `--user-location` also takes a JSON object (`{"country":"US","latitude":...,"longitude":...}`) or `@file`
55
+ - **`exa-ai get-contents` flags** - `--ids`, `--max-age-hours`, `--snapshot-as-of`, `--user-identifier`, `--compliance`, `--highlights`, `--highlights-query`, `--highlights-max-characters`, `--highlights-verbosity` and `--text-verbosity`. URLs are optional when `--ids` is given
56
+ - **`exa-ai answer` flags** - `--model` (`exa`, `exa-pro`, `exa-research`, `exa-fast`), `--user-location` and `--user-identifier`, with and without `--stream`
57
+ - **Stop an agent run** - `agent_run_stop` and `exa-ai agent-run-stop` call `POST /agent/runs/{id}/stop`. The run completes with stop reason `stopped` and keeps its results. The API supports it only for effort `high`, `xhigh` and `ultra`
58
+ - **Agent run budget, metadata and user flags** - `exa-ai agent-run-create` takes `--max-cost-dollars`, `--max-duration-seconds`, `--metadata` and `--user-identifier`
59
+ - **Agent run event replay** - `agent_run_events(run_id, last_event_id: "7")` replays the events after that id over server-sent events and returns the same `AgentRunEventList`
60
+ - **Event pages on the CLI** - `exa-ai agent-run-events` takes `--limit` and `--cursor`
61
+ - **More agent run output** - pretty and text output show the stop reason of a completed run. Pretty output also shows the cost of each data source, usage, and the field and confidence of each grounding item
62
+
63
+ ### Changed
64
+ - **`--category github` rejected** - `exa-ai search` and `exa-ai find-similar` no longer accept `--category github`, which is not in the API's category list. The Ruby client still sends any category it is given
65
+ - **`agent_run_delete` returns `Exa::Resources::AgentRunDeletion`** - The API answers a delete with `{id, object: "agent_run.deleted", deleted: true}`. Use `#deleted?` and `#id`. Before, the method returned an `AgentRun` whose status was nil
66
+
67
+ ### Fixed
68
+ - **Summaries that are not JSON** - when a request gives a summary schema, `search` and `get_contents` keep a summary that is not valid JSON, an empty one included, as the String received. Before, one such summary raised `JSON::ParserError` and the caller lost every result
69
+ - **String content keys** - a String key that names a content option (`"text"`, `"text_max_characters"`, `"contents"`, or a key inside `text`, `highlights`, `summary`, `extras`, `context` or `contents`) now matches the same Symbol key. `get_contents(urls, "text" => true, text_max_characters: 500)` sends one `text` key, and `text: {"max_characters" => 5}, text_max_characters: 7` no longer raises `JSON::GeneratorError`. On `search`, a top-level `"text"` now goes under `contents`. Keys inside a schema stay as given
70
+ - **JSON summaries on `search`** - a flat `summary_schema` and a `summary.schema` inside a caller's own `contents` now give parsed JSON summaries, as `summary: {schema:}` does. Before, the summaries came back as JSON strings
71
+ - **Live CRLF streams** - `answer_stream` and `search_stream` now yield each chunk of a stream with `\r\n` line endings as it arrives. Before, they yielded these chunks only after the stream ended, so an error event was raised late. A `data:` line with no space after the colon is now read
72
+ - **Flat content keys on `get_contents`** - flat keys such as `text_max_characters`, `summary_schema` and `highlights_verbosity` now fold under `text`, `summary` and `highlights`, as on `search`. Before, `get_contents` sent them at the top level, where the API does not know them. A flat `highlights_verbosity` now sends the `Exa-Beta` header, and a flat `summary_schema` now gives parsed JSON summaries
73
+ - **Content options in any order** - `text_max_characters: 500, text: true` sends `text: {maxCharacters: 500}`. Before, a flat key given before its parent key was dropped
74
+ - **Caller's own `contents` hash** - on `search`, `find_similar`, `search_stream`, agent runs and search monitors, it and the folded flat content keys now merge into one `contents`, nested hashes included, so `contents: {text: {max_characters: 5}}, text: true` keeps `max_characters`. A `"contents"` String key now merges into the same `contents` key; before, it gave two keys and JSON encoding raised a duplicate key error. Flat keys written inside `contents` are sent as given, not folded
75
+ - **Agent run stream parsing** - the stream reads the `id:` line and passes it to the block as a third argument (blocks and procs that take two arguments keep working; a lambda must accept three), accepts `\r\n` line endings and fields with no space after the colon, and skips comment lines
76
+ - **Exa Connect provider slugs** - the CLI help and README use the documented slugs `fiber` and `particle` (not `fiber_ai` and `particle_news`) and list `polymarket` and `macrobond`
77
+ - **`agent-run-create --wait` limit** - when the stream drops, polling now waits up to 3 hours (the longest an `ultra` run can take) instead of 5 minutes
78
+ - **`--effort` help includes `ultra`**
79
+ - **camelCase request keys for contents, find-similar, answer, context and agent runs** - `get_contents`, `find_similar`, `answer`, `answer` streaming and `context` now send camelCase keys (for example `systemPrompt`, `outputSchema`, `subpageTarget`, `tokensNum`), and nested keys are converted too (for example `budget.maxCostDollars` on agent runs). Keys inside `outputSchema`, `schema`, `metadata`, `data` and `exclusion` are sent as given
80
+ - **find-similar content options** - `text` and `summary` go under `contents`, as the spec requires
81
+ - **`exa-ai get-contents` option values** - an option that takes a value no longer has its value read again as the URL argument when the option comes before the URL
82
+ - **Contents flags that take text on `exa-ai search` and `exa-ai find-similar`** - `--summary-query`, `--highlights-query`, `--snapshot-as-of` and `--subpage-target` now stop with one error line and send no request when no value follows or when the next argument starts with `--`. Before, `--summary --summary-query --text` sent `--text` as the summary query and lost `--text`, these flags given last with no value were dropped in silence, and `--subpage-target` given last sent `subpageTarget: [null]`
83
+ - **Unknown flags on `exa-ai search` and `exa-ai find-similar`** - an argument that starts with `--` and is not a known flag now stops the command with `Error: unknown option <flag>`. Before, `find-similar --highlight https://a.com` sent `--highlight` as the URL, and `search` added the unknown flag to the query
84
+
85
+ ### Deprecated
86
+ These still work. Help text, doc comments, README and docs now mark them with their replacements
87
+ - **`find_similar` and `exa-ai find-similar`** - the API deprecates `/findSimilar`. Use `search` with a query that describes the source page
88
+ - **`context` and `exa-ai context`** - `/context` is not in the API spec. No replacement is named; for code lookup, use `search`
89
+ - **Legacy search types** - `fast` and `instant` (use `lite`), `deep-reasoning` (use `deep`) and `neural` (not in the spec)
90
+ - **`start_crawl_date` and `end_crawl_date`** - the API ignores them and returns an `IGNORED_FIELD` warning
91
+ - **`include_text` and `exclude_text`**
92
+ - **The `context` contents option and `context` response field** - use `highlights` or `text`
93
+ - **`highlights` `num_sentences` and `highlights_per_url`** - use `max_characters`; the API ignores `highlights_per_url`
94
+ - **`subpages` and `subpage_target` on `search` and `find_similar`** - they stay valid on `get_contents`
95
+ - **`resolved_search_type`** - may be an empty string; `search_type` is not in the API spec
96
+ - **`livecrawl` and `crawled_before_date` contents options** - use `max_age_hours` instead of `livecrawl`. `crawled_before_date` is an alias of `snapshot_as_of` with identical behavior; use `snapshot_as_of`
97
+
98
+ ## [0.13.0] - 2026-11-16
99
+
100
+ ### Removed
101
+ - **Research API support** - Removed the `research_start`, `research_list` and `research_get` client methods and the `exa-ai research-start`, `research-get` and `research-list` commands. Exa retired the Research API (it now returns HTTP 410). Use the Agent API instead (`agent_run_create(query: ...)`, `exa-ai agent-run-create --query ...`)
102
+
103
+ ### Fixed
104
+ - **Unmapped error statuses now raise** - Any 4xx or 5xx status without its own error class (for example 405, 409, 410, 501) now raises `Exa::ClientError` or `Exa::ServerError` with the API's message. Before, these responses returned as if the request worked, and callers got resources with nil fields. Code that relied on that silent return must now rescue the error
105
+ - **Streaming errors keep the API message** - `answer` streaming and agent run streaming now show the error message from the API, not only `HTTP <status>`
106
+ - **Failed import file uploads now raise** - `UploadImport` raises when the PUT to the upload URL fails (for example an expired URL). Before, it reported success
107
+
108
+ ## [0.12.2] - 2026-07-23
109
+
110
+ ### Fixed
111
+ - **`tweet` category removed** - The Exa API now rejects `category: "tweet"` with a hard error, so `exa-ai search` and `exa-ai find-similar` no longer accept or advertise it. Valid categories are: company, publication, news, github, personal site, people, financial report
112
+
113
+ ### Changed
114
+ - **`--output-schema` note in help text** - `deep` and `deep-reasoning` searches no longer auto-synthesize the `output` field; the API returns it only when an output schema is supplied. The `--type` and `--output-schema` help now say so
115
+ - **Shared category list** - `exa-ai find-similar` references `Exa::CLI::SearchParser::VALID_CATEGORIES` instead of keeping a hand-synced copy
116
+
117
+ ## [0.12.1] - 2026-06-29
118
+
119
+ ### Fixed
120
+ - **`--effort` help text** - Corrected the listed values to match the full API set: `minimal, low, medium, high, xhigh, auto` (was missing `minimal`, `xhigh`, and `auto`)
121
+
122
+ ## [0.12.0] - 2026-06-29
123
+
124
+ ### Added
125
+ - **Agent API** - Full support for Exa's Agent Run API: create, list, get, delete, and stream agent runs (`client.create_agent_run`, `client.list_agent_runs`, `client.get_agent_run`, `client.delete_agent_run`)
126
+ - **AgentRun resource** - New `Exa::Resources::AgentRun` and `Exa::Resources::AgentRunList` resource objects wrapping agent run API responses
127
+ - **CLI agent-run commands** - New `exa agent-run create`, `agent-run list`, `agent-run get`, and `agent-run delete` subcommands
128
+ - **Live streaming** - `exa agent-run create --wait` streams events in real time with live status updates
129
+ - **Structured output & grounding** - CLI renders structured output and grounding sources from agent run responses
130
+ - **Exa Connect data sources** - `--input-data` flag on `agent-run create` to pass Exa Connect data sources (websets, web streams)
131
+ - **Input exclusion** - `--input-exclusion` flag to exclude specific domains or URLs from agent runs
132
+ - **Previous run chaining** - `--previous-run-id` flag to chain an agent run to a prior one for iterative workflows
133
+
134
+ ## [0.11.2] - 2026-05-03
135
+
136
+ ### Fixed
137
+ - **PaymentRequired error** - Middleware now raises `Exa::PaymentRequired` on 402 responses instead of a generic error
138
+
139
+ ## [0.11.1] - 2026-03-20
140
+
141
+ ### Fixed
142
+ - **Structured summary parsing** - When `summary: { schema: ... }` is provided, the gem now automatically parses the JSON-encoded summary string returned by the API into a Ruby Hash. Plain text summaries (no schema) are unchanged.
143
+
144
+ ### Changed
145
+ - **Parameter consolidation** - Flat content sub-parameters (e.g., `text_max_characters`, `highlights_query`) are now automatically nested under their parent hashes before conversion, simplifying CLI integration
146
+
147
+ ## [0.11.0] - 2026-03-19
148
+
149
+ ### Added
150
+ - **Text verbosity** - Added `--text-verbosity` CLI flag with `compact`, `standard`, and `full` options for controlling text extraction detail level
151
+ - **System prompt** - Added `--system-prompt` CLI flag and `system_prompt` parameter (converts to `systemPrompt`) for AI-powered search customization
152
+ - **Content moderation** - Added `--moderation` CLI flag to enable content moderation on search results
153
+
154
+ ### Changed
155
+ - **Livecrawl flag** - `--livecrawl` is now a boolean flag (was a mode string). Enables livecrawl with smart defaults: `maxAgeHours=0` and `livecrawlTimeout=5000`. Use `--livecrawl-timeout` and `--max-age-hours` to override defaults
156
+
157
+ ### Fixed
158
+ - **Category list** - Removed deprecated `pdf` category from valid categories
159
+
160
+ ## [0.10.0] - 2026-03-07
161
+
162
+ ### Added
163
+ - **Livecrawl support** - Added `livecrawl` and `max_age_hours` parameters to search, with CLI `--livecrawl` and `--max-age-hours` flags
164
+ - **Deep-reasoning search type** - Added `deep-reasoning` and `instant` search types alongside existing types
165
+ - **Output field** - Search results now include an `output` field for deep-reasoning responses
166
+ - **Additional search parameters** - Added `additional_queries`, `output_schema`, and `user_location` parameter conversions
167
+ - **Integration tests** - Comprehensive integration tests for post-v0.9.0 search features including deep-reasoning
168
+
169
+ ### Fixed
170
+ - **Parameter conversion** - `num_results`, `include_domains`, `exclude_domains`, and highlights now correctly convert to camelCase in request body
171
+ - **CLI search parser** - Updated to support current API search types (`auto`, `fast`, `deep`, `neural`, `instant`, `deep-reasoning`)
172
+ - **Livecrawl validation** - Added proper validation for livecrawl parameter values in CLI
173
+ - **User location** - Use ISO country code format per API spec
174
+ - **VCR cassettes** - Re-recorded search cassettes against live API for accuracy
175
+
176
+ ## [0.9.0] - 2026-02-24
177
+
178
+ ### Added
179
+ - **Webset title support** - Websets can now be created and updated with an optional `title` field via both the Ruby client and CLI (`--title` flag on `webset-create` and `webset-update`)
180
+
181
+ ### Fixed
182
+ - **Integration test stability** - Added pre/post-suite sweep of stale websets to prevent hitting concurrent webset API limits during test runs
183
+
184
+ ## [0.8.0] - 2026-02-13
185
+
186
+ ### Added
187
+ - **Automatic .env file loading** - CLI and library now automatically load environment variables from .env files, eliminating the need to manually set EXA_API_KEY environment variable
188
+
189
+ ### Changed
190
+ - **dotenv dependency** - Moved dotenv from development to runtime dependency to support automatic .env file loading
191
+
192
+ ## [0.7.2] - 2026-02-13
193
+
194
+ ### Changed
195
+ - **Removed native extension dependency** - Removed unused `ld-eventsource` dependency, eliminating FFI and native compilation requirements
196
+
197
+ ### Fixed
198
+ - **CLI improvements** - Corrected cursor field name in webset-list help text, improved dispatcher executable handling
199
+ - **Search defaults** - Changed default search type to `auto` for better results
200
+
201
+ ## [0.7.1] - 2026-01-20
202
+
203
+ ### Added
204
+ - **Answer command --skip-citations flag** - Added `--skip-citations` and `--no-citations` flags to the answer command to omit citations from output, saving tokens when citations aren't needed
205
+
206
+ ### Changed
207
+ - **Documentation improvements** - Added Ruby requirements and macOS setup instructions, simplified table of contents
208
+ - **Test improvements** - Enhanced CLI integration test error messages, made setup commands fail fast instead of skip, improved handling of missing API keys
209
+
210
+ ## [0.7.0] - 2026-01-13
211
+
212
+ ### Added
213
+ - **Search categories** - Added support for people and company categories in search command
214
+
215
+ ### Changed
216
+ - **CLI argument parsing** - Refactored search command argument parsing into reusable module
217
+ - **LinkedIn workaround removed** - Removed legacy LinkedIn-specific workaround
218
+
219
+ ## [0.6.1] - 2025-12-07
220
+
221
+ ### Changed
222
+ - **Enhanced pretty format output** - Replaced JSON.pretty_generate with human-readable text format across all CLI formatters for better readability
223
+
224
+ ### Fixed
225
+ - **CLI enrichment flags** - Removed unused enrichment flags that were causing confusion
226
+ - **Webset import/search scope validation** - Added proper validation to prevent conflicts between import and search scope parameters
227
+ - **CLI formatter test** - Fixed enrichment CLI integration test to properly handle pretty format output (text instead of JSON)
228
+ - **Test cleanup** - Improved webset cleanup in tests to cancel all searches before deletion, preventing concurrent request limit issues
229
+
230
+ ## [0.6.0] - 2025-11-28
231
+
232
+ ### Added
233
+
234
+ #### Webset Imports
235
+ - **Import API operations** - Full support for creating and managing webset imports from CSV files
236
+ - **File upload service** - Service for uploading CSV files to create websets from external data
237
+ - **Import resource objects** - Resource objects for handling import responses and status
238
+ - **Import CLI commands** - Complete CLI interface for import operations (create, list, get)
239
+ - **Create websets from imports** - Direct webset creation from import results
240
+
241
+ #### Webset Monitors
242
+ - **Monitor API operations** - Comprehensive support for creating, retrieving, listing, updating, and deleting webset monitors
243
+ - **Monitor resource objects** - Resources for handling monitor configurations and schedules
244
+ - **Monitor CLI commands** - Full CLI suite for monitor operations (create, get, list, update, delete)
245
+ - **Automated webset updates** - Schedule periodic searches to keep websets up-to-date
246
+
247
+ #### CLI Enhancements
248
+ - **TOON output format** - New output format option for CLI commands supporting TOON serialization
249
+
250
+ ### Changed
251
+ - **Entity type validation** - Refactored and consolidated entity type validation logic across webset operations
252
+
253
+ ## [0.5.0] - 2025-11-26
254
+
255
+ ### Added
256
+ - Updated search types to use `fast` and `deep` instead of deprecated types
257
+
258
+ ### Changed
259
+ - Prioritized detailed error messages from API responses for better debugging
260
+ - CLI error messages now use $stderr instead of $stdout
261
+ - CLI output now flushes stdout to ensure piped output reaches destination immediately
262
+
263
+ ### Fixed
264
+ - Corrected CLI help messages to reference `exa-ai` instead of `exa-api`
265
+ - Improved webset-create CLI test error handling
266
+
267
+ ## [0.4.1] - 2025-11-26
268
+
269
+ ### Changed
270
+ - Added comprehensive codebase patterns documentation for service objects, resources, and CLI commands
271
+ - Improved test coverage for webset-search CLI commands
272
+
273
+ ## [0.4.0] - 2025-11-23
274
+
275
+ ### Added
276
+
277
+ #### Websets API Support
278
+ - **Complete Websets CRUD operations** - Full implementation of Websets API with create, retrieve, list, update, delete, and cancel operations
279
+ - **Webset Searches** - Create, retrieve, and cancel searches within websets with entity type support, custom criteria, and recall modes
280
+ - **Webset Items** - List, retrieve, and delete items in websets with expand parameter support
281
+ - **Webset Enrichments** - Full CRUD operations for enrichments with support for text, URL, and options formats
282
+ - **Parameter validation** - Client-side validation for webset creation and search operations with custom entity type support
283
+ - **Resource expansion** - Optional expand parameter to include nested resources (e.g., items) in webset responses
284
+
285
+ #### CLI Enhancements
286
+ - **Webset commands** - Complete CLI interface for websets (create, get, list, update, delete, cancel)
287
+ - **Webset search commands** - CLI for search operations (create, get, cancel) with wait flag for polling
288
+ - **Webset item commands** - CLI for item operations (list, get, delete)
289
+ - **Enrichment commands** - Full CLI suite for enrichments (create, get, list, update, delete, cancel)
290
+ - **Find similar command** - New CLI command for finding content similar to a URL
291
+ - **Improved help output** - Organized command categories with examples for better discoverability
292
+ - **File loading support** - Support for @file.json syntax in CLI for loading JSON parameters from files
293
+
294
+ #### Testing Infrastructure
295
+ - **WebsetsCleanupHelper** - Automatic resource cleanup for integration tests to prevent test interference
296
+ - **Minitest fail-fast** - Added minitest-fail-fast gem for faster test development workflow
297
+ - **Comprehensive integration tests** - Full test coverage for websets, searches, items, and enrichments (536+ tests)
298
+ - **Improved test queries** - Updated to use realistic, domain-specific queries instead of generic placeholders
299
+ - **VCR improvements** - Better cassette management with :once record mode to prevent unnecessary API calls
300
+
301
+ #### Infrastructure
302
+ - **WebsetsParameterConverter** - Snake_case to camelCase conversion for webset parameters
303
+ - **WebsetFormatter** - Output formatting for websets in json/pretty/text formats
304
+ - **EnrichmentFormatter** - Output formatting for enrichments with status helper methods
305
+ - **WebsetItemFormatter** - Formatting for individual webset items
306
+ - **Cursor-based pagination** - Support for cursor-based pagination in webset listing
307
+
308
+ ### Changed
309
+ - **Test development workflow** - Updated guidelines for when to run full test suite vs. single tests
310
+ - **VCR configuration** - Changed from :new_episodes to :once mode to prevent accidental API token usage
311
+ - **Authentication** - Uses x-api-key header (carried forward from 0.3.1)
312
+
313
+ ### Fixed
314
+ - **Test isolation** - Improved EXA_API_KEY handling with proper preservation and restoration
315
+ - **Test data realism** - Fixed API errors by using realistic queries instead of generic test data
316
+ - **CLI integration tests** - Converted to smoke tests with proper API key handling
317
+ - **VCR cassette recording** - Fixed debug logging contamination in VCR cassettes
318
+ - **Enrichment format support** - Updated to use supported formats (text, url, options) and removed unsupported email/phone formats
319
+
320
+ ## [0.3.1] - 2025-10-28
321
+
322
+ ### Added
323
+
324
+ #### CLI Features
325
+ - **Answer formatter** - New answer formatter module imported into CLI for improved answer output formatting
326
+
327
+ #### Testing
328
+ - **CLI executable tests** - Comprehensive test suite validating CLI executables and their functionality
329
+
330
+ ### Changed
331
+ - **Authentication header** - Migrated from Bearer token authentication to x-api-key header for API requests (internal change, no user-facing impact)
332
+
333
+ ### Fixed
334
+ - **Gem name conflict** - Resolved conflict with unrelated 'exa' gem to ensure proper gem resolution
335
+
336
+ ## [0.3.0] - 2025-10-20
337
+
338
+ ### Added
339
+
340
+ #### Answer Endpoint Enhancements
341
+ - **Streaming support** - `--stream` flag to stream answers as they're generated
342
+ - **System prompt support** - `--system-prompt` flag for custom answer instructions
343
+
344
+ #### Research CLI Enhancements
345
+ - **Model selection** - Updated `research-start` command with model options
346
+
347
+ #### Get Contents CLI Enhancements
348
+ - **Advanced parameters** - Expanded `get-contents` command with additional content extraction options
349
+
350
+ ### Changed
351
+ - N/A
352
+
353
+ ### Fixed
354
+ - N/A
355
+
356
+ ### Deprecated
357
+ - N/A
358
+
359
+ ### Removed
360
+ - N/A
361
+
362
+ ### Security
363
+ - N/A
364
+
365
+ ## [0.2.0] - 2025-10-19
366
+
367
+ ### Added
368
+
369
+ #### Advanced Search Features
370
+ - **Date range filtering** - Filter search results by publication date and crawl date:
371
+ - `start_published_date` / `end_published_date` - Results published within date range
372
+ - `start_crawl_date` / `end_crawl_date` - Results crawled within date range
373
+ - **Text filtering** - Include and exclude results based on text content:
374
+ - `include_text` - Results must contain specified phrase
375
+ - `exclude_text` - Results must not contain specified phrase
376
+ - **Full webpage text extraction** - Retrieve and process full page content:
377
+ - Boolean or advanced configuration with `max_characters` and `include_html_tags`
378
+ - Configurable character limits for API cost control
379
+ - Optional HTML tag preservation for LLM compatibility
380
+ - **AI-powered summaries** - Generate structured summaries with custom prompts and schemas:
381
+ - Custom summary prompts for tailored LLM instructions
382
+ - JSON schema support for structured output
383
+ - Full customization of summary format and content
384
+ - **Context formatting for RAG** - Format results as context strings for LLM retrieval-augmented generation:
385
+ - Automatic context string generation from search results
386
+ - Configurable character limits
387
+ - **Subpage crawling** - Extract content from related subpages:
388
+ - Specify number of subpages to crawl
389
+ - Fuzzy text matching for subpage targeting (e.g., "about", "docs", "pricing")
390
+ - **Links and image extraction** - Extract URLs and image URLs from results:
391
+ - Configurable count per result
392
+ - Separate image link extraction
393
+
394
+ #### Parameter Conversion Infrastructure
395
+ - **ParameterConverter** - Dedicated service for converting Ruby parameters to API format:
396
+ - Snake_case to camelCase conversion
397
+ - Nested content parameter handling
398
+ - Reusable component for future parameter transformations
399
+
400
+ #### CLI Enhancements
401
+ - Comprehensive date range flags: `--start-published-date`, `--end-published-date`, `--start-crawl-date`, `--end-crawl-date`
402
+ - Text filtering flags: `--include-text`, `--exclude-text` (repeatable)
403
+ - Content extraction flags:
404
+ - Text: `--text`, `--text-max-characters`, `--include-html-tags`
405
+ - Summary: `--summary`, `--summary-query`, `--summary-schema` (with @file syntax)
406
+ - Context: `--context`, `--context-max-characters`
407
+ - Subpages: `--subpages`, `--subpage-target` (repeatable)
408
+ - Links: `--links`, `--image-links`
409
+ - Enhanced help text with organized option categories
410
+ - JSON schema file loading with `@filename` syntax
411
+
412
+ #### Testing
413
+ - 9 new comprehensive integration tests covering all search features
414
+ - Tests for individual features and multi-feature combinations
415
+ - Parameter conversion validation tests
416
+
417
+ #### Documentation
418
+ - Extended README with advanced search examples
419
+ - Complete CLI usage documentation for all new flags
420
+ - Ruby API examples for all new features
421
+ - Usage patterns for combining multiple features
422
+
423
+ ### Changed
424
+ - Search command help text reorganized for clarity
425
+ - Parameter handling through centralized ParameterConverter
426
+
427
+ ### Fixed
428
+ - N/A
429
+
430
+ ### Deprecated
431
+ - N/A
432
+
433
+ ### Removed
434
+ - N/A
435
+
436
+ ### Security
437
+ - N/A
438
+
439
+ ## [0.1.0] - 2025-10-19
440
+
441
+ ### Added
442
+
443
+ #### API Features
444
+ - **Search endpoint** - Full-featured web search with query, type filters, include/exclude domains, and pagination
445
+ - **Answer endpoint** - Direct answers for queries
446
+ - **Context endpoint** - Code search with language filtering and file type support
447
+ - **Get Contents endpoint** - Retrieve full page contents from URLs
448
+ - **Research endpoints** - Async research operations:
449
+ - `start_research` - Begin long-running research tasks
450
+ - `get_research` - Check research task status and results
451
+ - `list_research` - List all research tasks
452
+
453
+ #### Configuration Options
454
+ - Multiple configuration methods:
455
+ - Environment variable (`EXA_API_KEY`)
456
+ - Configuration block (`Exa.configure`)
457
+ - Per-request API key flag
458
+ - Customizable timeouts and connection options
459
+ - Debug logging support
460
+
461
+ #### CLI Tools (8 commands)
462
+ - `exa search` - Execute search queries from command line
463
+ - `exa answer` - Get AI-generated answers
464
+ - `exa context` - Search code repositories
465
+ - `exa contents` - Fetch full page contents
466
+ - `exa research start` - Begin async research
467
+ - `exa research get` - Check research results
468
+ - `exa research list` - List active research tasks
469
+ - `exa version` - Display gem version
470
+
471
+ #### CLI Features
472
+ - Multiple output formats (JSON, table, JSONL)
473
+ - Structured output support with `--output-schema` flag
474
+ - Text rendering for human-readable results
475
+ - Proper error messages and exit codes
476
+
477
+ #### Infrastructure
478
+ - Full error hierarchy (Client, Server, Configuration errors)
479
+ - HTTP client built on Faraday with:
480
+ - Bearer token authentication
481
+ - JSON request/response handling
482
+ - Configurable timeouts
483
+ - Custom error middleware
484
+ - Debug logging support
485
+ - Resource objects (immutable Structs) wrapping API responses
486
+ - Comprehensive test suite (339 tests)
487
+ - VCR integration for deterministic testing
488
+ - WebMock for stubbed HTTP responses
489
+
490
+ #### Documentation
491
+ - Comprehensive README with installation and usage examples
492
+ - Inline code documentation following Ruby conventions
493
+ - Project architecture guide (CLAUDE.md)
494
+ - OpenAPI specification files for reference
495
+ - Test helper setup for development
496
+
497
+ ### Fixed
498
+ - N/A (initial release)
499
+
500
+ ### Deprecated
501
+ - N/A (initial release)
502
+
503
+ ### Removed
504
+ - N/A (initial release)
505
+
506
+ ### Security
507
+ - API keys filtered from VCR cassettes
508
+ - No hardcoded credentials
509
+ - Bearer token authentication properly configured
510
+ - Dependency security scanning recommended
511
+
512
+ ## Future Releases
513
+
514
+ - YARD documentation for public API
515
+ - GitHub Actions CI/CD pipeline
516
+ - Additional language support in CLI examples
data/README.md CHANGED
@@ -170,6 +170,14 @@ exa-ai get-contents "https://ruby-lang.org"
170
170
  exa-ai search "climate tech seed rounds" --type lite --objective "Find primary sources"
171
171
  exa-ai get-contents --ids DOC_ID_1,DOC_ID_2 --highlights --highlights-verbosity low
172
172
  exa-ai answer "What is machine learning?" --model exa-pro --user-location US
173
+
174
+ # Print the JSON request body sent to the API as one line on stderr. A
175
+ # deprecation warning for each deprecated flag comes before it; API warnings
176
+ # and error messages come after it. Results still go to stdout
177
+ exa-ai search "AI/ML infrastructure startups with Series A funding" --print-request 2>stderr.log
178
+
179
+ # Stop with an error, and send no request, when a deprecated flag is given
180
+ exa-ai search "venture-backed SaaS companies" --livecrawl --strict
173
181
  ```
174
182
 
175
183
  ## Features
@@ -195,11 +203,43 @@ These still work, so existing code keeps running. The search command prints the
195
203
  - The `context` contents option and the `context` response field are deprecated. Use `highlights` or `text`.
196
204
  - `highlights` `num_sentences` and `highlights_per_url` are deprecated. Use `max_characters`.
197
205
  - `subpages` and `subpage_target` are deprecated on `search` and `find_similar`. They stay valid on `get_contents`.
206
+ - `exa-ai search --livecrawl` and `exa-ai find-similar --livecrawl` are deprecated. Use `--max-age-hours 0 --livecrawl-timeout 5000`, which sends the same request.
198
207
  - The `resolved_search_type` response field is deprecated.
199
208
  - The CLI no longer accepts `--category github`; it is not in the API's category list.
200
209
 
210
+ `exa-ai search` and `exa-ai get-contents` print one line on stderr for each deprecated flag you give, before the request is sent: `Warning: --livecrawl is deprecated; use --max-age-hours 0 --livecrawl-timeout 5000`. When a flag has no replacement, the line gives the reason. stdout does not change. Add `--strict` to make each line an `Error:` line: the command exits 1 and sends no request. With `--print-request`, the warnings come before the request body; with `--strict` and a deprecated flag, no body is printed. `exa-ai find-similar` does not warn and does not take `--strict`.
211
+
201
212
  See [docs/API.md](docs/API.md) and [docs/CLI.md](docs/CLI.md) for details.
202
213
 
214
+ ### Flag list for wrappers
215
+
216
+ `exa-ai search --flags-json` and `exa-ai get-contents --flags-json` print every flag the command accepts as a JSON array, then exit 0. They need no API key and send no request. The output is the same with a query or other flags on the command line.
217
+
218
+ The same data is in Ruby constants:
219
+
220
+ ```ruby
221
+ require "exa"
222
+ require "exa/cli/search_parser"
223
+ require "exa/cli/get_contents"
224
+
225
+ Exa::CLI::SearchParser::FLAGS # exa-ai search
226
+ Exa::CLI::GetContents::FLAGS # exa-ai get-contents
227
+ ```
228
+
229
+ Each entry has these keys, in this order:
230
+
231
+ ```json
232
+ {"flag":"--highlights-num-sentences","api_field":"contents.highlights.numSentences","deprecated":true,"replacement":"--highlights-max-characters","reason":null}
233
+ ```
234
+
235
+ - `flag`: the flag name. The short alias `-h` is not listed.
236
+ - `api_field`: the request body field the flag sets, as sent (camelCase, dotted path). It is `null` when the flag sets no field (`--api-key`, `--output-format`), and an array when the flag sets more than one (`--livecrawl`).
237
+ - `deprecated`: `true` when the help text marks the flag deprecated.
238
+ - `replacement`: what to type instead of a deprecated flag. It can be a phrase, such as `--max-age-hours 0 --livecrawl-timeout 5000`. It is `null` when there is no replacement.
239
+ - `reason`: why a deprecated flag with no replacement is deprecated, such as `the API ignores it`. It is `null` for every other flag, and for `--include-text` and `--exclude-text`, which have no replacement and no reason in the list.
240
+
241
+ The commands reject any flag that is not in their list. The constants and the `--flags-json` output are public API: wrappers can rely on them instead of reading the gem's source.
242
+
203
243
  ### Agent
204
244
  - **Agent API** — Asynchronous research agent with citations, streaming, and full run lifecycle
205
245