tersign 0.4.6 → 0.4.7

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/cli.js CHANGED
@@ -3,13 +3,21 @@ const sub = process.argv[2];
3
3
  if (sub === undefined || sub === 'mcp') {
4
4
  if (sub === 'mcp')
5
5
  process.argv.splice(2, 1);
6
- // Bare `npx tersign` with no config is almost always a curious human, not an MCP client —
7
- // greet them with the wiring instructions instead of a stack trace.
8
- if (!process.env.TERSIGN_SELLER_KEY) {
9
- console.error('tersign: this command starts the MCP server, which needs TERSIGN_SELLER_KEY set.\n\n' +
10
- 'Wire it into your MCP client config:\n' +
11
- ' { "mcpServers": { "tersign": { "command": "npx", "args": ["tersign"],\n' +
12
- ' "env": { "TERSIGN_SELLER_KEY": "0x<your-seller-key>" } } } }\n\n' +
6
+ // Bare `npx tersign` at a prompt is almost always a curious human, not an MCP client — greet
7
+ // them rather than sitting mute on a stdio transport they are not speaking. The discriminator
8
+ // is the TTY, NOT the presence of a key: an MCP client, a directory's sandbox and a CI probe
9
+ // all arrive with stdin piped, and until 2026-08-29 every one of them hit a hard exit here.
10
+ // That made `npx tersign` fail on first run for anyone who had not already exported a key,
11
+ // left the server impossible to introspect or demonstrate anywhere, and contradicted
12
+ // record_disclosure's own published promise that the first call self-provisions. The key is
13
+ // no longer required — envDeps resolves through the shared keystore — so the greeting is now
14
+ // a courtesy for humans instead of a gate on everyone.
15
+ if (process.stdin.isTTY && !process.env.TERSIGN_SELLER_KEY) {
16
+ console.error('tersign: this starts the MCP server, which speaks JSON-RPC over stdin — nothing to see\n' +
17
+ 'at a prompt. Wire it into your MCP client config:\n\n' +
18
+ ' { "mcpServers": { "tersign": { "command": "npx", "args": ["tersign"] } } }\n\n' +
19
+ 'No key needed: the first call self-provisions a signer-keyed account (OS keychain,\n' +
20
+ 'else ~/.tersign/signer.key). Set TERSIGN_SELLER_KEY to use your own.\n\n' +
13
21
  "Just exploring? Try: tersign help · tersign verify <receipt.json | 0xdigest> [--ledger url]");
14
22
  process.exit(1);
15
23
  }
@@ -8,6 +8,6 @@ export declare function envDeps(env?: Record<string, string | undefined>): McpDe
8
8
  * every client; mcp.test.ts pins it against package.json so a release bump can't drift it. */
9
9
  export declare const MCP_SERVER_IDENTITY: {
10
10
  readonly name: "tersign";
11
- readonly version: "0.4.6";
11
+ readonly version: "0.4.7";
12
12
  };
13
13
  export declare function buildServer(deps: McpDeps): McpServer;
@@ -49,7 +49,7 @@ function json(value) {
49
49
  }
50
50
  /** MUST match package.json name/version — the MCP handshake self-reports this identity to
51
51
  * every client; mcp.test.ts pins it against package.json so a release bump can't drift it. */
52
- export const MCP_SERVER_IDENTITY = { name: 'tersign', version: '0.4.6' };
52
+ export const MCP_SERVER_IDENTITY = { name: 'tersign', version: '0.4.7' };
53
53
  export function buildServer(deps) {
54
54
  const server = new McpServer(MCP_SERVER_IDENTITY);
55
55
  server.registerTool('issue_receipt', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tersign",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Tersign \u2014 the evidence layer for the agent economy. Counter-signed receipts, agent action records, idempotency enforcement, refunds, disputes, and jury-ready evidence envelopes for x402/agent-commerce sellers.",
5
5
  "license": "MIT",
6
6
  "type": "module",