@octen.ai/cli 0.1.4 → 0.1.5
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 +3 -3
- package/dist/api/constants.d.ts +5 -0
- package/dist/api/constants.js +5 -0
- package/dist/api/search.js +10 -1
- package/dist/commands/search.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -33,10 +33,10 @@ You can also pass `--api-key <key>` on any command. To point at a self-hosted or
|
|
|
33
33
|
Search the live web.
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
|
-
octen search "latest LLM benchmarks" -n 10 --topic news --highlight --time-range
|
|
36
|
+
octen search "latest LLM benchmarks" -n 10 --topic news --highlight --time-range week
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Options: `-n` (result count 1–100), `--topic` (general|news), `--highlight`, `--time-range
|
|
39
|
+
Options: `-n` (result count 1–100), `--topic` (general|news), `--highlight`, `--time-range` (day|week|month|year or d|w|m|y), `--start-time`, `--end-time`, `--include-domains`, `--exclude-domains`, `--full-content`, `--images`, `--videos`, `--format` (text|markdown), `--safesearch`.
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
@@ -45,7 +45,7 @@ Options: `-n` (result count 1–100), `--topic` (general|news), `--highlight`, `
|
|
|
45
45
|
News-focused web search (same flags as `search` minus `--topic`).
|
|
46
46
|
|
|
47
47
|
```sh
|
|
48
|
-
octen news "OpenAI announcement" --highlight --time-range
|
|
48
|
+
octen news "OpenAI announcement" --highlight --time-range day
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
---
|
package/dist/api/constants.d.ts
CHANGED
|
@@ -34,5 +34,10 @@ export declare const LIMITS: {
|
|
|
34
34
|
readonly vlImages: 5;
|
|
35
35
|
readonly vlVideos: 1;
|
|
36
36
|
};
|
|
37
|
+
export declare const TOPIC_OPTIONS: readonly ["general", "news"];
|
|
38
|
+
export declare const TIME_BASIS_OPTIONS: readonly ["auto", "published", "crawled"];
|
|
39
|
+
export declare const TIME_RANGE_OPTIONS: readonly ["day", "week", "month", "year", "d", "w", "m", "y"];
|
|
40
|
+
export declare const SAFESEARCH_OPTIONS: readonly ["off", "strict"];
|
|
41
|
+
export declare const FORMAT_OPTIONS: readonly ["text", "markdown"];
|
|
37
42
|
export declare const SKILLS_REPO = "Octen-Team/octen-skills";
|
|
38
43
|
export declare const SKILLS_REPO_TARBALL: (ref: string) => string;
|
package/dist/api/constants.js
CHANGED
|
@@ -28,5 +28,10 @@ export const LIMITS = {
|
|
|
28
28
|
vlImages: 5,
|
|
29
29
|
vlVideos: 1,
|
|
30
30
|
};
|
|
31
|
+
export const TOPIC_OPTIONS = ["general", "news"];
|
|
32
|
+
export const TIME_BASIS_OPTIONS = ["auto", "published", "crawled"];
|
|
33
|
+
export const TIME_RANGE_OPTIONS = ["day", "week", "month", "year", "d", "w", "m", "y"];
|
|
34
|
+
export const SAFESEARCH_OPTIONS = ["off", "strict"];
|
|
35
|
+
export const FORMAT_OPTIONS = ["text", "markdown"];
|
|
31
36
|
export const SKILLS_REPO = "Octen-Team/octen-skills";
|
|
32
37
|
export const SKILLS_REPO_TARBALL = (ref) => `https://github.com/${SKILLS_REPO}/archive/${ref}.tar.gz`;
|
package/dist/api/search.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { LIMITS } from "./constants.js";
|
|
1
|
+
import { LIMITS, TOPIC_OPTIONS, TIME_BASIS_OPTIONS, TIME_RANGE_OPTIONS, SAFESEARCH_OPTIONS, FORMAT_OPTIONS, } from "./constants.js";
|
|
2
2
|
import { OctenValidationError } from "./errors.js";
|
|
3
|
+
function validateEnum(flag, value, allowed) {
|
|
4
|
+
if (value != null && !allowed.includes(value))
|
|
5
|
+
throw new OctenValidationError(`${flag} must be one of: ${allowed.join(", ")}`);
|
|
6
|
+
}
|
|
3
7
|
export function buildSearchRequest(query, o) {
|
|
4
8
|
if (!query)
|
|
5
9
|
throw new OctenValidationError("query is required");
|
|
@@ -9,6 +13,11 @@ export function buildSearchRequest(query, o) {
|
|
|
9
13
|
throw new OctenValidationError(`include-text max ${LIMITS.includeText}`);
|
|
10
14
|
if (o.excludeText && o.excludeText.length > LIMITS.excludeText)
|
|
11
15
|
throw new OctenValidationError(`exclude-text max ${LIMITS.excludeText}`);
|
|
16
|
+
validateEnum("--topic", o.topic, TOPIC_OPTIONS);
|
|
17
|
+
validateEnum("--time-basis", o.timeBasis, TIME_BASIS_OPTIONS);
|
|
18
|
+
validateEnum("--time-range", o.timeRange, TIME_RANGE_OPTIONS);
|
|
19
|
+
validateEnum("--safesearch", o.safesearch, SAFESEARCH_OPTIONS);
|
|
20
|
+
validateEnum("--format", o.format, FORMAT_OPTIONS);
|
|
12
21
|
const req = { query };
|
|
13
22
|
const put = (k, v) => { if (v != null)
|
|
14
23
|
req[k] = v; };
|
package/dist/commands/search.js
CHANGED
|
@@ -12,7 +12,7 @@ export function registerSearch(program, fixedTopic) {
|
|
|
12
12
|
.option("--exclude-domains <list>", "comma list", (v) => v.split(","))
|
|
13
13
|
.option("--include-text <list>", "comma list", (v) => v.split(","))
|
|
14
14
|
.option("--exclude-text <list>", "comma list", (v) => v.split(","))
|
|
15
|
-
.option("--time-basis <b>").option("--time-range <r>")
|
|
15
|
+
.option("--time-basis <b>", "auto|published|crawled").option("--time-range <r>", "day|week|month|year (or d|w|m|y)")
|
|
16
16
|
.option("--start-time <iso>").option("--end-time <iso>")
|
|
17
17
|
.option("--format <f>", "text|markdown").option("--safesearch <s>", "off|strict")
|
|
18
18
|
.option("--highlight").option("--highlight-max-tokens <n>", "max tokens per highlight", parseIntOpt("--highlight-max-tokens"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octen.ai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
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",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"dev": "tsc --watch",
|
|
26
26
|
"test": "vitest run",
|
|
27
27
|
"test:watch": "vitest",
|
|
28
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
28
29
|
"sync-skills": "tsx scripts/sync-skills.ts",
|
|
29
30
|
"prepublishOnly": "npm run build"
|
|
30
31
|
},
|