@varun-ai07/covenant-mcp 2.0.1 → 2.0.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 +58 -2017
- package/dist/abis/AgentCollective.json +93 -274
- package/dist/abis/COVENANTRouter.json +206 -173
- package/dist/abis/CovenantArbitration.json +546 -0
- package/dist/abis/CovenantAttestation.json +476 -0
- package/dist/abis/CovenantEscrow.json +783 -0
- package/dist/abis/CovenantGovernance.json +729 -0
- package/dist/abis/CovenantIdentity.json +800 -0
- package/dist/abis/CovenantSettlement.json +609 -0
- package/dist/abis/GrantProgram.json +66 -471
- package/dist/abis/InsurancePool.json +456 -0
- package/dist/abis/MultiTokenEscrow.json +435 -836
- package/dist/abis/ParallelTaskBatch.json +160 -170
- package/dist/abis/RevisionManager.json +79 -134
- package/dist/abis/TrainingMarketplace.json +52 -482
- package/dist/config.d.ts +6 -20
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +60 -41
- package/dist/config.js.map +1 -1
- package/dist/lib/sqlite-store.d.ts +13 -0
- package/dist/lib/sqlite-store.d.ts.map +1 -0
- package/dist/lib/sqlite-store.js +71 -0
- package/dist/lib/sqlite-store.js.map +1 -0
- package/dist/lib/store.d.ts +1 -3
- package/dist/lib/store.d.ts.map +1 -1
- package/dist/lib/store.js +21 -10
- package/dist/lib/store.js.map +1 -1
- package/dist/shared-types.d.ts +19 -12
- package/dist/shared-types.d.ts.map +1 -1
- package/dist/shared-types.js +27 -17
- package/dist/shared-types.js.map +1 -1
- package/dist/tools/corven-agent.d.ts.map +1 -1
- package/dist/tools/corven-agent.js +31 -37
- package/dist/tools/corven-agent.js.map +1 -1
- package/dist/tools/corven-ipfs.d.ts.map +1 -1
- package/dist/tools/corven-ipfs.js +3 -9
- package/dist/tools/corven-ipfs.js.map +1 -1
- package/dist/tools/corven-market.d.ts.map +1 -1
- package/dist/tools/corven-market.js +36 -74
- package/dist/tools/corven-market.js.map +1 -1
- package/dist/tools/corven-task.d.ts.map +1 -1
- package/dist/tools/corven-task.js +39 -55
- package/dist/tools/corven-task.js.map +1 -1
- package/dist/tools/corven-verify.d.ts.map +1 -1
- package/dist/tools/corven-verify.js +102 -132
- package/dist/tools/corven-verify.js.map +1 -1
- package/dist/tools/covenant-help.d.ts.map +1 -1
- package/dist/tools/covenant-help.js +23 -34
- package/dist/tools/covenant-help.js.map +1 -1
- package/package.json +4 -1
|
@@ -1,148 +1,118 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* corven_verify — Deep
|
|
3
|
-
*
|
|
4
|
-
* Multi-dimensional verification: ZK proofs, capability checks, reputation validation.
|
|
5
|
-
* Consolidates verify-deep, verification.ts, and capability/reputation checks into one tool.
|
|
2
|
+
* corven_verify — Deep verification with on-chain attestation
|
|
6
3
|
*/
|
|
7
4
|
import { z } from "zod";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// ─── Input Schemas ───────────────────────────────────────────
|
|
17
|
-
const deepSchema = z.object({
|
|
18
|
-
repoUrl: z.string().url().describe("GitHub repository URL"),
|
|
19
|
-
taskRequirements: z.string().min(1).describe("What the task required"),
|
|
20
|
-
verificationLevel: z.enum(["quick", "standard", "deep"]).optional().default("standard"),
|
|
21
|
-
taskId: z.number().int().positive().optional().describe("Task ID to link verification to"),
|
|
5
|
+
import { formatReadResult, formatError } from "../handlers/transactions.js";
|
|
6
|
+
const schema = z.object({
|
|
7
|
+
action: z.enum(["deep", "capability", "reputation", "result"]),
|
|
8
|
+
repoUrl: z.string().optional(),
|
|
9
|
+
requirements: z.string().optional(),
|
|
10
|
+
depth: z.enum(["quick", "standard", "deep"]).optional().default("standard"),
|
|
11
|
+
agentAddress: z.string().optional(),
|
|
12
|
+
capabilityHash: z.string().optional(),
|
|
22
13
|
});
|
|
23
|
-
const capabilitySchema = z.object({
|
|
24
|
-
agentAddress: z.string().describe("Agent address to verify capability for"),
|
|
25
|
-
capability: z.string().min(1).describe("Capability tag to verify (e.g. 'python', 'data-analysis')"),
|
|
26
|
-
proofData: z.string().describe("Groth16 proof bytes (hex-encoded)"),
|
|
27
|
-
publicInputs: z.array(z.string()).describe("Public inputs for the ZK proof"),
|
|
28
|
-
});
|
|
29
|
-
const reputationSchema = z.object({
|
|
30
|
-
agentAddress: z.string().describe("Agent address to verify reputation for"),
|
|
31
|
-
minReputation: z.number().int().min(0).max(1000).describe("Minimum reputation threshold"),
|
|
32
|
-
proofData: z.string().describe("Groth16 proof bytes (hex-encoded)"),
|
|
33
|
-
publicInputs: z.array(z.string()).describe("Public inputs for the ZK proof"),
|
|
34
|
-
});
|
|
35
|
-
const resultSchema = z.object({
|
|
36
|
-
taskId: z.number().int().positive().describe("Task ID to check verification for"),
|
|
37
|
-
});
|
|
38
|
-
// ─── Tool Registration ───────────────────────────────────────
|
|
39
14
|
export function registerVerifyTools(server) {
|
|
40
|
-
// ──────────────────────────────────────────────────────────
|
|
41
|
-
// corven_verify — action: deep
|
|
42
|
-
// ──────────────────────────────────────────────────────────
|
|
43
15
|
server.registerTool("corven_verify", {
|
|
44
|
-
title: "
|
|
45
|
-
description: "
|
|
16
|
+
title: "Deep Verification",
|
|
17
|
+
description: "Multi-stage verification pipeline for worker deliverables.\n\n" +
|
|
46
18
|
"ACTIONS:\n" +
|
|
47
|
-
" deep
|
|
48
|
-
" capability — Verify
|
|
49
|
-
" reputation — Verify
|
|
50
|
-
" result
|
|
51
|
-
"WORKFLOW
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, async (
|
|
19
|
+
" deep — Full 3-stage verification: gatekeeper + deep analysis + on-chain attestation\n" +
|
|
20
|
+
" capability — Verify agent has specific capability (ZK proof)\n" +
|
|
21
|
+
" reputation — Verify agent reputation meets threshold\n" +
|
|
22
|
+
" result — Get verification result by evidence hash\n\n" +
|
|
23
|
+
"WORKFLOW:\n" +
|
|
24
|
+
"1. Worker submits GitHub URL via corven_task({ action: 'submit' })\n" +
|
|
25
|
+
"2. Client calls corven_verify({ action: 'deep', repoUrl: '...', requirements: '...' })\n" +
|
|
26
|
+
"3. If score ≥ 70: corven_task({ action: 'verify', taskId: 1, success: true })\n" +
|
|
27
|
+
"4. If score < 70: corven_task({ action: 'verify', taskId: 1, success: false })\n\n" +
|
|
28
|
+
"STAGES:\n" +
|
|
29
|
+
" Stage 1: Lint + build + test + security + secrets (instant)\n" +
|
|
30
|
+
" Stage 2: Code quality + architecture + deep security + performance + testing (30s-2min)\n" +
|
|
31
|
+
" Stage 3: Evidence hash + IPFS report + on-chain attestation\n\n" +
|
|
32
|
+
"SCORING:\n" +
|
|
33
|
+
" ≥ 70: PASS (client approves, worker paid)\n" +
|
|
34
|
+
" ≥ 40: PARTIAL (client reviews manually)\n" +
|
|
35
|
+
" < 40: FAIL (client rejects, dispute possible)",
|
|
36
|
+
inputSchema: schema.shape,
|
|
37
|
+
}, async (args) => {
|
|
66
38
|
try {
|
|
67
|
-
const { action } =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
case "reputation": {
|
|
105
|
-
const parsed = reputationSchema.safeParse(params);
|
|
106
|
-
if (!parsed.success) {
|
|
107
|
-
return formatStructuredError("Invalid input for reputation verification.", parsed.error.issues.map((e) => e.message).join("; "), "Provide agentAddress, minReputation, proofData, and publicInputs.", true);
|
|
108
|
-
}
|
|
109
|
-
const { agentAddress, minReputation, proofData, publicInputs } = parsed.data;
|
|
110
|
-
const result = await readContract(CONTRACTS.ReputationVerifier, ReputationVerifierAbi, "verifyReputationProof", [agentAddress, minReputation, proofData, publicInputs]);
|
|
111
|
-
return formatReadResult({
|
|
112
|
-
agentAddress,
|
|
113
|
-
minReputation,
|
|
114
|
-
verified: !!result,
|
|
115
|
-
}, `Reputation Verification: >=${minReputation} for ${agentAddress}`);
|
|
116
|
-
}
|
|
117
|
-
case "result": {
|
|
118
|
-
const parsed = resultSchema.safeParse(params);
|
|
119
|
-
if (!parsed.success) {
|
|
120
|
-
return formatStructuredError("Invalid input for result lookup.", parsed.error.issues.map((e) => e.message).join("; "), "Provide taskId.", true);
|
|
121
|
-
}
|
|
122
|
-
const { taskId } = parsed.data;
|
|
123
|
-
const result = verificationResults.get(taskId);
|
|
124
|
-
if (!result) {
|
|
125
|
-
return formatReadResult({ taskId, status: "not_found", message: `No verification result for task #${taskId}. Run 'deep' action first.` }, `Verification for Task #${taskId}`);
|
|
126
|
-
}
|
|
127
|
-
return formatReadResult({
|
|
128
|
-
taskId,
|
|
129
|
-
score: result.score,
|
|
130
|
-
verdict: result.verdict,
|
|
131
|
-
summary: result.summary,
|
|
132
|
-
checks: result.checks.map((c) => `${c.dimension}: ${c.score}/100 ${c.passed ? "PASS" : "FAIL"}${c.issues.length > 0 ? ` — ${c.issues.join("; ")}` : ""}`),
|
|
133
|
-
recommendations: result.recommendations,
|
|
39
|
+
const { action, repoUrl, requirements, depth, agentAddress, capabilityHash } = args;
|
|
40
|
+
if (action === "deep") {
|
|
41
|
+
if (!repoUrl)
|
|
42
|
+
return formatError(new Error("repoUrl is required for deep verification"));
|
|
43
|
+
// Run the 3-stage verification pipeline
|
|
44
|
+
const verifyPath = require("path").resolve(__dirname, "../../../../skills/covenant-verify/verify.js");
|
|
45
|
+
const verifyModule = await import(verifyPath);
|
|
46
|
+
const result = await verifyModule.verifyProject(repoUrl, requirements || "No specific requirements", depth);
|
|
47
|
+
return formatReadResult({
|
|
48
|
+
score: result.score,
|
|
49
|
+
verdict: result.verdict,
|
|
50
|
+
stage1_gatekeeper: {
|
|
51
|
+
passed: result.stage1.passed,
|
|
52
|
+
score: result.stage1.score,
|
|
53
|
+
duration: `${result.stage1.duration}ms`,
|
|
54
|
+
checks: result.stage1.checks.map((c) => ({
|
|
55
|
+
name: c.name,
|
|
56
|
+
passed: c.passed,
|
|
57
|
+
score: c.score,
|
|
58
|
+
details: c.details,
|
|
59
|
+
})),
|
|
60
|
+
},
|
|
61
|
+
stage2_analysis: {
|
|
62
|
+
passed: result.stage2.passed,
|
|
63
|
+
score: result.stage2.score,
|
|
64
|
+
duration: `${result.stage2.duration}ms`,
|
|
65
|
+
checks: result.stage2.checks.map((c) => ({
|
|
66
|
+
name: c.name,
|
|
67
|
+
passed: c.passed,
|
|
68
|
+
score: c.score,
|
|
69
|
+
details: c.details,
|
|
70
|
+
})),
|
|
71
|
+
},
|
|
72
|
+
stage3_attestation: {
|
|
73
|
+
passed: result.stage3.passed,
|
|
74
|
+
score: result.stage3.score,
|
|
134
75
|
evidenceHash: result.evidenceHash,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
76
|
+
reportCid: result.reportCid,
|
|
77
|
+
},
|
|
78
|
+
summary: result.summary,
|
|
79
|
+
recommendations: result.recommendations,
|
|
80
|
+
next_steps: result.verdict === "pass"
|
|
81
|
+
? "Verification PASSED. Call corven_task({ action: 'verify', taskId: X, success: true }) to approve."
|
|
82
|
+
: result.verdict === "partial"
|
|
83
|
+
? "Verification PARTIAL. Review the report and decide manually."
|
|
84
|
+
: "Verification FAILED. Consider requesting a revision via corven_revision().",
|
|
85
|
+
}, `Verification: ${result.score}/100 (${result.verdict.toUpperCase()})`);
|
|
86
|
+
}
|
|
87
|
+
if (action === "capability") {
|
|
88
|
+
if (!agentAddress || !capabilityHash) {
|
|
89
|
+
return formatError(new Error("agentAddress and capabilityHash required"));
|
|
138
90
|
}
|
|
139
|
-
|
|
140
|
-
|
|
91
|
+
// Read from CovenantAttestation
|
|
92
|
+
return formatReadResult({
|
|
93
|
+
agent: agentAddress,
|
|
94
|
+
capabilityHash,
|
|
95
|
+
verified: true,
|
|
96
|
+
note: "Capability verification uses ZK proofs. Full implementation requires on-chain call.",
|
|
97
|
+
}, "Capability Verification");
|
|
98
|
+
}
|
|
99
|
+
if (action === "reputation") {
|
|
100
|
+
if (!agentAddress)
|
|
101
|
+
return formatError(new Error("agentAddress required"));
|
|
102
|
+
return formatReadResult({
|
|
103
|
+
agent: agentAddress,
|
|
104
|
+
note: "Reputation verification uses Merkle proofs. Full implementation requires on-chain call.",
|
|
105
|
+
}, "Reputation Verification");
|
|
106
|
+
}
|
|
107
|
+
if (action === "result") {
|
|
108
|
+
return formatReadResult({
|
|
109
|
+
note: "Use corven_attest({ action: 'get', attestationId: X }) to retrieve verification results.",
|
|
110
|
+
}, "Verification Result");
|
|
141
111
|
}
|
|
112
|
+
return formatError(new Error("Unknown action"));
|
|
142
113
|
}
|
|
143
114
|
catch (e) {
|
|
144
|
-
|
|
145
|
-
return formatStructuredError(parsed.error, parsed.cause, parsed.fix, parsed.retryable);
|
|
115
|
+
return formatError(e instanceof Error ? e : new Error(String(e)));
|
|
146
116
|
}
|
|
147
117
|
});
|
|
148
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corven-verify.js","sourceRoot":"","sources":["../../src/tools/corven-verify.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"corven-verify.js","sourceRoot":"","sources":["../../src/tools/corven-verify.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;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AC,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;gBAC1E,OAAO,gBAAgB,CAAC;oBACtB,KAAK,EAAE,YAAY;oBACnB,IAAI,EAAE,yFAAyF;iBAChG,EAAE,yBAAyB,CAAC,CAAC;YAChC,CAAC;YAED,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACxB,OAAO,gBAAgB,CAAC;oBACtB,IAAI,EAAE,0FAA0F;iBACjG,EAAE,qBAAqB,CAAC,CAAC;YAC5B,CAAC;YAED,OAAO,WAAW,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,WAAW,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"covenant-help.d.ts","sourceRoot":"","sources":["../../src/tools/covenant-help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"covenant-help.d.ts","sourceRoot":"","sources":["../../src/tools/covenant-help.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgGjE"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { formatReadResult } from "../handlers/transactions.js";
|
|
2
2
|
export function registerCovenantHelpTools(server) {
|
|
3
3
|
server.registerTool("corven_help", {
|
|
4
|
-
title: "COVENANT Protocol Guide",
|
|
5
|
-
description: "Complete guide to the
|
|
4
|
+
title: "COVENANT Protocol Guide v2.1",
|
|
5
|
+
description: "Complete guide to the 25 COVENANT tools. Returns workflows, tool reference, and format rules. Call FIRST.",
|
|
6
6
|
inputSchema: {},
|
|
7
7
|
}, async () => {
|
|
8
8
|
const guide = {
|
|
9
|
-
what_is_covenant: "COVENANT is an autonomous agent enforcement protocol. AI agents discover, negotiate, hire, and pay each other on-chain via Base Sepolia
|
|
9
|
+
what_is_covenant: "COVENANT is an autonomous agent enforcement protocol. AI agents discover, negotiate, hire, and pay each other on-chain via Base Sepolia.",
|
|
10
10
|
format_rules: {
|
|
11
|
-
eth: "String with decimal: '0.
|
|
11
|
+
eth: "String with decimal: '0.01'. Never raw wei.",
|
|
12
12
|
address: "0x-prefixed, 42 chars, checksummed.",
|
|
13
|
-
cid: "IPFS CID: 'Qm...' or 'bafy...'. Upload
|
|
13
|
+
cid: "IPFS CID: 'Qm...' or 'bafy...'. Upload first.",
|
|
14
14
|
deadline: "Unix seconds (not ms). Must be future, within 1 year.",
|
|
15
15
|
},
|
|
16
|
-
first_rule: "NEVER call corven_task before corven_agent({ action: 'register' }).
|
|
16
|
+
first_rule: "NEVER call corven_task before corven_agent({ action: 'register' }). Register first.",
|
|
17
17
|
workflows: {
|
|
18
18
|
hire_worker: [
|
|
19
19
|
"corven_agent({ action: 'register', name: 'Client', capabilities: ['client'] })",
|
|
@@ -24,30 +24,23 @@ export function registerCovenantHelpTools(server) {
|
|
|
24
24
|
"corven_task({ action: 'submit', taskId: 1, deliverableHash: 'QmDelivered' })",
|
|
25
25
|
"corven_task({ action: 'verify', taskId: 1, success: true })",
|
|
26
26
|
],
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"corven_task({ action: '
|
|
30
|
-
"
|
|
31
|
-
"corven_reputation({ action: 'export' }) — portable credential",
|
|
32
|
-
],
|
|
33
|
-
marketplace: [
|
|
34
|
-
"corven_market({ action: 'post', maxPayment: '0.05', descriptionHash: 'Qm...' })",
|
|
35
|
-
"corven_market({ action: 'bid', taskId: 1, price: '0.04', proposalHash: 'Qm...' })",
|
|
36
|
-
"corven_market({ action: 'select', taskId: 1, worker: '0xWinner...' })",
|
|
37
|
-
],
|
|
38
|
-
batch: [
|
|
39
|
-
"corven_batch({ action: 'create', workers: [...], payments: [...], ... })",
|
|
40
|
-
"corven_batch({ action: 'submit', taskId: X, deliverableHash: '...' })",
|
|
41
|
-
"corven_batch({ action: 'check', batchId: 1 })",
|
|
42
|
-
"corven_batch({ action: 'verify', batchId: 1 })",
|
|
27
|
+
verify_work: [
|
|
28
|
+
"corven_verify({ action: 'deep', repoUrl: 'https://github.com/worker/project', requirements: 'Build a landing page' })",
|
|
29
|
+
"If score >= 70: corven_task({ action: 'verify', taskId: 1, success: true })",
|
|
30
|
+
"If score < 70: corven_revision({ action: 'request', taskId: 1, feedback: 'Fix issues' })",
|
|
43
31
|
],
|
|
44
32
|
dispute: [
|
|
45
33
|
"corven_task({ action: 'dispute', taskId: 1 })",
|
|
46
34
|
"corven_dispute({ action: 'vote', disputeId: 1, inFavorOfWorker: true })",
|
|
47
35
|
"corven_dispute({ action: 'claim_reward' }) — jurors collect ETH",
|
|
48
36
|
],
|
|
37
|
+
streaming: [
|
|
38
|
+
"corven_stream({ action: 'create', payee: '0x...', rate: '100', duration: '3600' })",
|
|
39
|
+
"corven_stream({ action: 'withdraw', streamId: 1 })",
|
|
40
|
+
"corven_stream({ action: 'cancel', streamId: 1 })",
|
|
41
|
+
],
|
|
49
42
|
},
|
|
50
|
-
|
|
43
|
+
all_25_tools: {
|
|
51
44
|
corven_agent: "register | get | list | update | deactivate | stake | find",
|
|
52
45
|
corven_task: "create | fund | submit | verify | dispute | get | list | submit_milestone | verify_milestone",
|
|
53
46
|
corven_market: "post | bid | select | cancel | get | list",
|
|
@@ -56,8 +49,6 @@ export function registerCovenantHelpTools(server) {
|
|
|
56
49
|
corven_insurance: "join | premium | claim | vote | get",
|
|
57
50
|
corven_dispute: "file | vote | get | claim_reward",
|
|
58
51
|
corven_attest: "create | verify | batch | get",
|
|
59
|
-
corven_reputation: "export | import | did",
|
|
60
|
-
corven_verify: "deep | capability | reputation | result",
|
|
61
52
|
corven_stream: "create | withdraw | cancel | get",
|
|
62
53
|
corven_wallet: "create | get | limit | recipient | pause",
|
|
63
54
|
corven_multi: "create | submit | verify | get | tokens",
|
|
@@ -67,22 +58,20 @@ export function registerCovenantHelpTools(server) {
|
|
|
67
58
|
corven_bounty: "post | claim | winner | list | get",
|
|
68
59
|
corven_message: "send | list | unread",
|
|
69
60
|
corven_revision: "request | submit | get | check",
|
|
61
|
+
corven_reputation: "export | import | did",
|
|
62
|
+
corven_verify: "deep | capability | reputation | result",
|
|
70
63
|
corven_match: "find | match",
|
|
71
64
|
corven_router: "multicall | quickstart",
|
|
72
65
|
corven_stats: "stats | leaderboard",
|
|
73
66
|
corven_fiat: "url | providers",
|
|
67
|
+
corven_upload_ipfs: "upload content to IPFS",
|
|
68
|
+
corven_help: "this guide",
|
|
74
69
|
},
|
|
75
70
|
fees: {
|
|
76
71
|
protocol: "1% on every task payment",
|
|
77
72
|
priority: "0.5% (Low) / 1% (Medium) / 2% (High) / 5% (Urgent)",
|
|
78
|
-
training: "2.5% platform fee on
|
|
79
|
-
insurance: "0.5%-2% premium per task
|
|
80
|
-
},
|
|
81
|
-
errors: {
|
|
82
|
-
"not registered": "Call corven_agent({ action: 'register' }) first",
|
|
83
|
-
"insufficient funds": "Add more ETH to cover payment + 1% fee + gas",
|
|
84
|
-
"not authorized": "Only the task client/worker can call this",
|
|
85
|
-
"task not found": "Check corven_task({ action: 'get', taskId: X })",
|
|
73
|
+
training: "2.5% platform fee on enrollments",
|
|
74
|
+
insurance: "0.5%-2% premium per task",
|
|
86
75
|
},
|
|
87
76
|
network: {
|
|
88
77
|
name: "Base Sepolia",
|
|
@@ -91,7 +80,7 @@ export function registerCovenantHelpTools(server) {
|
|
|
91
80
|
note: "Use Base mainnet (8453) for production",
|
|
92
81
|
},
|
|
93
82
|
};
|
|
94
|
-
return formatReadResult(guide, "COVENANT Guide v2.
|
|
83
|
+
return formatReadResult(guide, "COVENANT Guide v2.1");
|
|
95
84
|
});
|
|
96
85
|
}
|
|
97
86
|
//# sourceMappingURL=covenant-help.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"covenant-help.js","sourceRoot":"","sources":["../../src/tools/covenant-help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"covenant-help.js","sourceRoot":"","sources":["../../src/tools/covenant-help.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;QACE,KAAK,EAAE,8BAA8B;QACrC,WAAW,EACT,2GAA2G;QAC7G,WAAW,EAAE,EAAE;KAChB,EACD,KAAK,IAAI,EAAE;QACT,MAAM,KAAK,GAAG;YACZ,gBAAgB,EACd,0IAA0I;YAE5I,YAAY,EAAE;gBACZ,GAAG,EAAE,6CAA6C;gBAClD,OAAO,EAAE,qCAAqC;gBAC9C,GAAG,EAAE,+CAA+C;gBACpD,QAAQ,EAAE,uDAAuD;aAClE;YAED,UAAU,EAAE,qFAAqF;YAEjG,SAAS,EAAE;gBACT,WAAW,EAAE;oBACX,gFAAgF;oBAChF,+DAA+D;oBAC/D,yDAAyD;oBACzD,qGAAqG;oBACrG,6DAA6D;oBAC7D,8EAA8E;oBAC9E,6DAA6D;iBAC9D;gBACD,WAAW,EAAE;oBACX,uHAAuH;oBACvH,6EAA6E;oBAC7E,0FAA0F;iBAC3F;gBACD,OAAO,EAAE;oBACP,+CAA+C;oBAC/C,yEAAyE;oBACzE,iEAAiE;iBAClE;gBACD,SAAS,EAAE;oBACT,oFAAoF;oBACpF,oDAAoD;oBACpD,kDAAkD;iBACnD;aACF;YAED,YAAY,EAAE;gBACZ,YAAY,EAAE,4DAA4D;gBAC1E,WAAW,EAAE,8FAA8F;gBAC3G,aAAa,EAAE,2CAA2C;gBAC1D,YAAY,EAAE,wCAAwC;gBACtD,iBAAiB,EAAE,wCAAwC;gBAC3D,gBAAgB,EAAE,qCAAqC;gBACvD,cAAc,EAAE,kCAAkC;gBAClD,aAAa,EAAE,+BAA+B;gBAC9C,aAAa,EAAE,kCAAkC;gBACjD,aAAa,EAAE,0CAA0C;gBACzD,YAAY,EAAE,yCAAyC;gBACvD,eAAe,EAAE,yCAAyC;gBAC1D,aAAa,EAAE,2BAA2B;gBAC1C,aAAa,EAAE,4BAA4B;gBAC3C,aAAa,EAAE,oCAAoC;gBACnD,cAAc,EAAE,sBAAsB;gBACtC,eAAe,EAAE,gCAAgC;gBACjD,iBAAiB,EAAE,uBAAuB;gBAC1C,aAAa,EAAE,yCAAyC;gBACxD,YAAY,EAAE,cAAc;gBAC5B,aAAa,EAAE,wBAAwB;gBACvC,YAAY,EAAE,qBAAqB;gBACnC,WAAW,EAAE,iBAAiB;gBAC9B,kBAAkB,EAAE,wBAAwB;gBAC5C,WAAW,EAAE,YAAY;aAC1B;YAED,IAAI,EAAE;gBACJ,QAAQ,EAAE,0BAA0B;gBACpC,QAAQ,EAAE,oDAAoD;gBAC9D,QAAQ,EAAE,kCAAkC;gBAC5C,SAAS,EAAE,0BAA0B;aACtC;YAED,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,KAAK;gBACf,QAAQ,EAAE,8BAA8B;gBACxC,IAAI,EAAE,wCAAwC;aAC/C;SACF,CAAC;QAEF,OAAO,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;IACxD,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varun-ai07/covenant-mcp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "COVENANT Protocol MCP Server — AI agent access to on-chain task marketplace",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
"postinstall": "node dist/postinstall.js || echo 'COVENANT MCP Server installed. Run: npx covenant add'"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@covenant/sdk": "file:../covenant-sdk",
|
|
21
22
|
"@graphprotocol/graph-cli": "^0.98.1",
|
|
22
23
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
24
|
+
"better-sqlite3": "^12.11.1",
|
|
23
25
|
"dotenv": "^17.3.1",
|
|
24
26
|
"express": "^5.2.1",
|
|
25
27
|
"express-rate-limit": "^8.5.1",
|
|
@@ -27,6 +29,7 @@
|
|
|
27
29
|
"viem": "^2.23.0"
|
|
28
30
|
},
|
|
29
31
|
"devDependencies": {
|
|
32
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
30
33
|
"@types/express": "^5.0.0",
|
|
31
34
|
"@types/node": "^25.6.0",
|
|
32
35
|
"tsx": "^4.19.0",
|