@octen.ai/cli 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.
- package/README.md +38 -1
- package/dist/api/errors.d.ts +4 -0
- package/dist/api/errors.js +8 -0
- package/dist/cli.js +2 -0
- package/dist/commands/completion.js +79 -24
- package/dist/commands/monitor/client.d.ts +6 -0
- package/dist/commands/monitor/client.js +9 -0
- package/dist/commands/monitor/confirm.d.ts +5 -0
- package/dist/commands/monitor/confirm.js +19 -0
- package/dist/commands/monitor/errors.d.ts +5 -0
- package/dist/commands/monitor/errors.js +38 -0
- package/dist/commands/monitor/index.d.ts +13 -0
- package/dist/commands/monitor/index.js +252 -0
- package/dist/commands/monitor/options.d.ts +45 -0
- package/dist/commands/monitor/options.js +187 -0
- package/dist/output/pretty/monitor.d.ts +7 -0
- package/dist/output/pretty/monitor.js +142 -0
- package/package.json +3 -2
- package/skills/manifest.json +1 -0
- package/skills/octen-monitor/SKILL.md +313 -0
- package/skills/octen-monitor/agents/openai.yaml +4 -0
- package/skills/octen-web-search/SKILL.md +6 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { MonitorCreateParams, MonitorListEventsParams, MonitorListParams, MonitorListRunsParams, MonitorUpdateParams } from "@octen.ai/sdk";
|
|
2
|
+
export type OutputField = {
|
|
3
|
+
field_name: string;
|
|
4
|
+
field_type: "string" | "number" | "boolean";
|
|
5
|
+
field_desc?: string;
|
|
6
|
+
};
|
|
7
|
+
export type MonitorType = "topic" | "page";
|
|
8
|
+
/** Parsed options of every `octen monitor` subcommand (commander's camelCase names). */
|
|
9
|
+
export interface MonitorCliOptions {
|
|
10
|
+
topic?: string;
|
|
11
|
+
page?: string[];
|
|
12
|
+
field?: OutputField[];
|
|
13
|
+
includeDomains?: string[];
|
|
14
|
+
excludeDomains?: string[];
|
|
15
|
+
name?: string;
|
|
16
|
+
condition?: string;
|
|
17
|
+
interval?: string;
|
|
18
|
+
cron?: string;
|
|
19
|
+
timezone?: string;
|
|
20
|
+
webhook?: string;
|
|
21
|
+
email?: string[];
|
|
22
|
+
metadata?: Record<string, string>;
|
|
23
|
+
params?: Record<string, unknown>;
|
|
24
|
+
status?: string;
|
|
25
|
+
clear?: string[];
|
|
26
|
+
rotateSecret?: boolean;
|
|
27
|
+
limit?: number;
|
|
28
|
+
cursor?: string;
|
|
29
|
+
pageNo?: number;
|
|
30
|
+
onlyChanges?: boolean;
|
|
31
|
+
orderBy?: string;
|
|
32
|
+
run?: string;
|
|
33
|
+
}
|
|
34
|
+
type Obj = Record<string, unknown>;
|
|
35
|
+
export declare function parseField(v: string, prev?: OutputField[]): OutputField[];
|
|
36
|
+
export declare function parseMetadata(v: string, prev?: Record<string, string>): Record<string, string>;
|
|
37
|
+
export declare const parseChoiceOpt: (name: string, choices: readonly string[]) => (v: string) => string;
|
|
38
|
+
export declare function readParams(v: string): Obj;
|
|
39
|
+
export declare function buildCreateParams(o: MonitorCliOptions): MonitorCreateParams;
|
|
40
|
+
export declare function needsTypeLookup(o: MonitorCliOptions): boolean;
|
|
41
|
+
export declare function buildUpdateParams(o: MonitorCliOptions, type: MonitorType | undefined): MonitorUpdateParams;
|
|
42
|
+
export declare function buildListParams(o: MonitorCliOptions): MonitorListParams;
|
|
43
|
+
export declare function buildRunsParams(o: MonitorCliOptions): MonitorListRunsParams;
|
|
44
|
+
export declare function buildEventsParams(o: MonitorCliOptions): MonitorListEventsParams;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { OctenValidationError } from "../../api/errors.js";
|
|
3
|
+
const FIELD_TYPES = ["string", "number", "boolean"];
|
|
4
|
+
const CLEARABLE = ["condition", "webhook", "email", "metadata"];
|
|
5
|
+
export function parseField(v, prev = []) {
|
|
6
|
+
const first = v.indexOf(":");
|
|
7
|
+
if (first <= 0)
|
|
8
|
+
throw new OctenValidationError("--field must be name:type[:description]");
|
|
9
|
+
const second = v.indexOf(":", first + 1);
|
|
10
|
+
const name = v.slice(0, first);
|
|
11
|
+
const type = second < 0 ? v.slice(first + 1) : v.slice(first + 1, second);
|
|
12
|
+
if (!FIELD_TYPES.includes(type)) {
|
|
13
|
+
throw new OctenValidationError(`--field type must be one of ${FIELD_TYPES.join(", ")}`);
|
|
14
|
+
}
|
|
15
|
+
const field = { field_name: name, field_type: type };
|
|
16
|
+
if (second >= 0)
|
|
17
|
+
field.field_desc = v.slice(second + 1);
|
|
18
|
+
return [...prev, field];
|
|
19
|
+
}
|
|
20
|
+
export function parseMetadata(v, prev = {}) {
|
|
21
|
+
const eq = v.indexOf("=");
|
|
22
|
+
if (eq <= 0)
|
|
23
|
+
throw new OctenValidationError("--metadata must be key=value");
|
|
24
|
+
return { ...prev, [v.slice(0, eq)]: v.slice(eq + 1) };
|
|
25
|
+
}
|
|
26
|
+
export const parseChoiceOpt = (name, choices) => (v) => {
|
|
27
|
+
if (!choices.includes(v))
|
|
28
|
+
throw new OctenValidationError(`${name} must be one of ${choices.join(", ")}`);
|
|
29
|
+
return v;
|
|
30
|
+
};
|
|
31
|
+
export function readParams(v) {
|
|
32
|
+
let text = v;
|
|
33
|
+
if (v.startsWith("@")) {
|
|
34
|
+
try {
|
|
35
|
+
text = readFileSync(v.slice(1), "utf8");
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
throw new OctenValidationError(`--params: cannot read ${v.slice(1)}: ${e.message}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
let parsed;
|
|
42
|
+
try {
|
|
43
|
+
parsed = JSON.parse(text);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
throw new OctenValidationError("--params must be a JSON object or @file");
|
|
47
|
+
}
|
|
48
|
+
if (!isObj(parsed))
|
|
49
|
+
throw new OctenValidationError("--params must be a JSON object or @file");
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
function isObj(v) {
|
|
53
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
54
|
+
}
|
|
55
|
+
// Same leaf from a named option and --params is a conflict, never a silent overwrite; arrays are leaves.
|
|
56
|
+
function mergeParams(base, extra, path = "") {
|
|
57
|
+
const out = { ...base };
|
|
58
|
+
for (const [k, v] of Object.entries(extra)) {
|
|
59
|
+
const p = path ? `${path}.${k}` : k;
|
|
60
|
+
if (!Object.hasOwn(out, k))
|
|
61
|
+
Object.defineProperty(out, k, { value: v, enumerable: true, writable: true, configurable: true });
|
|
62
|
+
else if (isObj(out[k]) && isObj(v))
|
|
63
|
+
out[k] = mergeParams(out[k], v, p);
|
|
64
|
+
else
|
|
65
|
+
throw new OctenValidationError(`--params sets ${p}, which another option already sets`);
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
function setIf(o, key, v) {
|
|
70
|
+
if (v !== undefined)
|
|
71
|
+
o[key] = v;
|
|
72
|
+
}
|
|
73
|
+
function schedule(o) {
|
|
74
|
+
if (o.interval === undefined && o.cron === undefined && o.timezone === undefined)
|
|
75
|
+
return undefined;
|
|
76
|
+
const s = {};
|
|
77
|
+
setIf(s, "interval", o.interval);
|
|
78
|
+
setIf(s, "cron", o.cron);
|
|
79
|
+
setIf(s, "timezone", o.timezone);
|
|
80
|
+
return s;
|
|
81
|
+
}
|
|
82
|
+
// Checked on the merged request, so a cron given through --params counts.
|
|
83
|
+
function checkSchedule(body) {
|
|
84
|
+
const s = body.schedule;
|
|
85
|
+
if (s && s.timezone !== undefined && s.cron === undefined)
|
|
86
|
+
throw new OctenValidationError("--timezone needs --cron");
|
|
87
|
+
return body;
|
|
88
|
+
}
|
|
89
|
+
function typeSettings(o, type) {
|
|
90
|
+
const t = {};
|
|
91
|
+
if (type === "topic") {
|
|
92
|
+
setIf(t, "query", o.topic);
|
|
93
|
+
setIf(t, "include_domains", o.includeDomains);
|
|
94
|
+
setIf(t, "exclude_domains", o.excludeDomains);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
setIf(t, "urls", o.page);
|
|
98
|
+
}
|
|
99
|
+
setIf(t, "output_schema", o.field);
|
|
100
|
+
return Object.keys(t).length ? t : undefined;
|
|
101
|
+
}
|
|
102
|
+
function checkTypeOptions(o, type) {
|
|
103
|
+
if (type === "page" && (o.topic !== undefined || o.includeDomains || o.excludeDomains)) {
|
|
104
|
+
throw new OctenValidationError("--topic, --include-domains and --exclude-domains apply to topic monitors only");
|
|
105
|
+
}
|
|
106
|
+
if (type === "topic" && o.page !== undefined)
|
|
107
|
+
throw new OctenValidationError("--page applies to page monitors only");
|
|
108
|
+
}
|
|
109
|
+
function common(o, body) {
|
|
110
|
+
setIf(body, "name", o.name);
|
|
111
|
+
setIf(body, "condition", o.condition);
|
|
112
|
+
setIf(body, "schedule", schedule(o));
|
|
113
|
+
if (o.email !== undefined)
|
|
114
|
+
body.email = { to: o.email };
|
|
115
|
+
setIf(body, "metadata", o.metadata);
|
|
116
|
+
}
|
|
117
|
+
export function buildCreateParams(o) {
|
|
118
|
+
if ((o.topic === undefined) === (o.page === undefined)) {
|
|
119
|
+
throw new OctenValidationError("give exactly one of --topic and --page");
|
|
120
|
+
}
|
|
121
|
+
const type = o.topic !== undefined ? "topic" : "page";
|
|
122
|
+
checkTypeOptions(o, type);
|
|
123
|
+
const body = { type, [type]: typeSettings(o, type) };
|
|
124
|
+
common(o, body);
|
|
125
|
+
if (o.webhook !== undefined)
|
|
126
|
+
body.webhook = { url: o.webhook };
|
|
127
|
+
return checkSchedule(o.params ? mergeParams(body, o.params) : body);
|
|
128
|
+
}
|
|
129
|
+
export function needsTypeLookup(o) {
|
|
130
|
+
return Boolean(o.field || o.includeDomains || o.excludeDomains || o.topic !== undefined || o.page !== undefined);
|
|
131
|
+
}
|
|
132
|
+
export function buildUpdateParams(o, type) {
|
|
133
|
+
const body = {};
|
|
134
|
+
if (needsTypeLookup(o)) {
|
|
135
|
+
if (!type)
|
|
136
|
+
throw new OctenValidationError("the monitor type is needed for these options");
|
|
137
|
+
checkTypeOptions(o, type);
|
|
138
|
+
setIf(body, type, typeSettings(o, type));
|
|
139
|
+
}
|
|
140
|
+
setIf(body, "status", o.status);
|
|
141
|
+
common(o, body);
|
|
142
|
+
if (o.webhook !== undefined || o.rotateSecret) {
|
|
143
|
+
const w = {};
|
|
144
|
+
setIf(w, "url", o.webhook);
|
|
145
|
+
if (o.rotateSecret)
|
|
146
|
+
w.rotate_secret = true;
|
|
147
|
+
body.webhook = w;
|
|
148
|
+
}
|
|
149
|
+
for (const f of o.clear ?? []) {
|
|
150
|
+
if (!CLEARABLE.includes(f)) {
|
|
151
|
+
throw new OctenValidationError(`--clear accepts ${CLEARABLE.join(", ")}`);
|
|
152
|
+
}
|
|
153
|
+
if (f in body)
|
|
154
|
+
throw new OctenValidationError(`--clear ${f} conflicts with setting ${f}`);
|
|
155
|
+
body[f] = null;
|
|
156
|
+
}
|
|
157
|
+
const merged = checkSchedule(o.params ? mergeParams(body, o.params) : body);
|
|
158
|
+
if (Object.keys(merged).length === 0)
|
|
159
|
+
throw new OctenValidationError("nothing to update: give at least one option");
|
|
160
|
+
return merged;
|
|
161
|
+
}
|
|
162
|
+
export function buildListParams(o) {
|
|
163
|
+
const q = {};
|
|
164
|
+
setIf(q, "status", o.status);
|
|
165
|
+
setIf(q, "name", o.name);
|
|
166
|
+
setIf(q, "limit", o.limit);
|
|
167
|
+
setIf(q, "cursor", o.cursor);
|
|
168
|
+
setIf(q, "page_no", o.pageNo);
|
|
169
|
+
return q;
|
|
170
|
+
}
|
|
171
|
+
export function buildRunsParams(o) {
|
|
172
|
+
const q = {};
|
|
173
|
+
setIf(q, "status", o.status);
|
|
174
|
+
setIf(q, "only_changes", o.onlyChanges);
|
|
175
|
+
setIf(q, "order_by", o.orderBy);
|
|
176
|
+
setIf(q, "limit", o.limit);
|
|
177
|
+
setIf(q, "cursor", o.cursor);
|
|
178
|
+
return q;
|
|
179
|
+
}
|
|
180
|
+
export function buildEventsParams(o) {
|
|
181
|
+
const q = {};
|
|
182
|
+
setIf(q, "run_id", o.run);
|
|
183
|
+
setIf(q, "order_by", o.orderBy);
|
|
184
|
+
setIf(q, "limit", o.limit);
|
|
185
|
+
setIf(q, "cursor", o.cursor);
|
|
186
|
+
return q;
|
|
187
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function renderMonitor(data: any): string;
|
|
2
|
+
export declare function renderMonitorList(data: any): string;
|
|
3
|
+
export declare function renderDeleted(data: any): string;
|
|
4
|
+
export declare function renderTriggered(data: any): string;
|
|
5
|
+
export declare function renderRuns(data: any): string;
|
|
6
|
+
export declare function renderRun(data: any): string;
|
|
7
|
+
export declare function renderEvents(data: any): string;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import pc from "picocolors";
|
|
2
|
+
import { unwrap } from "./envelope.js";
|
|
3
|
+
import { printableLine } from "../../util/terminalText.js";
|
|
4
|
+
/** Response text shown on one line, with control characters made visible. */
|
|
5
|
+
const t = (v) => (v === undefined || v === null ? "" : printableLine(String(v)));
|
|
6
|
+
function schedule(s) {
|
|
7
|
+
if (!s)
|
|
8
|
+
return "";
|
|
9
|
+
if (s.cron)
|
|
10
|
+
return `cron ${t(s.cron)}${s.timezone ? ` (${t(s.timezone)})` : ""}`;
|
|
11
|
+
return s.interval ? `every ${t(s.interval)}` : "";
|
|
12
|
+
}
|
|
13
|
+
function watching(m) {
|
|
14
|
+
if (m?.topic?.query)
|
|
15
|
+
return `topic: ${t(m.topic.query)}`;
|
|
16
|
+
if (m?.query)
|
|
17
|
+
return `topic: ${t(m.query)}`;
|
|
18
|
+
const urls = m?.page?.urls ?? m?.urls ?? [];
|
|
19
|
+
return urls.length ? `pages: ${urls.map(t).join(", ")}` : "";
|
|
20
|
+
}
|
|
21
|
+
function status(m) {
|
|
22
|
+
const s = t(m?.status);
|
|
23
|
+
return s === "paused" && m?.pause_reason ? `${s} (${t(m.pause_reason)})` : s;
|
|
24
|
+
}
|
|
25
|
+
/** The secret comes back once, on create, on adding a webhook and on rotation. */
|
|
26
|
+
function secretNotice(m) {
|
|
27
|
+
const secret = m?.webhook?.secret;
|
|
28
|
+
if (!secret)
|
|
29
|
+
return [];
|
|
30
|
+
return [
|
|
31
|
+
"",
|
|
32
|
+
pc.yellow(pc.bold("Webhook signing secret (only shown once, store it now):")),
|
|
33
|
+
` ${t(secret)}`,
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
export function renderMonitor(data) {
|
|
37
|
+
const m = unwrap(data) ?? {};
|
|
38
|
+
const lines = [`${pc.bold(t(m.name) || "(unnamed)")} ${pc.dim(t(m.monitor_id))}`];
|
|
39
|
+
const row = (label, value) => {
|
|
40
|
+
if (value !== undefined && value !== null && value !== "")
|
|
41
|
+
lines.push(` ${pc.dim(label.padEnd(12))}${t(value)}`);
|
|
42
|
+
};
|
|
43
|
+
row("type", m.type);
|
|
44
|
+
row("status", status(m));
|
|
45
|
+
row("watching", watching(m));
|
|
46
|
+
row("condition", m.condition);
|
|
47
|
+
row("schedule", schedule(m.schedule));
|
|
48
|
+
row("next run", m.next_run_at);
|
|
49
|
+
if (m.last_run)
|
|
50
|
+
row("last run", `${m.last_run.status} at ${m.last_run.at}`);
|
|
51
|
+
if (m.first_run_id)
|
|
52
|
+
row("first run", m.first_run_id);
|
|
53
|
+
if (m.webhook?.url)
|
|
54
|
+
row("webhook", m.webhook.url);
|
|
55
|
+
if (m.email?.to?.length)
|
|
56
|
+
row("email", m.email.to.join(", "));
|
|
57
|
+
if (m.metadata && Object.keys(m.metadata).length) {
|
|
58
|
+
row("metadata", Object.entries(m.metadata).map(([k, v]) => `${k}=${v}`).join(", "));
|
|
59
|
+
}
|
|
60
|
+
return [...lines, ...secretNotice(m)].join("\n");
|
|
61
|
+
}
|
|
62
|
+
export function renderMonitorList(data) {
|
|
63
|
+
const body = unwrap(data) ?? {};
|
|
64
|
+
const monitors = body.monitors ?? [];
|
|
65
|
+
const total = typeof body.total === "number" ? pc.dim(`total: ${body.total}`) : "";
|
|
66
|
+
if (!monitors.length)
|
|
67
|
+
return [pc.dim("No monitors."), total].filter(Boolean).join("\n");
|
|
68
|
+
const lines = monitors.map((m) => {
|
|
69
|
+
const last = m.last_run ? `last run ${t(m.last_run.status)} at ${t(m.last_run.at)}` : "no run yet";
|
|
70
|
+
return [
|
|
71
|
+
`${pc.bold(t(m.name) || "(unnamed)")} ${pc.dim(t(m.monitor_id))}`,
|
|
72
|
+
` ${[t(m.type), status(m), schedule(m.schedule), watching(m)].filter(Boolean).join(" · ")}`,
|
|
73
|
+
` ${pc.dim(last)}`,
|
|
74
|
+
].join("\n");
|
|
75
|
+
});
|
|
76
|
+
if (body.next_cursor)
|
|
77
|
+
lines.push(pc.dim(`next cursor: ${t(body.next_cursor)}`));
|
|
78
|
+
if (total)
|
|
79
|
+
lines.push(total);
|
|
80
|
+
return lines.join("\n\n");
|
|
81
|
+
}
|
|
82
|
+
export function renderDeleted(data) {
|
|
83
|
+
const d = unwrap(data) ?? {};
|
|
84
|
+
return `Deleted ${pc.bold(t(d.monitor_id))}.`;
|
|
85
|
+
}
|
|
86
|
+
export function renderTriggered(data) {
|
|
87
|
+
const d = unwrap(data) ?? {};
|
|
88
|
+
return `Started run ${pc.bold(t(d.run_id))} (${t(d.status) || "queued"}).`;
|
|
89
|
+
}
|
|
90
|
+
function runLine(r) {
|
|
91
|
+
// items_notified counts events generated (changes that met the condition), not deliveries.
|
|
92
|
+
const counts = `${t(r.items_total ?? 0)} checked, ${t(r.items_changed ?? 0)} new or changed, ${t(r.items_notified ?? 0)} events`;
|
|
93
|
+
const when = r.started_at ?? r.scheduled_at ?? "";
|
|
94
|
+
const why = [r.skip_reason && `skipped: ${t(r.skip_reason)}`, r.error_code && `error: ${t(r.error_code)}`].filter(Boolean).join(" · ");
|
|
95
|
+
return `${pc.bold(t(r.run_id))} ${t(r.status)}${r.kind ? ` · ${t(r.kind)}` : ""} ${pc.dim(t(when))}\n ${counts}${why ? `\n ${why}` : ""}`;
|
|
96
|
+
}
|
|
97
|
+
export function renderRuns(data) {
|
|
98
|
+
const body = unwrap(data) ?? {};
|
|
99
|
+
const runs = body.runs ?? [];
|
|
100
|
+
if (!runs.length)
|
|
101
|
+
return pc.dim("No runs.");
|
|
102
|
+
const lines = runs.map(runLine);
|
|
103
|
+
if (body.next_cursor)
|
|
104
|
+
lines.push(pc.dim(`next cursor: ${t(body.next_cursor)}`));
|
|
105
|
+
return lines.join("\n\n");
|
|
106
|
+
}
|
|
107
|
+
function changedLines(changed) {
|
|
108
|
+
if (!changed || typeof changed !== "object")
|
|
109
|
+
return [];
|
|
110
|
+
return Object.entries(changed)
|
|
111
|
+
.filter(([, c]) => c?.changed !== false)
|
|
112
|
+
.map(([field, c]) => ` ${t(field)}: ${t(JSON.stringify(c?.previous))} -> ${t(JSON.stringify(c?.current))}`);
|
|
113
|
+
}
|
|
114
|
+
function eventLine(e) {
|
|
115
|
+
const head = `${pc.bold(t(e.change_status))} ${t(e.title ?? e.url)}`;
|
|
116
|
+
const lines = [head];
|
|
117
|
+
if (e.title && e.url)
|
|
118
|
+
lines.push(` ${pc.dim(t(e.url))}`);
|
|
119
|
+
if (e.detected_at)
|
|
120
|
+
lines.push(` ${pc.dim(t(e.detected_at))}`);
|
|
121
|
+
const changes = changedLines(e.changed);
|
|
122
|
+
// A baseline or new item has no diff; show what was extracted instead.
|
|
123
|
+
const extracted = !changes.length && e.fields && typeof e.fields === "object"
|
|
124
|
+
? Object.entries(e.fields).map(([field, v]) => ` ${t(field)}: ${t(JSON.stringify(v))}`)
|
|
125
|
+
: [];
|
|
126
|
+
return [...lines, ...changes, ...extracted].join("\n");
|
|
127
|
+
}
|
|
128
|
+
export function renderRun(data) {
|
|
129
|
+
const r = unwrap(data) ?? {};
|
|
130
|
+
const items = r.items ?? [];
|
|
131
|
+
return [runLine(r), ...items.map(eventLine)].join("\n\n");
|
|
132
|
+
}
|
|
133
|
+
export function renderEvents(data) {
|
|
134
|
+
const body = unwrap(data) ?? {};
|
|
135
|
+
const events = body.events ?? [];
|
|
136
|
+
if (!events.length)
|
|
137
|
+
return pc.dim("No events.");
|
|
138
|
+
const lines = events.map(eventLine);
|
|
139
|
+
if (body.next_cursor)
|
|
140
|
+
lines.push(pc.dim(`next cursor: ${t(body.next_cursor)}`));
|
|
141
|
+
return lines.join("\n\n");
|
|
142
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octen.ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=20"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc && chmod +x dist/cli.js",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"prepublishOnly": "npm run build"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@octen.ai/sdk": "^0.5.0",
|
|
39
40
|
"commander": "^12.1.0",
|
|
40
41
|
"picocolors": "^1.0.1",
|
|
41
42
|
"smol-toml": "^1.7.0",
|