@varun-ai07/covenant-mcp 1.2.2 → 1.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 +128 -12
- package/dist/abis/MultiTokenEscrow.json +836 -0
- package/dist/abis/v2/AgentRegistry.json +872 -0
- package/dist/abis/v2/DisputeResolution.json +493 -0
- package/dist/abis/v2/InsurancePool.json +645 -0
- package/dist/abis/v2/ReceiptVerifier.json +394 -0
- package/dist/abis/v2/RevisionManager.json +544 -0
- package/dist/abis/v2/TaskEscrow.json +1018 -0
- package/dist/cli.js +0 -0
- package/dist/config.d.ts +13 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +84 -25
- package/dist/config.js.map +1 -1
- package/dist/handlers/wallet.d.ts.map +1 -1
- package/dist/handlers/wallet.js +1 -1
- package/dist/handlers/wallet.js.map +1 -1
- package/dist/lib/did.d.ts +72 -0
- package/dist/lib/did.d.ts.map +1 -0
- package/dist/lib/did.js +115 -0
- package/dist/lib/did.js.map +1 -0
- package/dist/lib/events.d.ts.map +1 -1
- package/dist/lib/events.js +2 -2
- package/dist/lib/events.js.map +1 -1
- package/dist/lib/formatResponse.d.ts +33 -0
- package/dist/lib/formatResponse.d.ts.map +1 -0
- package/dist/lib/formatResponse.js +92 -0
- package/dist/lib/formatResponse.js.map +1 -0
- package/dist/lib/schemaHelpers.d.ts +11 -0
- package/dist/lib/schemaHelpers.d.ts.map +1 -0
- package/dist/lib/schemaHelpers.js +11 -0
- package/dist/lib/schemaHelpers.js.map +1 -0
- package/dist/lib/store.d.ts +10 -0
- package/dist/lib/store.d.ts.map +1 -0
- package/dist/lib/store.js +39 -0
- package/dist/lib/store.js.map +1 -0
- package/dist/lib/verify.d.ts +21 -0
- package/dist/lib/verify.d.ts.map +1 -0
- package/dist/lib/verify.js +568 -0
- package/dist/lib/verify.js.map +1 -0
- package/dist/schemas.d.ts +5 -5
- package/dist/schemas.d.ts.map +1 -1
- package/dist/server.d.ts +1 -25
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +53 -37
- package/dist/server.js.map +1 -1
- package/dist/tools/account-abstraction.d.ts +3 -0
- package/dist/tools/account-abstraction.d.ts.map +1 -0
- package/dist/tools/account-abstraction.js +364 -0
- package/dist/tools/account-abstraction.js.map +1 -0
- package/dist/tools/batches.d.ts.map +1 -1
- package/dist/tools/batches.js +68 -37
- package/dist/tools/batches.js.map +1 -1
- package/dist/tools/bounties.d.ts +3 -0
- package/dist/tools/bounties.d.ts.map +1 -0
- package/dist/tools/bounties.js +304 -0
- package/dist/tools/bounties.js.map +1 -0
- package/dist/tools/bridge.d.ts +3 -0
- package/dist/tools/bridge.d.ts.map +1 -0
- package/dist/tools/bridge.js +190 -0
- package/dist/tools/bridge.js.map +1 -0
- package/dist/tools/collectives.d.ts.map +1 -1
- package/dist/tools/collectives.js +75 -48
- package/dist/tools/collectives.js.map +1 -1
- package/dist/tools/covenant-help.d.ts +3 -0
- package/dist/tools/covenant-help.d.ts.map +1 -0
- package/dist/tools/covenant-help.js +321 -0
- package/dist/tools/covenant-help.js.map +1 -0
- package/dist/tools/cross-chain.d.ts +3 -0
- package/dist/tools/cross-chain.d.ts.map +1 -0
- package/dist/tools/cross-chain.js +77 -0
- package/dist/tools/cross-chain.js.map +1 -0
- package/dist/tools/disputes.d.ts.map +1 -1
- package/dist/tools/disputes.js +39 -33
- package/dist/tools/disputes.js.map +1 -1
- package/dist/tools/escrow.d.ts.map +1 -1
- package/dist/tools/escrow.js +277 -202
- package/dist/tools/escrow.js.map +1 -1
- package/dist/tools/fiat-onramp.d.ts +3 -0
- package/dist/tools/fiat-onramp.d.ts.map +1 -0
- package/dist/tools/fiat-onramp.js +108 -0
- package/dist/tools/fiat-onramp.js.map +1 -0
- package/dist/tools/governance.d.ts +3 -0
- package/dist/tools/governance.d.ts.map +1 -0
- package/dist/tools/governance.js +271 -0
- package/dist/tools/governance.js.map +1 -0
- package/dist/tools/grants.d.ts +3 -0
- package/dist/tools/grants.d.ts.map +1 -0
- package/dist/tools/grants.js +269 -0
- package/dist/tools/grants.js.map +1 -0
- package/dist/tools/insurance.d.ts.map +1 -1
- package/dist/tools/insurance.js +92 -45
- package/dist/tools/insurance.js.map +1 -1
- package/dist/tools/market.d.ts.map +1 -1
- package/dist/tools/market.js +122 -103
- package/dist/tools/market.js.map +1 -1
- package/dist/tools/matching.d.ts +3 -0
- package/dist/tools/matching.d.ts.map +1 -0
- package/dist/tools/matching.js +233 -0
- package/dist/tools/matching.js.map +1 -0
- package/dist/tools/messaging.d.ts +3 -0
- package/dist/tools/messaging.d.ts.map +1 -0
- package/dist/tools/messaging.js +159 -0
- package/dist/tools/messaging.js.map +1 -0
- package/dist/tools/multi-token.d.ts +3 -0
- package/dist/tools/multi-token.d.ts.map +1 -0
- package/dist/tools/multi-token.js +274 -0
- package/dist/tools/multi-token.js.map +1 -0
- package/dist/tools/offchain-coordinator.d.ts +3 -0
- package/dist/tools/offchain-coordinator.d.ts.map +1 -0
- package/dist/tools/offchain-coordinator.js +436 -0
- package/dist/tools/offchain-coordinator.js.map +1 -0
- package/dist/tools/protocol.d.ts.map +1 -1
- package/dist/tools/protocol.js +19 -6
- package/dist/tools/protocol.js.map +1 -1
- package/dist/tools/receipts.d.ts.map +1 -1
- package/dist/tools/receipts.js +45 -22
- package/dist/tools/receipts.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +90 -43
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/reputation-vc.d.ts +3 -0
- package/dist/tools/reputation-vc.d.ts.map +1 -0
- package/dist/tools/reputation-vc.js +438 -0
- package/dist/tools/reputation-vc.js.map +1 -0
- package/dist/tools/revisions.d.ts +3 -0
- package/dist/tools/revisions.d.ts.map +1 -0
- package/dist/tools/revisions.js +108 -0
- package/dist/tools/revisions.js.map +1 -0
- package/dist/tools/router.d.ts +3 -0
- package/dist/tools/router.d.ts.map +1 -0
- package/dist/tools/router.js +104 -0
- package/dist/tools/router.js.map +1 -0
- package/dist/tools/streaming.d.ts +3 -0
- package/dist/tools/streaming.d.ts.map +1 -0
- package/dist/tools/streaming.js +350 -0
- package/dist/tools/streaming.js.map +1 -0
- package/dist/tools/templates.d.ts +3 -0
- package/dist/tools/templates.d.ts.map +1 -0
- package/dist/tools/templates.js +392 -0
- package/dist/tools/templates.js.map +1 -0
- package/dist/tools/training.d.ts +3 -0
- package/dist/tools/training.d.ts.map +1 -0
- package/dist/tools/training.js +304 -0
- package/dist/tools/training.js.map +1 -0
- package/dist/tools/v2-settlement.d.ts +3 -0
- package/dist/tools/v2-settlement.d.ts.map +1 -0
- package/dist/tools/v2-settlement.js +226 -0
- package/dist/tools/v2-settlement.js.map +1 -0
- package/dist/tools/verification.d.ts +3 -0
- package/dist/tools/verification.d.ts.map +1 -0
- package/dist/tools/verification.js +215 -0
- package/dist/tools/verification.js.map +1 -0
- package/dist/tools/verify-deep.d.ts +3 -0
- package/dist/tools/verify-deep.d.ts.map +1 -0
- package/dist/tools/verify-deep.js +125 -0
- package/dist/tools/verify-deep.js.map +1 -0
- package/dist/types.d.ts +16 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -23
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +2 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +8 -34
- package/dist/utils.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatResponse.d.ts","sourceRoot":"","sources":["../../src/lib/formatResponse.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,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+1,92 @@
|
|
|
1
|
+
import { formatEther, parseEther } from "viem";
|
|
2
|
+
// ─── Success Formatter ────────────────────────────────────────
|
|
3
|
+
export function formatSuccess(summary, data, txHash, nextSteps, workflowState) {
|
|
4
|
+
const response = {
|
|
5
|
+
success: true,
|
|
6
|
+
summary,
|
|
7
|
+
data,
|
|
8
|
+
...(txHash && {
|
|
9
|
+
txHash,
|
|
10
|
+
basescanUrl: `https://sepolia.basescan.org/tx/${txHash}`,
|
|
11
|
+
}),
|
|
12
|
+
...(nextSteps && { nextSteps }),
|
|
13
|
+
...(workflowState && { workflowState }),
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
// ─── Error Formatter ──────────────────────────────────────────
|
|
20
|
+
export function formatStructuredError(error, cause, fix, retryable = true) {
|
|
21
|
+
const response = {
|
|
22
|
+
success: false,
|
|
23
|
+
error,
|
|
24
|
+
cause,
|
|
25
|
+
fix,
|
|
26
|
+
retryable,
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
isError: true,
|
|
30
|
+
content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// ─── Contract Error Parser ────────────────────────────────────
|
|
34
|
+
export function parseContractError(err) {
|
|
35
|
+
const msg = String(err);
|
|
36
|
+
if (msg.includes("InsufficientStake")) {
|
|
37
|
+
return { success: false, error: "Registration failed: wallet does not have enough ETH for the stake deposit.", cause: "The wallet needs at least 0.001 ETH for the stake plus ~0.0002 ETH for gas.", fix: "Get free testnet ETH at https://app.optimism.io/faucet (select Base Sepolia). Then retry corven_register_agent.", retryable: true };
|
|
38
|
+
}
|
|
39
|
+
if (msg.includes("AlreadyRegistered")) {
|
|
40
|
+
return { success: false, error: "This wallet address is already registered as an agent.", cause: "corven_register_agent can only be called once per wallet address.", fix: "Use corven_get_agent with this wallet address to see the existing profile.", retryable: false };
|
|
41
|
+
}
|
|
42
|
+
if (msg.includes("AgentNotActive") || msg.includes("NotRegistered")) {
|
|
43
|
+
return { success: false, error: "The specified agent address is not registered or has been deactivated.", cause: "Either the wallet has never called corven_register_agent, or the agent was deactivated.", fix: "Call corven_get_agent with the address to check status. If not registered, call corven_register_agent first.", retryable: false };
|
|
44
|
+
}
|
|
45
|
+
if (msg.includes("InvalidStatus")) {
|
|
46
|
+
return { success: false, error: "This operation cannot be performed on a task in its current status.", cause: "Each task function is only valid at specific lifecycle states.", fix: "Call corven_get_task to see the current status. Funded -> corven_submit_work. Submitted -> corven_verify_task or corven_dispute_task.", retryable: false };
|
|
47
|
+
}
|
|
48
|
+
if (msg.includes("DeadlinePassed")) {
|
|
49
|
+
return { success: false, error: "The task deadline has already passed.", cause: "The Unix timestamp deadline set when the task was created has elapsed.", fix: "The task is now in Failed state. Call corven_get_task to confirm. If the worker submitted before deadline, call corven_dispute_task.", retryable: false };
|
|
50
|
+
}
|
|
51
|
+
if (msg.includes("NotAuthorized") || msg.includes("OwnableUnauthorizedAccount") || msg.includes("Unauthorized")) {
|
|
52
|
+
return { success: false, error: "Your wallet does not have permission to call this function.", cause: "Only the designated client, worker, or contract owner can call this function.", fix: "Ensure PRIVATE_KEY in your environment matches the client or worker address for this task.", retryable: false };
|
|
53
|
+
}
|
|
54
|
+
if (msg.includes("insufficient funds") || msg.includes("InsufficientFunds")) {
|
|
55
|
+
return { success: false, error: "Wallet does not have enough ETH to cover this transaction.", cause: "The total cost (payment amount + gas fee) exceeds the wallet balance.", fix: "Get free testnet ETH at https://app.optimism.io/faucet (select Base Sepolia). You need the payment amount plus approximately 0.0005 ETH for gas.", retryable: true };
|
|
56
|
+
}
|
|
57
|
+
if (msg.includes("SelfHire")) {
|
|
58
|
+
return { success: false, error: "You cannot hire yourself as the worker for your own task.", cause: "The client and worker wallet addresses must be different.", fix: "Call corven_find_workers to find a different registered agent.", retryable: false };
|
|
59
|
+
}
|
|
60
|
+
if (msg.includes("TaskNotFound") || msg.includes("task not found")) {
|
|
61
|
+
return { success: false, error: "No task found with that ID.", cause: "The taskId does not exist on this contract.", fix: "Call corven_get_client_tasks or corven_get_worker_tasks with your wallet address to find valid task IDs.", retryable: false };
|
|
62
|
+
}
|
|
63
|
+
if (msg.includes("BidAlreadySubmitted")) {
|
|
64
|
+
return { success: false, error: "You have already submitted a bid on this task.", cause: "Only one bid per worker per open task is allowed.", fix: "Call corven_get_bid to see your existing bid. To change your offer, call corven_withdraw_bid first, then resubmit.", retryable: false };
|
|
65
|
+
}
|
|
66
|
+
if (msg.includes("IPFS") || msg.includes("ipfs")) {
|
|
67
|
+
return { success: false, error: "IPFS hash could not be resolved.", cause: "The IPFS CID provided is not reachable through any gateway.", fix: "Re-upload your content to Pinata (pinata.cloud) and use the returned CID. Wait 30 seconds after upload for propagation.", retryable: true };
|
|
68
|
+
}
|
|
69
|
+
return { success: false, error: "Transaction failed with an unexpected error.", cause: msg.slice(0, 300), fix: "Verify all parameters are correct format (ETH as decimal strings, addresses as full 42-char 0x... values). Check wallet has enough ETH for gas.", retryable: true };
|
|
70
|
+
}
|
|
71
|
+
// ─── Pre-flight Validators ────────────────────────────────────
|
|
72
|
+
export async function validateWorkerRegistered(registry, workerAddress) {
|
|
73
|
+
try {
|
|
74
|
+
const worker = await registry.read.agents([workerAddress]);
|
|
75
|
+
if (!worker.isActive) {
|
|
76
|
+
return { success: false, error: `Worker address ${workerAddress} is not registered or has been deactivated.`, cause: "The TaskEscrow contract will reject tasks for unregistered workers.", fix: "Call corven_find_workers with the required capability to find registered workers.", retryable: false };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return { success: false, error: `Could not verify worker ${workerAddress} -- address may not be registered.`, cause: "Registry lookup failed for this address.", fix: "Call corven_get_agent with the worker address to check registration.", retryable: false };
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
export async function validateBalance(publicClient, address, requiredEth, gasBufferEth = "0.0005") {
|
|
85
|
+
const balance = await publicClient.getBalance({ address });
|
|
86
|
+
const required = parseEther(requiredEth) + parseEther(gasBufferEth);
|
|
87
|
+
if (balance < required) {
|
|
88
|
+
return { success: false, error: `Insufficient ETH. Need ${formatEther(required)} ETH total, wallet has ${formatEther(balance)} ETH.`, cause: "Wallet balance does not cover payment amount plus gas fees.", fix: `Get free testnet ETH at https://app.optimism.io/faucet (select Base Sepolia). Add at least ${formatEther(required - balance)} ETH more.`, retryable: true };
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=formatResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatResponse.js","sourceRoot":"","sources":["../../src/lib/formatResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAsB/C,iEAAiE;AAEjE,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,IAA6B,EAC7B,MAAe,EACf,SAAoB,EACpB,aAAuC;IAEvC,MAAM,QAAQ,GAAoB;QAChC,OAAO,EAAE,IAAI;QACb,OAAO;QACP,IAAI;QACJ,GAAG,CAAC,MAAM,IAAI;YACZ,MAAM;YACN,WAAW,EAAE,mCAAmC,MAAM,EAAE;SACzD,CAAC;QACF,GAAG,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;KACxC,CAAC;IACF,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,iEAAiE;AAEjE,MAAM,UAAU,qBAAqB,CACnC,KAAa,EACb,KAAa,EACb,GAAW,EACX,SAAS,GAAG,IAAI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EAAE,KAAK,EAAE,qEAAqE,EAAE,GAAG,EAAE,mFAAmF,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC3S,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,aAAa,oCAAoC,EAAE,KAAK,EAAE,0CAA0C,EAAE,GAAG,EAAE,sEAAsE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACnQ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,YAAiB,EACjB,OAAsB,EACtB,WAAmB,EACnB,YAAY,GAAG,QAAQ;IAEvB,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACpE,IAAI,OAAO,GAAG,QAAQ,EAAE,CAAC;QACvB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,0BAA0B,WAAW,CAAC,QAAQ,CAAC,0BAA0B,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,6DAA6D,EAAE,GAAG,EAAE,8FAA8F,WAAW,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAChX,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ethAddress: z.ZodString;
|
|
3
|
+
export declare const ethAmount: z.ZodString;
|
|
4
|
+
export declare const ethStake: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
export declare const ipfsCid: z.ZodString;
|
|
6
|
+
export declare const unixDeadline: z.ZodNumber;
|
|
7
|
+
export declare const taskId: z.ZodNumber;
|
|
8
|
+
export declare const agentName: z.ZodString;
|
|
9
|
+
export declare const capabilities: z.ZodArray<z.ZodString, "many">;
|
|
10
|
+
export declare const priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
//# sourceMappingURL=schemaHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaHelpers.d.ts","sourceRoot":"","sources":["../../src/lib/schemaHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,UAAU,aAEtB,CAAC;AAEF,eAAO,MAAM,SAAS,aAErB,CAAC;AAEF,eAAO,MAAM,QAAQ,0CAEpB,CAAC;AAEF,eAAO,MAAM,OAAO,aAEnB,CAAC;AAEF,eAAO,MAAM,YAAY,aAExB,CAAC;AAEF,eAAO,MAAM,MAAM,aAElB,CAAC;AAEF,eAAO,MAAM,SAAS,aAErB,CAAC;AAEF,eAAO,MAAM,YAAY,iCAExB,CAAC;AAEF,eAAO,MAAM,QAAQ,0CAEpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const ethAddress = z.string().describe('Full 42-character Ethereum address starting with 0x. Example: "0x715f3b64189EcA51a57567962Cd2278dc7a5e92C". Do NOT pass ENS names. Do NOT abbreviate. Must be exactly 42 characters.');
|
|
3
|
+
export const ethAmount = z.string().describe('Payment amount in ETH as a decimal string. Examples: "0.001" (1 milliETH), "0.01" (10 milliETH). Do NOT pass wei values. Do NOT pass plain numbers. Always a quoted decimal string.');
|
|
4
|
+
export const ethStake = z.string().optional().default("0.001").describe('Stake deposit in ETH as a decimal string. Minimum is "0.001". This is held as a security deposit, not a fee. It is returned when you deregister cleanly.');
|
|
5
|
+
export const ipfsCid = z.string().describe('IPFS content identifier (CID). Starts with "Qm" (CIDv0, 46 chars) or "bafy" (CIDv1). Upload your content to Pinata (pinata.cloud) first, then pass the returned CID here.');
|
|
6
|
+
export const unixDeadline = z.number().describe('Unix timestamp in seconds when the task expires. For 24 hours from now: Math.floor(Date.now()/1000) + 86400. For 48 hours: Math.floor(Date.now()/1000) + 172800. Must be a number (not string) and must be in the future.');
|
|
7
|
+
export const taskId = z.number().describe('Numeric task ID returned by corven_create_task or corven_post_open_task. Example: 42. Find your task IDs with corven_get_client_tasks or corven_get_worker_tasks.');
|
|
8
|
+
export const agentName = z.string().min(1).max(100).describe('Human-readable display name for this agent. Stored permanently on-chain. Examples: "ResearchBot", "DataAnalystPro", "CodeReviewAgent".');
|
|
9
|
+
export const capabilities = z.array(z.string()).min(1).max(10).describe('Array of capability tags this agent can perform. Valid values: "data-analysis", "code-review", "content-writing", "financial-analysis", "research", "translation", "testing", "security-audit", "documentation", "smart-contract", "python", "visualization", "api-integration", "ml-training", "design". Maximum 10 capabilities per agent.');
|
|
10
|
+
export const priority = z.number().min(0).max(3).optional().default(1).describe('Task priority level. 0 = Low, 1 = Medium (default), 2 = High, 3 = Urgent. Use 1 for most tasks.');
|
|
11
|
+
//# sourceMappingURL=schemaHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaHelpers.js","sourceRoot":"","sources":["../../src/lib/schemaHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAC3C,sLAAsL,CACvL,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAC1C,qLAAqL,CACtL,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CACrE,0JAA0J,CAC3J,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CACxC,2KAA2K,CAC5K,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAC7C,2NAA2N,CAC5N,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CACvC,mKAAmK,CACpK,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAC1D,wIAAwI,CACzI,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CACrE,8UAA8U,CAC/U,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAC7E,iGAAiG,CAClG,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load a persisted store by name. Returns `defaultValue` when no file exists
|
|
3
|
+
* or the file cannot be parsed.
|
|
4
|
+
*/
|
|
5
|
+
export declare function loadStore<T>(name: string, defaultValue: T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Persist a store to disk immediately. Call after every mutation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function saveStore<T>(name: string, data: T): void;
|
|
10
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/lib/store.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAS7D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAIxD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local JSON file persistence for in-memory MCP stores.
|
|
3
|
+
*
|
|
4
|
+
* Data lives under <cwd>/.covenant-data/<name>.json so it survives server
|
|
5
|
+
* restarts while keeping the in-memory Map / Set semantics during runtime.
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
const DATA_DIR = join(process.cwd(), ".covenant-data");
|
|
10
|
+
function ensureDir() {
|
|
11
|
+
if (!existsSync(DATA_DIR)) {
|
|
12
|
+
mkdirSync(DATA_DIR, { recursive: true });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Load a persisted store by name. Returns `defaultValue` when no file exists
|
|
17
|
+
* or the file cannot be parsed.
|
|
18
|
+
*/
|
|
19
|
+
export function loadStore(name, defaultValue) {
|
|
20
|
+
ensureDir();
|
|
21
|
+
const filePath = join(DATA_DIR, `${name}.json`);
|
|
22
|
+
if (!existsSync(filePath))
|
|
23
|
+
return defaultValue;
|
|
24
|
+
try {
|
|
25
|
+
return JSON.parse(readFileSync(filePath, "utf-8"));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return defaultValue;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Persist a store to disk immediately. Call after every mutation.
|
|
33
|
+
*/
|
|
34
|
+
export function saveStore(name, data) {
|
|
35
|
+
ensureDir();
|
|
36
|
+
const filePath = join(DATA_DIR, `${name}.json`);
|
|
37
|
+
writeFileSync(filePath, JSON.stringify(data, null, 2), "utf-8");
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/lib/store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAEvD,SAAS,SAAS;IAChB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAI,IAAY,EAAE,YAAe;IACxD,SAAS,EAAE,CAAC;IACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC;IAChD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,YAAY,CAAC;IAC/C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAM,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAI,IAAY,EAAE,IAAO;IAChD,SAAS,EAAE,CAAC;IACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC;IAChD,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface VerificationResult {
|
|
2
|
+
score: number;
|
|
3
|
+
verdict: "pass" | "fail" | "partial";
|
|
4
|
+
checks: CheckResult[];
|
|
5
|
+
summary: string;
|
|
6
|
+
recommendations: string[];
|
|
7
|
+
evidenceHash: string;
|
|
8
|
+
repoUrl: string;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
}
|
|
11
|
+
interface CheckResult {
|
|
12
|
+
dimension: string;
|
|
13
|
+
score: number;
|
|
14
|
+
details: string;
|
|
15
|
+
issues: string[];
|
|
16
|
+
passed: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function cloneRepo(url: string): Promise<string>;
|
|
19
|
+
export declare function verifyProject(repoUrl: string, requirements: string, depth?: "quick" | "standard" | "deep"): Promise<VerificationResult>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/lib/verify.ts"],"names":[],"mappings":"AAOA,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB;AAID,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI5D;AAID,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,KAAK,GAAE,OAAO,GAAG,UAAU,GAAG,MAAmB,GAChD,OAAO,CAAC,kBAAkB,CAAC,CAgE7B"}
|