@erdoai/cli 0.56.0 → 0.57.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 +43 -12
- 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`);
|
|
@@ -2588,16 +2595,30 @@ agentCmd.command("thread").description("Create a thread; prints its id").option(
|
|
|
2588
2595
|
fail(e);
|
|
2589
2596
|
}
|
|
2590
2597
|
});
|
|
2591
|
-
agentCmd.command("threads").description("List your
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2598
|
+
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(
|
|
2599
|
+
"--order-by <order>",
|
|
2600
|
+
"created_at (default) | activity (last message time) \u2014 scope=org/shared only"
|
|
2601
|
+
).option(
|
|
2602
|
+
"--include-automation",
|
|
2603
|
+
"include automation/heartbeat-sourced threads, excluded by default \u2014 scope=org/shared only"
|
|
2604
|
+
).option("-l, --limit <n>", "max threads (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(
|
|
2605
|
+
async (opts) => {
|
|
2606
|
+
try {
|
|
2607
|
+
const { threads, total } = await new ErdoClient().listThreads(opts);
|
|
2608
|
+
for (const t of threads) {
|
|
2609
|
+
console.log(`${t.id} ${t.name} ${t.created_by_user_name || t.created_by_user_id} ${t.source || "unrecorded"}`);
|
|
2610
|
+
}
|
|
2611
|
+
const shown = (opts.offset ?? 0) + threads.length;
|
|
2612
|
+
if (total > shown) {
|
|
2613
|
+
console.error(`(showing ${threads.length} of ${total} \u2014 use --limit/--offset for more)`);
|
|
2614
|
+
} else {
|
|
2615
|
+
console.error(`(${total} thread${total === 1 ? "" : "s"})`);
|
|
2616
|
+
}
|
|
2617
|
+
} catch (e) {
|
|
2618
|
+
fail(e);
|
|
2596
2619
|
}
|
|
2597
|
-
} catch (e) {
|
|
2598
|
-
fail(e);
|
|
2599
2620
|
}
|
|
2600
|
-
|
|
2621
|
+
);
|
|
2601
2622
|
function contentBlockLabel(c) {
|
|
2602
2623
|
const type = c.ui_content_type || c.content_type;
|
|
2603
2624
|
const payload = c.content;
|
|
@@ -3343,7 +3364,10 @@ function grantList(v) {
|
|
|
3343
3364
|
}
|
|
3344
3365
|
return slugs;
|
|
3345
3366
|
}
|
|
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(
|
|
3367
|
+
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(
|
|
3368
|
+
"--meta-title <title>",
|
|
3369
|
+
"public SEO title (browser tab + shared-link headline) \u2014 distinct from --title, the internal name"
|
|
3370
|
+
).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
3371
|
async (opts) => {
|
|
3348
3372
|
try {
|
|
3349
3373
|
const csv = (v) => v ? v.split(",").map((s) => s.trim()) : void 0;
|
|
@@ -3353,6 +3377,8 @@ pagesCmd.command("deploy").description("Deploy a page (HTML/React); --html/--js/
|
|
|
3353
3377
|
js: readMaybeFile(opts.js),
|
|
3354
3378
|
css: readMaybeFile(opts.css),
|
|
3355
3379
|
runtime: opts.runtime,
|
|
3380
|
+
meta_title: opts.metaTitle,
|
|
3381
|
+
meta_description: opts.metaDescription,
|
|
3356
3382
|
dataset_slugs: csv(opts.datasets),
|
|
3357
3383
|
writable_dataset_slugs: csv(opts.writableDatasets),
|
|
3358
3384
|
kv_slugs: csv(opts.kv),
|
|
@@ -3368,7 +3394,10 @@ pagesCmd.command("deploy").description("Deploy a page (HTML/React); --html/--js/
|
|
|
3368
3394
|
);
|
|
3369
3395
|
pagesCmd.command("update <id>").description(
|
|
3370
3396
|
"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(
|
|
3397
|
+
).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(
|
|
3398
|
+
"--meta-title <title>",
|
|
3399
|
+
'new public SEO title (omit to keep current; pass "" to clear back to the default)'
|
|
3400
|
+
).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").action(
|
|
3372
3401
|
async (id, opts) => {
|
|
3373
3402
|
try {
|
|
3374
3403
|
const res = await new ErdoClient().updatePage(id, {
|
|
@@ -3376,6 +3405,8 @@ pagesCmd.command("update <id>").description(
|
|
|
3376
3405
|
html: readMaybeFile(opts.html),
|
|
3377
3406
|
js: readMaybeFile(opts.js),
|
|
3378
3407
|
css: readMaybeFile(opts.css),
|
|
3408
|
+
meta_title: opts.metaTitle,
|
|
3409
|
+
meta_description: opts.metaDescription,
|
|
3379
3410
|
dataset_slugs: grantList(opts.datasets),
|
|
3380
3411
|
writable_dataset_slugs: grantList(opts.writableDatasets),
|
|
3381
3412
|
kv_slugs: grantList(opts.kv),
|