@alter-ai/cli 0.3.1 → 0.3.2

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 (3) hide show
  1. package/README.md +3 -2
  2. package/dist/cli.js +76 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -26,8 +26,9 @@ apps list | create | show | update | archive | unarchive | delete
26
26
  keys list | mint | show | rotate | revoke | rename
27
27
  agents list | create | show | update | revoke (+ mint-key, list-keys, revoke-key)
28
28
  providers list | list-catalog | create | show | update | delete
29
- managed-secrets list | show | create | rotate | delete | templates | access | users
30
- grants {list, list-for-agent, create, update, revoke}
29
+ managed-secrets list | show | create | rotate | delete | templates | access |
30
+ set-delegation-policy | users |
31
+ grants {list, list-for-agent, create, update, revoke} |
31
32
  groups {list, show}
32
33
  policy show-app
33
34
  audit list | show | portal-actions | grant-events | traces
package/dist/cli.js CHANGED
@@ -173,7 +173,7 @@ async function maybePrintUpdateBanner(currentVersion, argv2 = process.argv.slice
173
173
  // package.json
174
174
  var package_default = {
175
175
  name: "@alter-ai/cli",
176
- version: "0.3.1",
176
+ version: "0.3.2",
177
177
  description: "Command-line interface for the Alter Vault dev portal \u2014 scripted dashboard automation.",
178
178
  type: "module",
179
179
  bin: {
@@ -6229,6 +6229,21 @@ var Agent = class _Agent {
6229
6229
  async connect(options) {
6230
6230
  return this.#client.connect(options);
6231
6231
  }
6232
+ /**
6233
+ * Poll a Connect session to completion. See
6234
+ * {@link _VaultClient.pollConnectSession} for the full signature.
6235
+ */
6236
+ async pollConnectSession(...args) {
6237
+ return this.#client.pollConnectSession(...args);
6238
+ }
6239
+ /**
6240
+ * Mint a recovery Connect session from a typed error. See
6241
+ * {@link _VaultClient.createConnectSessionForError} for the full
6242
+ * signature.
6243
+ */
6244
+ async createConnectSessionForError(...args) {
6245
+ return this.#client.createConnectSessionForError(...args);
6246
+ }
6232
6247
  // ── Delegation self-revoke ─────────────────────────────────────────────
6233
6248
  /**
6234
6249
  * Opt out of this agent's delegation on an OAuth grant.
@@ -6408,6 +6423,21 @@ var App = class _App {
6408
6423
  async connect(options) {
6409
6424
  return this.#client.connect(options);
6410
6425
  }
6426
+ /**
6427
+ * Poll a Connect session to completion. See
6428
+ * {@link _VaultClient.pollConnectSession} for the full signature.
6429
+ */
6430
+ async pollConnectSession(...args) {
6431
+ return this.#client.pollConnectSession(...args);
6432
+ }
6433
+ /**
6434
+ * Mint a recovery Connect session from a typed error. See
6435
+ * {@link _VaultClient.createConnectSessionForError} for the full
6436
+ * signature.
6437
+ */
6438
+ async createConnectSessionForError(...args) {
6439
+ return this.#client.createConnectSessionForError(...args);
6440
+ }
6411
6441
  // ── Auth (operator-only) ───────────────────────────────────────────────
6412
6442
  async authenticate(options) {
6413
6443
  return this.#client.authenticate(options);
@@ -6841,7 +6871,7 @@ var DEFAULT_BASE_URL = "https://backend.alterauth.com";
6841
6871
  var PAT_API_PREFIX = "/api/v1/dev-portal";
6842
6872
  var HTTP_ERROR_THRESHOLD = 400;
6843
6873
  var DEFAULT_TIMEOUT_MS = 3e4;
6844
- var CLI_VERSION = "0.3.1";
6874
+ var CLI_VERSION = "0.3.2";
6845
6875
  var USER_AGENT = buildUserAgent();
6846
6876
  function buildUserAgent() {
6847
6877
  let osTag = "";
@@ -12161,6 +12191,46 @@ function collectRedirectUris(value, previous = []) {
12161
12191
  const next = value.split(",").map((s) => s.trim()).filter(Boolean);
12162
12192
  return [...previous, ...next];
12163
12193
  }
12194
+ function sanitizeStderrText(value) {
12195
+ return value.replace(/[\u0000-\u001f\u007f-\u009f]+/g, " ").trim();
12196
+ }
12197
+ function surfaceProviderResponse(row) {
12198
+ if (typeof row !== "object" || row === null) return;
12199
+ const r = row;
12200
+ const preflight = r.preflight;
12201
+ if (preflight && typeof preflight === "object") {
12202
+ const status = preflight.status;
12203
+ const msg = typeof preflight.message === "string" ? sanitizeStderrText(preflight.message) : "";
12204
+ if (status === "passed") {
12205
+ process.stderr.write("alter: preflight: passed\n");
12206
+ } else if (status === "failed") {
12207
+ process.stderr.write(
12208
+ `alter: preflight: failed${msg ? ` \u2014 ${msg}` : ""}
12209
+ `
12210
+ );
12211
+ } else if (status === "inconclusive") {
12212
+ process.stderr.write(
12213
+ `alter: preflight: inconclusive${msg ? ` \u2014 ${msg}` : ""} (save was allowed)
12214
+ `
12215
+ );
12216
+ }
12217
+ }
12218
+ const bc = r.breaking_changes;
12219
+ if (Array.isArray(bc) && bc.length > 0) {
12220
+ process.stderr.write(
12221
+ `alter: warning: ${bc.length} breaking change(s) \u2014 ${sanitizeStderrText(JSON.stringify(bc))}
12222
+ `
12223
+ );
12224
+ }
12225
+ const warning = r.warning;
12226
+ if (typeof warning === "string") {
12227
+ const sanitized = sanitizeStderrText(warning);
12228
+ if (sanitized.length > 0) {
12229
+ process.stderr.write(`alter: warning: ${sanitized}
12230
+ `);
12231
+ }
12232
+ }
12233
+ }
12164
12234
  function buildProvidersCommand() {
12165
12235
  const providers = new Command11("providers").description(
12166
12236
  "Manage OAuth provider configs"
@@ -12251,6 +12321,7 @@ function buildProvidersCommand() {
12251
12321
  appId,
12252
12322
  body
12253
12323
  );
12324
+ surfaceProviderResponse(row);
12254
12325
  emit(format, row);
12255
12326
  });
12256
12327
  return;
@@ -12290,6 +12361,7 @@ function buildProvidersCommand() {
12290
12361
  scopes,
12291
12362
  redirect_uris: redirects
12292
12363
  });
12364
+ surfaceProviderResponse(row);
12293
12365
  emit(format, row);
12294
12366
  });
12295
12367
  }
@@ -12336,6 +12408,7 @@ function buildProvidersCommand() {
12336
12408
  options.provider,
12337
12409
  body
12338
12410
  );
12411
+ surfaceProviderResponse(row);
12339
12412
  emit(format, row);
12340
12413
  });
12341
12414
  return;
@@ -12362,6 +12435,7 @@ function buildProvidersCommand() {
12362
12435
  redirect_uris: redirects,
12363
12436
  status: providerStatus
12364
12437
  });
12438
+ surfaceProviderResponse(row);
12365
12439
  emit(format, row);
12366
12440
  });
12367
12441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alter-ai/cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Command-line interface for the Alter Vault dev portal — scripted dashboard automation.",
5
5
  "type": "module",
6
6
  "bin": {