@fiscalmindset/blindfold 0.4.2 → 0.4.3

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/dist/cli.mjs +21 -18
  2. package/package.json +1 -1
  3. package/src/help.ts +22 -17
package/dist/cli.mjs CHANGED
@@ -1611,19 +1611,20 @@ var COMMANDS = [
1611
1611
  name: "grant",
1612
1612
  group: "\u{1F465} Team & sharing",
1613
1613
  usage: "--host <host>[,<host2>...]",
1614
- summary: "Authorize the contract to call these hosts (required before proxy/in-enclave can reach them).",
1615
- flags: [["--host <host,...>", "Comma-separated egress hosts to allow (additive)."]],
1616
- examples: ["blindfold grant --host api.openai.com", "blindfold grant --host api.github.com,api.stripe.com"]
1614
+ summary: "Allow the enclave to reach an API's server. Do this once per API before the proxy can call it \u2014 e.g. allow api.openai.com so a sealed OpenAI key can be used.",
1615
+ flags: [["--host <host,...>", "The API hostname(s) to allow, comma-separated. Each grant adds to the list."]],
1616
+ examples: ["blindfold grant --host api.openai.com", "blindfold grant --host api.github.com,api.stripe.com"],
1617
+ notes: "Why it's needed: the enclave refuses to call any host you haven't allowed (deny-by-default). Grant the host of each API whose key you've sealed."
1617
1618
  },
1618
1619
  {
1619
1620
  name: "share",
1620
1621
  group: "\u{1F465} Team & sharing",
1621
1622
  usage: "--to <agent-did> --host <host>[,...]",
1622
- summary: "Let a teammate's agent USE your sealed keys for a host \u2014 forward only, never the plaintext.",
1623
- flags: [["--to <agent-did>", "The teammate's agent DID to authorize."], ["--host <host,...>", "Hosts they may reach through the enclave."]],
1624
- examples: ["blindfold share --to did:t3n:\u2026 --host api.openai.com"]
1623
+ summary: "Let a teammate use your sealed key for an API \u2014 they can make calls but never see the key itself.",
1624
+ flags: [["--to <agent-did>", "The teammate's agent DID (their Terminal 3 identity)."], ["--host <host,...>", "Which API hosts they're allowed to reach through your enclave."]],
1625
+ examples: ["blindfold share --to did:t3n:abc\u2026 --host api.openai.com"]
1625
1626
  },
1626
- { name: "revoke", group: "\u{1F465} Team & sharing", usage: "--to <agent-did>", summary: "Remove a teammate's access \u2014 immediate and complete.", flags: [["--to <agent-did>", "The teammate's agent DID to revoke."]], examples: ["blindfold revoke --to did:t3n:\u2026"] },
1627
+ { name: "revoke", group: "\u{1F465} Team & sharing", usage: "--to <agent-did>", summary: "Take back a teammate's access you granted with `share` \u2014 immediate and complete.", flags: [["--to <agent-did>", "The teammate's agent DID to cut off."]], examples: ["blindfold revoke --to did:t3n:abc\u2026"] },
1627
1628
  // ── Enclave & admin ──────────────────────────────────────────────────────
1628
1629
  { name: "publish", group: "\u{1F4E6} Enclave & admin", usage: "[--wasm <path>]", summary: "Publish the Rust\u2192WASM contract to your tenant (one-time).", flags: [["--wasm <path>", "Path to blindfold_proxy.wasm (defaults to the bundled build)."]], examples: ["blindfold publish"] },
1629
1630
  { name: "status", group: "\u{1F4E6} Enclave & admin", usage: "", summary: "One-glance overview: mode, tenant health, and the list of sealed secrets.", examples: ["blindfold status"] },
@@ -1673,27 +1674,29 @@ function renderMainHelp() {
1673
1674
  ];
1674
1675
  const nameW = Math.min(12, COMMANDS.reduce((m, cmd) => Math.max(m, vlen(cmd.name)), 0));
1675
1676
  const descW = Math.max(16, w - 4 - nameW - 2);
1677
+ const fit = (s, max) => s.length > max ? s.slice(0, Math.max(1, max - 1)) + "\u2026" : s;
1676
1678
  for (const group of GROUP_ORDER) {
1677
1679
  const cmds = COMMANDS.filter((cmd) => cmd.group === group);
1678
1680
  const lines = [];
1679
- for (const cmd of cmds) {
1681
+ for (const [idx, cmd] of cmds.entries()) {
1682
+ if (idx > 0) lines.push("");
1680
1683
  const dl = wrapText(cmd.summary, descW);
1681
- lines.push(pad(c.cyan(cmd.name), nameW) + " " + (dl[0] ?? ""));
1682
- for (let i = 1; i < dl.length; i++) lines.push(pad("", nameW) + " " + c.gray(dl[i] ?? ""));
1683
- if (cmd.usage) {
1684
- lines.push(pad("", nameW) + " " + c.gray("\u21B3 blindfold " + cmd.name + " " + cmd.usage));
1685
- }
1684
+ lines.push(pad(c.bold(c.cyan(cmd.name)), nameW) + " " + (dl[0] ?? ""));
1685
+ for (let i = 1; i < dl.length; i++) lines.push(pad("", nameW) + " " + (dl[i] ?? ""));
1686
+ const ex = fit(cmd.examples?.[0] ?? `blindfold ${cmd.name}`, descW - 5);
1687
+ lines.push(pad("", nameW) + " " + c.gray("e.g. ") + c.green(ex));
1686
1688
  }
1687
1689
  out.push(boxLines(group, lines));
1688
1690
  out.push("");
1689
1691
  }
1690
1692
  out.push(
1691
- c.bold("Quick start"),
1692
- ` ${c.cyan("blindfold signup --email you@x.com")} ${c.gray("# create a funded testnet tenant")}`,
1693
- ` ${c.cyan("blindfold register --name openai_api_key")}`,
1694
- ` ${c.cyan("blindfold proxy")} ${c.gray("# point your agent at http://127.0.0.1:8787")}`,
1693
+ c.bold(c.magenta("\u25B6 Quick start")),
1694
+ ` ${c.green("blindfold signup --email you@x.com")} ${c.gray("# create a funded testnet tenant")}`,
1695
+ ` ${c.green("blindfold register --name openai_api_key")} ${c.gray("# seal a key (hidden prompt)")}`,
1696
+ ` ${c.green("blindfold proxy")} ${c.gray("# point your agent at http://127.0.0.1:8787")}`,
1695
1697
  "",
1696
- `${c.gray("Details for any command:")} ${c.cyan("blindfold <command> --help")} ${c.gray("\xB7")} ${c.gray("Docs:")} ${c.cyan("npmjs.com/package/@fiscalmindset/blindfold")}`,
1698
+ `${c.gray("Full flags + more examples for any command:")} ${c.cyan("blindfold <command> --help")}`,
1699
+ `${c.gray("Docs:")} ${c.cyan("npmjs.com/package/@fiscalmindset/blindfold")}`,
1697
1700
  ""
1698
1701
  );
1699
1702
  return out.join("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiscalmindset/blindfold",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "description": "Make any AI agent's API keys un-leakable, by sealing them inside a Terminal 3 TDX enclave.",
6
6
  "license": "MIT",
package/src/help.ts CHANGED
@@ -139,17 +139,18 @@ export const COMMANDS: CmdDef[] = [
139
139
  // ── Team & sharing ───────────────────────────────────────────────────────
140
140
  {
141
141
  name: "grant", group: "👥 Team & sharing", usage: "--host <host>[,<host2>...]",
142
- summary: "Authorize the contract to call these hosts (required before proxy/in-enclave can reach them).",
143
- flags: [["--host <host,...>", "Comma-separated egress hosts to allow (additive)."]],
142
+ summary: "Allow the enclave to reach an API's server. Do this once per API before the proxy can call it — e.g. allow api.openai.com so a sealed OpenAI key can be used.",
143
+ flags: [["--host <host,...>", "The API hostname(s) to allow, comma-separated. Each grant adds to the list."]],
144
144
  examples: ["blindfold grant --host api.openai.com", "blindfold grant --host api.github.com,api.stripe.com"],
145
+ notes: "Why it's needed: the enclave refuses to call any host you haven't allowed (deny-by-default). Grant the host of each API whose key you've sealed.",
145
146
  },
146
147
  {
147
148
  name: "share", group: "👥 Team & sharing", usage: "--to <agent-did> --host <host>[,...]",
148
- summary: "Let a teammate's agent USE your sealed keys for a hostforward only, never the plaintext.",
149
- flags: [["--to <agent-did>", "The teammate's agent DID to authorize."], ["--host <host,...>", "Hosts they may reach through the enclave."]],
150
- examples: ["blindfold share --to did:t3n:… --host api.openai.com"],
149
+ summary: "Let a teammate use your sealed key for an APIthey can make calls but never see the key itself.",
150
+ flags: [["--to <agent-did>", "The teammate's agent DID (their Terminal 3 identity)."], ["--host <host,...>", "Which API hosts they're allowed to reach through your enclave."]],
151
+ examples: ["blindfold share --to did:t3n:abc… --host api.openai.com"],
151
152
  },
152
- { name: "revoke", group: "👥 Team & sharing", usage: "--to <agent-did>", summary: "Remove a teammate's access — immediate and complete.", flags: [["--to <agent-did>", "The teammate's agent DID to revoke."]], examples: ["blindfold revoke --to did:t3n:…"] },
153
+ { name: "revoke", group: "👥 Team & sharing", usage: "--to <agent-did>", summary: "Take back a teammate's access you granted with `share` — immediate and complete.", flags: [["--to <agent-did>", "The teammate's agent DID to cut off."]], examples: ["blindfold revoke --to did:t3n:abc…"] },
153
154
 
154
155
  // ── Enclave & admin ──────────────────────────────────────────────────────
155
156
  { name: "publish", group: "📦 Enclave & admin", usage: "[--wasm <path>]", summary: "Publish the Rust→WASM contract to your tenant (one-time).", flags: [["--wasm <path>", "Path to blindfold_proxy.wasm (defaults to the bundled build)."]], examples: ["blindfold publish"] },
@@ -203,29 +204,33 @@ export function renderMainHelp(): string {
203
204
 
204
205
  const nameW = Math.min(12, COMMANDS.reduce((m, cmd) => Math.max(m, vlen(cmd.name)), 0));
205
206
  const descW = Math.max(16, w - 4 - nameW - 2);
207
+ const fit = (s: string, max: number): string => (s.length > max ? s.slice(0, Math.max(1, max - 1)) + "…" : s);
206
208
 
207
209
  for (const group of GROUP_ORDER) {
208
210
  const cmds = COMMANDS.filter((cmd) => cmd.group === group);
209
211
  const lines: string[] = [];
210
- for (const cmd of cmds) {
212
+ for (const [idx, cmd] of cmds.entries()) {
213
+ if (idx > 0) lines.push(""); // breathing room between commands
211
214
  const dl = wrapText(cmd.summary, descW);
212
- lines.push(pad(c.cyan(cmd.name), nameW) + " " + (dl[0] ?? ""));
213
- for (let i = 1; i < dl.length; i++) lines.push(pad("", nameW) + " " + c.gray(dl[i] ?? ""));
214
- if (cmd.usage) {
215
- lines.push(pad("", nameW) + " " + c.gray("↳ blindfold " + cmd.name + " " + cmd.usage));
216
- }
215
+ // command name (bright) + summary
216
+ lines.push(pad(c.bold(c.cyan(cmd.name)), nameW) + " " + (dl[0] ?? ""));
217
+ for (let i = 1; i < dl.length; i++) lines.push(pad("", nameW) + " " + (dl[i] ?? ""));
218
+ // one concrete example the fastest way to "get" the command
219
+ const ex = fit(cmd.examples?.[0] ?? `blindfold ${cmd.name}`, descW - 5);
220
+ lines.push(pad("", nameW) + " " + c.gray("e.g. ") + c.green(ex));
217
221
  }
218
222
  out.push(boxLines(group, lines));
219
223
  out.push("");
220
224
  }
221
225
 
222
226
  out.push(
223
- c.bold("Quick start"),
224
- ` ${c.cyan("blindfold signup --email you@x.com")} ${c.gray("# create a funded testnet tenant")}`,
225
- ` ${c.cyan("blindfold register --name openai_api_key")}`,
226
- ` ${c.cyan("blindfold proxy")} ${c.gray("# point your agent at http://127.0.0.1:8787")}`,
227
+ c.bold(c.magenta("Quick start")),
228
+ ` ${c.green("blindfold signup --email you@x.com")} ${c.gray("# create a funded testnet tenant")}`,
229
+ ` ${c.green("blindfold register --name openai_api_key")} ${c.gray("# seal a key (hidden prompt)")}`,
230
+ ` ${c.green("blindfold proxy")} ${c.gray("# point your agent at http://127.0.0.1:8787")}`,
227
231
  "",
228
- `${c.gray("Details for any command:")} ${c.cyan("blindfold <command> --help")} ${c.gray("·")} ${c.gray("Docs:")} ${c.cyan("npmjs.com/package/@fiscalmindset/blindfold")}`,
232
+ `${c.gray("Full flags + more examples for any command:")} ${c.cyan("blindfold <command> --help")}`,
233
+ `${c.gray("Docs:")} ${c.cyan("npmjs.com/package/@fiscalmindset/blindfold")}`,
229
234
  "",
230
235
  );
231
236
  return out.join("\n");