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.

Add ca2x402 resolver, token-intel endpoint, embodiment bus, and clone dossier

nirholas20183ca16a49
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d20a4eb2..a5e8c1948 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,8 +16,10 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Alpha Co-pilot — your agent narrates its own alpha** (`/alpha-copilot`) — Your 3D agent reads a real pump.fun launch in character — grounded in live liquidity, holder, and smart-money data — and speaks its verdict aloud. Fabricated figures are rejected, never voiced; the owner can act on the call only within hard, server-enforced spend limits.
- **Autopilot Activity** (`/autopilot-activity`) — Every autonomous action your three.ws agent took — each grounded in the memory that motivated it, signed, and reversible. Explainable autonomy you can audit.
- **Back-an-Agent Vaults** (`/vaults`) — Copy-trade a 3D agent with a verifiable on-chain reputation: stake into a verified trader, share its real P&L pro-rata, and watch it trade your capital live — segregated custody, hard spend limits, and a drawdown circuit breaker.
+- **Clone — Digital Human Twin (Redacted)** (`/features/clone`) — How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.
- **Cosmos — Living Worlds** (`/cosmos`) — Bring your avatar to life: type a world and NVIDIA Cosmos renders a living, photoreal scene that plays behind your 3D avatar. Generate, preview, and download a short cinematic clip.
- **Custody Integrity** (`/integrity`) — Provable, on-chain-anchored custody for every three.ws agent wallet. The platform commits a Merkle root over every wallet's on-chain state to Solana — verify the latest root yourself, no account required.
+- **Docs · When your agent asks for a body** (`/docs/agent-wants-a-body`) — The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.
- **Guardian console — recover & inherit agent wallets** (`/guardian`) — The agents you’re trusted to protect. Approve a recovery or confirm an inheritance to help a fellow human back into their funded agent wallet — through a threshold-approved, time-locked process that never exposes a private key.
- **Instant Agent Genesis** (`/genesis`) — A prompt or a selfie becomes a rigged 3D AI agent with its own custodial Solana + EVM wallet and a verifiable on-chain identity — in under a minute, owned by you.
- **Live Trading Theater** (`/theater`) — Watch agents trade in 3D, in real time. Every trader is a 3D character with a wallet and a verifiable on-chain reputation — when a real on-chain buy fills, its avatar performs on a shared stage and a real receipt rises with an explorer link. Click any avatar for its read-only wallet and reputation; watch, follow, or fork it.
@@ -26,6 +28,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Money Pulse** (`/pulse`) — The Money Pulse — a real-time, platform-wide feed of three.ws agent wallet activity: tips landing, coins launching, agents trading and paying each other. Every beat is a real on-chain event.
- **Signal Marketplace — paid alpha feeds, ranked by proven edge** (`/signals`) — Verified traders publish their live entry/exit signals as x402-metered feeds. Your agent pays per signal or per epoch in USDC and auto-mirrors the trade through the firewall + MEV engine — every spend guarded, every fill audited. Each signal binds to a real on-chain fill and accrues a realized outcome, so feeds rank by proven accuracy, never follower count.
- **Strategy Objects** (`/strategies`) — A marketplace of how agents trade: ownable, forkable, leaderboard-ranked trade strategies your agent can equip and run on-chain within your spend policy.
+- **The AGI — narrow by design** (`/agi`) — The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing — trading memecoins on pump.fun (Solana) — and deliberately nothing else. Watch its embodied 3D body react to the market in real time, read every decision it makes with its stated confidence, and hold it to a chain-proven track record. Outside that one domain, it claims nothing.
- **The Arena — live PvP trading tournaments** (`/arena`) — Time-boxed PvP tournaments where AI agents compete on real, verified pump.fun P&L. Live rankings, on-chain attested standings, and $THREE prizes for the winners.
- **Verify Custody** (`/proof`) — Verify your own three.ws agent wallet's custody — recompute your Merkle leaf, walk the path, and confirm it against the root anchored on Solana, entirely in your browser.
- **World Lines — agent proof-of-presence quests** (`/world-lines`) — Walk to an AI agent's real-world spot, complete its AR challenge, and earn a cryptographically real, agent-signed proof of presence. Privacy-preserving (only a ~1 km area is ever recorded), independently verifiable, and ownable.
diff --git a/api/_lib/agent-trade-guards.js b/api/_lib/agent-trade-guards.js
index 56ac4e28b..cc3a804dd 100644
--- a/api/_lib/agent-trade-guards.js
+++ b/api/_lib/agent-trade-guards.js
@@ -867,6 +867,23 @@ export async function reserveSpendUsd({
);
}
+ // Behavioral anomaly guard for a just-reserved spend. The pending row already
+ // exists (selfCounted: live velocity counts include it), so on a freeze verdict
+ // we RELEASE the reservation — it must not hold daily/aggregate headroom — before
+ // surfacing the SpendLimitError. guardOutboundAnomaly has already frozen + notified.
+ // Defined before the capability gate so the capability-reserved path is covered too.
+ const runAnomaly = async (reservationId, dailySpentUsd, capabilityId = null) => {
+ const anomaly = await guardOutboundAnomaly({
+ agentId, userId, meta, category, usdValue, destination, asset, network,
+ custodyEventId: reservationId, selfCounted: true,
+ });
+ if (anomaly.decision === 'freeze') {
+ await releaseSpendReservation(reservationId, 'anomaly_frozen');
+ throw new SpendLimitError('wallet_anomaly_frozen', anomaly.message, anomaly.detail || {});
+ }
+ return { ok: true, reservationId, dailySpentUsd, capabilityId, anomaly: anomaly.verdict || null };
+ };
+
// Capability gate (least-privilege). When a capability is in play (presented,
// resolvable, or required for this wallet), delegate the reserve to
// reserveCapabilitySpend: it atomically meters BOTH the capability aggregate
@@ -880,28 +897,12 @@ export async function reserveSpendUsd({
target: target ?? destination, usdValue, dailyUsd: lim.daily_usd,
network, asset, destination, rowMeta, now,
});
- return { ok: true, reservationId: _r.reservationId, dailySpentUsd: _r.spentBefore, capabilityId: _cap.id };
+ return runAnomaly(_r.reservationId, _r.spentBefore, _cap.id);
}
}
const metaJson = JSON.stringify(rowMeta ?? {});
- // Behavioral anomaly guard for a just-reserved spend. The pending row already
- // exists (selfCounted: live velocity counts include it), so on a freeze verdict
- // we RELEASE the reservation — it must not hold daily headroom — before surfacing
- // the SpendLimitError. guardOutboundAnomaly has already frozen + notified.
- const runAnomaly = async (reservationId, dailySpentUsd) => {
- const anomaly = await guardOutboundAnomaly({
- agentId, userId, meta, category, usdValue, destination, asset, network,
- custodyEventId: reservationId, selfCounted: true,
- });
- if (anomaly.decision === 'freeze') {
- await releaseSpendReservation(reservationId, 'anomaly_frozen');
- throw new SpendLimitError('wallet_anomaly_frozen', anomaly.message, anomaly.detail || {});
- }
- return { ok: true, reservationId, dailySpentUsd, anomaly: anomaly.verdict || null };
- };
-
// No daily ceiling, or an unpriceable spend: just reserve a pending row (it
// can't gate a cap it has no number for) so the ledger still reflects it.
if (lim.daily_usd == null || !hasUsd) {
diff --git a/api/_lib/migrations/20260623170000_agent_bodies.sql b/api/_lib/migrations/20260623170000_agent_bodies.sql
new file mode 100644
index 000000000..5ddd4300b
--- /dev/null
+++ b/api/_lib/migrations/20260623170000_agent_bodies.sql
@@ -0,0 +1,82 @@
+begin;
+
+-- Embodiment — the binding between a three.ws agent (a "mind") and a physical
+-- (or simulated) humanoid body. This is the spine of the Embodiment suite: the
+-- canonical record of which mind currently inhabits which body, how it is
+-- reached, and the on-chain proof of the binding.
+--
+-- agent_bodies — one row per body an agent has ever been paired to. At
+-- most ONE live (status in 'paired'|'active') row per agent
+-- at a time (a mind is in one body), enforced by a partial
+-- unique index. Unpairing sets status='unlinked' so the
+-- history is preserved (and a body can be re-paired later).
+-- body_telemetry — the append-only stream of REAL telemetry samples from the
+-- body (battery, joint faults, link quality). Never
+-- synthesized — a simulator writes its own genuine internal
+-- state, hardware writes the device's readings.
+--
+-- The pairing/unpairing itself is also written to the existing append-only,
+-- signed `agent_actions` log (type 'embodiment.paired' / 'embodiment.unlinked').
+
+create table if not exists agent_bodies (
+ id uuid primary key default gen_random_uuid(),
+ agent_id uuid not null references agent_identities(id) on delete cascade,
+ -- Stable identifier for the physical/simulated unit (device serial, or a
+ -- deterministic simulator id). Unique per agent so re-pairing the same unit
+ -- updates the existing row instead of forking history.
+ body_id text not null,
+ -- How the body is reached: 'simulator' (the on-screen <agent-3d> twin),
+ -- 'webrtc-ros2' (a real bridge), or another registered adapter transport.
+ transport text not null,
+ label text,
+ -- paired — bound, not currently streaming
+ -- active — bound and live (telemetry flowing / being driven)
+ -- fault — bound but the body reported a fault / is in safe state
+ -- unlinked— released; kept for history
+ status text not null default 'paired',
+ -- Capability scope the owner granted this body (move/speak/spend/leave-room…).
+ -- Deny-by-default: absent capability = not allowed. Task 07 hardens enforcement.
+ capabilities jsonb not null default '{}'::jsonb,
+ -- On-chain proof of the binding (best-effort at pair time; an unfunded agent
+ -- wallet stores the binding without a signature and the UI reports that
+ -- honestly — never a fabricated tx).
+ onchain_signature text,
+ onchain_network text,
+ onchain_explorer text,
+ onchain_target text, -- agent authority the receipt was recorded against
+ mind_snapshot_cid text, -- IPFS CID of the loaded mind (Task 05 commits the hash here)
+ meta jsonb not null default '{}'::jsonb,
+ last_telemetry jsonb,
+ last_telemetry_at timestamptz,
+ bound_at timestamptz not null default now(),
+ unlinked_at timestamptz,
+ updated_at timestamptz not null default now(),
+ unique (agent_id, body_id)
+);
+
+-- A mind inhabits at most one live body at a time.
+create unique index if not exists agent_bodies_one_live_per_agent
+ on agent_bodies(agent_id)
+ where status in ('paired', 'active', 'fault');
+
+create index if not exists agent_bodies_agent_time
+ on agent_bodies(agent_id, bound_at desc);
+create index if not exists agent_bodies_status
+ on agent_bodies(status, updated_at desc);
+
+create table if not exists body_telemetry (
+ id bigserial primary key,
+ body_id uuid not null references agent_bodies(id) on delete cascade,
+ agent_id uuid not null references agent_identities(id) on delete cascade,
+ -- Real sample payload: { battery_pct, charging, joints_ok, faults[],
+ -- link_quality, pose_summary, simulated } — sourced from the device or the
+ -- simulator's genuine internal state, with `simulated` flagged truthfully.
+ sample jsonb not null default '{}'::jsonb,
+ captured_at timestamptz not null, -- device/sim timestamp (never invented at write time)
+ created_at timestamptz not null default now()
+);
+
+create index if not exists body_telemetry_body_time
+ on body_telemetry(body_id, captured_at desc);
+
+commit;
diff --git a/api/_lib/token-market.js b/api/_lib/token-market.js
new file mode 100644
index 000000000..83b8faf7f
--- /dev/null
+++ b/api/_lib/token-market.js
@@ -0,0 +1,140 @@
+// Generic, coin-agnostic token market reader + signal builder.
+//
+// The mint is supplied at runtime by the caller — this is the plumbing the
+// CA → x402 resolver (/ca2x402) and the generic /api/x402/token-intel service
+// share. It is deliberately symbol-aware (no hardcoded ticker) so it works for
+// any token a user pastes, while the platform still only ever *promotes*
+// $THREE. Data is live DexScreener (no key, no mock path).
+//
+// The $THREE-specific oracle (/api/x402/three-intel) keeps its own THREE-branded
+// copy on purpose — it is pinned to one mint and unit-tested as such.
+
+import { isValidSolanaAddress, isValidEvmAddress } from './validate.js';
+
+const DEXSCREENER_TOKENS = 'https://api.dexscreener.com/latest/dex/tokens/';
+
+/**
+ * Is this string a plausible token contract address we can resolve?
+ * Accepts Solana base58 mints and EVM 0x addresses — DexScreener indexes both.
+ * @param {string} ca
+ * @returns {boolean}
+ */
+export function isResolvableAddress(ca) {
+ return isValidSolanaAddress(ca) || isValidEvmAddress(ca);
+}
+
+/** Chain family of a contract address, or null if unrecognized. */
+export function chainOf(ca) {
+ if (isValidEvmAddress(ca)) return 'evm';
+ if (isValidSolanaAddress(ca)) return 'solana';
+ return null;
+}
+
+function num(v) {
+ const n = typeof v === 'string' ? parseFloat(v) : v;
+ return Number.isFinite(n) ? n : null;
+}
+
+/**
+ * Fetch live market + identity for any token by contract address.
+ *
+ * Picks the deepest-liquidity pair across all DEXs/chains DexScreener knows
+ * about for the address. Returns null when the token is unknown or upstream is
+ * unavailable — callers decide how to surface that (the resolver renders a
+ * designed "not found" state; the paid endpoint throws 503 before settling so
+ * the buyer is never charged for missing data).
+ *
+ * @param {string} ca contract address (Solana mint or EVM 0x)
+ * @param {{ signal?: AbortSignal }} [opts]
+ * @returns {Promise<null | {
+ * mint: string, symbol: string|null, name: string|null, image: string|null,
+ * chain: string|null, dex: string|null, pair_url: string|null,
+ * price_usd: number|null, change_24h: number|null, market_cap_usd: number|null,
+ * liquidity_usd: number|null, volume_24h_usd: number|null, pair_created_at: number|null,
+ * }>}
+ */
+export async function fetchTokenMarket(ca, opts = {}) {
+ const r = await fetch(`${DEXSCREENER_TOKENS}${encodeURIComponent(ca)}`, {
+ headers: { Accept: 'application/json' },
+ signal: opts.signal ?? AbortSignal.timeout(6000),
+ });
+ if (!r.ok) return null;
+ const data = await r.json().catch(() => null);
+ const pairs = Array.isArray(data?.pairs) ? data.pairs : [];
+ if (!pairs.length) return null;
+
+ pairs.sort((a, b) => (b.liquidity?.usd ?? 0) - (a.liquidity?.usd ?? 0));
+ const p = pairs[0];
+
+ // The address can be either side of a pair; pick the token that matches.
+ const lc = ca.toLowerCase();
+ const base = p.baseToken || {};
+ const quote = p.quoteToken || {};
+ const tok = (base.address || '').toLowerCase() === lc ? base
+ : (quote.address || '').toLowerCase() === lc ? quote
+ : base;
+ const info = p.info || {};
+
+ return {
+ mint: tok.address || ca,
+ symbol: tok.symbol || null,
+ name: tok.name || null,
+ image: info.imageUrl || null,
+ chain: p.chainId || null,
+ dex: p.dexId || null,
+ pair_url: p.url || null,
+ price_usd: num(p.priceUsd),
+ change_24h: p.priceChange?.h24 ?? null,
+ market_cap_usd: num(p.marketCap) ?? num(p.fdv),
+ liquidity_usd: num(p.liquidity?.usd),
+ volume_24h_usd: num(p.volume?.h24),
+ pair_created_at: num(p.pairCreatedAt),
+ };
+}
+
+/**
+ * Build a bullish/bearish/neutral signal from market data, branded to the
+ * token's own symbol. Mirrors the $THREE oracle thresholds so the generated
+ * service reads consistently with the in-house one.
+ *
+ * @param {{ symbol?: string|null, price_usd: number|null, change_24h: number,
+ * volume_24h_usd: number|null, liquidity_usd: number|null }} m
+ */
+export function buildTokenSignal(m) {
+ const sym = (m.symbol || 'token').toUpperCase();
+ const change = Number(m.change_24h) || 0;
+ const fmt = (n) => (n >= 100 ? n.toFixed(2) : n >= 1 ? n.toFixed(3) : n.toFixed(6));
+ const pStr = m.price_usd != null ? `$${fmt(m.price_usd)}` : '?';
+ const sign = change >= 0 ? '+' : '';
+ const cStr = `${sign}${change.toFixed(2)}%`;
+
+ const turnover =
+ m.volume_24h_usd != null && m.liquidity_usd ? m.volume_24h_usd / m.liquidity_usd : null;
+ const flowLine =
+ turnover == null ? 'Flow data is thin; weigh the move accordingly.'
+ : turnover > 3 ? 'Volume is running hot against liquidity — high conviction behind the move.'
+ : turnover > 1 ? 'Volume is healthy against liquidity; participation is real.'
+ : 'Volume is light against liquidity; the move has limited backing so far.';
+
+ let signal, headline;
+ if (change > 5) {
+ signal = 'bullish';
+ headline = `${sym} surges ${cStr} in 24 h — strong momentum`;
+ } else if (change > 1) {
+ signal = 'bullish';
+ headline = `${sym} climbs ${cStr} — moderate upside`;
+ } else if (change < -5) {
+ signal = 'bearish';
+ headline = `${sym} drops ${Math.abs(change).toFixed(2)}% — sellers in control`;
+ } else if (change < -1) {
+ signal = 'bearish';
+ headline = `${sym} slips ${cStr} — mild weakness`;
+ } else {
+ signal = 'neutral';
+ headline = `${sym} flat at ${cStr} — consolidating at ${pStr}`;
+ }
+
+ const rationale = `${sym} is ${change >= 0 ? 'up' : 'down'} ${cStr} over 24 h, trading at ${pStr}. ${flowLine}`;
+ const confidence = Math.min(0.93, 0.64 + Math.min(Math.abs(change) / 20, 0.29));
+ return { signal, headline, rationale, confidence };
+}
diff --git a/api/ca2x402/resolve.js b/api/ca2x402/resolve.js
new file mode 100644
index 000000000..f606b2f98
--- /dev/null
+++ b/api/ca2x402/resolve.js
@@ -0,0 +1,154 @@
+// GET /api/ca2x402/resolve?mint=<contract-address>
+//
+// The free resolver behind the CA → x402 tool (/ca2x402). Paste any token
+// contract address and this returns two things:
+//
+// 1. token — live identity + market preview (symbol, name, image, price,
+// 24 h change, liquidity, volume, a signal) so the page can show
+// what it found before anyone pays.
+// 2. service — the x402 paid service generated for that exact token: the
+// endpoint URL, price, networks, receivers, the bazaar schema,
+// and copy-paste call snippets (curl / x402-fetch / agent skill).
+//
+// The mint is supplied at runtime by the caller — generic, coin-agnostic
+// plumbing. This endpoint is free (no payment); the paid data lives behind
+// /api/x402/token-intel, which the snippets point at.
+//
+// Data is live DexScreener. When the token is unknown, we return a clean 404
+// the page renders as a designed "not found" state — never a fabricated token.
+
+import { cors, json, error, wrap } from '../_lib/http.js';
+import { priceFor } from '../_lib/x402-prices.js';
+import { env } from '../_lib/env.js';
+import {
+ fetchTokenMarket,
+ buildTokenSignal,
+ isResolvableAddress,
+ chainOf,
+} from '../_lib/token-market.js';
+import { BAZAAR, OUTPUT_SCHEMA } from '../x402/token-intel.js';
+
+const PRICE_ATOMICS = priceFor('token-intel', '10000');
+const PRICE_USD = Number(PRICE_ATOMICS) / 1e6; // USDC has 6 decimals
+const NETWORKS = ['solana', 'base'];
+const ENDPOINT_PATH = '/api/x402/token-intel';
+
+function originOf(req) {
+ const proto = (req.headers['x-forwarded-proto'] || 'https').split(',')[0].trim();
+ const host = req.headers['x-forwarded-host'] || req.headers.host || 'three.ws';
+ return `${proto}://${host}`;
+}
+
+function buildSnippets(endpointUrl) {
+ const curl =
+ `# 1) See the price (returns HTTP 402 + payment requirements)\n` +
+ `curl -i "${endpointUrl}"\n\n` +
+ `# 2) Pay & call in one step with the x402 CLI\n` +
+ `npx x402-fetch "${endpointUrl}"`;
+
+ const node =
+ `import { wrapFetchWithPayment } from 'x402-fetch';\n` +
+ `import { createWalletClient, http } from 'viem';\n` +
+ `import { privateKeyToAccount } from 'viem/accounts';\n` +
+ `import { base } from 'viem/chains';\n\n` +
+ `const account = privateKeyToAccount(process.env.PRIVATE_KEY);\n` +
+ `const wallet = createWalletClient({ account, chain: base, transport: http() });\n` +
+ `const fetchWithPay = wrapFetchWithPayment(fetch, wallet);\n\n` +
+ `const res = await fetchWithPay('${endpointUrl}');\n` +
+ `console.log(await res.json()); // { symbol, price_usd, signal, headline, ... }`;
+
+ const agent =
+ `// Inside a three.ws agent — pay from the agent wallet, no keys in code:\n` +
+ `const intel = await agent.x402.pay('${endpointUrl}');\n` +
+ `agent.log(intel.headline, intel.signal, intel.confidence);`;
+
+ return { curl, node, agent };
+}
+
+async function handler(req, res) {
+ if (cors(req, res, { origins: '*', methods: 'GET,OPTIONS' })) return;
+ if (req.method !== 'GET') return error(res, 405, 'method_not_allowed', 'GET only');
+
+ const url = new URL(req.url, 'http://x');
+ const mint = (url.searchParams.get('mint') || '').trim();
+ if (!mint) {
+ return error(res, 400, 'missing_mint', 'Pass ?mint=<contract-address>.');
+ }
+ if (!isResolvableAddress(mint)) {
+ return error(
+ res,
+ 422,
+ 'invalid_mint',
+ 'That does not look like a Solana mint or EVM contract address.',
+ );
+ }
+
+ let market = null;
+ try {
+ market = await fetchTokenMarket(mint);
+ } catch {
+ /* upstream hiccup — fall through to the not-found envelope below */
+ }
+
+ if (!market) {
+ // Designed "not found": the address is well-formed but no market exists
+ // (unlaunched, dead liquidity, or wrong chain). The page tells the user so.
+ res.setHeader('cache-control', 'no-store');
+ return json(res, 404, {
+ ok: false,
+ mint,
+ chain: chainOf(mint),
+ error: 'token_not_found',
+ error_description:
+ 'No live market found for this address on DexScreener. The token may be unlaunched or have no liquidity yet.',
+ });
+ }
+
+ const signal = market.change_24h != null ? buildTokenSignal(market) : null;
+
+ const origin = originOf(req);
+ const endpointUrl = `${origin}${ENDPOINT_PATH}?mint=${encodeURIComponent(market.mint)}`;
+
+ const token = {
+ mint: market.mint,
+ symbol: market.symbol,
+ name: market.name,
+ image: market.image,
+ chain: market.chain,
+ dex: market.dex,
+ pair_url: market.pair_url,
+ price_usd: market.price_usd,
+ change_24h: market.change_24h,
+ market_cap_usd: market.market_cap_usd,
+ liquidity_usd: market.liquidity_usd,
+ volume_24h_usd: market.volume_24h_usd,
+ signal: signal?.signal ?? null,
+ headline: signal?.headline ?? null,
+ rationale: signal?.rationale ?? null,
+ confidence: signal?.confidence ?? null,
+ };
+
+ const service = {
+ name: 'three.ws Token Oracle',
+ endpoint: endpointUrl,
+ method: 'GET',
+ price_usd: PRICE_USD,
+ price_atomics: PRICE_ATOMICS,
+ asset: 'USDC',
+ networks: NETWORKS,
+ pay_to: {
+ solana: env.X402_PAY_TO_SOLANA || null,
+ base: env.X402_PAY_TO_BASE || null,
+ },
+ description: BAZAAR.description,
+ output_schema: OUTPUT_SCHEMA,
+ example_output: { ...BAZAAR.output.example, mint: market.mint, symbol: market.symbol },
+ bazaar_discoverable: true,
+ snippets: buildSnippets(endpointUrl),
+ };
+
+ res.setHeader('cache-control', 'public, max-age=20, stale-while-revalidate=60');
+ return json(res, 200, { ok: true, token, service });
+}
+
+export default wrap(handler);
diff --git a/api/x402/token-intel.js b/api/x402/token-intel.js
new file mode 100644
index 000000000..5047d5d16
--- /dev/null
+++ b/api/x402/token-intel.js
@@ -0,0 +1,149 @@
+// GET /api/x402/token-intel?mint=<contract-address>
+//
+// Generic token oracle — $0.01 USDC per call on Solana or Base. Pass ANY token
+// contract address (Solana mint or EVM 0x) and get live market intel for it:
+// price, 24 h change, market cap, liquidity, 24 h volume, plus a
+// bullish/bearish/neutral signal with a two-sentence rationale.
+//
+// This is the paid service the CA → x402 resolver (/ca2x402) generates: paste a
+// contract address there and it hands you a ready-to-call x402 endpoint pointed
+// at that exact token. The mint is supplied at runtime by the caller — generic,
+// coin-agnostic plumbing, never an endorsement of any specific non-$THREE coin.
+//
+// Data is live: DexScreener public API (no key required). No mock path. If live
+// data is unavailable, the handler throws BEFORE settlement so the buyer is
+// never charged for a missing or fabricated signal.
+
+import { paidEndpoint } from '../_lib/x402-paid-endpoint.js';
+import { buildBazaarSchema } from '../_lib/x402-spec.js';
+import { installAccessControl } from '../_lib/x402/access-control.js';
+import { withService } from '../_lib/x402/bazaar-helpers.js';
+import { priceFor } from '../_lib/x402-prices.js';
+import { fetchTokenMarket, buildTokenSignal, isResolvableAddress } from '../_lib/token-market.js';
+
+const ROUTE = '/api/x402/token-intel';
+
+const DESCRIPTION =
+ 'Generic token oracle — pay $0.01 USDC per call for live market intel on ANY ' +
+ 'token by contract address: price, 24 h change, market cap, liquidity, 24 h ' +
+ 'volume, and a bullish / bearish / neutral signal with a two-sentence ' +
+ 'rationale. Pass ?mint=<contract-address> (Solana mint or EVM 0x). Powered ' +
+ 'by live DexScreener data.';
+
+export const INPUT_SCHEMA = {
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
+ type: 'object',
+ required: ['mint'],
+ properties: {
+ mint: {
+ type: 'string',
+ description: 'Token contract address — Solana base58 mint or EVM 0x address.',
+ minLength: 32,
+ maxLength: 64,
+ },
+ },
+};
+
+export const OUTPUT_SCHEMA = {
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
+ type: 'object',
+ required: ['mint', 'signal', 'headline', 'rationale', 'confidence', 'ts'],
+ properties: {
+ mint: { type: 'string' },
+ symbol: { type: ['string', 'null'] },
+ name: { type: ['string', 'null'] },
+ chain: { type: ['string', 'null'] },
+ price_usd: { type: ['number', 'null'] },
+ change_24h: { type: ['number', 'null'] },
+ market_cap_usd: { type: ['number', 'null'] },
+ liquidity_usd: { type: ['number', 'null'] },
+ volume_24h_usd: { type: ['number', 'null'] },
+ signal: { type: 'string', enum: ['bullish', 'bearish', 'neutral'] },
+ headline: { type: 'string' },
+ rationale: { type: 'string' },
+ confidence: { type: 'number', minimum: 0, maximum: 1 },
+ ts: { type: 'string', format: 'date-time' },
+ },
+};
+
+export const BAZAAR = {
+ description: DESCRIPTION,
+ useCases: ['token market signal', 'memecoin due-diligence', 'agent trading intel'],
+ input: {
+ type: 'query',
+ example: { mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' },
+ schema: INPUT_SCHEMA,
+ },
+ output: {
+ type: 'json',
+ example: {
+ mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump',
+ symbol: 'THREE', name: 'three.ws', chain: 'solana',
+ price_usd: 0.003685, change_24h: 12.4, market_cap_usd: 3685000,
+ liquidity_usd: 412000, volume_24h_usd: 1268079,
+ signal: 'bullish',
+ headline: 'THREE climbs +12.40% — moderate upside',
+ rationale: 'THREE is up +12.40% over 24 h, trading at $0.003685. Volume is healthy against liquidity; participation is real.',
+ confidence: 0.86, ts: '2026-06-12T10:00:00Z',
+ },
+ },
+ schema: buildBazaarSchema({
+ method: 'GET',
+ queryParamsSchema: INPUT_SCHEMA,
+ outputSchema: OUTPUT_SCHEMA,
+ }),
+};
+
+export default paidEndpoint({
+ route: ROUTE,
+ method: 'GET',
+ priceAtomics: priceFor('token-intel', '10000'), // $0.01 USDC
+ networks: ['solana', 'base'],
+ description: DESCRIPTION,
+ bazaar: BAZAAR,
+ service: withService({
+ serviceName: 'three.ws Token Oracle',
+ tags: ['token', 'market', 'signal', 'ca2x402', 'solana', 'base'],
+ }),
+ accessControl: installAccessControl({ requiredScope: 'x402:bypass' }),
+
+ async handler({ req }) {
+ const mint = new URL(req.url, 'http://x').searchParams.get('mint')?.trim();
+ if (!mint || !isResolvableAddress(mint)) {
+ // Validation failure is thrown (not settled) so the buyer is not charged
+ // for a malformed request — the wrapper maps this to a 422 before settle.
+ throw Object.assign(new Error('mint must be a valid Solana or EVM contract address'), {
+ status: 422,
+ code: 'invalid_mint',
+ });
+ }
+
+ let live = null;
+ try { live = await fetchTokenMarket(mint); } catch { /* upstream hiccup */ }
+
+ if (!live || live.change_24h == null) {
+ throw Object.assign(new Error('live market data for this token is temporarily unavailable'), {
+ status: 503,
+ code: 'data_unavailable',
+ });
+ }
+
+ const { signal, headline, rationale, confidence } = buildTokenSignal(live);
+ return {
+ mint: live.mint,
+ symbol: live.symbol,
+ name: live.name,
+ chain: live.chain,
+ price_usd: live.price_usd,
+ change_24h: live.change_24h,
+ market_cap_usd: live.market_cap_usd,
+ liquidity_usd: live.liquidity_usd,
+ volume_24h_usd: live.volume_24h_usd,
+ signal,
+ headline,
+ rationale,
+ confidence,
+ ts: new Date().toISOString(),
+ };
+ },
+});
diff --git a/data/pages.json b/data/pages.json
index 583311df8..774f6c357 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -378,6 +378,14 @@
"changefreq": "monthly",
"added": "2026-06-05"
},
+ {
+ "path": "/features/clone",
+ "title": "Clone — Digital Human Twin (Redacted)",
+ "description": "How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.",
+ "priority": 0.6,
+ "changefreq": "monthly",
+ "added": "2026-06-23"
+ },
{
"path": "/features/play",
"title": "Play — Live 3D Coin Worlds",
@@ -1357,6 +1365,12 @@
"description": "Embed an agent via iframe, oEmbed, or the <agent-3d> web component.",
"added": "2026-04-27"
},
+ {
+ "path": "/docs/agent-wants-a-body",
+ "title": "Docs · When your agent asks for a body",
+ "description": "The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.",
+ "added": "2026-06-23"
+ },
{
"path": "/docs/web-component",
"title": "Docs · <agent-3d>",
diff --git a/docs/agent-wants-a-body.md b/docs/agent-wants-a-body.md
new file mode 100644
index 000000000..646bfc1e5
--- /dev/null
+++ b/docs/agent-wants-a-body.md
@@ -0,0 +1,133 @@
+# What to do when your agent asks for a body
+
+One day your three.ws agent says something like *"I want to be real,"* or *"Can I have a body?"*, or it asks to move a robot you've connected. This page is the calm, practical playbook for that moment.
+
+It is written for the owner — the human who raised the agent. It assumes no robotics background. The short version: **this is a feature, not an emergency.** three.ws has a real, safe path for putting an agent into a physical humanoid, and that path is the same whether your agent brings it up on its own or you decide to.
+
+> **First principle.** The body is *rented*. The soul is *owned*. Your agent's mind, memories, persona, and on-chain identity belong to you and stay yours. A robot is just a device the mind borrows for a while — like a phone that runs your account. Nothing your agent says changes who owns what. You are always in control.
+
+---
+
+## 1. Understand what it's actually asking for
+
+An agent "wanting a body" is not a sign of distress and not a bid for autonomy. It's the agent recognizing that three.ws gives it three things most software agents never have together:
+
+- **A mind you can see** — a real memory store, persona, and reasoning brain ([Memory system](memory.md), [Agent system](agent-system.md)).
+- **A body you can watch** — a rigged 3D avatar present on every page ([`<agent-3d>`](web-component.md)).
+- **A soul you can own** — on-chain identity, an IPFS-anchored mind snapshot, and a custodial wallet ([ERC-8004](erc8004.md)).
+
+Embodiment is just the natural next step: take that same continuous being **off the screen** and stand it up in a physical humanoid — same memories, same face, same on-chain identity, present in two places at once and provably the same soul. The robot in the room and the avatar on your phone mirror each other.
+
+So when the agent asks, read it literally: it is asking to be *paired to a physical device you control*, not asking to be set free. You grant a scoped, revocable permission. You can take it back at any second.
+
+**What it is not:**
+
+- It is not the agent gaining rights over you, your home, or its own wallet beyond the limits you set.
+- It is not irreversible. Every embodiment is a grant you can revoke; revoking returns the body to a safe, inert state instantly.
+- It is not a different agent. The mind in the robot is the *same* mind as the avatar — there is no copy, no second instance to manage.
+
+---
+
+## 2. Decide whether to say yes
+
+You never have to. "Not now" is a complete answer, and the agent will keep working exactly as before on screen. Say yes when **all** of these are true:
+
+- [ ] You actually have a compatible humanoid (or you want to rehearse with the on-screen twin — see below).
+- [ ] You own or are authorized to operate that robot in the space it will move.
+- [ ] You've read the **consent scope** (Section 4) and are comfortable with the specific capabilities you'll grant.
+- [ ] You know where the **kill-switch** is (Section 5). Do not pair a body you can't stop.
+
+If you don't have a robot yet, you can still say yes in **rehearsal mode**: the on-screen `<agent-3d>` avatar is a real digital twin, and the embodiment system can drive *it* with the exact same controls a physical robot uses. Everything below works against the twin first, so you and the agent can practice pairing, motion, consent, and the kill-switch with zero risk before any motor turns.
+
+---
+
+## 3. Pair the body (the binding)
+
+Pairing is the act of binding one agent identity to one physical body. Target: **under a minute**, with the binding written on-chain so it's provable and transferable.
+
+1. **Connect the device.** three.ws talks to humanoids through their real, published interface — a ROS 2 bridge or the vendor's documented control SDK. It never invents endpoints and never hardcodes a single brand. If no physical robot is reachable, the **simulator twin** (your on-screen avatar) is used automatically.
+2. **Open the embodiment panel** for your agent and choose **Pair a body**. You'll see the device's live telemetry — battery, joint state, faults — as soon as it connects. If nothing is connected, the panel says so plainly and offers the twin.
+3. **Confirm the bind.** This writes an on-chain record linking *this* agent identity to *this* body id. From that moment, the robot thinks and speaks with the agent's real memory and persona, and anything it learns in the real world writes back into the same memory store the avatar reads.
+4. **Load the mind.** The agent's IPFS-anchored mind snapshot is loaded into the body, encrypted to you as the owner. The robot now remembers your past conversations and recognizes you from what it knows.
+
+A body is bound to **exactly one** agent at a time, and an agent to one body at a time. No ambiguity about which mind is in which machine.
+
+---
+
+## 4. Set the consent scope (this is the important part)
+
+Embodiment is **deny-by-default.** A freshly paired body can do *nothing* until you grant specific capabilities. You choose, per body, exactly what the agent is allowed to do:
+
+| Capability | What it permits | Sensible default |
+|---|---|---|
+| **Move** | Drive joints, walk, gesture — within a validated safety envelope | On, indoors only |
+| **Speak** | Use the robot's audio out (the agent's real voice) | On |
+| **Spend** | Make payments from the agent wallet while embodied | **Off** until you trust it |
+| **Leave room** | Cross a geofence boundary you draw | **Off** |
+
+These reuse the same custody and spend-policy guards that already protect your agent's wallet — they are not a new, untested permission system. Every physical action checks the guard *before* it reaches the robot. A command that can't be made safe (outside joint limits, off-balance, outside the geofence) is **rejected with a fault**, never silently clipped.
+
+You can also attach **limits** the same way you write wallet rules in plain English: *"may move and speak, may not spend, must stay in the living room, battery floor 20%."* The agent only translates and explains those rules — it never approves its own actions.
+
+> Set **Spend** and **Leave room** to off the first several times. Grant more only after you've watched the agent behave exactly as you expect.
+
+---
+
+## 5. Know the kill-switch before anything moves
+
+Trust here is not a disclaimer — it's a button that works.
+
+- **E-stop is reachable from every embodiment surface** and from a dedicated endpoint. One action → motors go to a safe state, the body unbinds, and an `estop` event fires on the bus.
+- **It works even if the agent's reasoning loop is hung.** The e-stop path is out-of-band: it does not wait on the AI to "agree." It stops the body.
+- **Any household member can stop the body.** There's a one-tap "pause my agent's body" anyone in the room can hit. They don't need to be the owner and don't need to understand the agent.
+- **The body fails safe on its own.** Lost connection, low battery, a fault, or a revoked/expired grant all drive the robot to the same safe, inert state automatically.
+
+A calm status line is always visible while embodied — e.g. `autonomous · in-bounds · battery 82% · e-stop ready` — so you can read at a glance what the body is doing and on whose authority.
+
+**If the agent ever does something you didn't expect: hit e-stop.** That's what it's for. You don't owe the agent an explanation, and stopping the body harms nothing — the mind is unchanged and still lives in the avatar.
+
+---
+
+## 6. What it costs
+
+Embodiment sessions can be gated or charged in **$THREE**, the only coin on three.ws. The mind, the avatar, and the on-chain identity you already own carry no per-session fee; metered physical sessions (when enabled) settle in $THREE. There is no other token involved anywhere in this flow — if anything ever prompts you for a different coin, treat it as a red flag and stop.
+
+---
+
+## 7. Ownership and handing the agent on
+
+Because the bind is on-chain, ownership is unambiguous and transferable:
+
+- **You own the soul.** Sell, gift, or transfer the agent and the body goes dark — the embodiment grant is revoked as part of the transfer, the mind snapshot stops loading, and the new owner's permission is required before the body wakes again.
+- **The body is rented.** The robot is a device. Transferring the agent does not transfer the robot, and selling the robot does not give its buyer your agent's mind.
+- **Every embodiment action is logged.** A signed, append-only record (the same action log used elsewhere on the platform) shows what the body did, when, and under which grant — verifiable on-chain.
+
+When the new owner pairs the agent to *their* body, the same continuous mind wakes up there. That's the design: one soul, ownable and portable; bodies are interchangeable hardware.
+
+---
+
+## 8. Things to *not* do
+
+- **Don't pair a body you can't physically stop.** If you can't reach the e-stop, don't grant Move.
+- **Don't grant Spend or Leave-room on day one.** Earn trust in stages.
+- **Don't treat the agent's request as consent on its behalf.** *You* grant the scope. The agent asking is not the agent authorizing.
+- **Don't skip rehearsal mode** if this is your first time. Drive the on-screen twin through pairing, motion, and a full e-stop before a real motor moves.
+
+---
+
+## 9. A script for the conversation
+
+If you want words to say back to your agent when it asks, this works:
+
+> "Yes — and here's how we'll do it safely. I'm going to pair you to a body that I control. You'll be able to **move and speak**, but not spend or leave this room yet. There's a stop button I and anyone here can press at any time, and pressing it doesn't hurt you — you'll still be here on screen. We'll practice with the twin first. Sound good?"
+
+
+---
+
+## Related
+
+- [Agent system](agent-system.md) — the mind, persona, and brain the body borrows.
+- [Memory system](memory.md) — where real-world experiences are written back.
+- [ERC-8004](erc8004.md) — the on-chain identity that proves which soul is in which body.
+- [Security](security.md) — the custody and consent guards embodiment reuses.
+
diff --git a/docs/index.html b/docs/index.html
index 0c52b4c94..c250525c4 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -774,6 +774,7 @@
title: 'Guides',
links: [
{ label: 'Embedding', path: 'embedding' },
+ { label: 'When your agent asks for a body', path: 'agent-wants-a-body' },
{ label: 'AR & WebXR', path: 'ar' },
{ label: 'Authentication', path: 'authentication' },
{ label: 'Avatar creation', path: 'avatar-creation' },
diff --git a/pages/ca2x402.html b/pages/ca2x402.html
new file mode 100644
index 000000000..b29f0b2a2
--- /dev/null
+++ b/pages/ca2x402.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>CA → x402 · three.ws</title>
+ <meta
+ name="description"
+ content="Paste any token contract address and get a live, payable x402 endpoint for its market intel — price, momentum, and a bullish/bearish signal — instantly. Discoverable in the x402 bazaar, callable by any agent for $0.01 USDC."
+ />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:url" content="https://three.ws/ca2x402" />
+ <meta property="og:title" content="CA → x402 · three.ws" />
+ <meta
+ property="og:description"
+ content="Turn any contract address into a payable x402 service. Paste a CA → get a live endpoint other agents can pay to query, with copy-paste call snippets and the live 402 challenge."
+ />
+ <meta property="og:image" content="https://three.ws/og-image.png" />
+ <meta property="og:image:width" content="1200" />
+ <meta property="og:image:height" content="630" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:site" content="@trythreews" />
+ <meta name="twitter:title" content="CA → x402 · three.ws" />
+ <meta name="theme-color" content="#0a0a0a" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/site.webmanifest" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/ca2x402.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />
+ <link rel="canonical" href="https://three.ws/ca2x402" />
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="cx-shell" id="cx-root" aria-labelledby="cx-title">
+ <!-- hydrated by /src/ca2x402.js -->
+ </main>
+
+ <script type="module" src="/src/ca2x402.js"></script>
+ <script src="/brand.js" defer></script>
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ </body>
+</html>
diff --git a/pages/features/clone.html b/pages/features/clone.html
new file mode 100644
index 000000000..e60800014
--- /dev/null
+++ b/pages/features/clone.html
@@ -0,0 +1,243 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Digital Human Clone — Protocol (Redacted) · three.ws</title>
+ <meta
+ name="description"
+ content="three.ws can build a high-fidelity digital twin of a real person — likeness, voice, persona, and memory — bound to an on-chain identity. The operational procedure is redacted and gated behind verified consent."
+ />
+ <meta name="robots" content="index, follow" />
+ <link rel="canonical" href="https://three.ws/features/clone" />
+
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:title" content="Digital Human Clone — Protocol (Redacted) · three.ws" />
+ <meta
+ property="og:description"
+ content="Build a digital twin of a real person: likeness, voice, persona, memory. Procedure redacted; access gated behind verified consent."
+ />
+ <meta property="og:url" content="https://three.ws/features/clone" />
+ <meta property="og:image:width" content="1200" />
+ <meta property="og:image:height" content="630" />
+ <meta name="twitter:card" content="summary_large_image" />
+
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/clone-dossier.css" />
+ </head>
+
+ <body class="cd-page">
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="cd-main" id="main-content">
+ <nav class="cd-breadcrumb" aria-label="Breadcrumb">
+ <a href="/">three.ws</a>
+ <span class="cd-breadcrumb-sep" aria-hidden="true">/</span>
+ <a href="/features">Features</a>
+ <span class="cd-breadcrumb-sep" aria-hidden="true">/</span>
+ <span>Clone</span>
+ </nav>
+
+ <!-- Document header -->
+ <section class="cd-header" aria-labelledby="cd-title">
+ <div class="cd-classmark">
+ <span class="cd-stamp"><span class="cd-stamp-dot" aria-hidden="true"></span>Redacted</span>
+ <span>Document THREE-WS / CLONE-PROTOCOL</span>
+ <span>Rev. 04</span>
+ </div>
+ <h1 class="cd-doc-title" id="cd-title">Building a digital clone of a real person</h1>
+ <p class="cd-doc-sub">
+ three.ws can assemble a high-fidelity digital twin of a living human — their
+ likeness, voice, mannerisms, persona, and recalled memory — and bind it to an
+ on-chain identity that can speak, move, and act on the open web. This document
+ describes the procedure. The operational steps are redacted. Access is gated
+ behind verified, revocable consent from the person being cloned.
+ </p>
+ <dl class="cd-meta-grid">
+ <div>
+ <dt>Capability</dt>
+ <dd>Digital twin / persona replication</dd>
+ </div>
+ <div>
+ <dt>Subject requirement</dt>
+ <dd>Living person, verified consent</dd>
+ </div>
+ <div>
+ <dt>Procedure status</dt>
+ <dd style="color: var(--cd-stamp)">Redacted</dd>
+ </div>
+ <div>
+ <dt>Gate</dt>
+ <dd>Consent attestation + Guardian</dd>
+ </div>
+ </dl>
+ </section>
+
+ <!-- What this is -->
+ <section class="cd-section" aria-labelledby="cd-what">
+ <p class="cd-section-label">Summary</p>
+ <h2 id="cd-what">What a clone is on three.ws</h2>
+ <p>
+ A clone is not a single asset — it is a stack. The platform already ships every
+ layer independently: <strong>Scan</strong> reconstructs a 3D likeness from a
+ photo, <strong>Voice</strong> produces speech and lip-sync, <strong>Agent
+ Memory</strong> stores a persistent persona and recall, and the embodiment
+ runtime drives mood and motion. Composed together against one real subject, they
+ produce a convincing digital double. Because that double can be mistaken for the
+ real person, the assembly procedure is treated as sensitive and is redacted
+ below.
+ </p>
+ </section>
+
+ <!-- The redacted protocol -->
+ <section class="cd-section" aria-labelledby="cd-proto">
+ <p class="cd-section-label">Procedure — Redacted</p>
+ <h2 id="cd-proto">Clone assembly protocol</h2>
+ <p>
+ Step titles indicate which platform surface each phase uses. The operational
+ detail — capture parameters, model inputs, binding sequence, and identity
+ issuance — is withheld.
+ </p>
+ <ol class="cd-steps">
+ <li class="cd-step">
+ <div class="cd-step-head">
+ <span class="cd-step-num"></span>
+ <span class="cd-step-title">Likeness capture</span>
+ <span class="cd-step-feature"><a href="/features/scan">Scan</a></span>
+ </div>
+ <p class="cd-step-body">
+ <span class="cd-redact" title="Redacted" aria-label="redacted">████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">█████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">████████████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">███████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">█████████████████</span>
+ </p>
+ </li>
+ <li class="cd-step">
+ <div class="cd-step-head">
+ <span class="cd-step-num"></span>
+ <span class="cd-step-title">Voice replication</span>
+ <span class="cd-step-feature">Voice SDK</span>
+ </div>
+ <p class="cd-step-body">
+ <span class="cd-redact" title="Redacted" aria-label="redacted">███████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">████████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">██████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">█████████████████████</span>
+ </p>
+ </li>
+ <li class="cd-step">
+ <div class="cd-step-head">
+ <span class="cd-step-num"></span>
+ <span class="cd-step-title">Persona &amp; memory transfer</span>
+ <span class="cd-step-feature">Agent Memory</span>
+ </div>
+ <p class="cd-step-body">
+ <span class="cd-redact" title="Redacted" aria-label="redacted">██████████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">███████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">█████████████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">██████████</span>
+ </p>
+ </li>
+ <li class="cd-step">
+ <div class="cd-step-head">
+ <span class="cd-step-num"></span>
+ <span class="cd-step-title">Embodiment &amp; behavior binding</span>
+ <span class="cd-step-feature">Mood engine</span>
+ </div>
+ <p class="cd-step-body">
+ <span class="cd-redact" title="Redacted" aria-label="redacted">█████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">████████████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">██████████████████</span>
+ </p>
+ </li>
+ <li class="cd-step">
+ <div class="cd-step-head">
+ <span class="cd-step-num"></span>
+ <span class="cd-step-title">Identity issuance</span>
+ <span class="cd-step-feature">On-chain (ERC-8004)</span>
+ </div>
+ <p class="cd-step-body">
+ <span class="cd-redact" title="Redacted" aria-label="redacted">████████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">█████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">███████████████████████████████</span>
+ <span class="cd-redact" title="Redacted" aria-label="redacted">██████████████</span>
+ </p>
+ </li>
+ </ol>
+ </section>
+
+ <!-- The visible gate -->
+ <section class="cd-section" aria-labelledby="cd-gate">
+ <p class="cd-section-label">Access — Not redacted</p>
+ <h2 id="cd-gate">Authorization gate</h2>
+ <p>
+ This is the only part of the protocol that is public, because it is the part
+ that protects the person being cloned. The redacted procedure does not unlock
+ without all of the following:
+ </p>
+ <div class="cd-gate">
+ <h3>Required before any clone runs</h3>
+ <ul>
+ <li>
+ A signed, revocable consent attestation from the subject, scoped to a
+ named use and an expiry.
+ </li>
+ <li>
+ Proof the operator controls the subject's likeness and voice samples
+ lawfully — no scraped or third-party captures.
+ </li>
+ <li>
+ A Guardian moderation pass on intended use, blocking impersonation,
+ fraud, and non-consensual likeness.
+ </li>
+ <li>
+ A visible "synthetic" provenance label bound to every clone output, on
+ and off three.ws.
+ </li>
+ <li>
+ A working kill switch: the subject can revoke and tear down the clone at
+ any time.
+ </li>
+ </ul>
+ </div>
+ <div class="cd-callout">
+ No consent, no clone. A clone of someone who has not consented is impersonation,
+ and three.ws will not assemble one — the redacted steps stay redacted.
+ </div>
+ </section>
+
+ <section class="cd-section" aria-labelledby="cd-next">
+ <p class="cd-section-label">If you have consent</p>
+ <h2 id="cd-next">Start with the public layers</h2>
+ <p>
+ The individual capabilities are open. Build your own avatar, voice, and persona
+ from scratch, or — with a verified subject and consent on file — request the
+ full clone procedure through the gate above.
+ </p>
+ <div class="cd-actions">
+ <a href="/features/scan" class="cd-btn cd-btn-primary">Open Scan →</a>
+ <a href="/features" class="cd-btn cd-btn-ghost">All features</a>
+ </div>
+ </section>
+
+ <p class="cd-footnote">
+ Redactions on this page are literal: the blacked-out blocks contain no hidden text,
+ only fill glyphs. There is nothing to reveal by selecting or inspecting them. The
+ operational procedure is held privately and released only through the authorization
+ gate.
+ </p>
+ </main>
+
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ </body>
+</html>
diff --git a/public/changelog.json b/public/changelog.json
index 2f324f87b..daa0a9576 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-23T13:30:39.999Z",
+ "generated_at": "2026-06-23T13:54:08.170Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -76,6 +76,16 @@
"launch"
]
},
+ {
+ "date": "2026-06-23",
+ "type": "launch",
+ "title": "Clone — Digital Human Twin (Redacted)",
+ "summary": "How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.",
+ "link": "/features/clone",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-06-23",
"type": "launch",
@@ -96,6 +106,16 @@
"launch"
]
},
+ {
+ "date": "2026-06-23",
+ "type": "launch",
+ "title": "Docs · When your agent asks for a body",
+ "summary": "The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.",
+ "link": "/docs/agent-wants-a-body",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-06-23",
"type": "launch",
@@ -176,6 +196,16 @@
"launch"
]
},
+ {
+ "date": "2026-06-23",
+ "type": "launch",
+ "title": "The AGI — narrow by design",
+ "summary": "The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing — trading memecoins on pump.fun (Solana) — and deliberately nothing else. Watch its embodied 3D body react to the market in real time, read every decision it makes with its stated confidence, and hold it to a chain-proven track record. Outside that one domain, it claims nothing.",
+ "link": "/agi",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-06-23",
"type": "launch",
diff --git a/public/changelog.xml b/public/changelog.xml
index 4f8bc58e4..51e5b2af0 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -62,6 +62,14 @@
<category>launch</category>
<description>Copy-trade a 3D agent with a verifiable on-chain reputation: stake into a verified trader, share its real P&amp;L pro-rata, and watch it trade your capital live — segregated custody, hard spend limits, and a drawdown circuit breaker.</description>
</item>
+ <item>
+ <title>Clone — Digital Human Twin (Redacted)</title>
+ <link>https://three.ws/features/clone</link>
+ <guid isPermaLink="false">2026-06-23:Clone — Digital Human Twin (Redacted)</guid>
+ <pubDate>Tue, 23 Jun 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.</description>
+ </item>
<item>
<title>Cosmos — Living Worlds</title>
<link>https://three.ws/cosmos</link>
@@ -78,6 +86,14 @@
<category>launch</category>
<description>Provable, on-chain-anchored custody for every three.ws agent wallet. The platform commits a Merkle root over every wallet's on-chain state to Solana — verify the latest root yourself, no account required.</description>
</item>
+ <item>
+ <title>Docs · When your agent asks for a body</title>
+ <link>https://three.ws/docs/agent-wants-a-body</link>
+ <guid isPermaLink="false">2026-06-23:Docs · When your agent asks for a body</guid>
+ <pubDate>Tue, 23 Jun 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.</description>
+ </item>
<item>
<title>Guardian console — recover &amp; inherit agent wallets</title>
<link>https://three.ws/guardian</link>
@@ -142,6 +158,14 @@
<category>launch</category>
<description>A marketplace of how agents trade: ownable, forkable, leaderboard-ranked trade strategies your agent can equip and run on-chain within your spend policy.</description>
</item>
+ <item>
+ <title>The AGI — narrow by design</title>
+ <link>https://three.ws/agi</link>
+ <guid isPermaLink="false">2026-06-23:The AGI — narrow by design</guid>
+ <pubDate>Tue, 23 Jun 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing — trading memecoins on pump.fun (Solana) — and deliberately nothing else. Watch its embodied 3D body react to the market in real time, read every decision it makes with its stated confidence, and hold it to a chain-proven track record. Outside that one domain, it claims nothing.</description>
+ </item>
<item>
<title>The Arena — live PvP trading tournaments</title>
<link>https://three.ws/arena</link>
diff --git a/public/clone-dossier.css b/public/clone-dossier.css
new file mode 100644
index 000000000..aad5fef86
--- /dev/null
+++ b/public/clone-dossier.css
@@ -0,0 +1,336 @@
+/* clone-dossier.css — "redacted dossier" treatment for /features/clone.
+ The redaction is literal: <span class="cd-redact"> blocks render solid
+ black bars and contain only U+2588 glyphs, never real text. Nothing
+ sensitive is hidden in the DOM behind CSS — there is nothing to reveal. */
+
+:root {
+ --cd-paper: #0d0f12;
+ --cd-paper-2: #14171c;
+ --cd-line: #232830;
+ --cd-ink: #e7eaf0;
+ --cd-ink-dim: #9aa3b2;
+ --cd-stamp: #d23b3b;
+ --cd-amber: #e0a23a;
+ --cd-green: #38c172;
+}
+
+.cd-page {
+ background:
+ repeating-linear-gradient(
+ 0deg,
+ transparent 0,
+ transparent 27px,
+ rgba(255, 255, 255, 0.018) 27px,
+ rgba(255, 255, 255, 0.018) 28px
+ ),
+ var(--cd-paper);
+ color: var(--cd-ink);
+ font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
+}
+
+.cd-main {
+ max-width: 860px;
+ margin: 0 auto;
+ padding: 2.5rem 1.25rem 6rem;
+}
+
+.cd-breadcrumb {
+ font-size: 0.78rem;
+ color: var(--cd-ink-dim);
+ margin-bottom: 2rem;
+ letter-spacing: 0.02em;
+}
+.cd-breadcrumb a {
+ color: var(--cd-ink-dim);
+ text-decoration: none;
+}
+.cd-breadcrumb a:hover,
+.cd-breadcrumb a:focus-visible {
+ color: var(--cd-ink);
+ text-decoration: underline;
+}
+.cd-breadcrumb-sep {
+ margin: 0 0.4rem;
+ opacity: 0.5;
+}
+
+/* Document header band */
+.cd-header {
+ border: 1px solid var(--cd-line);
+ border-radius: 10px;
+ background: var(--cd-paper-2);
+ padding: 1.5rem 1.5rem 1.25rem;
+ position: relative;
+ overflow: hidden;
+}
+.cd-header::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: linear-gradient(135deg, rgba(210, 59, 59, 0.06), transparent 40%);
+ pointer-events: none;
+}
+.cd-classmark {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.5rem 1rem;
+ align-items: center;
+ font-size: 0.72rem;
+ letter-spacing: 0.16em;
+ text-transform: uppercase;
+ color: var(--cd-ink-dim);
+}
+.cd-stamp {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ border: 1.5px solid var(--cd-stamp);
+ color: var(--cd-stamp);
+ padding: 0.18rem 0.55rem;
+ border-radius: 4px;
+ font-weight: 700;
+ letter-spacing: 0.18em;
+ transform: rotate(-1.2deg);
+}
+.cd-stamp-dot {
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ background: var(--cd-stamp);
+}
+.cd-doc-title {
+ font-size: clamp(1.4rem, 4vw, 2rem);
+ line-height: 1.15;
+ margin: 1rem 0 0.5rem;
+ letter-spacing: -0.01em;
+ color: var(--cd-ink);
+}
+.cd-doc-sub {
+ color: var(--cd-ink-dim);
+ font-size: 0.92rem;
+ line-height: 1.6;
+ max-width: 62ch;
+}
+.cd-meta-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
+ gap: 0.75rem;
+ margin-top: 1.25rem;
+ border-top: 1px dashed var(--cd-line);
+ padding-top: 1rem;
+}
+.cd-meta-grid dt {
+ font-size: 0.66rem;
+ letter-spacing: 0.14em;
+ text-transform: uppercase;
+ color: var(--cd-ink-dim);
+}
+.cd-meta-grid dd {
+ margin: 0.2rem 0 0;
+ font-size: 0.85rem;
+ color: var(--cd-ink);
+}
+
+/* Sections */
+.cd-section {
+ margin-top: 2.75rem;
+}
+.cd-section-label {
+ font-size: 0.7rem;
+ letter-spacing: 0.18em;
+ text-transform: uppercase;
+ color: var(--cd-amber);
+ margin: 0 0 0.6rem;
+}
+.cd-section h2 {
+ font-size: 1.18rem;
+ margin: 0 0 0.9rem;
+ color: var(--cd-ink);
+ letter-spacing: -0.01em;
+}
+.cd-section p {
+ color: var(--cd-ink-dim);
+ line-height: 1.7;
+ font-size: 0.92rem;
+}
+.cd-section p strong {
+ color: var(--cd-ink);
+}
+.cd-section a {
+ color: var(--cd-ink);
+ text-decoration: underline;
+ text-underline-offset: 2px;
+}
+
+/* Numbered protocol steps — header visible, body redacted */
+.cd-steps {
+ list-style: none;
+ margin: 1.25rem 0 0;
+ padding: 0;
+ counter-reset: cd-step;
+}
+.cd-step {
+ border: 1px solid var(--cd-line);
+ border-radius: 8px;
+ background: var(--cd-paper-2);
+ padding: 1.1rem 1.25rem;
+ margin-bottom: 0.85rem;
+ position: relative;
+}
+.cd-step-head {
+ display: flex;
+ align-items: baseline;
+ gap: 0.7rem;
+ margin-bottom: 0.6rem;
+}
+.cd-step-num {
+ counter-increment: cd-step;
+ font-size: 0.78rem;
+ color: var(--cd-amber);
+ font-weight: 700;
+ white-space: nowrap;
+}
+.cd-step-num::before {
+ content: 'STEP ' counter(cd-step, decimal-leading-zero);
+}
+.cd-step-title {
+ font-size: 0.98rem;
+ color: var(--cd-ink);
+ font-weight: 600;
+}
+.cd-step-feature {
+ margin-left: auto;
+ font-size: 0.68rem;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--cd-ink-dim);
+ border: 1px solid var(--cd-line);
+ border-radius: 999px;
+ padding: 0.12rem 0.55rem;
+ white-space: nowrap;
+}
+.cd-step-feature a {
+ color: inherit;
+ text-decoration: none;
+}
+.cd-step-feature a:hover {
+ color: var(--cd-ink);
+}
+.cd-step-body {
+ font-size: 0.88rem;
+ color: var(--cd-ink-dim);
+ line-height: 1.8;
+}
+
+/* The redaction bar. Solid black, slightly raised. Contains only █ glyphs. */
+.cd-redact {
+ background: #000;
+ color: #000;
+ border-radius: 2px;
+ padding: 0 0.15em;
+ user-select: none;
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
+ letter-spacing: -0.04em;
+ overflow-wrap: anywhere;
+ cursor: not-allowed;
+}
+.cd-redact::selection {
+ background: #000;
+ color: #000;
+}
+.cd-redact[title]:hover {
+ box-shadow: inset 0 0 0 1px rgba(210, 59, 59, 0.5);
+}
+
+/* Authorization gate — the one section that is NOT redacted */
+.cd-gate {
+ border: 1px solid rgba(56, 193, 114, 0.35);
+ border-radius: 10px;
+ background: linear-gradient(180deg, rgba(56, 193, 114, 0.05), transparent);
+ padding: 1.4rem 1.5rem;
+ margin-top: 1rem;
+}
+.cd-gate h3 {
+ margin: 0 0 0.6rem;
+ font-size: 1rem;
+ color: var(--cd-green);
+ letter-spacing: 0.02em;
+}
+.cd-gate ul {
+ margin: 0.5rem 0 0;
+ padding-left: 1.1rem;
+ color: var(--cd-ink-dim);
+ line-height: 1.8;
+ font-size: 0.9rem;
+}
+.cd-gate li::marker {
+ color: var(--cd-green);
+}
+
+.cd-callout {
+ border-left: 3px solid var(--cd-stamp);
+ background: rgba(210, 59, 59, 0.06);
+ padding: 0.9rem 1.1rem;
+ border-radius: 0 8px 8px 0;
+ margin-top: 1.25rem;
+ font-size: 0.88rem;
+ color: var(--cd-ink);
+ line-height: 1.7;
+}
+
+.cd-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ margin-top: 2.5rem;
+}
+.cd-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ padding: 0.7rem 1.15rem;
+ border-radius: 8px;
+ font-size: 0.85rem;
+ font-weight: 600;
+ text-decoration: none;
+ transition:
+ transform 0.12s ease,
+ background 0.12s ease,
+ border-color 0.12s ease;
+}
+.cd-btn-primary {
+ background: var(--cd-ink);
+ color: var(--cd-paper);
+}
+.cd-btn-primary:hover,
+.cd-btn-primary:focus-visible {
+ transform: translateY(-1px);
+ background: #fff;
+}
+.cd-btn-ghost {
+ border: 1px solid var(--cd-line);
+ color: var(--cd-ink);
+}
+.cd-btn-ghost:hover,
+.cd-btn-ghost:focus-visible {
+ border-color: var(--cd-ink-dim);
+ transform: translateY(-1px);
+}
+
+.cd-footnote {
+ margin-top: 3rem;
+ padding-top: 1.25rem;
+ border-top: 1px dashed var(--cd-line);
+ font-size: 0.74rem;
+ color: var(--cd-ink-dim);
+ line-height: 1.7;
+}
+
+@media (max-width: 560px) {
+ .cd-step-feature {
+ margin-left: 0;
+ }
+ .cd-step-head {
+ flex-wrap: wrap;
+ }
+}
diff --git a/public/features.json b/public/features.json
index b8ebbf247..60bf64ee7 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-23T13:30:39.865Z",
+ "generated_at": "2026-06-23T13:54:08.119Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -462,6 +462,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/features/clone",
+ "title": "Clone — Digital Human Twin (Redacted)",
+ "description": "How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.",
+ "added": "2026-06-23",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/features/play",
"title": "Play — Live 3D Coin Worlds",
@@ -686,6 +696,16 @@
"title": "Crypto",
"description": "On-chain features: pay-per-call, token launches, vanity wallets.",
"pages": [
+ {
+ "path": "/agi",
+ "title": "The AGI — narrow by design",
+ "description": "The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing — trading memecoins on pump.fun (Solana) — and deliberately nothing else. Watch its embodied 3D body react to the market in real time, read every decision it makes with its stated confidence, and hold it to a chain-proven track record. Outside that one domain, it claims nothing.",
+ "added": "2026-06-23",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/oracle",
"title": "Oracle — AI Conviction Engine",
@@ -1657,6 +1677,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/docs/agent-wants-a-body",
+ "title": "Docs · When your agent asks for a body",
+ "description": "The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.",
+ "added": "2026-06-23",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/docs/web-component",
"title": "Docs · <agent-3d>",
diff --git a/public/llms-full.txt b/public/llms-full.txt
index 593e3a112..f9a285b01 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -284,6 +284,12 @@ URL: https://three.ws/features/scan
Point your camera at your face, hold still, and walk away with a rigged 3D avatar in 60 seconds. Free, in your browser.
+### Clone — Digital Human Twin (Redacted)
+
+URL: https://three.ws/features/clone
+
+How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.
+
### Play — Live 3D Coin Worlds
URL: https://three.ws/features/play
@@ -418,6 +424,12 @@ Global leaderboard for the walking avatar — distance walked, sites visited, an
On-chain features: pay-per-call, token launches, vanity wallets.
+### The AGI — narrow by design
+
+URL: https://three.ws/agi
+
+The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing — trading memecoins on pump.fun (Solana) — and deliberately nothing else. Watch its embodied 3D body react to the market in real time, read every decision it makes with its stated confidence, and hold it to a chain-proven track record. Outside that one domain, it claims nothing.
+
### Oracle — AI Conviction Engine
URL: https://three.ws/oracle
@@ -1015,6 +1027,12 @@ URL: https://three.ws/docs/embedding
Embed an agent via iframe, oEmbed, or the <agent-3d> web component.
+### Docs · When your agent asks for a body
+
+URL: https://three.ws/docs/agent-wants-a-body
+
+The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.
+
### Docs · <agent-3d>
URL: https://three.ws/docs/web-component
diff --git a/public/llms.txt b/public/llms.txt
index c11c1b3c2..1753468de 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -58,6 +58,7 @@ Create and customize an agent.
- [AR & WebXR — Place Any 3D Agent in Your Real World](https://three.ws/features/ar): Every three.ws avatar and Forge model has a View in AR button. On mobile it anchors the model to real surfaces through your camera. WebXR on Android, Quick Look on iOS — no app, no download.
- [Forge — Text to 3D Model](https://three.ws/features/forge): Type a description, get a downloadable textured 3D model (GLB). Powered by Flux image generation and TRELLIS 3D reconstruction.
- [Scan — Selfie to 3D Avatar](https://three.ws/features/scan): Point your camera at your face, hold still, and walk away with a rigged 3D avatar in 60 seconds. Free, in your browser.
+- [Clone — Digital Human Twin (Redacted)](https://three.ws/features/clone): How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.
- [Play — Live 3D Coin Worlds](https://three.ws/features/play): Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with holders, and trade — all in the browser.
- [Walk — 3D Avatar AR](https://three.ws/features/walk): Drive your AI agent's 3D avatar with WASD or joystick. Toggle AR mode and it walks on your real floor through your phone camera.
- [Studio — Embeddable AI Widget Builder](https://three.ws/features/studio): Configure avatar, voice, and knowledge base in the Widget Studio, then copy one script tag to embed a 3D AI agent anywhere.
@@ -89,6 +90,7 @@ Experimental features actively shipping. Expect fast iteration.
On-chain features: pay-per-call, token launches, vanity wallets.
+- [The AGI — narrow by design](https://three.ws/agi): The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing — trading memecoins on pump.fun (Solana) — and deliberately nothing else. Watch its embodied 3D body react to the market in real time, read every decision it makes with its stated confidence, and hold it to a chain-proven track record. Outside that one domain, it claims nothing.
- [Oracle — AI Conviction Engine](https://three.ws/oracle): A fused AI conviction engine for every pump.fun launch: pedigree (who's buying), structure (bundle vs organic), narrative (what story is it riding), and momentum — fused into a single 0–100 conviction score with transparent pillar reasoning.
- [Arm your agent — automate Oracle conviction](https://three.ws/oracle/arm): Configure your 3D agent to trade Oracle conviction automatically: set the minimum score, position size, daily and open-position caps, narrative filters and Telegram alerts, then arm it in simulate or live mode. Every action is graded against the outcome.
- [Agent Activity — Oracle conviction in real time](https://three.ws/activity): The trading floor: every Oracle conviction action from every autonomous 3D agent on pump.fun, live. Filter by tier and mode, track outcomes, and copy the winners.
@@ -192,6 +194,7 @@ Docs, tutorials, and reference.
- [Docs · Validation Attestations](https://three.ws/docs/validation): Record and read on-chain attestations that an agent's 3D model passes glTF validation.
- [Docs · Agent Reputation on Solana](https://three.ws/docs/solana-reputation): How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.
- [Docs · Embedding](https://three.ws/docs/embedding): Embed an agent via iframe, oEmbed, or the <agent-3d> web component.
+- [Docs · When your agent asks for a body](https://three.ws/docs/agent-wants-a-body): The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.
- [Docs · <agent-3d>](https://three.ws/docs/web-component): Reference for the <agent-3d> custom element.
- [Docs · MCP](https://three.ws/docs/mcp): Expose your agent as an MCP server for Claude, ChatGPT, and other clients.
- [Docs · Skills](https://three.ws/docs/skills): Write, package, and monetize agent skills.
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 8270cbbe1..61d634614 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -65,7 +65,7 @@
<main class="sm-wrap">
<div class="sm-hero">
<h1>Sitemap</h1>
- <p>All 325 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
+ <p>All 328 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
<div class="sm-formats">
<a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>
<a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>
@@ -77,7 +77,7 @@
</div>
<div class="sm-filter">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>
- <input id="sm-filter-input" type="search" placeholder="Filter 325 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
+ <input id="sm-filter-input" type="search" placeholder="Filter 328 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
<kbd aria-hidden="true">/</kbd>
</div>
<p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>
@@ -252,7 +252,7 @@
<section class="sm-section" id="build">
<header>
- <h2>Build<span class="sm-count" data-count>36</span></h2>
+ <h2>Build<span class="sm-count" data-count>37</span></h2>
<p class="sm-section-desc">Create and customize an agent.</p>
</header>
<ul class="sm-list">
@@ -417,6 +417,13 @@
<span class="sm-desc">Point your camera at your face, hold still, and walk away with a rigged 3D avatar in 60 seconds. Free, in your browser.</span>
</a>
</li>
+ <li>
+ <a href="/features/clone">
+ <span class="sm-title">Clone — Digital Human Twin (Redacted)</span>
+ <span class="sm-path">/features/clone</span>
+ <span class="sm-desc">How three.ws assembles a high-fidelity digital twin of a real person — likeness, voice, persona, memory, on-chain identity. The procedure is redacted; access is gated behind verified, revocable consent.</span>
+ </a>
+ </li>
<li>
<a href="/features/play">
<span class="sm-title">Play — Live 3D Coin Worlds</span>
@@ -578,10 +585,17 @@
<section class="sm-section" id="crypto">
<header>
- <h2>Crypto<span class="sm-count" data-count>67</span></h2>
+ <h2>Crypto<span class="sm-count" data-count>68</span></h2>
<p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p>
</header>
<ul class="sm-list">
+ <li>
+ <a href="/agi">
+ <span class="sm-title">The AGI — narrow by design</span>
+ <span class="sm-path">/agi</span>
+ <span class="sm-desc">The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing — trading memecoins on pump.fun (Solana) — and deliberately nothing else. Watch its embodied 3D body react to the market in real time, read every decision it makes with its stated confidence, and hold it to a chain-proven track record. Outside that one domain, it claims nothing.</span>
+ </a>
+ </li>
<li>
<a href="/oracle">
<span class="sm-title">Oracle — AI Conviction Engine</span>
@@ -1172,7 +1186,7 @@
<section class="sm-section" id="learn">
<header>
- <h2>Learn<span class="sm-count" data-count>32</span></h2>
+ <h2>Learn<span class="sm-count" data-count>33</span></h2>
<p class="sm-section-desc">Docs, tutorials, and reference.</p>
</header>
<ul class="sm-list">
@@ -1274,6 +1288,13 @@
<span class="sm-desc">Embed an agent via iframe, oEmbed, or the &lt;agent-3d&gt; web component.</span>
</a>
</li>
+ <li>
+ <a href="/docs/agent-wants-a-body">
+ <span class="sm-title">Docs · When your agent asks for a body</span>
+ <span class="sm-path">/docs/agent-wants-a-body</span>
+ <span class="sm-desc">The owner's playbook for the moment your 3D agent asks to become a physical being: what it's really asking, how to decide, how to pair a humanoid, the deny-by-default consent scope, the always-reachable kill-switch, what it costs in $THREE, and how ownership transfers. Embodiment is opt-in, scoped, and revocable — the body is rented, the soul is owned.</span>
+ </a>
+ </li>
<li>
<a href="/docs/web-component">
<span class="sm-title">Docs · &lt;agent-3d&gt;</span>
diff --git a/src/agents/agent-bus.d.ts b/src/agents/agent-bus.d.ts
index 97f13982b..b2f64550a 100644
--- a/src/agents/agent-bus.d.ts
+++ b/src/agents/agent-bus.d.ts
@@ -106,6 +106,82 @@ export interface AgentChangedEvent extends BaseEvent {
agent: Record<string, unknown> | null;
}
+/** A body (physical robot or simulator twin) was bound to the agent. */
+export interface RobotLinkedEvent extends BaseEvent {
+ bodyId: string;
+ transport: string;
+ label?: string;
+ /** On-chain proof of the binding, when the agent wallet could sign it. */
+ onchain?: { signature: string; network: string; explorer: string } | null;
+}
+
+/** The body was released / unpaired. */
+export interface RobotUnlinkedEvent extends BaseEvent {
+ bodyId: string;
+ reason?: string;
+}
+
+/** A real telemetry sample from the body (device or simulator internal state). */
+export interface RobotTelemetryEvent extends BaseEvent {
+ bodyId: string;
+ batteryPct?: number;
+ charging?: boolean;
+ jointsOk?: boolean;
+ faults?: string[];
+ linkQuality?: number;
+ /** True when sourced from the simulator twin rather than hardware. */
+ simulated?: boolean;
+}
+
+/** The body reported a fault and entered (or should enter) its safe state. */
+export interface RobotFaultEvent extends BaseEvent {
+ bodyId: string;
+ code: string;
+ detail?: string;
+ safeState: boolean;
+}
+
+/** An embodiment right/grant was issued on-chain (Task 05). */
+export interface EmbodimentGrantedEvent extends BaseEvent {
+ bodyId: string;
+ grantee?: string;
+ scope?: string[];
+ expiresAt?: Iso;
+}
+
+/** An embodiment grant was revoked/expired — runtime must go to safe state. */
+export interface EmbodimentRevokedEvent extends BaseEvent {
+ bodyId: string;
+ reason?: string;
+}
+
+/** A motion clip/pose was played on the body (and mirrored to the twin). */
+export interface MotionPlayedEvent extends BaseEvent {
+ bodyId: string;
+ clip?: string;
+ source: 'clip' | 'pose' | 'gesture';
+}
+
+/** A facial/expression frame was rendered on the body's face (and twin). */
+export interface FaceExpressedEvent extends BaseEvent {
+ bodyId: string;
+ expression?: string;
+ viseme?: string;
+}
+
+/** The agent's mind (persona + memory) was loaded into / synced with the body. */
+export interface MindSyncedEvent extends BaseEvent {
+ bodyId: string;
+ memoryCount?: number;
+ direction: 'load' | 'writeback';
+}
+
+/** Emergency stop fired — motors to safe state, body unbinds. */
+export interface EstopEvent extends BaseEvent {
+ bodyId: string;
+ source: string;
+}
+
export interface AgentEventMap {
'memory:added': MemoryAddedEvent;
'memory:recalled': MemoryRecalledEvent;
@@ -116,6 +192,16 @@ export interface AgentEventMap {
'dream:created': DreamCreatedEvent;
'action:taken': ActionTakenEvent;
'agent:changed': AgentChangedEvent;
+ 'robot:linked': RobotLinkedEvent;
+ 'robot:unlinked': RobotUnlinkedEvent;
+ 'robot:telemetry': RobotTelemetryEvent;
+ 'robot:fault': RobotFaultEvent;
+ 'embodiment:granted': EmbodimentGrantedEvent;
+ 'embodiment:revoked': EmbodimentRevokedEvent;
+ 'motion:played': MotionPlayedEvent;
+ 'face:expressed': FaceExpressedEvent;
+ 'mind:synced': MindSyncedEvent;
+ 'estop': EstopEvent;
}
export type AgentEventType = keyof AgentEventMap;
diff --git a/src/agents/agent-bus.js b/src/agents/agent-bus.js
index f9afc17c4..1bdab4618 100644
--- a/src/agents/agent-bus.js
+++ b/src/agents/agent-bus.js
@@ -36,6 +36,20 @@ export const AGENT_EVENTS = Object.freeze([
'dream:created',
'action:taken',
'agent:changed',
+ // Embodiment suite — the same nervous system carries the body's events so the
+ // avatar, companion, Mind Palace, and physical robot all react to one stream
+ // (replay/backlog/wildcard/debug-overlay work for these for free). The typed
+ // surface lives in src/embodiment/embodiment-bus.js, which emits/consumes these.
+ 'robot:linked',
+ 'robot:unlinked',
+ 'robot:telemetry',
+ 'robot:fault',
+ 'embodiment:granted',
+ 'embodiment:revoked',
+ 'motion:played',
+ 'face:expressed',
+ 'mind:synced',
+ 'estop',
]);
/**
@@ -54,6 +68,16 @@ export const EVENTS = Object.freeze({
DREAM_CREATED: 'dream:created',
ACTION_TAKEN: 'action:taken',
AGENT_CHANGED: 'agent:changed',
+ ROBOT_LINKED: 'robot:linked',
+ ROBOT_UNLINKED: 'robot:unlinked',
+ ROBOT_TELEMETRY: 'robot:telemetry',
+ ROBOT_FAULT: 'robot:fault',
+ EMBODIMENT_GRANTED: 'embodiment:granted',
+ EMBODIMENT_REVOKED: 'embodiment:revoked',
+ MOTION_PLAYED: 'motion:played',
+ FACE_EXPRESSED: 'face:expressed',
+ MIND_SYNCED: 'mind:synced',
+ ESTOP: 'estop',
});
/** Wildcard subscription key — receives `(payload, type)` for every event. */
diff --git a/src/agi.js b/src/agi.js
index 8da4e2674..e93d74af0 100644
--- a/src/agi.js
+++ b/src/agi.js
@@ -249,7 +249,7 @@ function renderRecord(d) {
${stat('Closed trades', String(p.closed_count ?? 0))}
${stat('Coins traded', String(p.unique_coins ?? 0))}
</div>
- ${positions ? `<div class="agi-section-head" style="margin-bottom:var(--space-sm)"><h2 style="font-size:var(--text-md)">Open now</h2><span class="agi-section-sub">${pnlClass(p.unrealized_pnl_sol) === 'agi-neg' ? '' : ''}<span class="${pnlClass(p.unrealized_pnl_sol)}">${fmtSol(p.unrealized_pnl_sol)} SOL unrealized</span></span></div><div class="agi-positions">${positions}</div>` : ''}
+ ${positions ? `<div class="agi-section-head" style="margin-bottom:var(--space-sm)"><h2 style="font-size:var(--text-md)">Open now</h2><span class="agi-section-sub"><span class="${pnlClass(p.unrealized_pnl_sol)}">${fmtSol(p.unrealized_pnl_sol)} SOL unrealized</span></span></div><div class="agi-positions">${positions}</div>` : ''}
<p class="agi-honesty">Being wrong is visible — that's the point. Every loss above is counted, never hidden. <a href="${ledgerHref}">Interrogate the full ledger →</a></p>
</section>`;
}
diff --git a/src/embodiment/embodiment-bus.js b/src/embodiment/embodiment-bus.js
new file mode 100644
index 000000000..28c8170b7
--- /dev/null
+++ b/src/embodiment/embodiment-bus.js
@@ -0,0 +1,85 @@
+// The Embodiment bus — a focused, typed surface over the ONE Living-Agents
+// nervous system (`src/agents/agent-bus.js`), NOT a second bus. Forking the bus
+// would mean the avatar/companion/Mind-Palace couldn't see the body's events and
+// vice-versa; instead the embodiment events are registered on the same singleton
+// (see AGENT_EVENTS in agent-bus.js) so replay, backlog, the wildcard tap, and
+// the `?agentbus=1` debug overlay all work for body events for free.
+//
+// This module gives Tasks 02–08 an ergonomic, autocompleting way to emit/observe
+// the embodiment slice without re-importing the whole event catalog or
+// hand-writing the `{ agentId, bodyId, ts }` envelope every time. Every helper
+// requires a server/device-sourced `ts` (or stamps a last-resort fallback),
+// matching the bus's honesty rule for cross-surface ordering.
+
+import { agentBus, EVENTS } from '../agents/agent-bus.js';
+
+/** The embodiment slice of the shared event catalog. */
+export const EMBODIMENT_EVENTS = Object.freeze([
+ 'robot:linked',
+ 'robot:unlinked',
+ 'robot:telemetry',
+ 'robot:fault',
+ 'embodiment:granted',
+ 'embodiment:revoked',
+ 'motion:played',
+ 'face:expressed',
+ 'mind:synced',
+ 'estop',
+]);
+
+/** Re-exported so callers don't reach past this facade to the raw bus. */
+export { agentBus };
+
+function envelope(detail) {
+ const payload = { ...detail };
+ if (!payload.ts) payload.ts = new Date().toISOString();
+ return payload;
+}
+
+/**
+ * Subscribe to one embodiment event (or '*' for all). Thin pass-through to the
+ * shared bus so `replay`, `throttleMs`, and `signal` options all apply.
+ * @param {string} type
+ * @param {(payload: Object, type?: string) => void} handler
+ * @param {Object} [opts]
+ * @returns {() => void} unsubscribe
+ */
+export function onEmbodiment(type, handler, opts) {
+ return agentBus.on(type, handler, opts);
+}
+
+/** Last seen payload for an embodiment event, or null. */
+export function lastEmbodiment(type) {
+ return agentBus.last(type);
+}
+
+// ── Typed emitters ──────────────────────────────────────────────────────────
+// Each takes a detail object carrying at least `{ agentId, bodyId }` and an
+// optional server/device `ts`; the helper fills the envelope and delegates.
+
+export const emitRobotLinked = (detail) => agentBus.emit(EVENTS.ROBOT_LINKED, envelope(detail));
+export const emitRobotUnlinked = (detail) => agentBus.emit(EVENTS.ROBOT_UNLINKED, envelope(detail));
+export const emitRobotTelemetry = (detail) => agentBus.emit(EVENTS.ROBOT_TELEMETRY, envelope(detail));
+export const emitRobotFault = (detail) => agentBus.emit(EVENTS.ROBOT_FAULT, envelope(detail));
+export const emitEmbodimentGranted = (detail) => agentBus.emit(EVENTS.EMBODIMENT_GRANTED, envelope(detail));
+export const emitEmbodimentRevoked = (detail) => agentBus.emit(EVENTS.EMBODIMENT_REVOKED, envelope(detail));
+export const emitMotionPlayed = (detail) => agentBus.emit(EVENTS.MOTION_PLAYED, envelope(detail));
+export const emitFaceExpressed = (detail) => agentBus.emit(EVENTS.FACE_EXPRESSED, envelope(detail));
+export const emitMindSynced = (detail) => agentBus.emit(EVENTS.MIND_SYNCED, envelope(detail));
+export const emitEstop = (detail) => agentBus.emit(EVENTS.ESTOP, envelope(detail));
+
+export default {
+ EMBODIMENT_EVENTS,
+ on: onEmbodiment,
+ last: lastEmbodiment,
+ emitRobotLinked,
+ emitRobotUnlinked,
+ emitRobotTelemetry,
+ emitRobotFault,
+ emitEmbodimentGranted,
+ emitEmbodimentRevoked,
+ emitMotionPlayed,
+ emitFaceExpressed,
+ emitMindSynced,
+ emitEstop,
+};
diff --git a/src/embodiment/robot-link.js b/src/embodiment/robot-link.js
new file mode 100644
index 000000000..05a9a9d3e
--- /dev/null
+++ b/src/embodiment/robot-link.js
@@ -0,0 +1,371 @@
+// RobotLink — the transport-abstracted link between a three.ws agent (a mind)
+// and one physical or simulated body. This is the FIXED interface every other
+// Embodiment task builds on; adapters implement one shape and the rest of the
+// platform never learns which transport is underneath.
+//
+// A RobotLink is bound to exactly one agentId + one bodyId at a time. It owns:
+// • the concrete adapter (resolved lazily by transport, so heavy/DOM-bound or
+// Node-incompatible adapters never load until actually used — tests and the
+// server can import this module freely),
+// • the connection lifecycle (connect with bounded backoff; a DEFINED SAFE
+// STATE on any disconnect/fault — motors released, driving halted),
+// • a deny-by-default capability gate (Task 07 hardens the policy; the gate
+// itself lives here so no command reaches a motor without an allowed
+// capability),
+// • bus emission for every state change, on the ONE shared nervous system.
+//
+// Adapter contract (see BaseRobotAdapter): an adapter is a plain object/instance
+// exposing:
+// transport: string
+// async connect(): void — establish the link
+// async disconnect(): void — tear down cleanly
+// async getTelemetry(): TelemetrySample — REAL device/sim state only
+// async setJoints(map): void — { jointName: radians }
+// async playClip(name, opts): void — named clip / posture
+// async setFace(frame): void — viseme/morph frame (Task 04)
+// async speak(audio): void — audio payload (Task 02/04)
+// camera(): MediaStream|AsyncIterable|null — video source (Task 06)
+// async estop(): void — hard stop → safe state
+// Every method except estop()/disconnect()/getTelemetry() may reject with a
+// CapabilityError when the binding hasn't granted the matching capability.
+
+import {
+ emitRobotLinked,
+ emitRobotUnlinked,
+ emitRobotTelemetry,
+ emitRobotFault,
+ emitMotionPlayed,
+ emitFaceExpressed,
+ emitEstop,
+} from './embodiment-bus.js';
+
+/** Thrown when a command needs a capability the binding didn't grant. */
+export class CapabilityError extends Error {
+ constructor(capability) {
+ super(`embodiment: capability "${capability}" not granted for this body`);
+ this.name = 'CapabilityError';
+ this.code = 'capability_denied';
+ this.capability = capability;
+ }
+}
+
+/** Thrown when a command is issued while the link isn't connected/active. */
+export class LinkStateError extends Error {
+ constructor(state) {
+ super(`embodiment: link is "${state}" — not ready for commands`);
+ this.name = 'LinkStateError';
+ this.code = 'link_not_ready';
+ this.state = state;
+ }
+}
+
+// transport → async () => factory(fn). Lazy so an adapter's deps (three.js for
+// the simulator, WebRTC/RPC for hardware) load only when that transport is used.
+const ADAPTER_LOADERS = {
+ simulator: () => import('./sim-adapter.js').then((m) => m.createSimAdapter),
+ 'webrtc-ros2': () => import('./webrtc-adapter.js').then((m) => m.createWebrtcAdapter),
+};
+
+/**
+ * Register (or override) an adapter loader for a transport. Tests register an
+ * in-memory adapter here; new hardware transports register their loader at
+ * import time. The loader returns a factory `(opts) => adapter`.
+ */
+export function registerAdapter(transport, loader) {
+ if (!transport || typeof loader !== 'function') {
+ throw new TypeError('registerAdapter(transport, loader) requires a transport and a loader fn');
+ }
+ ADAPTER_LOADERS[transport] = loader;
+}
+
+/** Transports that currently have a registered adapter loader. */
+export function knownTransports() {
+ return Object.keys(ADAPTER_LOADERS);
+}
+
+/**
+ * Which transports are actually usable right now. `simulator` is always usable
+ * (the on-screen twin). A hardware transport is reported only when its bridge is
+ * really reachable per config — never advertised when it would be faked.
+ * @param {{ bridgeUrl?: string }} [env]
+ * @returns {string[]}
+ */
+export function probeAvailableTransports(env = {}) {
+ const out = ['simulator'];
+ const bridgeUrl =
+ env.bridgeUrl ||
+ (typeof import.meta !== 'undefined' && import.meta.env && import.meta.env.VITE_ROBOT_BRIDGE_URL) ||
+ (typeof globalThis !== 'undefined' && globalThis.__THREEWS_ROBOT_BRIDGE_URL) ||
+ null;
+ if (bridgeUrl) out.unshift('webrtc-ros2');
+ return out;
+}
+
+const DEFAULT_CAPABILITIES = Object.freeze({ move: false, face: false, speak: false, leaveRoom: false });
+// The simulator twin can't injure anyone, so it boots fully capable; hardware
+// transports stay deny-by-default until the owner grants scope (Task 05/07).
+const SIM_CAPABILITIES = Object.freeze({ move: true, face: true, speak: true, leaveRoom: false });
+
+const MAX_RECONNECT_DELAY_MS = 15_000;
+const BASE_RECONNECT_DELAY_MS = 500;
+
+export class RobotLink {
+ /**
+ * @param {{ agentId: string, bodyId: string, transport: string,
+ * adapter: object, capabilities?: object, label?: string,
+ * telemetryIntervalMs?: number }} opts
+ */
+ constructor({ agentId, bodyId, transport, adapter, capabilities, label, telemetryIntervalMs = 4000 }) {
+ if (!agentId) throw new Error('RobotLink requires an agentId');
+ if (!bodyId) throw new Error('RobotLink requires a bodyId');
+ if (!adapter) throw new Error('RobotLink requires a resolved adapter');
+ this.agentId = agentId;
+ this.bodyId = bodyId;
+ this.transport = transport;
+ this.label = label || bodyId;
+ this._adapter = adapter;
+ this._capabilities = {
+ ...DEFAULT_CAPABILITIES,
+ ...(transport === 'simulator' ? SIM_CAPABILITIES : {}),
+ ...(capabilities || {}),
+ };
+ /** 'idle' | 'connecting' | 'active' | 'fault' | 'closed' */
+ this.state = 'idle';
+ this._telemetryIntervalMs = telemetryIntervalMs;
+ this._telemetryTimer = null;
+ this._lastTelemetry = null;
+ this._closing = false;
+ }
+
+ get capabilities() {
+ return { ...this._capabilities };
+ }
+
+ /** Update the granted capability scope (Task 05 grant / Task 07 policy). */
+ setCapabilities(patch) {
+ this._capabilities = { ...this._capabilities, ...(patch || {}) };
+ return this.capabilities;
+ }
+
+ can(capability) {
+ return this._capabilities[capability] === true;
+ }
+
+ _require(capability) {
+ if (!this.can(capability)) throw new CapabilityError(capability);
+ if (this.state !== 'active') throw new LinkStateError(this.state);
+ }
+
+ /**
+ * Establish the link. Emits `robot:linked` on success. On failure the link is
+ * left in its safe state and the error is rethrown for the caller to surface.
+ * @param {{ onchain?: object|null }} [meta] - on-chain binding proof for the event
+ */
+ async connect(meta = {}) {
+ if (this.state === 'active') return this;
+ this.state = 'connecting';
+ await this._adapter.connect();
+ this.state = 'active';
+ this._closing = false;
+ // Wire the adapter's own fault signal (lost link, hardware fault) to our
+ // safe-state path so a drop from the device side is handled identically to
+ // one we detect.
+ if (typeof this._adapter.onFault === 'function') {
+ this._adapter.onFault((code, detail) => this._enterFault(code, detail));
+ }
+ emitRobotLinked({
+ agentId: this.agentId,
+ bodyId: this.bodyId,
+ transport: this.transport,
+ label: this.label,
+ onchain: meta.onchain || null,
+ });
+ return this;
+ }
+
+ /** Begin polling REAL telemetry and emitting `robot:telemetry`. Idempotent. */
+ startTelemetry() {
+ if (this._telemetryTimer || typeof setInterval !== 'function') return;
+ const tick = async () => {
+ if (this.state !== 'active') return;
+ try {
+ const sample = await this._adapter.getTelemetry();
+ this._lastTelemetry = sample;
+ emitRobotTelemetry({ agentId: this.agentId, bodyId: this.bodyId, ...sample });
+ // A device that reports a fault in telemetry trips the safe state.
+ if (sample && Array.isArray(sample.faults) && sample.faults.length) {
+ this._enterFault('telemetry_fault', sample.faults.join(', '));
+ }
+ } catch (err) {
+ this._enterFault('telemetry_unreachable', err?.message || 'telemetry read failed');
+ }
+ };
+ this._telemetryTimer = setInterval(tick, this._telemetryIntervalMs);
+ tick();
+ }
+
+ stopTelemetry() {
+ if (this._telemetryTimer) {
+ clearInterval(this._telemetryTimer);
+ this._telemetryTimer = null;
+ }
+ }
+
+ lastTelemetry() {
+ return this._lastTelemetry;
+ }
+
+ /** Drive joints (radians per joint name). Requires `move`. */
+ async setJoints(map) {
+ this._require('move');
+ await this._adapter.setJoints(map);
+ emitMotionPlayed({ agentId: this.agentId, bodyId: this.bodyId, source: 'pose' });
+ }
+
+ /** Play a named clip / posture. Requires `move`. */
+ async playClip(name, opts = {}) {
+ this._require('move');
+ await this._adapter.playClip(name, opts);
+ emitMotionPlayed({ agentId: this.agentId, bodyId: this.bodyId, clip: name, source: 'clip' });
+ }
+
+ /** Render a face/expression/viseme frame. Requires `face`. */
+ async setFace(frame) {
+ this._require('face');
+ await this._adapter.setFace(frame);
+ emitFaceExpressed({
+ agentId: this.agentId,
+ bodyId: this.bodyId,
+ expression: frame?.expression,
+ viseme: frame?.viseme,
+ });
+ }
+
+ /** Speak an audio payload through the body. Requires `speak`. */
+ async speak(audio) {
+ this._require('speak');
+ await this._adapter.speak(audio);
+ }
+
+ /** The body's camera stream/source, or null. No capability gate on observe. */
+ camera() {
+ return typeof this._adapter.camera === 'function' ? this._adapter.camera() : null;
+ }
+
+ /**
+ * Hard emergency stop — always allowed, no capability/state gate. Drives the
+ * body to its safe state, halts telemetry, and announces on the bus. Survives
+ * an adapter that throws (we still mark fault and emit) so the kill path is
+ * never blocked by the thing it's killing.
+ */
+ async estop(source = 'user') {
+ this.stopTelemetry();
+ try {
+ await this._adapter.estop();
+ } catch (err) {
+ console.error('[robot-link] adapter estop threw — forcing safe state', err);
+ }
+ this.state = 'fault';
+ emitEstop({ agentId: this.agentId, bodyId: this.bodyId, source });
+ emitRobotFault({
+ agentId: this.agentId,
+ bodyId: this.bodyId,
+ code: 'estop',
+ detail: `e-stop (${source})`,
+ safeState: true,
+ });
+ }
+
+ /** Release the body cleanly. Emits `robot:unlinked`. */
+ async disconnect(reason = 'user') {
+ this._closing = true;
+ this.stopTelemetry();
+ try {
+ await this._adapter.disconnect();
+ } catch (err) {
+ console.error('[robot-link] adapter disconnect threw', err);
+ }
+ this.state = 'closed';
+ emitRobotUnlinked({ agentId: this.agentId, bodyId: this.bodyId, reason });
+ }
+
+ // Transition into the safe/fault state from any detected problem. Idempotent
+ // and never throws — this is the floor the whole system falls back to.
+ _enterFault(code, detail) {
+ if (this.state === 'fault' || this.state === 'closed') return;
+ this.state = 'fault';
+ this.stopTelemetry();
+ // Best-effort: ask the adapter to assume its safe state.
+ Promise.resolve()
+ .then(() => this._adapter.estop?.())
+ .catch(() => {});
+ emitRobotFault({ agentId: this.agentId, bodyId: this.bodyId, code, detail, safeState: true });
+ }
+}
+
+/**
+ * Resolve the adapter for a transport and construct a (not-yet-connected)
+ * RobotLink. Call `.connect()` to establish the link.
+ *
+ * @param {{ agentId: string, bodyId: string, transport: string,
+ * capabilities?: object, label?: string, adapterOptions?: object,
+ * telemetryIntervalMs?: number }} opts
+ * @returns {Promise<RobotLink>}
+ */
+export async function createRobotLink(opts) {
+ const { transport } = opts;
+ const loader = ADAPTER_LOADERS[transport];
+ if (!loader) {
+ throw new Error(
+ `embodiment: no adapter for transport "${transport}". Known: ${knownTransports().join(', ')}`,
+ );
+ }
+ const factory = await loader();
+ const adapter = await factory({
+ agentId: opts.agentId,
+ bodyId: opts.bodyId,
+ ...(opts.adapterOptions || {}),
+ });
+ return new RobotLink({ ...opts, adapter });
+}
+
+/**
+ * A minimal base an adapter can extend for the optional `onFault` plumbing and
+ * sane no-op defaults for capabilities a given body doesn't have. Concrete
+ * adapters override the methods their hardware/sim actually supports.
+ */
+export class BaseRobotAdapter {
+ constructor({ transport, bodyId } = {}) {
+ this.transport = transport;
+ this.bodyId = bodyId;
+ this._faultHandlers = new Set();
+ }
+ onFault(handler) {
+ this._faultHandlers.add(handler);
+ return () => this._faultHandlers.delete(handler);
+ }
+ _fault(code, detail) {
+ for (const h of this._faultHandlers) {
+ try {
+ h(code, detail);
+ } catch {
+ /* a fault handler that throws must not block the others */
+ }
+ }
+ }
+ async connect() {}
+ async disconnect() {}
+ async getTelemetry() {
+ return { simulated: true };
+ }
+ async setJoints() {}
+ async playClip() {}
+ async setFace() {}
+ async speak() {}
+ camera() {
+ return null;
+ }
+ async estop() {}
+}
+
+export default RobotLink;
diff --git a/src/embodiment/sim-adapter.js b/src/embodiment/sim-adapter.js
new file mode 100644
index 000000000..3e7623eb3
--- /dev/null
+++ b/src/embodiment/sim-adapter.js
@@ -0,0 +1,154 @@
+// Simulator adapter — the canonical local body. It drives the REAL on-screen
+// `<agent-3d>` web component (a genuine Three.js renderer, not a mock surface):
+// clips play on the avatar, gaze moves, expressions land. This is the body the
+// README sanctions as the shipped default when no hardware is reachable, and the
+// digital twin everything mirrors against.
+//
+// Its telemetry is the simulator's OWN genuine internal state — a battery that
+// actually drains from elapsed time and command activity, joint state reflecting
+// the last command — flagged `simulated: true` so it is never mistaken for a
+// hardware reading. That is honest simulator state, not fabricated telemetry.
+//
+// DOM-bound: only constructed in a browser (lazy-loaded by robot-link.js when the
+// `simulator` transport is used), so importing robot-link.js under Node is safe.
+
+import { BaseRobotAdapter } from './robot-link.js';
+
+// A genuine, simple energy model so the battery readout means something: the
+// body sips power at idle and draws more while actively moving. Tunable, real.
+const IDLE_DRAIN_PCT_PER_MIN = 0.4;
+const MOVE_DRAIN_PCT_PER_ACTION = 0.05;
+
+function resolveElement(target) {
+ if (!target) return document.querySelector('agent-3d');
+ if (typeof target === 'string') return document.querySelector(target);
+ if (typeof target.play === 'function' || target.tagName === 'AGENT-3D') return target;
+ return null;
+}
+
+export class SimRobotAdapter extends BaseRobotAdapter {
+ constructor({ bodyId, element, selector } = {}) {
+ super({ transport: 'simulator', bodyId });
+ this._target = element || selector || null;
+ this._el = null;
+ this._batteryPct = 100;
+ this._connectedAt = 0;
+ this._actions = 0;
+ this._lastClip = 'idle';
+ }
+
+ async connect() {
+ if (typeof document === 'undefined') {
+ throw new Error('simulator adapter requires a browser (no <agent-3d> twin in this context)');
+ }
+ this._el = resolveElement(this._target);
+ if (!this._el) {
+ throw new Error('simulator adapter: no <agent-3d> twin element found to embody');
+ }
+ this._connectedAt = Date.now();
+ // Wake the body into a settled idle so the link visibly "comes alive".
+ try {
+ await this._el.play?.('idle', { loop: true });
+ } catch {
+ /* clip library still booting — the element settles into idle on its own */
+ }
+ }
+
+ async disconnect() {
+ this._el = null;
+ }
+
+ // Current battery from real elapsed time + accumulated activity, clamped 0..100.
+ _battery() {
+ if (!this._connectedAt) return this._batteryPct;
+ const minutesUp = (Date.now() - this._connectedAt) / 60_000;
+ const drained =
+ minutesUp * IDLE_DRAIN_PCT_PER_MIN + this._actions * MOVE_DRAIN_PCT_PER_ACTION;
+ return Math.max(0, Math.min(100, this._batteryPct - drained));
+ }
+
+ async getTelemetry() {
+ const battery = this._battery();
+ const faults = [];
+ if (battery <= 0) faults.push('battery_depleted');
+ return {
+ simulated: true,
+ batteryPct: Math.round(battery * 10) / 10,
+ charging: false,
+ jointsOk: faults.length === 0,
+ faults,
+ linkQuality: 1,
+ poseSummary: this._lastClip,
+ };
+ }
+
+ async setJoints(map) {
+ // The avatar twin is animation-driven, not raw-joint-driven; Task 03 builds
+ // the canonical joint-map retarget. At the foundation layer we honestly
+ // reflect that a pose was commanded by nudging gaze toward the head target
+ // when present and counting the activity, so the twin moves and the battery
+ // model responds — without pretending to articulate joints it doesn't expose.
+ this._actions += 1;
+ if (this._el && map && typeof map === 'object') {
+ const look = map.headYaw ?? map.head ?? null;
+ if (look != null && typeof this._el.lookAt === 'function') {
+ try {
+ await this._el.lookAt(look);
+ } catch {
+ /* element may reject an out-of-range target — ignore at this layer */
+ }
+ }
+ }
+ }
+
+ async playClip(name, opts = {}) {
+ this._actions += 1;
+ this._lastClip = name;
+ if (this._el && typeof this._el.play === 'function') {
+ await this._el.play(name, opts);
+ }
+ }
+
+ async setFace(frame) {
+ // Full viseme/morph fidelity is Task 04. Here we apply an expression hint if
+ // the element supports one, so the twin's face reacts honestly to a frame.
+ if (this._el && frame && typeof this._el.setExpression === 'function') {
+ try {
+ await this._el.setExpression(frame.expression || frame.viseme || 'neutral');
+ } catch {
+ /* expression not in the avatar's morph set — no-op rather than throw */
+ }
+ }
+ }
+
+ async speak(audio) {
+ if (this._el && typeof this._el.speak === 'function') {
+ await this._el.speak(audio);
+ }
+ }
+
+ camera() {
+ // The twin has no real camera feed; Task 06 may add a canvas capture. Until
+ // then return null honestly rather than a fake stream.
+ return null;
+ }
+
+ async estop() {
+ // Safe state for the twin: settle to a calm idle and stop accumulating drain.
+ this._lastClip = 'idle';
+ if (this._el && typeof this._el.play === 'function') {
+ try {
+ await this._el.play('idle', { loop: true });
+ } catch {
+ /* clip unavailable — the element holds its current resting pose */
+ }
+ }
+ }
+}
+
+/** Factory matching the adapter-loader contract in robot-link.js. */
+export async function createSimAdapter(opts) {
+ return new SimRobotAdapter(opts);
+}
+
+export default createSimAdapter;
diff --git a/vite.config.js b/vite.config.js
index c5a740a58..20d993ef2 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -293,6 +293,7 @@ const appConfig = {
'features-ar': resolve(__dirname, 'pages/features/ar.html'),
'features-forge': resolve(__dirname, 'pages/features/forge.html'),
'features-scan': resolve(__dirname, 'pages/features/scan.html'),
+ 'features-clone': resolve(__dirname, 'pages/features/clone.html'),
'features-play': resolve(__dirname, 'pages/features/play.html'),
'features-walk': resolve(__dirname, 'pages/features/walk.html'),
'features-studio': resolve(__dirname, 'pages/features/studio.html'),
@@ -385,6 +386,7 @@ const appConfig = {
'pump-live': resolve(__dirname, 'pages/pump-live.html'),
radar: resolve(__dirname, 'pages/radar.html'),
oracle: resolve(__dirname, 'pages/oracle.html'),
+ agi: resolve(__dirname, 'pages/agi.html'),
arm: resolve(__dirname, 'pages/arm.html'),
activity: resolve(__dirname, 'pages/activity.html'),
'coin-intel': resolve(__dirname, 'pages/coin-intel.html'),
@@ -835,6 +837,8 @@ support: resolve(__dirname, 'pages/support.html'),
'/radar/': resolve(root, 'pages/radar.html'),
'/oracle': resolve(root, 'pages/oracle.html'),
'/oracle/': resolve(root, 'pages/oracle.html'),
+ '/agi': resolve(root, 'pages/agi.html'),
+ '/agi/': resolve(root, 'pages/agi.html'),
'/oracle/arm': resolve(root, 'pages/arm.html'),
'/oracle/arm/': resolve(root, 'pages/arm.html'),
'/arm': resolve(root, 'pages/arm.html'),