@erdoai/cli 0.85.1 → 0.86.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/dist/index.js +45 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -587,6 +587,16 @@ var ErdoClient = class {
|
|
|
587
587
|
`/v1/voice/phone-numbers/${encodeURIComponent(number)}/sms`
|
|
588
588
|
);
|
|
589
589
|
}
|
|
590
|
+
// Turn an agent's answering of texts on or off. Only the switch changes: the
|
|
591
|
+
// agent's persona, number and calls are untouched, and texts keep arriving and
|
|
592
|
+
// stay readable either way.
|
|
593
|
+
setVoiceAgentSMSReplies(slug, enabled) {
|
|
594
|
+
return this.request(
|
|
595
|
+
"POST",
|
|
596
|
+
`/v1/voice/agents/${encodeURIComponent(slug)}/sms-replies`,
|
|
597
|
+
{ enabled }
|
|
598
|
+
);
|
|
599
|
+
}
|
|
590
600
|
// Run a read-only HogQL query against the org's page-analytics events. Rows are
|
|
591
601
|
// positional per columns; enabled:false means page analytics is off for the org
|
|
592
602
|
// (not zero traffic). A rejected query surfaces PostHog's message as the error.
|
|
@@ -1318,9 +1328,12 @@ var ErdoClient = class {
|
|
|
1318
1328
|
);
|
|
1319
1329
|
}
|
|
1320
1330
|
// --- knowledge ---
|
|
1321
|
-
listKnowledge(visibility) {
|
|
1331
|
+
listKnowledge(visibility, options) {
|
|
1322
1332
|
const params = new URLSearchParams();
|
|
1323
1333
|
if (visibility) params.set("visibility", visibility);
|
|
1334
|
+
if (options?.record_type) params.set("record_type", options.record_type);
|
|
1335
|
+
if (options?.limit !== void 0) params.set("limit", String(options.limit));
|
|
1336
|
+
if (options?.offset !== void 0) params.set("offset", String(options.offset));
|
|
1324
1337
|
const qs = params.toString();
|
|
1325
1338
|
return this.request("GET", `/v1/knowledge${qs ? `?${qs}` : ""}`);
|
|
1326
1339
|
}
|
|
@@ -5353,6 +5366,12 @@ voiceSMSCmd.command("get <sessionID>").description("Read one SMS conversation: i
|
|
|
5353
5366
|
]
|
|
5354
5367
|
]
|
|
5355
5368
|
);
|
|
5369
|
+
const contact = c.contact;
|
|
5370
|
+
if (contact && (contact.name || contact.email || contact.phone || contact.company)) {
|
|
5371
|
+
const parts = [contact.name, contact.email, contact.phone, contact.company].filter(Boolean);
|
|
5372
|
+
console.log(`
|
|
5373
|
+
contact: ${parts.join(" \xB7 ")}`);
|
|
5374
|
+
}
|
|
5356
5375
|
const messages = res.messages ?? [];
|
|
5357
5376
|
if (messages.length === 0) {
|
|
5358
5377
|
console.log("\nNo texts have been recorded in this conversation yet.");
|
|
@@ -5497,6 +5516,25 @@ voiceNumbersCmd.command("provision-sms <number>").description("Ask for A2P SMS r
|
|
|
5497
5516
|
fail(e);
|
|
5498
5517
|
}
|
|
5499
5518
|
});
|
|
5519
|
+
var voiceAgentsCmd = voiceCmd.command("agents").description("Settings on a voice agent itself");
|
|
5520
|
+
voiceAgentsCmd.command("sms-replies <slug>").description("Turn a voice agent's answering of texts on or off").option("--on", "the agent answers texts sent to its own number").option("--off", "texts still arrive and stay readable; the agent does not write back").action(async (slug, opts) => {
|
|
5521
|
+
if (Boolean(opts.on) === Boolean(opts.off)) {
|
|
5522
|
+
fail(new Error("say which way: pass --on or --off (exactly one)"));
|
|
5523
|
+
}
|
|
5524
|
+
try {
|
|
5525
|
+
const agent = await new ErdoClient().setVoiceAgentSMSReplies(slug, Boolean(opts.on));
|
|
5526
|
+
console.log(
|
|
5527
|
+
`${agent.slug} ${agent.sms_replies_enabled ? "on" : "off"} ${agent.phone_number ?? "-"} ${agent.name}`
|
|
5528
|
+
);
|
|
5529
|
+
if (!agent.phone_number) {
|
|
5530
|
+
process.stderr.write(
|
|
5531
|
+
"this agent has no phone number yet \u2014 the setting is stored and applies once it gets one\n"
|
|
5532
|
+
);
|
|
5533
|
+
}
|
|
5534
|
+
} catch (e) {
|
|
5535
|
+
fail(e);
|
|
5536
|
+
}
|
|
5537
|
+
});
|
|
5500
5538
|
var datasetsCmd = program.command("datasets").description("Datasets");
|
|
5501
5539
|
datasetsCmd.command("list").description("List datasets").option(
|
|
5502
5540
|
"--class <class>",
|
|
@@ -6344,9 +6382,13 @@ var knowledgeCmd = program.command("knowledge").description("Knowledge objects")
|
|
|
6344
6382
|
knowledgeCmd.command("list").description("List knowledge objects").option(
|
|
6345
6383
|
"--public",
|
|
6346
6384
|
"only entries opted into anonymous external surfaces (website widgets)"
|
|
6347
|
-
).action(async (opts) => {
|
|
6385
|
+
).option("--record-type <type>", "inspect typed records, including drafts (excludes archived)").option("--limit <n>", "page size (default 20, maximum 100)", (v) => parseInt(v, 10)).option("--offset <n>", "page offset; follow next_offset for typed records", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
6348
6386
|
try {
|
|
6349
|
-
print(await new ErdoClient().listKnowledge(opts.public ? "public" : void 0
|
|
6387
|
+
print(await new ErdoClient().listKnowledge(opts.public ? "public" : void 0, {
|
|
6388
|
+
record_type: opts.recordType,
|
|
6389
|
+
limit: opts.limit,
|
|
6390
|
+
offset: opts.offset
|
|
6391
|
+
}));
|
|
6350
6392
|
} catch (e) {
|
|
6351
6393
|
fail(e);
|
|
6352
6394
|
}
|