@resolvemesh/sdk
v0.1.1
Published
Typed ResolveMesh client for capability resolution and outcome reporting.
Readme
@resolvemesh/sdk
Typed ESM client for ResolveMesh capability resolution and outcome reporting. The package validates requests and responses with the same bundled contract schemas used by the service. Provider execution and credentials remain with the caller.
Install
npm install @resolvemesh/sdkThe SDK requires a Fetch API implementation and secure crypto.randomUUID().
Remote base URLs must use HTTPS.
Resolve a read-only intent
import { createResolveClient } from "@resolvemesh/sdk";
const resolveMesh = createResolveClient({
apiKey: process.env.RESOLVEMESH_API_KEY!,
baseUrl: "https://resolvemesh.com",
});
const resolution = await resolveMesh.resolve({
intentText: "Retrieve the latest SEC 10-K for a public company",
capabilityTypes: ["DATA_RETRIEVAL"],
allowedProtocols: ["MCP", "REST"],
riskClass: "READ_ONLY",
});Send a narrow, sanitized intent. Do not include raw prompts, documents, credentials, provider output, or personal profiles.
Report an outcome
const match = resolution.matches[0];
if (match) {
await resolveMesh.reportOutcome({
resolutionId: resolution.resolutionId,
capabilityId: match.capabilityId,
status: "SUCCEEDED",
durationMs: 2840,
failureCode: null,
});
}The SDK creates one idempotency key per outcome call and reuses it across its
bounded retry. Pass { idempotencyKey } as the second argument when retries
must coordinate across processes.
Read public compatibility intelligence
Compatibility JSON endpoints require no API key:
const pair = await fetch(
"https://resolvemesh.com/v1/compatibility?client=codex&tool=linear",
).then((response) => response.json());
const changes = await fetch(
"https://resolvemesh.com/v1/compatibility-changes?client=codex&tool=linear",
).then((response) => response.json());MCP clients can connect to https://resolvemesh.com/mcp/public for the same
bounded catalog through compatibility_lookup and compatibility_changes.
The public endpoint is read-only and holds no tenant or provider credentials.
Errors
ResolveApiErrorexposes the canonical status, code, retryability, details, and request ID.ResolveNetworkErrorrepresents bounded transport failures.ResolveProtocolErrorrepresents malformed, oversized, or contract-invalid responses.
License
MIT
