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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
style: replace em-dashes and reword two prose comments the rules lint read as commented-out code in the approvals, strategy, domains and desktop runtime files
nirholas66624fbe184f
diff --git a/api/_lib/agent-strategy-runtime.js b/api/_lib/agent-strategy-runtime.jsindex da1900c01..4b6aa600f 100644--- a/api/_lib/agent-strategy-runtime.js+++ b/api/_lib/agent-strategy-runtime.js@@ -395,7 +395,7 @@ async function evaluateEntries({ equip, agent, launches, nowMs, maxEntries = 3 }if (sinceMin < config.risk.cooldown_minutes) return results;}- // Concurrency — never exceed the strategy's max concurrent open positions. In+ // Concurrency: never exceed the strategy's max concurrent open positions. In// ask mode a pending approval holds a slot too, so the owner is never asked for// more buys than the strategy may hold at once.const [openCnt] = await sql`diff --git a/api/_lib/approvals.js b/api/_lib/approvals.jsindex 508b0e8b7..bad091aaf 100644--- a/api/_lib/approvals.js+++ b/api/_lib/approvals.js@@ -9,7 +9,7 @@// risk notes. Approving://// 1. requires the payload hash the owner was shown, so a screen that went-// stale (or a link someone edited) can never approve a different action;+// stale (or a link someone edited) can never approve a different action, and// 2. flips pending -> approved in ONE conditional UPDATE that also checks the// expiry, so a double tap, a push tap racing a web click, or an approval// after the deadline cannot execute twice or late;diff --git a/api/_lib/cloud-domains.js b/api/_lib/cloud-domains.jsindex 86064fd76..f5c284c04 100644--- a/api/_lib/cloud-domains.js+++ b/api/_lib/cloud-domains.js@@ -2,7 +2,7 @@// domain_* MCP tools and /api/domains.//// Authenticated as the Cloud Run runtime service account through-// getGcpAccessToken (gcp-auth.js). Every call is a real request to the API;+// getGcpAccessToken (gcp-auth.js). Every call is a real request to the API, and// nothing here is cached or faked. Callers that want caching wrap these (see// domains-service.js).//diff --git a/api/agents/agent-strategy-objects.js b/api/agents/agent-strategy-objects.jsindex 1d614ba67..f3ca62e43 100644--- a/api/agents/agent-strategy-objects.js+++ b/api/agents/agent-strategy-objects.js@@ -309,7 +309,7 @@ async function handleClose(req, res, id) {return json(res, 200, { data: result.data });}-// POST mode — switch one equipped strategy between auto (buy within caps) and ask+// POST mode: switch one equipped strategy between auto (buy within caps) and ask// (file an approval for every buy). Going to auto arms autonomous buying, so it// needs the real-funds agreement; going to ask never does.async function handleMode(req, res, id) {@@ -352,7 +352,7 @@ async function handleApprovals(req, res, id) {return json(res, 200, { data: { approvals: rows } });}-// POST approve — the owner's explicit yes for one ask-mode buy. Executes the exact+// POST approve: the owner's explicit yes for one ask-mode buy. Executes the exact// stored payload once, through every spend guard, at the moment of approval.async function handleApprove(req, res, id) {const owned = await loadOwned(req, res, id);diff --git a/api/audit-log.js b/api/audit-log.jsindex 82d792de5..3336bce7b 100644--- a/api/audit-log.js+++ b/api/audit-log.js@@ -1,6 +1,6 @@// GET /api/audit-log — JSON list of the caller's audit events// GET /api/audit-log?format=csv — CSV download (same data, last 90 days)-// GET /api/audit-log?action_prefix=approval_ — only actions starting with the+// GET /api/audit-log?action_prefix=approval_ : only actions starting with the// prefix (the /approvals page's audit panel). Lowercase letters and _ only.//// Backs the "Action log" panel on /dashboard-next/account. Reads from thediff --git a/api/strategies.js b/api/strategies.jsindex 7a0805ef4..8ca3884d8 100644--- a/api/strategies.js+++ b/api/strategies.js@@ -355,7 +355,7 @@ async function handlePublish(req, res, auth, id) {return json(res, 200, { data: publicStrategy(updated, perf.get(id), names.get(auth.userId)) });}-// POST /api/strategies/preview { config, hours?, network? } — public and read-only:+// POST /api/strategies/preview { config, hours?, network? }: public and read-only:// replays recorded launches through the live entry filter and research gates.async function handlePreview(req, res) {const rl = await limits.strategyPreviewIp(clientIp(req));diff --git a/apps/desktop/src/runtime/strategy-schema.js b/apps/desktop/src/runtime/strategy-schema.jsindex aad7193bb..bdc8b9486 100644--- a/apps/desktop/src/runtime/strategy-schema.js+++ b/apps/desktop/src/runtime/strategy-schema.js@@ -1,4 +1,4 @@-// Strategy Object config — the validated, versioned rule set behind a Strategy.+// Strategy Object config: the validated, versioned rule set behind a Strategy.//// A strategy is NOT free text: it is a structured plan with a real schema. This// module is the single source of truth for that schema. It normalizes arbitrary@@ -9,7 +9,7 @@//// Critically, the strategy's own caps (per-trade size, slippage, concurrency)// are ADDITIONAL constraints layered on top of the agent's server-side spend-// policy — never a way around it. The runtime sizes a buy from `sizing.amount_sol`+// policy: never a way around it. The runtime sizes a buy from `sizing.amount_sol`// but the trade still passes through the full guard + custody path, so a strategy// can never exceed the spend leash. Ever.//@@ -81,7 +81,7 @@ export const STRATEGY_CONFIG_DEFAULTS = Object.freeze({},});-// Hard ceilings the schema enforces regardless of input — defensive bounds so a+// Hard ceilings the schema enforces regardless of input: defensive bounds so a// stored config can never carry a nonsense number into the runtime.const BOUNDS = Object.freeze({amount_sol: { min: 0.0001, max: 100 },@@ -199,7 +199,7 @@ export function normalizeStrategyConfig(raw) {},exits: {take_profit_pct: numOrNull(x.take_profit_pct, BOUNDS.take_profit_pct),- // stop_loss is mandatory and always present — default applied if absent/invalid.+ // stop_loss is mandatory and always present: default applied if absent/invalid.stop_loss_pct: clampNum(x.stop_loss_pct, d.exits.stop_loss_pct, BOUNDS.stop_loss_pct),trailing_stop_pct: numOrNull(x.trailing_stop_pct, BOUNDS.trailing_stop_pct),max_hold_minutes: intOrNull(x.max_hold_minutes, BOUNDS.max_hold_minutes),@@ -272,7 +272,7 @@ export function validateStrategyConfig(raw) {errors.push({ field: 'sizing.amount_sol', message: 'Per-trade size must be greater than 0 SOL.' });}if (!(config.exits.stop_loss_pct > 0)) {- errors.push({ field: 'exits.stop_loss_pct', message: 'A stop-loss is required — every strategy must define its downside.' });+ errors.push({ field: 'exits.stop_loss_pct', message: 'A stop-loss is required: every strategy must define its downside.' });}if (config.entry.min_market_cap_usd != null &&@@ -299,7 +299,7 @@ export function validateStrategyConfig(raw) {/*** Evaluate one real launch against a strategy's entry conditions. Pure +- * synchronous. Returns { pass, reasons } — reasons always explains the verdict+ * synchronous. Returns { pass, reasons }: reasons always explains the verdict* (kept on rejections too, for the runtime's evaluation log).** @param {object} config normalized strategy config@@ -314,11 +314,11 @@ export function matchesEntry(config, launch, nowMs) {if (!launch || !launch.mint) return { pass: false, reasons: ['no_mint'] };- // Age gate — only act on genuinely recent launches.+ // Age gate: only act on genuinely recent launches.if (e.max_age_minutes != null && launch.created_at) {const ageMin = (nowMs - Number(launch.created_at)) / 60000;if (!Number.isFinite(ageMin) || ageMin < 0) {- // Clock skew / bad timestamp — treat as fresh, don't reject.+ // Clock skew / bad timestamp: treat as fresh, don't reject.} else if (ageMin > e.max_age_minutes) {return { pass: false, reasons: [`too_old:${Math.round(ageMin)}m`] };} else {@@ -326,7 +326,7 @@ export function matchesEntry(config, launch, nowMs) {}}- // SOL-quote requirement — the agent wallet trades in SOL on this path.+ // SOL-quote requirement: the agent wallet trades in SOL on this path.if (e.require_sol_quote && launch.is_usdc_pair === true) {return { pass: false, reasons: ['quote_not_sol'] };}@@ -472,7 +472,7 @@ export function evaluateResearchGates(config, report) {/*** Decide whether an open position should exit, given a live re-quote. Pure.- * Returns { exit, reason } — reason ∈ take_profit|stop_loss|trailing_stop|timeout.+ * Returns { exit, reason }: reason ∈ take_profit|stop_loss|trailing_stop|timeout.** @param {object} config normalized config* @param {object} pos { entry_lamports, peak_value_lamports, opened_at(ms) }@@ -484,7 +484,7 @@ export function shouldExit(config, pos, currentValueLamports, nowMs) {const entry = Number(pos.entry_lamports || 0);const cur = Number(currentValueLamports || 0);- // Time-based exit is independent of price — check it even with no entry basis.+ // Time-based exit is independent of price: check it even with no entry basis.if (x.max_hold_minutes != null && pos.opened_at) {const heldMin = (nowMs - Number(pos.opened_at)) / 60000;if (heldMin >= x.max_hold_minutes) return { exit: true, reason: 'timeout' };diff --git a/public/push-sw.js b/public/push-sw.jsindex e5ddce54d..0659fe458 100644--- a/public/push-sw.js+++ b/public/push-sw.js@@ -9,7 +9,7 @@// • notificationclick — focus or open the target URL (tagged ?source=push so// the app records a `returned` funnel event), and beacon a// `opened` event so sent→opened→returned is measurable.-// • approvals — an approval push (api/_lib/approvals.js) gets Approve+// • approvals : an approval push (api/_lib/approvals.js) gets Approve// and Deny buttons. Tapping one posts the decision with the// payload hash the notification showed, so the server only// executes that exact action, then shows the outcome. A