@tabai/sdk 0.2.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/LICENSE +23 -0
- package/README.md +401 -0
- package/bin/tab.mjs +23 -0
- package/dist/_shared/abi.d.ts +150 -0
- package/dist/_shared/abi.d.ts.map +1 -0
- package/dist/_shared/abi.js +197 -0
- package/dist/_shared/abi.js.map +1 -0
- package/dist/_shared/chains.d.ts +118 -0
- package/dist/_shared/chains.d.ts.map +1 -0
- package/dist/_shared/chains.js +89 -0
- package/dist/_shared/chains.js.map +1 -0
- package/dist/_shared/hex.d.ts +35 -0
- package/dist/_shared/hex.d.ts.map +1 -0
- package/dist/_shared/hex.js +40 -0
- package/dist/_shared/hex.js.map +1 -0
- package/dist/_shared/index.d.ts +14 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +14 -0
- package/dist/_shared/index.js.map +1 -0
- package/dist/_shared/keccak256.d.ts +29 -0
- package/dist/_shared/keccak256.d.ts.map +1 -0
- package/dist/_shared/keccak256.js +145 -0
- package/dist/_shared/keccak256.js.map +1 -0
- package/dist/_shared/result.d.ts +78 -0
- package/dist/_shared/result.d.ts.map +1 -0
- package/dist/_shared/result.js +61 -0
- package/dist/_shared/result.js.map +1 -0
- package/dist/cli/client-config.d.ts +155 -0
- package/dist/cli/client-config.d.ts.map +1 -0
- package/dist/cli/client-config.js +382 -0
- package/dist/cli/client-config.js.map +1 -0
- package/dist/cli/connect.d.ts +76 -0
- package/dist/cli/connect.d.ts.map +1 -0
- package/dist/cli/connect.js +158 -0
- package/dist/cli/connect.js.map +1 -0
- package/dist/cli/doctor.d.ts +57 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +253 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +13 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/main.d.ts +45 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +371 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/errors.d.ts +29 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +37 -0
- package/dist/errors.js.map +1 -0
- package/dist/http/client-402.d.ts +243 -0
- package/dist/http/client-402.d.ts.map +1 -0
- package/dist/http/client-402.js +515 -0
- package/dist/http/client-402.js.map +1 -0
- package/dist/http/headers.d.ts +173 -0
- package/dist/http/headers.d.ts.map +1 -0
- package/dist/http/headers.js +284 -0
- package/dist/http/headers.js.map +1 -0
- package/dist/http/index.d.ts +15 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +15 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/metering-claim.d.ts +82 -0
- package/dist/http/metering-claim.d.ts.map +1 -0
- package/dist/http/metering-claim.js +99 -0
- package/dist/http/metering-claim.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +40 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +50 -0
- package/dist/logger.js.map +1 -0
- package/dist/mcp/assets.d.ts +31 -0
- package/dist/mcp/assets.d.ts.map +1 -0
- package/dist/mcp/assets.js +78 -0
- package/dist/mcp/assets.js.map +1 -0
- package/dist/mcp/index.d.ts +19 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +19 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/json-schema.d.ts +86 -0
- package/dist/mcp/json-schema.d.ts.map +1 -0
- package/dist/mcp/json-schema.js +215 -0
- package/dist/mcp/json-schema.js.map +1 -0
- package/dist/mcp/json.d.ts +43 -0
- package/dist/mcp/json.d.ts.map +1 -0
- package/dist/mcp/json.js +69 -0
- package/dist/mcp/json.js.map +1 -0
- package/dist/mcp/registry-client.d.ts +88 -0
- package/dist/mcp/registry-client.d.ts.map +1 -0
- package/dist/mcp/registry-client.js +158 -0
- package/dist/mcp/registry-client.js.map +1 -0
- package/dist/mcp/schemas.d.ts +82 -0
- package/dist/mcp/schemas.d.ts.map +1 -0
- package/dist/mcp/schemas.js +493 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/server.d.ts +97 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +285 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/settings.d.ts +90 -0
- package/dist/mcp/settings.d.ts.map +1 -0
- package/dist/mcp/settings.js +160 -0
- package/dist/mcp/settings.js.map +1 -0
- package/dist/mcp/toolset.d.ts +231 -0
- package/dist/mcp/toolset.d.ts.map +1 -0
- package/dist/mcp/toolset.js +760 -0
- package/dist/mcp/toolset.js.map +1 -0
- package/dist/payments/abi.d.ts +9 -0
- package/dist/payments/abi.d.ts.map +1 -0
- package/dist/payments/abi.js +17 -0
- package/dist/payments/abi.js.map +1 -0
- package/dist/payments/config.d.ts +199 -0
- package/dist/payments/config.d.ts.map +1 -0
- package/dist/payments/config.js +259 -0
- package/dist/payments/config.js.map +1 -0
- package/dist/payments/index.d.ts +13 -0
- package/dist/payments/index.d.ts.map +1 -0
- package/dist/payments/index.js +13 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/payments/kuru.d.ts +191 -0
- package/dist/payments/kuru.d.ts.map +1 -0
- package/dist/payments/kuru.js +377 -0
- package/dist/payments/kuru.js.map +1 -0
- package/dist/payments/monad.d.ts +69 -0
- package/dist/payments/monad.d.ts.map +1 -0
- package/dist/payments/monad.js +306 -0
- package/dist/payments/monad.js.map +1 -0
- package/dist/payments/permit2.d.ts +118 -0
- package/dist/payments/permit2.d.ts.map +1 -0
- package/dist/payments/permit2.js +366 -0
- package/dist/payments/permit2.js.map +1 -0
- package/dist/payments/registry.d.ts +119 -0
- package/dist/payments/registry.d.ts.map +1 -0
- package/dist/payments/registry.js +199 -0
- package/dist/payments/registry.js.map +1 -0
- package/dist/payments/strategy.d.ts +80 -0
- package/dist/payments/strategy.d.ts.map +1 -0
- package/dist/payments/strategy.js +103 -0
- package/dist/payments/strategy.js.map +1 -0
- package/dist/proxy/hooks.d.ts +90 -0
- package/dist/proxy/hooks.d.ts.map +1 -0
- package/dist/proxy/hooks.js +35 -0
- package/dist/proxy/hooks.js.map +1 -0
- package/dist/proxy/index.d.ts +9 -0
- package/dist/proxy/index.d.ts.map +1 -0
- package/dist/proxy/index.js +9 -0
- package/dist/proxy/index.js.map +1 -0
- package/dist/proxy/proxy.d.ts +156 -0
- package/dist/proxy/proxy.d.ts.map +1 -0
- package/dist/proxy/proxy.js +366 -0
- package/dist/proxy/proxy.js.map +1 -0
- package/dist/server/adapters/express.d.ts +89 -0
- package/dist/server/adapters/express.d.ts.map +1 -0
- package/dist/server/adapters/express.js +215 -0
- package/dist/server/adapters/express.js.map +1 -0
- package/dist/server/adapters/hono.d.ts +52 -0
- package/dist/server/adapters/hono.d.ts.map +1 -0
- package/dist/server/adapters/hono.js +61 -0
- package/dist/server/adapters/hono.js.map +1 -0
- package/dist/server/adapters/next.d.ts +52 -0
- package/dist/server/adapters/next.d.ts.map +1 -0
- package/dist/server/adapters/next.js +56 -0
- package/dist/server/adapters/next.js.map +1 -0
- package/dist/server/index.d.ts +30 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +30 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/metering.d.ts +209 -0
- package/dist/server/metering.d.ts.map +1 -0
- package/dist/server/metering.js +365 -0
- package/dist/server/metering.js.map +1 -0
- package/dist/server/post-paid.d.ts +355 -0
- package/dist/server/post-paid.d.ts.map +1 -0
- package/dist/server/post-paid.js +512 -0
- package/dist/server/post-paid.js.map +1 -0
- package/dist/x402/client.d.ts +203 -0
- package/dist/x402/client.d.ts.map +1 -0
- package/dist/x402/client.js +337 -0
- package/dist/x402/client.js.map +1 -0
- package/dist/x402/hub.d.ts +79 -0
- package/dist/x402/hub.d.ts.map +1 -0
- package/dist/x402/hub.js +164 -0
- package/dist/x402/hub.js.map +1 -0
- package/dist/x402/index.d.ts +27 -0
- package/dist/x402/index.d.ts.map +1 -0
- package/dist/x402/index.js +27 -0
- package/dist/x402/index.js.map +1 -0
- package/dist/x402/proxy.d.ts +162 -0
- package/dist/x402/proxy.d.ts.map +1 -0
- package/dist/x402/proxy.js +198 -0
- package/dist/x402/proxy.js.map +1 -0
- package/dist/x402/server.d.ts +162 -0
- package/dist/x402/server.d.ts.map +1 -0
- package/dist/x402/server.js +306 -0
- package/dist/x402/server.js.map +1 -0
- package/dist/x402/wire.d.ts +104 -0
- package/dist/x402/wire.d.ts.map +1 -0
- package/dist/x402/wire.js +265 -0
- package/dist/x402/wire.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../../src/mcp/registry-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA6C/C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEzF;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,CAAC,EAAU,EAAW,EAAE;IAC5C,MAAM,IAAI,GAAI,UAAsE,CAAC,WAAW,CAAC;IACjG,OAAO,OAAO,IAAI,EAAE,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAA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AK,CAAC,KAAK,CAAC,WAAW,EAAE;YAChC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE;YACjC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;SAC3B,CAAC;QACJ,UAAU,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,CAAC,gBAAgB,kBAAkB,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;KACpG,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The keyless read client for the Tab registry read API.\n *\n * `tab_discover` and `tab_status` answer questions about chain state -- which\n * Services are registered, what each tool costs, what an Agent owes -- and every\n * one of those answers is a public fact. Nothing here signs, nothing here\n * authenticates, and nothing here writes. That is why `tab connect` can wire a\n * client up without ever touching a key, and why `tab doctor` can check a\n * deployment end to end from a laptop that holds none.\n *\n * ## Why the read API rather than the chain\n *\n * A Credit Limit is not a storage slot. It is `LimitLib` recomputed over an\n * Agent's committed Settlement history and the Bond ledger, cross-checked\n * against `TabBook.creditLimit` at the same block before it is served. A Bond\n * figure is a sum of `Bond`'s own events, checked against `Bond.ledgerOf`. An\n * MCP server that read the chain directly would have to restate both, and a\n * second restatement that drifts from the first is worse than one source of\n * truth: it would put two different Credit Limits in front of the same model.\n * So the figures come from the one process that already computes and checks\n * them, and this client's whole job is to fetch and not to interpret.\n *\n * The consequence is stated rather than hidden: with no registry read API\n * configured, `tab_discover` and `tab_status` fail with `UPSTREAM` and say so.\n * `tab_call` does not go through here at all -- it reads its figures off the\n * Service's own charge headers -- so a model can still call and be metered while\n * the index is down.\n *\n * ## Structural web types\n *\n * This package compiles against ES2023 with no DOM types, so `fetch`, its\n * response, and the abort signal are described by the shapes this module\n * touches, exactly as `client-402.ts` does. A host `fetch`, `undici`, and a test\n * closure all satisfy {@link RegistryFetch} without any of them being named.\n *\n * Requirements: 24.1, 24.4, 25.1, 25.3\n */\n\nimport type { Result, TabError } from \"../_shared/index.js\";\nimport { ok } from \"../_shared/index.js\";\n\nimport { tabError, upstreamError, validationError } from \"../errors.js\";\nimport { defaultLogger, type Logger } from \"../logger.js\";\nimport { asString, isRecord } from \"./json.js\";\n\n/** The two fields of a response this client reads. */\nexport interface RegistryResponse {\n readonly status: number;\n json(): Promise<unknown>;\n}\n\n/** The `fetch` this client calls. A host `fetch` satisfies it as it stands. */\nexport type RegistryFetch = (url: string, init: Readonly<Record<string, unknown>>) => Promise<RegistryResponse>;\n\nexport interface RegistryReadClientOptions {\n /** Absolute base URL of the read API, with or without a trailing slash. */\n readonly baseUrl: string;\n readonly fetchImpl?: RegistryFetch;\n /** How long one read may take. Defaults to 10 seconds. */\n readonly timeoutMs?: number;\n readonly logger?: Logger;\n}\n\n/** Every read `tab_discover` and `tab_status` make, and nothing else. */\nexport interface RegistryReadClient {\n /** The base URL reads go to, normalised, so an error message can name it. */\n readonly baseUrl: string;\n /** `GET /healthz`, which is what `doctor` asks before it trusts anything else. */\n health(): Promise<Result<unknown>>;\n /** A page of registered Services, hydrated with prices, collections and Bond. */\n services(limit: number): Promise<Result<unknown>>;\n /** One Service, or `NOT_FOUND` when nothing ever registered under the id. */\n service(serviceId: string): Promise<Result<unknown>>;\n /** One Agent's credit picture per Asset. An address with no history is a 200 with empty arrays. */\n agent(address: string): Promise<Result<unknown>>;\n /** Settlements, newest first, filtered by Agent and optionally by Asset. */\n settlements(query: SettlementQuery): Promise<Result<unknown>>;\n /** One Settlement with the transaction that paid it, named by its `settlementId`. */\n settlement(settlementId: string): Promise<Result<unknown>>;\n}\n\nexport interface SettlementQuery {\n readonly agent: string;\n /** The token address alone, which is how the index keys an Asset. */\n readonly asset?: string;\n readonly limit: number;\n}\n\n/** Drops a trailing slash so path joining never produces a double one. */\nexport const normaliseBaseUrl = (baseUrl: string): string => baseUrl.replace(/\\/+$/, \"\");\n\n/**\n * An abort signal that fires after `ms`, when the host has one.\n *\n * Described structurally rather than typed as `AbortSignal`, for the same reason\n * `fetch` is: no DOM types here. A host without `AbortSignal.timeout` gets no\n * signal and the read runs to whatever timeout its transport imposes, which is\n * worse than a bounded read but better than a failure to construct one.\n */\nconst timeoutSignal = (ms: number): unknown => {\n const ctor = (globalThis as { AbortSignal?: { timeout?: (ms: number) => unknown } }).AbortSignal;\n return typeof ctor?.timeout === \"function\" ? ctor.timeout(ms) : undefined;\n};\n\nconst hostFetch = (): RegistryFetch | undefined => {\n const candidate = (globalThis as { fetch?: unknown }).fetch;\n return typeof candidate === \"function\" ? (candidate as RegistryFetch) : undefined;\n};\n\nconst CATEGORIES = [\"VALIDATION\", \"NOT_FOUND\", \"CONFLICT\", \"UPSTREAM\", \"CHAIN\", \"TIMEOUT\", \"INTERNAL\"] as const;\n\n/**\n * Reads the read API's own error body back into a `TabError`.\n *\n * Every route there fails with `{ error: { category, code, message } }` in this\n * package's own vocabulary, so a 404 for an unregistered serviceId arrives here\n * as `NOT_FOUND` / `SERVICE_NOT_REGISTERED` and reaches the model unchanged.\n * Rewriting it as a generic upstream failure would throw away the one part a\n * caller can act on.\n */\nfunction upstreamFailure(url: string, status: number, body: unknown): Result<never> {\n const error = isRecord(body) ? body[\"error\"] : undefined;\n if (isRecord(error)) {\n const category = asString(error[\"category\"], \"\");\n if ((CATEGORIES as readonly string[]).includes(category)) {\n return {\n ok: false,\n error: tabError(\n category as TabError[\"category\"],\n asString(error[\"code\"], \"REGISTRY_READ_FAILED\"),\n asString(error[\"message\"], `the registry read API answered ${status} for ${url}`),\n { details: { url, status } },\n ),\n };\n }\n }\n return upstreamError(\n \"REGISTRY_READ_FAILED\",\n `the registry read API answered ${status} for ${url}`,\n { retryable: status >= 500, details: { url, status } },\n );\n}\n\n/**\n * Builds the client.\n *\n * Construction is total, like every other factory in this package: an unusable\n * base URL is reported by the first read, which is the only place a caller can\n * act on it.\n */\nexport function createRegistryReadClient(options: RegistryReadClientOptions): RegistryReadClient {\n const baseUrl = normaliseBaseUrl(options.baseUrl);\n const timeoutMs = options.timeoutMs ?? 10_000;\n const logger = options.logger ?? defaultLogger;\n\n const get = async (pathname: string, query: Readonly<Record<string, string | undefined>> = {}): Promise<Result<unknown>> => {\n if (!/^https?:\\/\\/[^\\s]+$/.test(baseUrl)) {\n return validationError(\n \"REGISTRY_URL_INVALID\",\n `the registry read API base URL must be an absolute http or https URL, received \\`${options.baseUrl}\\``,\n { details: { baseUrl: options.baseUrl } },\n );\n }\n const send = options.fetchImpl ?? hostFetch();\n if (send === undefined) {\n return upstreamError(\n \"FETCH_UNAVAILABLE\",\n \"this host has no global fetch; supply fetchImpl, or run on Node 20.10 or later\",\n );\n }\n\n const search = Object.entries(query)\n .filter((entry): entry is [string, string] => entry[1] !== undefined)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join(\"&\");\n const url = `${baseUrl}${pathname}${search === \"\" ? \"\" : `?${search}`}`;\n\n const signal = timeoutSignal(timeoutMs);\n let response: RegistryResponse;\n try {\n response = await send(url, {\n method: \"GET\",\n headers: { accept: \"application/json\" },\n ...(signal === undefined ? {} : { signal }),\n });\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n // A transport failure and a timeout are the same shape here and different\n // things to a caller, so the category splits on the abort name.\n const timedOut = error instanceof Error && (error.name === \"TimeoutError\" || error.name === \"AbortError\");\n logger.warn(\"registry read failed\", { url, reason });\n // Both are UPSTREAM: the category vocabulary has no timeout of its own, and a\n // read API that answered nothing in time is an upstream failure whichever way\n // it failed. The code is what tells the two apart, and both are retryable.\n return timedOut\n ? upstreamError(\n \"REGISTRY_READ_TIMEOUT\",\n `the registry read API at ${url} did not answer within ${timeoutMs}ms`,\n { retryable: true, details: { url, timeoutMs } },\n )\n : upstreamError(\"REGISTRY_UNREACHABLE\", `the registry read API at ${url} could not be reached: ${reason}`, {\n retryable: true,\n details: { url },\n });\n }\n\n let body: unknown;\n try {\n body = await response.json();\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n return upstreamError(\n \"REGISTRY_BODY_UNREADABLE\",\n `the registry read API at ${url} answered ${response.status} with a body that is not JSON: ${reason}`,\n { details: { url, status: response.status } },\n );\n }\n\n if (response.status < 200 || response.status >= 300) return upstreamFailure(url, response.status, body);\n return ok(body);\n };\n\n return {\n baseUrl,\n health: () => get(\"/healthz\"),\n services: (limit) => get(\"/services\", { limit: String(limit) }),\n service: (serviceId) => get(`/services/${encodeURIComponent(serviceId.toLowerCase())}`),\n agent: (address) => get(`/agents/${encodeURIComponent(address.toLowerCase())}`),\n settlements: (query) =>\n get(\"/settlements\", {\n agent: query.agent.toLowerCase(),\n asset: query.asset?.toLowerCase(),\n limit: String(query.limit),\n }),\n settlement: (settlementId) => get(`/settlements/${encodeURIComponent(settlementId.toLowerCase())}`),\n };\n}\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four MCP tools, declared. (R25.1, R25.2)
|
|
3
|
+
*
|
|
4
|
+
* This file is the contract. A model reads these schemas to decide what to send
|
|
5
|
+
* and what it will get back, `tools/list` serves them verbatim, every tool
|
|
6
|
+
* validates its input against the schema here before doing any work, and the
|
|
7
|
+
* task 16.3 tests validate every output against it. There is one declaration of
|
|
8
|
+
* each shape and it lives here, so the published contract and the enforced
|
|
9
|
+
* contract cannot drift apart.
|
|
10
|
+
*
|
|
11
|
+
* ## Amounts are decimal strings, never numbers
|
|
12
|
+
*
|
|
13
|
+
* Every field whose name ends in `BaseUnits` is a string of digits matching
|
|
14
|
+
* {@link BASE_UNITS_PATTERN}. A `uint256` does not survive a double: 2^53 base
|
|
15
|
+
* units of a 6-decimal Asset is about 9 billion units of that Asset, which is
|
|
16
|
+
* inside the range a Credit Limit can reach, and a rounded amount that still
|
|
17
|
+
* looks plausible is the worst possible failure for a billing surface. JSON has
|
|
18
|
+
* no integer type wide enough, so the wire form is a string and the boundary
|
|
19
|
+
* converts.
|
|
20
|
+
*
|
|
21
|
+
* ## Failure is a value, not an exception
|
|
22
|
+
*
|
|
23
|
+
* Every output schema carries an optional `error` object of
|
|
24
|
+
* `{ category, code, message }`. Nothing in this package throws across the MCP
|
|
25
|
+
* boundary, so a tool that cannot do its job returns a schema-valid payload
|
|
26
|
+
* whose `error` says why, and the model can act on it. `tab_call` and
|
|
27
|
+
* `tab_settle` additionally carry a required `ok` boolean, because those two
|
|
28
|
+
* change state and "did it happen" is the first thing a caller must read.
|
|
29
|
+
*
|
|
30
|
+
* `LIMIT_EXCEEDED` is the case the design singles out: the Agent has no headroom
|
|
31
|
+
* for the Asset, so the tool answers `ok: false` with both `requiredBaseUnits`
|
|
32
|
+
* and `headroomBaseUnits` populated. That is the difference between a model that
|
|
33
|
+
* decides to settle and a model that guesses. (R21.5)
|
|
34
|
+
*
|
|
35
|
+
* Requirements: 21.5, 25.1, 25.2, 25.3, 25.4
|
|
36
|
+
*/
|
|
37
|
+
import type { JsonObjectSchema, JsonSchema } from "./json-schema.js";
|
|
38
|
+
/** A `uint256` in decimal, as a string. 78 digits is the ceiling; 39 covers every real amount. */
|
|
39
|
+
export declare const BASE_UNITS_PATTERN = "^[0-9]{1,39}$";
|
|
40
|
+
/** A 20-byte address. */
|
|
41
|
+
export declare const ADDRESS_PATTERN = "^0x[a-fA-F0-9]{40}$";
|
|
42
|
+
/** A 32-byte word: a serviceId, a tool key, a tabId, a settlement id. */
|
|
43
|
+
export declare const WORD_PATTERN = "^0x[a-fA-F0-9]{64}$";
|
|
44
|
+
/** An Asset named with its network: the decimal EVM chain id, a colon, the token address. */
|
|
45
|
+
export declare const ASSET_PATTERN = "^[0-9]+:0x[a-fA-F0-9]{40}$";
|
|
46
|
+
/**
|
|
47
|
+
* The failure block every tool can return.
|
|
48
|
+
*
|
|
49
|
+
* `category` is the same seven-value vocabulary `../_shared/index.js` uses everywhere
|
|
50
|
+
* else, so a code path that maps a category to an HTTP status on one surface
|
|
51
|
+
* maps it the same way here. `requiredBaseUnits` and `headroomBaseUnits` are
|
|
52
|
+
* present only on `LIMIT_EXCEEDED`.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ERROR_SCHEMA: JsonSchema;
|
|
55
|
+
export declare const TAB_DISCOVER_INPUT: JsonObjectSchema;
|
|
56
|
+
export declare const TAB_DISCOVER_OUTPUT: JsonObjectSchema;
|
|
57
|
+
export declare const TAB_CALL_INPUT: JsonObjectSchema;
|
|
58
|
+
export declare const TAB_CALL_OUTPUT: JsonObjectSchema;
|
|
59
|
+
export declare const TAB_STATUS_INPUT: JsonObjectSchema;
|
|
60
|
+
export declare const TAB_STATUS_OUTPUT: JsonObjectSchema;
|
|
61
|
+
export declare const TAB_SETTLE_INPUT: JsonObjectSchema;
|
|
62
|
+
export declare const TAB_SETTLE_OUTPUT: JsonObjectSchema;
|
|
63
|
+
/** One tool as `tools/list` serves it. */
|
|
64
|
+
export interface TabToolDeclaration {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly title: string;
|
|
67
|
+
readonly description: string;
|
|
68
|
+
readonly inputSchema: JsonObjectSchema;
|
|
69
|
+
readonly outputSchema: JsonObjectSchema;
|
|
70
|
+
/** MCP behaviour hints. `tab_settle` is the only tool that is not read-only. */
|
|
71
|
+
readonly annotations: {
|
|
72
|
+
readonly readOnlyHint: boolean;
|
|
73
|
+
readonly destructiveHint: boolean;
|
|
74
|
+
readonly idempotentHint: boolean;
|
|
75
|
+
readonly openWorldHint: boolean;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export declare const TAB_TOOLS: readonly TabToolDeclaration[];
|
|
79
|
+
/** The tool names, in the order `tools/list` serves them. */
|
|
80
|
+
export declare const TAB_TOOL_NAMES: string[];
|
|
81
|
+
export declare const tabToolByName: (name: string) => TabToolDeclaration | undefined;
|
|
82
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/mcp/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAA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,kBAAkB,EA+ClD,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,cAAc,UAAqC,CAAC;AAEjE,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,kBAAkB,GAAG,SACpB,CAAC"}
|
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four MCP tools, declared. (R25.1, R25.2)
|
|
3
|
+
*
|
|
4
|
+
* This file is the contract. A model reads these schemas to decide what to send
|
|
5
|
+
* and what it will get back, `tools/list` serves them verbatim, every tool
|
|
6
|
+
* validates its input against the schema here before doing any work, and the
|
|
7
|
+
* task 16.3 tests validate every output against it. There is one declaration of
|
|
8
|
+
* each shape and it lives here, so the published contract and the enforced
|
|
9
|
+
* contract cannot drift apart.
|
|
10
|
+
*
|
|
11
|
+
* ## Amounts are decimal strings, never numbers
|
|
12
|
+
*
|
|
13
|
+
* Every field whose name ends in `BaseUnits` is a string of digits matching
|
|
14
|
+
* {@link BASE_UNITS_PATTERN}. A `uint256` does not survive a double: 2^53 base
|
|
15
|
+
* units of a 6-decimal Asset is about 9 billion units of that Asset, which is
|
|
16
|
+
* inside the range a Credit Limit can reach, and a rounded amount that still
|
|
17
|
+
* looks plausible is the worst possible failure for a billing surface. JSON has
|
|
18
|
+
* no integer type wide enough, so the wire form is a string and the boundary
|
|
19
|
+
* converts.
|
|
20
|
+
*
|
|
21
|
+
* ## Failure is a value, not an exception
|
|
22
|
+
*
|
|
23
|
+
* Every output schema carries an optional `error` object of
|
|
24
|
+
* `{ category, code, message }`. Nothing in this package throws across the MCP
|
|
25
|
+
* boundary, so a tool that cannot do its job returns a schema-valid payload
|
|
26
|
+
* whose `error` says why, and the model can act on it. `tab_call` and
|
|
27
|
+
* `tab_settle` additionally carry a required `ok` boolean, because those two
|
|
28
|
+
* change state and "did it happen" is the first thing a caller must read.
|
|
29
|
+
*
|
|
30
|
+
* `LIMIT_EXCEEDED` is the case the design singles out: the Agent has no headroom
|
|
31
|
+
* for the Asset, so the tool answers `ok: false` with both `requiredBaseUnits`
|
|
32
|
+
* and `headroomBaseUnits` populated. That is the difference between a model that
|
|
33
|
+
* decides to settle and a model that guesses. (R21.5)
|
|
34
|
+
*
|
|
35
|
+
* Requirements: 21.5, 25.1, 25.2, 25.3, 25.4
|
|
36
|
+
*/
|
|
37
|
+
/** A `uint256` in decimal, as a string. 78 digits is the ceiling; 39 covers every real amount. */
|
|
38
|
+
export const BASE_UNITS_PATTERN = "^[0-9]{1,39}$";
|
|
39
|
+
/** A 20-byte address. */
|
|
40
|
+
export const ADDRESS_PATTERN = "^0x[a-fA-F0-9]{40}$";
|
|
41
|
+
/** A 32-byte word: a serviceId, a tool key, a tabId, a settlement id. */
|
|
42
|
+
export const WORD_PATTERN = "^0x[a-fA-F0-9]{64}$";
|
|
43
|
+
/** An Asset named with its network: the decimal EVM chain id, a colon, the token address. */
|
|
44
|
+
export const ASSET_PATTERN = "^[0-9]+:0x[a-fA-F0-9]{40}$";
|
|
45
|
+
const baseUnits = (description) => ({
|
|
46
|
+
type: "string",
|
|
47
|
+
pattern: BASE_UNITS_PATTERN,
|
|
48
|
+
description,
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* An amount the source may be unable to serve.
|
|
52
|
+
*
|
|
53
|
+
* Null is "this figure was withheld", never "zero". The registry read API
|
|
54
|
+
* withholds a Credit Limit it could not cross-check against `TabBook` rather
|
|
55
|
+
* than serving an unchecked one, and a zero in its place would read as an Agent
|
|
56
|
+
* with no credit -- the opposite of what a withheld figure means.
|
|
57
|
+
*/
|
|
58
|
+
const nullableBaseUnits = (description) => ({
|
|
59
|
+
type: ["string", "null"],
|
|
60
|
+
pattern: BASE_UNITS_PATTERN,
|
|
61
|
+
description,
|
|
62
|
+
});
|
|
63
|
+
const address = (description) => ({ type: "string", pattern: ADDRESS_PATTERN, description });
|
|
64
|
+
const word = (description) => ({ type: "string", pattern: WORD_PATTERN, description });
|
|
65
|
+
const assetRef = (description) => ({ type: "string", pattern: ASSET_PATTERN, description });
|
|
66
|
+
const nullableString = (description) => ({ type: ["string", "null"], description });
|
|
67
|
+
/**
|
|
68
|
+
* The failure block every tool can return.
|
|
69
|
+
*
|
|
70
|
+
* `category` is the same seven-value vocabulary `../_shared/index.js` uses everywhere
|
|
71
|
+
* else, so a code path that maps a category to an HTTP status on one surface
|
|
72
|
+
* maps it the same way here. `requiredBaseUnits` and `headroomBaseUnits` are
|
|
73
|
+
* present only on `LIMIT_EXCEEDED`.
|
|
74
|
+
*/
|
|
75
|
+
export const ERROR_SCHEMA = {
|
|
76
|
+
type: "object",
|
|
77
|
+
description: "Why the call did not do what was asked. Absent when it did.",
|
|
78
|
+
properties: {
|
|
79
|
+
category: {
|
|
80
|
+
type: "string",
|
|
81
|
+
enum: [
|
|
82
|
+
"VALIDATION",
|
|
83
|
+
"AUTHORISATION",
|
|
84
|
+
"NOT_FOUND",
|
|
85
|
+
"LIMIT",
|
|
86
|
+
"CHAIN",
|
|
87
|
+
"UPSTREAM",
|
|
88
|
+
"CONFLICT",
|
|
89
|
+
"UNAVAILABLE",
|
|
90
|
+
"INTERNAL",
|
|
91
|
+
],
|
|
92
|
+
description: "The failure class, in the vocabulary the rest of Tab uses. VALIDATION and NOT_FOUND are the caller's to fix; LIMIT means the Credit Limit or the headroom is exhausted.",
|
|
93
|
+
},
|
|
94
|
+
code: { type: "string", description: "A stable machine-readable code, such as LIMIT_EXCEEDED." },
|
|
95
|
+
message: { type: "string", description: "One sentence a model or a person can act on." },
|
|
96
|
+
retryable: { type: "boolean", description: "Whether repeating the identical call could succeed." },
|
|
97
|
+
requiredBaseUnits: baseUnits("LIMIT_EXCEEDED only: what the call needed, in Asset base units."),
|
|
98
|
+
headroomBaseUnits: baseUnits("LIMIT_EXCEEDED only: what the Agent had, in Asset base units."),
|
|
99
|
+
},
|
|
100
|
+
required: ["category", "code", "message"],
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
};
|
|
103
|
+
// ---------------------------------------------------------------- tab_discover
|
|
104
|
+
export const TAB_DISCOVER_INPUT = {
|
|
105
|
+
type: "object",
|
|
106
|
+
description: "Filters over the registered Services. Every field is optional; no filter lists everything.",
|
|
107
|
+
properties: {
|
|
108
|
+
asset: assetRef("Keep only Services that accept this Asset, as `chainId:tokenAddress`, for example `143:0x7547...b603`."),
|
|
109
|
+
tier: {
|
|
110
|
+
type: "string",
|
|
111
|
+
enum: ["curated", "permissionless", "any"],
|
|
112
|
+
default: "any",
|
|
113
|
+
description: "Curation tier. A Curated Service carries more Credit Limit weight; a Permissionless one is registered and unreviewed.",
|
|
114
|
+
},
|
|
115
|
+
search: {
|
|
116
|
+
type: "string",
|
|
117
|
+
maxLength: 128,
|
|
118
|
+
description: "Case-insensitive substring matched against the Service name and its serviceId.",
|
|
119
|
+
},
|
|
120
|
+
limit: { type: "integer", minimum: 1, maximum: 100, default: 25, description: "How many Services to return." },
|
|
121
|
+
},
|
|
122
|
+
required: [],
|
|
123
|
+
additionalProperties: false,
|
|
124
|
+
};
|
|
125
|
+
const SERVICE_ASSET_SCHEMA = {
|
|
126
|
+
type: "object",
|
|
127
|
+
properties: {
|
|
128
|
+
chainId: { type: "integer", description: "The EVM chain id: 143 is Monad Mainnet, 10143 is Monad Testnet." },
|
|
129
|
+
address: address("The token contract on that chain."),
|
|
130
|
+
symbol: nullableString("Null when this package ships no descriptor for the Asset."),
|
|
131
|
+
decimals: { type: ["integer", "null"], description: "Null when this package ships no descriptor for the Asset." },
|
|
132
|
+
collectionAddress: {
|
|
133
|
+
type: ["string", "null"],
|
|
134
|
+
pattern: ADDRESS_PATTERN,
|
|
135
|
+
description: "Where the Service collects Settlements of this Asset. Null when no Tab Collection resolves.",
|
|
136
|
+
},
|
|
137
|
+
curatedAsset: {
|
|
138
|
+
type: "boolean",
|
|
139
|
+
description: "True when this package ships a descriptor for the pair, which is what supplies symbol and decimals. False means the Asset is accepted on chain but unknown here, so its symbol and decimals are null and a caller must not assume six decimals.",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
required: ["chainId", "address", "symbol", "decimals", "collectionAddress", "curatedAsset"],
|
|
143
|
+
additionalProperties: false,
|
|
144
|
+
};
|
|
145
|
+
const SERVICE_TOOL_SCHEMA = {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
tool: word("The tool key: the tool name, left-aligned and zero-padded to 32 bytes."),
|
|
149
|
+
toolName: nullableString("The ascii the tool key decodes to, when it decodes to printable ascii."),
|
|
150
|
+
asset: assetRef("The Asset this price is denominated in."),
|
|
151
|
+
priceBaseUnits: baseUnits("What one call costs, in Asset base units."),
|
|
152
|
+
},
|
|
153
|
+
required: ["tool", "toolName", "asset", "priceBaseUnits"],
|
|
154
|
+
additionalProperties: false,
|
|
155
|
+
};
|
|
156
|
+
const SERVICE_BOND_SCHEMA = {
|
|
157
|
+
type: "object",
|
|
158
|
+
properties: {
|
|
159
|
+
asset: assetRef("The Asset the stake is denominated in."),
|
|
160
|
+
stakedBaseUnits: baseUnits("Total Bond staked for this Asset."),
|
|
161
|
+
freeBaseUnits: baseUnits("Stake the Service can still withdraw. It is what caps the credit its history backs."),
|
|
162
|
+
},
|
|
163
|
+
required: ["asset", "stakedBaseUnits", "freeBaseUnits"],
|
|
164
|
+
additionalProperties: false,
|
|
165
|
+
};
|
|
166
|
+
const PENDING_CHANGE_SCHEMA = {
|
|
167
|
+
type: ["object", "null"],
|
|
168
|
+
description: "The next queued registry change, or null when nothing is queued.",
|
|
169
|
+
properties: {
|
|
170
|
+
changeId: word("The id the RegistryChangeQueued event reported."),
|
|
171
|
+
kind: nullableString("Tier, SettlementWindow, ToolPrice, and so on."),
|
|
172
|
+
etaIso: nullableString("When the timelock lets the change apply."),
|
|
173
|
+
},
|
|
174
|
+
required: ["changeId", "kind", "etaIso"],
|
|
175
|
+
additionalProperties: false,
|
|
176
|
+
};
|
|
177
|
+
const HUB_ENDPOINT_SCHEMA = {
|
|
178
|
+
type: "object",
|
|
179
|
+
properties: {
|
|
180
|
+
endpoint: { type: "string", description: "The provider-relative path, for example `/get_current_weather`." },
|
|
181
|
+
name: nullableString("The Hub's display name for the endpoint."),
|
|
182
|
+
description: nullableString("What the endpoint does, as the Hub describes it."),
|
|
183
|
+
priceType: {
|
|
184
|
+
type: "string",
|
|
185
|
+
description: "How the Hub prices it: PER_CALL, PER_RESULT, PER_UNIT or PER_UNIT_MATRIX. Only PER_CALL has a fixed base-unit price.",
|
|
186
|
+
},
|
|
187
|
+
priceUsd: nullableString("The Hub's decimal USD figure. The metered charge is this plus the fronting Service's margin."),
|
|
188
|
+
priceBaseUnits: nullableBaseUnits("The USD figure as six-decimal base units, for PER_CALL only. Null otherwise."),
|
|
189
|
+
networks: { type: "array", items: { type: "string" }, description: "CAIP-2 networks the Hub takes payment on." },
|
|
190
|
+
},
|
|
191
|
+
required: ["endpoint", "name", "description", "priceType", "priceUsd", "priceBaseUnits", "networks"],
|
|
192
|
+
additionalProperties: false,
|
|
193
|
+
};
|
|
194
|
+
const SERVICE_HUB_SCHEMA = {
|
|
195
|
+
type: "object",
|
|
196
|
+
description: "The API Hub provider this Service fronts, when it fronts one. Each endpoint is called through the Service at `<endpoint>/hub/<prefix><endpoint path>`, paid upstream by the Service and metered onto the Agent's Open Tab for the upstream price plus the Service's margin.",
|
|
197
|
+
properties: {
|
|
198
|
+
provider: { type: "string", description: "The Hub provider slug." },
|
|
199
|
+
prefix: { type: "string", description: "The mount under the Service endpoint: `/hub/<prefix>`." },
|
|
200
|
+
endpoints: { type: "array", items: HUB_ENDPOINT_SCHEMA },
|
|
201
|
+
total: { type: "integer", description: "How many endpoints the Hub lists for the provider." },
|
|
202
|
+
error: ERROR_SCHEMA,
|
|
203
|
+
},
|
|
204
|
+
required: ["provider", "prefix", "endpoints", "total"],
|
|
205
|
+
additionalProperties: false,
|
|
206
|
+
};
|
|
207
|
+
export const TAB_DISCOVER_OUTPUT = {
|
|
208
|
+
type: "object",
|
|
209
|
+
properties: {
|
|
210
|
+
services: {
|
|
211
|
+
type: "array",
|
|
212
|
+
description: "The matching Services. Empty on failure, with `error` populated.",
|
|
213
|
+
items: {
|
|
214
|
+
type: "object",
|
|
215
|
+
properties: {
|
|
216
|
+
serviceId: word("The Service's 32-byte registry key."),
|
|
217
|
+
name: nullableString("The ascii the serviceId decodes to, when it decodes to printable ascii."),
|
|
218
|
+
endpoint: nullableString("Where tab_call sends requests. Null when nothing configured one: the chain records no endpoint, so it comes from tab.config or from the server options."),
|
|
219
|
+
tier: { type: "string", enum: ["curated", "permissionless", "unknown"] },
|
|
220
|
+
settlementWindowSeconds: {
|
|
221
|
+
type: "integer",
|
|
222
|
+
description: "How long after a Metered Delivery the Agent has to settle before the tab is delinquent.",
|
|
223
|
+
},
|
|
224
|
+
assets: { type: "array", items: SERVICE_ASSET_SCHEMA },
|
|
225
|
+
tools: { type: "array", items: SERVICE_TOOL_SCHEMA },
|
|
226
|
+
bonds: { type: "array", items: SERVICE_BOND_SCHEMA },
|
|
227
|
+
pendingChange: PENDING_CHANGE_SCHEMA,
|
|
228
|
+
hub: SERVICE_HUB_SCHEMA,
|
|
229
|
+
},
|
|
230
|
+
required: [
|
|
231
|
+
"serviceId",
|
|
232
|
+
"name",
|
|
233
|
+
"endpoint",
|
|
234
|
+
"tier",
|
|
235
|
+
"settlementWindowSeconds",
|
|
236
|
+
"assets",
|
|
237
|
+
"tools",
|
|
238
|
+
"bonds",
|
|
239
|
+
"pendingChange",
|
|
240
|
+
],
|
|
241
|
+
additionalProperties: false,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
error: ERROR_SCHEMA,
|
|
245
|
+
},
|
|
246
|
+
required: ["services"],
|
|
247
|
+
additionalProperties: false,
|
|
248
|
+
};
|
|
249
|
+
// ---------------------------------------------------------------- tab_call
|
|
250
|
+
export const TAB_CALL_INPUT = {
|
|
251
|
+
type: "object",
|
|
252
|
+
description: "Calls one tool on one Service. The call is metered onto the Agent's Open Tab and paid for later.",
|
|
253
|
+
properties: {
|
|
254
|
+
serviceId: word("The Service to call, as reported by tab_discover."),
|
|
255
|
+
tool: {
|
|
256
|
+
type: "string",
|
|
257
|
+
minLength: 1,
|
|
258
|
+
maxLength: 128,
|
|
259
|
+
description: "The tool name, for example `quote.generate`. A 32-byte hex word is accepted too.",
|
|
260
|
+
},
|
|
261
|
+
asset: assetRef("Which Asset to meter in. Defaults to the Service's only priced Asset when it has one."),
|
|
262
|
+
arguments: { type: "object", description: "The tool's own arguments, passed through untouched." },
|
|
263
|
+
timeoutMs: { type: "integer", minimum: 1000, maximum: 120000, default: 30000 },
|
|
264
|
+
},
|
|
265
|
+
required: ["serviceId", "tool"],
|
|
266
|
+
additionalProperties: false,
|
|
267
|
+
};
|
|
268
|
+
export const TAB_CALL_OUTPUT = {
|
|
269
|
+
type: "object",
|
|
270
|
+
properties: {
|
|
271
|
+
ok: { type: "boolean", description: "Whether the Service served the call and it was metered." },
|
|
272
|
+
result: { description: "Whatever the Service returned. Absent when ok is false." },
|
|
273
|
+
charge: {
|
|
274
|
+
type: "object",
|
|
275
|
+
description: "What this call cost. Present whenever the Service reported a charge block.",
|
|
276
|
+
properties: {
|
|
277
|
+
amountBaseUnits: baseUnits("Charged when ok is true; required but not charged when ok is false."),
|
|
278
|
+
asset: assetRef("The Asset the charge is denominated in."),
|
|
279
|
+
tool: word("The tool key that was metered."),
|
|
280
|
+
},
|
|
281
|
+
required: ["amountBaseUnits", "asset", "tool"],
|
|
282
|
+
additionalProperties: false,
|
|
283
|
+
},
|
|
284
|
+
tab: {
|
|
285
|
+
type: "object",
|
|
286
|
+
description: "The Agent's position for this Asset, as the Service reported it on this response.",
|
|
287
|
+
properties: {
|
|
288
|
+
openTabBaseUnits: baseUnits("What the Agent now owes for this Asset."),
|
|
289
|
+
headroomBaseUnits: baseUnits("What the Agent may still spend before the Credit Limit binds."),
|
|
290
|
+
creditLimitBaseUnits: baseUnits("The Credit Limit for this Asset, when the response carried one."),
|
|
291
|
+
asset: assetRef("The Asset these figures are denominated in."),
|
|
292
|
+
settlementDueIso: nullableString("When the Settlement Window closes on this tab."),
|
|
293
|
+
},
|
|
294
|
+
required: ["openTabBaseUnits", "headroomBaseUnits", "asset"],
|
|
295
|
+
additionalProperties: false,
|
|
296
|
+
},
|
|
297
|
+
x402: {
|
|
298
|
+
type: "object",
|
|
299
|
+
description: "Present when the Service refused the call on credit and it was prepaid through x402 instead, with the signer tab.config's `x402` factory built. Nothing landed on the Open Tab: the call was paid in full, once, by this transaction.",
|
|
300
|
+
properties: {
|
|
301
|
+
txHash: { type: "string", description: "The settlement transaction the facilitator broadcast. Empty when it reported none." },
|
|
302
|
+
network: { type: "string", description: "The CAIP-2 network it settled on, for example `eip155:10143`." },
|
|
303
|
+
amountBaseUnits: baseUnits("What was paid, in atomic units of the asset."),
|
|
304
|
+
asset: assetRef("The token the payment was made in."),
|
|
305
|
+
payTo: address("Where the funds went: the Service's Collection address."),
|
|
306
|
+
payer: address("Who signed: the x402 signer's address."),
|
|
307
|
+
explorerUrl: nullableString("A link to the transaction on the configured explorer."),
|
|
308
|
+
},
|
|
309
|
+
required: ["txHash", "network", "amountBaseUnits", "asset", "payTo", "payer", "explorerUrl"],
|
|
310
|
+
additionalProperties: false,
|
|
311
|
+
},
|
|
312
|
+
error: ERROR_SCHEMA,
|
|
313
|
+
},
|
|
314
|
+
required: ["ok"],
|
|
315
|
+
additionalProperties: false,
|
|
316
|
+
};
|
|
317
|
+
// ---------------------------------------------------------------- tab_status
|
|
318
|
+
export const TAB_STATUS_INPUT = {
|
|
319
|
+
type: "object",
|
|
320
|
+
description: "The Agent's credit picture: what it owes, what it may still spend, and what has settled.",
|
|
321
|
+
properties: {
|
|
322
|
+
agent: address("The Agent's Monad address. Defaults to the Agent this server is configured for."),
|
|
323
|
+
asset: assetRef("Report only this Asset. Omitted reports every Asset the Agent has touched."),
|
|
324
|
+
historyLimit: { type: "integer", minimum: 0, maximum: 200, default: 20 },
|
|
325
|
+
},
|
|
326
|
+
required: [],
|
|
327
|
+
additionalProperties: false,
|
|
328
|
+
};
|
|
329
|
+
const PER_ASSET_SCHEMA = {
|
|
330
|
+
type: "object",
|
|
331
|
+
properties: {
|
|
332
|
+
asset: assetRef("The Asset these figures are denominated in."),
|
|
333
|
+
creditLimitBaseUnits: nullableBaseUnits("What this Agent may owe for this Asset at once. Null when the source withheld the figure because it could not cross-check it against TabBook."),
|
|
334
|
+
openTabBaseUnits: baseUnits("What it owes now."),
|
|
335
|
+
prepaidBaseUnits: nullableBaseUnits("Credit paid in ahead of use, which is drawn on before the Credit Limit. Null when the source serves only cumulative settlement totals and no live balance."),
|
|
336
|
+
headroomBaseUnits: nullableBaseUnits("What it may still spend. Null whenever the Credit Limit is null."),
|
|
337
|
+
delinquent: { type: "boolean", description: "True while a Settlement Window has closed on an unsettled tab." },
|
|
338
|
+
tabs: {
|
|
339
|
+
type: "array",
|
|
340
|
+
description: "The tabs behind the figures, newest first, capped by historyLimit.",
|
|
341
|
+
items: {
|
|
342
|
+
type: "object",
|
|
343
|
+
properties: {
|
|
344
|
+
tabId: {
|
|
345
|
+
type: ["string", "null"],
|
|
346
|
+
pattern: WORD_PATTERN,
|
|
347
|
+
description: "The tab's identity on TabBook. Null when the source reports the observation by Agent, Service and Asset without naming the tab.",
|
|
348
|
+
},
|
|
349
|
+
serviceId: word("The Service the tab is with."),
|
|
350
|
+
openBaseUnits: baseUnits("The Open Tab last observed on this tab. A lower bound: a Metered Delivery raises a tab without an indexed event, so the per-Asset figure above is the one to trust."),
|
|
351
|
+
dueIso: nullableString("When this tab's Settlement Window closes."),
|
|
352
|
+
},
|
|
353
|
+
required: ["tabId", "serviceId", "openBaseUnits", "dueIso"],
|
|
354
|
+
additionalProperties: false,
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
required: [
|
|
359
|
+
"asset",
|
|
360
|
+
"creditLimitBaseUnits",
|
|
361
|
+
"openTabBaseUnits",
|
|
362
|
+
"prepaidBaseUnits",
|
|
363
|
+
"headroomBaseUnits",
|
|
364
|
+
"delinquent",
|
|
365
|
+
"tabs",
|
|
366
|
+
],
|
|
367
|
+
additionalProperties: false,
|
|
368
|
+
};
|
|
369
|
+
const SETTLEMENT_SCHEMA = {
|
|
370
|
+
type: "object",
|
|
371
|
+
description: "A Settlement the Agent paid on Monad: the Asset moved to the Service and the Open Tab fell in one transaction.",
|
|
372
|
+
properties: {
|
|
373
|
+
settlementId: word("The Settlement's identity, assigned by TabBook when it was applied."),
|
|
374
|
+
txHash: word("The Monad transaction that paid it."),
|
|
375
|
+
serviceId: word("The Service that was paid."),
|
|
376
|
+
asset: assetRef("The Asset that was paid."),
|
|
377
|
+
amountBaseUnits: baseUnits("How much was paid."),
|
|
378
|
+
appliedBaseUnits: baseUnits("How much of it lowered the Open Tab."),
|
|
379
|
+
prepaidBaseUnits: baseUnits("How much of it was banked as prepaid credit."),
|
|
380
|
+
explorerUrl: nullableString("The transaction on the Monad explorer."),
|
|
381
|
+
},
|
|
382
|
+
required: ["settlementId", "txHash", "serviceId", "asset", "amountBaseUnits", "appliedBaseUnits", "prepaidBaseUnits", "explorerUrl"],
|
|
383
|
+
additionalProperties: false,
|
|
384
|
+
};
|
|
385
|
+
export const TAB_STATUS_OUTPUT = {
|
|
386
|
+
type: "object",
|
|
387
|
+
properties: {
|
|
388
|
+
agent: address("The Agent these figures are about."),
|
|
389
|
+
indexedBlock: {
|
|
390
|
+
type: ["integer", "null"],
|
|
391
|
+
minimum: 0,
|
|
392
|
+
description: "The Monad block every figure is as at. A Settlement sent a moment ago sits in a later block and is not yet reflected; read again after the index passes it. Null when the index has never ticked.",
|
|
393
|
+
},
|
|
394
|
+
perAsset: { type: "array", items: PER_ASSET_SCHEMA },
|
|
395
|
+
settlements: { type: "array", items: SETTLEMENT_SCHEMA },
|
|
396
|
+
error: ERROR_SCHEMA,
|
|
397
|
+
},
|
|
398
|
+
required: ["agent", "indexedBlock", "perAsset"],
|
|
399
|
+
additionalProperties: false,
|
|
400
|
+
};
|
|
401
|
+
// ---------------------------------------------------------------- tab_settle
|
|
402
|
+
export const TAB_SETTLE_INPUT = {
|
|
403
|
+
type: "object",
|
|
404
|
+
description: "Pays down an Open Tab by calling TabSettlement.settle on Monad with the Agent's own key. This spends real funds unless dryRun is set.",
|
|
405
|
+
properties: {
|
|
406
|
+
serviceId: word("The Service being paid."),
|
|
407
|
+
asset: assetRef("The Asset to pay in, as `chainId:tokenAddress`."),
|
|
408
|
+
amountBaseUnits: baseUnits("How much to pay, in Asset base units."),
|
|
409
|
+
strategyId: { type: "string", maxLength: 64, description: "Which registered payment strategy to settle through." },
|
|
410
|
+
dryRun: {
|
|
411
|
+
type: "boolean",
|
|
412
|
+
default: false,
|
|
413
|
+
description: "Build and validate the Settlement, report what would be sent, and broadcast nothing.",
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
required: ["serviceId", "asset", "amountBaseUnits"],
|
|
417
|
+
additionalProperties: false,
|
|
418
|
+
};
|
|
419
|
+
export const TAB_SETTLE_OUTPUT = {
|
|
420
|
+
type: "object",
|
|
421
|
+
properties: {
|
|
422
|
+
ok: { type: "boolean", description: "Whether the Settlement was sent, or would have been on a dry run." },
|
|
423
|
+
dryRun: { type: "boolean", description: "True when nothing was sent." },
|
|
424
|
+
txHash: nullableString("The Monad transaction. Null on a dry run and on failure."),
|
|
425
|
+
chainId: { type: ["integer", "null"] },
|
|
426
|
+
amountBaseUnits: baseUnits("What was paid, echoed from the request."),
|
|
427
|
+
settlementId: {
|
|
428
|
+
type: ["string", "null"],
|
|
429
|
+
pattern: WORD_PATTERN,
|
|
430
|
+
description: "The Settlement's identity from the receipt. Null on a dry run, and null when the receipt was not awaited.",
|
|
431
|
+
},
|
|
432
|
+
appliedBaseUnits: nullableString("How much lowered the Open Tab, from the receipt."),
|
|
433
|
+
prepaidBaseUnits: nullableString("How much was banked as prepaid credit, from the receipt."),
|
|
434
|
+
explorerUrl: nullableString("The transaction on the Monad explorer."),
|
|
435
|
+
error: ERROR_SCHEMA,
|
|
436
|
+
},
|
|
437
|
+
required: ["ok", "dryRun", "amountBaseUnits"],
|
|
438
|
+
additionalProperties: false,
|
|
439
|
+
};
|
|
440
|
+
const READ_ONLY = {
|
|
441
|
+
readOnlyHint: true,
|
|
442
|
+
destructiveHint: false,
|
|
443
|
+
idempotentHint: true,
|
|
444
|
+
openWorldHint: true,
|
|
445
|
+
};
|
|
446
|
+
export const TAB_TOOLS = [
|
|
447
|
+
{
|
|
448
|
+
name: "tab_discover",
|
|
449
|
+
title: "Discover Tab Services",
|
|
450
|
+
description: "Lists Services registered on Monad, with the Assets each accepts, what each tool costs, and how much stake each has posted. Read-only and keyless. Start here: tab_call needs a serviceId from this list.",
|
|
451
|
+
inputSchema: TAB_DISCOVER_INPUT,
|
|
452
|
+
outputSchema: TAB_DISCOVER_OUTPUT,
|
|
453
|
+
annotations: READ_ONLY,
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: "tab_call",
|
|
457
|
+
title: "Call a metered tool",
|
|
458
|
+
description: "Calls a tool on a Service. Nothing is paid at call time: the charge lands on the Agent's Open Tab and is settled later with tab_settle. When the Agent has no headroom the call returns ok false with code LIMIT_EXCEEDED and both requiredBaseUnits and headroomBaseUnits, which is the signal to settle rather than retry. If tab.config declares an x402 signer and the Service offered x402 on that refusal, the call is prepaid instead and the output carries an x402 block naming the transaction.",
|
|
459
|
+
inputSchema: TAB_CALL_INPUT,
|
|
460
|
+
outputSchema: TAB_CALL_OUTPUT,
|
|
461
|
+
annotations: {
|
|
462
|
+
readOnlyHint: false,
|
|
463
|
+
destructiveHint: false,
|
|
464
|
+
idempotentHint: false,
|
|
465
|
+
openWorldHint: true,
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
name: "tab_status",
|
|
470
|
+
title: "Read the Agent's credit picture",
|
|
471
|
+
description: "Reports the Agent's Credit Limit, Open Tab, prepaid credit and headroom per Asset, plus its recent Settlements. Read-only and keyless.",
|
|
472
|
+
inputSchema: TAB_STATUS_INPUT,
|
|
473
|
+
outputSchema: TAB_STATUS_OUTPUT,
|
|
474
|
+
annotations: READ_ONLY,
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: "tab_settle",
|
|
478
|
+
title: "Settle an Open Tab",
|
|
479
|
+
description: "Pays down an Open Tab by sending a Settlement on Monad with the Agent's own key. This spends real funds. Set dryRun to build and check the Settlement without sending it.",
|
|
480
|
+
inputSchema: TAB_SETTLE_INPUT,
|
|
481
|
+
outputSchema: TAB_SETTLE_OUTPUT,
|
|
482
|
+
annotations: {
|
|
483
|
+
readOnlyHint: false,
|
|
484
|
+
destructiveHint: true,
|
|
485
|
+
idempotentHint: false,
|
|
486
|
+
openWorldHint: true,
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
];
|
|
490
|
+
/** The tool names, in the order `tools/list` serves them. */
|
|
491
|
+
export const TAB_TOOL_NAMES = TAB_TOOLS.map((tool) => tool.name);
|
|
492
|
+
export const tabToolByName = (name) => TAB_TOOLS.find((tool) => tool.name === name);
|
|
493
|
+
//# sourceMappingURL=schemas.js.map
|