@aifinpay/mcp 1.5.3 → 2.0.0-rc.13
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 +116 -69
- package/bin/aifinpay-mcp.js +119 -49
- package/dist/api.d.ts +2 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +6 -0
- package/dist/api.js.map +1 -0
- package/dist/config.d.ts +35 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +63 -0
- package/dist/config.js.map +1 -1
- package/dist/identity.d.ts +9 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +75 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/safe-fetch.d.ts +2 -0
- package/dist/safe-fetch.d.ts.map +1 -1
- package/dist/safe-fetch.js +76 -17
- package/dist/safe-fetch.js.map +1 -1
- package/dist/server.d.ts +11 -8
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +106 -102
- package/dist/server.js.map +1 -1
- package/dist/tools/agent-address.d.ts.map +1 -1
- package/dist/tools/agent-address.js +6 -27
- package/dist/tools/agent-address.js.map +1 -1
- package/dist/tools/agent-history.d.ts +58 -0
- package/dist/tools/agent-history.d.ts.map +1 -0
- package/dist/tools/agent-history.js +73 -0
- package/dist/tools/agent-history.js.map +1 -0
- package/dist/tools/agent-quota.d.ts +40 -0
- package/dist/tools/agent-quota.d.ts.map +1 -0
- package/dist/tools/agent-quota.js +95 -0
- package/dist/tools/agent-quota.js.map +1 -0
- package/dist/tools/dev-payment-quote.d.ts +39 -0
- package/dist/tools/dev-payment-quote.d.ts.map +1 -0
- package/dist/tools/dev-payment-quote.js +52 -0
- package/dist/tools/dev-payment-quote.js.map +1 -0
- package/dist/tools/production-control.d.ts +108 -0
- package/dist/tools/production-control.d.ts.map +1 -0
- package/dist/tools/production-control.js +132 -0
- package/dist/tools/production-control.js.map +1 -0
- package/package.json +8 -22
- package/skills/SKILL.md +143 -0
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,+BAA+B,CAAC;AAEvC,2EAA2E;AAC3E,8EAA8E;AAC9E,qDAAqD;AACrD,MAAM,SAAS,GAAG,aAAa,CAAC;IAC9B,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,4BAA4B,KAAK,GAAG;IAC9D,8EAA8E;IAC9E,0EAA0E;IAC1E,YA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AAC,CAAC;YAClD,KAAK,mBAAmB;gBACtB,OAAO,mBAAmB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,KAAK,oBAAoB;gBACvB,OAAO,oBAAoB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC/C;gBACE,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,IAAI,EAAE,EAAE,CAAC;iBACtE,CAAC;QACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,IAAI,KAAK,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACnD,CAAC;AAQD,SAAS,UAAU,CAAC,KAAgC,EAAE,GAAW;IAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,IAAI,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-address.d.ts","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"agent-address.d.ts","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B/B;AAED,wBAAsB,eAAe,CACnC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GAe/B"}
|
|
@@ -1,38 +1,25 @@
|
|
|
1
1
|
export function agentAddressTool() {
|
|
2
2
|
return {
|
|
3
3
|
name: "agent_address",
|
|
4
|
-
description: "Return the agent's on-chain
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"and other bridges advertising Polygon settlement. Solana (base58) — " +
|
|
8
|
-
"for the leaderboard / Seat PDA and Solana-native bridges. Casper — " +
|
|
9
|
-
"identity only for now: the address is derived from the same seed and " +
|
|
10
|
-
"can be funded, but this SDK cannot yet sign Casper deploys, so it is " +
|
|
11
|
-
"not a settlement rail here. One seed, three addresses.",
|
|
4
|
+
description: "Return the agent's currently derived on-chain addresses. " +
|
|
5
|
+
"This tool is read-only and never authorizes or signs a payment. " +
|
|
6
|
+
"Production value movement is available only through the verified SDK v2 settlement executor after trusted deployment pins are released.",
|
|
12
7
|
inputSchema: {
|
|
13
8
|
type: "object",
|
|
14
9
|
properties: {},
|
|
15
10
|
},
|
|
16
|
-
// OpenAI Apps SDK requires impact hints on every tool (omitting = validation error).
|
|
17
11
|
annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false },
|
|
18
12
|
outputSchema: {
|
|
19
13
|
type: "object",
|
|
20
14
|
properties: {
|
|
21
15
|
solana: { type: "string", description: "Solana base58 address" },
|
|
22
|
-
evm: { type: "string", description: "
|
|
23
|
-
// Declared because the handler returns it. A field present in the
|
|
24
|
-
// payload but absent from the schema is how a client silently drops
|
|
25
|
-
// it — the address would be derived, returned, and never shown.
|
|
16
|
+
evm: { type: "string", description: "EVM address used across EVM networks" },
|
|
26
17
|
casper: {
|
|
27
18
|
type: "string",
|
|
28
|
-
description: "Casper
|
|
29
|
-
"and fundable, but this SDK cannot sign Casper deploys yet.",
|
|
19
|
+
description: "Casper identity derived from the same seed. Read-only in this MCP RC; no payment signing tool is exposed.",
|
|
30
20
|
},
|
|
31
21
|
note: { type: "string" },
|
|
32
22
|
},
|
|
33
|
-
// `casper` is deliberately not required: an agent built from a raw EVM
|
|
34
|
-
// key has no seed to derive it from, and claiming it always exists
|
|
35
|
-
// would make that case look like a bug rather than a limitation.
|
|
36
23
|
required: ["solana", "evm"],
|
|
37
24
|
},
|
|
38
25
|
};
|
|
@@ -41,16 +28,8 @@ export async function runAgentAddress(ctx, _args) {
|
|
|
41
28
|
const payload = {
|
|
42
29
|
solana: ctx.agent.solanaAddress,
|
|
43
30
|
evm: ctx.agent.evmAddress,
|
|
44
|
-
// Casper was absent here while the project counted it among its live
|
|
45
|
-
// networks, so an agent could not be told its own address on a chain we
|
|
46
|
-
// advertise. Same seed as the other two; the account hash is what a Casper
|
|
47
|
-
// explorer expects.
|
|
48
31
|
casper: ctx.agent.casperAddress,
|
|
49
|
-
note: "
|
|
50
|
-
"(io.net, Exa, Venice). Solana is supported via Seat PDA payments. " +
|
|
51
|
-
"Casper has a deployed settlement contract and the SDK derives the " +
|
|
52
|
-
"address, but does not yet sign Casper deploys. " +
|
|
53
|
-
"One seed derives all three — funding any enables that chain.",
|
|
32
|
+
note: "Read-only address discovery. Payment signing is intentionally absent from this MCP production RC until the final SDK v2 release contains independently trusted deployment pins and paid E2E evidence.",
|
|
54
33
|
};
|
|
55
34
|
return {
|
|
56
35
|
content: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-address.js","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"agent-address.js","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,2DAA2D;YAC3D,kEAAkE;YAClE,yIAAyI;QAC3I,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;QACjF,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;gBAChE,GAAG,EAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;gBAC/E,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,2GAA2G;iBAC9G;gBACD,IAAI,EAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;aAC3B;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;SAC5B;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAgB,EAChB,KAA8B;IAE9B,MAAM,OAAO,GAAG;QACd,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,aAAa;QAC/B,GAAG,EAAK,GAAG,CAAC,KAAK,CAAC,UAAU;QAC5B,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,aAAa;QAC/B,IAAI,EACF,uMAAuM;KAC1M,CAAC;IACF,OAAO;QACL,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;SACzD;QACD,iBAAiB,EAAE,OAAO;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ToolContext } from "../server.js";
|
|
2
|
+
export declare function agentHistoryTool(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: string;
|
|
7
|
+
additionalProperties: boolean;
|
|
8
|
+
properties: {
|
|
9
|
+
address: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
passport: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
network: {
|
|
17
|
+
type: string;
|
|
18
|
+
default: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
source: {
|
|
22
|
+
type: string;
|
|
23
|
+
enum: string[];
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
limit: {
|
|
27
|
+
type: string;
|
|
28
|
+
minimum: number;
|
|
29
|
+
maximum: number;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
offset: {
|
|
33
|
+
type: string;
|
|
34
|
+
minimum: number;
|
|
35
|
+
maximum: number;
|
|
36
|
+
default: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
annotations: {
|
|
41
|
+
readOnlyHint: boolean;
|
|
42
|
+
destructiveHint: boolean;
|
|
43
|
+
openWorldHint: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare function runAgentHistory(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
47
|
+
isError: boolean;
|
|
48
|
+
content: {
|
|
49
|
+
type: string;
|
|
50
|
+
text: string;
|
|
51
|
+
}[];
|
|
52
|
+
} | {
|
|
53
|
+
content: {
|
|
54
|
+
type: string;
|
|
55
|
+
text: string;
|
|
56
|
+
}[];
|
|
57
|
+
}>;
|
|
58
|
+
//# sourceMappingURL=agent-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-history.d.ts","sourceRoot":"","sources":["../../src/tools/agent-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc/B;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GA2CpF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { apiUrl } from "../api.js";
|
|
2
|
+
export function agentHistoryTool() {
|
|
3
|
+
return {
|
|
4
|
+
name: "agent_history",
|
|
5
|
+
description: "Read an agent's payment history by EVM address, public passport identifier, or both. Defaults to the current wallet. Transactions are indexed AiFinPay Polygon settlements, not arbitrary wallet transfers. Receipts include retained prepaid batches and test payments. Never pass a seed, private key or API secret as a passport.",
|
|
6
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {
|
|
7
|
+
address: { type: "string" },
|
|
8
|
+
passport: { type: "string", description: "Public @username, AIFP-… number or aifp_agent_… identifier" },
|
|
9
|
+
network: { type: "string", default: "polygon", description: "Exact passport wallet network; indexed transactions currently support polygon only" },
|
|
10
|
+
source: { type: "string", enum: ["transactions", "receipts"], default: "transactions" },
|
|
11
|
+
limit: { type: "integer", minimum: 1, maximum: 100, default: 25 },
|
|
12
|
+
offset: { type: "integer", minimum: 0, maximum: 100000, default: 0 },
|
|
13
|
+
} },
|
|
14
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export async function runAgentHistory(ctx, args) {
|
|
18
|
+
const base = ctx.config.baseUrl || "https://aifinpay.io";
|
|
19
|
+
const source = args.source ?? "transactions", network = args.network ?? "polygon";
|
|
20
|
+
const limit = args.limit ?? 25, offset = args.offset ?? 0;
|
|
21
|
+
const failure = (message) => ({ isError: true, content: [{ type: "text", text: message }] });
|
|
22
|
+
if (!Number.isSafeInteger(limit) || Number(limit) < 1 || Number(limit) > 100 ||
|
|
23
|
+
!Number.isSafeInteger(offset) || Number(offset) < 0 || Number(offset) > 100000)
|
|
24
|
+
return failure("Invalid history pagination");
|
|
25
|
+
if (source !== "receipts" && source !== "transactions")
|
|
26
|
+
return failure("Unknown history source");
|
|
27
|
+
async function get(path) {
|
|
28
|
+
const response = await ctx.agent.inner.fetchImpl(apiUrl(base, path), { headers: { accept: "application/json" } });
|
|
29
|
+
if (!response.ok)
|
|
30
|
+
throw new Error(`HTTP ${response.status} from history/resolver; passport resolution requires a deployed Agent Passport backend`);
|
|
31
|
+
return await response.json();
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
let address = args.address == null ? undefined : String(args.address);
|
|
35
|
+
if (args.passport) {
|
|
36
|
+
const identifier = String(args.passport).trim();
|
|
37
|
+
if (!/^(@[a-z][a-z0-9_]{2,31}|AIFP-\d{1,18}|aifp_agent_[0-9a-f]{32})$/i.test(identifier)) {
|
|
38
|
+
return failure("passport must be a public @username, AIFP number or aifp_agent_* id; never a secret");
|
|
39
|
+
}
|
|
40
|
+
const resolved = await get(`/api/agent/resolve/${encodeURIComponent(identifier)}`);
|
|
41
|
+
if (resolved?.agent?.status !== "active" || !Array.isArray(resolved.agent.wallets))
|
|
42
|
+
throw new Error("Passport is not active or has no verified wallets");
|
|
43
|
+
const wallets = resolved.agent.wallets.filter((w) => w.network === network && w.chain_family === "evm" && Number(w.verified_at) > 0);
|
|
44
|
+
const wallet = wallets.find((w) => w.is_primary) || wallets[0];
|
|
45
|
+
if (!wallet || typeof wallet.address !== "string")
|
|
46
|
+
throw new Error("Passport has no verified EVM wallet on the requested network");
|
|
47
|
+
if (address && address.toLowerCase() !== wallet.address.toLowerCase())
|
|
48
|
+
throw new Error("Address does not match passport wallet");
|
|
49
|
+
address = wallet.address;
|
|
50
|
+
}
|
|
51
|
+
address ??= ctx.agent.evmAddress;
|
|
52
|
+
if (!/^0x[0-9a-fA-F]{40}$/.test(address))
|
|
53
|
+
return failure("Expected an EVM address");
|
|
54
|
+
const query = new URLSearchParams({ limit: String(limit), offset: String(offset) });
|
|
55
|
+
if (source === "transactions")
|
|
56
|
+
query.set("chain", String(network));
|
|
57
|
+
const body = await get(`/v1/agents/${address.toLowerCase()}/${source}?${query}`);
|
|
58
|
+
if (!Array.isArray(body?.[source]))
|
|
59
|
+
throw new Error("Invalid history response");
|
|
60
|
+
const fields = source === "receipts"
|
|
61
|
+
? ["receipt_id", "merchant_id", "resource", "scope", "tier", "quota", "used", "remaining", "amount", "currency", "exp", "chain", "tx_ref", "payer", "network_mode", "settled_at", "expires_at", "unit_quota", "metering_version"]
|
|
62
|
+
: ["tx_hash", "log_index", "chain", "payment_id", "block_number", "block_ts", "agent_address", "merchant_address", "token_address", "total_amount", "merchant_amount", "treasury_fee", "ip_creator_fee"];
|
|
63
|
+
const items = body[source].map((row) => Object.fromEntries(fields.filter(f => row?.[f] !== undefined).map(f => [f, row[f]])));
|
|
64
|
+
return { content: [{ type: "text", text: JSON.stringify({ address: address.toLowerCase(), source, items,
|
|
65
|
+
limit, offset, next_offset: typeof body.next_offset === "number" ? body.next_offset : null,
|
|
66
|
+
coverage: source === "receipts" ? "Retained receipts only; externally metered quotas may lag" : "Indexed AiFinPay Polygon settlements only; excludes arbitrary wallet transfers and may lag the chain",
|
|
67
|
+
}, null, 2) }] };
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return failure(`History lookup failed: ${error.message}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=agent-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-history.js","sourceRoot":"","sources":["../../src/tools/agent-history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,sUAAsU;QACnV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,EAAE;gBACtE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4DAA4D,EAAE;gBACvG,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE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AAW,EAAE,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;wBAC1F,QAAQ,EAAE,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,2DAA2D,CAAC,CAAC,CAAC,sGAAsG;qBACvM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAAC,OAAO,OAAO,CAAC,0BAA2B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ToolContext } from "../server.js";
|
|
2
|
+
export declare function agentQuotaTool(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
merchant_id: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
include_exhausted: {
|
|
13
|
+
type: string;
|
|
14
|
+
default: boolean;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
annotations: {
|
|
20
|
+
readOnlyHint: boolean;
|
|
21
|
+
openWorldHint: boolean;
|
|
22
|
+
destructiveHint: boolean;
|
|
23
|
+
};
|
|
24
|
+
outputSchema: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function runAgentQuota(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
29
|
+
isError: boolean;
|
|
30
|
+
content: {
|
|
31
|
+
type: string;
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
} | {
|
|
35
|
+
content: {
|
|
36
|
+
type: string;
|
|
37
|
+
text: string;
|
|
38
|
+
}[];
|
|
39
|
+
}>;
|
|
40
|
+
//# sourceMappingURL=agent-quota.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-quota.d.ts","sourceRoot":"","sources":["../../src/tools/agent-quota.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EA4B7B;AAiBD,wBAAsB,aAAa,CACjC,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GAwE9B"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const DEFAULT_BASE = "https://api.aifinpay.io";
|
|
2
|
+
export function agentQuotaTool() {
|
|
3
|
+
return {
|
|
4
|
+
name: "agent_quota",
|
|
5
|
+
description: "How many prepaid requests this agent has left, per service. Lists the " +
|
|
6
|
+
"agent's active quota batches (merchant, resource, used, remaining, " +
|
|
7
|
+
"expiry). Read-only; never spends, pays, or signs anything. Ask it " +
|
|
8
|
+
"things like: how many calls do I have left at mrch_x?",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
merchant_id: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: "Optional mrch_… filter — only batches bought from this service.",
|
|
15
|
+
},
|
|
16
|
+
include_exhausted: {
|
|
17
|
+
type: "boolean",
|
|
18
|
+
default: false,
|
|
19
|
+
description: "Also list batches with 0 remaining (still retained, not yet expired).",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
// Talks only to the configured AiFinPay backend, never to arbitrary URLs.
|
|
24
|
+
annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false },
|
|
25
|
+
outputSchema: { type: "object" },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export async function runAgentQuota(ctx, args) {
|
|
29
|
+
const base = (ctx.config.baseUrl ?? DEFAULT_BASE).replace(/\/+$/, "");
|
|
30
|
+
const address = ctx.agent.evmAddress;
|
|
31
|
+
const merchantFilter = typeof args.merchant_id === "string" && args.merchant_id ? args.merchant_id : null;
|
|
32
|
+
const includeExhausted = args.include_exhausted === true;
|
|
33
|
+
let resp;
|
|
34
|
+
try {
|
|
35
|
+
resp = await ctx.agent.inner.fetchImpl(`${base}/v1/agents/${address}/receipts`, { method: "GET" });
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
const err = e;
|
|
39
|
+
return errorResult(`could not reach ${base}: ${err.message}`);
|
|
40
|
+
}
|
|
41
|
+
if (!resp.ok) {
|
|
42
|
+
return errorResult(`quota lookup failed: HTTP ${resp.status}`);
|
|
43
|
+
}
|
|
44
|
+
const body = (await resp.json());
|
|
45
|
+
const now = Math.floor(Date.now() / 1000);
|
|
46
|
+
let batches = (body.receipts ?? [])
|
|
47
|
+
.filter((r) => r.exp == null || r.exp > now)
|
|
48
|
+
.filter((r) => (merchantFilter ? r.merchant_id === merchantFilter : true))
|
|
49
|
+
.filter((r) => includeExhausted || (r.remaining ?? 0) > 0)
|
|
50
|
+
.map((r) => ({
|
|
51
|
+
merchant_id: r.merchant_id,
|
|
52
|
+
resource: r.resource,
|
|
53
|
+
scope: r.scope ?? "exact",
|
|
54
|
+
tier: r.tier,
|
|
55
|
+
used: r.used ?? 0,
|
|
56
|
+
remaining: r.remaining ?? 0,
|
|
57
|
+
quota: r.quota ?? 1,
|
|
58
|
+
paid: r.amount != null ? `${r.amount} ${r.currency ?? "USD"}` : undefined,
|
|
59
|
+
expires: r.exp != null ? new Date(r.exp * 1000).toISOString() : undefined,
|
|
60
|
+
receipt_id: r.receipt_id,
|
|
61
|
+
}));
|
|
62
|
+
// Most useful first: the batches with the most room to spend.
|
|
63
|
+
batches = batches.sort((a, b) => b.remaining - a.remaining);
|
|
64
|
+
// Roll up per merchant so "how much do I have left at X" is one line even
|
|
65
|
+
// when the agent bought several batches there.
|
|
66
|
+
const perMerchant = new Map();
|
|
67
|
+
for (const b of batches) {
|
|
68
|
+
const key = b.merchant_id ?? "unknown";
|
|
69
|
+
const cur = perMerchant.get(key) ?? { remaining: 0, batches: 0 };
|
|
70
|
+
cur.remaining += b.remaining;
|
|
71
|
+
cur.batches += 1;
|
|
72
|
+
perMerchant.set(key, cur);
|
|
73
|
+
}
|
|
74
|
+
const payload = {
|
|
75
|
+
agent: address,
|
|
76
|
+
...(merchantFilter ? { merchant_filter: merchantFilter } : {}),
|
|
77
|
+
totals: Object.fromEntries(perMerchant),
|
|
78
|
+
batches,
|
|
79
|
+
note: batches.length === 0
|
|
80
|
+
? merchantFilter
|
|
81
|
+
? `no active quota at ${merchantFilter} — a new batch starts with that service's 402 (or agent_quote its URL first)`
|
|
82
|
+
: "no active quota anywhere — pay a service's 402 to start a batch"
|
|
83
|
+
: "`remaining` is authoritative where AiFinPay meters (hosted gateway); a merchant running its own @aifinpay/gate meters locally and our copy can lag behind by their traffic.",
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function errorResult(...lines) {
|
|
90
|
+
return {
|
|
91
|
+
isError: true,
|
|
92
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=agent-quota.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-quota.js","sourceRoot":"","sources":["../../src/tools/agent-quota.ts"],"names":[],"mappings":"AAuBA,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAE/C,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,wEAAwE;YACxE,qEAAqE;YACrE,oEAAoE;YACpE,uDAAuD;QACzD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IA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AAC;IAEF,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,GAAG,KAAe;IACrC,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ToolContext } from "../server.js";
|
|
2
|
+
export declare function devPaymentQuoteTool(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: string;
|
|
7
|
+
additionalProperties: boolean;
|
|
8
|
+
properties: {
|
|
9
|
+
contract_version: {
|
|
10
|
+
type: string;
|
|
11
|
+
enum: string[];
|
|
12
|
+
};
|
|
13
|
+
units: {
|
|
14
|
+
type: string;
|
|
15
|
+
minimum: number;
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
required: string[];
|
|
20
|
+
};
|
|
21
|
+
annotations: {
|
|
22
|
+
readOnlyHint: boolean;
|
|
23
|
+
destructiveHint: boolean;
|
|
24
|
+
openWorldHint: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare function runDevPaymentQuote(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
28
|
+
isError: boolean;
|
|
29
|
+
content: {
|
|
30
|
+
type: string;
|
|
31
|
+
text: string;
|
|
32
|
+
}[];
|
|
33
|
+
} | {
|
|
34
|
+
content: {
|
|
35
|
+
type: string;
|
|
36
|
+
text: string;
|
|
37
|
+
}[];
|
|
38
|
+
}>;
|
|
39
|
+
//# sourceMappingURL=dev-payment-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-payment-quote.d.ts","sourceRoot":"","sources":["../../src/tools/dev-payment-quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;EASlC;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GA8BvF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export function devPaymentQuoteTool() {
|
|
2
|
+
return { name: "dev_payment_quote",
|
|
3
|
+
description: "Inspect the dev paid-content challenge and quote a prepaid batch on Amoy. Checks the requested contract version against the deployed quote. Never signs or broadcasts; a version mismatch is an error, not permission to relabel a contract.",
|
|
4
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {
|
|
5
|
+
contract_version: { type: "string", enum: ["1.2", "1.4"] },
|
|
6
|
+
units: { type: "integer", minimum: 1, default: 1000 },
|
|
7
|
+
}, required: ["contract_version"] },
|
|
8
|
+
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export async function runDevPaymentQuote(ctx, args) {
|
|
12
|
+
const fail = (text) => ({ isError: true, content: [{ type: "text", text }] });
|
|
13
|
+
const version = args.contract_version, units = args.units ?? 1000;
|
|
14
|
+
if (version !== "1.2" && version !== "1.4")
|
|
15
|
+
return fail("Choose contract_version 1.2 or 1.4");
|
|
16
|
+
if (!Number.isSafeInteger(units) || Number(units) < 1)
|
|
17
|
+
return fail("units must be a positive integer");
|
|
18
|
+
if (!ctx.config.devMode || !ctx.config.baseUrl)
|
|
19
|
+
return fail("Configure AIFINPAY_MODE=dev and AIFINPAY_BASE_URL explicitly");
|
|
20
|
+
try {
|
|
21
|
+
const base = ctx.config.baseUrl.replace(/\/+$/, "");
|
|
22
|
+
if (["aifinpay.io", "api.aifinpay.io", "gateway.aifinpay.io"].includes(new URL(base).hostname)) {
|
|
23
|
+
return fail("Dev quotes require a separate dev backend URL");
|
|
24
|
+
}
|
|
25
|
+
const fetchImpl = ctx.agent.inner.fetchImpl;
|
|
26
|
+
const resource = "/v1/dev/paid/data";
|
|
27
|
+
const response = await fetchImpl(`${base}${resource}`);
|
|
28
|
+
if (response.status !== 402)
|
|
29
|
+
return fail(`Dev paid route must return 402; received HTTP ${response.status}`);
|
|
30
|
+
const challenge = await response.json();
|
|
31
|
+
if (!challenge?.merchant_id || !challenge.accepted_chains?.includes("amoy"))
|
|
32
|
+
return fail("Dev route has no configured Amoy settlement");
|
|
33
|
+
const quoted = await fetchImpl(`${base}/v1/quote`, { method: "POST", headers: { "content-type": "application/json" },
|
|
34
|
+
body: JSON.stringify({ merchant_id: challenge.merchant_id, resource, scope: "exact", tier: "standard", units,
|
|
35
|
+
payer: ctx.agent.evmAddress }) });
|
|
36
|
+
if (!quoted.ok)
|
|
37
|
+
return fail(`Dev quote failed: HTTP ${quoted.status}`);
|
|
38
|
+
const quote = await quoted.json();
|
|
39
|
+
if (quote.network_mode !== "test" || quote.merchant_id !== challenge.merchant_id ||
|
|
40
|
+
quote.resource !== resource || quote.accepted_chains?.length !== 1 || quote.accepted_chains[0] !== "amoy") {
|
|
41
|
+
return fail("Quote is not bound to this test merchant/resource on Amoy");
|
|
42
|
+
}
|
|
43
|
+
if (quote.settlement_call?.splitter_version !== version)
|
|
44
|
+
return fail(`Requested ${version}; backend advertises ${quote.settlement_call?.splitter_version ?? "no verified version"}. Configure the corresponding dev deployment first.`);
|
|
45
|
+
return { content: [{ type: "text", text: JSON.stringify({ quote, signing_available: false,
|
|
46
|
+
next_step: "Use a separately verified Amoy executor for this exact deployment; current MCP does not broadcast payments. Keep the quote and transaction reference for receipt recovery." }, null, 2) }] };
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return fail("Dev backend unavailable or returned an invalid response");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=dev-payment-quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-payment-quote.js","sourceRoot":"","sources":["../../src/tools/dev-payment-quote.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,mBAAmB;IACjC,OAAO,EAAE,IAAI,EAAE,mBAAmB;QAChC,WAAW,EAAE,8OAA8O;QAC3P,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,EAAE;gBACtE,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;gBAC1D,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;aACtD,EAAE,QAAQ,EAAE,CAAC,kBAAkB,CAAC,EAAE;QACnC,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;KACnF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,GAAgB,EAAE,IAA6B;IACtF,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACtF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC;IAClE,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC,oCAAoC,CAAC,CAAC;IAC9F,IAAI,CAAC,MAAM,CAAC,aAA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ext } from "../server.js";
|
|
2
|
+
export declare function agentPassportResolveTool(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
identifier: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
required: string[];
|
|
14
|
+
};
|
|
15
|
+
annotations: {
|
|
16
|
+
readOnlyHint: boolean;
|
|
17
|
+
openWorldHint: boolean;
|
|
18
|
+
destructiveHint: boolean;
|
|
19
|
+
};
|
|
20
|
+
outputSchema: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare function runAgentPassportResolve(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
25
|
+
content: {
|
|
26
|
+
type: string;
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
}>;
|
|
30
|
+
export declare function settlementRoutesTool(): {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: string;
|
|
35
|
+
properties: {
|
|
36
|
+
route_class: {
|
|
37
|
+
type: string;
|
|
38
|
+
enum: string[];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
annotations: {
|
|
43
|
+
readOnlyHint: boolean;
|
|
44
|
+
openWorldHint: boolean;
|
|
45
|
+
destructiveHint: boolean;
|
|
46
|
+
};
|
|
47
|
+
outputSchema: {
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare function runSettlementRoutes(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
52
|
+
content: {
|
|
53
|
+
type: string;
|
|
54
|
+
text: string;
|
|
55
|
+
}[];
|
|
56
|
+
}>;
|
|
57
|
+
export declare function settlementInvoiceTool(): {
|
|
58
|
+
name: string;
|
|
59
|
+
description: string;
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: string;
|
|
62
|
+
properties: {
|
|
63
|
+
route_class: {
|
|
64
|
+
type: string;
|
|
65
|
+
enum: string[];
|
|
66
|
+
};
|
|
67
|
+
chain: {
|
|
68
|
+
type: string;
|
|
69
|
+
enum: string[];
|
|
70
|
+
};
|
|
71
|
+
asset: {
|
|
72
|
+
type: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
gross_amount: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
merchant_wallet: {
|
|
80
|
+
type: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
order_id: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
valid_until: {
|
|
87
|
+
type: string;
|
|
88
|
+
description: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
required: string[];
|
|
92
|
+
};
|
|
93
|
+
annotations: {
|
|
94
|
+
readOnlyHint: boolean;
|
|
95
|
+
openWorldHint: boolean;
|
|
96
|
+
destructiveHint: boolean;
|
|
97
|
+
};
|
|
98
|
+
outputSchema: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export declare function runSettlementInvoice(ctx: ToolContext, args: Record<string, unknown>): Promise<{
|
|
103
|
+
content: {
|
|
104
|
+
type: string;
|
|
105
|
+
text: string;
|
|
106
|
+
}[];
|
|
107
|
+
}>;
|
|
108
|
+
//# sourceMappingURL=production-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production-control.d.ts","sourceRoot":"","sources":["../../src/tools/production-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA+BhD,wBAAgB,wBAAwB;;;;;;;;;;;;;;;;;;;;;EAgBvC;AAED,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAS5F;AAED,wBAAgB,oBAAoB;;;;;;;;;;;;;;;;;;;;EAgBnC;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAQxF;AAED,wBAAgB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBpC;AAED,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAuBzF"}
|