@erdoai/cli 0.178.0 → 0.179.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 +38 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -124,7 +124,7 @@ function parseCSV(text) {
|
|
|
124
124
|
|
|
125
125
|
// src/index.ts
|
|
126
126
|
import { password, select } from "@inquirer/prompts";
|
|
127
|
-
import { Command as Command2, Option as Option2 } from "commander";
|
|
127
|
+
import { Argument, Command as Command2, Option as Option2 } from "commander";
|
|
128
128
|
|
|
129
129
|
// src/config.ts
|
|
130
130
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -223,6 +223,7 @@ function resolveOrgId(account, override) {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
// src/client.ts
|
|
226
|
+
var MEMBER_ACCESS_LEVELS = ["read_only", "full"];
|
|
226
227
|
function formatOrg(name, slug) {
|
|
227
228
|
if (name && slug) return `${name} (${slug})`;
|
|
228
229
|
return name || slug || "";
|
|
@@ -1384,6 +1385,7 @@ var ErdoClient = class {
|
|
|
1384
1385
|
if (params?.scope) q.set("scope", params.scope);
|
|
1385
1386
|
if (params?.orderBy) q.set("order_by", params.orderBy);
|
|
1386
1387
|
if (params?.includeAutomation) q.set("include_automation", "true");
|
|
1388
|
+
if (params?.origin) q.set("origin", params.origin);
|
|
1387
1389
|
if (params?.limit !== void 0) q.set("limit", String(params.limit));
|
|
1388
1390
|
if (params?.offset !== void 0) q.set("offset", String(params.offset));
|
|
1389
1391
|
const qs = q.toString();
|
|
@@ -1839,6 +1841,15 @@ var ErdoClient = class {
|
|
|
1839
1841
|
listIntegrations() {
|
|
1840
1842
|
return this.request("GET", "/v1/integrations");
|
|
1841
1843
|
}
|
|
1844
|
+
// What teammates may do through a shared connection made with someone's own
|
|
1845
|
+
// login: `read_only` (the default) or `full`. The owner always has full access.
|
|
1846
|
+
setIntegrationMemberAccess(integrationId, memberAccess) {
|
|
1847
|
+
return this.request(
|
|
1848
|
+
"POST",
|
|
1849
|
+
`/v1/integrations/${encodeURIComponent(integrationId)}/member-access`,
|
|
1850
|
+
{ member_access: memberAccess }
|
|
1851
|
+
);
|
|
1852
|
+
}
|
|
1842
1853
|
// Start or stop lending a connection to the organizations this one manages.
|
|
1843
1854
|
// `managed_organizations` names the orgs it now serves — empty when this org
|
|
1844
1855
|
// manages nobody yet, which is a truthful answer rather than a failure.
|
|
@@ -2475,7 +2486,8 @@ function formatIntegrationListRow(i) {
|
|
|
2475
2486
|
const unreadable = i.identity_unreadable ? " identity unreadable" : "";
|
|
2476
2487
|
const unchecked = i.identity_unchecked ? " identity not checked" : "";
|
|
2477
2488
|
const connectorAccount = i.connector_account_id ? ` connector_account_id=${i.connector_account_id}` : "";
|
|
2478
|
-
|
|
2489
|
+
const memberAccess = i.member_access ? ` members: ${i.member_access}` : "";
|
|
2490
|
+
return `${i.app} ${i.status} ${i.auth_type} ${i.name} ${i.id}${connectorAccount}${provided}${memberAccess}${unreadable}${unchecked}`;
|
|
2479
2491
|
}
|
|
2480
2492
|
function identityNotes(rows) {
|
|
2481
2493
|
const notes = [];
|
|
@@ -3308,10 +3320,21 @@ managed.command("list").description("List the client orgs your org manages").act
|
|
|
3308
3320
|
fail(e);
|
|
3309
3321
|
}
|
|
3310
3322
|
});
|
|
3311
|
-
managed.command("create").description("Provision a new client org managed by your org").requiredOption("--name <name>", "display name for the new managed org").option("--slug <slug>", "desired slug (a unique suffix is appended if it collides)").
|
|
3323
|
+
managed.command("create").description("Provision a new client org managed by your org").requiredOption("--name <name>", "display name for the new managed org").option("--slug <slug>", "desired slug (a unique suffix is appended if it collides, unless --exact-slug)").option(
|
|
3324
|
+
"--exact-slug",
|
|
3325
|
+
"make the call safe to retry: use --slug exactly as given; if you already manage an org with that slug it is returned and nothing is created, and a slug held by any other org is refused"
|
|
3326
|
+
).option("--timezone <iana>", "IANA timezone for the new org, e.g. Europe/London (default heartbeats run in it; UTC if omitted)").action(async (opts) => {
|
|
3312
3327
|
try {
|
|
3313
|
-
|
|
3314
|
-
|
|
3328
|
+
if (opts.exactSlug && !opts.slug) {
|
|
3329
|
+
throw new Error("--exact-slug needs --slug");
|
|
3330
|
+
}
|
|
3331
|
+
const o = await new ErdoClient().createManagedOrganization({
|
|
3332
|
+
name: opts.name,
|
|
3333
|
+
slug: opts.slug,
|
|
3334
|
+
exact_slug: opts.exactSlug ? true : void 0,
|
|
3335
|
+
timezone: opts.timezone
|
|
3336
|
+
});
|
|
3337
|
+
console.log(o.created ? `Created managed org: ${o.name}` : `Managed org already exists, nothing created: ${o.name}`);
|
|
3315
3338
|
console.log(`slug: ${o.slug}
|
|
3316
3339
|
id: ${o.id}`);
|
|
3317
3340
|
process.stderr.write(
|
|
@@ -4769,7 +4792,7 @@ async function resolveConversationPersona(client, selector) {
|
|
|
4769
4792
|
throw new Error(`No enabled agent matches "${selector}"`);
|
|
4770
4793
|
}
|
|
4771
4794
|
var conversationsCmd = program.command("threads").description("List and open conversations with people and named agents");
|
|
4772
|
-
conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
4795
|
+
conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("--origin <origin>", "person (default) | erdo (automation and Shortcut runs) | all \u2014 scope=org/shared only").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
4773
4796
|
try {
|
|
4774
4797
|
const { threads, total } = await new ErdoClient().listThreads(opts);
|
|
4775
4798
|
for (const thread of threads) {
|
|
@@ -9687,6 +9710,15 @@ Provided to ${orgs.length} organization${orgs.length === 1 ? "" : "s"}:`);
|
|
|
9687
9710
|
fail(e);
|
|
9688
9711
|
}
|
|
9689
9712
|
});
|
|
9713
|
+
integrationsCmd.command("member-access").argument("<integration-id>").addArgument(new Argument("<member-access>", "read_only or full").choices(MEMBER_ACCESS_LEVELS)).description(
|
|
9714
|
+
"Set what teammates can do through a shared connection made with your login (connected apps and MCP servers such as GitHub): read_only lets them look things up, full also lets them make changes. You always keep full access"
|
|
9715
|
+
).action(async (integrationId, memberAccess) => {
|
|
9716
|
+
try {
|
|
9717
|
+
print(await new ErdoClient().setIntegrationMemberAccess(integrationId, memberAccess));
|
|
9718
|
+
} catch (e) {
|
|
9719
|
+
fail(e);
|
|
9720
|
+
}
|
|
9721
|
+
});
|
|
9690
9722
|
integrationsCmd.command("disconnect <app>").description("Disconnect an app \u2014 releases the stored credential and removes the connection; org admins can disconnect any of the org's connections").action(async (app) => {
|
|
9691
9723
|
try {
|
|
9692
9724
|
const client = new ErdoClient();
|