@letterstory/cli 0.177.114 → 0.177.115

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/lib/cli.mjs CHANGED
@@ -91,7 +91,7 @@ import {
91
91
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
92
92
 
93
93
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
94
- export const VERSION = "0.177.114";
94
+ export const VERSION = "0.177.115";
95
95
 
96
96
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
97
97
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -38,6 +38,9 @@ export const ARGS = {
38
38
  describe_org_config_fields: {},
39
39
  get_org_config_source: {},
40
40
  get_billing_payments: {},
41
+ list_trusted_issuers: {},
42
+ approve_trusted_issuer: { issuer: { positional: 0, label: "issuer", required: true } },
43
+ revoke_trusted_issuer: { issuer: { positional: 0, label: "issuer", required: true } },
41
44
  get_billing: {},
42
45
  get_billing_invoices: {},
43
46
  list_token_rewards: {},
@@ -119,9 +122,11 @@ export async function cmdOrg(ctx) {
119
122
  return orgMcp(rest);
120
123
  case "billing":
121
124
  return orgBilling(rest);
125
+ case "auto-connect":
126
+ return orgAutoConnect(rest);
122
127
  default:
123
128
  throw new CliError(
124
- `Unknown org subcommand: ${sub ?? "(none)"}. Try: export, join, diff, apply, git, integrations, overview, linear, mcp, fields, billing`
129
+ `Unknown org subcommand: ${sub ?? "(none)"}. Try: export, join, diff, apply, git, integrations, overview, linear, mcp, fields, billing, auto-connect`
125
130
  );
126
131
  }
127
132
  }
@@ -508,6 +513,49 @@ async function orgLinear(ctx) {
508
513
  }
509
514
  }
510
515
 
516
+ /**
517
+ * `org auto-connect` — the issuers whose Claude auto-connect sign-ins the org accepts:
518
+ * org auto-connect the issuers, live and revoked (list_trusted_issuers)
519
+ * org auto-connect approve <issuer> trust an issuer for this org (approve_trusted_issuer)
520
+ * org auto-connect revoke <issuer> --yes stop trusting it (revoke_trusted_issuer)
521
+ */
522
+ async function orgAutoConnect(ctx) {
523
+ const { client, flags, io } = ctx;
524
+ const sub = ctx.positionals[0] ?? "list";
525
+ const rest = ctx.positionals.slice(1);
526
+ const line = (i) =>
527
+ `${i.revoked_at ? "○" : "●"} ${i.issuer} added by ${i.added_by}${i.revoked_at ? ` (revoked ${i.revoked_at})` : ""}`;
528
+ const call = async (tool, allowed) => {
529
+ refuseUnknownFlags(ctx, {}, allowed);
530
+ return client.callTool(tool, argsFromFlags(ARGS[tool], flags, rest));
531
+ };
532
+ switch (sub) {
533
+ case "list": {
534
+ const result = await call("list_trusted_issuers", []);
535
+ printResult(io, flags, result, (r) => r.issuers.map(line).join("\n") || "No trusted issuers.");
536
+ return 0;
537
+ }
538
+ case "approve": {
539
+ const result = await call("approve_trusted_issuer", []);
540
+ printResult(io, flags, result, (r) => line(r.issuer));
541
+ return 0;
542
+ }
543
+ case "revoke": {
544
+ if (!flagBool(flags.yes)) {
545
+ io.error(
546
+ `Revoking stops Claude auto-connect sign-ins from this issuer. Re-run with --yes to confirm: ${ctx.bin} org auto-connect revoke <issuer> --yes`
547
+ );
548
+ return 1;
549
+ }
550
+ const result = await call("revoke_trusted_issuer", ["yes"]);
551
+ printResult(io, flags, result, (r) => line(r.issuer));
552
+ return 0;
553
+ }
554
+ default:
555
+ throw new CliError(`Unknown org auto-connect subcommand: ${sub}. Try: list, approve, revoke`);
556
+ }
557
+ }
558
+
511
559
  /**
512
560
  * `org mcp` — other products' MCP servers Letter's agent can call (docs/architecture/mcp-connections.md):
513
561
  * org mcp the connections (list_mcp_connections)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.114",
3
+ "version": "0.177.115",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",