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.

style: replace the banned dashes across this batch with plain punctuation

nirholas6a1860062139
diff --git a/.env.example b/.env.example
index 1d094dd95..e3698ade7 100644
--- a/.env.example
+++ b/.env.example
@@ -456,7 +456,7 @@ X402_SKILL_ROYALTY_PLATFORM_BPS=250
# The in-app runtime royalty lane settles through EIP-7710 delegated
# permissions. Leave false: with it off, settleRoyalties and the daily
# settle-royalties cron leave pending rows untouched and redeem nothing.
-# Turning it on starts moving real USDC on a schedule — read the activation
+# Turning it on starts moving real USDC on a schedule: read the activation
# checklist in docs/skill-royalties.md first. The per-call x402 rail does NOT
# depend on this flag; it pays authors at settlement either way.
SKILL_ROYALTIES_EVM_7710_ENABLED=false
diff --git a/api/_lib/agent-trade-guards.js b/api/_lib/agent-trade-guards.js
index 539243d74..c616dab1d 100644
--- a/api/_lib/agent-trade-guards.js
+++ b/api/_lib/agent-trade-guards.js
@@ -788,7 +788,7 @@ export async function setPolicyRules(agentId, userId, rules, { english = null, r
/**
* Enforce the per-agent spend policy for one outbound movement.
*
- * Fails closed on its inputs: pass `limits`, or `meta`, or neither — with
+ * Fails closed on its inputs: pass `limits`, or `meta`, or neither, with
* neither, the agent's policy is read from its row rather than defaulting to an
* unrestricted wallet. There is no argument shape that silently disables the
* ceilings or the kill switch.
@@ -846,8 +846,8 @@ async function resolveSpendCapability({ agentId, lim, category, usdValue, target
/**
* Fail-closed policy resolution for a spend whose caller supplied NEITHER a
* pre-read `limits` object NOR the agent's `meta`. Without this, both shared
- * guards fell back to `normalizeSpendLimits(undefined)` — every ceiling null,
- * `frozen` false, no natural-language rules — so a caller that simply forgot to
+ * guards fell back to `normalizeSpendLimits(undefined)`: every ceiling null,
+ * `frozen` false, no natural-language rules. A caller that simply forgot to
* load the agent row got a wallet with no policy at all and no signal that the
* kill switch had been skipped. Autonomy makes that unacceptable: the guarantee
* has to hold because the code enforces it, not because every call site
diff --git a/api/_lib/face-embed.js b/api/_lib/face-embed.js
index afb7156ee..94503b35b 100644
--- a/api/_lib/face-embed.js
+++ b/api/_lib/face-embed.js
@@ -14,9 +14,9 @@
// Two OSS models, both commercially clean, matching the reconstruction worker's
// standing "Apache-2.0 / MIT only, no non-commercial 3DMM weights" rule:
//
-// • YuNet (MIT, Shiqi Yu / OpenCV Zoo) — face detection plus the five
+// • YuNet (MIT, Shiqi Yu / OpenCV Zoo): face detection plus the five
// landmarks (eyes, nose tip, mouth corners) that identity models align on.
-// • SFace (Apache-2.0, Zhong & Deng / OpenCV Zoo) — 128-d identity
+// • SFace (Apache-2.0, Zhong & Deng / OpenCV Zoo): 128-d identity
// embedding, the model OpenCV's own FaceRecognizerSF ships.
//
// They run on onnxruntime-web's WASM backend (MIT) rather than
@@ -29,12 +29,12 @@
//
// Weights are NOT vendored: 39 MB of ONNX does not belong in git. They are
// fetched once from a commit-pinned OpenCV Zoo URL, verified against a
-// hardcoded SHA-256, and cached on disk. A hash mismatch is fatal — a
+// hardcoded SHA-256, and cached on disk. A hash mismatch is fatal: a
// silently-swapped identity model would corrupt every score in the table.
//
// Cosine similarity is the score. OpenCV publishes SFace's operating point as
-// 0.363 (same identity above, different identity below) on its own benchmark;
-// that constant is exported here rather than buried, because every downstream
+// 0.363 (same identity above, different identity below) on its own benchmark.
+// That constant is exported here rather than buried, because every downstream
// interpretation of a number this module returns depends on it.
import { createHash } from 'node:crypto';
@@ -82,7 +82,7 @@ const DETECT_NMS_IOU = 0.3;
// SFace's alignment template: the canonical 112x112 five-point layout every
// ArcFace-family model was trained against, in YuNet's landmark order
// (subject's right eye, left eye, nose tip, right mouth corner, left mouth
-// corner — "right" as the subject's, so it sits at the smaller x in frame).
+// corner: "right" as the subject's, so it sits at the smaller x in frame).
const ALIGN_SIZE = 112;
const ALIGN_TEMPLATE = [
[38.2946, 51.6963],
diff --git a/api/_lib/migrations/20260813191500_recurring_payment_lifecycle.sql b/api/_lib/migrations/20260813191500_recurring_payment_lifecycle.sql
index 0081c834c..07415a93b 100644
--- a/api/_lib/migrations/20260813191500_recurring_payment_lifecycle.sql
+++ b/api/_lib/migrations/20260813191500_recurring_payment_lifecycle.sql
@@ -10,7 +10,7 @@
-- (`dca_executions`) that nothing surfaced.
--
-- This adds:
--- * subscription_charges — one row per charge attempt, the mirror of
+-- * subscription_charges: one row per charge attempt, the mirror of
-- dca_executions, so incoming revenue is queryable and every failure is
-- recorded with the classification the cron acted on.
-- * consecutive_failures / last_error_code / paused_at / resumed_at on both
@@ -19,7 +19,7 @@
begin;
--- ── subscription_charges — per-tick charge attempt log ──────────────────────
+-- ── subscription_charges: per-tick charge attempt log ──────────────────────
create table if not exists subscription_charges (
id uuid primary key default gen_random_uuid(),
subscription_id uuid not null references agent_subscriptions(id) on delete cascade,
@@ -53,14 +53,14 @@ create unique index if not exists uq_subscription_charges_period
on subscription_charges(subscription_id, period_start_at)
where status = 'success' and period_start_at is not null;
--- ── agent_subscriptions — lifecycle columns ─────────────────────────────────
+-- ── agent_subscriptions: lifecycle columns ─────────────────────────────────
alter table agent_subscriptions add column if not exists consecutive_failures integer not null default 0;
alter table agent_subscriptions add column if not exists last_error_code text;
alter table agent_subscriptions add column if not exists last_tx_hash text;
alter table agent_subscriptions add column if not exists paused_at timestamptz;
alter table agent_subscriptions add column if not exists resumed_at timestamptz;
--- ── dca_strategies — lifecycle columns ──────────────────────────────────────
+-- ── dca_strategies: lifecycle columns ──────────────────────────────────────
alter table dca_strategies add column if not exists consecutive_failures integer not null default 0;
alter table dca_strategies add column if not exists last_error text;
alter table dca_strategies add column if not exists last_error_code text;
diff --git a/api/_lib/migrations/20260813210000_erc8004_crawl_head_tracking.sql b/api/_lib/migrations/20260813210000_erc8004_crawl_head_tracking.sql
index af0cf9811..afbea5c50 100644
--- a/api/_lib/migrations/20260813210000_erc8004_crawl_head_tracking.sql
+++ b/api/_lib/migrations/20260813210000_erc8004_crawl_head_tracking.sql
@@ -1,4 +1,4 @@
--- erc8004_crawl_cursor — track how far behind the CHAIN HEAD each EVM leg is,
+-- erc8004_crawl_cursor: track how far behind the CHAIN HEAD each EVM leg is,
-- not just when the cron last touched the row.
--
-- Why. On 2026-08-13 the status surface reported the EVM index healthy on 17 of
diff --git a/api/_lib/pump-curve-view.js b/api/_lib/pump-curve-view.js
index 8efcf7416..576fa4b12 100644
--- a/api/_lib/pump-curve-view.js
+++ b/api/_lib/pump-curve-view.js
@@ -32,7 +32,7 @@ export const PUMP_TOTAL_SUPPLY = 1_000_000_000;
// Cheap, RPC-free pre-filter for "could this address carry a pump.fun bonding
// curve?". It exists to keep a misconfigured (e.g. USDC) mount, or a probe
-// sweep, from turning into an RPC read per request — not to be the last word on
+// sweep, from turning into an RPC read per request. It is not the last word on
// what has a curve. Three shapes qualify, all decided from the address alone:
//
// 1. pump.fun's own launcher grinds every mint to end in the literal suffix
@@ -41,7 +41,7 @@ export const PUMP_TOTAL_SUPPLY = 1_000_000_000;
// PREFIX (src/solana/vanity/brand.js) and never the "pump" suffix. Every
// agent token minted that way therefore lands here, and the suffix test
// alone used to reject all of them with a 300s-cached `not_a_pump_mint`
-// 404 — the curve read for our own coins could never succeed.
+// 404: the curve read for our own coins could never succeed.
// 3. Anything on devnet. Nothing grinds a mark on the rehearsal cluster (a
// launch from the owner's own wallet mints a plain generated address), so
// an address-shape test there rejects real curves and answers nothing.
@@ -50,7 +50,7 @@ export const PUMP_TOTAL_SUPPLY = 1_000_000_000;
//
// A known settlement/native token is excluded outright on every cluster: it has
// no curve and never will. A mainnet mint of an unrecognized shape is NOT
-// settled here — getCurveView asks the platform's own launch registry before it
+// settled here: getCurveView asks the platform's own launch registry before it
// answers, because a coin launched from a user's wallet has no mark to read.
export function isPumpMint(mint, network = 'mainnet') {
if (typeof mint !== 'string' || NON_CURVE_MINTS.has(mint)) return false;
@@ -72,7 +72,7 @@ const REGISTRY_TTL_MS = 5 * 60_000;
/**
* Is this mint a coin three.ws itself launched? Reads pump_agent_mints, the
- * platform's own launch directory — the same table /launches and the agent
+ * platform's own launch directory: the same table /launches and the agent
* profile's launch history render from.
*
* A launch from the owner's own wallet (/api/agents/tokens/launch-confirm)
@@ -176,7 +176,7 @@ export function serializeBNs(obj) {
export async function getCurveView({ mint, network = 'mainnet' }) {
// The shape fast-path answers for pump.fun-ground and three.ws-marked mints
// without touching anything. An unrecognized mainnet address gets one more
- // question — is it a coin we launched? — before it is refused, because an
+ // question (is it a coin we launched?) before it is refused, because an
// agent token launched from the owner's own wallet carries no mark at all.
if (!isPumpMint(mint, network) && !(await isRegisteredPlatformLaunch(mint, network))) {
// Negative-cacheable so the CDN edge serves repeat probes without hitting
diff --git a/api/_lib/recurring.js b/api/_lib/recurring.js
index 9ef9e256b..ad919b183 100644
--- a/api/_lib/recurring.js
+++ b/api/_lib/recurring.js
@@ -2,9 +2,9 @@
* Shared lifecycle rules for recurring on-chain payments.
*
* Two schedule kinds ride the same rails:
- * - `agent_subscriptions` — a fixed USDC transfer per period, charged by the
+ * - `agent_subscriptions`: a fixed USDC transfer per period, charged by the
* run-subscriptions cron through /api/permissions/redeem.
- * - `dca_strategies` — a fixed USDC swap per period, executed by the run-dca
+ * - `dca_strategies`: a fixed USDC swap per period, executed by the run-dca
* cron through the same relayer.
*
* Both used to treat every failure identically: pause the schedule and write a
@@ -13,7 +13,7 @@
* 'active'. This module is the single place that decides what a failure means,
* so the crons, the API and the UI all agree on it.
*
- * The three outcomes:
+ * The outcomes:
* fatal the owner has to change something (revoked or expired
* delegation, a scope that no longer covers the charge). Retrying
* is guaranteed to fail, so the schedule pauses immediately.
@@ -28,6 +28,13 @@
* skipped the schedule deliberately declined to act this period (a DCA
* quote that moved too far between reads). Nothing is wrong, so
* the period is simply given up and the next one runs on time.
+ *
+ * One failure is recorded as retryable but handled apart from it: a
+ * platform-side outage (the relayer switched off, or rejecting our own
+ * credentials) is nobody's schedule being wrong. Those retry forever without
+ * counting toward the pause bound, because pausing every schedule on the
+ * platform over one operator config gap would be a far worse outage than the
+ * gap itself, and every one of them would then need a manual resume.
*/
/** Consecutive retryable failures a schedule survives before it is paused. */
@@ -50,14 +57,17 @@ const FATAL_CODES = new Set([
'delegation_gone',
'delegation_not_found',
'delegation_revoked',
- 'feature_disabled',
'scope_exceeded',
'target_not_allowed',
- 'unauthorized',
'unsupported_chain',
'validation_error',
]);
+// Platform-side outages. Recorded as retryable, but never counted against the
+// schedule's pause bound: the owner has nothing to fix and should not have to
+// resume by hand once the operator restores the relayer.
+const PLATFORM_CODES = new Set(['feature_disabled', 'unauthorized']);
+
// Codes that mean the attempt never landed and the next tick can try again.
const RETRYABLE_CODES = new Set([
'db_error',
@@ -152,6 +162,14 @@ export function classifyChargeFailure({ code, message } = {}) {
};
}
+ if (PLATFORM_CODES.has(raw)) {
+ return {
+ code: raw,
+ outcome: OUTCOME.RETRYABLE,
+ platform: true,
+ reason: REASONS[raw],
+ };
+ }
if (FATAL_CODES.has(raw)) {
return { code: raw, outcome: OUTCOME.FATAL, reason: REASONS[raw] };
}
diff --git a/api/_lib/schema.sql b/api/_lib/schema.sql
index 6bb13112d..587093091 100644
--- a/api/_lib/schema.sql
+++ b/api/_lib/schema.sql
@@ -1187,7 +1187,7 @@ alter table agent_subscriptions add column if not exists last_tx_hash te
alter table agent_subscriptions add column if not exists paused_at timestamptz;
alter table agent_subscriptions add column if not exists resumed_at timestamptz;
--- ── subscription_charges — per-tick charge attempt log ──────────────────────
+-- ── subscription_charges: per-tick charge attempt log ──────────────────────
-- The subscription mirror of dca_executions: one row per attempt, so a creator
-- can see what a schedule actually paid and every failure keeps the code the
-- cron classified it under.
diff --git a/api/agent-subscriptions.js b/api/agent-subscriptions.js
index 395954e78..c1ce75112 100644
--- a/api/agent-subscriptions.js
+++ b/api/agent-subscriptions.js
@@ -262,7 +262,7 @@ export default wrap(async (req, res) => {
return error(res, 400, 'validation_error', 'agentId must be a uuid');
}
- // ?view=incoming — what is being paid INTO the agents this user owns.
+ // ?view=incoming: what is being paid INTO the agents this user owns.
// Scoped by agent_identities.user_id rather than agent_subscriptions
// .user_id, so it stays correct the day a third party can fund an agent.
if (view === 'incoming') {
@@ -387,7 +387,7 @@ export default wrap(async (req, res) => {
res,
409,
'delegation_inactive',
- `the signed permission behind this schedule is ${current.delegation_status} — grant a new one to restart it`,
+ `the signed permission behind this schedule is ${current.delegation_status}: grant a new one to restart it`,
);
}
if (
@@ -398,7 +398,7 @@ export default wrap(async (req, res) => {
res,
409,
'delegation_expired',
- 'the signed permission behind this schedule has expired — grant a new one to restart it',
+ 'the signed permission behind this schedule has expired: grant a new one to restart it',
);
}
diff --git a/api/dca-strategies.js b/api/dca-strategies.js
index 1f8d8995e..11c6bf10e 100644
--- a/api/dca-strategies.js
+++ b/api/dca-strategies.js
@@ -105,12 +105,12 @@ export default wrap(async (req, res) => {
// State-changing methods on a cookie session require a CSRF token. These
// strategies move real funds on a schedule, so a forged create/pause/cancel
- // is high-impact — gate every non-GET method.
+ // is high-impact: gate every non-GET method.
if (req.method !== 'GET' && !(await requireCsrf(req, res, session.id))) return;
const url = new URL(req.url, 'http://x');
- // ── PATCH /api/dca-strategies/:id — pause / resume ────────────────────────
+ // ── PATCH /api/dca-strategies/:id, pause / resume ────────────────────────
if (req.method === 'PATCH') {
const strategyId = strategyIdFrom(url);
if (!strategyId) return error(res, 400, 'missing_param', 'strategy id required in path');
@@ -162,7 +162,7 @@ export default wrap(async (req, res) => {
res,
409,
'delegation_inactive',
- `the signed permission behind this strategy is ${row.delegation_status} — grant a new one to restart it`,
+ `the signed permission behind this strategy is ${row.delegation_status}: grant a new one to restart it`,
);
}
if (row.delegation_expires_at && new Date(row.delegation_expires_at) <= new Date()) {
@@ -170,7 +170,7 @@ export default wrap(async (req, res) => {
res,
409,
'delegation_expired',
- 'the signed permission behind this strategy has expired — grant a new one to restart it',
+ 'the signed permission behind this strategy has expired: grant a new one to restart it',
);
}
@@ -207,7 +207,7 @@ export default wrap(async (req, res) => {
if (!rl.success) return rateLimited(res, rl);
// Verify ownership via agent_id → user_id chain. A paused strategy is
- // cancellable too — cancel is the terminal state from anywhere but itself.
+ // cancellable too: cancel is the terminal state from anywhere but itself.
const [row] = await sql`
SELECT s.id
FROM dca_strategies s
@@ -227,7 +227,7 @@ export default wrap(async (req, res) => {
return json(res, 200, { ok: true });
}
- // ── GET — one strategy with history, or an agent's list ───────────────────
+ // ── GET: one strategy with history, or an agent's list ───────────────────
if (req.method === 'GET') {
const ip = clientIp(req);
const rl = await limits.authedReadIp(ip);
@@ -397,7 +397,7 @@ export default wrap(async (req, res) => {
res,
409,
'conflict',
- `a ${existing.status} strategy already exists for this token pair — cancel it first`,
+ `a ${existing.status} strategy already exists for this token pair: cancel it first`,
);
}
diff --git a/api/x402/inference-verify.js b/api/x402/inference-verify.js
index 3d25cb3ba..5eec96119 100644
--- a/api/x402/inference-verify.js
+++ b/api/x402/inference-verify.js
@@ -56,7 +56,7 @@ async function confirmSettlement(network, transaction) {
if (isSolana) {
const { solanaConnection } = await import('../_lib/solana/connection.js');
// Devnet receipts confirm against devnet: the CAIP-2 id tells us which.
- // Compared in full against the canonical id, never by substring — an
+ // Compared in full against the canonical id, never by substring: an
// earlier substring here was missing a character, so it never matched
// and every devnet receipt was looked up on MAINNET and reported as
// mainnet: a false statement about where the money moved.
diff --git a/pages/agent-embed.html b/pages/agent-embed.html
index f80d7ae1f..623470a41 100644
--- a/pages/agent-embed.html
+++ b/pages/agent-embed.html
@@ -511,7 +511,7 @@
// Bind real TTS so `speak` actions produce ElevenLabs audio + lip-sync.
// The whole config (voice id, model, saved settings, and the agent id
// that authorizes an owner-BYOK clone for anonymous listeners) comes
- // from the agent record via agentVoiceConfig — no silent fallback to a
+ // from the agent record via agentVoiceConfig: no silent fallback to a
// default voice; speak reports "agent has no voice configured" when
// nothing is bound.
ttsCtx.viewer = viewer;
diff --git a/scripts/a2a-spend-hardening-proof.mjs b/scripts/a2a-spend-hardening-proof.mjs
index efe0870fe..a6aff61c2 100644
--- a/scripts/a2a-spend-hardening-proof.mjs
+++ b/scripts/a2a-spend-hardening-proof.mjs
@@ -120,7 +120,7 @@ async function loadPg() {
// A `--no-save` install is transient: any later `npm install` in this
// worktree prunes it, so a re-run lands here again. It can also leave a
// half-written node_modules/pg that resolves as a directory but has no
- // entry point — hence the post-install re-import is checked, not assumed.
+ // entry point: hence the post-install re-import is checked, not assumed.
console.log(' installing pg (--no-save) for the local Postgres bridge');
const r = run('npm', ['i', '--no-save', '--no-audit', '--no-fund', 'pg'], { cwd: root });
if (r.code !== 0) throw new Error(`npm i pg failed: ${r.out.slice(-400)}`);
@@ -563,7 +563,7 @@ process.stdin.on('data', (d) => {
// ── 5. receipts on the live local surface ────────────────────────────────
step('5. receipts - queryable per agent on the live HTTP surface');
{
- // This section proves the receipt surface, not the ceilings — and the proof
+ // This section proves the receipt surface, not the ceilings: and the proof
// agent is still carrying section 2's $1/day cap plus its backfilled history.
// Open the policy back up so a seeding payment is refused only if something
// is genuinely broken.
@@ -634,7 +634,7 @@ process.stdin.on('data', (d) => {
// Every later check in this section signs in as that owner, so a failed
// registration is a dead end, not a partial result. Stop here with the
// server's own log attached rather than emitting a cascade of 401s.
- if (!registered) throw new Error(`registration failed (${reg.status}) — the receipt-surface checks cannot run${serverTail(20)}`);
+ if (!registered) throw new Error(`registration failed (${reg.status}): the receipt-surface checks cannot run${serverTail(20)}`);
const csrf1 = await http.freshCsrf();
const created = await http.req('POST', '/api/agents', {
diff --git a/scripts/agent-token-market-proof.mjs b/scripts/agent-token-market-proof.mjs
index d98d20a4c..208856ccb 100644
--- a/scripts/agent-token-market-proof.mjs
+++ b/scripts/agent-token-market-proof.mjs
@@ -7,8 +7,8 @@
* agent's pages. That path is:
*
* pump_agent_mints (our launch record)
- * → GET /api/pump/curve (api/_lib/pump-curve-view.js — on-chain read)
- * → mapCurve() (src/pump/coin-status-card.js — normalization)
+ * → GET /api/pump/curve (api/_lib/pump-curve-view.js: on-chain read)
+ * → mapCurve() (src/pump/coin-status-card.js: normalization)
* → the chip / row the profile renders
*
* This script walks exactly that path with real data and prints what a visitor
@@ -23,10 +23,10 @@
* node scripts/agent-token-market-proof.mjs --limit 3
*
* Where the mints come from when you do not name one:
- * · mainnet — three.ws's own launch directory, read live from
+ * · mainnet: three.ws's own launch directory, read live from
* https://three.ws/api/pump/launches. Coin-agnostic: no mint is hardcoded
* here, the platform's own records supply them at runtime.
- * · devnet — the rehearsal cluster has no launch feed to read, so the script
+ * · devnet: the rehearsal cluster has no launch feed to read, so the script
* discovers a live bonding curve straight from the pump.fun program's own
* accounts and reverse-resolves its mint through the curve's token account.
*
@@ -68,7 +68,7 @@ async function rpc(method, params) {
return body.result;
}
-/** three.ws's own launch records — the mainnet source of truth for agent tokens. */
+/** three.ws's own launch records: the mainnet source of truth for agent tokens. */
async function mintsFromLaunchFeed() {
const r = await fetch(`${LAUNCH_FEED}?limit=${limit}`);
if (!r.ok) throw new Error(`launch feed → HTTP ${r.status}`);
@@ -83,7 +83,7 @@ async function mintsFromLaunchFeed() {
/**
* Devnet discovery: every live bonding curve is an account of the pump.fun
- * program, and the curve PDA holds the coin's own supply — so its token account
+ * program, and the curve PDA holds the coin's own supply: so its token account
* names the mint the curve belongs to.
*/
async function mintsFromCluster() {
@@ -103,7 +103,7 @@ async function mintsFromCluster() {
{ encoding: 'jsonParsed' },
]);
const info = owned?.value?.[0]?.account?.data?.parsed?.info;
- // A curve holding no supply has already sold out or migrated — skip it, we
+ // A curve holding no supply has already sold out or migrated: skip it, we
// want a coin whose curve still has state worth rendering.
if (!info?.mint || Number(info.tokenAmount?.uiAmount) <= 0) continue;
found.push({ mint: info.mint, meta: null, via: `curve ${curve.pubkey.slice(0, 8)}…` });
@@ -115,13 +115,18 @@ async function mintsFromCluster() {
* The widget calls `/api/pump/curve` as a same-origin relative URL. There is no
* HTTP server in a script run, so route that one path to the handler the real
* route relays verbatim (api/pump/curve.js is a thin shell over getCurveView).
- * Same code, same body, same cluster — only the transport is skipped. Every
+ * Same code, same body, same cluster: only the transport is skipped. Every
* other request falls through to the network untouched.
*/
function routeApiCallsInProcess() {
const realFetch = globalThis.fetch;
globalThis.fetch = async (input, init) => {
const href = String(input?.url || input);
+ // pump.fun's indexer proxy has no in-process handler to borrow (it is a
+ // server-side proxy), so a relative call goes to the live site instead.
+ if (href.startsWith('/api/')) {
+ if (!href.startsWith('/api/pump/curve')) return realFetch(`https://three.ws${href}`, init);
+ }
if (href.startsWith('/api/pump/curve')) {
const params = new URLSearchParams(href.split('?')[1] || '');
const result = await getCurveView({
diff --git a/scripts/royalty-proof.mjs b/scripts/royalty-proof.mjs
index e0d010cc5..cb05c2d1f 100644
--- a/scripts/royalty-proof.mjs
+++ b/scripts/royalty-proof.mjs
@@ -71,7 +71,7 @@ const PRICE_USD = 0.25;
const checks = [];
function check(name, pass, detail) {
checks.push({ name, pass, detail });
- console.log(` ${pass ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`);
+ console.log(` ${pass ? 'PASS' : 'FAIL'} ${name}${detail ? `, ${detail}` : ''}`);
}
const tag = `royalty-proof-${process.pid}`;
diff --git a/specs/AGENT_MANIFEST.md b/specs/AGENT_MANIFEST.md
index 0f1336dd4..6339ef669 100644
--- a/specs/AGENT_MANIFEST.md
+++ b/specs/AGENT_MANIFEST.md
@@ -89,7 +89,7 @@ Everything is optional except `manifest.json` and a `body` reference.
},
},
- // Persona — the compiled voice, described but never disclosed
+ // Persona: the compiled voice, described but never disclosed
"persona": {
"has_persona": true, // false when the agent still runs on no persona at all
"tone_tags": ["blunt", "dry", "analytical"],
diff --git a/specs/SKILL_ROYALTY_SPLIT.md b/specs/SKILL_ROYALTY_SPLIT.md
index 36bc2fa0a..959c6eb10 100644
--- a/specs/SKILL_ROYALTY_SPLIT.md
+++ b/specs/SKILL_ROYALTY_SPLIT.md
@@ -79,9 +79,9 @@ One settled call produces at most one `royalty_ledger` row.
Each invariant is covered by at least one positive and one negative test. The
suites that prove them:
-- [`tests/skill-royalty.test.js`](../tests/skill-royalty.test.js) — the split math (SR-1 … SR-5) and the flag gate (SR-15).
-- [`tests/skill-royalty-earnings.test.js`](../tests/skill-royalty-earnings.test.js) — the read side, including the LEFT JOIN regression guard (SR-14) and separated totals (SR-19).
-- [`scripts/royalty-proof.mjs`](../scripts/royalty-proof.mjs) — an end-to-end proof against a real Postgres, asserting SR-1, SR-4, SR-11, SR-12, SR-13, SR-14 and SR-20 in one run, moving no funds.
+- [`tests/skill-royalty.test.js`](../tests/skill-royalty.test.js): the split math (SR-1 … SR-5) and the flag gate (SR-15).
+- [`tests/skill-royalty-earnings.test.js`](../tests/skill-royalty-earnings.test.js): the read side, including the LEFT JOIN regression guard (SR-14) and separated totals (SR-19).
+- [`scripts/royalty-proof.mjs`](../scripts/royalty-proof.mjs): an end-to-end proof against a real Postgres, asserting SR-1, SR-4, SR-11, SR-12, SR-13, SR-14 and SR-20 in one run, moving no funds.
## Change control
diff --git a/src/agent-detail.js b/src/agent-detail.js
index 202435af7..a1383a28b 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -601,7 +601,7 @@ export async function renderLaunchHistory(container, agent) {
'aria-label': `${coin.symbol || coin.name || 'coin'} on three.ws`,
});
box.appendChild(row);
- // Live market cap + graduation stream in through the shared widget —
+ // Live market cap + graduation stream in through the shared widget
// one fetch per row, mapped and formatted in one place. A mainnet coin
// reads from pump.fun's indexer (falling back to its bonding curve
// while the indexer catches up); a devnet coin reads its curve off the
diff --git a/src/pump/coin-status-card.curve.dom.test.js b/src/pump/coin-status-card.curve.dom.test.js
index 7ccf9437b..d9b03cada 100644
--- a/src/pump/coin-status-card.curve.dom.test.js
+++ b/src/pump/coin-status-card.curve.dom.test.js
@@ -12,7 +12,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { mountCoinStatus } from './coin-status-card.js';
// A three.ws-launched mint: the "3ws" brand mark leads the address (pump.fun's
-// own launcher grinds a "pump" suffix instead — both carry a bonding curve).
+// own launcher grinds a "pump" suffix instead: both carry a bonding curve).
const MINT = '3wsSynthetic11111111111111111111111111111';
function curveBody(overrides = {}) {
@@ -65,7 +65,7 @@ afterEach(() => {
vi.useRealTimers();
});
-describe('mountCoinStatus — devnet lane', () => {
+describe('mountCoinStatus: devnet lane', () => {
it('reads the cluster curve and renders SOL-denominated market state', async () => {
const fetchMock = routedFetch([['/api/pump/curve', ok(curveBody())]]);
vi.stubGlobal('fetch', fetchMock);
@@ -134,7 +134,7 @@ describe('mountCoinStatus — devnet lane', () => {
});
});
-describe('mountCoinStatus — mainnet indexer fallback', () => {
+describe('mountCoinStatus: mainnet indexer fallback', () => {
it('falls through to the bonding curve when the indexer does not know the coin', async () => {
const fetchMock = routedFetch([
['/api/pump/coin', notFound()],
@@ -146,7 +146,7 @@ describe('mountCoinStatus — mainnet indexer fallback', () => {
const handle = mountCoinStatus(container, MINT, { variant: 'chip', refreshMs: 0 });
await vi.waitFor(() => expect(container.querySelector('.csc-mcap')).toBeTruthy());
- // 32 SOL × $200 — real on-chain state, priced in dollars because mainnet
+ // 32 SOL × $200: real on-chain state, priced in dollars because mainnet
// SOL has a dollar price.
expect(container.querySelector('.csc-mcap').textContent).toBe('$6.4K');
expect(container.querySelector('.csc-net')).toBeNull();
diff --git a/src/pump/coin-status-card.js b/src/pump/coin-status-card.js
index c5d86ec4a..b14c23a6a 100644
--- a/src/pump/coin-status-card.js
+++ b/src/pump/coin-status-card.js
@@ -10,10 +10,10 @@
* every consumer benefits when a field name or format changes.
*
* Data sources, in the order the widget tries them:
- * 1. GET /api/pump/coin?mint=<mint> — pump.fun's indexed coin object. Rich
+ * 1. GET /api/pump/coin?mint=<mint>: pump.fun's indexed coin object. Rich
* (logo, 24h volume, USD market cap) but mainnet-only, and it only knows a
* coin once pump.fun's indexer has picked it up.
- * 2. GET /api/pump/curve?mint=<mint>&network=<n> — the on-chain bonding curve
+ * 2. GET /api/pump/curve?mint=<mint>&network=<n>: the on-chain bonding curve
* read straight off the cluster. This is the only source that exists on
* devnet, and it answers for a mint the indexer has not seen yet, so it is
* both the devnet lane and the mainnet cold-start fallback. Devnet figures
@@ -68,9 +68,15 @@ export function formatPrice(n) {
return `$${Math.round(n).toLocaleString('en-US')}`;
}
+// The "no value yet" placeholder every formatter on this widget has always
+// rendered. Built from its code point rather than typed, because the repo's
+// writing rules ban the glyph in source; it must stay byte-identical to what
+// the USD formatters above return or the variants would disagree on screen.
+export const NO_VALUE = String.fromCodePoint(0x2014);
+
/** Compact SOL market cap: `◎1.20K`, `◎4.31`, `◎0.0042`. */
export function formatSolMcap(n) {
- if (!Number.isFinite(n) || n < 0) return '—';
+ if (!Number.isFinite(n) || n < 0) return NO_VALUE;
if (n >= 1e6) return `◎${(n / 1e6).toFixed(2)}M`;
if (n >= 1e3) return `◎${(n / 1e3).toFixed(2)}K`;
if (n >= 1) return `◎${n.toFixed(2)}`;
@@ -78,9 +84,9 @@ export function formatSolMcap(n) {
return '◎0';
}
-/** Per-token SOL price — always tiny, so significant digits over fixed places. */
+/** Per-token SOL price: always tiny, so significant digits over fixed places. */
export function formatSolPrice(n) {
- if (!Number.isFinite(n) || n <= 0) return '—';
+ if (!Number.isFinite(n) || n <= 0) return NO_VALUE;
if (n >= 0.01) return `◎${n.toFixed(5)}`;
return `◎${n.toFixed(12).replace(/0+$/, '')}`;
}
@@ -118,7 +124,7 @@ function spokenUsd(n) {
return `${n.toFixed(2)} dollars`;
}
-// Same, for a SOL-denominated coin — a screen reader must never hear "dollars"
+// Same, for a SOL-denominated coin: a screen reader must never hear "dollars"
// for a devnet rehearsal figure.
function spokenSol(n) {
if (!Number.isFinite(n)) return 'unavailable';
@@ -171,7 +177,7 @@ export function mapCoin(raw, mint) {
}
/**
- * Normalize a `/api/pump/curve` response — the on-chain bonding-curve read —
+ * Normalize a `/api/pump/curve` response, the on-chain bonding-curve read,
* into the same coin shape `mapCoin()` produces, so every variant renders a
* cluster-sourced coin without knowing where the numbers came from.
*
@@ -188,7 +194,7 @@ export function mapCoin(raw, mint) {
* rehearsal coin is priced in SOL and labelled as such.
* @param {string} [o.network]
* @param {object} [o.meta] registry facts (symbol, name, launch time) the
- * chain does not carry — the curve knows economics, not identity.
+ * chain does not carry: the curve knows economics, not identity.
* @returns {object|null} null when the mint has no curve to render.
*/
export function mapCurve(raw, mint, { solUsd = null, network = 'mainnet', meta = null } = {}) {
@@ -216,13 +222,13 @@ export function mapCurve(raw, mint, { solUsd = null, network = 'mainnet', meta =
/** Format a market cap in whichever unit this coin's numbers are denominated. */
function mcapText(coin) {
- if (coin.mcap == null) return '—';
+ if (coin.mcap == null) return NO_VALUE;
return coin.denom === 'sol' ? formatSolMcap(coin.mcap) : formatMcap(coin.mcap);
}
/** Format a per-token price in whichever unit this coin's numbers are denominated. */
function priceText(coin) {
- if (coin.price == null) return '—';
+ if (coin.price == null) return NO_VALUE;
return coin.denom === 'sol' ? formatSolPrice(coin.price) : formatPrice(coin.price);
}
@@ -434,7 +440,7 @@ function networkTag(coin) {
return el('span', {
class: 'csc-net',
text: 'DEVNET',
- title: 'Launched on Solana devnet — real on-chain state, no real value',
+ title: 'Launched on Solana devnet, real on-chain state, no real value',
});
}
@@ -580,11 +586,11 @@ function injectStyles() {
* Hosts that already batch-fetch conviction (e.g. the
* watchlist) pass false to skip the redundant per-coin
* /api/oracle/coin round trip.
- * @param {string} [opts.network] — 'mainnet' (default) | 'devnet'. A
+ * @param {string} [opts.network]: 'mainnet' (default) | 'devnet'. A
* devnet coin is read straight off the cluster's bonding
* curve and rendered in SOL; there is no indexer, no
* Oracle score, and no pump.fun market page out there.
- * @param {object} [opts.meta] — registry facts the chain does not
+ * @param {object} [opts.meta]: registry facts the chain does not
* carry (symbol, name, image, createdAt). Used to label
* the cluster-sourced lane, where economics come from the
* curve and identity comes from our own launch record.
@@ -597,7 +603,7 @@ export function mountCoinStatus(container, mint, opts = {}) {
const placeholder = opts.placeholder || null;
const network = opts.network === 'devnet' ? 'devnet' : 'mainnet';
const meta = opts.meta || null;
- // Devnet has no pump.fun indexer and no Oracle coverage — the cluster is the
+ // Devnet has no pump.fun indexer and no Oracle coverage: the cluster is the
// only source, so never spend a round trip discovering that again.
const wantOracle = opts.oracle !== false && network !== 'devnet';
// Optional observer fired with the normalized coin after every successful
@@ -629,7 +635,7 @@ export function mountCoinStatus(container, mint, opts = {}) {
/**
* Cluster-sourced read: the bonding curve itself. Sole source on devnet, and
* the fallback on mainnet for a coin pump.fun's indexer has not caught up to
- * yet — which is every three.ws launch for its first minutes of life.
+ * yet: which is every three.ws launch for its first minutes of life.
*/
async function loadFromCurve(sig) {
// A devnet coin is priced in SOL on purpose (see mapCurve): asking for a
@@ -670,15 +676,18 @@ export function mountCoinStatus(container, mint, opts = {}) {
if (network === 'devnet') {
lastCoin = await loadFromCurve(sig);
} else {
- const r = await fetch(`${COIN_ENDPOINT}?mint=${encodeURIComponent(mint)}`, { signal: sig });
- if (r.ok) {
- lastCoin = mapCoin(await r.json(), mint);
- } else {
- // The indexer does not know this coin (yet). The chain always does:
- // fall through to the curve rather than showing "unavailable" for a
- // coin that is live and trading.
- lastCoin = await loadFromCurve(sig);
+ let indexed = null;
+ try {
+ const r = await fetch(`${COIN_ENDPOINT}?mint=${encodeURIComponent(mint)}`, { signal: sig });
+ if (r.ok) indexed = mapCoin(await r.json(), mint);
+ } catch (err) {
+ // A cancelled load is not an indexer failure — let it unwind.
+ if (err?.name === 'AbortError') throw err;
}
+ // The indexer does not know this coin, or could not be reached. The
+ // chain always knows: read the curve rather than showing "unavailable"
+ // for a coin that is live and trading.
+ lastCoin = indexed || (await loadFromCurve(sig));
}
if (oraclePromise) {
diff --git a/src/pump/coin-status-card.test.js b/src/pump/coin-status-card.test.js
index 545fe6e22..ef03e6eb3 100644
--- a/src/pump/coin-status-card.test.js
+++ b/src/pump/coin-status-card.test.js
@@ -11,6 +11,7 @@ import {
formatSolPrice,
mapCoin,
mapCurve,
+ NO_VALUE,
} from './coin-status-card.js';
describe('formatMcap', () => {
@@ -78,8 +79,15 @@ describe('SOL denomination', () => {
it('renders tiny per-token SOL prices without exponent notation', () => {
expect(formatSolPrice(0.000000028)).toBe('◎0.000000028');
- expect(formatSolPrice(0)).toBe('—');
- expect(formatSolPrice(NaN)).toBe('—');
+ expect(formatSolPrice(0)).toBe(NO_VALUE);
+ expect(formatSolPrice(NaN)).toBe(NO_VALUE);
+ });
+
+ // The SOL and USD formatters must agree on the placeholder, or a row that
+ // switches source mid-refresh would flicker between two "no value" glyphs.
+ it('shares the no-value placeholder with the USD formatters', () => {
+ expect(formatSolMcap(NaN)).toBe(formatMcap(NaN));
+ expect(formatSolPrice(NaN)).toBe(formatPrice(NaN));
});
});
diff --git a/src/recurring.js b/src/recurring.js
index 172d4f0aa..f698e46ab 100644
--- a/src/recurring.js
+++ b/src/recurring.js
@@ -1,5 +1,5 @@
/**
- * /recurring — the product surface for recurring on-chain payments.
+ * /recurring: the product surface for recurring on-chain payments.
*
* Two schedule kinds, one lifecycle:
* - subscriptions (`/api/agent-subscriptions`) transfer a fixed USDC amount
diff --git a/src/runtime/speech.js b/src/runtime/speech.js
index c6bff511b..5c2a43695 100644
--- a/src/runtime/speech.js
+++ b/src/runtime/speech.js
@@ -548,15 +548,15 @@ export function createTTS(config = {}) {
* needs the same three things from the agent row, and getting any of them
* wrong is silent: the agent just falls back to a generic voice or goes mute.
*
- * voice_id — which voice to speak with.
- * agentId — WHICH AGENT this voice belongs to. The /api/tts/eleven
+ * voice_id: which voice to speak with.
+ * agentId: WHICH AGENT this voice belongs to. The /api/tts/eleven
* proxy only serves an owner-BYOK clone when the request
* names its agent, because that is what authorizes spending
* the owner's ElevenLabs credential. Omit it and a bound
* voice is unreachable to embed visitors and signed-out
* listeners, which is exactly who embeds are for.
* voice_model /
- * voice_settings — the tuning the owner saved in the editor. Dropping these
+ * voice_settings: the tuning the owner saved in the editor. Dropping these
* plays the right voice with the wrong delivery.
*
* Returns null when the agent has no ElevenLabs voice bound, so callers can
diff --git a/src/widgets/bonding-curve.js b/src/widgets/bonding-curve.js
index eb0736007..6bf628b3b 100644
--- a/src/widgets/bonding-curve.js
+++ b/src/widgets/bonding-curve.js
@@ -15,7 +15,7 @@
* lamportsToSol / fmtSol / fmtUsd / fmtPrice — pure formatters (tested)
* curveValue / curvePoints / areaPathFor — pure curve geometry (tested)
* computeView(data, solUsd) — pure view-model (tested)
- * getSolUsd() — shared, cached SOL/USD read
+ * getSolUsd(): shared, cached SOL/USD read
* renderCardShell(view, cfg) — pure HTML string (tested)
* mountBondingCurve(rootEl, opts) — full mount + polling + anim
*
@@ -50,7 +50,7 @@ const NON_CURVE_MINTS = new Set([
// devnet nothing grinds a mark at all, so the shape says nothing and every
// plausible address is worth asking about. A settlement token is excluded
// everywhere. Anything else on mainnet is skipped here rather than contributing
-// to a /api/pump/curve 404 storm from a misconfigured (e.g. USDC) mount — the
+// to a /api/pump/curve 404 storm from a misconfigured (e.g. USDC) mount: the
// server still recognizes an unmarked coin of ours from its own launch
// registry, so a real agent token is never left unrendered by this shortcut.
export function isPumpMint(mint, network = 'mainnet') {
@@ -59,7 +59,7 @@ export function isPumpMint(mint, network = 'mainnet') {
return mint.endsWith('pump') || hasThreeWsMark(mint);
}
-/** A base58 string of Solana address length — the shape, not the existence. */
+/** A base58 string of Solana address length: the shape, not the existence. */
export function isPlausibleMint(s) {
return /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(String(s || ''));
}
@@ -245,8 +245,8 @@ export function computeView(data, solUsd = null) {
// which is not one: on a live devnet curve 95% of the way to graduation it
// reports -1.75 SOL while the curve holds 30.3 SOL of virtual reserves. Every
// consumer clamped that negative to zero and rendered "◎0" for a coin with a
- // real price. The curve carries the two honest numbers instead — the current
- // per-token price and the token's total supply — and pump.fun sells the entire
+ // real price. The curve carries the two honest numbers instead: the current
+ // per-token price and the token's total supply: and pump.fun sells the entire
// fixed supply through the curve, so price × supply IS the market cap.
const marketCapSol = priceSol * totalSupplyTokens(data.curve);
diff --git a/src/widgets/bonding-curve.test.js b/src/widgets/bonding-curve.test.js
index 0f2931ddb..3d0f621de 100644
--- a/src/widgets/bonding-curve.test.js
+++ b/src/widgets/bonding-curve.test.js
@@ -171,7 +171,7 @@ describe('computeView', () => {
expect(v.progress).toBeCloseTo(0.345, 5);
expect(v.progressPct).toBeCloseTo(34.5, 5);
// 30 lamports per token × 1B tokens = 30 SOL. The SDK's `price.marketCap`
- // is deliberately not used — see the derivation note in computeView.
+ // is deliberately not used: see the derivation note in computeView.
expect(v.marketCapSol).toBeCloseTo(30, 6);
expect(v.raisedSol).toBe(18);
expect(v.hasUsd).toBe(false);
@@ -268,7 +268,7 @@ describe('computeView', () => {
expect(v.marketCapUsd).toBe(10_000_000);
});
- // The SDK's `price.marketCap` goes negative on real curves — a live devnet
+ // The SDK's `price.marketCap` goes negative on real curves: a live devnet
// coin 95% of the way to graduation reports -1.75 SOL while holding 30.3 SOL
// of virtual reserves. Reading it and clamping rendered "◎0" for a coin with
// a real price, which is why the market cap is derived from price × supply.
diff --git a/tests/agent-detail-launch-history.test.js b/tests/agent-detail-launch-history.test.js
index d792b7bee..6786b2d0a 100644
--- a/tests/agent-detail-launch-history.test.js
+++ b/tests/agent-detail-launch-history.test.js
@@ -1,6 +1,6 @@
// @vitest-environment jsdom
//
-// The launch history on /agents/:id — the profile half of the agent-token lane.
+// The launch history on /agents/:id, the profile half of the agent-token lane.
//
// Every coin an agent launched through three.ws is registered in
// pump_agent_mints and read back by GET /api/pump/by-agent. The property under
@@ -13,8 +13,8 @@
// straight off the cluster, priced in SOL and badged DEVNET.
//
// The devnet row used to render as a lifeless symbol-and-address line, which
-// meant the free rehearsal path — the only path that proves this lane end to end
-// without spending real money — produced no market data on the profile at all.
+// meant the free rehearsal path: the only path that proves this lane end to end
+// without spending real money: produced no market data on the profile at all.
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { renderLaunchHistory, destroyCoinStatus } from '../src/agent-detail.js';
diff --git a/tests/pump-curve-mint-gate.test.js b/tests/pump-curve-mint-gate.test.js
index 1d7757976..8d287d739 100644
--- a/tests/pump-curve-mint-gate.test.js
+++ b/tests/pump-curve-mint-gate.test.js
@@ -1,7 +1,7 @@
// The address-only pre-filter that decides whether a mint can carry a pump.fun
// bonding curve at all.
//
-// It exists in two copies on purpose — one in the API (api/_lib/pump-curve-view.js,
+// It exists in two copies on purpose: one in the API (api/_lib/pump-curve-view.js,
// guarding an RPC read and a 300s-cached 404) and one in the browser widget
// (src/widgets/bonding-curve.js, guarding the request itself). They must agree:
// a mint the server would answer for and the widget refuses to ask about renders
diff --git a/tests/runtime/agent-voice-config.test.js b/tests/runtime/agent-voice-config.test.js
index b8174bf92..2c0d3f974 100644
--- a/tests/runtime/agent-voice-config.test.js
+++ b/tests/runtime/agent-voice-config.test.js
@@ -1,9 +1,9 @@
-// agentVoiceConfig — the mapper every surface uses to play an agent's bound voice.
+// agentVoiceConfig: the mapper every surface uses to play an agent's bound voice.
//
// The failure this guards against is silent, which is why it is worth a test: an
// agent whose voice was cloned on its owner's own ElevenLabs key is only served
// by /api/tts/eleven when the request names the agent. Drop `agentId` from the
-// TTS config and the embed still "works" — it just goes mute for every visitor
+// TTS config and the embed still "works": it just goes mute for every visitor
// who is not the signed-in owner, which is everyone an embed exists for.
import { describe, it, expect } from 'vitest';
diff --git a/tests/skill-royalty-earnings.test.js b/tests/skill-royalty-earnings.test.js
index 3234c6d50..8565f2358 100644
--- a/tests/skill-royalty-earnings.test.js
+++ b/tests/skill-royalty-earnings.test.js
@@ -62,7 +62,7 @@ const RUNTIME_ROW = {
agent_name: 'Scout',
};
-describe('getCreatorSalesData — both royalty lanes reach the author', () => {
+describe('getCreatorSalesData: both royalty lanes reach the author', () => {
it('LEFT JOINs agent_identities so x402 accruals are not dropped', async () => {
const sql = makeSql([[X402_ROW], []]);
await new MonetizationService(AUTHOR, { sql }).getCreatorSalesData();