Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

746 B
Raw Blame
// Error classes for the keyless X guest reader. Adapted from XActions
// (Apache-2.0, see NOTICE). Only the types the guest reader raises are kept.

export class XGuestError extends Error {
	constructor(message, { status = null, endpoint = null, reason = 'error' } = {}) {
		super(message);
		this.name = new.target.name;
		this.status = status;
		this.endpoint = endpoint;
		this.reason = reason;
	}
}

export class NotFoundError extends XGuestError {
	constructor(message, opts = {}) {
		super(message, { ...opts, reason: opts.reason || 'not_found' });
	}
}

export class RateLimitError extends XGuestError {
	constructor(message, opts = {}) {
		super(message, { ...opts, reason: 'rate_limited' });
		this.resetAt = opts.resetAt ?? null;
	}
}