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.

chore(coin): live cohorts tests + refinements

nirholasf6a59cc89ffb
diff --git a/api/_lib/coin/cohorts-live.js b/api/_lib/coin/cohorts-live.js
index 88c5dc854..a4513e486 100644
--- a/api/_lib/coin/cohorts-live.js
+++ b/api/_lib/coin/cohorts-live.js
@@ -136,7 +136,10 @@ export function liveCohortCounts(set, params = {}) {
* @param {string} [opts.salt] sampling salt (defaults to the mint)
* @returns {{members: Array, sampled: boolean, total: number, truncated: boolean}}
*/
-export function liveCohortMembers(set, { cohortId, params = {}, limit = 200, sample, salt = 'live' }) {
+export function liveCohortMembers(
+ set,
+ { cohortId, params = {}, limit = 200, sample, salt = 'live' },
+) {
if (!isLiveCohort(cohortId)) {
const err = new Error(`cohort "${cohortId}" requires a holder snapshot`);
err.code = 'snapshot_required';
diff --git a/api/_lib/coin/cohorts-live.test.js b/api/_lib/coin/cohorts-live.test.js
new file mode 100644
index 000000000..58d49b7eb
--- /dev/null
+++ b/api/_lib/coin/cohorts-live.test.js
@@ -0,0 +1,110 @@
+import { describe, it, expect } from 'vitest';
+import { isLiveCohort, liveCohortCounts, liveCohortMembers } from './cohorts-live.js';
+
+// A live holder set: descending balances over synthetic $THREE wallets.
+// (No DB / Helius — these are the pure derivations over an already-fetched set.)
+function makeSet(amounts) {
+ const holders = amounts
+ .map((u, i) => ({ wallet: 'THREEsynthetic' + i, units: BigInt(u) }))
+ .sort((a, b) => (b.units > a.units ? 1 : b.units < a.units ? -1 : 0));
+ const totalUnits = holders.reduce((s, h) => s + h.units, 0n);
+ return { holders, totalUnits };
+}
+
+describe('isLiveCohort', () => {
+ it('only size cohorts compute without a snapshot', () => {
+ expect(isLiveCohort('holders')).toBe(true);
+ expect(isLiveCohort('whales')).toBe(true);
+ expect(isLiveCohort('diamond-hands')).toBe(false);
+ expect(isLiveCohort('new-buyers')).toBe(false);
+ expect(isLiveCohort('exited')).toBe(false);
+ });
+});
+
+describe('liveCohortCounts', () => {
+ it('counts holders; tenure cohorts are null, never a fabricated 0', () => {
+ const { holderCount, counts, concentration } = liveCohortCounts(
+ makeSet([100, 50, 25, 10, 5, 4, 3, 2, 1, 1]),
+ {},
+ );
+ expect(holderCount).toBe(10);
+ expect(counts.holders).toBe(10);
+ expect(counts['diamond-hands']).toBeNull();
+ expect(counts['new-buyers']).toBeNull();
+ expect(counts.exited).toBeNull();
+ expect(concentration.top1Share).toBeGreaterThan(0);
+ expect(concentration.top1Share).toBeLessThanOrEqual(1);
+ expect(['none', 'healthy', 'moderate', 'high', 'very-high']).toContain(concentration.label);
+ });
+
+ it('whale slice tracks topPct', () => {
+ const set = makeSet(Array.from({ length: 100 }, (_, i) => 100 - i));
+ expect(liveCohortCounts(set, { topPct: 0.1 }).counts.whales).toBe(10);
+ expect(liveCohortCounts(set, { topPct: 0.25 }).counts.whales).toBe(25);
+ });
+
+ it('empty set → zero holders, no NaN shares', () => {
+ const { holderCount, counts, concentration } = liveCohortCounts(
+ { holders: [], totalUnits: 0n },
+ {},
+ );
+ expect(holderCount).toBe(0);
+ expect(counts.whales).toBe(0);
+ expect(concentration.top1Share).toBe(0);
+ expect(concentration.label).toBe('none');
+ });
+
+ it('top10Share = 1 when ≤10 wallets hold everything', () => {
+ expect(liveCohortCounts(makeSet([5, 5, 5, 5, 5]), {}).concentration.top10Share).toBe(1);
+ });
+});
+
+describe('liveCohortMembers', () => {
+ const set = makeSet([100, 50, 25, 10, 5, 4, 3, 2, 1, 1]);
+
+ it('holders cohort returns all, balance desc, no live tenure', () => {
+ const { members } = liveCohortMembers(set, { cohortId: 'holders', limit: 100 });
+ expect(members).toHaveLength(10);
+ expect(BigInt(members[0].balance)).toBeGreaterThanOrEqual(BigInt(members[1].balance));
+ expect(members[0].firstSeen).toBeNull();
+ });
+
+ it('whales cohort returns the top slice only', () => {
+ const { members, total } = liveCohortMembers(set, {
+ cohortId: 'whales',
+ params: { topPct: 0.2 },
+ });
+ expect(total).toBe(2);
+ expect(members).toHaveLength(2);
+ });
+
+ it('tenure cohorts throw snapshot_required', () => {
+ expect(() => liveCohortMembers(set, { cohortId: 'diamond-hands' })).toThrow(/snapshot/i);
+ });
+
+ it('limit truncates and flags it', () => {
+ const { members, truncated } = liveCohortMembers(set, { cohortId: 'holders', limit: 3 });
+ expect(members).toHaveLength(3);
+ expect(truncated).toBe(true);
+ });
+
+ it('sampling thins deterministically (~10% of 1000)', () => {
+ const big = makeSet(Array.from({ length: 1000 }, (_, i) => 1000 - i));
+ const a = liveCohortMembers(big, {
+ cohortId: 'holders',
+ limit: 1000,
+ sample: 0.1,
+ salt: 's',
+ });
+ const b = liveCohortMembers(big, {
+ cohortId: 'holders',
+ limit: 1000,
+ sample: 0.1,
+ salt: 's',
+ });
+ expect(a.total).toBe(b.total);
+ expect(a.total).toBeGreaterThan(50);
+ expect(a.total).toBeLessThan(150);
+ expect(a.sampled).toBe(true);
+ });
+});
diff --git a/api/_lib/coin/index.js b/api/_lib/coin/index.js
index c7c920ac8..5cd317f45 100644
--- a/api/_lib/coin/index.js
+++ b/api/_lib/coin/index.js
@@ -10,11 +10,7 @@ export {
sendSolTransfer,
sendSolBatched,
} from './treasury.js';
-export {
- fetchHolderBalances,
- persistHolderSnapshot,
- readEligibleHolders,
-} from './holders.js';
+export { fetchHolderBalances, persistHolderSnapshot, readEligibleHolders } from './holders.js';
export {
COHORTS,
listCohorts,
diff --git a/api/_mcp3d/catalog.js b/api/_mcp3d/catalog.js
index a2abd9fea..d257e3136 100644
--- a/api/_mcp3d/catalog.js
+++ b/api/_mcp3d/catalog.js
@@ -9,7 +9,9 @@ import { toolDefs as animationDefs } from '../_mcp/tools/animations.js';
// generated model can be analyzed in the same conversation — no duplicated
// glTF logic. validate_model is omitted: in the studio context inspect already
// covers "what is this mesh", and optimize covers "how do I ship it".
-const reusedModelDefs = modelDefs.filter((d) => d.name === 'inspect_model' || d.name === 'optimize_model');
+const reusedModelDefs = modelDefs.filter(
+ (d) => d.name === 'inspect_model' || d.name === 'optimize_model',
+);
// The animation library (list_animations + apply_animation) completes the
// pipeline: text_to_3d → auto_rig_model → apply_animation. Same retarget engine
diff --git a/api/_mcp3d/tools/studio.js b/api/_mcp3d/tools/studio.js
index 890e5871d..8033c8a59 100644
--- a/api/_mcp3d/tools/studio.js
+++ b/api/_mcp3d/tools/studio.js
@@ -189,7 +189,11 @@ function needsKeyResult(backendId) {
'or use the default image path (omit "path", or set path="image").',
},
],
- structuredContent: { status: 'needs_key', backend: backendId, provider: meta?.byok || backendId },
+ structuredContent: {
+ status: 'needs_key',
+ backend: backendId,
+ provider: meta?.byok || backendId,
+ },
isError: true,
};
}
@@ -197,7 +201,16 @@ function needsKeyResult(backendId) {
// Submit a native geometry-first job (Meshy/Tripo, BYOK) and shape the MCP
// response. Returns a needs_key result when no key is available. The job handle
// is a forge token so generation_status routes the poll back to this provider.
-async function submitGeometryJob({ req, args, backendId, isImageMode, prompt, primaryImage, tier, path }) {
+async function submitGeometryJob({
+ req,
+ args,
+ backendId,
+ isImageMode,
+ prompt,
+ primaryImage,
+ tier,
+ path,
+}) {
const providerName = BACKENDS[backendId].byok; // 'meshy' | 'tripo'
const key = await resolveProviderKey(req, args, providerName);
if (!key) return needsKeyResult(backendId);
@@ -212,7 +225,11 @@ async function submitGeometryJob({ req, args, backendId, isImageMode, prompt, pr
const submitted = isImageMode
? await gp.imageTo3d({ imageUrl: primaryImage, prompt: prompt || undefined, tier })
: await gp.textToGeometry({ prompt, tier });
- const token = encodeJobToken({ provider: providerName, kind: submitted.kind, taskId: submitted.taskId });
+ const token = encodeJobToken({
+ provider: providerName,
+ kind: submitted.kind,
+ taskId: submitted.taskId,
+ });
return {
content: [
@@ -249,11 +266,11 @@ async function pollAnyProvider(req, jobId) {
if (!key) {
return {
status: 'failed',
- error:
- 'Your provider API key is required to check this job. Send it as the x-forge-provider-key header and retry.',
+ error: 'Your provider API key is required to check this job. Send it as the x-forge-provider-key header and retry.',
};
}
- const gp = token.provider === 'tripo' ? createTripoProvider(key) : createMeshyProvider(key);
+ const gp =
+ token.provider === 'tripo' ? createTripoProvider(key) : createMeshyProvider(key);
return gp.status({ kind: token.kind, taskId: token.taskId });
}
if (token.provider === 'gcp') {
@@ -261,7 +278,10 @@ async function pollAnyProvider(req, jobId) {
try {
gcp = createGcpProvider();
} catch {
- return { status: 'failed', error: 'The self-hosted reconstruction backend is not configured.' };
+ return {
+ status: 'failed',
+ error: 'The self-hosted reconstruction backend is not configured.',
+ };
}
return gcp.status(token.taskId);
}
@@ -272,13 +292,21 @@ async function pollAnyProvider(req, jobId) {
// ── pose_model: deterministic preset selection (ported from the pose-seed tool) ─
function poseTokensOf(str) {
- return String(str || '').toLowerCase().split(/[^a-z0-9]+/g).filter(Boolean);
+ return String(str || '')
+ .toLowerCase()
+ .split(/[^a-z0-9]+/g)
+ .filter(Boolean);
}
const POSE_INDEX = PRESETS.map((preset) => {
const idTokens = poseTokensOf(preset.id);
const labelTokens = poseTokensOf(preset.label);
const groupTokens = poseTokensOf(preset.group);
- return { preset, all: new Set([...idTokens, ...labelTokens, ...groupTokens]), idTokens, labelTokens };
+ return {
+ preset,
+ all: new Set([...idTokens, ...labelTokens, ...groupTokens]),
+ idTokens,
+ labelTokens,
+ };
});
function scorePosePreset(promptTokens, entry) {
let score = 0;
@@ -286,7 +314,10 @@ function scorePosePreset(promptTokens, entry) {
if (entry.all.has(t)) score += 3;
else {
for (const tok of [...entry.idTokens, ...entry.labelTokens]) {
- if (tok.includes(t) || t.includes(tok)) { score += 1; break; }
+ if (tok.includes(t) || t.includes(tok)) {
+ score += 1;
+ break;
+ }
}
}
}
@@ -296,14 +327,21 @@ function pickPosePreset(prompt) {
const tokens = poseTokensOf(prompt);
const deterministic = () => {
const hash = createHash('sha256').update(String(prompt)).digest();
- return { entry: POSE_INDEX[hash.readUInt32BE(0) % POSE_INDEX.length], score: 0, reason: 'no-match-deterministic-pick' };
+ return {
+ entry: POSE_INDEX[hash.readUInt32BE(0) % POSE_INDEX.length],
+ score: 0,
+ reason: 'no-match-deterministic-pick',
+ };
};
if (tokens.length === 0) return deterministic();
let best = null;
let bestScore = -1;
for (const entry of POSE_INDEX) {
const sc = scorePosePreset(tokens, entry);
- if (sc > bestScore) { best = entry; bestScore = sc; }
+ if (sc > bestScore) {
+ best = entry;
+ bestScore = sc;
+ }
}
if (bestScore <= 0) return deterministic();
return { entry: best, score: bestScore, reason: 'token-match' };
@@ -345,13 +383,13 @@ export const toolDefs = [
type: 'string',
enum: ['1:1', '4:3', '3:4', '16:9', '9:16'],
default: '1:1',
- description: 'Aspect ratio of the intermediate reference image (image path only).',
- },
- tier: TIER_PROP,
- path: PATH_PROP,
- backend: BACKEND_PROP,
- __ASPECT_CLOSE__: {
+ description:
+ 'Aspect ratio of the intermediate reference image (image path only).',
},
+ tier: TIER_PROP,
+ path: PATH_PROP,
+ backend: BACKEND_PROP,
+ __ASPECT_CLOSE__: {},
},
required: ['prompt'],
additionalProperties: false,
@@ -424,14 +462,16 @@ export const toolDefs = [
image_url: {
type: 'string',
format: 'uri',
- description: 'Public https URL of the reference image (PNG/JPG/WebP). Use image_urls for multi-view.',
+ description:
+ 'Public https URL of the reference image (PNG/JPG/WebP). Use image_urls for multi-view.',
},
image_urls: {
type: 'array',
items: { type: 'string', format: 'uri' },
minItems: 1,
maxItems: 4,
- description: '1–4 public https URLs of the same object from different angles. Takes precedence over image_url; >1 enables multi-view reconstruction.',
+ description:
+ '1–4 public https URLs of the same object from different angles. Takes precedence over image_url; >1 enables multi-view reconstruction.',
},
prompt: {
type: 'string',
@@ -465,7 +505,9 @@ export const toolDefs = [
}
if (views.length === 0) {
return {
- content: [{ type: 'text', text: 'Error: provide image_url or image_urls (1–4).' }],
+ content: [
+ { type: 'text', text: 'Error: provide image_url or image_urls (1–4).' },
+ ],
isError: true,
};
}
@@ -479,7 +521,10 @@ export const toolDefs = [
if (!(await isPublicHttpsUrl(v))) {
return {
content: [
- { type: 'text', text: 'Error: every image URL must be a public https URL.' },
+ {
+ type: 'text',
+ text: 'Error: every image URL must be a public https URL.',
+ },
],
isError: true,
};
@@ -582,7 +627,9 @@ export const toolDefs = [
text:
`Segmented into ${result.partCount || result.parts.length} parts.\n` +
`Segmented GLB (each part is a named node): ${glbUrl}\n` +
- (result.manifestUrl ? `Parts manifest: ${result.manifestUrl}\n` : '') +
+ (result.manifestUrl
+ ? `Parts manifest: ${result.manifestUrl}\n`
+ : '') +
`Parts:\n${partLines}\n` +
'Display the attached text/html resource as an inline 3D artifact.',
},
@@ -617,9 +664,16 @@ export const toolDefs = [
if (result.status === 'failed') {
return {
content: [
- { type: 'text', text: `Generation failed: ${result.error || 'unknown error'}` },
+ {
+ type: 'text',
+ text: `Generation failed: ${result.error || 'unknown error'}`,
+ },
],
- structuredContent: { job_id: args.job_id, status: 'failed', error: result.error || null },
+ structuredContent: {
+ job_id: args.job_id,
+ status: 'failed',
+ error: result.error || null,
+ },
isError: true,
};
}
@@ -643,7 +697,11 @@ export const toolDefs = [
inputSchema: {
type: 'object',
properties: {
- glb_url: { type: 'string', format: 'uri', description: 'Public https URL of a .glb file.' },
+ glb_url: {
+ type: 'string',
+ format: 'uri',
+ description: 'Public https URL of a .glb file.',
+ },
auto_rotate: { type: 'boolean', default: true },
ar: { type: 'boolean', default: true },
background: {
@@ -697,7 +755,8 @@ export const toolDefs = [
type: 'string',
enum: ['rmbg2', 'u2net', 'isnet', 'u2net_human_seg', 'silueta'],
default: 'rmbg2',
- description: 'Background removal model. rmbg2 is highest quality; u2net_human_seg is optimised for people.',
+ description:
+ 'Background removal model. rmbg2 is highest quality; u2net_human_seg is optimised for people.',
},
},
required: ['image_url'],
@@ -707,7 +766,9 @@ export const toolDefs = [
await enforce(limits.mcp3dGenerate, auth);
if (!(await isPublicHttpsUrl(args.image_url))) {
return {
- content: [{ type: 'text', text: 'Error: image_url must be a public https URL.' }],
+ content: [
+ { type: 'text', text: 'Error: image_url must be a public https URL.' },
+ ],
isError: true,
};
}
@@ -752,7 +813,8 @@ export const toolDefs = [
type: 'string',
enum: ['full', 'simplify', 'repair', 'convert'],
default: 'full',
- description: 'full = repair + simplify; simplify = face reduction only; repair = hole-fill + normal fix; convert = format change only.',
+ description:
+ 'full = repair + simplify; simplify = face reduction only; repair = hole-fill + normal fix; convert = format change only.',
},
target_faces: {
type: 'integer',
@@ -765,7 +827,8 @@ export const toolDefs = [
type: 'string',
enum: ['glb', 'obj', 'stl', 'ply', 'usdz', '3mf', 'fbx'],
default: 'glb',
- description: 'Target format. fbx + operation=convert preserves a rigged GLB\'s skeleton, skin weights, and blendshapes (for Unity/Unreal); other operations produce a static fbx.',
+ description:
+ "Target format. fbx + operation=convert preserves a rigged GLB's skeleton, skin weights, and blendshapes (for Unity/Unreal); other operations produce a static fbx.",
},
},
required: ['mesh_url'],
@@ -775,7 +838,9 @@ export const toolDefs = [
await enforce(limits.mcp3dGenerate, auth);
if (!(await isPublicHttpsUrl(args.mesh_url))) {
return {
- content: [{ type: 'text', text: 'Error: mesh_url must be a public https URL.' }],
+ content: [
+ { type: 'text', text: 'Error: mesh_url must be a public https URL.' },
+ ],
isError: true,
};
}
@@ -852,7 +917,9 @@ export const toolDefs = [
await enforce(limits.mcp3dGenerate, auth);
if (!(await isPublicHttpsUrl(args.mesh_url))) {
return {
- content: [{ type: 'text', text: 'Error: mesh_url must be a public https URL.' }],
+ content: [
+ { type: 'text', text: 'Error: mesh_url must be a public https URL.' },
+ ],
isError: true,
};
}
@@ -911,26 +978,30 @@ export const toolDefs = [
minimum: 2,
maximum: 64,
default: 24,
- description: 'Upper bound on parts. Smaller fragments are merged into neighbours until the count fits.',
+ description:
+ 'Upper bound on parts. Smaller fragments are merged into neighbours until the count fits.',
},
min_part_faces: {
type: 'integer',
minimum: 4,
maximum: 100000,
default: 64,
- description: 'Parts smaller than this many faces are merged into their largest neighbour.',
+ description:
+ 'Parts smaller than this many faces are merged into their largest neighbour.',
},
crease_angle: {
type: 'number',
minimum: 5,
maximum: 170,
default: 40,
- description: 'Dihedral angle (degrees) above which a concave edge is treated as a part boundary. Lower = more parts.',
+ description:
+ 'Dihedral angle (degrees) above which a concave edge is treated as a part boundary. Lower = more parts.',
},
only_part: {
type: 'string',
maxLength: 64,
- description: 'Optional: export just this part by id ("part_03") or name ("upper-left"). Run once without it to discover part ids.',
+ description:
+ 'Optional: export just this part by id ("part_03") or name ("upper-left"). Run once without it to discover part ids.',
},
},
required: ['mesh_url'],
@@ -940,7 +1011,9 @@ export const toolDefs = [
await enforce(limits.mcp3dGenerate, auth);
if (!(await isPublicHttpsUrl(args.mesh_url))) {
return {
- content: [{ type: 'text', text: 'Error: mesh_url must be a public https URL.' }],
+ content: [
+ { type: 'text', text: 'Error: mesh_url must be a public https URL.' },
+ ],
isError: true,
};
}
@@ -992,7 +1065,8 @@ export const toolDefs = [
type: 'string',
minLength: 3,
maxLength: 500,
- description: 'Texture description, e.g. "worn leather armour, dark brown, scratched metal buckles".',
+ description:
+ 'Texture description, e.g. "worn leather armour, dark brown, scratched metal buckles".',
},
negative_prompt: {
type: 'string',
@@ -1018,7 +1092,9 @@ export const toolDefs = [
await enforce(limits.mcp3dGenerate, auth);
if (!(await isPublicHttpsUrl(args.mesh_url))) {
return {
- content: [{ type: 'text', text: 'Error: mesh_url must be a public https URL.' }],
+ content: [
+ { type: 'text', text: 'Error: mesh_url must be a public https URL.' },
+ ],
isError: true,
};
}
@@ -1054,12 +1130,12 @@ export const toolDefs = [
},
{
name: 'retexture_region',
- title: 'Repaint one masked region of a model\'s texture (magic brush)',
+ title: "Repaint one masked region of a model's texture (magic brush)",
description:
'Surgically repaint ONLY a region of an existing texture from a prompt and/or colour, ' +
'leaving the rest of the surface untouched and feathering the seam so the edit is invisible. ' +
'Real SDXL inpainting in UV space — fix a seam, recolour one panel, add a logo to a chest plate. ' +
- 'Supply mask_url: a UV-space mask PNG in the model\'s own UV layout where WHITE marks the area to ' +
+ "Supply mask_url: a UV-space mask PNG in the model's own UV layout where WHITE marks the area to " +
'repaint and black is preserved. Safe to run repeatedly — chain passes by feeding the previous ' +
'result GLB back in as mesh_url. Returns a job_id to poll with generation_status.',
inputSchema: {
@@ -1080,7 +1156,8 @@ export const toolDefs = [
prompt: {
type: 'string',
maxLength: 500,
- description: 'What to paint into the masked region, e.g. "weathered copper plate".',
+ description:
+ 'What to paint into the masked region, e.g. "weathered copper plate".',
},
color: {
type: 'string',
@@ -1102,7 +1179,8 @@ export const toolDefs = [
minimum: 0.2,
maximum: 1,
default: 0.85,
- description: 'How aggressively to regenerate the region (higher = more change).',
+ description:
+ 'How aggressively to regenerate the region (higher = more change).',
},
feather: {
type: 'integer',
@@ -1119,20 +1197,27 @@ export const toolDefs = [
await enforce(limits.mcp3dGenerate, auth);
if (!(await isPublicHttpsUrl(args.mesh_url))) {
return {
- content: [{ type: 'text', text: 'Error: mesh_url must be a public https URL.' }],
+ content: [
+ { type: 'text', text: 'Error: mesh_url must be a public https URL.' },
+ ],
isError: true,
};
}
if (!(await isPublicHttpsUrl(args.mask_url))) {
return {
- content: [{ type: 'text', text: 'Error: mask_url must be a public https URL.' }],
+ content: [
+ { type: 'text', text: 'Error: mask_url must be a public https URL.' },
+ ],
isError: true,
};
}
if (!args.prompt && !args.color) {
return {
content: [
- { type: 'text', text: 'Error: provide a prompt and/or a color for the region.' },
+ {
+ type: 'text',
+ text: 'Error: provide a prompt and/or a color for the region.',
+ },
],
isError: true,
};
@@ -1202,11 +1287,20 @@ export const toolDefs = [
const provider = regenProvider('rerig');
if (!provider.supportsMode('rerig')) {
return {
- content: [{ type: 'text', text: 'Auto-rigging is not configured on this deployment.' }],
+ content: [
+ {
+ type: 'text',
+ text: 'Auto-rigging is not configured on this deployment.',
+ },
+ ],
isError: true,
};
}
- const job = await provider.submit({ mode: 'rerig', sourceUrl: args.glb_url, params: {} });
+ const job = await provider.submit({
+ mode: 'rerig',
+ sourceUrl: args.glb_url,
+ params: {},
+ });
return {
content: [
{
@@ -1237,7 +1331,8 @@ export const toolDefs = [
type: 'string',
minLength: 1,
maxLength: 500,
- description: 'Pose description, e.g. "warrior stance", "wave hello", "sitting cross-legged".',
+ description:
+ 'Pose description, e.g. "warrior stance", "wave hello", "sitting cross-legged".',
},
},
required: ['prompt'],
@@ -1246,7 +1341,10 @@ export const toolDefs = [
async handler(args) {
const picked = pickPosePreset(args.prompt);
const preset = picked.entry.preset;
- const seed = createHash('sha256').update(`${args.prompt}|${preset.id}`).digest('hex').slice(0, 16);
+ const seed = createHash('sha256')
+ .update(`${args.prompt}|${preset.id}`)
+ .digest('hex')
+ .slice(0, 16);
const previewUrl = `${POSE_PREVIEW_BASE}?seed=${encodeURIComponent(seed)}&preset=${encodeURIComponent(preset.id)}`;
return {
content: [
@@ -1280,12 +1378,14 @@ export const toolDefs = [
type: 'string',
minLength: 1,
maxLength: 2000,
- description: 'The rough idea or prompt to optimize, e.g. "some kind of cool dragon thing".',
+ description:
+ 'The rough idea or prompt to optimize, e.g. "some kind of cool dragon thing".',
},
style: {
type: 'string',
maxLength: 200,
- description: 'Optional style hint, e.g. "low-poly", "realistic", "stylized PBR".',
+ description:
+ 'Optional style hint, e.g. "low-poly", "realistic", "stylized PBR".',
},
},
required: ['idea'],
@@ -1314,12 +1414,23 @@ export const toolDefs = [
if (!parsed || typeof parsed.prompt !== 'string') {
return {
content: [{ type: 'text', text: result.text }],
- structuredContent: { ok: true, optimized_prompt: null, raw_response: result.text, model: result.model },
+ structuredContent: {
+ ok: true,
+ optimized_prompt: null,
+ raw_response: result.text,
+ model: result.model,
+ },
};
}
return {
content: [{ type: 'text', text: `Optimized prompt: ${parsed.prompt}` }],
- structuredContent: { ok: true, optimized_prompt: parsed.prompt, spec: parsed, model: result.model, usage: result.usage },
+ structuredContent: {
+ ok: true,
+ optimized_prompt: parsed.prompt,
+ spec: parsed,
+ model: result.model,
+ usage: result.usage,
+ },
};
},
},
@@ -1335,7 +1446,8 @@ export const toolDefs = [
type: 'string',
minLength: 3,
maxLength: 500,
- description: 'Material to describe, e.g. "worn copper, scratched, slightly oxidized".',
+ description:
+ 'Material to describe, e.g. "worn copper, scratched, slightly oxidized".',
},
name: {
type: 'string',
@@ -1351,7 +1463,9 @@ export const toolDefs = [
const cfg = graniteConfigOrThrow();
const system =
'You are a 3D material author. Given a description, return ONLY a valid glTF 2.0 material JSON object with keys: "name", "pbrMetallicRoughness" { "baseColorFactor": [r,g,b,a] (0-1), "metallicFactor" (0-1), "roughnessFactor" (0-1) }, "emissiveFactor": [r,g,b] (0-1), "doubleSided" (bool), and a "_notes" string. No markdown, no prose outside the JSON.';
- const user = args.name ? `Name: ${args.name}\nMaterial: ${args.description}` : args.description;
+ const user = args.name
+ ? `Name: ${args.name}\nMaterial: ${args.description}`
+ : args.description;
const result = await watsonxChatComplete(cfg, {
messages: [
{ role: 'system', content: system },
@@ -1369,12 +1483,22 @@ export const toolDefs = [
if (!material || typeof material !== 'object') {
return {
content: [{ type: 'text', text: result.text }],
- structuredContent: { ok: true, material: null, raw_response: result.text, model: result.model },
+ structuredContent: {
+ ok: true,
+ material: null,
+ raw_response: result.text,
+ model: result.model,
+ },
};
}
if (args.name && !material.name) material.name = args.name;
return {
- content: [{ type: 'text', text: `Generated glTF material${material.name ? ` "${material.name}"` : ''}.` }],
+ content: [
+ {
+ type: 'text',
+ text: `Generated glTF material${material.name ? ` "${material.name}"` : ''}.`,
+ },
+ ],
structuredContent: { ok: true, material, model: result.model, usage: result.usage },
};
},
diff --git a/api/coin/[mint]/cohorts.js b/api/coin/[mint]/cohorts.js
index d6563b5d6..51c021723 100644
--- a/api/coin/[mint]/cohorts.js
+++ b/api/coin/[mint]/cohorts.js
@@ -110,7 +110,12 @@ async function serveLiveCohorts(req, res, { mint, agentToken }) {
set = await liveHolderSet({ mint, network });
} catch (e) {
// Helius unconfigured / RPC blip — typed, not a 500.
- return error(res, 503, 'holders_unavailable', e?.message || 'holder data is temporarily unavailable');
+ return error(
+ res,
+ 503,
+ 'holders_unavailable',
+ e?.message || 'holder data is temporarily unavailable',
+ );
}
// ── Overview: definitions + counts + concentration (public) ──────────────
diff --git a/api/forge.js b/api/forge.js
index a3ca9a1e3..6e118371f 100644
--- a/api/forge.js
+++ b/api/forge.js
@@ -217,12 +217,20 @@ async function startJob(req, res) {
// The native image→3D endpoints reconstruct from a single primary
// view; multi-view fusion stays on the image/TRELLIS path.
previewImageUrl = imageUrls[0];
- submitted = await gp.imageTo3d({ imageUrl: previewImageUrl, prompt: prompt || undefined, tier });
+ submitted = await gp.imageTo3d({
+ imageUrl: previewImageUrl,
+ prompt: prompt || undefined,
+ tier,
+ });
} else {
submitted = await gp.textToGeometry({ prompt, tier });
}
- const token = encodeJobToken({ provider: providerName, kind: submitted.kind, taskId: submitted.taskId });
+ const token = encodeJobToken({
+ provider: providerName,
+ kind: submitted.kind,
+ taskId: submitted.taskId,
+ });
// Store the upstream task id as the job handle so findByJob/materialize
// resolve it on poll, exactly like the Replicate path.
diff --git a/src/agent-detail.css b/src/agent-detail.css
index 9b0f606a4..f96be9ac7 100644
--- a/src/agent-detail.css
+++ b/src/agent-detail.css
@@ -16,18 +16,34 @@
so mirror the canonical card radius / elevation / skeleton tokens here
to keep cards and loading states consistent with the rest of the site. */
--radius-card: 14px;
- --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.30);
- --shadow-2: 0 4px 24px rgba(0, 0, 0, 0.40), 0 1px 4px rgba(0, 0, 0, 0.20);
+ --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.3);
+ --shadow-2: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
--skeleton-base: rgba(255, 255, 255, 0.04);
--skeleton-sheen: rgba(255, 255, 255, 0.08);
--skeleton-radius: 5px;
}
-* { box-sizing: border-box; }
-html, body { margin: 0; padding: 0; background: var(--ad-bg); color: var(--ad-text); font-family: 'Inter', system-ui, sans-serif; }
-a { color: inherit; text-decoration: none; }
+* {
+ box-sizing: border-box;
+}
+html,
+body {
+ margin: 0;
+ padding: 0;
+ background: var(--ad-bg);
+ color: var(--ad-text);
+ font-family: 'Inter', system-ui, sans-serif;
+}
+a {
+ color: inherit;
+ text-decoration: none;
+}
-.ad-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
+.ad-shell {
+ display: grid;
+ grid-template-columns: 220px 1fr;
+ min-height: 100vh;
+}
.ad-sidebar {
border-right: 1px solid var(--ad-line);
@@ -39,15 +55,50 @@ a { color: inherit; text-decoration: none; }
top: 0;
height: 100vh;
}
-.ad-brand { font-weight: 600; letter-spacing: 0.02em; }
-.ad-nav { display: flex; flex-direction: column; gap: 4px; }
-.ad-nav a { padding: 8px 10px; border-radius: 8px; color: var(--ad-muted); font-size: 14px; }
-.ad-nav a:hover { background: rgba(255,255,255,0.04); color: var(--ad-text); }
-.ad-nav a.active { color: var(--ad-text); background: rgba(255,255,255,0.05); }
-.ad-beta { font-size: 9px; color: var(--ad-violet); margin-left: 6px; letter-spacing: 0.1em; }
-.ad-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ad-muted); }
+.ad-brand {
+ font-weight: 600;
+ letter-spacing: 0.02em;
+}
+.ad-nav {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+.ad-nav a {
+ padding: 8px 10px;
+ border-radius: 8px;
+ color: var(--ad-muted);
+ font-size: 14px;
+}
+.ad-nav a:hover {
+ background: rgba(255, 255, 255, 0.04);
+ color: var(--ad-text);
+}
+.ad-nav a.active {
+ color: var(--ad-text);
+ background: rgba(255, 255, 255, 0.05);
+}
+.ad-beta {
+ font-size: 9px;
+ color: var(--ad-violet);
+ margin-left: 6px;
+ letter-spacing: 0.1em;
+}
+.ad-side-foot {
+ margin-top: auto;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ font-size: 13px;
+ color: var(--ad-muted);
+}
-.ad-main { padding: 0; max-width: 920px; margin: 0 auto; width: 100%; }
+.ad-main {
+ padding: 0;
+ max-width: 920px;
+ margin: 0 auto;
+ width: 100%;
+}
.ad-banner {
background: linear-gradient(90deg, #1a1a1a, #222222);
@@ -75,8 +126,14 @@ a { color: inherit; text-decoration: none; }
font-family: inherit;
font-size: 13px;
}
-.ad-search:focus { outline: none; border-color: var(--ad-line-2); }
-.ad-actions { display: flex; gap: 8px; }
+.ad-search:focus {
+ outline: none;
+ border-color: var(--ad-line-2);
+}
+.ad-actions {
+ display: flex;
+ gap: 8px;
+}
.ad-btn {
background: var(--ad-bg-2);
color: var(--ad-text);
@@ -89,11 +146,24 @@ a { color: inherit; text-decoration: none; }
display: inline-flex;
align-items: center;
}
-.ad-btn:hover { border-color: var(--ad-line-2); }
-.ad-btn-primary { background: #fff; color: #000; border-color: #fff; }
+.ad-btn:hover {
+ border-color: var(--ad-line-2);
+}
+.ad-btn-primary {
+ background: #fff;
+ color: #000;
+ border-color: #fff;
+}
-.ad-back { display: inline-block; margin: 22px 24px 8px; color: var(--ad-muted); font-size: 13px; }
-.ad-back:hover { color: var(--ad-text); }
+.ad-back {
+ display: inline-block;
+ margin: 22px 24px 8px;
+ color: var(--ad-muted);
+ font-size: 13px;
+}
+.ad-back:hover {
+ color: var(--ad-text);
+}
.ad-hero {
display: flex;
@@ -102,36 +172,82 @@ a { color: inherit; text-decoration: none; }
align-items: flex-start;
}
.ad-hero-avatar {
- width: 84px; height: 84px;
+ width: 84px;
+ height: 84px;
border-radius: 14px;
object-fit: cover;
background: var(--ad-bg-2);
border: 1px solid var(--ad-line);
flex-shrink: 0;
}
-.ad-hero-body { flex: 1; min-width: 0; }
-.ad-hero-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
-.ad-hero-title h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
+.ad-hero-body {
+ flex: 1;
+ min-width: 0;
+}
+.ad-hero-title {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ flex-wrap: wrap;
+}
+.ad-hero-title h1 {
+ margin: 0;
+ font-size: 28px;
+ font-weight: 600;
+ letter-spacing: -0.01em;
+}
.ad-status {
- display: inline-flex; align-items: center; gap: 6px;
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
background: rgba(74, 222, 128, 0.08);
color: var(--ad-green);
border: 1px solid rgba(74, 222, 128, 0.25);
- padding: 3px 10px; border-radius: 999px;
+ padding: 3px 10px;
+ border-radius: 999px;
font-size: 12px;
}
-.ad-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ad-green); }
+.ad-status::before {
+ content: '';
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: var(--ad-green);
+}
.ad-status.ad-status-inactive {
background: rgba(231, 233, 238, 0.06);
color: var(--ad-muted);
border-color: var(--ad-line-2);
}
-.ad-status.ad-status-inactive::before { background: var(--ad-dim); }
-.ad-hero-meta { display: flex; align-items: center; gap: 8px; color: var(--ad-muted); font-size: 13px; margin-top: 6px; }
-.ad-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
-.ad-dot { color: var(--ad-dim); }
-.ad-hero-desc { color: var(--ad-muted); font-size: 14px; line-height: 1.55; margin: 12px 0 10px; white-space: pre-wrap; }
-.ad-hero-trust { display: flex; gap: 8px; flex-wrap: wrap; }
+.ad-status.ad-status-inactive::before {
+ background: var(--ad-dim);
+}
+.ad-hero-meta {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ color: var(--ad-muted);
+ font-size: 13px;
+ margin-top: 6px;
+}
+.ad-mono {
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
+}
+.ad-dot {
+ color: var(--ad-dim);
+}
+.ad-hero-desc {
+ color: var(--ad-muted);
+ font-size: 14px;
+ line-height: 1.55;
+ margin: 12px 0 10px;
+ white-space: pre-wrap;
+}
+.ad-hero-trust {
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+}
.ad-card {
background: var(--ad-card);
@@ -141,8 +257,14 @@ a { color: inherit; text-decoration: none; }
margin: 12px 24px;
box-shadow: var(--shadow-1);
}
-.ad-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
-.ad-card-head h2, .ad-card-title {
+.ad-card-head {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ margin-bottom: 14px;
+}
+.ad-card-head h2,
+.ad-card-title {
margin: 0;
font-size: 12px;
letter-spacing: 0.14em;
@@ -150,62 +272,120 @@ a { color: inherit; text-decoration: none; }
color: var(--ad-text);
}
.ad-token-cta {
- display: inline-flex; align-items: center; gap: 6px;
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
margin-top: 12px;
padding: 9px 14px;
border-radius: 9px;
background: rgba(120, 200, 140, 0.16);
border: 1px solid rgba(120, 200, 140, 0.42);
color: #c6f0d6;
- font-size: 13px; font-weight: 600;
+ font-size: 13px;
+ font-weight: 600;
letter-spacing: -0.005em;
text-decoration: none;
cursor: pointer;
- transition: background 0.15s, border-color 0.15s, color 0.15s;
+ transition:
+ background 0.15s,
+ border-color 0.15s,
+ color 0.15s;
}
.ad-token-cta:hover:not(:disabled) {
background: rgba(120, 200, 140, 0.26);
border-color: rgba(120, 200, 140, 0.65);
color: #d8f5e2;
}
-.ad-token-cta:disabled { opacity: 0.55; cursor: wait; }
+.ad-token-cta:disabled {
+ opacity: 0.55;
+ cursor: wait;
+}
-.ad-bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--ad-cyan); }
-.ad-bullet-amber { background: var(--ad-amber); }
-.ad-bullet-green { background: var(--ad-green); }
-.ad-bullet-dim { background: var(--ad-dim); }
-.ad-bullet-muted { background: var(--ad-dim); }
+.ad-bullet {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: var(--ad-cyan);
+}
+.ad-bullet-amber {
+ background: var(--ad-amber);
+}
+.ad-bullet-green {
+ background: var(--ad-green);
+}
+.ad-bullet-dim {
+ background: var(--ad-dim);
+}
+.ad-bullet-muted {
+ background: var(--ad-dim);
+}
.ad-pill {
- display: inline-flex; align-items: center;
- font-size: 11px; padding: 3px 9px;
+ display: inline-flex;
+ align-items: center;
+ font-size: 11px;
+ padding: 3px 9px;
border-radius: 999px;
border: 1px solid var(--ad-line-2);
color: var(--ad-muted);
}
-.ad-pill-muted { margin-left: auto; }
-.ad-pill-amber { color: var(--ad-amber); border-color: rgba(245,165,36,0.3); background: rgba(245,165,36,0.08); }
-.ad-pill-violet { color: var(--ad-violet); border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }
-.ad-pill-green { color: var(--ad-green); border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.08); }
-.ad-pill-cyan { color: var(--ad-cyan); border-color: rgba(87,199,255,0.3); background: rgba(87,199,255,0.08); }
+.ad-pill-muted {
+ margin-left: auto;
+}
+.ad-pill-amber {
+ color: var(--ad-amber);
+ border-color: rgba(245, 165, 36, 0.3);
+ background: rgba(245, 165, 36, 0.08);
+}
+.ad-pill-violet {
+ color: var(--ad-violet);
+ border-color: rgba(255, 255, 255, 0.15);
+ background: rgba(255, 255, 255, 0.04);
+}
+.ad-pill-green {
+ color: var(--ad-green);
+ border-color: rgba(74, 222, 128, 0.3);
+ background: rgba(74, 222, 128, 0.08);
+}
+.ad-pill-cyan {
+ color: var(--ad-cyan);
+ border-color: rgba(87, 199, 255, 0.3);
+ background: rgba(87, 199, 255, 0.08);
+}
-.ad-services { display: flex; flex-direction: column; gap: 10px; }
+.ad-services {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
.ad-svc {
border: 1px solid var(--ad-line);
border-radius: 12px;
padding: 12px 14px;
- background: rgba(255,255,255,0.015);
+ background: rgba(255, 255, 255, 0.015);
+}
+.ad-svc-head {
+ display: flex;
+ gap: 10px;
+ align-items: center;
+ margin-bottom: 8px;
}
-.ad-svc-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ad-svc-tag {
- font-size: 11px; letter-spacing: 0.1em;
- padding: 3px 8px; border-radius: 6px;
- background: rgba(255,255,255,0.06);
+ font-size: 11px;
+ letter-spacing: 0.1em;
+ padding: 3px 8px;
+ border-radius: 6px;
+ background: rgba(255, 255, 255, 0.06);
color: var(--ad-text);
}
-.ad-svc-version { color: var(--ad-muted); font-size: 12px; }
+.ad-svc-version {
+ color: var(--ad-muted);
+ font-size: 12px;
+}
.ad-svc-link {
- display: flex; gap: 8px; align-items: center;
+ display: flex;
+ gap: 8px;
+ align-items: center;
background: var(--ad-bg-2);
border: 1px solid var(--ad-line);
border-radius: 8px;
@@ -215,27 +395,68 @@ a { color: inherit; text-decoration: none; }
color: var(--ad-text);
overflow: hidden;
}
-.ad-svc-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
-.ad-svc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; font-size: 12px; }
-.ad-svc-meta-label { color: var(--ad-dim); letter-spacing: 0.1em; font-size: 10px; margin-right: 4px; }
+.ad-svc-link span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ flex: 1;
+}
+.ad-svc-meta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+ margin-top: 10px;
+ align-items: center;
+ font-size: 12px;
+}
+.ad-svc-meta-label {
+ color: var(--ad-dim);
+ letter-spacing: 0.1em;
+ font-size: 10px;
+ margin-right: 4px;
+}
.ad-chip {
font-size: 11px;
padding: 3px 8px;
border-radius: 6px;
- background: rgba(255,255,255,0.05);
+ background: rgba(255, 255, 255, 0.05);
color: var(--ad-muted);
border: 1px solid var(--ad-line);
}
-.ad-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
-.ad-row-split { justify-content: space-between; }
-.ad-balance { font-size: 14px; margin-top: 8px; }
-.ad-muted { color: var(--ad-muted); font-size: 13px; }
+.ad-row {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 6px 0;
+}
+.ad-row-split {
+ justify-content: space-between;
+}
+.ad-balance {
+ font-size: 14px;
+ margin-top: 8px;
+}
+.ad-muted {
+ color: var(--ad-muted);
+ font-size: 13px;
+}
-.ad-sub { font-size: 10px; letter-spacing: 0.16em; color: var(--ad-dim); margin: 12px 0 8px; }
-.ad-trust-pills { display: flex; gap: 8px; flex-wrap: wrap; }
+.ad-sub {
+ font-size: 10px;
+ letter-spacing: 0.16em;
+ color: var(--ad-dim);
+ margin: 12px 0 8px;
+}
+.ad-trust-pills {
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+}
-.ad-collapse { padding: 0; }
+.ad-collapse {
+ padding: 0;
+}
.ad-collapse summary {
list-style: none;
cursor: pointer;
@@ -244,8 +465,14 @@ a { color: inherit; text-decoration: none; }
align-items: center;
gap: 10px;
}
-.ad-collapse summary::-webkit-details-marker { display: none; }
-.ad-collapse summary::after { content: '⌄'; margin-left: auto; color: var(--ad-muted); }
+.ad-collapse summary::-webkit-details-marker {
+ display: none;
+}
+.ad-collapse summary::after {
+ content: '⌄';
+ margin-left: auto;
+ color: var(--ad-muted);
+}
.ad-raw {
margin: 0;
padding: 0 20px 18px;
@@ -258,9 +485,19 @@ a { color: inherit; text-decoration: none; }
overflow: auto;
}
-.ad-protocols { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
+.ad-protocols {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 6px;
+ margin-top: 4px;
+}
-.ad-cta-row { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
+.ad-cta-row {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ margin-top: 16px;
+}
.ad-cta {
display: block;
text-align: center;
@@ -270,30 +507,47 @@ a { color: inherit; text-decoration: none; }
font-size: 13px;
color: var(--ad-text);
}
-.ad-cta:hover { background: rgba(255,255,255,0.03); }
+.ad-cta:hover {
+ background: rgba(255, 255, 255, 0.03);
+}
.ad-copy {
- background: transparent; border: none; cursor: pointer;
- color: var(--ad-dim); font-size: 13px; padding: 2px 4px;
+ background: transparent;
+ border: none;
+ cursor: pointer;
+ color: var(--ad-dim);
+ font-size: 13px;
+ padding: 2px 4px;
+}
+.ad-copy:hover {
+ color: var(--ad-text);
}
-.ad-copy:hover { color: var(--ad-text); }
.ad-foot {
- display: flex; justify-content: space-between;
+ display: flex;
+ justify-content: space-between;
padding: 30px 24px;
color: var(--ad-dim);
font-size: 12px;
border-top: 1px solid var(--ad-line);
margin-top: 20px;
}
-.ad-foot a:hover { color: var(--ad-text); }
+.ad-foot a:hover {
+ color: var(--ad-text);
+}
@media (max-width: 760px) {
- .ad-shell { grid-template-columns: 1fr; }
- .ad-sidebar { display: none; }
+ .ad-shell {
+ grid-template-columns: 1fr;
+ }
+ .ad-sidebar {
+ display: none;
+ }
}
-.ad-bullet-red { background: var(--danger); }
+.ad-bullet-red {
+ background: var(--danger);
+}
.ad-pill-live {
color: var(--danger);
border-color: rgba(248, 113, 113, 0.3);
@@ -352,9 +606,16 @@ a { color: inherit; text-decoration: none; }
word-break: break-all;
}
-.ad-resolved.ok { color: #81c784; }
-.ad-resolved.warn { color: #ff8a80; }
-.ad-resolved.loading { color: var(--ad-muted); font-style: italic; }
+.ad-resolved.ok {
+ color: #81c784;
+}
+.ad-resolved.warn {
+ color: #ff8a80;
+}
+.ad-resolved.loading {
+ color: var(--ad-muted);
+ font-style: italic;
+}
/* ── Reviews ─────────────────────────────────────────────────────────────── */
@@ -408,7 +669,7 @@ a { color: inherit; text-decoration: none; }
.ad-reviews-bar-track {
flex: 1;
height: 6px;
- background: rgba(255,255,255,0.08);
+ background: rgba(255, 255, 255, 0.08);
border-radius: 3px;
overflow: hidden;
}
@@ -426,12 +687,16 @@ a { color: inherit; text-decoration: none; }
/* star widget */
.ad-star {
font-size: 16px;
- color: rgba(255,255,255,0.2);
+ color: rgba(255, 255, 255, 0.2);
transition: color 0.1s;
user-select: none;
}
-.ad-star.filled { color: var(--ad-amber); }
-.ad-star.half { color: var(--ad-amber); }
+.ad-star.filled {
+ color: var(--ad-amber);
+}
+.ad-star.half {
+ color: var(--ad-amber);
+}
/* write-review form */
.ad-review-form {
@@ -455,9 +720,13 @@ a { color: inherit; text-decoration: none; }
.ad-review-star-picker .ad-star {
font-size: 24px;
cursor: pointer;
- transition: transform 0.1s, color 0.1s;
+ transition:
+ transform 0.1s,
+ color 0.1s;
+}
+.ad-review-star-picker .ad-star:hover {
+ transform: scale(1.15);
}
-.ad-review-star-picker .ad-star:hover { transform: scale(1.15); }
.ad-review-textarea {
width: 100%;
background: var(--ad-bg);
@@ -472,7 +741,10 @@ a { color: inherit; text-decoration: none; }
box-sizing: border-box;
transition: border-color 0.15s;
}
-.ad-review-textarea:focus { outline: none; border-color: var(--ad-line-2); }
+.ad-review-textarea:focus {
+ outline: none;
+ border-color: var(--ad-line-2);
+}
.ad-review-form-footer {
display: flex;
justify-content: space-between;
@@ -499,8 +771,13 @@ a { color: inherit; text-decoration: none; }
cursor: pointer;
transition: opacity 0.15s;
}
-.ad-review-submit:disabled { opacity: 0.45; cursor: default; }
-.ad-review-submit:not(:disabled):hover { opacity: 0.88; }
+.ad-review-submit:disabled {
+ opacity: 0.45;
+ cursor: default;
+}
+.ad-review-submit:not(:disabled):hover {
+ opacity: 0.88;
+}
.ad-review-delete {
background: transparent;
color: var(--ad-muted);
@@ -511,14 +788,19 @@ a { color: inherit; text-decoration: none; }
font-size: 13px;
cursor: pointer;
}
-.ad-review-delete:hover { color: #ff8a80; border-color: #ff8a80; }
+.ad-review-delete:hover {
+ color: #ff8a80;
+ border-color: #ff8a80;
+}
/* review list */
.ad-review-item {
padding: 16px 0;
border-bottom: 1px solid var(--ad-line);
}
-.ad-review-item:last-child { border-bottom: none; }
+.ad-review-item:last-child {
+ border-bottom: none;
+}
.ad-review-item-head {
display: flex;
align-items: center;
@@ -558,7 +840,9 @@ a { color: inherit; text-decoration: none; }
display: flex;
gap: 2px;
}
-.ad-review-item-stars .ad-star { font-size: 13px; }
+.ad-review-item-stars .ad-star {
+ font-size: 13px;
+}
.ad-review-body {
font-size: 13px;
color: var(--ad-text);
@@ -582,8 +866,14 @@ a { color: inherit; text-decoration: none; }
font-family: inherit;
cursor: pointer;
}
-.ad-review-mine-btn:hover { color: var(--ad-text); border-color: var(--ad-line-2); }
-.ad-review-mine-btn.danger:hover { color: #ff8a80; border-color: #ff8a80; }
+.ad-review-mine-btn:hover {
+ color: var(--ad-text);
+ border-color: var(--ad-line-2);
+}
+.ad-review-mine-btn.danger:hover {
+ color: #ff8a80;
+ border-color: #ff8a80;
+}
.ad-reviews-empty {
padding: 28px 0;
@@ -644,10 +934,15 @@ a { color: inherit; text-decoration: none; }
height: 12px;
border-radius: 6px;
}
-.ad-review-skel-line.short { width: 40%; }
-.ad-review-skel-line.med { width: 70%; }
-.ad-review-skel-line.long { width: 90%; }
-
+.ad-review-skel-line.short {
+ width: 40%;
+}
+.ad-review-skel-line.med {
+ width: 70%;
+}
+.ad-review-skel-line.long {
+ width: 90%;
+}
/* ───────────────────────────────────────────────────────────────────────────
Marketplace-feature enrichment (agent-detail-market.js)
@@ -687,8 +982,15 @@ a { color: inherit; text-decoration: none; }
cursor: pointer;
border-bottom: 1px dashed var(--ad-line-2);
}
-.ad-author-btn:hover:not(:disabled) { color: #fff; border-bottom-color: var(--ad-text); }
-.ad-author-btn:disabled { cursor: default; border-bottom: 0; color: var(--ad-muted); }
+.ad-author-btn:hover:not(:disabled) {
+ color: #fff;
+ border-bottom-color: var(--ad-text);
+}
+.ad-author-btn:disabled {
+ cursor: default;
+ border-bottom: 0;
+ color: var(--ad-muted);
+}
.ad-cat-pill,
.ad-stat-pill {
display: inline-flex;
@@ -702,11 +1004,22 @@ a { color: inherit; text-decoration: none; }
}
/* Hero actions */
-.ad-market-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
-#ad-bookmark.on { color: var(--ad-amber); border-color: rgba(245,165,36,0.4); }
+.ad-market-actions {
+ display: inline-flex;
+ gap: 8px;
+ flex-wrap: wrap;
+}
+#ad-bookmark.on {
+ color: var(--ad-amber);
+ border-color: rgba(245, 165, 36, 0.4);
+}
/* ── Live preview ──────────────────────────────────────────────────────── */
-.ad-preview-hint { margin-left: auto; font-size: 12px; color: var(--ad-dim); }
+.ad-preview-hint {
+ margin-left: auto;
+ font-size: 12px;
+ color: var(--ad-dim);
+}
.ad-preview-thread {
display: flex;
flex-direction: column;
@@ -716,9 +1029,15 @@ a { color: inherit; text-decoration: none; }
padding: 4px 2px;
margin-bottom: 12px;
}
-.market-preview-msg { display: flex; }
-.market-preview-msg.user { justify-content: flex-end; }
-.market-preview-msg.assistant { justify-content: flex-start; }
+.market-preview-msg {
+ display: flex;
+}
+.market-preview-msg.user {
+ justify-content: flex-end;
+}
+.market-preview-msg.assistant {
+ justify-content: flex-start;
+}
.market-preview-bubble {
max-width: 80%;
padding: 9px 13px;
@@ -744,10 +1063,22 @@ a { color: inherit; text-decoration: none; }
animation: ad-blink 1s steps(2) infinite;
margin-left: 1px;
}
-@keyframes ad-blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }
-.ad-preview-form { display: flex; gap: 8px; }
-.ad-preview-input {
- flex: 1;
+@keyframes ad-blink {
+ 0%,
+ 50% {
+ opacity: 1;
+ }
+ 50.01%,
+ 100% {
+ opacity: 0;
+ }
+}
+.ad-preview-form {
+ display: flex;
+ gap: 8px;
+}
+.ad-preview-input {
+ flex: 1;
min-width: 0;
padding: 10px 13px;
border-radius: 10px;
@@ -757,9 +1088,19 @@ a { color: inherit; text-decoration: none; }
font: inherit;
font-size: 14px;
}
-.ad-preview-input:focus { outline: none; border-color: var(--ad-text); }
-.ad-preview-footer { margin-top: 8px; font-size: 12px; color: var(--ad-dim); min-height: 14px; }
-.ad-preview-footer.err { color: #ff6b6b; }
+.ad-preview-input:focus {
+ outline: none;
+ border-color: var(--ad-text);
+}
+.ad-preview-footer {
+ margin-top: 8px;
+ font-size: 12px;
+ color: var(--ad-dim);
+ min-height: 14px;
+}
+.ad-preview-footer.err {
+ color: #ff6b6b;
+}
/* ── Skills & pricing ──────────────────────────────────────────────────── */
.ad-pricing-summary {
@@ -769,15 +1110,17 @@ a { color: inherit; text-decoration: none; }
padding: 8px 12px;
margin-bottom: 12px;
border-radius: 10px;
- background: rgba(245,165,36,0.08);
- border: 1px solid rgba(245,165,36,0.2);
+ background: rgba(245, 165, 36, 0.08);
+ border: 1px solid rgba(245, 165, 36, 0.2);
font-size: 13px;
color: var(--ad-text);
}
.ad-pricing-icon {
display: inline-flex;
- width: 18px; height: 18px;
- align-items: center; justify-content: center;
+ width: 18px;
+ height: 18px;
+ align-items: center;
+ justify-content: center;
border-radius: 50%;
background: var(--ad-amber);
color: #000;
@@ -792,9 +1135,21 @@ a { color: inherit; text-decoration: none; }
padding: 10px 0;
border-bottom: 1px solid var(--ad-line);
}
-.ad-skill-row:last-child { border-bottom: 0; }
-.ad-skill-name { font-size: 14px; color: var(--ad-text); font-weight: 500; }
-.ad-skill-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
+.ad-skill-row:last-child {
+ border-bottom: 0;
+}
+.ad-skill-name {
+ font-size: 14px;
+ color: var(--ad-text);
+ font-weight: 500;
+}
+.ad-skill-actions {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ margin-left: auto;
+ flex-wrap: wrap;
+}
.ad-price-badge {
display: inline-flex;
padding: 3px 10px;
@@ -803,9 +1158,19 @@ a { color: inherit; text-decoration: none; }
font-weight: 600;
border: 1px solid var(--ad-line-2);
}
-.ad-price-badge.free { color: var(--ad-green); border-color: rgba(74,222,128,0.3); }
-.ad-price-badge.paid { color: var(--ad-amber); border-color: rgba(245,165,36,0.35); }
-.ad-price-badge.owned { color: var(--ad-green); border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.08); }
+.ad-price-badge.free {
+ color: var(--ad-green);
+ border-color: rgba(74, 222, 128, 0.3);
+}
+.ad-price-badge.paid {
+ color: var(--ad-amber);
+ border-color: rgba(245, 165, 36, 0.35);
+}
+.ad-price-badge.owned {
+ color: var(--ad-green);
+ border-color: rgba(74, 222, 128, 0.3);
+ background: rgba(74, 222, 128, 0.08);
+}
.ad-skill-btn {
padding: 5px 12px;
border-radius: 8px;
@@ -816,18 +1181,48 @@ a { color: inherit; text-decoration: none; }
font-size: 12px;
font-weight: 600;
cursor: pointer;
- transition: background 0.15s, border-color 0.15s;
+ transition:
+ background 0.15s,
+ border-color 0.15s;
+}
+.ad-skill-btn:hover {
+ background: rgba(255, 255, 255, 0.06);
+ border-color: var(--ad-text);
+}
+.ad-skill-btn.purchase-btn {
+ background: var(--ad-text);
+ color: var(--ad-bg);
+ border-color: var(--ad-text);
+}
+.ad-skill-btn.purchase-btn:hover {
+ background: #fff;
+}
+#ad-pricing-library {
+ margin-top: 14px;
}
-.ad-skill-btn:hover { background: rgba(255,255,255,0.06); border-color: var(--ad-text); }
-.ad-skill-btn.purchase-btn { background: var(--ad-text); color: var(--ad-bg); border-color: var(--ad-text); }
-.ad-skill-btn.purchase-btn:hover { background: #fff; }
-#ad-pricing-library { margin-top: 14px; }
/* ── Sale / ownership panel ────────────────────────────────────────────── */
-.ad-sale-eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ad-muted); }
-.ad-sale-price { font-size: 24px; font-weight: 700; margin: 4px 0 14px; color: var(--ad-text); }
-.ad-sale-price.free { color: var(--ad-green); }
-.ad-sale-field { display: block; font-size: 12px; color: var(--ad-muted); margin-bottom: 12px; }
+.ad-sale-eyebrow {
+ font-size: 12px;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--ad-muted);
+}
+.ad-sale-price {
+ font-size: 24px;
+ font-weight: 700;
+ margin: 4px 0 14px;
+ color: var(--ad-text);
+}
+.ad-sale-price.free {
+ color: var(--ad-green);
+}
+.ad-sale-field {
+ display: block;
+ font-size: 12px;
+ color: var(--ad-muted);
+ margin-bottom: 12px;
+}
.ad-sale-field input {
display: block;
width: 100%;
@@ -841,26 +1236,63 @@ a { color: inherit; text-decoration: none; }
font: inherit;
font-size: 14px;
}
-.ad-sale-field input:focus { outline: none; border-color: var(--ad-text); }
-.ad-sale-input-wrap { position: relative; display: block; }
+.ad-sale-field input:focus {
+ outline: none;
+ border-color: var(--ad-text);
+}
+.ad-sale-input-wrap {
+ position: relative;
+ display: block;
+}
.ad-sale-currency {
position: absolute;
- right: 12px; top: 50%;
+ right: 12px;
+ top: 50%;
transform: translateY(-50%);
font-size: 12px;
color: var(--ad-dim);
margin-top: 2px;
}
-.ad-sale-actions { display: flex; gap: 8px; margin-top: 4px; }
-.ad-sale-status { font-size: 13px; margin: 10px 0 0; min-height: 16px; }
-.ad-sale-status.err { color: #ff6b6b; }
-.ad-sale-status.ok { color: var(--ad-green); }
-.ad-sale-hint { font-size: 12px; color: var(--ad-dim); margin: 8px 0 0; line-height: 1.5; }
+.ad-sale-actions {
+ display: flex;
+ gap: 8px;
+ margin-top: 4px;
+}
+.ad-sale-status {
+ font-size: 13px;
+ margin: 10px 0 0;
+ min-height: 16px;
+}
+.ad-sale-status.err {
+ color: #ff6b6b;
+}
+.ad-sale-status.ok {
+ color: var(--ad-green);
+}
+.ad-sale-hint {
+ font-size: 12px;
+ color: var(--ad-dim);
+ margin: 8px 0 0;
+ line-height: 1.5;
+}
/* ── Embed ─────────────────────────────────────────────────────────────── */
-.ad-embed-lede { font-size: 13px; color: var(--ad-muted); margin: 0 0 16px; }
-.ad-embed-section { margin-bottom: 14px; }
-.ad-embed-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--ad-muted); }
+.ad-embed-lede {
+ font-size: 13px;
+ color: var(--ad-muted);
+ margin: 0 0 16px;
+}
+.ad-embed-section {
+ margin-bottom: 14px;
+}
+.ad-embed-label {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 6px;
+ font-size: 12px;
+ color: var(--ad-muted);
+}
.ad-embed-copy {
padding: 3px 11px;
border-radius: 7px;
@@ -872,8 +1304,13 @@ a { color: inherit; text-decoration: none; }
font-weight: 600;
cursor: pointer;
}
-.ad-embed-copy:hover { background: rgba(255,255,255,0.06); }
-.ad-embed-copy.copied { color: var(--ad-green); border-color: rgba(74,222,128,0.3); }
+.ad-embed-copy:hover {
+ background: rgba(255, 255, 255, 0.06);
+}
+.ad-embed-copy.copied {
+ color: var(--ad-green);
+ border-color: rgba(74, 222, 128, 0.3);
+}
.ad-embed-code {
margin: 0;
padding: 12px 14px;
@@ -889,7 +1326,11 @@ a { color: inherit; text-decoration: none; }
}
/* ── Version history ───────────────────────────────────────────────────── */
-.ad-versions { list-style: none; margin: 0; padding: 0; }
+.ad-versions {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
.ad-version-row {
display: grid;
grid-template-columns: auto 1fr auto;
@@ -898,10 +1339,23 @@ a { color: inherit; text-decoration: none; }
padding: 10px 0;
border-bottom: 1px solid var(--ad-line);
}
-.ad-version-row:last-child { border-bottom: 0; }
-.ad-version-tag { font-family: 'SF Mono', ui-monospace, monospace; font-size: 12px; color: var(--ad-amber); }
-.ad-version-log { font-size: 13px; color: var(--ad-text); }
-.ad-version-when { font-size: 12px; color: var(--ad-dim); white-space: nowrap; }
+.ad-version-row:last-child {
+ border-bottom: 0;
+}
+.ad-version-tag {
+ font-family: 'SF Mono', ui-monospace, monospace;
+ font-size: 12px;
+ color: var(--ad-amber);
+}
+.ad-version-log {
+ font-size: 13px;
+ color: var(--ad-text);
+}
+.ad-version-when {
+ font-size: 12px;
+ color: var(--ad-dim);
+ white-space: nowrap;
+}
/* ── Similar agents ────────────────────────────────────────────────────── */
.ad-similar-grid {
@@ -917,9 +1371,14 @@ a { color: inherit; text-decoration: none; }
border-radius: 12px;
background: var(--ad-bg-2);
border: 1px solid var(--ad-line);
- transition: border-color 0.15s, transform 0.15s;
+ transition:
+ border-color 0.15s,
+ transform 0.15s;
+}
+.ad-similar-item:hover {
+ border-color: var(--ad-line-2);
+ transform: translateY(-2px);
}
-.ad-similar-item:hover { border-color: var(--ad-line-2); transform: translateY(-2px); }
.ad-similar-thumb {
width: 100%;
aspect-ratio: 1;
@@ -933,25 +1392,44 @@ a { color: inherit; text-decoration: none; }
color: var(--ad-muted);
margin-bottom: 9px;
}
-.ad-similar-name { font-size: 13px; font-weight: 600; color: var(--ad-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
-.ad-similar-meta { font-size: 11px; color: var(--ad-dim); margin-top: 3px; }
+.ad-similar-name {
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--ad-text);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.ad-similar-meta {
+ font-size: 11px;
+ color: var(--ad-dim);
+ margin-top: 3px;
+}
/* ── Creator modal ─────────────────────────────────────────────────────── */
.creator-modal-overlay {
- position: fixed; inset: 0; z-index: 1000;
- display: flex; align-items: center; justify-content: center;
+ position: fixed;
+ inset: 0;
+ z-index: 1000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
padding: 20px;
- background: rgba(0,0,0,0.7);
+ background: rgba(0, 0, 0, 0.7);
opacity: 0;
transition: opacity 0.2s;
-webkit-backdrop-filter: blur(4px);
backdrop-filter: blur(4px);
}
-.creator-modal-overlay.show { opacity: 1; }
+.creator-modal-overlay.show {
+ opacity: 1;
+}
/* Without this the unconditional `display:flex` above defeats the `hidden`
attribute, leaving an invisible (opacity:0) full-viewport layer that swallows
every click on the page. */
-.creator-modal-overlay[hidden] { display: none; }
+.creator-modal-overlay[hidden] {
+ display: none;
+}
.creator-modal {
position: relative;
width: min(720px, 100%);
@@ -964,8 +1442,11 @@ a { color: inherit; text-decoration: none; }
box-shadow: var(--shadow-2);
}
.creator-modal-close {
- position: absolute; top: 14px; right: 14px;
- width: 30px; height: 30px;
+ position: absolute;
+ top: 14px;
+ right: 14px;
+ width: 30px;
+ height: 30px;
border-radius: 8px;
border: 1px solid var(--ad-line);
background: var(--ad-bg-2);
@@ -973,50 +1454,128 @@ a { color: inherit; text-decoration: none; }
font-size: 18px;
cursor: pointer;
}
-.creator-modal-close:hover { background: rgba(255,255,255,0.06); }
-.creator-modal-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
+.creator-modal-close:hover {
+ background: rgba(255, 255, 255, 0.06);
+}
+.creator-modal-head {
+ display: flex;
+ gap: 16px;
+ align-items: center;
+ margin-bottom: 22px;
+}
.creator-modal-avatar {
- width: 64px; height: 64px;
+ width: 64px;
+ height: 64px;
border-radius: 50%;
background: var(--ad-bg-2) center/cover no-repeat;
- display: flex; align-items: center; justify-content: center;
- font-size: 26px; font-weight: 700; color: var(--ad-muted);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 26px;
+ font-weight: 700;
+ color: var(--ad-muted);
flex-shrink: 0;
}
-.creator-modal-eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ad-dim); }
-.creator-modal-title { margin: 2px 0 0; font-size: 22px; color: var(--ad-text); }
-.creator-modal-handle { font-size: 13px; color: var(--ad-muted); margin-top: 2px; }
-.creator-modal-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--ad-muted); }
-.creator-modal-stats strong { color: var(--ad-text); margin-right: 4px; }
-.creator-modal-body { display: grid; gap: 22px; }
-.creator-modal-sectiontitle { font-size: 13px; color: var(--ad-text); margin: 0 0 12px; }
-.creator-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
+.creator-modal-eyebrow {
+ font-size: 11px;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--ad-dim);
+}
+.creator-modal-title {
+ margin: 2px 0 0;
+ font-size: 22px;
+ color: var(--ad-text);
+}
+.creator-modal-handle {
+ font-size: 13px;
+ color: var(--ad-muted);
+ margin-top: 2px;
+}
+.creator-modal-stats {
+ display: flex;
+ gap: 16px;
+ margin-top: 8px;
+ font-size: 12px;
+ color: var(--ad-muted);
+}
+.creator-modal-stats strong {
+ color: var(--ad-text);
+ margin-right: 4px;
+}
+.creator-modal-body {
+ display: grid;
+ gap: 22px;
+}
+.creator-modal-sectiontitle {
+ font-size: 13px;
+ color: var(--ad-text);
+ margin: 0 0 12px;
+}
+.creator-modal-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
+ gap: 12px;
+}
.creator-mini-card {
padding: 10px;
border-radius: 11px;
background: var(--ad-bg-2);
border: 1px solid var(--ad-line);
cursor: pointer;
- transition: border-color 0.15s, transform 0.15s;
+ transition:
+ border-color 0.15s,
+ transform 0.15s;
+}
+.creator-mini-card:hover {
+ border-color: var(--ad-line-2);
+ transform: translateY(-2px);
}
-.creator-mini-card:hover { border-color: var(--ad-line-2); transform: translateY(-2px); }
.creator-mini-card .thumb {
- width: 100%; aspect-ratio: 1; border-radius: 8px;
+ width: 100%;
+ aspect-ratio: 1;
+ border-radius: 8px;
background: var(--ad-bg) center/cover no-repeat;
- display: flex; align-items: center; justify-content: center;
- font-size: 22px; font-weight: 700; color: var(--ad-muted);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 22px;
+ font-weight: 700;
+ color: var(--ad-muted);
margin-bottom: 8px;
}
-.creator-mini-card .name { font-size: 12px; font-weight: 600; color: var(--ad-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
-.creator-mini-card .meta { font-size: 10px; color: var(--ad-dim); margin-top: 3px; display: flex; gap: 5px; flex-wrap: wrap; }
-.market-empty { font-size: 13px; color: var(--ad-dim); padding: 8px 0; }
+.creator-mini-card .name {
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--ad-text);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.creator-mini-card .meta {
+ font-size: 10px;
+ color: var(--ad-dim);
+ margin-top: 3px;
+ display: flex;
+ gap: 5px;
+ flex-wrap: wrap;
+}
+.market-empty {
+ font-size: 13px;
+ color: var(--ad-dim);
+ padding: 8px 0;
+}
/* ── Payment modal (shared engine) ─────────────────────────────────────── */
.market-modal-overlay {
- position: fixed; inset: 0; z-index: 1100;
- display: flex; align-items: center; justify-content: center;
+ position: fixed;
+ inset: 0;
+ z-index: 1100;
+ display: flex;
+ align-items: center;
+ justify-content: center;
padding: 20px;
- background: rgba(0,0,0,0.72);
+ background: rgba(0, 0, 0, 0.72);
-webkit-backdrop-filter: blur(4px);
backdrop-filter: blur(4px);
}
@@ -1024,7 +1583,9 @@ a { color: inherit; text-decoration: none; }
toggled via overlay.hidden. Without this, the unconditional `display:flex`
above overrides the UA `[hidden]{display:none}` rule and the (blank) modal
shows on page load. */
-.market-modal-overlay[hidden] { display: none; }
+.market-modal-overlay[hidden] {
+ display: none;
+}
.market-modal {
position: relative;
width: min(440px, 100%);
@@ -1034,93 +1595,270 @@ a { color: inherit; text-decoration: none; }
box-shadow: var(--shadow-2);
overflow: hidden;
}
-.market-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--ad-line); }
-.market-modal-head h2 { margin: 0; font-size: 17px; color: var(--ad-text); }
+.market-modal-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 18px 20px;
+ border-bottom: 1px solid var(--ad-line);
+}
+.market-modal-head h2 {
+ margin: 0;
+ font-size: 17px;
+ color: var(--ad-text);
+}
.market-modal-close {
- width: 30px; height: 30px; border-radius: 8px;
- border: 1px solid var(--ad-line); background: var(--ad-bg-2);
- color: var(--ad-text); font-size: 18px; cursor: pointer;
+ width: 30px;
+ height: 30px;
+ border-radius: 8px;
+ border: 1px solid var(--ad-line);
+ background: var(--ad-bg-2);
+ color: var(--ad-text);
+ font-size: 18px;
+ cursor: pointer;
+}
+.market-modal-close:hover {
+ background: rgba(255, 255, 255, 0.06);
+}
+.payment-modal-body {
+ padding: 20px;
}
-.market-modal-close:hover { background: rgba(255,255,255,0.06); }
-.payment-modal-body { padding: 20px; }
.payment-modal-badge {
- display: flex; gap: 8px; align-items: flex-start;
- padding: 9px 12px; border-radius: 9px; margin-bottom: 14px;
- font-size: 12px; line-height: 1.5;
- background: var(--ad-bg-2); border: 1px solid var(--ad-line);
+ display: flex;
+ gap: 8px;
+ align-items: flex-start;
+ padding: 9px 12px;
+ border-radius: 9px;
+ margin-bottom: 14px;
+ font-size: 12px;
+ line-height: 1.5;
+ background: var(--ad-bg-2);
+ border: 1px solid var(--ad-line);
color: var(--ad-muted);
}
-.payment-modal-badge.warn { background: rgba(245,165,36,0.08); border-color: rgba(245,165,36,0.25); color: var(--ad-text); }
-#payment-modal-lede { font-size: 13px; color: var(--ad-muted); margin: 0 0 12px; }
+.payment-modal-badge.warn {
+ background: rgba(245, 165, 36, 0.08);
+ border-color: rgba(245, 165, 36, 0.25);
+ color: var(--ad-text);
+}
+#payment-modal-lede {
+ font-size: 13px;
+ color: var(--ad-muted);
+ margin: 0 0 12px;
+}
.payment-item {
- display: flex; flex-direction: column; gap: 2px;
- padding: 12px 14px; border-radius: 10px;
- background: var(--ad-bg-2); border: 1px solid var(--ad-line);
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ padding: 12px 14px;
+ border-radius: 10px;
+ background: var(--ad-bg-2);
+ border: 1px solid var(--ad-line);
margin-bottom: 12px;
}
-.payment-item strong { font-size: 15px; color: var(--ad-text); }
-.payment-item span { font-size: 11px; color: var(--ad-dim); }
-.payment-item em { font-size: 13px; color: var(--ad-muted); font-style: normal; }
+.payment-item strong {
+ font-size: 15px;
+ color: var(--ad-text);
+}
+.payment-item span {
+ font-size: 11px;
+ color: var(--ad-dim);
+}
+.payment-item em {
+ font-size: 13px;
+ color: var(--ad-muted);
+ font-style: normal;
+}
.payment-price {
- display: flex; align-items: center; justify-content: space-between;
- padding: 12px 0; margin-bottom: 14px;
- border-top: 1px solid var(--ad-line); border-bottom: 1px solid var(--ad-line);
-}
-.payment-price span { font-size: 13px; color: var(--ad-muted); }
-.payment-price strong { font-size: 18px; color: var(--ad-text); }
-.payment-wallet-area { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
-.payment-wallet-area p { margin: 0; font-size: 13px; color: var(--ad-muted); }
-.payment-wallet-area p.small { font-size: 11px; color: var(--ad-dim); }
-.payment-wallet-area a { color: var(--ad-text); }
-.btn-primary, .payment-confirm-btn {
- width: 100%; padding: 11px 16px; border-radius: 10px;
- border: 1px solid var(--ad-text); background: var(--ad-text); color: var(--ad-bg);
- font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 12px 0;
+ margin-bottom: 14px;
+ border-top: 1px solid var(--ad-line);
+ border-bottom: 1px solid var(--ad-line);
+}
+.payment-price span {
+ font-size: 13px;
+ color: var(--ad-muted);
+}
+.payment-price strong {
+ font-size: 18px;
+ color: var(--ad-text);
+}
+.payment-wallet-area {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ margin-bottom: 14px;
+}
+.payment-wallet-area p {
+ margin: 0;
+ font-size: 13px;
+ color: var(--ad-muted);
+}
+.payment-wallet-area p.small {
+ font-size: 11px;
+ color: var(--ad-dim);
+}
+.payment-wallet-area a {
+ color: var(--ad-text);
+}
+.btn-primary,
+.payment-confirm-btn {
+ width: 100%;
+ padding: 11px 16px;
+ border-radius: 10px;
+ border: 1px solid var(--ad-text);
+ background: var(--ad-text);
+ color: var(--ad-bg);
+ font: inherit;
+ font-size: 14px;
+ font-weight: 600;
+ cursor: pointer;
+ text-align: center;
+ text-decoration: none;
box-sizing: border-box;
}
-.btn-primary:hover, .payment-confirm-btn:hover { background: #fff; }
-.btn-primary:disabled, .payment-confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
+.btn-primary:hover,
+.payment-confirm-btn:hover {
+ background: #fff;
+}
+.btn-primary:disabled,
+.payment-confirm-btn:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
.btn-secondary {
- width: 100%; padding: 11px 16px; border-radius: 10px;
- border: 1px solid var(--ad-line-2); background: var(--ad-bg-2); color: var(--ad-text);
- font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none;
+ width: 100%;
+ padding: 11px 16px;
+ border-radius: 10px;
+ border: 1px solid var(--ad-line-2);
+ background: var(--ad-bg-2);
+ color: var(--ad-text);
+ font: inherit;
+ font-size: 14px;
+ font-weight: 600;
+ cursor: pointer;
+ text-align: center;
+ text-decoration: none;
box-sizing: border-box;
}
-.btn-secondary:hover { background: rgba(255,255,255,0.06); }
-.wallet-pick { margin-bottom: 6px; }
-.payment-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0; }
-.payment-qr .muted { font-size: 11px; color: var(--ad-dim); text-align: center; }
-.payment-status { font-size: 13px; margin-top: 12px; min-height: 16px; color: var(--ad-muted); }
-.payment-status.err { color: #ff6b6b; }
-.payment-status.ok { color: var(--ad-green); }
-.payment-modal-retry p { margin: 0 0 8px; font-size: 13px; color: var(--ad-text); }
-.retry-tx { font-size: 12px; color: var(--ad-dim); margin-bottom: 10px; }
-.retry-tx a { color: var(--ad-text); }
-.retry-actions { display: flex; gap: 8px; }
+.btn-secondary:hover {
+ background: rgba(255, 255, 255, 0.06);
+}
+.wallet-pick {
+ margin-bottom: 6px;
+}
+.payment-qr {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 8px;
+ margin: 12px 0;
+}
+.payment-qr .muted {
+ font-size: 11px;
+ color: var(--ad-dim);
+ text-align: center;
+}
+.payment-status {
+ font-size: 13px;
+ margin-top: 12px;
+ min-height: 16px;
+ color: var(--ad-muted);
+}
+.payment-status.err {
+ color: #ff6b6b;
+}
+.payment-status.ok {
+ color: var(--ad-green);
+}
+.payment-modal-retry p {
+ margin: 0 0 8px;
+ font-size: 13px;
+ color: var(--ad-text);
+}
+.retry-tx {
+ font-size: 12px;
+ color: var(--ad-dim);
+ margin-bottom: 10px;
+}
+.retry-tx a {
+ color: var(--ad-text);
+}
+.retry-actions {
+ display: flex;
+ gap: 8px;
+}
.retry-primary {
- flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--ad-text);
- background: var(--ad-text); color: var(--ad-bg); font: inherit; font-weight: 600; cursor: pointer;
+ flex: 1;
+ padding: 9px;
+ border-radius: 9px;
+ border: 1px solid var(--ad-text);
+ background: var(--ad-text);
+ color: var(--ad-bg);
+ font: inherit;
+ font-weight: 600;
+ cursor: pointer;
}
.retry-secondary {
- flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--ad-line-2);
- background: var(--ad-bg-2); color: var(--ad-text); font: inherit; font-weight: 600; cursor: pointer;
+ flex: 1;
+ padding: 9px;
+ border-radius: 9px;
+ border: 1px solid var(--ad-line-2);
+ background: var(--ad-bg-2);
+ color: var(--ad-text);
+ font: inherit;
+ font-weight: 600;
+ cursor: pointer;
+}
+.payment-modal-success {
+ padding: 30px 24px;
+ text-align: center;
}
-.payment-modal-success { padding: 30px 24px; text-align: center; }
.ps-check {
- width: 52px; height: 52px; margin: 0 auto 14px;
- border-radius: 50%; background: rgba(74,222,128,0.12);
- display: flex; align-items: center; justify-content: center;
- font-size: 26px; color: var(--ad-green);
-}
-.ps-title { margin: 0 0 6px; font-size: 19px; color: var(--ad-text); }
-.ps-sub { margin: 0 0 18px; font-size: 13px; color: var(--ad-muted); line-height: 1.5; }
-.ps-actions { display: flex; flex-direction: column; gap: 8px; }
-.muted { color: var(--ad-muted); }
-.muted.small { font-size: 11px; }
+ width: 52px;
+ height: 52px;
+ margin: 0 auto 14px;
+ border-radius: 50%;
+ background: rgba(74, 222, 128, 0.12);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 26px;
+ color: var(--ad-green);
+}
+.ps-title {
+ margin: 0 0 6px;
+ font-size: 19px;
+ color: var(--ad-text);
+}
+.ps-sub {
+ margin: 0 0 18px;
+ font-size: 13px;
+ color: var(--ad-muted);
+ line-height: 1.5;
+}
+.ps-actions {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+.muted {
+ color: var(--ad-muted);
+}
+.muted.small {
+ font-size: 11px;
+}
@media (max-width: 640px) {
- .ad-version-row { grid-template-columns: auto 1fr; }
- .ad-version-when { grid-column: 2; }
+ .ad-version-row {
+ grid-template-columns: auto 1fr;
+ }
+ .ad-version-when {
+ grid-column: 2;
+ }
}
/* ───────────────────────────────────────────────────────────────────────────
@@ -1171,7 +1909,10 @@ a { color: inherit; text-decoration: none; }
color: var(--ad-text);
white-space: nowrap;
}
-.ad-cohort-icon { font-size: 12px; line-height: 1; }
+.ad-cohort-icon {
+ font-size: 12px;
+ line-height: 1;
+}
.ad-cohort-bar {
height: 6px;
min-width: 40px;
@@ -1211,22 +1952,22 @@ a { color: inherit; text-decoration: none; }
.ad-conc-healthy {
color: var(--ad-green);
border-color: rgba(74, 222, 128, 0.35);
- background: rgba(74, 222, 128, 0.10);
+ background: rgba(74, 222, 128, 0.1);
}
.ad-conc-moderate {
color: var(--ad-cyan);
border-color: rgba(87, 199, 255, 0.35);
- background: rgba(87, 199, 255, 0.10);
+ background: rgba(87, 199, 255, 0.1);
}
.ad-conc-high {
color: var(--ad-amber);
border-color: rgba(245, 165, 36, 0.35);
- background: rgba(245, 165, 36, 0.10);
+ background: rgba(245, 165, 36, 0.1);
}
.ad-conc-very-high {
color: #f87171;
border-color: rgba(248, 113, 113, 0.35);
- background: rgba(248, 113, 113, 0.10);
+ background: rgba(248, 113, 113, 0.1);
}
.ad-cohorts-conc-detail {
color: var(--ad-muted);
@@ -1259,7 +2000,9 @@ a { color: inherit; text-decoration: none; }
padding: 3px 10px;
font-size: 11px;
cursor: pointer;
- transition: background 0.15s, border-color 0.15s;
+ transition:
+ background 0.15s,
+ border-color 0.15s;
}
.ad-cohorts-retry:hover {
background: rgba(255, 255, 255, 0.04);
@@ -1279,10 +2022,25 @@ a { color: inherit; text-decoration: none; }
background: linear-gradient(90deg, transparent, var(--skeleton-sheen), transparent);
animation: ad-cohort-shimmer 1.4s infinite;
}
-.ad-skel-count { display: inline-block; width: 44px; height: 16px; }
-.ad-skel-row { height: 18px; width: 100%; }
-@keyframes ad-cohort-shimmer { 100% { transform: translateX(100%); } }
+.ad-skel-count {
+ display: inline-block;
+ width: 44px;
+ height: 16px;
+}
+.ad-skel-row {
+ height: 18px;
+ width: 100%;
+}
+@keyframes ad-cohort-shimmer {
+ 100% {
+ transform: translateX(100%);
+ }
+}
@media (prefers-reduced-motion: reduce) {
- .ad-skel::after { animation: none; }
- .ad-cohort-fill { transition: none; }
+ .ad-skel::after {
+ animation: none;
+ }
+ .ad-cohort-fill {
+ transition: none;
+ }
}
diff --git a/src/agent-detail.js b/src/agent-detail.js
index c7d442d23..721c1ae8f 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -170,7 +170,9 @@ function cohortsView(data) {
];
if (!holderCount) {
- nodes.push(el('div', { class: 'ad-cohorts-empty', text: 'No holders yet — be the first.' }));
+ nodes.push(
+ el('div', { class: 'ad-cohorts-empty', text: 'No holders yet — be the first.' }),
+ );
return nodes;
}
@@ -520,7 +522,8 @@ function starsHtml(rating, size = 'sm') {
let html = '';
for (let i = 1; i <= 5; i++) {
if (i <= full) html += `<span class="ad-star filled" aria-hidden="true">★</span>`;
- else if (i === full + 1 && half) html += `<span class="ad-star half" aria-hidden="true">★</span>`;
+ else if (i === full + 1 && half)
+ html += `<span class="ad-star half" aria-hidden="true">★</span>`;
else html += `<span class="ad-star" aria-hidden="true">★</span>`;
}
return html;
@@ -594,9 +597,14 @@ async function loadReviews(agentId, agentRec) {
class: 'ad-reviews-stars',
'aria-label': `${avgDisplay} out of 5 stars`,
}),
- el('div', { class: 'ad-reviews-total', text: `${summary.rating_count} review${summary.rating_count !== 1 ? 's' : ''}` }),
+ el('div', {
+ class: 'ad-reviews-total',
+ text: `${summary.rating_count} review${summary.rating_count !== 1 ? 's' : ''}`,
+ }),
]),
- el('div', { class: 'ad-reviews-bars' },
+ el(
+ 'div',
+ { class: 'ad-reviews-bars' },
[5, 4, 3, 2, 1].map((star) => {
const count = summary.breakdown?.[star] || 0;
const pct = Math.round((count / total) * 100);
@@ -617,7 +625,9 @@ async function loadReviews(agentId, agentRec) {
// Write / edit form (skip if owner)
if (!isOwner) {
- body.appendChild(buildReviewForm(agentId, my_review, (updated) => loadReviews(agentId, agentRec)));
+ body.appendChild(
+ buildReviewForm(agentId, my_review, (updated) => loadReviews(agentId, agentRec)),
+ );
}
// Reviews list
@@ -625,7 +635,11 @@ async function loadReviews(agentId, agentRec) {
body.appendChild(
el('div', { class: 'ad-reviews-empty' }, [
el('strong', { text: 'No reviews yet' }),
- el('span', { text: isOwner ? 'Reviews from users will appear here.' : 'Be the first to review this agent.' }),
+ el('span', {
+ text: isOwner
+ ? 'Reviews from users will appear here.'
+ : 'Be the first to review this agent.',
+ }),
]),
);
return;
@@ -642,9 +656,10 @@ function buildReviewForm(agentId, existing, onSuccess) {
let selectedRating = existing?.rating || 0;
let submitting = false;
-
-
- const formTitle = el('div', { class: 'ad-review-form-title', text: existing ? 'Your Review' : 'Write a Review' });
+ const formTitle = el('div', {
+ class: 'ad-review-form-title',
+ text: existing ? 'Your Review' : 'Write a Review',
+ });
const starPicker = el('div', {
class: 'ad-review-star-picker',
@@ -661,7 +676,12 @@ function buildReviewForm(agentId, existing, onSuccess) {
text: '★',
});
s.addEventListener('click', () => setRating(n));
- s.addEventListener('keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setRating(n); } });
+ s.addEventListener('keydown', (e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ setRating(n);
+ }
+ });
starPicker.appendChild(s);
return s;
});
@@ -683,7 +703,10 @@ function buildReviewForm(agentId, existing, onSuccess) {
});
textarea.value = existing?.body || '';
- const charCount = el('span', { class: 'ad-review-char-count', text: `${textarea.value.length}/2000` });
+ const charCount = el('span', {
+ class: 'ad-review-char-count',
+ text: `${textarea.value.length}/2000`,
+ });
textarea.addEventListener('input', () => {
charCount.textContent = `${textarea.value.length}/2000`;
});
@@ -709,16 +732,23 @@ function buildReviewForm(agentId, existing, onSuccess) {
const headers = { 'content-type': 'application/json' };
if (csrf) headers['x-csrf-token'] = csrf;
- const r = await fetch(`/api/marketplace/agents/${encodeURIComponent(agentId)}/reviews`, {
- method: 'POST',
- credentials: 'include',
- headers,
- body: JSON.stringify({ rating: selectedRating, body: textarea.value.trim() || null }),
- });
+ const r = await fetch(
+ `/api/marketplace/agents/${encodeURIComponent(agentId)}/reviews`,
+ {
+ method: 'POST',
+ credentials: 'include',
+ headers,
+ body: JSON.stringify({
+ rating: selectedRating,
+ body: textarea.value.trim() || null,
+ }),
+ },
+ );
const json = await r.json();
if (!r.ok) {
if (r.status === 401) {
- statusEl.innerHTML = '<a href="/sign-in" style="color:var(--ad-violet)">Sign in</a> to leave a review';
+ statusEl.innerHTML =
+ '<a href="/sign-in" style="color:var(--ad-violet)">Sign in</a> to leave a review';
} else {
statusEl.textContent = json.error?.message || 'Save failed';
}
@@ -740,7 +770,11 @@ function buildReviewForm(agentId, existing, onSuccess) {
const actions = el('div', { class: 'ad-review-form-actions' });
if (existing) {
- const deleteBtn = el('button', { class: 'ad-review-delete', type: 'button', text: 'Delete' });
+ const deleteBtn = el('button', {
+ class: 'ad-review-delete',
+ type: 'button',
+ text: 'Delete',
+ });
deleteBtn.addEventListener('click', async () => {
if (submitting) return;
submitting = true;
@@ -808,7 +842,11 @@ function buildReviewItem(r, agentId, onRefresh) {
const form = buildReviewForm(agentId, r, onRefresh);
item.replaceWith(form);
});
- const delBtn = el('button', { class: 'ad-review-mine-btn danger', type: 'button', text: 'Delete' });
+ const delBtn = el('button', {
+ class: 'ad-review-mine-btn danger',
+ type: 'button',
+ text: 'Delete',
+ });
delBtn.addEventListener('click', async () => {
delBtn.disabled = true;
delBtn.textContent = 'Deleting…';
@@ -1221,11 +1259,11 @@ function bindWalletActions(isOwner) {
actions: actionsEl,
});
- const withdrawAmountInput = withdrawModal.bodyEl.querySelector('#withdraw-amount');
+ const withdrawAmountInput = withdrawModal.bodyEl.querySelector('#withdraw-amount');
const recipientAddressInput = withdrawModal.bodyEl.querySelector('#recipient-address');
- const recipientResolvedEl = withdrawModal.bodyEl.querySelector('#recipient-resolved');
- const cancelWithdrawBtn = withdrawModal.actionsEl.querySelector('#cancel-withdraw-btn');
- const confirmWithdrawBtn = withdrawModal.actionsEl.querySelector('#confirm-withdraw-btn');
+ const recipientResolvedEl = withdrawModal.bodyEl.querySelector('#recipient-resolved');
+ const cancelWithdrawBtn = withdrawModal.actionsEl.querySelector('#cancel-withdraw-btn');
+ const confirmWithdrawBtn = withdrawModal.actionsEl.querySelector('#confirm-withdraw-btn');
const snsResolver = makeSnsResolver(recipientAddressInput, recipientResolvedEl);
withdrawBtn.addEventListener('click', () => {
diff --git a/tasks/pumpfun-upstream/03-segments-findings.md b/tasks/pumpfun-upstream/03-segments-findings.md
index d92f7f456..47752ba53 100644
--- a/tasks/pumpfun-upstream/03-segments-findings.md
+++ b/tasks/pumpfun-upstream/03-segments-findings.md
@@ -8,7 +8,7 @@
## What it is
-It is Pump.fun's **internal user-segmentation SDK** — a thin TypeScript read-client over a private **DynamoDB** table of audience cohorts that a Lambda materializes from Pump.fun's **BigQuery** warehouse. "Segments" means *marketing/growth audience cohorts of pump.fun app users* (not on-chain, not token/fee related). The three baked-in segments in [`src/segments/definitions.ts`](https://github.com/pump-fun/pump-segments-sdk/blob/devnet/src/segments/definitions.ts) make this unambiguous: `mobile-users-no-notifications`, `mobile-high-volume-traders` ($1k+ weekly), `mobile-active-yesterday` — each defined by a BigQuery SQL string against `pump-data-production.analytics.daily_user_activity` (columns `user_id`, `was_on_mobile`, `notifications_received`, `usd_volume`). It is push-notification / growth-targeting infrastructure.
+It is Pump.fun's **internal user-segmentation SDK** — a thin TypeScript read-client over a private **DynamoDB** table of audience cohorts that a Lambda materializes from Pump.fun's **BigQuery** warehouse. "Segments" means _marketing/growth audience cohorts of pump.fun app users_ (not on-chain, not token/fee related). The three baked-in segments in [`src/segments/definitions.ts`](https://github.com/pump-fun/pump-segments-sdk/blob/devnet/src/segments/definitions.ts) make this unambiguous: `mobile-users-no-notifications`, `mobile-high-volume-traders` ($1k+ weekly), `mobile-active-yesterday` — each defined by a BigQuery SQL string against `pump-data-production.analytics.daily_user_activity` (columns `user_id`, `was_on_mobile`, `notifications_received`, `usd_volume`). It is push-notification / growth-targeting infrastructure.
## Capability list (actual API)
@@ -22,7 +22,7 @@ It is Pump.fun's **internal user-segmentation SDK** — a thin TypeScript read-c
**None usable.** Every capability is gated behind Pump.fun's private infrastructure:
- **Hard dependency on their AWS account.** It reads a specific DynamoDB table populated by their Lambda from their BigQuery project `pump-data-production`. Without their AWS credentials and that pre-computed table, every method throws `SegmentError` immediately. There is no public endpoint and no on-chain component.
-- **Wrong domain.** Segments are about *pump.fun app users* (mobile usage, notification counts, USD trading volume keyed by internal `user_id`). They are **not** $THREE holders, wallets, creators, or fees. This does not touch fee sharing, creator revenue, or royalties.
+- **Wrong domain.** Segments are about _pump.fun app users_ (mobile usage, notification counts, USD trading volume keyed by internal `user_id`). They are **not** $THREE holders, wallets, creators, or fees. This does not touch fee sharing, creator revenue, or royalties.
- **No overlap with our features.** Nothing here unlocks the `/go` bounty board, `api/_lib/coin-communities.js`, `holder-pass.js`, `royalty.js`, or the fee-sharing paths in `api/pump/[action].js` (all confirmed present). Those operate on Solana wallets/mints/holders — a different data plane entirely.
## Availability
@@ -35,16 +35,16 @@ Pre-release and effectively private: unpublished on npm, `access: restricted` (i
## Addendum — re-evaluated for agent-token holder segmentation
-Raised use case: we let users launch tokens for their agents, so segment *those token holders* into cohorts (whales, diamond hands, new buyers, dormant) and wire them into the `/go` bounty board, communities, and holder worlds.
+Raised use case: we let users launch tokens for their agents, so segment _those token holders_ into cohorts (whales, diamond hands, new buyers, dormant) and wire them into the `/go` bounty board, communities, and holder worlds.
**The product instinct is right; this SDK is the wrong vehicle.** Verified against our actual code:
-- **We already own the data plane this SDK lacks.** [`api/_lib/coin/holders.js`](../../api/_lib/coin/holders.js) snapshots every agent-token holder on-chain via Helius `getTokenAccounts` (Token-2022) into a **Neon Postgres** `coin_holders` table — `persistHolderSnapshot({coinId, balances})`, `readEligibleHolders({coinId, minBalance})`. [`api/_lib/holder-pass.js`](../../api/_lib/holder-pass.js) already does USD-tiered gating. The segments-sdk computes *none* of this — it is a pure read proxy over a table someone else populates.
+- **We already own the data plane this SDK lacks.** [`api/_lib/coin/holders.js`](../../api/_lib/coin/holders.js) snapshots every agent-token holder on-chain via Helius `getTokenAccounts` (Token-2022) into a **Neon Postgres** `coin_holders` table — `persistHolderSnapshot({coinId, balances})`, `readEligibleHolders({coinId, minBalance})`. [`api/_lib/holder-pass.js`](../../api/_lib/holder-pass.js) already does USD-tiered gating. The segments-sdk computes _none_ of this — it is a pure read proxy over a table someone else populates.
- **Datastore mismatch.** The SDK is hardwired to **DynamoDB** (`@aws-sdk/lib-dynamodb`). Our store is Neon Postgres (`sql` tagged template). Adopting it means standing up a second datastore for zero benefit.
-- **Its real value is a backend we can't touch.** The "segments" are materialized by Pump.fun's private Lambda from their internal `pump-data-production` BigQuery, keyed by *pump.fun app `user_id`* — not Solana wallets, not our mints. Even pointed at our own DynamoDB table, every method returns empty until we build the entire cohort-materializer ourselves — which we already 80% have in `holders.js`.
-- **Reusable surface ≈ 40 lines.** Only the base64 cursor pagination and the `imurmurhash` deterministic sampling (`bucket = hash % 10000`) are worth borrowing as a *pattern*. Trivial to write natively against `coin_holders`.
+- **Its real value is a backend we can't touch.** The "segments" are materialized by Pump.fun's private Lambda from their internal `pump-data-production` BigQuery, keyed by _pump.fun app `user_id`_ — not Solana wallets, not our mints. Even pointed at our own DynamoDB table, every method returns empty until we build the entire cohort-materializer ourselves — which we already 80% have in `holders.js`.
+- **Reusable surface ≈ 40 lines.** Only the base64 cursor pagination and the `imurmurhash` deterministic sampling (`bucket = hash % 10000`) are worth borrowing as a _pattern_. Trivial to write natively against `coin_holders`.
-**Revised recommendation:** **Do not adopt the SDK** (unchanged), but **do build native agent-token holder cohorts** on top of `coin_holders` — a small, high-leverage feature. Borrow the *idea* (named cohorts + deterministic sampling), not the dependency.
+**Revised recommendation:** **Do not adopt the SDK** (unchanged), but **do build native agent-token holder cohorts** on top of `coin_holders` — a small, high-leverage feature. Borrow the _idea_ (named cohorts + deterministic sampling), not the dependency.
## Shipped
@@ -54,3 +54,45 @@ Built natively, dependency-free, against our own holder set — no DynamoDB, no
- [`api/coin/[mint]/cohorts.js`](../../api/coin/[mint]/cohorts.js) — public definitions+counts; creator-gated member export for airdrop/bounty targeting.
- [`2026-06-08-coin-holder-cohorts.sql`](../../api/_lib/migrations/2026-06-08-coin-holder-cohorts.sql) — `first_seen` / `last_seen` partial indexes; re-export in `coin/index.js`.
- Tests: [`cohorts.test.js`](../../api/_lib/coin/cohorts.test.js) (14, passing) — sampling determinism/distribution, spec bounds, registry. Wired into `npm test` via `vitest.config.js`. SQL paths need a live DB to exercise (none locally).
+
+## Live fallback for agent tokens + UI (added 2026-06-08)
+
+**Gap found in the snapshot-only build:** the "Shipped" section above assumes
+"every agent token already has its full holder set snapshotted into
+`coin_holders`." It does not. Agent-token launches
+([`api/agents/tokens/[action].js`](../../api/agents/tokens/[action].js)) write
+only `agent_identities.meta.token`; **nothing registers them in
+`coin_launches`** (only the manual `scripts/coin-cli.mjs` /
+`scripts/pump-link-mint.mjs` do), and the snapshot cron sweeps
+`listActiveCoins()` (coin_launches only). So `coin_holders` is empty for an
+ordinary agent token, and `GET /api/coin/:mint/cohorts` returned **404 / empty**
+for exactly the tokens this feature is for.
+
+**Fix (per the user's "use the Helius path"):** compute the snapshot-independent
+cohorts **live** from the holder set Helius already indexes for the mint, with no
+dependency on the lottery/reflection plumbing.
+
+- [`api/_lib/coin/cohorts-live.js`](../../api/_lib/coin/cohorts-live.js) —
+ `liveHolderSet` (one Helius `fetchHolderBalances` walk), `liveCohortCounts`
+ (holders + whales + concentration: top-1 / top-10 share + a health label),
+ `liveCohortMembers` (sorted, optional deterministic sampling, reusing the
+ snapshot path's `sampleBucket`/`inSample`). Tenure cohorts (diamond-hands /
+ new-buyers / exited) report **`null` / 422** live — never a fabricated 0 —
+ since they need `first_seen` history a snapshot would accrue.
+- [`api/coin/[mint]/cohorts.js`](../../api/coin/[mint]/cohorts.js) — when
+ `loadCoinByMint` misses, falls back to the agent token (by
+ `meta->'token'->>'mint'`) and serves live cohorts; unknown mints still 404.
+ Creator-gated export (owner of the agent), CDN-cached overview, dedicated
+ `cohortsIp` rate-limit so the paid Helius walk can't be run up.
+- [`src/agent-detail.js`](../../src/agent-detail.js) +
+ [`agent-detail.css`](../../src/agent-detail.css) — **the first consumer**: a
+ holder-cohort panel under the agent's token (whale share bar, concentration
+ chip, designed loading / empty / error states). Nothing rendered cohorts
+ before this.
+- Tests: [`cohorts-live.test.js`](../../api/_lib/coin/cohorts-live.test.js)
+ (10, passing) — count/whale/concentration math, null tenure, sampling
+ determinism, truncation.
+
+Net: snapshot coins get full cohorts incl. tenure; agent tokens get
+size/concentration cohorts immediately, and gain tenure automatically if/when a
+mint is ever registered + snapshotted.
diff --git a/tasks/week-2026-06-08/B2-evm-marketplace-purchase.md b/tasks/week-2026-06-08/B2-evm-marketplace-purchase.md
deleted file mode 100644
index daeb9e82e..000000000
--- a/tasks/week-2026-06-08/B2-evm-marketplace-purchase.md
+++ /dev/null
@@ -1,71 +0,0 @@
-# B2 — Implement EVM marketplace purchase confirmation (close the 501 dead-end)
-
-**Track:** B — complete feature · **Priority:** P1 · **Effort:** 1–2 days · **Depends on:** none
-
-## Context
-
-The marketplace buy flow **dead-ends for any non-Solana chain**. Both purchase-confirm handlers
-return `501 not_implemented` the moment the chain isn't Solana:
-
-- `api/marketplace/purchase.js:259` — `chain '${pur.chain}' confirmation not yet supported`
-- `api/marketplace/buy-asset.js:253` — same
-
-So a buyer can begin an EVM (Base, etc.) purchase but can never confirm it. This violates the
-"every state must be reachable / no dead paths" rule and the "no `not_implemented`" rule.
-
-The Solana confirmation path in those same files is the reference implementation — mirror its
-shape (verify the on-chain payment, mark the purchase paid, grant the entitlement, record the
-receipt) for EVM.
-
-## What to do
-
-1. **Read both handlers fully** and the Solana confirm path they already implement. Identify the
- exact post-payment steps Solana does: signature/tx verification, amount/recipient/mint checks,
- idempotency, DB state transition (pending → paid), entitlement grant, receipt/audit write.
-2. **Find the existing EVM verification primitives** — this repo already does EVM/x402 on Base.
- Search `api/_lib/` for EVM helpers (`rg -n "base|evm|viem|ethers|verifyTransaction|usdc" api/_lib`).
- x402 settlement on Base + EVM RPC reads almost certainly already exist (the x402 stack). Reuse
- them — do **not** add a new web3 dependency or re-implement RPC plumbing.
-3. **Implement EVM confirmation** for the chain(s) the marketplace actually offers (confirm which:
- Base at minimum). For an EVM purchase, verify the on-chain transfer (correct token = USDC
- settlement, correct amount, correct recipient/treasury, sufficient confirmations), enforce
- idempotency (same tx can't grant twice), then run the **same** state-transition + entitlement +
- receipt steps as Solana.
-4. **De-duplicate.** `purchase.js` and `buy-asset.js` carry a near-identical expire/confirm/501
- ladder. Extract the shared confirm logic into one helper in `api/_lib/` (e.g.
- `marketplace-confirm.js`) so the EVM path is implemented **once** and both endpoints call it.
- Don't fix the same gap twice.
-5. **Error boundaries:** invalid / unconfirmed tx → clear 4xx with an actionable message; transient
- RPC failure → retriable 5xx; never a bare `501`.
-
-## Acceptance criteria
-
-- [ ] An EVM (Base) purchase can be confirmed end-to-end: on-chain payment verified, purchase
- marked paid, entitlement granted, receipt recorded.
-- [ ] Replaying the same confirmation (same tx) is idempotent — no double-grant.
-- [ ] Wrong token / wrong amount / wrong recipient / unconfirmed tx each return a clear,
- actionable 4xx (not 501, not a silent success).
-- [ ] Shared confirm logic is extracted to one helper; both `purchase.js` and `buy-asset.js` use it.
-- [ ] Solana confirmation is unchanged (no regression).
-- [ ] No `not_implemented` / 501 remains in the purchase-confirm path for supported chains.
-
-## Verification
-
-1. `npx vitest run` for marketplace tests; add tests for the EVM confirm path (valid tx, replay,
- wrong-amount, unconfirmed) using the repo's existing EVM test helpers/fixtures (use $THREE or a
- clearly-synthetic placeholder mint — never a real third-party mint).
-2. `npm run dev`; walk the marketplace buy flow for an EVM item if a testable path exists, and
- confirm the confirm step succeeds and the entitlement appears.
-
-## Rules
-
-Obey [CLAUDE.md](../../CLAUDE.md). No mocks, real chain verification. Settlement in USDC on Base is
-the allowed coin-agnostic plumbing — do not surface any non-$THREE token symbol in UI copy.
-
-## Completion protocol
-
-1. Re-read your diff (`git diff`) and confirm every line is justified.
-2. Delete this file: `tasks/week-2026-06-08/B2-evm-marketplace-purchase.md`.
-3. Commit your code change **and** this file's deletion together, e.g.:
- `git add -A && git commit -m "feat(marketplace): EVM purchase confirmation + shared confirm helper; close B2"`
-4. Do **not** push — the human controls pushes.
diff --git a/tasks/week-2026-06-08/README.md b/tasks/week-2026-06-08/README.md
deleted file mode 100644
index 6620bfc97..000000000
--- a/tasks/week-2026-06-08/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Week of 2026-06-08 — Task Board
-
-Source of truth for this week's work. Derived from a full-codebase audit on 2026-06-08:
-production logs (Jun 6–7 export), an incomplete-feature/rule-violation sweep, the API
-surface map, and the roadmap backlog.
-
-Each file in this directory is a **self-contained prompt for one agent**. An agent should:
-
-1. Read exactly one task file.
-2. Complete it fully and professionally, obeying [CLAUDE.md](../../CLAUDE.md).
-3. Verify the work (build/tests/manual as specified in the task).
-4. **Delete the task file it just read** as the final step (see each task's "Completion protocol").
-5. Commit the change **and** the file deletion together. Do **not** push — pushes are the human's call.
-
-No mocks, no stubs, no placeholders, no TODOs. The only coin that may ever appear anywhere
-is `$THREE` (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`).
-
----
-
-## Tasks
-
-| ID | Title | Track | Priority | Depends on | Effort |
-|----|-------|-------|----------|------------|--------|
-| A1 | `/api/pump/curve` 404 + RPC storm | A — prod fire | P0 | — | 2–3h |
-| A2 | `/api/chat` 502s — harden LLM fallback chain | A — prod fire | P0 | — | ~half day |
-| A3 | Forge `views_used` migration not applied in prod | A — prod fire | P1 | — | 30m–1h |
-| A4 | `/api/pump/by-agent` 500 — add UUID guard | A — prod fire | P1 | — | 1–2h |
-| A5 | Neon cold-start failures (auto-agent + seed) | A — prod fire | P2 | — | 2–4h |
-| B1 | Coin-purity sweep — purge all non-$THREE tokens | B — complete | P0 | — | 2–3h |
-| B2 | EVM marketplace purchase confirmation (501 dead-end) | B — complete | P1 | — | 1–2 days |
-| B3 | Remove/implement empty `skill-collection.js` | B — complete | P2 | — | 30m–2h |
-| B4 | Docs + CI hygiene (texture worker, zero-byte guard) | B — complete | P2 | — | 2–3h |
-| C1 | `three-token-data.js` shared hook (keystone) | C — build | P1 | — | ~half day |
-| C2 | $THREE holder "your position" widget (Task 14) | C — build | P1 | C1 | 1 day |
-| C3 | Holder leaderboard + endpoint + gated 3D badge (Task 15) | C — build | P1 | C1 | 1–2 days |
-| C4 | $THREE token page upgrade (Task 16) | C — build | P2 | C1 | 1–2 days |
-| C5 | Holder rewards / revenue-share surface (Task 17) | C — build | P2 | C1 | 1 day |
-| C6 | Reconcile + polish `/three-live` (Task 13) | C — build | P3 | — | half day |
-
-## Recommended order
-
-- **Day 1 (parallel):** A1, A2, A3, B1 — independent, low-risk, highest impact.
-- **Day 2:** A4, A5, B3, B4 — cleanup; start **C1** (keystone).
-- **Day 3+:** C2 and C3 in parallel once C1 lands; B2 in its own lane; then C4/C5; C6 last.
-
-## Dependency notes
-
-- **C2, C4, C5 all consume the C1 hook.** Do not start them before C1 is merged, or they will
- re-implement $THREE data fetching and drift.
-- **C3** depends on C1 only for the client surface; its new `?action=leaderboard` endpoint is
- independent and can be built in parallel.
-- **A2 has an operational prerequisite** (confirm `ANTHROPIC_API_KEY` is set in Vercel prod) that
- the human must verify — see the task.
-
-## Hard correctness flag for Track C
-
-There is **no on-chain rewards/claim program** in `contracts/`. `/api/three-token/revenue-share`
-returns pro-rata *math*, not a claimable balance. C5 must be an accrual/calculator surface that
-labels claiming as "coming" — do **not** wire a claim button with no backing program.