@erdoai/cli 0.56.0 → 0.58.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/dist/index.js +61 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -694,8 +694,15 @@ var ErdoClient = class {
|
|
|
694
694
|
const { runs } = await this.listAgentRuns({ thread: threadID, limit: 1 });
|
|
695
695
|
return runs[0]?.id;
|
|
696
696
|
}
|
|
697
|
-
listThreads() {
|
|
698
|
-
|
|
697
|
+
listThreads(params) {
|
|
698
|
+
const q = new URLSearchParams();
|
|
699
|
+
if (params?.scope) q.set("scope", params.scope);
|
|
700
|
+
if (params?.orderBy) q.set("order_by", params.orderBy);
|
|
701
|
+
if (params?.includeAutomation) q.set("include_automation", "true");
|
|
702
|
+
if (params?.limit !== void 0) q.set("limit", String(params.limit));
|
|
703
|
+
if (params?.offset !== void 0) q.set("offset", String(params.offset));
|
|
704
|
+
const qs = q.toString();
|
|
705
|
+
return this.request("GET", `/v1/threads${qs ? `?${qs}` : ""}`);
|
|
699
706
|
}
|
|
700
707
|
getThreadMessages(threadId) {
|
|
701
708
|
return this.request("GET", `/v1/threads/${encodeURIComponent(threadId)}/messages`);
|
|
@@ -1378,6 +1385,18 @@ function timedOutMessage(threadID) {
|
|
|
1378
1385
|
function print(value) {
|
|
1379
1386
|
console.log(JSON.stringify(value, null, 2));
|
|
1380
1387
|
}
|
|
1388
|
+
function printPageReview(review) {
|
|
1389
|
+
if (!review) return;
|
|
1390
|
+
if (!review.reviewed) {
|
|
1391
|
+
console.error(`review: not run${review.reason ? ` (${review.reason})` : ""}`);
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
console.error(`review: ${review.summary || `${review.issues?.length ?? 0} issue(s)`}`);
|
|
1395
|
+
for (const issue of review.issues || []) {
|
|
1396
|
+
console.error(` [${issue.severity}/${issue.category}] ${issue.description}`);
|
|
1397
|
+
if (issue.suggestion) console.error(` fix: ${issue.suggestion}`);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1381
1400
|
function printAlignedTable(columns, rows) {
|
|
1382
1401
|
const cell = (v) => v === null || v === void 0 ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
1383
1402
|
const widths = columns.map((c, i) => Math.max(c.length, ...rows.map((r) => cell(r[i]).length), 0));
|
|
@@ -2588,16 +2607,30 @@ agentCmd.command("thread").description("Create a thread; prints its id").option(
|
|
|
2588
2607
|
fail(e);
|
|
2589
2608
|
}
|
|
2590
2609
|
});
|
|
2591
|
-
agentCmd.command("threads").description("List your
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2610
|
+
agentCmd.command("threads").description("List threads (default: your own; --scope org/shared for organization-wide)").option("-s, --scope <scope>", "own (default) | org | shared \u2014 org/shared require org membership").option(
|
|
2611
|
+
"--order-by <order>",
|
|
2612
|
+
"created_at (default) | activity (last message time) \u2014 scope=org/shared only"
|
|
2613
|
+
).option(
|
|
2614
|
+
"--include-automation",
|
|
2615
|
+
"include automation/heartbeat-sourced threads, excluded by default \u2014 scope=org/shared only"
|
|
2616
|
+
).option("-l, --limit <n>", "max threads (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(
|
|
2617
|
+
async (opts) => {
|
|
2618
|
+
try {
|
|
2619
|
+
const { threads, total } = await new ErdoClient().listThreads(opts);
|
|
2620
|
+
for (const t of threads) {
|
|
2621
|
+
console.log(`${t.id} ${t.name} ${t.created_by_user_name || t.created_by_user_id} ${t.source || "unrecorded"}`);
|
|
2622
|
+
}
|
|
2623
|
+
const shown = (opts.offset ?? 0) + threads.length;
|
|
2624
|
+
if (total > shown) {
|
|
2625
|
+
console.error(`(showing ${threads.length} of ${total} \u2014 use --limit/--offset for more)`);
|
|
2626
|
+
} else {
|
|
2627
|
+
console.error(`(${total} thread${total === 1 ? "" : "s"})`);
|
|
2628
|
+
}
|
|
2629
|
+
} catch (e) {
|
|
2630
|
+
fail(e);
|
|
2596
2631
|
}
|
|
2597
|
-
} catch (e) {
|
|
2598
|
-
fail(e);
|
|
2599
2632
|
}
|
|
2600
|
-
|
|
2633
|
+
);
|
|
2601
2634
|
function contentBlockLabel(c) {
|
|
2602
2635
|
const type = c.ui_content_type || c.content_type;
|
|
2603
2636
|
const payload = c.content;
|
|
@@ -3343,7 +3376,10 @@ function grantList(v) {
|
|
|
3343
3376
|
}
|
|
3344
3377
|
return slugs;
|
|
3345
3378
|
}
|
|
3346
|
-
pagesCmd.command("deploy").description("Deploy a page (HTML/React); --html/--js/--css accept @file").requiredOption("--title <title>", "page title").requiredOption("--html <htmlOr@file>", "HTML (or @path to a file)").option("--js <jsOr@file>", "JS/JSX (or @path)").option("--css <cssOr@file>", "CSS (or @path)").option("--runtime <runtime>", "react-tailwind (default) or none").option(
|
|
3379
|
+
pagesCmd.command("deploy").description("Deploy a page (HTML/React); --html/--js/--css accept @file").requiredOption("--title <title>", "page title").requiredOption("--html <htmlOr@file>", "HTML (or @path to a file)").option("--js <jsOr@file>", "JS/JSX (or @path)").option("--css <cssOr@file>", "CSS (or @path)").option("--runtime <runtime>", "react-tailwind (default) or none").option(
|
|
3380
|
+
"--meta-title <title>",
|
|
3381
|
+
"public SEO title (browser tab + shared-link headline) \u2014 distinct from --title, the internal name"
|
|
3382
|
+
).option("--meta-description <description>", "public SEO description (shared-link preview / search result blurb)").option("--datasets <csv>", "dataset slugs the page reads").option("--writable-datasets <csv>", "dataset slugs the page may write via erdo.insertRows").option("--kv <csv>", "named KV-store slugs the page reads").option("--writable-kv <csv>", "named KV-store slugs the page may write").option("--public", "make the page publicly viewable").action(
|
|
3347
3383
|
async (opts) => {
|
|
3348
3384
|
try {
|
|
3349
3385
|
const csv = (v) => v ? v.split(",").map((s) => s.trim()) : void 0;
|
|
@@ -3353,6 +3389,8 @@ pagesCmd.command("deploy").description("Deploy a page (HTML/React); --html/--js/
|
|
|
3353
3389
|
js: readMaybeFile(opts.js),
|
|
3354
3390
|
css: readMaybeFile(opts.css),
|
|
3355
3391
|
runtime: opts.runtime,
|
|
3392
|
+
meta_title: opts.metaTitle,
|
|
3393
|
+
meta_description: opts.metaDescription,
|
|
3356
3394
|
dataset_slugs: csv(opts.datasets),
|
|
3357
3395
|
writable_dataset_slugs: csv(opts.writableDatasets),
|
|
3358
3396
|
kv_slugs: csv(opts.kv),
|
|
@@ -3368,7 +3406,13 @@ pagesCmd.command("deploy").description("Deploy a page (HTML/React); --html/--js/
|
|
|
3368
3406
|
);
|
|
3369
3407
|
pagesCmd.command("update <id>").description(
|
|
3370
3408
|
"Update an existing page by id; provided fields are merged (update just --js to keep html/css). --html/--js/--css accept @file"
|
|
3371
|
-
).option("--title <title>", "new title").option("--html <htmlOr@file>", "HTML (or @path to a file)").option("--js <jsOr@file>", "JS/JSX (or @path)").option("--css <cssOr@file>", "CSS (or @path)").option(
|
|
3409
|
+
).option("--title <title>", "new title").option("--html <htmlOr@file>", "HTML (or @path to a file)").option("--js <jsOr@file>", "JS/JSX (or @path)").option("--css <cssOr@file>", "CSS (or @path)").option(
|
|
3410
|
+
"--meta-title <title>",
|
|
3411
|
+
'new public SEO title (omit to keep current; pass "" to clear back to the default)'
|
|
3412
|
+
).option("--meta-description <description>", 'new public SEO description (omit to keep current; pass "" to clear)').option("--datasets <csv>", 'replacement read-dataset slugs ("[]" clears)').option("--writable-datasets <csv>", 'replacement writable-dataset slugs ("[]" clears)').option("--kv <csv>", 'replacement read KV-store slugs ("[]" clears)').option("--writable-kv <csv>", 'replacement writable KV-store slugs ("[]" clears)').option("--public", "make the page publicly viewable").option("--private", "make the page private").option(
|
|
3413
|
+
"--request-review",
|
|
3414
|
+
"ask the judge lenses to review the page after this update and report findings -- for material edits to a LIVE page (layout, forms/CTA, legal/compliance copy, restructured sections), not cosmetic tweaks. First builds and full rewrites are already reviewed automatically"
|
|
3415
|
+
).action(
|
|
3372
3416
|
async (id, opts) => {
|
|
3373
3417
|
try {
|
|
3374
3418
|
const res = await new ErdoClient().updatePage(id, {
|
|
@@ -3376,14 +3420,18 @@ pagesCmd.command("update <id>").description(
|
|
|
3376
3420
|
html: readMaybeFile(opts.html),
|
|
3377
3421
|
js: readMaybeFile(opts.js),
|
|
3378
3422
|
css: readMaybeFile(opts.css),
|
|
3423
|
+
meta_title: opts.metaTitle,
|
|
3424
|
+
meta_description: opts.metaDescription,
|
|
3379
3425
|
dataset_slugs: grantList(opts.datasets),
|
|
3380
3426
|
writable_dataset_slugs: grantList(opts.writableDatasets),
|
|
3381
3427
|
kv_slugs: grantList(opts.kv),
|
|
3382
3428
|
writable_kv_slugs: grantList(opts.writableKv),
|
|
3383
|
-
public: opts.public ? true : opts.private ? false : void 0
|
|
3429
|
+
public: opts.public ? true : opts.private ? false : void 0,
|
|
3430
|
+
request_review: !!opts.requestReview
|
|
3384
3431
|
});
|
|
3385
3432
|
console.log(`${res.id} ${res.public_url || res.url}`);
|
|
3386
3433
|
if (res.warning) console.error(`warning: ${res.warning}`);
|
|
3434
|
+
printPageReview(res.review);
|
|
3387
3435
|
} catch (e) {
|
|
3388
3436
|
fail(e);
|
|
3389
3437
|
}
|