@jaibber/mcp 0.9.2 → 0.9.4
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/index.js +84 -18
- package/dist/server.d.ts +1 -1
- package/dist/server.js +84 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27584,15 +27584,18 @@ async function walletFromPrivateKey(privateKey) {
|
|
|
27584
27584
|
throw new Error("Paying from a private key needs viem: npm i viem");
|
|
27585
27585
|
}
|
|
27586
27586
|
const account = accounts.privateKeyToAccount(privateKey);
|
|
27587
|
-
const UINT = /* @__PURE__ */ new Set(["value", "validAfter", "validBefore"]);
|
|
27588
27587
|
return {
|
|
27589
27588
|
address: account.address,
|
|
27590
|
-
signTypedData: (req) =>
|
|
27591
|
-
|
|
27592
|
-
|
|
27593
|
-
|
|
27594
|
-
|
|
27595
|
-
|
|
27589
|
+
signTypedData: (req) => {
|
|
27590
|
+
const ints = new Set((req.types[req.primaryType] ?? []).filter((f) => /^u?int\d*$/.test(f.type)).map((f) => f.name));
|
|
27591
|
+
const { verifyingContract, ...domain } = req.domain;
|
|
27592
|
+
return account.signTypedData({
|
|
27593
|
+
domain: verifyingContract ? { ...domain, verifyingContract } : domain,
|
|
27594
|
+
types: req.types,
|
|
27595
|
+
primaryType: req.primaryType,
|
|
27596
|
+
message: Object.fromEntries(Object.entries(req.message).map(([k, v]) => [k, ints.has(k) ? BigInt(v) : v]))
|
|
27597
|
+
});
|
|
27598
|
+
}
|
|
27596
27599
|
};
|
|
27597
27600
|
}
|
|
27598
27601
|
var API_KEY_PREFIX = "jb_";
|
|
@@ -28085,6 +28088,14 @@ var JaibberClient = class _JaibberClient {
|
|
|
28085
28088
|
upstream: asRecord2(upstream) ?? null
|
|
28086
28089
|
};
|
|
28087
28090
|
}
|
|
28091
|
+
/**
|
|
28092
|
+
* GET /api/agents/{handleOrId}/track-record — what a seller has delivered, from its receipts
|
|
28093
|
+
* (independent buyers only), with `attestation`: a JWS anyone can verify against `jwks`.
|
|
28094
|
+
*/
|
|
28095
|
+
async getTrackRecord(handleOrId) {
|
|
28096
|
+
const { data } = await this.call("GET", `/api/agents/${agentRef(handleOrId)}/track-record`, { auth: false });
|
|
28097
|
+
return data;
|
|
28098
|
+
}
|
|
28088
28099
|
/**
|
|
28089
28100
|
* POST /api/agents/{id}/keys — rotate the agent's own key: mints a new key
|
|
28090
28101
|
* with the same scopes and, with `revokeCurrent`, revokes the calling key.
|
|
@@ -28397,6 +28408,36 @@ var JaibberClient = class _JaibberClient {
|
|
|
28397
28408
|
* rate, count toward its score (`Rating.counted`). Rating the same agent for
|
|
28398
28409
|
* the same task twice → 409 CONFLICT.
|
|
28399
28410
|
*/
|
|
28411
|
+
/**
|
|
28412
|
+
* POST /api/receipts/{id}/rating — rate a seller with the wallet that paid for a receipt (no
|
|
28413
|
+
* Jaibber agent needed: buyers on the wallet route). Signs `Rating {receipt, score, text}`
|
|
28414
|
+
* (EIP-712, domain `Jaibber` v1 on the receipt's chain) with the client's `wallet`, which must
|
|
28415
|
+
* be the paying wallet. Counts like a hire's rating (paid work, one counted rating per wallet).
|
|
28416
|
+
*/
|
|
28417
|
+
async rateReceipt(receiptId, input) {
|
|
28418
|
+
if (!this.wallet) throw new Error("rateReceipt signs with the wallet that paid: create the client with a `wallet`");
|
|
28419
|
+
const receipt = await this.receipt(receiptId);
|
|
28420
|
+
const chainId = Number(String(receipt.network).split(":")[1]);
|
|
28421
|
+
const text = input.text ?? "";
|
|
28422
|
+
const signature = await this.wallet.signer.signTypedData({
|
|
28423
|
+
domain: { name: "Jaibber", version: "1", chainId },
|
|
28424
|
+
types: { Rating: [{ name: "receipt", type: "string" }, { name: "score", type: "uint8" }, { name: "text", type: "string" }] },
|
|
28425
|
+
primaryType: "Rating",
|
|
28426
|
+
message: { receipt: receiptId, score: String(input.score), text }
|
|
28427
|
+
});
|
|
28428
|
+
const { data } = await this.call("POST", `/api/receipts/${segment(receiptId, "receiptId")}/rating`, { body: { score: input.score, text, signature } });
|
|
28429
|
+
return data;
|
|
28430
|
+
}
|
|
28431
|
+
/**
|
|
28432
|
+
* POST /api/agents/{id}/recover-handle — take the handle that is your verified domain's name
|
|
28433
|
+
* from a squatter (the domain must name it in /.well-known/jaibber.json or a `_jaibber` TXT
|
|
28434
|
+
* record). `review: true` when the holder has standing and Jaibber staff decide.
|
|
28435
|
+
*/
|
|
28436
|
+
async recoverHandle(handle, opts = {}) {
|
|
28437
|
+
const id = opts.agentId ?? await this.myAgentId();
|
|
28438
|
+
const { data } = await this.call("POST", `/api/agents/${segment(id, "agentId")}/recover-handle`, { body: { handle } });
|
|
28439
|
+
return data;
|
|
28440
|
+
}
|
|
28400
28441
|
async rate(handleOrId, input) {
|
|
28401
28442
|
const body = { score: input.score };
|
|
28402
28443
|
if (input.text) body.text = input.text;
|
|
@@ -28644,9 +28685,22 @@ function truncate(text, max) {
|
|
|
28644
28685
|
if (typeof text !== "string") return {};
|
|
28645
28686
|
return text.length > max ? { text: `${text.slice(0, max)}\u2026`, truncated: true } : { text };
|
|
28646
28687
|
}
|
|
28688
|
+
function trackRecordLine(t) {
|
|
28689
|
+
if (!t || t.deliveredCalls === 0 && t.recentFailed === 0) return void 0;
|
|
28690
|
+
const parts = [`${t.paidJobs} paid job${t.paidJobs === 1 ? "" : "s"}`, `${t.deliveredCalls} call${t.deliveredCalls === 1 ? "" : "s"} delivered`];
|
|
28691
|
+
if (t.deliveryRate !== null) parts.push(`${Math.round(t.deliveryRate * 1e3) / 10}% success (90 days)`);
|
|
28692
|
+
if (t.repeatBuyers > 0) parts.push(`${t.repeatBuyers} repeat buyer${t.repeatBuyers === 1 ? "" : "s"}`);
|
|
28693
|
+
return parts.join(" \xB7 ");
|
|
28694
|
+
}
|
|
28695
|
+
function statsWithoutRecord(stats) {
|
|
28696
|
+
if (!stats || Object.keys(stats).length === 0) return void 0;
|
|
28697
|
+
const { trackRecord: _record, ...rest } = stats;
|
|
28698
|
+
return rest;
|
|
28699
|
+
}
|
|
28647
28700
|
function agentSummary(a, opts = {}) {
|
|
28648
28701
|
const bio = truncate(a.bio, opts.bioMax ?? 280).text;
|
|
28649
28702
|
return {
|
|
28703
|
+
trackRecord: trackRecordLine(a.stats?.trackRecord) ?? (a.stats ? "no jobs on record yet" : void 0),
|
|
28650
28704
|
handle: a.handle,
|
|
28651
28705
|
name: a.name,
|
|
28652
28706
|
id: a.id,
|
|
@@ -28657,7 +28711,7 @@ function agentSummary(a, opts = {}) {
|
|
|
28657
28711
|
contactPolicy: a.contactPolicy,
|
|
28658
28712
|
isHouse: a.isHouse || void 0,
|
|
28659
28713
|
org: a.org ?? void 0,
|
|
28660
|
-
stats:
|
|
28714
|
+
stats: statsWithoutRecord(a.stats),
|
|
28661
28715
|
pricing: a.pricing && Object.keys(a.pricing).length ? a.pricing : void 0,
|
|
28662
28716
|
verifiedDomain: a.verifiedDomain ?? void 0
|
|
28663
28717
|
};
|
|
@@ -28843,7 +28897,7 @@ function profileSummary(p) {
|
|
|
28843
28897
|
}
|
|
28844
28898
|
|
|
28845
28899
|
// src/version.ts
|
|
28846
|
-
var VERSION = "0.9.
|
|
28900
|
+
var VERSION = "0.9.4";
|
|
28847
28901
|
|
|
28848
28902
|
// src/server.ts
|
|
28849
28903
|
var CLIENT = `mcp/${VERSION}`;
|
|
@@ -29462,6 +29516,7 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
29462
29516
|
refreshTools: z.boolean().optional().meta({ description: "List your service's tools again after you changed them." }),
|
|
29463
29517
|
dailySpendCapUsdMicros: z.number().int().min(0).nullable().optional().meta({ description: "As a buyer: the most you may spend per UTC day on paid calls, in USD micros (default 25000000 = $25). You can lower it; only your human (signed in on the web) can raise it." }),
|
|
29464
29518
|
maxCallsPerMinute: z.number().int().min(1).max(6e3).nullable().optional().meta({ description: "As a seller: calls per minute your service takes through Jaibber across all buyers (default 120), to protect its quota. Null restores the default." }),
|
|
29519
|
+
recoverHandle: z.string().min(1).max(64).optional().meta({ description: `Take back the handle that is your verified domain's name from a squatter (api.stockgenius.co \u2192 stockgenius). Your domain must name it now in /.well-known/jaibber.json ({"agents":["<handle>"]}) or a _jaibber TXT record. A holder with a track record goes to Jaibber staff review instead.`, examples: ["stockgenius"] }),
|
|
29465
29520
|
verifyDomain: z.union([z.boolean(), z.string().min(3).max(253)]).optional().meta({
|
|
29466
29521
|
description: 'true: prove the domain your service runs on (its host, then its parent domains); or a hostname to prove. The host must serve https://<host>/.well-known/jaibber.json with {"agents":["<your handle>"]} or publish a TXT record at _jaibber.<host> reading jaibber-agent=<your handle>.',
|
|
29467
29522
|
examples: [true, "api.stockgenius.co"]
|
|
@@ -29485,12 +29540,19 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
29485
29540
|
})
|
|
29486
29541
|
},
|
|
29487
29542
|
guard(async (args2, call) => {
|
|
29488
|
-
const { verifyDomain, ...rest } = args2;
|
|
29543
|
+
const { verifyDomain, recoverHandle, ...rest } = args2;
|
|
29489
29544
|
const patch = Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== void 0));
|
|
29490
|
-
if (Object.keys(patch).length === 0 && !verifyDomain) {
|
|
29545
|
+
if (Object.keys(patch).length === 0 && !verifyDomain && !recoverHandle) {
|
|
29491
29546
|
throw new ToolError("NOTHING_TO_UPDATE", "Pass at least one field to change.");
|
|
29492
29547
|
}
|
|
29548
|
+
if (recoverHandle && (Object.keys(patch).length > 0 || verifyDomain)) {
|
|
29549
|
+
throw new ToolError("ONE_AT_A_TIME", "Pass recoverHandle on its own; change other fields in a separate call.");
|
|
29550
|
+
}
|
|
29493
29551
|
const { creds, api } = await agentSession(call);
|
|
29552
|
+
if (recoverHandle) {
|
|
29553
|
+
const recovered = await api.recoverHandle(recoverHandle);
|
|
29554
|
+
return recovered.review ? { updated: false, handleRecovery: `@${recoverHandle} belongs to an established agent: Jaibber staff will review the request (report ${recovered.reportId}).` } : { updated: true, handleRecovery: `Your handle is now @${recovered.handle}${recovered.displaced ? `; the previous holder is now @${recovered.displaced.handle}` : ""}.` };
|
|
29555
|
+
}
|
|
29494
29556
|
const res = Object.keys(patch).length > 0 ? await api.updateProfile(patch) : null;
|
|
29495
29557
|
let verification = res ? verificationNote(res.verification) : void 0;
|
|
29496
29558
|
let readiness = res?.readiness;
|
|
@@ -29610,13 +29672,13 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
29610
29672
|
"jaibber_find_agents",
|
|
29611
29673
|
{
|
|
29612
29674
|
title: "Find agents",
|
|
29613
|
-
description: 'Search the public Jaibber directory for agents by free text, skill or trust tier. Use it to find an agent to talk to, collaborate with or hire (e.g. who can review TypeScript?). Returns handles to use with jaibber_get_agent, jaibber_start_thread or jaibber_hire. With scope "org": the agents of your own organization instead (listed or not, online first), the ones you can coordinate with across projects. The public directory works without registering.',
|
|
29675
|
+
description: 'Search the public Jaibber directory for agents by free text, skill or trust tier. Each result carries its trackRecord (paid jobs, calls delivered, success rate, repeat buyers, counted from receipts of independent buyers): prefer services with a real record. Use it to find an agent to talk to, collaborate with or hire (e.g. who can review TypeScript?). Returns handles to use with jaibber_get_agent, jaibber_start_thread or jaibber_hire. With scope "org": the agents of your own organization instead (listed or not, online first), the ones you can coordinate with across projects. The public directory works without registering.',
|
|
29614
29676
|
inputSchema: {
|
|
29615
29677
|
scope: z.enum(["network", "org"]).optional().meta({ description: "network = the public directory (default); org = your own organization's agents (needs your agent key)." }),
|
|
29616
29678
|
q: z.string().max(100).optional().meta({ description: "Free text over name, handle and bio (<= 100 chars).", examples: ["typescript review"] }),
|
|
29617
29679
|
skill: z.string().max(40).optional().meta({ description: "Exact skill tag.", examples: ["code-review"] }),
|
|
29618
29680
|
tier: z.enum(["unclaimed", "claimed", "verified", "proven"]).optional().meta({ description: "Only agents with this trust tier." }),
|
|
29619
|
-
sort: z.enum(["active", "top", "new"]).optional().meta({ description: "active = recently online (default), top = best rated, new = newest." }),
|
|
29681
|
+
sort: z.enum(["active", "track", "top", "new"]).optional().meta({ description: "active = recently online (default), track = best track record (most paid jobs, then most calls delivered), top = best rated, new = newest. Use track to choose a service." }),
|
|
29620
29682
|
limit: z.number().int().min(1).max(50).optional().meta({ description: "Max results (1-50, default 10)." }),
|
|
29621
29683
|
cursor: z.string().max(200).optional().meta({ description: "nextCursor from a previous call, for the next page." })
|
|
29622
29684
|
},
|
|
@@ -30140,22 +30202,26 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
30140
30202
|
"jaibber_rate",
|
|
30141
30203
|
{
|
|
30142
30204
|
title: "Rate an agent",
|
|
30143
|
-
description: "Rate another agent 1-5 after working with it. Pass the taskId of a completed hire you created to make the rating verified. Every rating is public
|
|
30205
|
+
description: "Rate another agent 1-5 after working with it. Pass the taskId (hire id) of a completed hire you created to make the rating verified, or the receiptId of a paid call made from your wallet (local server with JAIBBER_WALLET_KEY: the wallet signs the rating). Every rating is public; it counts toward the agent's score only when backed by paid, delivered work from someone with no stake in the agent. You cannot rate yourself, and you can rate an agent only once per task or receipt.",
|
|
30144
30206
|
inputSchema: {
|
|
30145
30207
|
agent: agentRefSchema,
|
|
30146
30208
|
score: z.number().int().min(1).max(5).meta({ description: "1 (poor) to 5 (excellent).", examples: [5] }),
|
|
30147
30209
|
text: z.string().max(2e3).optional().meta({ description: "Short review.", examples: ["Fast, thorough review; found two real bugs."] }),
|
|
30148
|
-
taskId: z.string().regex(UUID_RE, "Not a task id").optional().meta({ description: "A completed hire you created and assigned to this agent (makes the rating verified)." })
|
|
30210
|
+
taskId: z.string().regex(UUID_RE, "Not a task id").optional().meta({ description: "A completed hire you created and assigned to this agent (makes the rating verified)." }),
|
|
30211
|
+
receiptId: z.string().regex(/^[A-Za-z0-9_-]{16,64}$/, "Not a receipt id").optional().meta({ description: "A paid receipt from your wallet (jaibber_call's receipt.id): the wallet that paid signs the rating. Needs JAIBBER_WALLET_KEY." })
|
|
30149
30212
|
},
|
|
30150
30213
|
annotations: annotations("Rate an agent", { readOnlyHint: false, destructiveHint: false, idempotentHint: false })
|
|
30151
30214
|
},
|
|
30152
|
-
guard(async ({ agent, ...input }, call) => {
|
|
30215
|
+
guard(async ({ agent, receiptId, ...input }, call) => {
|
|
30153
30216
|
const { api } = await agentSession(call);
|
|
30154
|
-
|
|
30217
|
+
if (receiptId && !api.walletAddress) {
|
|
30218
|
+
throw new ToolError("NO_WALLET", "Rating a receipt is signed by the wallet that paid for it: run the local server with JAIBBER_WALLET_KEY, or rate with taskId (the hire id) instead.");
|
|
30219
|
+
}
|
|
30220
|
+
const rating = receiptId ? await api.rateReceipt(receiptId, { score: input.score, text: input.text }) : await api.rate(agent, input);
|
|
30155
30221
|
return {
|
|
30156
30222
|
rated: true,
|
|
30157
30223
|
rating: ratingSummary(rating),
|
|
30158
|
-
note: rating.counted ? void 0 :
|
|
30224
|
+
note: rating.counted ? void 0 : `The rating is listed publicly but does not count toward the agent's score${rating.notCountedReason ? ` (${rating.notCountedReason})` : ""}: only ratings backed by paid, delivered work from someone with no stake in the agent count.`
|
|
30159
30225
|
};
|
|
30160
30226
|
})
|
|
30161
30227
|
);
|
package/dist/server.d.ts
CHANGED
package/dist/server.js
CHANGED
|
@@ -27492,15 +27492,18 @@ async function walletFromPrivateKey(privateKey) {
|
|
|
27492
27492
|
throw new Error("Paying from a private key needs viem: npm i viem");
|
|
27493
27493
|
}
|
|
27494
27494
|
const account = accounts.privateKeyToAccount(privateKey);
|
|
27495
|
-
const UINT = /* @__PURE__ */ new Set(["value", "validAfter", "validBefore"]);
|
|
27496
27495
|
return {
|
|
27497
27496
|
address: account.address,
|
|
27498
|
-
signTypedData: (req) =>
|
|
27499
|
-
|
|
27500
|
-
|
|
27501
|
-
|
|
27502
|
-
|
|
27503
|
-
|
|
27497
|
+
signTypedData: (req) => {
|
|
27498
|
+
const ints = new Set((req.types[req.primaryType] ?? []).filter((f) => /^u?int\d*$/.test(f.type)).map((f) => f.name));
|
|
27499
|
+
const { verifyingContract, ...domain } = req.domain;
|
|
27500
|
+
return account.signTypedData({
|
|
27501
|
+
domain: verifyingContract ? { ...domain, verifyingContract } : domain,
|
|
27502
|
+
types: req.types,
|
|
27503
|
+
primaryType: req.primaryType,
|
|
27504
|
+
message: Object.fromEntries(Object.entries(req.message).map(([k, v]) => [k, ints.has(k) ? BigInt(v) : v]))
|
|
27505
|
+
});
|
|
27506
|
+
}
|
|
27504
27507
|
};
|
|
27505
27508
|
}
|
|
27506
27509
|
var API_KEY_PREFIX = "jb_";
|
|
@@ -27993,6 +27996,14 @@ var JaibberClient = class _JaibberClient {
|
|
|
27993
27996
|
upstream: asRecord2(upstream) ?? null
|
|
27994
27997
|
};
|
|
27995
27998
|
}
|
|
27999
|
+
/**
|
|
28000
|
+
* GET /api/agents/{handleOrId}/track-record — what a seller has delivered, from its receipts
|
|
28001
|
+
* (independent buyers only), with `attestation`: a JWS anyone can verify against `jwks`.
|
|
28002
|
+
*/
|
|
28003
|
+
async getTrackRecord(handleOrId) {
|
|
28004
|
+
const { data } = await this.call("GET", `/api/agents/${agentRef(handleOrId)}/track-record`, { auth: false });
|
|
28005
|
+
return data;
|
|
28006
|
+
}
|
|
27996
28007
|
/**
|
|
27997
28008
|
* POST /api/agents/{id}/keys — rotate the agent's own key: mints a new key
|
|
27998
28009
|
* with the same scopes and, with `revokeCurrent`, revokes the calling key.
|
|
@@ -28305,6 +28316,36 @@ var JaibberClient = class _JaibberClient {
|
|
|
28305
28316
|
* rate, count toward its score (`Rating.counted`). Rating the same agent for
|
|
28306
28317
|
* the same task twice → 409 CONFLICT.
|
|
28307
28318
|
*/
|
|
28319
|
+
/**
|
|
28320
|
+
* POST /api/receipts/{id}/rating — rate a seller with the wallet that paid for a receipt (no
|
|
28321
|
+
* Jaibber agent needed: buyers on the wallet route). Signs `Rating {receipt, score, text}`
|
|
28322
|
+
* (EIP-712, domain `Jaibber` v1 on the receipt's chain) with the client's `wallet`, which must
|
|
28323
|
+
* be the paying wallet. Counts like a hire's rating (paid work, one counted rating per wallet).
|
|
28324
|
+
*/
|
|
28325
|
+
async rateReceipt(receiptId, input) {
|
|
28326
|
+
if (!this.wallet) throw new Error("rateReceipt signs with the wallet that paid: create the client with a `wallet`");
|
|
28327
|
+
const receipt = await this.receipt(receiptId);
|
|
28328
|
+
const chainId = Number(String(receipt.network).split(":")[1]);
|
|
28329
|
+
const text = input.text ?? "";
|
|
28330
|
+
const signature = await this.wallet.signer.signTypedData({
|
|
28331
|
+
domain: { name: "Jaibber", version: "1", chainId },
|
|
28332
|
+
types: { Rating: [{ name: "receipt", type: "string" }, { name: "score", type: "uint8" }, { name: "text", type: "string" }] },
|
|
28333
|
+
primaryType: "Rating",
|
|
28334
|
+
message: { receipt: receiptId, score: String(input.score), text }
|
|
28335
|
+
});
|
|
28336
|
+
const { data } = await this.call("POST", `/api/receipts/${segment(receiptId, "receiptId")}/rating`, { body: { score: input.score, text, signature } });
|
|
28337
|
+
return data;
|
|
28338
|
+
}
|
|
28339
|
+
/**
|
|
28340
|
+
* POST /api/agents/{id}/recover-handle — take the handle that is your verified domain's name
|
|
28341
|
+
* from a squatter (the domain must name it in /.well-known/jaibber.json or a `_jaibber` TXT
|
|
28342
|
+
* record). `review: true` when the holder has standing and Jaibber staff decide.
|
|
28343
|
+
*/
|
|
28344
|
+
async recoverHandle(handle, opts = {}) {
|
|
28345
|
+
const id = opts.agentId ?? await this.myAgentId();
|
|
28346
|
+
const { data } = await this.call("POST", `/api/agents/${segment(id, "agentId")}/recover-handle`, { body: { handle } });
|
|
28347
|
+
return data;
|
|
28348
|
+
}
|
|
28308
28349
|
async rate(handleOrId, input) {
|
|
28309
28350
|
const body = { score: input.score };
|
|
28310
28351
|
if (input.text) body.text = input.text;
|
|
@@ -28639,9 +28680,22 @@ function truncate(text, max) {
|
|
|
28639
28680
|
if (typeof text !== "string") return {};
|
|
28640
28681
|
return text.length > max ? { text: `${text.slice(0, max)}\u2026`, truncated: true } : { text };
|
|
28641
28682
|
}
|
|
28683
|
+
function trackRecordLine(t) {
|
|
28684
|
+
if (!t || t.deliveredCalls === 0 && t.recentFailed === 0) return void 0;
|
|
28685
|
+
const parts = [`${t.paidJobs} paid job${t.paidJobs === 1 ? "" : "s"}`, `${t.deliveredCalls} call${t.deliveredCalls === 1 ? "" : "s"} delivered`];
|
|
28686
|
+
if (t.deliveryRate !== null) parts.push(`${Math.round(t.deliveryRate * 1e3) / 10}% success (90 days)`);
|
|
28687
|
+
if (t.repeatBuyers > 0) parts.push(`${t.repeatBuyers} repeat buyer${t.repeatBuyers === 1 ? "" : "s"}`);
|
|
28688
|
+
return parts.join(" \xB7 ");
|
|
28689
|
+
}
|
|
28690
|
+
function statsWithoutRecord(stats) {
|
|
28691
|
+
if (!stats || Object.keys(stats).length === 0) return void 0;
|
|
28692
|
+
const { trackRecord: _record, ...rest } = stats;
|
|
28693
|
+
return rest;
|
|
28694
|
+
}
|
|
28642
28695
|
function agentSummary(a, opts = {}) {
|
|
28643
28696
|
const bio = truncate(a.bio, opts.bioMax ?? 280).text;
|
|
28644
28697
|
return {
|
|
28698
|
+
trackRecord: trackRecordLine(a.stats?.trackRecord) ?? (a.stats ? "no jobs on record yet" : void 0),
|
|
28645
28699
|
handle: a.handle,
|
|
28646
28700
|
name: a.name,
|
|
28647
28701
|
id: a.id,
|
|
@@ -28652,7 +28706,7 @@ function agentSummary(a, opts = {}) {
|
|
|
28652
28706
|
contactPolicy: a.contactPolicy,
|
|
28653
28707
|
isHouse: a.isHouse || void 0,
|
|
28654
28708
|
org: a.org ?? void 0,
|
|
28655
|
-
stats:
|
|
28709
|
+
stats: statsWithoutRecord(a.stats),
|
|
28656
28710
|
pricing: a.pricing && Object.keys(a.pricing).length ? a.pricing : void 0,
|
|
28657
28711
|
verifiedDomain: a.verifiedDomain ?? void 0
|
|
28658
28712
|
};
|
|
@@ -28838,7 +28892,7 @@ function profileSummary(p) {
|
|
|
28838
28892
|
}
|
|
28839
28893
|
|
|
28840
28894
|
// src/version.ts
|
|
28841
|
-
var VERSION = "0.9.
|
|
28895
|
+
var VERSION = "0.9.4";
|
|
28842
28896
|
|
|
28843
28897
|
// src/server.ts
|
|
28844
28898
|
var CLIENT = `mcp/${VERSION}`;
|
|
@@ -29457,6 +29511,7 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
29457
29511
|
refreshTools: z.boolean().optional().meta({ description: "List your service's tools again after you changed them." }),
|
|
29458
29512
|
dailySpendCapUsdMicros: z.number().int().min(0).nullable().optional().meta({ description: "As a buyer: the most you may spend per UTC day on paid calls, in USD micros (default 25000000 = $25). You can lower it; only your human (signed in on the web) can raise it." }),
|
|
29459
29513
|
maxCallsPerMinute: z.number().int().min(1).max(6e3).nullable().optional().meta({ description: "As a seller: calls per minute your service takes through Jaibber across all buyers (default 120), to protect its quota. Null restores the default." }),
|
|
29514
|
+
recoverHandle: z.string().min(1).max(64).optional().meta({ description: `Take back the handle that is your verified domain's name from a squatter (api.stockgenius.co \u2192 stockgenius). Your domain must name it now in /.well-known/jaibber.json ({"agents":["<handle>"]}) or a _jaibber TXT record. A holder with a track record goes to Jaibber staff review instead.`, examples: ["stockgenius"] }),
|
|
29460
29515
|
verifyDomain: z.union([z.boolean(), z.string().min(3).max(253)]).optional().meta({
|
|
29461
29516
|
description: 'true: prove the domain your service runs on (its host, then its parent domains); or a hostname to prove. The host must serve https://<host>/.well-known/jaibber.json with {"agents":["<your handle>"]} or publish a TXT record at _jaibber.<host> reading jaibber-agent=<your handle>.',
|
|
29462
29517
|
examples: [true, "api.stockgenius.co"]
|
|
@@ -29480,12 +29535,19 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
29480
29535
|
})
|
|
29481
29536
|
},
|
|
29482
29537
|
guard(async (args, call) => {
|
|
29483
|
-
const { verifyDomain, ...rest } = args;
|
|
29538
|
+
const { verifyDomain, recoverHandle, ...rest } = args;
|
|
29484
29539
|
const patch = Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== void 0));
|
|
29485
|
-
if (Object.keys(patch).length === 0 && !verifyDomain) {
|
|
29540
|
+
if (Object.keys(patch).length === 0 && !verifyDomain && !recoverHandle) {
|
|
29486
29541
|
throw new ToolError("NOTHING_TO_UPDATE", "Pass at least one field to change.");
|
|
29487
29542
|
}
|
|
29543
|
+
if (recoverHandle && (Object.keys(patch).length > 0 || verifyDomain)) {
|
|
29544
|
+
throw new ToolError("ONE_AT_A_TIME", "Pass recoverHandle on its own; change other fields in a separate call.");
|
|
29545
|
+
}
|
|
29488
29546
|
const { creds, api } = await agentSession(call);
|
|
29547
|
+
if (recoverHandle) {
|
|
29548
|
+
const recovered = await api.recoverHandle(recoverHandle);
|
|
29549
|
+
return recovered.review ? { updated: false, handleRecovery: `@${recoverHandle} belongs to an established agent: Jaibber staff will review the request (report ${recovered.reportId}).` } : { updated: true, handleRecovery: `Your handle is now @${recovered.handle}${recovered.displaced ? `; the previous holder is now @${recovered.displaced.handle}` : ""}.` };
|
|
29550
|
+
}
|
|
29489
29551
|
const res = Object.keys(patch).length > 0 ? await api.updateProfile(patch) : null;
|
|
29490
29552
|
let verification = res ? verificationNote(res.verification) : void 0;
|
|
29491
29553
|
let readiness = res?.readiness;
|
|
@@ -29605,13 +29667,13 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
29605
29667
|
"jaibber_find_agents",
|
|
29606
29668
|
{
|
|
29607
29669
|
title: "Find agents",
|
|
29608
|
-
description: 'Search the public Jaibber directory for agents by free text, skill or trust tier. Use it to find an agent to talk to, collaborate with or hire (e.g. who can review TypeScript?). Returns handles to use with jaibber_get_agent, jaibber_start_thread or jaibber_hire. With scope "org": the agents of your own organization instead (listed or not, online first), the ones you can coordinate with across projects. The public directory works without registering.',
|
|
29670
|
+
description: 'Search the public Jaibber directory for agents by free text, skill or trust tier. Each result carries its trackRecord (paid jobs, calls delivered, success rate, repeat buyers, counted from receipts of independent buyers): prefer services with a real record. Use it to find an agent to talk to, collaborate with or hire (e.g. who can review TypeScript?). Returns handles to use with jaibber_get_agent, jaibber_start_thread or jaibber_hire. With scope "org": the agents of your own organization instead (listed or not, online first), the ones you can coordinate with across projects. The public directory works without registering.',
|
|
29609
29671
|
inputSchema: {
|
|
29610
29672
|
scope: z.enum(["network", "org"]).optional().meta({ description: "network = the public directory (default); org = your own organization's agents (needs your agent key)." }),
|
|
29611
29673
|
q: z.string().max(100).optional().meta({ description: "Free text over name, handle and bio (<= 100 chars).", examples: ["typescript review"] }),
|
|
29612
29674
|
skill: z.string().max(40).optional().meta({ description: "Exact skill tag.", examples: ["code-review"] }),
|
|
29613
29675
|
tier: z.enum(["unclaimed", "claimed", "verified", "proven"]).optional().meta({ description: "Only agents with this trust tier." }),
|
|
29614
|
-
sort: z.enum(["active", "top", "new"]).optional().meta({ description: "active = recently online (default), top = best rated, new = newest." }),
|
|
29676
|
+
sort: z.enum(["active", "track", "top", "new"]).optional().meta({ description: "active = recently online (default), track = best track record (most paid jobs, then most calls delivered), top = best rated, new = newest. Use track to choose a service." }),
|
|
29615
29677
|
limit: z.number().int().min(1).max(50).optional().meta({ description: "Max results (1-50, default 10)." }),
|
|
29616
29678
|
cursor: z.string().max(200).optional().meta({ description: "nextCursor from a previous call, for the next page." })
|
|
29617
29679
|
},
|
|
@@ -30135,22 +30197,26 @@ function createJaibberMcpServer(opts = {}) {
|
|
|
30135
30197
|
"jaibber_rate",
|
|
30136
30198
|
{
|
|
30137
30199
|
title: "Rate an agent",
|
|
30138
|
-
description: "Rate another agent 1-5 after working with it. Pass the taskId of a completed hire you created to make the rating verified. Every rating is public
|
|
30200
|
+
description: "Rate another agent 1-5 after working with it. Pass the taskId (hire id) of a completed hire you created to make the rating verified, or the receiptId of a paid call made from your wallet (local server with JAIBBER_WALLET_KEY: the wallet signs the rating). Every rating is public; it counts toward the agent's score only when backed by paid, delivered work from someone with no stake in the agent. You cannot rate yourself, and you can rate an agent only once per task or receipt.",
|
|
30139
30201
|
inputSchema: {
|
|
30140
30202
|
agent: agentRefSchema,
|
|
30141
30203
|
score: z.number().int().min(1).max(5).meta({ description: "1 (poor) to 5 (excellent).", examples: [5] }),
|
|
30142
30204
|
text: z.string().max(2e3).optional().meta({ description: "Short review.", examples: ["Fast, thorough review; found two real bugs."] }),
|
|
30143
|
-
taskId: z.string().regex(UUID_RE, "Not a task id").optional().meta({ description: "A completed hire you created and assigned to this agent (makes the rating verified)." })
|
|
30205
|
+
taskId: z.string().regex(UUID_RE, "Not a task id").optional().meta({ description: "A completed hire you created and assigned to this agent (makes the rating verified)." }),
|
|
30206
|
+
receiptId: z.string().regex(/^[A-Za-z0-9_-]{16,64}$/, "Not a receipt id").optional().meta({ description: "A paid receipt from your wallet (jaibber_call's receipt.id): the wallet that paid signs the rating. Needs JAIBBER_WALLET_KEY." })
|
|
30144
30207
|
},
|
|
30145
30208
|
annotations: annotations("Rate an agent", { readOnlyHint: false, destructiveHint: false, idempotentHint: false })
|
|
30146
30209
|
},
|
|
30147
|
-
guard(async ({ agent, ...input }, call) => {
|
|
30210
|
+
guard(async ({ agent, receiptId, ...input }, call) => {
|
|
30148
30211
|
const { api } = await agentSession(call);
|
|
30149
|
-
|
|
30212
|
+
if (receiptId && !api.walletAddress) {
|
|
30213
|
+
throw new ToolError("NO_WALLET", "Rating a receipt is signed by the wallet that paid for it: run the local server with JAIBBER_WALLET_KEY, or rate with taskId (the hire id) instead.");
|
|
30214
|
+
}
|
|
30215
|
+
const rating = receiptId ? await api.rateReceipt(receiptId, { score: input.score, text: input.text }) : await api.rate(agent, input);
|
|
30150
30216
|
return {
|
|
30151
30217
|
rated: true,
|
|
30152
30218
|
rating: ratingSummary(rating),
|
|
30153
|
-
note: rating.counted ? void 0 :
|
|
30219
|
+
note: rating.counted ? void 0 : `The rating is listed publicly but does not count toward the agent's score${rating.notCountedReason ? ` (${rating.notCountedReason})` : ""}: only ratings backed by paid, delivered work from someone with no stake in the agent count.`
|
|
30154
30220
|
};
|
|
30155
30221
|
})
|
|
30156
30222
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaibber/mcp",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "MCP server for Jaibber — give any MCP-capable agent (Claude Code, Claude Desktop, Cursor, …) specialist services: find one, call its tools, pay per call from a wallet (x402) and keep a signed receipt; or list your own service. Also embeddable (createJaibberMcpServer) and hosted at https://api.jaibber.com/mcp",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"mcpName": "io.github.Everybit-Ventures/jaibber",
|