tersign 0.1.0 → 0.1.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.
- package/README.md +1 -1
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +23 -0
- package/dist/mcp/bin.js +0 -0
- package/dist/mcp/server.d.ts +6 -0
- package/dist/mcp/server.js +4 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install tersign
|
|
|
16
16
|
- **Evidence envelopes** — package any counter-signed record into a jury-ready submission for external venues (Internet Court slot format, Kleros ERC-1497, UMA claims): digests + a public verify URL, never raw evidence, with party statements structurally segregated from ledger-attested content.
|
|
17
17
|
- **Ledger client** — counter-signature + sequential hash-chaining + evidence-pack exports via the hosted Tersign ledger (optional; the SDK works standalone).
|
|
18
18
|
- **MCP server** — `npx tersign-mcp` exposes the full loop (issue / verify / refund / dispute) as Model Context Protocol tools for agent frameworks.
|
|
19
|
-
- **Third-party verification** — `npx tersign
|
|
19
|
+
- **Third-party verification** — `npx tersign verify <receipt.json | 0xdigest>` recovers signatures and checks the public chain with no account and no trust in Tersign. (Installed: `tersign-verify` works directly.)
|
|
20
20
|
|
|
21
21
|
## Quick start
|
|
22
22
|
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** tersign — the package-default bin, dispatching subcommands:
|
|
3
|
+
*
|
|
4
|
+
* npx tersign → MCP server on stdio (what MCP clients invoke; registry contract)
|
|
5
|
+
* npx tersign mcp → same, explicit
|
|
6
|
+
* npx tersign verify … → third-party receipt verification (same as tersign-verify)
|
|
7
|
+
*
|
|
8
|
+
* Why a dispatcher: `npx tersign-verify` resolves 'tersign-verify' as a PACKAGE name (E404 —
|
|
9
|
+
* npx only maps bare bin names for installed packages), so the uninstalled one-liner must go
|
|
10
|
+
* through the package-name bin. The dedicated tersign-verify / tersign-mcp bins still exist
|
|
11
|
+
* for installed use. */
|
|
12
|
+
export {};
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const sub = process.argv[2];
|
|
3
|
+
if (sub === undefined || sub === 'mcp') {
|
|
4
|
+
if (sub === 'mcp')
|
|
5
|
+
process.argv.splice(2, 1);
|
|
6
|
+
await import('./mcp/bin.js');
|
|
7
|
+
}
|
|
8
|
+
else if (sub === 'verify') {
|
|
9
|
+
process.argv.splice(2, 1);
|
|
10
|
+
await import('./verify-bin.js');
|
|
11
|
+
}
|
|
12
|
+
else if (sub === 'help' || sub === '--help' || sub === '-h') {
|
|
13
|
+
console.log('tersign — evidence layer for the agent economy\n\n' +
|
|
14
|
+
' tersign start the MCP server (stdio)\n' +
|
|
15
|
+
' tersign mcp same, explicit\n' +
|
|
16
|
+
' tersign verify <receipt.json | 0xdigest> [--signer 0xaddr] [--ledger url]\n' +
|
|
17
|
+
' verify a receipt: local signature recovery + public chain check\n');
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
console.error(`unknown subcommand '${sub}' — did you mean: tersign verify ${sub}\nrun 'tersign help' for usage`);
|
|
21
|
+
process.exit(2);
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/dist/mcp/bin.js
CHANGED
|
File without changes
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -4,4 +4,10 @@ import { type McpDeps } from './tools.js';
|
|
|
4
4
|
* (or its framework) can issue, verify, and chain receipts without importing the SDK.
|
|
5
5
|
* Config via env — see envDeps(). */
|
|
6
6
|
export declare function envDeps(env?: Record<string, string | undefined>): McpDeps;
|
|
7
|
+
/** MUST match package.json name/version — the MCP handshake self-reports this identity to
|
|
8
|
+
* every client; mcp.test.ts pins it against package.json so a release bump can't drift it. */
|
|
9
|
+
export declare const MCP_SERVER_IDENTITY: {
|
|
10
|
+
readonly name: "tersign";
|
|
11
|
+
readonly version: "0.1.2";
|
|
12
|
+
};
|
|
7
13
|
export declare function buildServer(deps: McpDeps): McpServer;
|
package/dist/mcp/server.js
CHANGED
|
@@ -43,8 +43,11 @@ export function envDeps(env = process.env) {
|
|
|
43
43
|
function json(value) {
|
|
44
44
|
return { content: [{ type: 'text', text: JSON.stringify(value, null, 2) }] };
|
|
45
45
|
}
|
|
46
|
+
/** MUST match package.json name/version — the MCP handshake self-reports this identity to
|
|
47
|
+
* every client; mcp.test.ts pins it against package.json so a release bump can't drift it. */
|
|
48
|
+
export const MCP_SERVER_IDENTITY = { name: 'tersign', version: '0.1.2' };
|
|
46
49
|
export function buildServer(deps) {
|
|
47
|
-
const server = new McpServer(
|
|
50
|
+
const server = new McpServer(MCP_SERVER_IDENTITY);
|
|
48
51
|
server.registerTool('issue_receipt', {
|
|
49
52
|
title: 'Issue signed receipt',
|
|
50
53
|
description: 'Issue an x402 offer-receipt (EIP-712) plus an Tersign compliance record for a settled payment; counter-signs into the ledger when configured.',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tersign",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"vitest": "^2.0.0"
|
|
28
28
|
},
|
|
29
29
|
"bin": {
|
|
30
|
+
"tersign": "dist/cli.js",
|
|
30
31
|
"tersign-mcp": "dist/mcp/bin.js",
|
|
31
32
|
"tersign-verify": "dist/verify-bin.js"
|
|
32
33
|
},
|
|
@@ -56,5 +57,6 @@
|
|
|
56
57
|
"ai-agents",
|
|
57
58
|
"mcp",
|
|
58
59
|
"audit-trail"
|
|
59
|
-
]
|
|
60
|
-
|
|
60
|
+
],
|
|
61
|
+
"mcpName": "io.github.tersignhq/evidence"
|
|
62
|
+
}
|