@octen.ai/cli 0.13.0 → 0.13.1

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
@@ -289,9 +289,12 @@ Search the live web.
289
289
 
290
290
  ```sh
291
291
  octen search "latest LLM benchmarks" -n 10 --topic news --highlight --time-range week
292
+ octen search "EU AI Act obligations for general-purpose models" -n 5 --result-type dynamic --highlight
292
293
  ```
293
294
 
294
- Options: `-n` (result count 1–100), `--topic` (general|news), `--highlight` (+`--highlight-max-tokens`, 100–20000), `--time-range` (day|week|month|year or d|w|m|y), `--start-time`/`--end-time` (YYYY-MM-DD or ISO datetime), `--include-domains`, `--exclude-domains`, `--language` (comma-separated ISO 639-1 codes, e.g. `en,ja` — one of `ar de en es fr hi id it ja ko nl pl pt ru th tr vi zh`), `--full-content` (+`--full-content-max-tokens`, 100–100000), `--images`, `--format` (text|markdown), `--safesearch`.
295
+ Options: `-n` (result count 1–100), `--topic` (general|news), `--result-type` (standard|dynamic), `--highlight` (+`--highlight-max-tokens`, 100–20000), `--time-range` (day|week|month|year or d|w|m|y), `--start-time`/`--end-time` (YYYY-MM-DD or ISO datetime), `--include-domains`, `--exclude-domains`, `--language` (comma-separated ISO 639-1 codes, e.g. `en,ja` — one of `ar de en es fr hi id it ja ko nl pl pt ru th tr vi zh`), `--full-content` (+`--full-content-max-tokens`, 100–100000), `--images`, `--format` (text|markdown), `--safesearch`.
296
+
297
+ `--result-type standard` (the default) returns results as the flags specify, and with `--highlight` the `--highlight-max-tokens` cap applies as given. With `dynamic`, only the relevant results come back, so `-n` is a maximum (fewer, possibly none, can come back), and Octen may adjust the highlight length per result. In the JSON output of `octen search`, `meta.result_type` echoes the value used.
295
298
 
296
299
  ---
297
300
 
@@ -373,9 +376,10 @@ Use it for comparisons across many sources (pricing, products, vendors), surveys
373
376
 
374
377
  ```sh
375
378
  octen broad-search "compare cloud GPU pricing across providers" --max-queries 5 -n 10
379
+ octen broad-search "compare cloud GPU pricing across providers" --max-queries 5 -n 5 --result-type dynamic --highlight
376
380
  ```
377
381
 
378
- Options: `--max-queries` (decompose into up to N sub-queries, 1–30, default 5), plus all `octen search` flags (`-n/--count` per sub-query, `--topic`, `--highlight`, `--full-content`, `--time-range`, `--start-time`/`--end-time`, `--include-domains`/`--exclude-domains`, `--include-text`/`--exclude-text`, `--language`, `--images`, `--format`, `--safesearch`).
382
+ Options: `--max-queries` (decompose into up to N sub-queries, 1–30, default 5), plus all `octen search` flags (`-n/--count` per sub-query, `--topic`, `--result-type` (standard|dynamic, applied to every sub-query; the response does not echo it), `--highlight`, `--full-content`, `--time-range`, `--start-time`/`--end-time`, `--include-domains`/`--exclude-domains`, `--include-text`/`--exclude-text`, `--language`, `--images`, `--format`, `--safesearch`).
379
383
 
380
384
  ---
381
385
 
@@ -392,7 +396,7 @@ It posts to its own endpoint, `/search-premier`, which takes the request `/searc
392
396
 
393
397
  **Use `octen search` by default.** Premier takes longer, and it is billed at its own per-call rate, which a Search Plan's unlimited searches do not cover.
394
398
 
395
- Options: every `octen search` flag except `--topic`, plus `--result-type` (`standard`|`dynamic`). `standard` returns results as the other flags specify; `dynamic` returns only the relevant results, up to `-n`, and adjusts the highlight length per result.
399
+ Options: every `octen search` flag except `--topic`. That includes `--result-type` (`standard`|`dynamic`), which works as it does on `octen search`; the two commands differ in endpoint, retrieval depth and billing, not in flags.
396
400
 
397
401
  A token cap given without its switch is not dropped here: `--highlight-max-tokens` alone caps the highlights, and `--full-content-max-tokens` without `--full-content` exits 2, since it would return no content.
398
402
 
@@ -5,7 +5,6 @@
5
5
  * shared options go through the search builder rather than a second copy of
6
6
  * it. Kept here are the places where this command differs from `search`:
7
7
  *
8
- * - `result_type`, which the reference documents and `search` does not offer;
9
8
  * - `topic`, which is `search`'s own and is never forwarded;
10
9
  * - a token cap given without its switch. The search builder sends a cap only
11
10
  * beside `--highlight` / `--full-content` and drops it otherwise. Here a
@@ -5,7 +5,6 @@
5
5
  * shared options go through the search builder rather than a second copy of
6
6
  * it. Kept here are the places where this command differs from `search`:
7
7
  *
8
- * - `result_type`, which the reference documents and `search` does not offer;
9
8
  * - `topic`, which is `search`'s own and is never forwarded;
10
9
  * - a token cap given without its switch. The search builder sends a cap only
11
10
  * beside `--highlight` / `--full-content` and drops it otherwise. Here a
@@ -24,7 +23,8 @@ export function buildPremierSearchRequest(query, o) {
24
23
  if (o.fullContentMaxTokens != null && !o.fullContent)
25
24
  throw new OctenValidationError("--full-content-max-tokens needs --full-content — full content is off unless asked for");
26
25
  // Dropped by name, not by type: an options object built for `search` would
27
- // otherwise carry its `topic` straight through.
26
+ // otherwise carry its `topic` straight through. `resultType` is appended
27
+ // after the shared options so the body's key order stays as it was.
28
28
  const { topic: _topic, resultType, ...shared } = o;
29
29
  // A highlight cap is a request for highlights of that length, so it is sent
30
30
  // as one. It has to carry `enable`: the API returns no highlights at all for
@@ -1,3 +1,4 @@
1
+ import { RESULT_TYPE_OPTIONS } from "./constants.js";
1
2
  export declare function validateEnum(flag: string, value: unknown, allowed: readonly string[]): void;
2
3
  /**
3
4
  * Normalize a time bound to an ISO 8601 datetime the API accepts.
@@ -40,6 +41,7 @@ export interface BroadSearchResponse {
40
41
  }
41
42
  export interface SearchOpts {
42
43
  topic?: "general" | "news";
44
+ resultType?: (typeof RESULT_TYPE_OPTIONS)[number];
43
45
  count?: number;
44
46
  includeDomains?: string[];
45
47
  excludeDomains?: string[];
@@ -1,4 +1,4 @@
1
- import { LIMITS, TOPIC_OPTIONS, TIME_BASIS_OPTIONS, TIME_RANGE_OPTIONS, SAFESEARCH_OPTIONS, FORMAT_OPTIONS, } from "./constants.js";
1
+ import { LIMITS, RESULT_TYPE_OPTIONS, TOPIC_OPTIONS, TIME_BASIS_OPTIONS, TIME_RANGE_OPTIONS, SAFESEARCH_OPTIONS, FORMAT_OPTIONS, } from "./constants.js";
2
2
  import { OctenValidationError } from "./errors.js";
3
3
  export function validateEnum(flag, value, allowed) {
4
4
  if (value != null && !allowed.includes(value))
@@ -47,6 +47,7 @@ export function buildSearchOptions(o) {
47
47
  assertRange("highlight-max-tokens", o.highlightMaxTokens, LIMITS.highlightMaxTokens);
48
48
  assertRange("full-content-max-tokens", o.fullContentMaxTokens, LIMITS.fullContentMaxTokens);
49
49
  validateEnum("--topic", o.topic, TOPIC_OPTIONS);
50
+ validateEnum("--result-type", o.resultType, RESULT_TYPE_OPTIONS);
50
51
  validateEnum("--time-basis", o.timeBasis, TIME_BASIS_OPTIONS);
51
52
  validateEnum("--time-range", o.timeRange, TIME_RANGE_OPTIONS);
52
53
  validateEnum("--safesearch", o.safesearch, SAFESEARCH_OPTIONS);
@@ -55,6 +56,7 @@ export function buildSearchOptions(o) {
55
56
  const put = (k, v) => { if (v != null)
56
57
  opts[k] = v; };
57
58
  put("topic", o.topic);
59
+ put("result_type", o.resultType);
58
60
  put("count", o.count);
59
61
  put("include_domains", o.includeDomains);
60
62
  put("exclude_domains", o.excludeDomains);
@@ -10,6 +10,7 @@ export function registerBroadSearch(program) {
10
10
  .description("Broad multi-angle web search — expands the query into sub-queries searched concurrently. Best for comparisons, surveys/research, and multi-angle questions; pass the query as-is and raise --max-queries for broader coverage (use `search` for a single focused query)")
11
11
  .option("--max-queries <n>", "decompose into up to N sub-queries (1-30; default 5, raise toward 30 for surveys/research)", parseIntOpt("--max-queries"))
12
12
  .option("--topic <t>", "general|news")
13
+ .option("--result-type <t>", "standard|dynamic")
13
14
  .option("-n, --count <n>", "results per sub-query 1-100", parseIntOpt("--count"))
14
15
  .option("--include-domains <list>", "comma list", parseCsvOpt("--include-domains"))
15
16
  .option("--exclude-domains <list>", "comma list", parseCsvOpt("--exclude-domains"))
@@ -21,6 +21,7 @@ export function registerSearch(program) {
21
21
  .option("--full-content").option("--full-content-max-tokens <n>", "max tokens per result", parseIntOpt("--full-content-max-tokens"))
22
22
  .option("--images");
23
23
  cmd.option("--topic <t>", "general|news");
24
+ cmd.option("--result-type <t>", "standard|dynamic");
24
25
  cmd.action(async (queryArg, opts, command) => {
25
26
  const g = command.optsWithGlobals();
26
27
  const client = makeClient(g);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octen.ai/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Command-line tool for Octen — web search, extract, chat, embeddings, and one-command MCP/Skills setup.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -94,6 +94,18 @@ curl -s -X POST "https://api.octen.ai/search" \
94
94
  }'
95
95
  ```
96
96
 
97
+ ### With Dynamic Results
98
+ ```bash
99
+ curl -s -X POST "https://api.octen.ai/search" \
100
+ -H "Content-Type: application/json" \
101
+ -H "X-Api-Key: ${OCTEN_API_KEY}" \
102
+ -d '{
103
+ "query": "EU AI Act enforcement timeline",
104
+ "count": 10,
105
+ "result_type": "dynamic"
106
+ }'
107
+ ```
108
+
97
109
  ## Endpoint
98
110
 
99
111
  ```http
@@ -165,6 +177,7 @@ POST https://api.octen.ai/search
165
177
  | `meta.usage.full_content_tokens` | integer | Total tokens returned in full_content |
166
178
  | `meta.latency` | number | Response time in milliseconds |
167
179
  | `meta.warning` | string? | Warning message, if any |
180
+ | `meta.result_type` | string | The result type used for this request |
168
181
 
169
182
  ### JSON Example
170
183
 
@@ -274,7 +287,7 @@ curl -s -X POST "https://api.octen.ai/broad-search" \
274
287
  -d '{
275
288
  "query": "compare cloud GPU pricing across major providers",
276
289
  "max_queries": 5,
277
- "search_options": {"count": 10, "highlight": {"enable": true}}
290
+ "search_options": {"count": 10, "result_type": "dynamic", "highlight": {"enable": true}}
278
291
  }'
279
292
  ```
280
293
 
@@ -284,7 +297,7 @@ curl -s -X POST "https://api.octen.ai/broad-search" \
284
297
  |--|--|--|--|--|
285
298
  | `query` | string | **Yes** | - | Original search query (max 500 chars) |
286
299
  | `max_queries` | integer | No | `5` | Upper bound on the number of sub-queries generated (1–30); raise toward 30 for surveys/research, lower for a tighter search |
287
- | `search_options` | object | No | - | Options applied to **each** sub-query — same fields and defaults as the [Parameters](#parameters) table above (`count`, `include_domains`, `language`, time filters, `highlight`, `full_content`, `include_images`, …) |
300
+ | `search_options` | object | No | - | Options applied to **each** sub-query — same fields and defaults as the [Parameters](#parameters) table above (`count`, `result_type`, `include_domains`, `language`, time filters, `highlight`, `full_content`, `include_images`, …) |
288
301
 
289
302
  ### Response
290
303
 
@@ -57,7 +57,7 @@ or call the HTTP API directly with `curl` — the sibling skills **octen-search*
57
57
  | The user wants… | Tool | Key point |
58
58
  |--|--|--|
59
59
  | One fact, one entity, one document — a single focused lookup | `search` | Fast real-time search. Default choice. |
60
- | A `search` that came back thin or off-target — or a document already known to be hard to find: a niche report, a filing, a page buried deep in a site | `premier_search` | Takes what `search` takes (plus `result_type`), with deeper retrieval and reranking. Slower and billed separately: **try `search` first** for an ordinary lookup. |
60
+ | A `search` that came back thin or off-target — or a document already known to be hard to find: a niche report, a filing, a page buried deep in a site | `premier_search` | Takes the same parameters as `search`, with deeper retrieval and reranking. Slower and billed separately: **try `search` first** for an ordinary lookup. |
61
61
  | Recent events / headlines — a single news lookup | `news_search` | Its own endpoint. Returns articles **and** `subjects`: the coverage grouped into storylines with summaries. |
62
62
  | A company or a person — what they do, who runs it, financials, recent announcements, or two compared | `business_search` | Returns structured cards, not pages to read. Far cheaper than `search` plus reading the results. |
63
63
  | Multiple distinct parts or entities one search can't cover: comparisons across many sources, surveys, "what are the options for X", a question that decomposes into 3+ sub-questions | `broad_search` | Fans out; **~Nx cost + latency** — see below. |
@@ -78,6 +78,10 @@ or call the HTTP API directly with `curl` — the sibling skills **octen-search*
78
78
  > documents Search Premier, and **octen-design-search** documents Design Search.
79
79
  > That path needs an `OCTEN_API_KEY`; without one, say the tool is unavailable
80
80
  > rather than substituting a different tool and presenting it as the same thing.
81
+ >
82
+ > `result_type` (`standard` or `dynamic`) on `search` and `broad_search` exists
83
+ > from **octen-mcp 0.8.1**; the hosted endpoint has it. On an older server only
84
+ > `premier_search` takes it.
81
85
 
82
86
  ### When to prefer `search` over `broad_search`
83
87