@erdoai/cli 0.61.0 → 0.63.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.
Files changed (2) hide show
  1. package/dist/index.js +83 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -269,6 +269,15 @@ var ErdoClient = class {
269
269
  setAutonomyMode(mode) {
270
270
  return this.request("PUT", "/v1/autonomy-mode", { mode });
271
271
  }
272
+ // Personal approval settings — which risk classes of the caller's OWN agent
273
+ // runs still raise a card in the active org. gates null = no personal
274
+ // setting (org default); [] = nothing asks; otherwise the listed classes ask.
275
+ getApprovalSettings() {
276
+ return this.request("GET", "/v1/approval-settings");
277
+ }
278
+ setApprovalSettings(gates) {
279
+ return this.request("PUT", "/v1/approval-settings", { gates });
280
+ }
272
281
  // --- Manager accounts: operate many client (managed) orgs with ONE manager key ---
273
282
  // The manager is your active org; you must be an admin/owner of it. A managed org
274
283
  // is a client tenant you provision and operate. The manager key (createManagerKey)
@@ -844,6 +853,15 @@ var ErdoClient = class {
844
853
  listIntegrations() {
845
854
  return this.request("GET", "/v1/integrations");
846
855
  }
856
+ // For a Pipedream-backed integration this is the full disconnect: the
857
+ // credential is released at the provider and the connection removed, not just
858
+ // the integration row deleted.
859
+ deleteIntegration(integrationId) {
860
+ return this.request(
861
+ "DELETE",
862
+ `/v1/integrations/${encodeURIComponent(integrationId)}`
863
+ );
864
+ }
847
865
  getConnectionScope(integrationId) {
848
866
  return this.request(
849
867
  "GET",
@@ -3100,6 +3118,50 @@ ${listing}`);
3100
3118
  }
3101
3119
  }
3102
3120
  );
3121
+ approvalsCmd.command("settings [mode]").description(
3122
+ "Show or set YOUR approval settings: which classes of your agents' actions still ask. mode: safe (auto-approve page work + bookkeeping; spend and destructive still ask) | all (approve everything) | reset (back to the org default)"
3123
+ ).option(
3124
+ "--gates <classes>",
3125
+ "explicit comma-separated gate list, e.g. spend,destructive (overrides <mode>)"
3126
+ ).action(async (mode, opts = {}) => {
3127
+ try {
3128
+ const client = new ErdoClient();
3129
+ let gates;
3130
+ if (opts.gates !== void 0) {
3131
+ gates = opts.gates.split(",").map((g) => g.trim()).filter(Boolean);
3132
+ } else {
3133
+ switch (mode) {
3134
+ case void 0:
3135
+ break;
3136
+ // show
3137
+ case "safe":
3138
+ gates = ["spend", "destructive"];
3139
+ break;
3140
+ case "all":
3141
+ gates = [];
3142
+ break;
3143
+ case "reset":
3144
+ gates = null;
3145
+ break;
3146
+ default:
3147
+ throw new Error(`unknown mode ${mode} \u2014 use safe | all | reset, or --gates spend,destructive`);
3148
+ }
3149
+ }
3150
+ if (gates !== void 0) {
3151
+ await client.setApprovalSettings(gates);
3152
+ }
3153
+ const { gates: current } = await client.getApprovalSettings();
3154
+ if (current === null) {
3155
+ console.log("Approval settings: org default (every gated action asks, subject to the org's own gates and standing policies)");
3156
+ } else if (current.length === 0) {
3157
+ console.log("Approval settings: approve everything \u2014 no class of your agents' actions asks (a standing always-require policy still applies)");
3158
+ } else {
3159
+ console.log(`Approval settings: ${current.join(", ")} still ask; the rest of your agents' actions auto-approve`);
3160
+ }
3161
+ } catch (e) {
3162
+ fail(e);
3163
+ }
3164
+ });
3103
3165
  var attnCmd = program.command("attention").description("The attention feed \u2014 digests, choices, escalations awaiting a human");
3104
3166
  attnCmd.command("list").description("List attention items").option("--status <status...>", "open | answered | dismissed | expired").option("--open", "shorthand for --status open").option("--engine-actions", "only engine-generated items").option("--item <idOrSlug>", "read one item: its slug or its uuid").option("-n, --limit <n>", "max items", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(
3105
3167
  async (opts) => {
@@ -4180,7 +4242,7 @@ integrationsCmd.command("apps [query]").description("Search connectable apps (na
4180
4242
  fail(e);
4181
4243
  }
4182
4244
  });
4183
- integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass its API key or other credentials with -c, or omit them to get a browser connect URL for OAuth apps").option("-c, --credential <key=value...>", "credential field, e.g. -c api_key=\u2026 (repeatable); rejected by OAuth apps, which have no credential to pass", (v, acc) => acc.concat(v), []).option("-n, --name <name>", "display name for the connection").option("--rotate", "replace the credentials of the app's existing connection instead of adding a second one \u2014 for a key that was rotated at the provider; requires -c").action(async (app, opts) => {
4245
+ integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass its API key or other credentials with -c, or omit them to get a browser connect URL for OAuth apps").option("-c, --credential <key=value...>", "credential field, e.g. -c api_key=\u2026 (repeatable); rejected by OAuth apps, which have no credential to pass", (v, acc) => acc.concat(v), []).option("-n, --name <name>", "display name for the connection").option("--rotate", "replace the credentials of the app's existing connection instead of adding a second one \u2014 for a key that was rotated at the provider; requires -c").option("--share", "share the connection with the whole organization instead of keeping it private to you \u2014 for org-level credentials teammates and agents should see").action(async (app, opts) => {
4184
4246
  try {
4185
4247
  let credentials;
4186
4248
  if (opts.credential.length) {
@@ -4195,7 +4257,8 @@ integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass
4195
4257
  app,
4196
4258
  name: opts.name,
4197
4259
  credentials,
4198
- rotate_credentials: opts.rotate || void 0
4260
+ rotate_credentials: opts.rotate || void 0,
4261
+ share_with_org: opts.share || void 0
4199
4262
  });
4200
4263
  print(res);
4201
4264
  const notes = [];
@@ -4210,6 +4273,24 @@ ${notes.join("\n")}`);
4210
4273
  fail(e);
4211
4274
  }
4212
4275
  });
4276
+ 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) => {
4277
+ try {
4278
+ const client = new ErdoClient();
4279
+ const { integrations } = await client.listIntegrations();
4280
+ const matches = integrations.filter((i) => i.app === app);
4281
+ if (!matches.length) fail(new Error(`no ${app} connection found \u2014 see: erdo integrations list`));
4282
+ if (matches.length > 1) {
4283
+ fail(
4284
+ new Error(
4285
+ `there are ${matches.length} ${app} connections (${matches.map((i) => i.name || i.id).join(", ")}) \u2014 disconnect the right one from Data \u2192 Connectors in the Erdo web app`
4286
+ )
4287
+ );
4288
+ }
4289
+ print(await client.deleteIntegration(matches[0].id));
4290
+ } catch (e) {
4291
+ fail(e);
4292
+ }
4293
+ });
4213
4294
  integrationsCmd.command("status <app>").description("Check whether an app is connected (completes browser-authorized connections)").action(async (app) => {
4214
4295
  try {
4215
4296
  print(await new ErdoClient().checkIntegrationConnection(app));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.61.0",
4
- "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
3
+ "version": "0.63.0",
4
+ "description": "Erdo CLI drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "erdo": "dist/index.js"
@@ -52,4 +52,4 @@
52
52
  "overrides": {
53
53
  "esbuild": "^0.28.1"
54
54
  }
55
- }
55
+ }