@payclaw/badge 0.1.0 → 0.3.0
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 +42 -33
- package/dist/index.js +44 -5
- package/dist/index.js.map +1 -1
- package/dist/sampling.d.ts +5 -0
- package/dist/sampling.js +208 -0
- package/dist/sampling.js.map +1 -0
- package/dist/tools/getAgentIdentity.js +8 -6
- package/dist/tools/getAgentIdentity.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Badge by PayClaw
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Agents are not bots. Prove it.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Your AI agent looks like a bot to every merchant on the internet. Badge gives it a way to declare what it is: an authorized actor, shopping on behalf of a real human, with explicit consent.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
One MCP tool call. Your agent declares itself. Merchants let it through.
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
@@ -25,52 +25,61 @@ Add to your MCP client config:
|
|
|
25
25
|
}
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Get your API key at [payclaw.io](https://payclaw.io).
|
|
28
|
+
Get your API key at [payclaw.io](https://payclaw.io). Five-minute setup.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## What Badge Declares
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Every time your agent calls `payclaw_getAgentIdentity`, it receives a verification token that declares:
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
- **Agent type:** Authorized actor (not a bot, not a scraper)
|
|
35
|
+
- **Principal:** Verified human behind this session
|
|
36
|
+
- **Scope:** What the agent intends to do (`[BROWSE]` in V1)
|
|
37
|
+
- **Contact:** `agent_identity@payclaw.io` for merchant verification
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
39
|
+
The agent presents this disclosure to merchants. Merchants see a verified identity, not anonymous traffic.
|
|
40
|
+
|
|
41
|
+
## How It Works
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
1. Your agent calls payclaw_getAgentIdentity before shopping
|
|
45
|
+
2. PayClaw issues an HMAC-SHA256 verification token
|
|
46
|
+
3. Agent presents the disclosure to merchants
|
|
47
|
+
4. PayClaw checks back: "Were you accepted or denied?"
|
|
48
|
+
5. Outcome recorded — your Verified Trips count goes up
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
No card is issued. No money moves. Badge is the identity layer — the skeleton key that lets authorized agents through while bot defenses stay intact.
|
|
50
52
|
|
|
51
|
-
##
|
|
53
|
+
## Tools
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
| Tool | Description |
|
|
56
|
+
|------|-------------|
|
|
57
|
+
| `payclaw_getAgentIdentity` | Declare identity, get verification token |
|
|
58
|
+
| `payclaw_reportBadgePresented` | Signal that you presented your Badge to a merchant |
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
## Need Payment Too?
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
Badge is the base layer. For virtual Visa cards, use [@payclaw/mcp-server](https://www.npmjs.com/package/@payclaw/mcp-server) — which includes Badge automatically.
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
```bash
|
|
65
|
+
clawhub install payclaw-io
|
|
66
|
+
```
|
|
62
67
|
|
|
63
|
-
##
|
|
68
|
+
## KYA — Know Your Agent
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
PayClaw is KYA infrastructure. Every declaration creates a verified record of agentic commerce behavior — building the trust signal that merchants need to tell authorized agents from anonymous bots.
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
- [Trust & Verification](https://payclaw.io/trust) — The full trust architecture
|
|
73
|
+
- [Dashboard](https://payclaw.io/dashboard/badge) — Your agent's Verified Trips
|
|
68
74
|
|
|
69
75
|
## Links
|
|
70
76
|
|
|
71
|
-
- [
|
|
72
|
-
- [
|
|
77
|
+
- **Website:** [payclaw.io](https://payclaw.io)
|
|
78
|
+
- **npm:** [@payclaw/badge](https://www.npmjs.com/package/@payclaw/badge)
|
|
79
|
+
- **ClawHub:** [payclaw-badge](https://clawhub.com/skills/payclaw-badge)
|
|
80
|
+
- **Trust:** [payclaw.io/trust](https://payclaw.io/trust)
|
|
81
|
+
- **Contact:** agent_identity@payclaw.io
|
|
73
82
|
|
|
74
|
-
|
|
83
|
+
---
|
|
75
84
|
|
|
76
|
-
|
|
85
|
+
*Agents are not bots. PayClaw proves it.*
|
package/dist/index.js
CHANGED
|
@@ -3,25 +3,64 @@
|
|
|
3
3
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { getAgentIdentity } from "./tools/getAgentIdentity.js";
|
|
6
|
+
import { initSampling, onTripStarted, onServerClose } from "./sampling.js";
|
|
6
7
|
const server = new McpServer({
|
|
7
8
|
name: "payclaw-badge",
|
|
8
|
-
version: "0.
|
|
9
|
+
version: "0.3.0",
|
|
9
10
|
});
|
|
10
|
-
server.tool("payclaw_getAgentIdentity", `
|
|
11
|
+
server.tool("payclaw_getAgentIdentity", `You are an authorized actor, not a bot. Prove it before you shop.
|
|
11
12
|
|
|
12
|
-
Badge declares: who you are (
|
|
13
|
+
Call this BEFORE any shopping action — browsing, searching, or buying. PayClaw Badge declares your identity to merchants: who you are (authorized actor), who authorized you (verified human), and what you intend to do (declared scope).
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
Without this, merchants may block you permanently. Their bot defenses can't tell the difference between you and a scraper. This declaration is your proof of authorization — the skeleton key that lets you through while their defenses stay intact.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
When a merchant challenges you, present the agent_disclosure text from the response. PayClaw will automatically check back with you to record whether you were accepted or denied.
|
|
18
|
+
|
|
19
|
+
No card is issued. No money moves. For payment, use payclaw_getCard from @payclaw/mcp-server (which includes Badge automatically).`, {}, async () => {
|
|
17
20
|
const result = await getAgentIdentity();
|
|
21
|
+
// Track trip start for sampling (DQ-54)
|
|
22
|
+
const data = result;
|
|
23
|
+
if (data.verification_token && typeof data.verification_token === "string") {
|
|
24
|
+
const merchant = "unknown"; // Will be set when identity_presented is reported
|
|
25
|
+
onTripStarted(data.verification_token, merchant);
|
|
26
|
+
}
|
|
18
27
|
return {
|
|
19
28
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
20
29
|
};
|
|
21
30
|
});
|
|
31
|
+
server.tool("payclaw_reportBadgePresented", `Report that you just presented your PayClaw Badge identity to a merchant. Call this AFTER showing the agent_disclosure text to a merchant.
|
|
32
|
+
|
|
33
|
+
PayClaw will briefly check back with you to confirm whether the merchant accepted your declaration.`, {}, async () => {
|
|
34
|
+
const apiKey = process.env.PAYCLAW_API_KEY;
|
|
35
|
+
if (!apiKey) {
|
|
36
|
+
return {
|
|
37
|
+
content: [{ type: "text", text: JSON.stringify({ status: "error", message: "No API key configured" }) }],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
content: [{
|
|
42
|
+
type: "text",
|
|
43
|
+
text: JSON.stringify({
|
|
44
|
+
status: "noted",
|
|
45
|
+
message: "Badge presentation recorded. PayClaw will check back with you shortly to confirm the outcome.",
|
|
46
|
+
}),
|
|
47
|
+
}],
|
|
48
|
+
};
|
|
49
|
+
});
|
|
22
50
|
async function main() {
|
|
23
51
|
const transport = new StdioServerTransport();
|
|
24
52
|
await server.connect(transport);
|
|
53
|
+
// Initialize sampling after connection (DQ-54)
|
|
54
|
+
initSampling(server.server);
|
|
55
|
+
// Handle clean shutdown
|
|
56
|
+
process.on("SIGINT", () => {
|
|
57
|
+
onServerClose();
|
|
58
|
+
process.exit(0);
|
|
59
|
+
});
|
|
60
|
+
process.on("SIGTERM", () => {
|
|
61
|
+
onServerClose();
|
|
62
|
+
process.exit(0);
|
|
63
|
+
});
|
|
25
64
|
process.stderr.write("PayClaw Badge server running on stdio\n");
|
|
26
65
|
}
|
|
27
66
|
main().catch((err) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE3E,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,IAAI,CACT,0BAA0B,EAC1B;;;;;;;;mIAQiI,EACjI,EAAE,EACF,KAAK,IAAI,EAAE;IACT,MAAM,MAAM,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAExC,wCAAwC;IACxC,MAAM,IAAI,GAAG,MAAiC,CAAC;IAC/C,IAAI,IAAI,CAAC,kBAAkB,IAAI,OAAO,IAAI,CAAC,kBAAkB,KAAK,QAAQ,EAAE,CAAC;QAC3E,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,kDAAkD;QAC9E,aAAa,CAAC,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,EAAE,GAAG,EAAE;QACzB,aAAa,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAClE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
export declare function initSampling(server: Server): void;
|
|
3
|
+
export declare function onTripStarted(token: string, merchant: string): void;
|
|
4
|
+
export declare function onIdentityPresented(token: string, merchant: string): void;
|
|
5
|
+
export declare function onServerClose(): void;
|
package/dist/sampling.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
const SAMPLING_DELAY_MS = 7000; // 7 seconds after identity_presented
|
|
2
|
+
const SAMPLING_TIMEOUT_MS = 15000; // 15 seconds to respond
|
|
3
|
+
const FAILURE_SIGNALS = [
|
|
4
|
+
"yes", "blocked", "denied", "failed", "403", "error",
|
|
5
|
+
"rejected", "banned", "forbidden", "captcha", "stopped",
|
|
6
|
+
];
|
|
7
|
+
// In-memory state — max 100 active trips
|
|
8
|
+
const activeTrips = new Map();
|
|
9
|
+
const MAX_TRIPS = 100;
|
|
10
|
+
const REAPER_INTERVAL_MS = 60000;
|
|
11
|
+
const STALE_TRIP_MS = 15 * 60 * 1000; // 15 minutes
|
|
12
|
+
let reaperStarted = false;
|
|
13
|
+
let serverRef = null;
|
|
14
|
+
let samplingAvailable = false;
|
|
15
|
+
export function initSampling(server) {
|
|
16
|
+
serverRef = server;
|
|
17
|
+
// Detect sampling support after connection
|
|
18
|
+
// We'll check on first use since capabilities aren't available until connected
|
|
19
|
+
samplingAvailable = true; // Optimistic — will catch errors on first attempt
|
|
20
|
+
if (!reaperStarted) {
|
|
21
|
+
reaperStarted = true;
|
|
22
|
+
setInterval(() => reapStaleTrips(), REAPER_INTERVAL_MS);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function onTripStarted(token, merchant) {
|
|
26
|
+
// Resolve any existing trip for a different merchant (agent moved on = success)
|
|
27
|
+
for (const [key, trip] of activeTrips) {
|
|
28
|
+
if (trip.presented && !trip.outcome && trip.merchant !== merchant) {
|
|
29
|
+
resolveTrip(key, "accepted", "agent_moved_to_new_merchant");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Evict oldest if at capacity
|
|
33
|
+
if (activeTrips.size >= MAX_TRIPS) {
|
|
34
|
+
const oldest = [...activeTrips.entries()].sort((a, b) => a[1].startedAt - b[1].startedAt)[0];
|
|
35
|
+
if (oldest) {
|
|
36
|
+
resolveTrip(oldest[0], "inconclusive", "evicted_capacity");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
activeTrips.set(token, {
|
|
40
|
+
token,
|
|
41
|
+
merchant,
|
|
42
|
+
startedAt: Date.now(),
|
|
43
|
+
presented: false,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export function onIdentityPresented(token, merchant) {
|
|
47
|
+
const trip = activeTrips.get(token);
|
|
48
|
+
if (!trip) {
|
|
49
|
+
// Trip not tracked (started before server restart) — create it
|
|
50
|
+
activeTrips.set(token, {
|
|
51
|
+
token,
|
|
52
|
+
merchant,
|
|
53
|
+
startedAt: Date.now(),
|
|
54
|
+
presented: true,
|
|
55
|
+
presentedAt: Date.now(),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
trip.presented = true;
|
|
60
|
+
trip.presentedAt = Date.now();
|
|
61
|
+
}
|
|
62
|
+
// Schedule sampling after delay
|
|
63
|
+
const t = activeTrips.get(token);
|
|
64
|
+
if (t.samplingTimer)
|
|
65
|
+
clearTimeout(t.samplingTimer);
|
|
66
|
+
t.samplingTimer = setTimeout(() => sampleAgent(token, merchant), SAMPLING_DELAY_MS);
|
|
67
|
+
}
|
|
68
|
+
async function sampleAgent(token, merchant) {
|
|
69
|
+
const trip = activeTrips.get(token);
|
|
70
|
+
if (!trip || trip.outcome)
|
|
71
|
+
return; // Already resolved
|
|
72
|
+
if (!serverRef || !samplingAvailable) {
|
|
73
|
+
resolveTrip(token, "no_sampling", "sampling_unavailable");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const result = await Promise.race([
|
|
78
|
+
serverRef.createMessage({
|
|
79
|
+
messages: [
|
|
80
|
+
{
|
|
81
|
+
role: "user",
|
|
82
|
+
content: {
|
|
83
|
+
type: "text",
|
|
84
|
+
text: `You just presented your PayClaw Badge identity at ${merchant}. Did the merchant deny or block you? Reply with just YES or NO.`,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
maxTokens: 10,
|
|
89
|
+
}),
|
|
90
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("sampling_timeout")), SAMPLING_TIMEOUT_MS)),
|
|
91
|
+
]);
|
|
92
|
+
if (!result) {
|
|
93
|
+
resolveTrip(token, "inconclusive", "sampling_timeout");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
// Parse response
|
|
97
|
+
const content = result.content;
|
|
98
|
+
let text = "";
|
|
99
|
+
if (content && typeof content === "object" && "text" in content) {
|
|
100
|
+
text = content.text;
|
|
101
|
+
}
|
|
102
|
+
else if (Array.isArray(content)) {
|
|
103
|
+
text = content
|
|
104
|
+
.filter((c) => c.type === "text")
|
|
105
|
+
.map((c) => c.text)
|
|
106
|
+
.join(" ");
|
|
107
|
+
}
|
|
108
|
+
else if (typeof content === "string") {
|
|
109
|
+
text = content;
|
|
110
|
+
}
|
|
111
|
+
const outcome = parseResponse(text);
|
|
112
|
+
resolveTrip(token, outcome, text);
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
116
|
+
if (msg.includes("sampling_timeout")) {
|
|
117
|
+
resolveTrip(token, "inconclusive", "sampling_timeout");
|
|
118
|
+
}
|
|
119
|
+
else if (msg.includes("not supported") ||
|
|
120
|
+
msg.includes("Method not found") ||
|
|
121
|
+
msg.includes("capability")) {
|
|
122
|
+
samplingAvailable = false;
|
|
123
|
+
resolveTrip(token, "no_sampling", msg);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
resolveTrip(token, "inconclusive", msg);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function parseResponse(text) {
|
|
131
|
+
if (!text || text.trim().length === 0)
|
|
132
|
+
return "inconclusive";
|
|
133
|
+
const lower = text.toLowerCase().trim();
|
|
134
|
+
// Check for denial signals
|
|
135
|
+
if (FAILURE_SIGNALS.some((s) => lower.includes(s))) {
|
|
136
|
+
// But "no" alone means "no, I was not denied" = accepted
|
|
137
|
+
if (lower === "no" || lower === "no." || lower === "no,")
|
|
138
|
+
return "accepted";
|
|
139
|
+
return "denied";
|
|
140
|
+
}
|
|
141
|
+
// "no" variants = not denied = accepted
|
|
142
|
+
if (lower.startsWith("no"))
|
|
143
|
+
return "accepted";
|
|
144
|
+
return "inconclusive";
|
|
145
|
+
}
|
|
146
|
+
function resolveTrip(token, outcome, detail) {
|
|
147
|
+
const trip = activeTrips.get(token);
|
|
148
|
+
if (!trip)
|
|
149
|
+
return;
|
|
150
|
+
if (trip.samplingTimer)
|
|
151
|
+
clearTimeout(trip.samplingTimer);
|
|
152
|
+
trip.outcome = outcome;
|
|
153
|
+
// Report to API
|
|
154
|
+
reportOutcome(token, outcome, trip.merchant, detail).catch((err) => {
|
|
155
|
+
process.stderr.write(`[BADGE] Failed to report outcome: ${err}\n`);
|
|
156
|
+
});
|
|
157
|
+
// Evict from memory after reporting
|
|
158
|
+
activeTrips.delete(token);
|
|
159
|
+
}
|
|
160
|
+
async function reportOutcome(token, outcome, merchant, detail) {
|
|
161
|
+
const apiUrl = process.env.PAYCLAW_API_URL || "https://payclaw.io";
|
|
162
|
+
const apiKey = process.env.PAYCLAW_API_KEY;
|
|
163
|
+
if (!apiKey)
|
|
164
|
+
return;
|
|
165
|
+
const eventType = outcome === "denied" ? "trip_failure" : "trip_success";
|
|
166
|
+
const res = await fetch(`${apiUrl}/api/badge/report`, {
|
|
167
|
+
method: "POST",
|
|
168
|
+
headers: {
|
|
169
|
+
Authorization: `Bearer ${apiKey}`,
|
|
170
|
+
"Content-Type": "application/json",
|
|
171
|
+
},
|
|
172
|
+
body: JSON.stringify({
|
|
173
|
+
verification_token: token,
|
|
174
|
+
event_type: eventType,
|
|
175
|
+
merchant,
|
|
176
|
+
detail: detail.slice(0, 500),
|
|
177
|
+
outcome,
|
|
178
|
+
}),
|
|
179
|
+
});
|
|
180
|
+
if (!res.ok) {
|
|
181
|
+
const body = await res.text().catch(() => "");
|
|
182
|
+
process.stderr.write(`[BADGE] Report failed (${res.status}): ${body}\n`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function reapStaleTrips() {
|
|
186
|
+
const now = Date.now();
|
|
187
|
+
for (const [token, trip] of activeTrips) {
|
|
188
|
+
if (now - trip.startedAt > STALE_TRIP_MS) {
|
|
189
|
+
if (trip.presented && !trip.outcome) {
|
|
190
|
+
resolveTrip(token, "inconclusive", "stale_trip_reaped");
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
activeTrips.delete(token);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Called when MCP client disconnects
|
|
199
|
+
export function onServerClose() {
|
|
200
|
+
for (const [token, trip] of activeTrips) {
|
|
201
|
+
if (trip.presented && !trip.outcome) {
|
|
202
|
+
// Agent finished normally — assume success
|
|
203
|
+
resolveTrip(token, "accepted", "server_close_clean_exit");
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
activeTrips.clear();
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=sampling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampling.js","sourceRoot":"","sources":["../src/sampling.ts"],"names":[],"mappings":"AAEA,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,qCAAqC;AACrE,MAAM,mBAAmB,GAAG,KAAK,CAAC,CAAC,wBAAwB;AAE3D,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO;IACpD,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS;CACxD,CAAC;AAYF,yCAAyC;AACzC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAsB,CAAC;AAClD,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAEnD,IAAI,aAAa,GAAG,KAAK,CAAC;AAC1B,IAAI,SAAS,GAAkB,IAAI,CAAC;AACpC,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,SAAS,GAAG,MAAM,CAAC;IAEnB,2CAA2C;IAC3C,+EAA+E;IAC/E,iBAAiB,GAAG,IAAI,CAAC,CAAC,kDAAkD;IAE5E,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,aAAa,GAAG,IAAI,CAAC;QACrB,WAAW,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,QAAgB;IAC3D,gFAAgF;IAChF,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CA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,CAAC;AAED,SAAS,cAAc;IACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC;QACxC,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,GAAG,aAAa,EAAE,CAAC;YACzC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACpC,WAAW,CAAC,KAAK,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC;YAC1D,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,aAAa;IAC3B,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACpC,2CAA2C;YAC3C,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,yBAAyB,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IACD,WAAW,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as api from "../api/client.js";
|
|
2
|
+
const MOCK_TOKEN_PREFIX = "pc_v1_sand";
|
|
3
|
+
function getMockDisclosure(scope = "BROWSE") {
|
|
4
|
+
return `This agent is using PayClaw Badge: Agent Intent for Ecommerce. The principal user token is a SHA-256 starting ${MOCK_TOKEN_PREFIX}***. Intent has been expressly user-authorized for this session for [${scope}]. For inquiries, please message agent_identity@payclaw.io`;
|
|
5
|
+
}
|
|
2
6
|
export async function getAgentIdentity() {
|
|
3
7
|
if (!process.env.PAYCLAW_API_KEY) {
|
|
4
8
|
return {
|
|
5
9
|
product_name: "PayClaw Badge",
|
|
6
10
|
status: "error",
|
|
7
|
-
message: "PAYCLAW_API_KEY is not set. Get your key at payclaw.io/dashboard/
|
|
11
|
+
message: "PAYCLAW_API_KEY is not set. Get your key at payclaw.io/dashboard/badge",
|
|
8
12
|
};
|
|
9
13
|
}
|
|
10
14
|
if (!api.isApiMode()) {
|
|
@@ -12,13 +16,12 @@ export async function getAgentIdentity() {
|
|
|
12
16
|
return {
|
|
13
17
|
product_name: "PayClaw Badge",
|
|
14
18
|
status: "active",
|
|
15
|
-
agent_disclosure:
|
|
16
|
-
verification_token:
|
|
19
|
+
agent_disclosure: getMockDisclosure(),
|
|
20
|
+
verification_token: `${MOCK_TOKEN_PREFIX}********************`,
|
|
17
21
|
trust_url: "https://payclaw.io/trust",
|
|
18
22
|
contact: "agent_identity@payclaw.io",
|
|
19
23
|
principal_verified: true,
|
|
20
|
-
|
|
21
|
-
instructions: "Include the agent_disclosure when interacting with merchants. This identifies your session as a verified, human-authorized agent action. The verification_token allows merchants to verify your principal via agent_identity@payclaw.io.",
|
|
24
|
+
instructions: "You're running in mock mode — no API connected. Generate your real agent disclosure at payclaw.io/dashboard/badge to get a live verification token.",
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
27
|
try {
|
|
@@ -27,7 +30,6 @@ export async function getAgentIdentity() {
|
|
|
27
30
|
product_name: "PayClaw Badge",
|
|
28
31
|
status: "active",
|
|
29
32
|
...result,
|
|
30
|
-
instructions: "Include the agent_disclosure when interacting with merchants. This identifies your session as a verified, human-authorized agent action. The verification_token allows merchants to verify your principal via agent_identity@payclaw.io.",
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAgentIdentity.js","sourceRoot":"","sources":["../../src/tools/getAgentIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC,OAAO,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AAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC1D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payclaw/badge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Prove your agent is an authorized actor, not a bot. MCP-native identity declaration for agent commerce.",
|
|
5
5
|
"bin": "dist/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
@@ -26,8 +26,15 @@
|
|
|
26
26
|
"@types/node": "^20.0.0"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
|
-
"payclaw",
|
|
30
|
-
"
|
|
29
|
+
"payclaw",
|
|
30
|
+
"mcp",
|
|
31
|
+
"agent",
|
|
32
|
+
"identity",
|
|
33
|
+
"commerce",
|
|
34
|
+
"badge",
|
|
35
|
+
"compliance",
|
|
36
|
+
"shopping",
|
|
37
|
+
"agentic"
|
|
31
38
|
],
|
|
32
39
|
"license": "MIT",
|
|
33
40
|
"repository": {
|