Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: ship pump-fun skills port with kol, sns, trade reactions, and gmgn integration
nirholas9a80ce0f63df
diff --git a/api/pump-fun-mcp.js b/api/pump-fun-mcp.jsindex 30254af76..7cc3b0b63 100644--- a/api/pump-fun-mcp.js+++ b/api/pump-fun-mcp.js@@ -24,6 +24,7 @@ import { getRadarSignals } from '../src/kol/radar.js';import { TOOLS, rpcError, rpcEnvelope } from '../src/pump/mcp-tools.js';import { generateVanityKey } from '../src/pump/vanity-keygen.js';import bs58 from 'bs58';+import { resolveSnsName, reverseLookupAddress } from '../src/solana/sns.js';// ── On-chain handlers ──────────────────────────────────────────────────────@@ -166,6 +167,22 @@ async function handleKolLeaderboard({ window = '7d', limit = 25 }) {return getLeaderboard({ window, limit });}+// ── SNS handlers ──────────────────────────────────────────────────────────++async function handleSnsResolve({ name }) {+ if (!name) throw rpcError(-32602, 'name is required');+ const address = await resolveSnsName(name);+ if (!address) throw rpcError(-32004, `domain "${name}" not found`);+ return { name, address };+}++async function handleSnsReverseLookup({ address }) {+ if (!address) throw rpcError(-32602, 'address is required');+ const name = await reverseLookupAddress(address);+ if (!name) throw rpcError(-32004, `no .sol domain found for address`);+ return { address, name };+}+// ── Indexer-backed handlers (route through pumpfunMcp) ─────────────────────function indexerOrUnavailable(name) {diff --git a/public/studio/index.html b/public/studio/index.htmlindex ad8d19fdf..b4b75760e 100644--- a/public/studio/index.html+++ b/public/studio/index.html@@ -84,6 +84,12 @@<section class="studio-col-right" aria-label="Brand and config"><div class="panel">+ <div class="studio-right-tabs" role="tablist">+ <button class="studio-right-tab" id="tab-brand" role="tab" aria-selected="true" aria-controls="panel-brand">Brand</button>+ <button class="studio-right-tab" id="tab-launch" role="tab" aria-selected="false" aria-controls="panel-launch">⚡ Launch</button>+ </div>++ <div id="panel-brand" role="tabpanel"><h2 data-tooltip="Style the widget to match your site — colors, environment, captions, and behavior. Changes update the preview live.">3. Brand</h2>diff --git a/public/studio/studio.css b/public/studio/studio.cssindex 214300060..9102c7080 100644--- a/public/studio/studio.css+++ b/public/studio/studio.css@@ -658,3 +658,95 @@ body.studio-body {border-radius: 3px;width: fit-content;}++/* ── right-column tabs (Brand / Launch) ─────────────────────────────────── */+.studio-right-tabs {+ display: flex;+ gap: 0;+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);+ margin: 0 calc(var(--space-md) * -1) var(--space-md);+ padding: 0 var(--space-md);+}+.studio-right-tab {+ padding: var(--space-xs) var(--space-sm);+ font-size: var(--text-sm);+ font-family: inherit;+ font-weight: 500;+ background: transparent;+ border: none;+ border-bottom: 2px solid transparent;+ color: rgba(229, 229, 229, 0.45);+ cursor: pointer;+ margin-bottom: -1px;+ transition: color 0.15s, border-color 0.15s;+}+.studio-right-tab:hover {+ color: rgba(229, 229, 229, 0.85);+}+.studio-right-tab[aria-selected='true'] {+ color: #e5e5e5;+ border-bottom-color: var(--accent);+}++/* ── launch panel ───────────────────────────────────────────────────────── */+.launch-panel {+ display: flex;+ flex-direction: column;+ gap: var(--space-sm);+}+.launch-panel-desc {+ font-size: var(--text-sm);+ margin: 0;+}+.launch-req {+ color: rgba(255, 100, 100, 0.8);+}+.launch-field-err {+ font-size: var(--text-xs);+ color: #ffb3b3;+}+.launch-file-input {+ background: #0a0a0a;+ border: 1px solid rgba(255, 255, 255, 0.1);+ color: #e5e5e5;+ padding: 4px 8px;+ border-radius: var(--radius-md);+ font-size: var(--text-sm);+ font-family: inherit;+ cursor: pointer;+}++/* Bonding-curve progress — ported from solana-launchpad-ui styles.css */+.bonding-curve-preview {+ margin-top: var(--space-xs);+}+.bonding-curve-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ margin-bottom: 5px;+}+.bonding-curve-pct {+ font-size: 0.78rem;+ color: #7bff69;+ font-weight: 500;+}+.bonding-curve-track {+ height: 4px;+ background: rgba(255, 255, 255, 0.06);+ border-radius: 2px;+ overflow: hidden;+}+.bonding-curve-fill {+ height: 100%;+ background: linear-gradient(90deg, #5bd94d, #7bff69);+ border-radius: 2px;+ transition: width 0.5s ease;+}+.bonding-curve-labels {+ display: flex;+ justify-content: space-between;+ font-size: 0.7rem;+ color: rgba(255, 255, 255, 0.3);+ margin-top: 4px;+}diff --git a/services/pump-graduations/carbon-source.js b/services/pump-graduations/carbon-source.jsnew file mode 100644index 000000000..2b35938ca--- /dev/null+++ b/services/pump-graduations/carbon-source.js@@ -0,0 +1,99 @@+/**+ * Carbon-backed graduation source.+ * Drop-in alternative to the legacy conn.onLogs subscription in index.js.+ *+ * Interface contract:+ * const src = new CarbonGraduationSource({ connection });+ * src.start((ev) => { /* ev: { mint, signature, ts, marketCapUsd } *\/ });+ * src.stop();+ *+ * The `logSubscriber` constructor option overrides the Solana subscription+ * call and is used exclusively by tests to inject a mock stream.+ *+ * Env (inherited from parent service — no separate env needed):+ * SOLANA_RPC_URL / SOLANA_WS_URL are consumed by index.js before this+ * source is instantiated.+ */++import { PublicKey } from '@solana/web3.js';+import bs58 from 'bs58';++const PUMP_PROGRAM_ID = new PublicKey('6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P');++// Anchor "event" CPI emit discriminator: sha256("event:CompleteEvent")[..8]+const COMPLETE_EVENT_DISCRIMINATOR = Buffer.from([95, 114, 97, 156, 212, 46, 152, 8]);++export class CarbonGraduationSource {+ /**+ * @param {object} opts+ * @param {import('@solana/web3.js').Connection} [opts.connection]+ * Solana Connection instance (used by the production path).+ * @param {Function} [opts.logSubscriber]+ * Injectable log-subscription function matching Connection.onLogs's+ * signature: (programId, handler, commitment) => subscriptionId.+ * When provided, `connection` is ignored for subscribing (but may still+ * be used externally for enrichment).+ */+ constructor({ connection, logSubscriber } = {}) {+ this._conn = connection;+ this._logSubscriber = logSubscriber;+ this._subId = null;+ this._seen = new Set();+ }++ start(onGraduation) {+ const handler = (entry) => this._handle(entry, onGraduation);+ if (this._logSubscriber) {+ this._subId = this._logSubscriber(PUMP_PROGRAM_ID, handler, 'confirmed');+ } else {+ this._subId = this._conn.onLogs(PUMP_PROGRAM_ID, handler, 'confirmed');+ }+ }++ stop() {+ if (this._conn && this._subId != null) {+ this._conn.removeOnLogsListener(this._subId);+ this._subId = null;+ }+ }++ _handle(entry, onGraduation) {+ if (entry.err) return;+ const sig = entry.signature;+ if (this._seen.has(sig)) return;+ if (!entry.logs?.some((l) => l.includes('Program data:'))) return;++ const ev = parseGraduation(sig, entry.logs);+ if (!ev) return;++ this._seen.add(sig);+ if (this._seen.size > 5000) this._seen.clear();++ onGraduation(ev);+ }+}++/**+ * Parse a CompleteEvent from raw program logs.+ * Returns { mint, signature, ts, marketCapUsd } or null.+ */+function parseGraduation(sig, logs) {+ for (const line of logs) {+ const m = line.match(/^Program data: (.+)$/);+ if (!m) continue;+ let data;+ try { data = Buffer.from(m[1], 'base64'); } catch { continue; }+ if (data.length < 8) continue;+ if (!data.subarray(0, 8).equals(COMPLETE_EVENT_DISCRIMINATOR)) continue;++ // CompleteEvent layout: discriminator(8) user(32) mint(32) bondingCurve(32) timestamp(i64)+ if (data.length < 8 + 32 + 32 + 32 + 8) continue;+ let off = 8 + 32; // skip discriminator + user+ const mint = bs58.encode(data.subarray(off, off + 32)); off += 32;+ off += 32; // skip bondingCurve+ const ts = Number(data.readBigInt64LE(off));++ return { mint, signature: sig, ts, marketCapUsd: null };+ }+ return null;+}diff --git a/src/kol/wallets.json b/src/kol/wallets.jsonnew file mode 100644index 000000000..fe51488c7--- /dev/null+++ b/src/kol/wallets.json@@ -0,0 +1 @@+[]diff --git a/src/pump/agent-token-widget.js b/src/pump/agent-token-widget.jsindex 3dfa8ac3e..afced2fb4 100644--- a/src/pump/agent-token-widget.js+++ b/src/pump/agent-token-widget.js@@ -17,6 +17,8 @@* recent payment feed, owner withdraw button, governance explainer.*/+import { mountBondingCurve } from '../components/bonding-curve.js';+const POLL_MS = 10_000;function fmtUsdc(atomics) {@@ -87,13 +89,8 @@ const STYLES = `font-size: 0.72rem; color: rgba(255,255,255,0.4); letter-spacing: 0.05em; text-transform: uppercase;}-.atok-grad-bar {- height: 4px; background: rgba(255,255,255,0.05); border-radius: 999px;- margin: 0.9rem 0 0.3rem; overflow: hidden;-}-.atok-grad-fill {- height: 100%; background: linear-gradient(90deg, #6a93ff, #a4f0bc);- transition: width 0.6s cubic-bezier(.2,.8,.2,1);+.atok-curve-wrap {+ margin: 0.9rem 0 0;}.atok-grad-label {font-size: 0.7rem; color: rgba(255,255,255,0.5); display: flex; justify-content: space-between;@@ -256,6 +253,7 @@ export class AgentTokenWidget {this.lastPrice = null;this.lastVaults = null;this.lastFeedTop = null;+ this._curve = null;this._mobileStrip = null;this._poll = null;this._destroyed = false;@@ -281,6 +279,7 @@ export class AgentTokenWidget {this._destroyed = true;if (this._poll) clearInterval(this._poll);this._teardownRealtime();+ if (this._curve) { this._curve.destroy(); this._curve = null; }if (this._mobileStrip?.parentNode) this._mobileStrip.parentNode.removeChild(this._mobileStrip);}@@ -634,8 +633,8 @@ export class AgentTokenWidget {${progressPct != null- ? `<div class="atok-grad-bar"><div class="atok-grad-fill" style="width:${progressPct.toFixed(1)}%"></div></div>- <div class="atok-grad-label"><span>${progressPct.toFixed(1)}% to graduation</span><span>${graduated ? 'AMM' : 'curve'}</span></div>`+ ? `<div class="atok-curve-wrap"></div>+ <div class="atok-grad-label"><span>${progressPct.toFixed(1)}% to graduation</span><span>curve</span></div>`: graduated? `<div class="atok-grad-label" style="margin-top:0.6rem"><span>🎓 Graduated to AMM</span><span></span></div>`: ''diff --git a/src/pump/mcp-tools.js b/src/pump/mcp-tools.jsindex 82d5fd09e..04be97347 100644--- a/src/pump/mcp-tools.js+++ b/src/pump/mcp-tools.js@@ -201,8 +201,46 @@ export const TOOLS = [required: ['address'],},},+ {+ name: 'kol_leaderboard',+ description:+ 'Top KOL traders ranked by P&L for a given time window. Returns wallet, pnlUsd, winRate, trades, rank.',+ inputSchema: {+ type: 'object',+ properties: {+ window: { type: 'string', enum: ['24h', '7d', '30d'], default: '7d' },+ limit: { type: 'integer', minimum: 1, maximum: 100, default: 25 },+ },+ },+ },];+ {+ name: 'social_cashtag_sentiment',+ description:+ 'Score social-post sentiment for a cashtag using a deterministic lexicon. Returns score (-1..1), positive/negative/neutral percentages, and example posts.',+ inputSchema: {+ type: 'object',+ properties: {+ posts: {+ type: 'array',+ description: 'Array of post objects. Each must have a text field; id, ts, and author are optional.',+ items: {+ type: 'object',+ properties: {+ id: { type: 'string' },+ ts: { type: 'string' },+ text: { type: 'string' },+ author: { type: 'string' },+ },+ required: ['text'],+ },+ },+ },+ required: ['posts'],+ },+ },+export function rpcError(code, message) {const err = new Error(message);err.rpcCode = code;