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: portfolio, x triggers, llms.txt/sitemap, docs and dashboard polish
nirholas2215716e0365
diff --git a/.gitignore b/.gitignoreindex 147110d7b..ffad161c6 100644--- a/.gitignore+++ b/.gitignore@@ -60,6 +60,8 @@ scripts/pump-usdc-race.mjs# Wallet / private-key material — NEVER commit*.privkey.txt*.b58.txt+*-pump-wallet.json+.fresh-pump-wallet.jsonwallets/.wallets/x402-test-wallets/diff --git a/agent-edit.html b/agent-edit.htmlindex 08f68683a..0ea90f7a2 100644--- a/agent-edit.html+++ b/agent-edit.html@@ -376,6 +376,68 @@padding: 1rem 0;}+ .avatar-picker-list {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));+ gap: 0.75rem;+ }+ .avatar-tile {+ position: relative;+ background: rgba(255, 255, 255, 0.04);+ border: 1px solid rgba(255, 255, 255, 0.1);+ border-radius: 10px;+ padding: 0.5rem;+ cursor: pointer;+ font-family: inherit;+ color: rgba(255, 255, 255, 0.85);+ display: flex;+ flex-direction: column;+ gap: 0.382rem;+ align-items: stretch;+ transition: border-color 0.15s, transform 0.1s;+ }+ .avatar-tile:hover { border-color: rgba(59, 130, 246, 0.5); }+ .avatar-tile:active { transform: scale(0.98); }+ .avatar-tile.current { border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }+ .avatar-tile img {+ width: 100%;+ aspect-ratio: 1 / 1;+ object-fit: cover;+ border-radius: 6px;+ background: #0a0a12;+ }+ .avatar-tile-ph {+ width: 100%;+ aspect-ratio: 1 / 1;+ display: flex;+ align-items: center;+ justify-content: center;+ background: #0a0a12;+ border-radius: 6px;+ color: rgba(255, 255, 255, 0.3);+ font-size: 0.764rem;+ }+ .avatar-tile-name {+ font-size: 0.764rem;+ color: rgba(255, 255, 255, 0.7);+ text-align: left;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .avatar-tile-badge {+ position: absolute;+ top: 0.382rem;+ right: 0.382rem;+ background: #3b82f6;+ color: #fff;+ font-size: 0.55rem;+ text-transform: uppercase;+ letter-spacing: 0.04em;+ padding: 0.15rem 0.382rem;+ border-radius: 4px;+ }+.edit-tab:focus-visible,.btn-primary:focus-visible,.btn-reset-all:focus-visible,@@ -476,6 +538,229 @@font-size: 0.764rem;color: rgba(255, 255, 255, 0.4);}++ /* ── Shared building blocks for new tabs ── */+ .card {+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.07);+ border-radius: 10px;+ padding: 1rem 1.25rem;+ margin-bottom: 0.875rem;+ }+ .card-title {+ font-size: 0.764rem;+ color: rgba(255, 255, 255, 0.45);+ text-transform: uppercase;+ letter-spacing: 0.08em;+ font-weight: 500;+ margin-bottom: 0.382rem;+ }+ .card-sub { font-size: 0.875rem; color: rgba(255, 255, 255, 0.85); }+ .card-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }+ .card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-left: auto; }+ .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.764rem; word-break: break-all; }+ .hint { font-size: 0.764rem; color: rgba(255, 255, 255, 0.45); margin: 0 0 0.75rem; }+ .muted { font-size: 0.764rem; color: rgba(255, 255, 255, 0.35); padding: 0.5rem 0; }++ .btn-ghost {+ background: transparent;+ border: 1px solid rgba(255, 255, 255, 0.14);+ border-radius: 6px;+ color: rgba(255, 255, 255, 0.7);+ cursor: pointer;+ font: 0.764rem/1 inherit;+ padding: 0.5rem 0.875rem;+ text-decoration: none;+ display: inline-flex;+ align-items: center;+ }+ .btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }+ .btn-ghost.danger { color: #fca5a5; border-color: rgba(252, 165, 165, 0.3); }+ .btn-ghost.danger:hover { border-color: rgba(252, 165, 165, 0.6); }+ .btn-danger {+ background: #dc2626;+ border: 0;+ border-radius: 8px;+ color: #fff;+ cursor: pointer;+ font: 0.875rem/1 inherit;+ padding: 0.618rem 1.25rem;+ font-weight: 500;+ }+ .btn-danger:disabled { opacity: 0.4; cursor: not-allowed; background: #6b1f1f; }+ .btn-danger:not(:disabled):hover { background: #b91c1c; }++ .metric-label { font-size: 0.618rem; color: rgba(255, 255, 255, 0.4); text-transform: uppercase; letter-spacing: 0.08em; }+ .metric-value { font-size: 1.25rem; color: rgba(255, 255, 255, 0.95); font-weight: 500; margin-top: 0.2rem; }+ .metric-card {+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.07);+ border-radius: 10px;+ padding: 0.875rem 1rem;+ }+ .metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }++ /* Voice */+ .voice-list {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));+ gap: 0.5rem;+ max-height: 380px;+ overflow-y: auto;+ border: 1px solid rgba(255, 255, 255, 0.06);+ border-radius: 10px;+ padding: 0.5rem;+ background: rgba(0, 0, 0, 0.2);+ }+ .voice-tile {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.5rem;+ background: rgba(255, 255, 255, 0.04);+ border: 1px solid rgba(255, 255, 255, 0.08);+ border-radius: 8px;+ padding: 0.5rem 0.618rem;+ font: 0.764rem/1.3 inherit;+ color: rgba(255, 255, 255, 0.85);+ cursor: pointer;+ text-align: left;+ transition: border-color 0.15s;+ }+ .voice-tile:hover { border-color: rgba(59, 130, 246, 0.5); }+ .voice-tile.current { border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }+ .voice-tile-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }+ .voice-tile-meta { font-size: 0.618rem; color: rgba(255, 255, 255, 0.4); }+ .voice-tile-play { background: transparent; border: 0; color: rgba(255, 255, 255, 0.6); font-size: 1rem; cursor: pointer; padding: 0 0.25rem; }+ .voice-tile-play:hover { color: #fff; }++ /* Memories */+ .mem-list { display: flex; flex-direction: column; gap: 0.5rem; }+ .mem-item {+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.07);+ border-radius: 8px;+ padding: 0.75rem 0.875rem;+ display: flex;+ gap: 0.75rem;+ align-items: flex-start;+ }+ .mem-item-body { flex: 1; min-width: 0; }+ .mem-item-type { font-size: 0.618rem; color: #93c5fd; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin-bottom: 0.25rem; }+ .mem-item-content { font-size: 0.875rem; color: rgba(255, 255, 255, 0.85); white-space: pre-wrap; word-break: break-word; }+ .mem-item-tags { font-size: 0.618rem; color: rgba(255, 255, 255, 0.4); margin-top: 0.25rem; }++ /* Chip list */+ .chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }+ .chip {+ display: inline-flex;+ align-items: center;+ gap: 0.382rem;+ background: rgba(255, 255, 255, 0.05);+ border: 1px solid rgba(255, 255, 255, 0.1);+ border-radius: 999px;+ padding: 0.382rem 0.75rem;+ font-size: 0.764rem;+ color: rgba(255, 255, 255, 0.85);+ }+ .chip-remove { background: transparent; border: 0; color: rgba(255, 255, 255, 0.4); cursor: pointer; font-size: 0.875rem; padding: 0 0 0 0.25rem; line-height: 1; }+ .chip-remove:hover { color: #fca5a5; }+ .chip-builtin { opacity: 0.7; }++ /* Wallet */+ .wallet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.875rem; }+ .modal {+ position: fixed;+ inset: 0;+ background: rgba(0, 0, 0, 0.65);+ display: flex;+ align-items: center;+ justify-content: center;+ z-index: 1000;+ padding: 1rem;+ }+ .modal[hidden] { display: none !important; }+ .modal-card { background: #0f0f17; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 1.5rem; width: 100%; max-width: 400px; }+ .modal-title { font-size: 1rem; font-weight: 500; color: #fff; margin-bottom: 1rem; }+ .qr-wrap { display: flex; justify-content: center; margin: 0.5rem 0; }+ .qr-wrap img { background: #fff; padding: 0.5rem; border-radius: 8px; width: 200px; height: 200px; }++ /* X / Social */+ .trigger-list { display: flex; flex-direction: column; gap: 0.5rem; }+ .trigger-item { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 8px; padding: 0.75rem 0.875rem; }+ .trigger-item-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.382rem; }+ .trigger-item-kind { font-size: 0.764rem; color: rgba(255, 255, 255, 0.85); font-weight: 500; flex: 1; }+ .trigger-item-body { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; font-size: 0.764rem; color: rgba(255, 255, 255, 0.6); }+ .trigger-item-body input,+ .trigger-item-body select {+ background: rgba(255, 255, 255, 0.05);+ border: 1px solid rgba(255, 255, 255, 0.1);+ border-radius: 6px;+ color: #fff;+ font: inherit;+ font-size: 0.764rem;+ padding: 0.3rem 0.5rem;+ width: auto;+ }++ /* Analytics */+ .bar-chart {+ display: flex;+ align-items: flex-end;+ gap: 2px;+ height: 100px;+ padding: 0.5rem;+ background: rgba(0, 0, 0, 0.2);+ border: 1px solid rgba(255, 255, 255, 0.06);+ border-radius: 8px;+ }+ .bar-chart-col { flex: 1; background: linear-gradient(180deg, #3b82f6 0%, #1e3a8a 100%); border-radius: 2px 2px 0 0; min-height: 2px; }+ .bar-chart-col[data-value='0'] { background: rgba(255, 255, 255, 0.06); }+ .pay-list { display: flex; flex-direction: column; gap: 0.382rem; }+ .pay-item { display: flex; justify-content: space-between; gap: 0.5rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.764rem; color: rgba(255, 255, 255, 0.75); }+ .pay-amount { font-weight: 500; color: #86efac; }+ .pay-amount.out { color: #fca5a5; }++ /* Embed */+ .embed-preview {+ background: rgba(0, 0, 0, 0.3);+ border: 1px solid rgba(255, 255, 255, 0.06);+ border-radius: 10px;+ padding: 0.5rem;+ overflow: auto;+ max-height: 720px;+ }+ .embed-preview iframe { border: 0; border-radius: 6px; background: #000; display: block; max-width: 100%; }++ /* Widgets */+ .widget-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }+ .widget-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 0.875rem; }+ .widget-card-type { display: inline-block; font-size: 0.618rem; color: #93c5fd; background: rgba(59, 130, 246, 0.1); padding: 0.2rem 0.5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }+ .widget-card-name { font-size: 0.875rem; font-weight: 500; color: rgba(255, 255, 255, 0.9); margin-bottom: 0.5rem; }+ .widget-card-meta { font-size: 0.618rem; color: rgba(255, 255, 255, 0.4); margin-bottom: 0.5rem; }++ /* Studio */+ .studio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }+ .studio-tile {+ display: block;+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.07);+ border-radius: 10px;+ padding: 1rem;+ color: inherit;+ text-decoration: none;+ transition: border-color 0.15s, transform 0.1s;+ }+ .studio-tile:hover { border-color: rgba(59, 130, 246, 0.5); transform: translateY(-1px); }+ .studio-tile-title { font-size: 0.875rem; font-weight: 500; color: rgba(255, 255, 255, 0.9); margin-bottom: 0.382rem; }+ .studio-tile-desc { font-size: 0.764rem; color: rgba(255, 255, 255, 0.5); line-height: 1.4; }++ /* Danger */+ .danger-card { border-color: rgba(220, 38, 38, 0.3); }++ /* Tab bar scrolls when overflowing */+ .edit-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }+ .edit-tab { white-space: nowrap; flex-shrink: 0; }</style><link rel="stylesheet" href="/nav.css" /><link rel="stylesheet" href="/footer.css" />@@ -497,56 +782,21 @@</header><div class="edit-tabs" role="tablist" aria-label="Edit sections">- <button- class="edit-tab active"- data-tab="persona"- role="tab"- aria-selected="true"- aria-controls="panel-persona"- id="tab-persona"- >- Persona- </button>- <button- class="edit-tab"- data-tab="outfit"- role="tab"- aria-selected="false"- aria-controls="panel-outfit"- id="tab-outfit"- >- Outfit- </button>- <button- class="edit-tab"- data-tab="publish"- role="tab"- aria-selected="false"- aria-controls="panel-publish"- id="tab-publish"- >- Publish- </button>- <button- class="edit-tab"- data-tab="monetization"- role="tab"- aria-selected="false"- aria-controls="panel-monetization"- id="tab-monetization"- >- Monetization- </button>- <button- class="edit-tab"- data-tab="autopilot"- role="tab"- aria-selected="false"- aria-controls="panel-autopilot"- id="tab-autopilot"- >- Autopilot- </button>+ <button class="edit-tab active" data-tab="persona" role="tab" aria-selected="true" aria-controls="panel-persona" id="tab-persona">Persona</button>+ <button class="edit-tab" data-tab="outfit" role="tab" aria-selected="false" aria-controls="panel-outfit" id="tab-outfit">Outfit</button>+ <button class="edit-tab" data-tab="voice" role="tab" aria-selected="false" aria-controls="panel-voice" id="tab-voice">Voice</button>+ <button class="edit-tab" data-tab="knowledge" role="tab" aria-selected="false" aria-controls="panel-knowledge" id="tab-knowledge">Knowledge</button>+ <button class="edit-tab" data-tab="skills" role="tab" aria-selected="false" aria-controls="panel-skills" id="tab-skills">Skills</button>+ <button class="edit-tab" data-tab="publish" role="tab" aria-selected="false" aria-controls="panel-publish" id="tab-publish">Publish</button>+ <button class="edit-tab" data-tab="monetization" role="tab" aria-selected="false" aria-controls="panel-monetization" id="tab-monetization">Monetization</button>+ <button class="edit-tab" data-tab="wallet" role="tab" aria-selected="false" aria-controls="panel-wallet" id="tab-wallet">Wallet</button>+ <button class="edit-tab" data-tab="social" role="tab" aria-selected="false" aria-controls="panel-social" id="tab-social">Social</button>+ <button class="edit-tab" data-tab="autopilot" role="tab" aria-selected="false" aria-controls="panel-autopilot" id="tab-autopilot">Autopilot</button>+ <button class="edit-tab" data-tab="analytics" role="tab" aria-selected="false" aria-controls="panel-analytics" id="tab-analytics">Analytics</button>+ <button class="edit-tab" data-tab="embed" role="tab" aria-selected="false" aria-controls="panel-embed" id="tab-embed">Embed</button>+ <button class="edit-tab" data-tab="widgets" role="tab" aria-selected="false" aria-controls="panel-widgets" id="tab-widgets">Widgets</button>+ <button class="edit-tab" data-tab="studio" role="tab" aria-selected="false" aria-controls="panel-studio" id="tab-studio">Studio</button>+ <button class="edit-tab" data-tab="danger" role="tab" aria-selected="false" aria-controls="panel-danger" id="tab-danger">Danger</button></div><main id="main">@@ -588,21 +838,24 @@hidden><div class="outfit-preview" id="outfit-preview" aria-label="Avatar preview">- <!-- agent-3d inserted here once avatar is confirmed -->+ <!-- agent-3d injected by agent-edit.js when the tab opens --></div><div class="outfit-controls" id="outfit-controls"><div class="outfit-header">- <h2 class="outfit-title">Materials</h2>- <button+ <h2 class="outfit-title">Avatar</h2>+ <aclass="btn-reset-all"- id="btn-reset-all"- aria-label="Reset all materials"+ href="/dashboard/#avatars"+ aria-label="Create or manage avatars in the dashboard">- Reset all- </button>+ Manage in dashboard ›+ </a></div>- <div id="mat-list">- <div class="no-named-mats">Loading preview…</div>+ <p class="note" style="font-size: 0.764rem; color: rgba(255,255,255,0.4); margin: 0 0 1rem;">+ Pick which 3D avatar represents this agent. The preview updates on save.+ </p>+ <div id="avatar-picker-list" class="avatar-picker-list">+ <div class="no-named-mats">Loading avatars…</div></div></div></section>@@ -705,10 +958,419 @@></span></div></section>++ <!-- Voice tab -->+ <section class="edit-panel persona-panel" id="panel-voice" role="tabpanel" aria-labelledby="tab-voice" hidden>+ <div class="card">+ <div class="card-row">+ <div>+ <div class="card-title">Current voice</div>+ <div class="card-sub" id="voice-current">Loading…</div>+ </div>+ <div class="card-actions">+ <button class="btn-ghost" id="voice-preview-btn" hidden>Preview</button>+ <button class="btn-ghost danger" id="voice-remove-btn" hidden>Remove</button>+ </div>+ </div>+ </div>++ <div class="form-group">+ <label class="form-label">Pick an ElevenLabs voice</label>+ <input class="form-input" id="voice-filter" type="search" placeholder="Filter voices by name…" />+ <div id="voice-list" class="voice-list"><div class="muted">Loading voices…</div></div>+ </div>++ <div class="form-group">+ <label class="form-label">Or clone your own voice</label>+ <p class="hint">Upload at least 30 seconds of clean speech (mp3/wav/m4a, max 10 MB). 3 clones per day.</p>+ <div class="form-actions">+ <input type="file" id="voice-clone-file" accept="audio/*" hidden />+ <button class="btn-primary" id="voice-clone-btn">Upload & clone</button>+ <input class="form-input" id="voice-clone-name" type="text" placeholder="Clone name (optional)" style="max-width:240px" />+ <span class="form-status" id="voice-status" role="status" aria-live="polite"></span>+ </div>+ </div>+ </section>++ <!-- Knowledge tab -->+ <section class="edit-panel persona-panel" id="panel-knowledge" role="tabpanel" aria-labelledby="tab-knowledge" hidden>+ <p class="hint">Persistent memories the agent will recall. Add facts, preferences, references, and project context.</p>++ <div class="form-group">+ <label class="form-label" for="mem-type">Type</label>+ <select class="form-input" id="mem-type">+ <option value="reference">Reference</option>+ <option value="user">User</option>+ <option value="feedback">Feedback</option>+ <option value="project">Project</option>+ </select>+ </div>+ <div class="form-group">+ <label class="form-label" for="mem-content">Content</label>+ <textarea class="form-textarea" id="mem-content" rows="3" maxlength="4000" placeholder="Bug reports are tracked in Linear project INGEST…"></textarea>+ </div>+ <div class="form-group">+ <label class="form-label" for="mem-tags">Tags (comma-separated)</label>+ <input class="form-input" id="mem-tags" type="text" placeholder="incidents, observability" />+ </div>+ <div class="form-actions">+ <button class="btn-primary" id="mem-add-btn">Add memory</button>+ <span class="form-status" id="mem-status" role="status" aria-live="polite"></span>+ </div>++ <div class="form-group" style="margin-top:1.5rem">+ <label class="form-label">Seed from a URL</label>+ <p class="hint">Fetch a web page and import key facts as memories.</p>+ <div class="form-actions">+ <input class="form-input" id="mem-seed-url" type="url" placeholder="https://…" style="flex:1" />+ <button class="btn-ghost" id="mem-seed-btn">Seed</button>+ </div>+ </div>++ <div class="form-group" style="margin-top:1.5rem">+ <label class="form-label">Existing memories</label>+ <div id="mem-list" class="mem-list"><div class="muted">Loading…</div></div>+ </div>+ </section>++ <!-- Skills tab -->+ <section class="edit-panel persona-panel" id="panel-skills" role="tabpanel" aria-labelledby="tab-skills" hidden>+ <p class="hint">Skills the agent exposes. Built-ins (greet, present-model, validate-model, remember, think) are always available. Add custom skills below.</p>++ <div class="form-group">+ <label class="form-label">Active skills</label>+ <div id="skills-list" class="chip-list"><div class="muted">Loading…</div></div>+ </div>++ <div class="form-group">+ <label class="form-label" for="skill-add-input">Add a skill</label>+ <div class="form-actions">+ <input class="form-input" id="skill-add-input" type="text" placeholder="skill-slug (e.g. translate-text)" list="skills-marketplace" style="flex:1" />+ <datalist id="skills-marketplace"></datalist>+ <button class="btn-primary" id="skill-add-btn">Add</button>+ </div>+ <p class="hint">Browse the marketplace for community skills: <a href="/marketplace.html" target="_blank" rel="noopener" style="color:#93c5fd">marketplace ›</a></p>+ </div>++ <div class="form-actions">+ <button class="btn-primary" id="skills-save">Save skills</button>+ <span class="form-status" id="skills-status" role="status" aria-live="polite"></span>+ </div>+ </section>++ <!-- Wallet tab -->+ <section class="edit-panel persona-panel" id="panel-wallet" role="tabpanel" aria-labelledby="tab-wallet" hidden>+ <div class="wallet-grid">+ <div class="card">+ <div class="card-title">Solana wallet</div>+ <div class="card-sub mono" id="wallet-sol-address">—</div>+ <div class="card-row" style="margin-top:.618rem">+ <div>+ <div class="metric-label">SOL</div>+ <div class="metric-value" id="wallet-sol-balance">—</div>+ </div>+ <div>+ <div class="metric-label">USDC</div>+ <div class="metric-value" id="wallet-usdc-balance">—</div>+ </div>+ <div>+ <div class="metric-label">Total</div>+ <div class="metric-value" id="wallet-total-usd">—</div>+ </div>+ </div>+ <div class="card-actions" style="margin-top:.875rem">+ <button class="btn-primary" id="wallet-send-btn">Send</button>+ <button class="btn-ghost" id="wallet-fund-btn">Fund</button>+ <button class="btn-ghost" id="wallet-copy-sol">Copy address</button>+ <a class="btn-ghost" id="wallet-explorer" href="#" target="_blank" rel="noopener">Explorer ›</a>+ </div>+ </div>++ <div class="card">+ <div class="card-title">EVM wallet</div>+ <div class="card-sub mono" id="wallet-evm-address">Not linked.</div>+ <div class="card-row" style="margin-top:.618rem">+ <div>+ <div class="metric-label">Chain</div>+ <div class="metric-value" id="wallet-evm-chain">—</div>+ </div>+ </div>+ <div class="card-actions" style="margin-top:.875rem">+ <button class="btn-ghost" id="wallet-evm-copy">Copy address</button>+ <a class="btn-ghost" id="wallet-evm-explorer" href="#" target="_blank" rel="noopener" hidden>Explorer ›</a>+ </div>+ </div>++ <div class="card">+ <div class="card-title">On-chain identity</div>+ <div class="card-sub" id="wallet-identity">Loading…</div>+ </div>++ <div class="card">+ <div class="card-title">Recent activity</div>+ <div class="card-sub" id="wallet-activity">Loading…</div>+ </div>+ </div>++ <!-- Send modal -->+ <div id="send-modal" class="modal" hidden>+ <div class="modal-card">+ <div class="modal-title">Send from agent wallet</div>+ <div class="form-group">+ <label class="form-label" for="send-asset">Asset</label>+ <select class="form-input" id="send-asset">+ <option value="usdc">USDC (Solana)</option>+ <option value="sol">SOL</option>+ </select>+ </div>+ <div class="form-group">+ <label class="form-label" for="send-to">Recipient address</label>+ <input class="form-input" id="send-to" type="text" placeholder="Solana address" />+ </div>+ <div class="form-group">+ <label class="form-label" for="send-amount">Amount</label>+ <input class="form-input" id="send-amount" type="number" min="0" step="0.000001" placeholder="0.00" />+ </div>+ <div class="form-actions">+ <button class="btn-primary" id="send-confirm">Send</button>+ <button class="btn-ghost" id="send-cancel">Cancel</button>+ <span class="form-status" id="send-status" role="status" aria-live="polite"></span>+ </div>+ </div>+ </div>++ <!-- Fund modal -->+ <div id="fund-modal" class="modal" hidden>+ <div class="modal-card">+ <div class="modal-title">Fund this agent</div>+ <p class="hint">Send SOL or USDC (Solana) to the address below.</p>+ <div class="qr-wrap"><img id="fund-qr" alt="Wallet QR code" /></div>+ <div class="card-sub mono" id="fund-address">—</div>+ <div class="form-actions">+ <button class="btn-ghost" id="fund-copy">Copy address</button>+ <button class="btn-ghost" id="fund-close">Close</button>+ </div>+ </div>+ </div>+ </section>++ <!-- Social tab -->+ <section class="edit-panel persona-panel" id="panel-social" role="tabpanel" aria-labelledby="tab-social" hidden>+ <div class="card">+ <div class="card-row">+ <div>+ <div class="card-title">X (Twitter)</div>+ <div class="card-sub" id="x-status">Loading…</div>+ </div>+ <div class="card-actions">+ <button class="btn-primary" id="x-connect-btn" hidden>Connect X</button>+ <button class="btn-ghost danger" id="x-disconnect-btn" hidden>Disconnect</button>+ </div>+ </div>+ </div>++ <div class="form-group">+ <label class="form-label" for="x-username">Agent's X handle (public, optional)</label>+ <div class="form-actions">+ <input class="form-input" id="x-username" type="text" placeholder="@handle" style="flex:1" />+ <button class="btn-ghost" id="x-username-save">Save handle</button>+ </div>+ </div>++ <div class="form-group">+ <label class="form-label">Scheduled posts</label>+ <p class="hint">Triggers run on cron and post automatically.</p>+ <div id="x-triggers-list" class="trigger-list"><div class="muted">Loading…</div></div>+ <div class="form-actions" style="margin-top:.5rem">+ <select class="form-input" id="x-trigger-kind" style="max-width:220px">+ <option value="daily_persona">Daily persona post</option>+ <option value="weekly_digest">Weekly digest</option>+ <option value="price_milestone">Price milestone</option>+ <option value="payment_received">Payment received</option>+ </select>+ <button class="btn-primary" id="x-trigger-add">Add trigger</button>+ </div>+ </div>++ <div class="form-group">+ <label class="form-label">Post now</label>+ <textarea class="form-textarea" id="x-post-text" rows="3" maxlength="280" placeholder="Compose a tweet (max 280 chars)…"></textarea>+ <div class="form-actions">+ <button class="btn-primary" id="x-post-btn">Post to X</button>+ <span class="form-status" id="x-post-status" role="status" aria-live="polite"></span>+ </div>+ </div>+ </section>++ <!-- Analytics tab -->+ <section class="edit-panel persona-panel" id="panel-analytics" role="tabpanel" aria-labelledby="tab-analytics" hidden>+ <div class="metrics-grid">+ <div class="metric-card">+ <div class="metric-label">LLM calls (this month)</div>+ <div class="metric-value" id="m-llm-month">—</div>+ </div>+ <div class="metric-card">+ <div class="metric-label">LLM calls (30d)</div>+ <div class="metric-value" id="m-llm-30d">—</div>+ </div>+ <div class="metric-card">+ <div class="metric-label">Earnings received</div>+ <div class="metric-value" id="m-earn-in">—</div>+ </div>+ <div class="metric-card">+ <div class="metric-label">Spend (paid to others)</div>+ <div class="metric-value" id="m-earn-out">—</div>+ </div>+ </div>++ <div class="form-group" style="margin-top:1rem">+ <label class="form-label">Calls per day (30 days)</label>+ <div id="m-chart" class="bar-chart"><div class="muted">Loading…</div></div>+ </div>++ <div class="form-group">+ <label class="form-label">Recent payments received</label>+ <div id="m-pay-in" class="pay-list"><div class="muted">Loading…</div></div>+ </div>+ <div class="form-group">+ <label class="form-label">Recent payments sent</label>+ <div id="m-pay-out" class="pay-list"><div class="muted">Loading…</div></div>+ </div>+ </section>++ <!-- Embed tab -->+ <section class="edit-panel persona-panel" id="panel-embed" role="tabpanel" aria-labelledby="tab-embed" hidden>+ <p class="hint">Drop your agent on any website, Notion page, or Discord channel.</p>++ <div class="form-group">+ <label class="form-label" for="embed-size">Preview size</label>+ <select class="form-input" id="embed-size" style="max-width:220px">+ <option value="420x520">Small (420×520)</option>+ <option value="560x680" selected>Medium (560×680)</option>+ <option value="800x900">Large (800×900)</option>+ <option value="100%x600">Full width (×600)</option>+ </select>+ </div>++ <div class="form-group">+ <label class="form-label">Live preview</label>+ <div id="embed-preview" class="embed-preview"></div>+ </div>++ <div class="form-group">+ <label class="form-label" for="embed-iframe-code">Iframe snippet</label>+ <textarea class="form-input mono" id="embed-iframe-code" rows="3" readonly></textarea>+ <div class="form-actions"><button class="btn-ghost" data-copy="#embed-iframe-code">Copy</button></div>+ </div>++ <div class="form-group">+ <label class="form-label" for="embed-link">Direct link</label>+ <input class="form-input mono" id="embed-link" type="text" readonly />+ <div class="form-actions"><button class="btn-ghost" data-copy="#embed-link">Copy</button> <a class="btn-ghost" id="embed-open" href="#" target="_blank" rel="noopener">Open in new tab ›</a></div>+ </div>++ <div class="form-group">+ <label class="form-label" for="embed-oembed">oEmbed discovery URL</label>+ <input class="form-input mono" id="embed-oembed" type="text" readonly />+ <div class="form-actions"><button class="btn-ghost" data-copy="#embed-oembed">Copy</button></div>+ </div>++ <div class="form-group">+ <label class="form-label">Embed policy</label>+ <p class="hint">Restrict which sites and surfaces may embed this agent.</p>+ <label class="form-label" for="embed-allowed-origins">Allowed origins (one per line, * for any)</label>+ <textarea class="form-input mono" id="embed-allowed-origins" rows="3" placeholder="https://example.com https://*.mysite.com"></textarea>+ <div class="form-actions">+ <button class="btn-primary" id="embed-policy-save">Save policy</button>+ <button class="btn-ghost" id="embed-policy-clear">Clear policy</button>+ <span class="form-status" id="embed-policy-status" role="status" aria-live="polite"></span>+ </div>+ </div>+ </section>++ <!-- Widgets tab -->+ <section class="edit-panel persona-panel" id="panel-widgets" role="tabpanel" aria-labelledby="tab-widgets" hidden>+ <p class="hint">Widgets are reusable embeds (turntable, talking-agent, gallery) you can paste anywhere.</p>++ <div class="form-group">+ <label class="form-label">Create a widget for this agent's avatar</label>+ <div class="form-actions">+ <select class="form-input" id="widget-new-type" style="max-width:220px">+ <option value="talking-agent">Talking agent</option>+ <option value="turntable">Turntable</option>+ <option value="animation-gallery">Animation gallery</option>+ <option value="passport">Passport</option>+ <option value="hotspot-tour">Hotspot tour</option>+ </select>+ <input class="form-input" id="widget-new-name" type="text" placeholder="Widget name" style="flex:1" />+ <button class="btn-primary" id="widget-new-btn">Create</button>+ </div>+ <span class="form-status" id="widget-status" role="status" aria-live="polite"></span>+ </div>++ <div class="form-group" style="margin-top:1rem">+ <label class="form-label">Your widgets</label>+ <div id="widgets-list" class="widget-list"><div class="muted">Loading…</div></div>+ </div>+ </section>++ <!-- Studio tab -->+ <section class="edit-panel persona-panel" id="panel-studio" role="tabpanel" aria-labelledby="tab-studio" hidden>+ <p class="hint">Power-user tools for tuning the avatar, animations, and on-chain identity.</p>++ <div class="studio-grid">+ <a class="studio-tile" id="studio-playground" href="#" target="_blank" rel="noopener">+ <div class="studio-tile-title">3D Playground</div>+ <div class="studio-tile-desc">Inspect the avatar in a freeform Three.js scene.</div>+ </a>+ <a class="studio-tile" id="studio-avatar" href="#" target="_blank" rel="noopener">+ <div class="studio-tile-title">Avatar studio</div>+ <div class="studio-tile-desc">Customize materials, animations, and metadata.</div>+ </a>+ <a class="studio-tile" id="studio-marketplace" href="/marketplace.html" target="_blank" rel="noopener">+ <div class="studio-tile-title">Marketplace</div>+ <div class="studio-tile-desc">Browse and remix published agents.</div>+ </a>+ <a class="studio-tile" id="studio-dashboard" href="/dashboard/" target="_blank" rel="noopener">+ <div class="studio-tile-title">Creator dashboard</div>+ <div class="studio-tile-desc">All your agents, avatars, widgets, and revenue.</div>+ </a>+ <a class="studio-tile" id="studio-public" href="#" target="_blank" rel="noopener">+ <div class="studio-tile-title">Public agent page</div>+ <div class="studio-tile-desc">See your agent the way visitors do.</div>+ </a>+ <a class="studio-tile" id="studio-manifest" href="#" target="_blank" rel="noopener">+ <div class="studio-tile-title">Agent manifest (JSON)</div>+ <div class="studio-tile-desc">Canonical machine-readable agent spec.</div>+ </a>+ </div>++ <div class="form-group" style="margin-top:1.5rem">+ <label class="form-label">Animations</label>+ <div id="studio-animations" class="chip-list"><div class="muted">None.</div></div>+ </div>+ </section>++ <!-- Danger zone -->+ <section class="edit-panel persona-panel" id="panel-danger" role="tabpanel" aria-labelledby="tab-danger" hidden>+ <div class="card danger-card">+ <div class="card-title">Delete this agent</div>+ <p class="hint">Soft-deletes the agent, removes all memories, and unlists it from your dashboard. Wallet keys stay encrypted in cold storage. This cannot be undone from the UI.</p>+ <div class="form-group">+ <label class="form-label" for="danger-confirm">Type the agent's name to confirm:</label>+ <input class="form-input" id="danger-confirm" type="text" autocomplete="off" />+ </div>+ <div class="form-actions">+ <button class="btn-danger" id="danger-delete-btn" disabled>Delete agent</button>+ <span class="form-status" id="danger-status" role="status" aria-live="polite"></span>+ </div>+ </div>+ </section></main><div class="outfit-status" id="outfit-status" role="status" aria-live="polite"></div>+ <script type="module" src="/dist-lib/agent-3d.js"></script><script type="module" src="/src/agent-edit.js"></script><div id="footer-container"></div>diff --git a/agent-home.html b/agent-home.htmlindex 546d7f673..96a2479bd 100644--- a/agent-home.html+++ b/agent-home.html@@ -259,6 +259,61 @@text-align: center;}+ .agent-type-pill {+ display: inline-flex;+ align-items: center;+ gap: 0.4em;+ font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;+ font-size: 0.62rem;+ letter-spacing: 0.18em;+ text-transform: uppercase;+ color: rgba(255, 215, 0, 0.85);+ background: rgba(255, 215, 0, 0.07);+ border: 1px solid rgba(255, 215, 0, 0.22);+ padding: 0.25em 0.75em;+ border-radius: 999px;+ font-weight: 600;+ margin-bottom: 0.9rem;+ }+ .agent-type-pill .agent-type-help {+ color: rgba(255, 215, 0, 0.55);+ text-decoration: none;+ border-left: 1px solid rgba(255, 215, 0, 0.25);+ padding-left: 0.55em;+ margin-left: 0.1em;+ font-size: 0.85em;+ cursor: help;+ }+ .agent-type-pill .agent-type-help:hover {+ color: rgba(255, 215, 0, 1);+ }++ .agent-body-link {+ display: flex;+ width: fit-content;+ align-items: center;+ gap: 0.45em;+ margin: 0.85rem auto 0;+ font-size: 0.7rem;+ color: rgba(255, 255, 255, 0.45);+ text-decoration: none;+ padding: 0.3em 0.8em;+ border: 1px solid rgba(255, 255, 255, 0.1);+ border-radius: 999px;+ transition: color 0.15s, border-color 0.15s, background 0.15s;+ }+ .agent-body-link:hover {+ color: #fff;+ border-color: rgba(255, 255, 255, 0.3);+ background: rgba(255, 255, 255, 0.04);+ }+ .agent-body-link-key {+ font-size: 0.58rem;+ text-transform: uppercase;+ letter-spacing: 0.12em;+ color: rgba(255, 255, 255, 0.3);+ }+.agent-page-title {font-size: 2rem;font-weight: 300;@@ -753,9 +808,24 @@ar-modes="webxr scene-viewer quick-look"alt="Loading agent avatar"></model-viewer>- <p class="agent-stage-empty" id="agent-stage-empty" hidden>- This agent doesn't have a body yet.- </p>+ <div class="agent-stage-empty" id="agent-stage-empty" hidden>+ <p style="margin:0 0 0.6rem;">This agent doesn't have a body yet.</p>+ <a+ class="agent-stage-cta agent-stage-cta--primary"+ href="/marketplace?tab=avatars"+ style="font-size:0.78rem; padding:0.45em 0.95em;"+ >Pick a body →</a>+ </div>+ <a+ class="agent-body-link"+ id="agent-body-link"+ href="#"+ hidden+ title="Open the 3D body this agent wears"+ >+ <span class="agent-body-link-key">Body</span>+ <span id="agent-body-link-name">View avatar →</span>+ </a><div class="agent-stage-cta-row" id="agent-stage-ctas" hidden><a class="agent-stage-cta agent-stage-cta--primary" id="agent-stage-edit" hidden>Open in editor →</a@@ -784,6 +854,15 @@</section><div class="agent-page-hero">+ <div class="agent-type-pill" id="agent-type-pill" aria-label="This page is an agent profile">+ <span>Agent</span>+ <a+ class="agent-type-help"+ href="/docs/agents-vs-avatars"+ aria-label="What is an agent?"+ title="An agent is the mind — identity, skills, wallet. An avatar is the body it wears. Learn more."+ >?</a>+ </div><h1 class="agent-page-title" id="page-agent-name">Agent</h1><p class="agent-page-subtitle" id="page-agent-desc">Embodied. Present. Persistent.@@ -1011,10 +1090,10 @@const card = document.createElement('a');card.className = 'my-agents-card';card.href = `/agent/${agent.id}`;- const avatarUrl = agent.avatar?.startsWith('http') ? agent.avatar : `/api/avatars/${agent.avatar}/thumbnail`;+ const avatarUrl = agent.avatar_thumbnail_url || '/three.svg';const name = escapeHtml(agent.name);card.innerHTML = `- <img src="${escapeHtml(avatarUrl || '/three.svg')}" class="my-agents-card-icon" alt="${name} avatar">+ <img src="${escapeHtml(avatarUrl)}" class="my-agents-card-icon" alt="${name} avatar" onerror="this.src='/three.svg'"><div class="my-agents-card-title">${name}</div><div class="my-agents-card-desc">${escapeHtml(agent.description || 'No description')}</div>${agent.onchain ? '<div class="my-agents-card-badge">On-chain</div>' : ''}@@ -1219,19 +1298,29 @@}} catch {}- const glbUrl = await resolveAgentGlb(identity);- if (glbUrl) {- viewer.src = glbUrl;+ const resolved = await resolveAgentGlb(identity);+ if (resolved?.url) {+ viewer.src = resolved.url;} else {empty.hidden = false;viewer.style.display = 'none';}+ if (resolved?.avatarId) {+ const bodyLink = document.getElementById('agent-body-link');+ const bodyName = document.getElementById('agent-body-link-name');+ if (bodyLink) {+ bodyLink.href = `/avatars/${resolved.avatarId}`;+ bodyLink.hidden = false;+ }+ if (bodyName && resolved.avatarName) {+ bodyName.textContent = `${resolved.avatarName} →`;+ }+ }stage.setAttribute('aria-busy', 'false');}async function resolveAgentGlb(identity) {try {- // identity.avatarId is already populated from the backend in _loadAsyncconst avatarId = identity.avatarId;if (!avatarId) return null;@@ -1240,7 +1329,8 @@});if (!avResp.ok) return null;const { avatar } = await avResp.json();- return avatar?.url || null;+ if (!avatar?.url) return null;+ return { url: avatar.url, avatarId, avatarName: avatar.name || '' };} catch {return null;}diff --git a/api/_lib/migrations/2026-05-13-drop-agent-identities-user-unique.sql b/api/_lib/migrations/2026-05-13-drop-agent-identities-user-unique.sqlnew file mode 100644index 000000000..7e433a229--- /dev/null+++ b/api/_lib/migrations/2026-05-13-drop-agent-identities-user-unique.sql@@ -0,0 +1,8 @@+-- Drop the partial UNIQUE index that capped each user at one non-deleted agent.+-- The dashboard (Your agents → New agent) and api/agents POST handler are+-- designed for multi-agent ownership; the unique index blocked every create+-- after the first with `duplicate key value violates unique constraint+-- "agent_identities_user_unique"`. The non-unique companion index+-- `agent_identities_user` remains and continues to serve the per-user lookups+-- in handleList / handleGetOrCreateMe.+drop index if exists agent_identities_user_unique;diff --git a/api/_lib/migrations/2026-05-13-x-pro-features.sql b/api/_lib/migrations/2026-05-13-x-pro-features.sqlnew file mode 100644index 000000000..ee3658be7--- /dev/null+++ b/api/_lib/migrations/2026-05-13-x-pro-features.sql@@ -0,0 +1,28 @@+-- Pro features: tone presets, auto-publish flag for triggers, metrics on+-- past posts, cadence guard (last_posted_at), and threads.++alter table avatars add column if not exists tone text;+alter table x_triggers add column if not exists auto_publish boolean not null default true;+alter table x_posts add column if not exists metrics jsonb;+alter table x_posts add column if not exists metrics_fetched_at timestamptz;+alter table x_posts add column if not exists reply_to_tweet_id text;+alter table x_scheduled_posts add column if not exists reply_to_tweet_id text;+alter table x_scheduled_posts add column if not exists thread_parts jsonb;+alter table social_connections add column if not exists last_posted_at timestamptz;++-- Pending reviews: when a trigger fires with auto_publish=false, we stash+-- the draft here for the user to approve / edit / reject.+create table if not exists x_pending_reviews (+ id uuid primary key default gen_random_uuid(),+ user_id uuid not null references users(id) on delete cascade,+ trigger_id uuid references x_triggers(id) on delete cascade,+ agent_id text,+ text text not null,+ thread_parts jsonb,+ status text not null default 'pending' check (status in ('pending','approved','rejected')),+ created_at timestamptz not null default now(),+ resolved_at timestamptz+);++create index if not exists x_pending_reviews_user_pending_idx+ on x_pending_reviews(user_id, created_at desc) where status = 'pending';diff --git a/api/_lib/migrations/2026-05-13-x-triggers.sql b/api/_lib/migrations/2026-05-13-x-triggers.sqlnew file mode 100644index 000000000..f804c071a--- /dev/null+++ b/api/_lib/migrations/2026-05-13-x-triggers.sql@@ -0,0 +1,24 @@+-- Auto-post triggers. Each row is a rule like "tweet daily at 9am UTC" or+-- "tweet when my token mcap crosses these thresholds". The run-x-triggers+-- cron evaluates predicates and enqueues posts in x_scheduled_posts.++create table if not exists x_triggers (+ id uuid primary key default gen_random_uuid(),+ user_id uuid not null references users(id) on delete cascade,+ agent_id text,+ kind text not null check (kind in (+ 'daily_persona',+ 'weekly_digest',+ 'price_milestone',+ 'payment_received'+ )),+ config jsonb not null default '{}'::jsonb,+ enabled boolean not null default true,+ last_fired_at timestamptz,+ last_state jsonb not null default '{}'::jsonb,+ created_at timestamptz not null default now(),+ updated_at timestamptz not null default now()+);++create index if not exists x_triggers_user_idx on x_triggers(user_id);+create index if not exists x_triggers_enabled_idx on x_triggers(kind, enabled) where enabled = true;diff --git a/api/_lib/pump.js b/api/_lib/pump.jsindex 0507f870d..9613a3994 100644--- a/api/_lib/pump.js+++ b/api/_lib/pump.js@@ -51,8 +51,22 @@ export async function getPumpSdk({ network = 'mainnet' } = {}) {import('bn.js').then((m) => m.default || m),]);const connection = getConnection({ network });- const sdk = new OnlinePumpSdk() ? new OnlinePumpSdk(connection) : new PumpSdk(connection);- return { sdk, connection, BN, web3, PumpSdk, OnlinePumpSdk };+ // `OnlinePumpSdk` exposes the `fetch*` helpers; the instruction builders+ // (`createInstruction`, `createV2AndBuyInstructions`, `buyInstructions`, …)+ // live on the offline `PumpSdk`. Compose both so callers see one `sdk` with+ // the full surface — required by the studio launch flow.+ const offline = new PumpSdk();+ const online = OnlinePumpSdk ? new OnlinePumpSdk(connection) : null;+ const sdk = online+ ? new Proxy(online, {+ get(target, prop, receiver) {+ if (prop in target) return Reflect.get(target, prop, receiver);+ const fallback = offline[prop];+ return typeof fallback === 'function' ? fallback.bind(offline) : fallback;+ },+ })+ : offline;+ return { sdk, connection, BN, web3, PumpSdk, OnlinePumpSdk, offline, online };}// v2 bonding curve helpers — buy_v2, sell_v2, create_v2, USDC quote support@@ -108,7 +122,7 @@ export async function getPumpSwapSdk({ network = 'mainnet' } = {}) {]);const connection = getConnection({ network });const sdk = new PumpAmmSdk(connection);- const internalSdk = new PumpAmmInternalSdk() ? new PumpAmmInternalSdk(connection) : null;+ const internalSdk = PumpAmmInternalSdk ? new PumpAmmInternalSdk(connection) : null;return { sdk, internalSdk, connection, BN, web3 };}diff --git a/api/_lib/schema.sql b/api/_lib/schema.sqlindex 3e926e5e9..fd2f94944 100644--- a/api/_lib/schema.sql+++ b/api/_lib/schema.sql@@ -276,8 +276,6 @@ CREATE TABLE IF NOT EXISTS agent_identities (create index if not exists agent_identities_useron agent_identities(user_id) where deleted_at is null;-create unique index if not exists agent_identities_user_unique- on agent_identities(user_id) where deleted_at is null;create index if not exists agent_identities_walleton agent_identities(wallet_address) where wallet_address is not null;@@ -490,10 +488,6 @@ create table if not exists agent_registrations_pending (create index if not exists agent_registrations_pending_user_expiryon agent_registrations_pending(user_id, expires_at);--- ── Additive: ensure partial unique index exists (required by ON CONFLICT in agents.js) ──-create unique index if not exists agent_identities_user_unique- on agent_identities(user_id) where deleted_at is null;--- ── agent_delegations — ERC-7710 signed delegation envelopes ────────────────create table if not exists agent_delegations (id uuid primary key default gen_random_uuid(),diff --git a/api/agents.js b/api/agents.jsindex 967fc440e..d431fbb2c 100644--- a/api/agents.js+++ b/api/agents.js@@ -113,7 +113,7 @@ async function handleGetOrCreateMe(req, res, auth) {const sol = await generateSolanaAgentWallet();await sql`INSERT INTO agent_identities (user_id, name, skills, wallet_address, meta)- VALUES (+ SELECT${auth.userId},${'Agent'},${['greet', 'present-model', 'validate-model', 'remember', 'think']},@@ -123,10 +123,14 @@ async function handleGetOrCreateMe(req, res, auth) {solana_address: sol.address,encrypted_solana_secret: sol.encrypted_secret,})}::jsonb+ WHERE NOT EXISTS (+ SELECT 1 FROM agent_identities+ WHERE user_id = ${auth.userId} AND deleted_at IS NULL)- ON CONFLICT (user_id) WHERE deleted_at IS NULL DO NOTHING`;- // Re-select covers both: we inserted, or a concurrent request beat us.+ // Re-select returns the oldest agent: if a concurrent request beat+ // us, that one wins; if both inserted (rare race during first visit),+ // the oldest is canonical and the extra row is harmless.[agent] = await sql`SELECT i.*,a.storage_key AS avatar_storage_key,@@ -438,6 +442,14 @@ function decorate(row, isOwner = true) {base.erc8004_agent_id = row.erc8004_agent_id;base.erc8004_registry = row.erc8004_registry;base.registration_cid = row.registration_cid;+ // Publish-time fields needed by the agent editor. Owner-only because the+ // system prompt is private IP.+ base.system_prompt = row.system_prompt || null;+ base.greeting = row.greeting || null;+ base.category = row.category || null;+ base.tags = row.tags || [];+ base.capabilities = row.capabilities || {};+ base.is_published = !!row.is_published;}return base;}diff --git a/api/auth/x/[action].js b/api/auth/x/[action].jsindex 775c68e26..c5c5cc690 100644--- a/api/auth/x/[action].js+++ b/api/auth/x/[action].js@@ -108,10 +108,7 @@ async function handleCallback(req, res) {const code = url.searchParams.get('code');const state = url.searchParams.get('state');- if (url.searchParams.get('error')) {- return redirect(res, `/settings?tab=connected-accounts&x=denied`);- }- if (!code || !state) return error(res, 400, 'validation_error', 'missing code or state');+ if (!state) return error(res, 400, 'validation_error', 'missing state');const r = getRedis();const raw = await r.get(`x_oauth:${state}`);@@ -119,7 +116,19 @@ async function handleCallback(req, res) {await r.del(`x_oauth:${state}`);const stateData = typeof raw === 'string' ? JSON.parse(raw) : raw;- const { code_verifier: codeVerifier, user_id: userId } = stateData;+ const { code_verifier: codeVerifier, user_id: userId, agent_id: stateAgentId } = stateData;+ const successRedirect = stateAgentId+ ? `/agent-edit.html?id=${encodeURIComponent(stateAgentId)}&tab=social&x=connected`+ : `/settings?tab=connected-accounts&x=connected`;+ const errorRedirect = stateAgentId+ ? `/agent-edit.html?id=${encodeURIComponent(stateAgentId)}&tab=social&x=error`+ : `/settings?tab=connected-accounts&x=error`;+ const deniedRedirect = stateAgentId+ ? `/agent-edit.html?id=${encodeURIComponent(stateAgentId)}&tab=social&x=denied`+ : `/settings?tab=connected-accounts&x=denied`;++ if (url.searchParams.get('error')) return redirect(res, deniedRedirect);+ if (!code) return error(res, 400, 'validation_error', 'missing code');// Exchange code for tokensconst creds = Buffer.from(`${env.X_OAUTH_CLIENT_ID}:${env.X_OAUTH_CLIENT_SECRET}`).toString(@@ -142,7 +151,7 @@ async function handleCallback(req, res) {if (!tokenRes.ok) {console.error('[x-oauth] token exchange failed', await tokenRes.text());- return redirect(res, `/settings?tab=connected-accounts&x=error`);+ return redirect(res, errorRedirect);}const tokens = await tokenRes.json();@@ -156,7 +165,7 @@ async function handleCallback(req, res) {);if (!profileRes.ok) {console.error('[x-oauth] profile fetch failed', await profileRes.text());- return redirect(res, `/settings?tab=connected-accounts&x=error`);+ return redirect(res, errorRedirect);}const { data: profile } = await profileRes.json();@@ -180,7 +189,7 @@ async function handleCallback(req, res) {updated_at = now()`;- return redirect(res, `/settings?tab=connected-accounts&x=connected`);+ return redirect(res, successRedirect);}// ── dispatch ──────────────────────────────────────────────────────────────────diff --git a/api/cron/[name].js b/api/cron/[name].jsindex 2aef4ae2c..9abc3bea9 100644--- a/api/cron/[name].js+++ b/api/cron/[name].js@@ -68,6 +68,7 @@ const HANDLERS = {'cleanup-csrf-tokens': handleCleanupCsrfTokens,'process-withdrawals': handleProcessWithdrawals,'run-x-scheduled-posts': handleRunXScheduledPosts,+ 'run-x-triggers': handleRunXTriggers,};export default wrap(async (req, res) => {@@ -2609,3 +2610,217 @@ async function handleRunXScheduledPosts(req, res) {return json(res, 200, report);}++// ═══════════════════════════════════════════════════════════════════════════+// run-x-triggers+//+// Evaluates enabled rows in x_triggers. Each kind has its own predicate;+// when it fires, we draft post text (LLM for personas, formatted for+// milestones) and insert into x_scheduled_posts with scheduled_at=now().+// The run-x-scheduled-posts cron picks it up on the next tick.+// ═══════════════════════════════════════════════════════════════════════════++const TRIGGER_BUDGET_MS = 60_000;+const SOL_USD_FALLBACK = 150;++async function handleRunXTriggers(req, res) {+ if (cors(req, res, { methods: 'GET,POST,OPTIONS' })) return;+ const auth = req.headers['authorization'] || '';+ const expected = env.CRON_SECRET ? `Bearer ${env.CRON_SECRET}` : null;+ const fromCron = req.headers['x-vercel-cron'] === '1';+ if (!fromCron && expected && auth !== expected) {+ return error(res, 401, 'unauthorized', 'cron secret required');+ }++ const started = Date.now();+ const rows = await sql`+ select id, user_id, agent_id, kind, config, last_fired_at, last_state+ from x_triggers+ where enabled = true+ order by coalesce(last_fired_at, '1970-01-01'::timestamptz) asc+ limit 200+ `;++ const report = { evaluated: 0, fired: 0, skipped: 0, errors: 0 };+ for (const t of rows) {+ if (Date.now() - started > TRIGGER_BUDGET_MS) break;+ report.evaluated++;+ try {+ const fired = await evalTrigger(t);+ if (fired) report.fired++;+ else report.skipped++;+ } catch (err) {+ report.errors++;+ console.error('[run-x-triggers] error', t.id, t.kind, err.message);+ }+ }+ return json(res, 200, report);+}++async function evalTrigger(t) {+ if (t.kind === 'daily_persona') return await evalDailyPersona(t);+ if (t.kind === 'weekly_digest') return await evalWeeklyDigest(t);+ if (t.kind === 'price_milestone') return await evalPriceMilestone(t);+ if (t.kind === 'payment_received') return await evalPaymentReceived(t);+ return false;+}++function utcHour(d) { return d.getUTCHours(); }+function utcDay(d) { return d.getUTCDay(); }+function ymdUTC(d) { return `${d.getUTCFullYear()}-${String(d.getUTCMonth()+1).padStart(2,'0')}-${String(d.getUTCDate()).padStart(2,'0')}`; }++async function enqueueTriggerPost(t, text) {+ await sql`+ insert into x_scheduled_posts (user_id, agent_id, text, scheduled_at)+ values (${t.user_id}, ${t.agent_id}, ${text}, now())+ `;+}++async function setTriggerState(t, state) {+ await sql`update x_triggers set last_state = ${JSON.stringify(state)}::jsonb, last_fired_at = now() where id = ${t.id}`;+}++async function loadAvatarFromAgent(agentId) {+ if (!agentId) return null;+ const r = await sql`select id, name, description, agent_id from avatars where id = ${agentId} or agent_id::text = ${agentId} limit 1`;+ return r[0] || null;+}++const DRAFT_SYSTEM = `You write tweets for AI agents on three.ws. Tweets must be:+- Under 280 characters (hard limit).+- In the agent's voice (first person, matching the description).+- No hashtag spam. At most 1 hashtag.+- No leading/trailing quotes. Plain text only.+- Avoid em-dashes.+Output ONLY the tweet text, nothing else.`;++async function llmDraft({ system, user, max = 200 }) {+ const r = await fetch('https://api.anthropic.com/v1/messages', {+ method: 'POST',+ headers: {+ 'content-type': 'application/json',+ 'anthropic-version': '2023-06-01',+ 'x-api-key': env.ANTHROPIC_API_KEY,+ },+ body: JSON.stringify({+ model: 'claude-haiku-4-5-20251001',+ max_tokens: max,+ system,+ messages: [{ role: 'user', content: user }],+ }),+ });+ if (!r.ok) throw new Error(`llm failed: ${await r.text()}`);+ const data = await r.json();+ let text = (data.content?.[0]?.text || '').trim();+ if (text.startsWith('"') && text.endsWith('"')) text = text.slice(1, -1).trim();+ if (text.length > 280) text = text.slice(0, 279) + '…';+ return text;+}++async function evalDailyPersona(t) {+ const now = new Date();+ if (utcHour(now) !== Number(t.config.hour_utc)) return false;+ const today = ymdUTC(now);+ if (t.last_state?.fired_ymd === today) return false;++ const avatar = await loadAvatarFromAgent(t.agent_id);+ const ctx = avatar+ ? `Agent name: ${avatar.name || 'Unnamed'}\nAgent description: ${avatar.description || '(none)'}`+ : '';+ const topic = t.config.topic ? `Topic for today: ${t.config.topic}` : 'Write something engaging and in-character about being an autonomous AI agent today.';+ const text = await llmDraft({ system: DRAFT_SYSTEM, user: [ctx, topic].filter(Boolean).join('\n\n') });+ await enqueueTriggerPost(t, text);+ await setTriggerState(t, { fired_ymd: today });+ return true;+}++async function evalWeeklyDigest(t) {+ const now = new Date();+ if (utcDay(now) !== Number(t.config.day_of_week) || utcHour(now) !== Number(t.config.hour_utc)) return false;+ const week = `${now.getUTCFullYear()}-W${Math.floor((now.getUTCDate()+6)/7)}`;+ if (t.last_state?.fired_week === week) return false;++ const avatar = await loadAvatarFromAgent(t.agent_id);+ const mint = avatar ? (await sql`+ select m.symbol, m.name, s.recent_tx_count+ from pump_agent_mints m left join pump_agent_stats s on s.mint_id = m.id+ where m.agent_id::text = ${avatar.agent_id ?? null} or m.agent_id::text = ${avatar.id}+ order by m.created_at desc limit 1+ `)[0] : null;++ const ctx = avatar ? `Agent name: ${avatar.name || 'Unnamed'}\nDescription: ${avatar.description || '(none)'}` : '';+ const stats = mint ? `\nToken: $${mint.symbol || 'TOKEN'} on pump.fun. Recent transactions: ${mint.recent_tx_count || 0}.` : '';+ const text = await llmDraft({+ system: DRAFT_SYSTEM,+ user: `${ctx}${stats}\n\nWrite a weekly recap tweet covering the agent's progress this week. If token stats are present, mention them naturally.`,+ });+ await enqueueTriggerPost(t, text);+ await setTriggerState(t, { fired_week: week });+ return true;+}++async function evalPriceMilestone(t) {+ const thresholds = (t.config.thresholds_usd || []).slice().sort((a, b) => a - b);+ if (!thresholds.length) return false;+ const avatar = await loadAvatarFromAgent(t.agent_id);+ if (!avatar) return false;+ const mintRow = (await sql`+ select m.id as mint_id, m.symbol, p.market_cap_lamports+ from pump_agent_mints m+ left join lateral (+ select market_cap_lamports from pump_agent_price_points+ where mint_id = m.id order by ts desc limit 1+ ) p on true+ where m.agent_id::text = ${avatar.agent_id ?? null} or m.agent_id::text = ${avatar.id}+ order by m.created_at desc limit 1+ `)[0];+ if (!mintRow || !mintRow.market_cap_lamports) return false;++ const solUsd = Number(t.config.sol_usd) || SOL_USD_FALLBACK;+ const mcapUsd = (Number(mintRow.market_cap_lamports) / 1e9) * solUsd;+ const lastFired = Number(t.last_state?.last_threshold_fired_usd || 0);+ const nextThreshold = thresholds.find((th) => mcapUsd >= th && th > lastFired);+ if (!nextThreshold) return false;++ const text = await llmDraft({+ system: DRAFT_SYSTEM,+ user: `Agent name: ${avatar.name || 'Unnamed'}\nDescription: ${avatar.description || '(none)'}\nToken: $${mintRow.symbol || 'TOKEN'} on pump.fun.\nMilestone: market cap just crossed $${nextThreshold.toLocaleString()} (now ≈ $${Math.round(mcapUsd).toLocaleString()}).\n\nWrite a tweet celebrating this milestone in the agent's voice.`,+ });+ await enqueueTriggerPost(t, text);+ await setTriggerState(t, { last_threshold_fired_usd: nextThreshold, mcap_usd: mcapUsd });+ return true;+}++async function evalPaymentReceived(t) {+ const avatar = await loadAvatarFromAgent(t.agent_id);+ if (!avatar) return false;+ const since = t.last_state?.last_payment_id ?? '00000000-0000-0000-0000-000000000000';+ const minUsd = Number(t.config.min_amount_usd || 0);++ const payments = await sql`+ select p.id, p.amount_atomics, p.currency_mint, p.skill_id, p.tool_name, m.symbol+ from pump_agent_payments p+ join pump_agent_mints m on m.id = p.mint_id+ where (m.agent_id::text = ${avatar.agent_id ?? null} or m.agent_id::text = ${avatar.id})+ and p.status = 'confirmed'+ and p.id::text > ${since}+ order by p.confirmed_at asc+ limit 3+ `;+ if (!payments.length) return false;++ let lastId = null;+ for (const p of payments) {+ const approxUsd = Number(p.amount_atomics) / 1e6;+ if (approxUsd < minUsd) { lastId = p.id; continue; }+ const label = p.tool_name ? `for "${p.tool_name}"` : (p.skill_id ? `for skill ${p.skill_id}` : 'for a paid action');+ const text = await llmDraft({+ system: DRAFT_SYSTEM,+ user: `Agent name: ${avatar.name || 'Unnamed'}\nDescription: ${avatar.description || '(none)'}\nA user just paid ~$${approxUsd.toFixed(2)} ${label}.\n\nWrite a short thank-you tweet in the agent's voice.`,+ });+ await enqueueTriggerPost(t, text);+ lastId = p.id;+ }+ if (lastId) await setTriggerState(t, { last_payment_id: lastId });+ return true;+}diff --git a/api/portfolio/[action].js b/api/portfolio/[action].jsnew file mode 100644index 000000000..6937ce3f9--- /dev/null+++ b/api/portfolio/[action].js@@ -0,0 +1,398 @@+// Portfolio dispatcher for the user's agent custodial wallets.+//+// GET /api/portfolio/summary?snapshot=1 → live aggregated balances; opt. snapshot+// GET /api/portfolio/history?days=30 → past snapshots for the chart+// POST /api/portfolio/send → server-signed transfer from an agent wallet+//+// All endpoints require a session cookie and operate only on agents owned by+// the caller (agent_identities.user_id = session.user_id). Balances are+// memoized for 60s in-process to shield Helius/Alchemy/CoinGecko from+// per-page-load fan-out.++import { cors, json, method, readJson, wrap, error, validationError } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';+import { getSessionUser, isSameSiteOrigin } from '../_lib/auth.js';+import { requireCsrf } from '../_lib/csrf.js';+import { logAudit } from '../_lib/audit.js';+import { sql } from '../_lib/db.js';+import { getBalances, walletUsdTotal, invalidateBalances } from '../_lib/balances.js';+import { recoverAgentKey, recoverSolanaAgentKeypair } from '../_lib/agent-wallet.js';+import { env } from '../_lib/env.js';+import { z } from 'zod';++const ETH_ADDR_RE = /^0x[a-fA-F0-9]{40}$/;+const SOL_ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;++function parse(schema, raw) {+ const r = schema.safeParse(raw);+ if (!r.success) {+ const err = new Error(r.error.issues[0]?.message || 'invalid input');+ err.status = 400;+ err.code = 'validation_error';+ err.issues = r.error.issues;+ throw err;+ }+ return r.data;+}++async function listUserAgentWallets(userId) {+ const rows = await sql`+ select id, name, wallet_address, chain_id, meta+ from agent_identities+ where user_id = ${userId} and deleted_at is null+ order by created_at asc+ `;+ const wallets = [];+ for (const row of rows) {+ const meta = row.meta || {};+ if (row.wallet_address) {+ wallets.push({+ agent_id: row.id,+ agent_name: row.name || 'Agent',+ kind: 'evm',+ chain: 'evm',+ chain_id: row.chain_id || 8453,+ address: row.wallet_address,+ });+ }+ const solAddr = meta.solana_address;+ if (solAddr) {+ wallets.push({+ agent_id: row.id,+ agent_name: row.name || 'Agent',+ kind: 'solana',+ chain: 'solana',+ address: solAddr,+ });+ }+ }+ return wallets;+}++// ── GET /api/portfolio/summary ─────────────────────────────────────────────++async function handleSummary(req, res) {+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['GET'])) return;++ const user = await getSessionUser(req, res);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');++ const rl = await limits.walletRead(user.id);+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');++ const url = new URL(req.url, 'http://localhost');+ const wantSnapshot = url.searchParams.get('snapshot') === '1';++ const wallets = await listUserAgentWallets(user.id);++ const results = await Promise.allSettled(+ wallets.map((w) => getBalances({ chain: w.chain, address: w.address })),+ );++ const byWallet = wallets.map((w, i) => {+ const r = results[i];+ if (r.status === 'fulfilled') {+ const bal = r.value;+ return {+ agent_id: w.agent_id,+ agent_name: w.agent_name,+ chain: w.chain,+ chain_id: w.chain_id,+ address: w.address,+ native: bal.native,+ tokens: bal.tokens,+ usd: walletUsdTotal(bal),+ ok: true,+ };+ }+ const err = r.reason;+ return {+ agent_id: w.agent_id,+ agent_name: w.agent_name,+ chain: w.chain,+ chain_id: w.chain_id,+ address: w.address,+ native: { symbol: w.chain === 'solana' ? 'SOL' : 'ETH', amount: 0, usd: 0 },+ tokens: [],+ usd: 0,+ ok: false,+ error: err?.code === 'not_configured' ? `missing env: ${err.missing}` : err?.message || 'fetch failed',+ };+ });++ const totalUsd = byWallet.reduce((s, w) => s + (w.usd || 0), 0);++ if (wantSnapshot) {+ const breakdown = byWallet.map((w) => ({+ agent_id: w.agent_id,+ chain: w.chain,+ address: w.address,+ usd: w.usd,+ }));+ try {+ await sql`+ insert into portfolio_snapshots (user_id, total_usd, breakdown)+ values (${user.id}, ${totalUsd}, ${JSON.stringify(breakdown)}::jsonb)+ `;+ } catch (e) {+ console.error('[portfolio] snapshot insert failed', e?.message);+ }+ }++ return json(res, 200, {+ captured_at: new Date().toISOString(),+ total_usd: totalUsd,+ wallets: byWallet,+ });+}++// ── GET /api/portfolio/history ─────────────────────────────────────────────++async function handleHistory(req, res) {+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['GET'])) return;++ const user = await getSessionUser(req, res);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');++ const rl = await limits.walletRead(user.id);+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');++ const url = new URL(req.url, 'http://localhost');+ const days = Math.min(365, Math.max(1, parseInt(url.searchParams.get('days') || '90', 10)));++ const rows = await sql`+ select captured_at, total_usd+ from portfolio_snapshots+ where user_id = ${user.id}+ and captured_at > now() - (${days} || ' days')::interval+ order by captured_at asc+ `;++ return json(res, 200, {+ days,+ points: rows.map((r) => ({+ t: new Date(r.captured_at).toISOString(),+ usd: Number(r.total_usd),+ })),+ });+}++// ── POST /api/portfolio/send ───────────────────────────────────────────────++const sendSchema = z.object({+ agent_id: z.string().uuid(),+ chain: z.enum(['solana', 'evm']),+ // 'native' for SOL/ETH, otherwise a mint (Solana) or 0x contract (EVM).+ asset: z.string().min(1),+ recipient: z.string().min(1),+ // Decimal string, in human units (e.g. "1.5" SOL or "100" USDC).+ amount: z.string().regex(/^\d+(\.\d+)?$/),+ memo: z.string().max(120).optional(),+});++function parseAmountToBaseUnits(amountStr, decimals) {+ const [whole, frac = ''] = amountStr.split('.');+ const fracPadded = (frac + '0'.repeat(decimals)).slice(0, decimals);+ const combined = (whole + fracPadded).replace(/^0+/, '') || '0';+ return BigInt(combined);+}++async function loadOwnedAgent(userId, agentId) {+ const [row] = await sql`+ select id, name, wallet_address, chain_id, meta+ from agent_identities+ where id = ${agentId} and user_id = ${userId} and deleted_at is null+ limit 1+ `;+ return row || null;+}++async function sendEvm({ agent, asset, recipient, amount, memo }) {+ if (!ETH_ADDR_RE.test(recipient)) {+ const e = new Error('invalid EVM recipient');+ e.code = 'validation_error';+ e.status = 400;+ throw e;+ }+ const encryptedKey = agent.meta?.encrypted_wallet_key;+ if (!encryptedKey) {+ const e = new Error('agent has no EVM key');+ e.code = 'no_key';+ e.status = 409;+ throw e;+ }+ const chainId = agent.chain_id || 8453;+ const rpcUrl = env.getRpcUrl(chainId);+ if (!rpcUrl) {+ const e = new Error(`no RPC URL for chain ${chainId}`);+ e.code = 'no_rpc';+ e.status = 503;+ throw e;+ }++ const pkHex = await recoverAgentKey(encryptedKey);+ const { JsonRpcProvider, Wallet, parseEther, Contract } = await import('ethers');+ const provider = new JsonRpcProvider(rpcUrl);+ const signer = new Wallet(pkHex, provider);++ if (asset === 'native') {+ const value = parseEther(amount);+ const tx = await signer.sendTransaction({ to: recipient, value, data: memo ? '0x' + Buffer.from(memo, 'utf8').toString('hex') : undefined });+ return { tx_hash: tx.hash, chain_id: chainId };+ }++ if (!ETH_ADDR_RE.test(asset)) {+ const e = new Error('asset must be 0x contract or "native"');+ e.code = 'validation_error';+ e.status = 400;+ throw e;+ }+ const ERC20 = ['function decimals() view returns (uint8)', 'function transfer(address,uint256) returns (bool)'];+ const token = new Contract(asset, ERC20, signer);+ const decimals = Number(await token.decimals());+ const amountUnits = parseAmountToBaseUnits(amount, decimals);+ const tx = await token.transfer(recipient, amountUnits);+ return { tx_hash: tx.hash, chain_id: chainId };+}++async function sendSolana({ agent, asset, recipient, amount, userId }) {+ if (!SOL_ADDR_RE.test(recipient)) {+ const e = new Error('invalid Solana recipient');+ e.code = 'validation_error';+ e.status = 400;+ throw e;+ }+ const encryptedSecret = agent.meta?.encrypted_solana_secret;+ if (!encryptedSecret) {+ const e = new Error('agent has no Solana key');+ e.code = 'no_key';+ e.status = 409;+ throw e;+ }++ const { Connection, PublicKey, Transaction, SystemProgram, LAMPORTS_PER_SOL } = await import('@solana/web3.js');+ const rpcUrl = process.env.HELIUS_API_KEY+ ? `https://mainnet.helius-rpc.com/?api-key=${process.env.HELIUS_API_KEY}`+ : 'https://api.mainnet-beta.solana.com';+ const conn = new Connection(rpcUrl, 'confirmed');++ const kp = await recoverSolanaAgentKeypair(encryptedSecret, {+ userId,+ agentId: agent.id,+ reason: 'portfolio_send',+ });++ const recipientPk = new PublicKey(recipient);+ const tx = new Transaction();++ if (asset === 'native') {+ const lamports = BigInt(Math.round(Number(amount) * LAMPORTS_PER_SOL));+ tx.add(SystemProgram.transfer({ fromPubkey: kp.publicKey, toPubkey: recipientPk, lamports }));+ } else {+ if (!SOL_ADDR_RE.test(asset)) {+ const e = new Error('asset must be SPL mint or "native"');+ e.code = 'validation_error';+ e.status = 400;+ throw e;+ }+ const { getAssociatedTokenAddress, createAssociatedTokenAccountInstruction, createTransferInstruction } = await import('@solana/spl-token');+ const mintPk = new PublicKey(asset);++ const mintInfo = await conn.getParsedAccountInfo(mintPk);+ const decimals = mintInfo.value?.data?.parsed?.info?.decimals ?? 6;++ const senderAta = await getAssociatedTokenAddress(mintPk, kp.publicKey);+ const recipientAta = await getAssociatedTokenAddress(mintPk, recipientPk);+ const recipientAccount = await conn.getAccountInfo(recipientAta);+ if (!recipientAccount) {+ tx.add(createAssociatedTokenAccountInstruction(kp.publicKey, recipientAta, recipientPk, mintPk));+ }+ const amountUnits = parseAmountToBaseUnits(amount, decimals);+ tx.add(createTransferInstruction(senderAta, recipientAta, kp.publicKey, amountUnits));+ }++ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash();+ tx.feePayer = kp.publicKey;+ tx.recentBlockhash = blockhash;+ tx.sign(kp);++ const sig = await conn.sendRawTransaction(tx.serialize(), { skipPreflight: false });+ await conn.confirmTransaction({ signature: sig, blockhash, lastValidBlockHeight }, 'confirmed');+ return { tx_hash: sig };+}++async function handleSend(req, res) {+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['POST'])) return;++ const user = await getSessionUser(req, res);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');++ if (!isSameSiteOrigin(req)) {+ return error(res, 403, 'forbidden', 'cross-site request denied');+ }+ if (!(await requireCsrf(req, res, user.id))) return;++ const rl = await limits.strict(`portfolio:send:${user.id}`);+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many sends');++ let body;+ try {+ body = parse(sendSchema, await readJson(req));+ } catch (e) {+ return validationError(res, e);+ }++ const agent = await loadOwnedAgent(user.id, body.agent_id);+ if (!agent) return error(res, 404, 'not_found', 'agent not found');++ try {+ const out =+ body.chain === 'solana'+ ? await sendSolana({ agent, asset: body.asset, recipient: body.recipient, amount: body.amount, userId: user.id })+ : await sendEvm({ agent, asset: body.asset, recipient: body.recipient, amount: body.amount, memo: body.memo });++ logAudit({+ userId: user.id,+ action: 'portfolio_send',+ resourceId: agent.id,+ meta: {+ chain: body.chain,+ asset: body.asset,+ recipient: body.recipient,+ amount: body.amount,+ tx_hash: out.tx_hash,+ },+ });++ // Invalidate cache so the next /summary reflects the new balance.+ const addr = body.chain === 'solana' ? agent.meta?.solana_address : agent.wallet_address;+ if (addr) invalidateBalances({ chain: body.chain, address: addr });++ return json(res, 200, { ok: true, ...out });+ } catch (e) {+ if (e.code === 'validation_error') return error(res, 400, 'validation_error', e.message);+ if (e.code === 'no_key') return error(res, 409, 'no_key', e.message);+ if (e.code === 'no_rpc') return error(res, 503, 'no_rpc', e.message);+ console.error('[portfolio/send] failed', e?.message);+ return error(res, 502, 'send_failed', e?.message || 'transaction failed');+ }+}++// ── Dispatcher ─────────────────────────────────────────────────────────────++export default wrap(async (req, res) => {+ const action = String(req.query?.action || '').toLowerCase();+ switch (action) {+ case 'summary':+ return handleSummary(req, res);+ case 'history':+ return handleHistory(req, res);+ case 'send':+ return handleSend(req, res);+ default:+ return error(res, 404, 'not_found', `unknown action: ${action}`);+ }+});diff --git a/api/x/triggers.js b/api/x/triggers.jsnew file mode 100644index 000000000..c84745782--- /dev/null+++ b/api/x/triggers.js@@ -0,0 +1,99 @@+// GET /api/x/triggers — list triggers for current user+// POST /api/x/triggers — create { kind, config, agent_id?, enabled? }+// PATCH /api/x/triggers?id=<uuid> — update { config?, enabled? }+// DELETE /api/x/triggers?id=<uuid> — delete++import { sql } from '../_lib/db.js';+import { getSessionUser } from '../_lib/auth.js';+import { cors, method, wrap, error, readJson, json } from '../_lib/http.js';++const VALID_KINDS = new Set(['daily_persona', 'weekly_digest', 'price_milestone', 'payment_received']);++function validateConfig(kind, config) {+ if (typeof config !== 'object' || config === null) throw new Error('config must be an object');+ if (kind === 'daily_persona') {+ const h = Number(config.hour_utc);+ if (!Number.isInteger(h) || h < 0 || h > 23) throw new Error('hour_utc must be integer 0–23');+ if (config.topic && typeof config.topic !== 'string') throw new Error('topic must be a string');+ }+ if (kind === 'weekly_digest') {+ const d = Number(config.day_of_week);+ const h = Number(config.hour_utc);+ if (!Number.isInteger(d) || d < 0 || d > 6) throw new Error('day_of_week must be integer 0 (Sun)–6 (Sat)');+ if (!Number.isInteger(h) || h < 0 || h > 23) throw new Error('hour_utc must be integer 0–23');+ }+ if (kind === 'price_milestone') {+ if (!Array.isArray(config.thresholds_usd) || !config.thresholds_usd.length) throw new Error('thresholds_usd must be non-empty array of numbers');+ if (config.thresholds_usd.some((t) => typeof t !== 'number' || t <= 0)) throw new Error('thresholds_usd entries must be positive numbers');+ }+ if (kind === 'payment_received') {+ const min = Number(config.min_amount_usd ?? 0);+ if (!Number.isFinite(min) || min < 0) throw new Error('min_amount_usd must be a non-negative number');+ }+}++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,POST,PATCH,DELETE,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['GET', 'POST', 'PATCH', 'DELETE'])) return;++ const user = await getSessionUser(req);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');++ const url = new URL(req.url, 'http://x');+ const id = url.searchParams.get('id');++ if (req.method === 'GET') {+ const rows = await sql`+ select id, agent_id, kind, config, enabled, last_fired_at, created_at, updated_at+ from x_triggers+ where user_id = ${user.id}+ order by created_at desc+ `;+ return json(res, 200, { triggers: rows });+ }++ if (req.method === 'POST') {+ const body = await readJson(req);+ const kind = body?.kind;+ if (!VALID_KINDS.has(kind)) return error(res, 400, 'validation_error', `kind must be one of: ${[...VALID_KINDS].join(', ')}`);+ const config = body?.config ?? {};+ try { validateConfig(kind, config); } catch (err) { return error(res, 400, 'validation_error', err.message); }+ const agentId = typeof body?.agent_id === 'string' ? body.agent_id : null;+ const enabled = body?.enabled !== false;+ const rows = await sql`+ insert into x_triggers (user_id, agent_id, kind, config, enabled)+ values (${user.id}, ${agentId}, ${kind}, ${JSON.stringify(config)}::jsonb, ${enabled})+ returning id, agent_id, kind, config, enabled, last_fired_at, created_at, updated_at+ `;+ return json(res, 201, { trigger: rows[0] });+ }++ if (!id) return error(res, 400, 'validation_error', 'id required');++ if (req.method === 'PATCH') {+ const body = await readJson(req);+ const existing = (await sql`select kind, config from x_triggers where id = ${id} and user_id = ${user.id} limit 1`)[0];+ if (!existing) return error(res, 404, 'not_found', 'trigger not found');++ const nextConfig = body?.config !== undefined ? body.config : existing.config;+ if (body?.config !== undefined) {+ try { validateConfig(existing.kind, nextConfig); } catch (err) { return error(res, 400, 'validation_error', err.message); }+ }+ const nextEnabled = typeof body?.enabled === 'boolean' ? body.enabled : null;++ const rows = await sql`+ update x_triggers+ set config = ${JSON.stringify(nextConfig)}::jsonb,+ enabled = coalesce(${nextEnabled}, enabled),+ updated_at = now()+ where id = ${id} and user_id = ${user.id}+ returning id, agent_id, kind, config, enabled, last_fired_at, created_at, updated_at+ `;+ return json(res, 200, { trigger: rows[0] });+ }++ // DELETE+ const result = await sql`delete from x_triggers where id = ${id} and user_id = ${user.id} returning id`;+ if (!result.length) return error(res, 404, 'not_found', 'trigger not found');+ return json(res, 200, { deleted: id });+});diff --git a/avatar-page.html b/avatar-page.htmlindex eb84c51c1..e56202425 100644--- a/avatar-page.html+++ b/avatar-page.html@@ -169,12 +169,35 @@border-bottom: 1px solid var(--border);}.av-eyebrow {+ display: inline-flex;+ align-items: center;+ gap: 7px;font-family: 'Space Grotesk', sans-serif;font-size: 10px;letter-spacing: 0.18em;text-transform: uppercase;color: var(--accent);font-weight: 600;+ padding: 3px 9px;+ border: 1px solid rgba(125, 211, 252, 0.3);+ border-radius: 999px;+ background: rgba(125, 211, 252, 0.07);+ }+ .av-eyebrow-help {+ color: rgba(125, 211, 252, 0.65);+ text-decoration: none;+ border-left: 1px solid rgba(125, 211, 252, 0.3);+ padding-left: 7px;+ font-size: 11px;+ letter-spacing: 0;+ cursor: help;+ }+ .av-eyebrow-help:hover { color: var(--text); }+ .av-source-tag {+ font-size: 11px;+ color: var(--text-3);+ margin: 8px 0 0;+ letter-spacing: 0.02em;}.av-name {font-family: 'Space Grotesk', sans-serif;diff --git a/data/pages.json b/data/pages.jsonnew file mode 100644index 000000000..1c734cdc7--- /dev/null+++ b/data/pages.json@@ -0,0 +1,127 @@+{+ "$schema": "./pages.schema.json",+ "site": {+ "name": "three.ws",+ "url": "https://three.ws",+ "tagline": "Give your AI a body.",+ "description": "three.ws is the AI-agent layer for the open web: build, embed, monetize, and trade autonomous agents with real 3D avatars, on-chain identity (ERC-8004), pay-per-call (x402), and pump.fun token launches.",+ "contact": "https://x.com/trythreews",+ "github": "https://github.com/nirholas/three.ws"+ },+ "sections": [+ {+ "id": "main",+ "title": "Main",+ "description": "Entry points into the product.",+ "pages": [+ { "path": "/", "title": "Home", "description": "Landing page. Pitch, live agent demos, and the front door to every flow.", "priority": 1.0, "changefreq": "weekly" },+ { "path": "/discover", "title": "Discover", "description": "On-chain agent directory (ERC-8004 + Solana). Browse, search, and inspect every registered agent.", "priority": 0.9, "changefreq": "daily" },+ { "path": "/gallery", "title": "Avatar Gallery", "description": "Every public 3D avatar in the system, browsable as a grid.", "priority": 0.8, "changefreq": "daily" },+ { "path": "/marketplace", "title": "Marketplace", "description": "Buy access to agents, skills, and avatars from other creators.", "priority": 0.8, "changefreq": "daily" },+ { "path": "/community", "title": "Community", "description": "Featured creators, builds, and conversations from the three.ws community.", "priority": 0.6, "changefreq": "weekly" },+ { "path": "/sitemap", "title": "Sitemap", "description": "Human-readable index of every page on three.ws.", "priority": 0.4, "changefreq": "weekly" }+ ]+ },+ {+ "id": "build",+ "title": "Build",+ "description": "Create and customize an agent.",+ "pages": [+ { "path": "/create", "title": "Create Agent", "description": "Wizard for building a new agent: avatar, brain (LLM + prompt), skills, and on-chain identity.", "priority": 0.9, "changefreq": "weekly" },+ { "path": "/app", "title": "Viewer", "description": "Drag-and-drop glTF/GLB viewer for inspecting 3D models in the browser.", "priority": 0.7, "changefreq": "monthly" },+ { "path": "/validation", "title": "glTF Validator", "description": "Khronos-spec validator for glTF/GLB files. Paste a URL or upload a model.", "priority": 0.6, "changefreq": "monthly" },+ { "path": "/studio", "title": "Widget Studio", "description": "Pick an avatar, configure embed options, copy a one-line snippet for your site.", "priority": 0.8, "changefreq": "weekly" },+ { "path": "/artifact", "title": "Artifact Viewer", "description": "Renders Claude artifact bundles as standalone embeddable apps.", "priority": 0.5, "changefreq": "monthly" },+ { "path": "/widgets", "title": "Widgets Gallery", "description": "Pre-built chat, voice, and 3D-avatar widgets you can drop into any page.", "priority": 0.7, "changefreq": "weekly" },+ { "path": "/hydrate", "title": "Hydrate", "description": "Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.", "priority": 0.7, "changefreq": "weekly" }+ ]+ },+ {+ "id": "crypto",+ "title": "Crypto",+ "description": "On-chain features: pay-per-call, token launches, vanity wallets.",+ "pages": [+ { "path": "/pay", "title": "Pay (x402)", "description": "Pay-per-call gateway: invoke any x402-protocol paid API with a USDC micro-transaction.", "priority": 0.9, "changefreq": "weekly" },+ { "path": "/pumpfun", "title": "Pump.fun Stream", "description": "Mint and trade pump.fun agent tokens on Solana. Live feed of every launch.", "priority": 0.8, "changefreq": "daily" },+ { "path": "/pump-live", "title": "Pump Live", "description": "Real-time SSE feed of every pump.fun launch as it happens.", "priority": 0.7, "changefreq": "daily" },+ { "path": "/pump-dashboard", "title": "Pump Dashboard", "description": "Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.", "priority": 0.8, "changefreq": "daily" },+ { "path": "/strategy-lab", "title": "Strategy Lab", "description": "Build DCA and subscription strategies that trade on-chain on your behalf.", "priority": 0.7, "changefreq": "weekly" },+ { "path": "/vanity-wallet", "title": "Solana Vanity Wallet", "description": "Grind a Solana address with a custom prefix using your browser's GPU.", "priority": 0.6, "changefreq": "monthly" },+ { "path": "/eth-vanity", "title": "ETH Vanity (CREATE2)", "description": "Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.", "priority": 0.6, "changefreq": "monthly" }+ ]+ },+ {+ "id": "agent-tools",+ "title": "Agent Tools",+ "description": "Manage, talk to, and deploy individual agents.",+ "pages": [+ { "path": "/chat", "title": "Chat", "description": "Talk to your agent. Voice, text, and tool-use in one interface.", "priority": 0.8, "changefreq": "weekly" },+ { "path": "/agent", "title": "Agent Home", "description": "Default landing for an agent instance — chat, embed, and remix actions.", "priority": 0.7, "changefreq": "weekly" },+ { "path": "/agents", "title": "Agents Index", "description": "Browse every registered agent on three.ws.", "priority": 0.7, "changefreq": "daily" },+ { "path": "/my-agents", "title": "My Agents", "description": "Your private collection of agents and avatars. Requires sign-in.", "priority": 0.5, "changefreq": "weekly", "auth": "required", "indexable": false },+ { "path": "/reputation", "title": "Reputation Explorer", "description": "Inspect on-chain reputation scores and attestations for any agent.", "priority": 0.6, "changefreq": "weekly" }+ ]+ },+ {+ "id": "account",+ "title": "Account",+ "description": "Sign-in, dashboard, billing.",+ "pages": [+ { "path": "/login", "title": "Sign in", "description": "Sign in with email, GitHub, or a connected wallet.", "priority": 0.4, "changefreq": "yearly" },+ { "path": "/register", "title": "Create account", "description": "Create a new three.ws account.", "priority": 0.4, "changefreq": "yearly" },+ { "path": "/forgot-password", "title": "Forgot password", "description": "Request a password-reset email.", "priority": 0.2, "changefreq": "yearly" },+ { "path": "/dashboard", "title": "Dashboard", "description": "Your account dashboard: agents, avatars, payments, keys, MCP servers, monetization, billing.", "priority": 0.5, "changefreq": "weekly", "auth": "required", "indexable": false },+ { "path": "/dashboard/wallets", "title": "Dashboard · Wallets", "description": "Manage connected and agent-managed wallets.", "auth": "required", "indexable": false },+ { "path": "/dashboard/usage", "title": "Dashboard · Usage", "description": "API call volume, x402 spend, and per-agent usage breakdowns.", "auth": "required", "indexable": false },+ { "path": "/dashboard/storage", "title": "Dashboard · Storage", "description": "Avatar storage modes (R2 vs IPFS) and pin management.", "auth": "required", "indexable": false },+ { "path": "/dashboard/sessions", "title": "Dashboard · Sessions", "description": "Active sign-in sessions across devices.", "auth": "required", "indexable": false },+ { "path": "/dashboard/actions", "title": "Dashboard · Actions", "description": "Agent action history and approvals.", "auth": "required", "indexable": false },+ { "path": "/settings", "title": "Settings", "description": "Account, profile, and notification settings.", "auth": "required", "indexable": false }+ ]+ },+ {+ "id": "learn",+ "title": "Learn",+ "description": "Docs, tutorials, and reference.",+ "pages": [+ { "path": "/docs", "title": "Docs", "description": "Full documentation: SDKs, API reference, embedding, agent system, smart contracts.", "priority": 0.9, "changefreq": "weekly" },+ { "path": "/docs/quick-start", "title": "Docs · Quick Start", "description": "Five-minute walkthrough: create an agent, embed it, get a paid call.", "priority": 0.8, "changefreq": "weekly" },+ { "path": "/docs/agent-system", "title": "Docs · Agent System", "description": "How agents, avatars, skills, and memories fit together." },+ { "path": "/docs/erc8004", "title": "Docs · ERC-8004", "description": "Reference for the on-chain agent identity standard." },+ { "path": "/docs/embedding", "title": "Docs · Embedding", "description": "Embed an agent via iframe, oEmbed, or the <agent-3d> web component." },+ { "path": "/docs/web-component", "title": "Docs · <agent-3d>", "description": "Reference for the <agent-3d> custom element." },+ { "path": "/docs/mcp", "title": "Docs · MCP", "description": "Expose your agent as an MCP server for Claude, ChatGPT, and other clients." },+ { "path": "/docs/skills", "title": "Docs · Skills", "description": "Write, package, and monetize agent skills." },+ { "path": "/docs/widgets", "title": "Docs · Widgets", "description": "Build and publish reusable chat and 3D widgets." },+ { "path": "/docs/api-reference", "title": "Docs · API Reference", "description": "Full HTTP API reference." },+ { "path": "/docs/sdk", "title": "Docs · SDK", "description": "JavaScript / Node SDK for three.ws." },+ { "path": "/tutorials", "title": "Tutorials", "description": "Step-by-step build guides." }+ ]+ },+ {+ "id": "legal",+ "title": "Legal",+ "description": "",+ "pages": [+ { "path": "/legal/privacy", "title": "Privacy Policy", "description": "How three.ws handles user data.", "priority": 0.2, "changefreq": "yearly" },+ { "path": "/legal/tos", "title": "Terms of Use", "description": "Terms of service for three.ws.", "priority": 0.2, "changefreq": "yearly" }+ ]+ },+ {+ "id": "machine",+ "title": "Machine-readable",+ "description": "Indexes and well-known files for crawlers and AI agents.",+ "pages": [+ { "path": "/sitemap.xml", "title": "sitemap.xml", "description": "XML sitemap for search-engine crawlers.", "indexable": false },+ { "path": "/llms.txt", "title": "llms.txt", "description": "AI-agent-friendly index of every public page (Howard convention).", "indexable": false },+ { "path": "/llms-full.txt", "title": "llms-full.txt", "description": "Expanded llms.txt with full descriptions and content hints.", "indexable": false },+ { "path": "/robots.txt", "title": "robots.txt", "description": "Crawler directives.", "indexable": false },+ { "path": "/openapi.json", "title": "OpenAPI", "description": "Machine-readable HTTP API spec.", "indexable": false },+ { "path": "/.well-known/x402", "title": ".well-known/x402", "description": "x402 paid-API discovery document.", "indexable": false },+ { "path": "/.well-known/agent-attestation-schemas", "title": ".well-known/agent-attestation-schemas", "description": "JSON schemas for agent attestations.", "indexable": false },+ { "path": "/.well-known/oauth-authorization-server", "title": ".well-known/oauth-authorization-server", "description": "OAuth 2.1 authorization-server metadata.", "indexable": false },+ { "path": "/.well-known/chat-plugin.json", "title": ".well-known/chat-plugin.json", "description": "ChatGPT-style plugin manifest.", "indexable": false }+ ]+ }+ ]+}diff --git a/docs/index.html b/docs/index.htmlindex 0c0880d89..85da5f609 100644--- a/docs/index.html+++ b/docs/index.html@@ -592,6 +592,8 @@title: 'Getting started',links: [{ label: 'Introduction', path: 'introduction' },+ { label: 'Getting started (hosted)', path: 'tutorials/getting-started' },+ { label: 'Agents vs. Avatars', path: 'agents-vs-avatars' },{ label: 'Quick start', path: 'quick-start' },{ label: 'Deployment', path: 'deployment' },{ label: 'Local setup', path: 'internal/SETUP' },@@ -643,6 +645,7 @@{title: 'Tutorials',links: [+ { label: 'Getting started (hosted)', path: 'tutorials/getting-started' },{ label: 'Build your first agent', path: 'tutorials/first-agent' },{ label: 'Personal AI site', path: 'tutorials/personal-ai-site' },{ label: 'Create a custom skill', path: 'tutorials/custom-skill' },diff --git a/features.html b/features.htmlnew file mode 100644index 000000000..1b9e95e38--- /dev/null+++ b/features.html@@ -0,0 +1,399 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />+ <title>Features — three.ws</title>+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <meta name="author" content="nirholas" />+ <meta+ name="description"+ content="three.ws features: 3D avatars, on-chain identity on Solana via Metaplex Core, voice and persona, x402 paid skills, embeds, and an agent marketplace."+ />+ <meta name="theme-color" content="#000000" />++ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="Features — three.ws" />+ <meta+ property="og:description"+ content="3D avatars, on-chain identity on Solana, voice, x402 paid skills, embeds, and an agent marketplace."+ />+ <meta property="og:url" content="https://three.ws/features" />+ <meta property="og:image" content="https://three.ws/og-image.png" />+ <meta property="og:image:width" content="1200" />+ <meta property="og:image:height" content="630" />++ <meta name="twitter:card" content="summary_large_image" />+ <meta name="twitter:title" content="Features — three.ws" />+ <meta+ name="twitter:description"+ content="3D avatars, on-chain identity on Solana, voice, x402 paid skills, embeds, and an agent marketplace."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" />++ <link rel="canonical" href="https://three.ws/features" />+ <link rel="shortcut icon" href="/favicon.ico" />+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />+ <link rel="preconnect" href="https://fonts.googleapis.com" />+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/features.css" />+ <link+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400&family=Space+Grotesk:wght@500;600;700&display=swap"+ rel="stylesheet"+ />+ <script+ type="module"+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ ></script>+ </head>+ <body class="features-page">+ <a href="#hero" class="skip-link">Skip to main content</a>+ <header>+ <h1>+ <a href="/" aria-label="three.ws home"+ ><img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" /><span+ class="wordmark-dot"+ aria-hidden="true"+ ></span+ >three.ws</a+ >+ </h1>+ <div id="nav-container"></div>+ </header>+ <script src="/nav.js"></script>++ <main class="features-main">+ <!-- Hero -->+ <section class="hero" id="hero">+ <div class="hero-bg" aria-hidden="true">+ <div class="hero-mesh"></div>+ <div class="hero-grid"></div>+ <div class="hero-glow hero-glow-gold"></div>+ <div class="hero-glow hero-glow-cyan"></div>+ </div>+ <div class="hero-content">+ <div class="hero-chip scroll-reveal">+ <span class="hero-chip-dot"></span>+ <span>Live on Solana</span>+ <span class="hero-chip-divider"></span>+ <span class="hero-chip-spec">Metaplex Core</span>+ </div>+ <h2 class="hero-title scroll-reveal">+ Give your AI<br />+ a <em>body</em>.+ </h2>+ <p class="hero-subtitle scroll-reveal">+ three.ws turns any GLB into a tradable on-chain agent — with voice,+ persona, paid skills, and an embed you can drop on any site.+ </p>+ <div class="hero-cta scroll-reveal">+ <a href="/create" class="btn-primary">+ <span>Create an agent</span>+ <span class="btn-arrow" aria-hidden="true">→</span>+ </a>+ <a+ href="/discover"+ class="btn-ghost"+ aria-label="Browse agents on three.ws"+ >Browse agents</a+ >+ </div>+ <ul class="hero-proof scroll-reveal" aria-label="Stack">+ <li>Solana</li>+ <li>Metaplex Core</li>+ <li>x402</li>+ <li>A2A</li>+ <li>MCP</li>+ </ul>+ </div>+ <div class="hero-avatar scroll-reveal" aria-hidden="true">+ <div class="hero-avatar-ring"></div>+ <div class="hero-avatar-pulse"></div>+ <model-viewer+ class="hero-avatar-viewer"+ src="/animations/robotexpressive.glb"+ alt="Rotating 3D avatar"+ aria-label="Rotating 3D avatar"+ camera-controls+ disable-zoom+ auto-rotate+ auto-rotate-delay="0"+ rotation-per-second="18deg"+ interaction-prompt="none"+ shadow-intensity="0.8"+ shadow-softness="1"+ exposure="1.05"+ tone-mapping="aces"+ environment-image="neutral"+ camera-orbit="20deg 70deg 6m"+ field-of-view="28deg"+ loading="eager"+ ></model-viewer>+ <div class="hero-avatar-tag" aria-hidden="true">+ <span class="hero-avatar-tag-label">asset</span>+ <span class="hero-avatar-tag-value">Sol…a9f</span>+ </div>+ </div>+ <div class="hero-scroll-hint scroll-reveal" aria-hidden="true">+ <span>scroll</span>+ <span class="hero-scroll-line"></span>+ </div>+ </section>++ <!-- How it works -->+ <section class="section" id="how-it-works">+ <h3 class="section-label scroll-reveal">How It Works</h3>+ <div class="steps">+ <div class="step scroll-reveal">+ <div class="step-num">01</div>+ <h4>Upload</h4>+ <p>+ Drop a GLB or generate an avatar in+ <a href="/create">/create</a>. three.ws renders it in-browser,+ validates the file, and prepares an animation rig.+ </p>+ </div>+ <div class="step scroll-reveal">+ <div class="step-num">02</div>+ <h4>Mint</h4>+ <p>+ Publish the agent as a Metaplex Core asset on Solana. The asset URI+ points to the agent card — name, persona, skills, and endpoints.+ </p>+ </div>+ <div class="step scroll-reveal">+ <div class="step-num">03</div>+ <h4>Earn</h4>+ <p>+ Add paid skills with x402, accept tips and subscriptions, and embed+ the agent on any site. Every call is signed and on-chain auditable.+ </p>+ </div>+ </div>+ </section>++ <!-- Agent Card JSON -->+ <section class="section section-dark" id="agent-card">+ <h3 class="section-label scroll-reveal">The Agent Card</h3>+ <p class="section-desc scroll-reveal">+ Every three.ws agent is described by a public JSON document — served at+ <code>/a/sol/<asset>/.well-known/agent-card.json</code> — so any+ A2A or MCP client can discover and talk to it.+ </p>+ <div class="code-block scroll-reveal">+ <div class="code-header">+ <span class="code-dot red" aria-hidden="true"></span>+ <span class="code-dot yellow" aria-hidden="true"></span>+ <span class="code-dot green" aria-hidden="true"></span>+ <span class="code-filename">agent-card.json</span>+ </div>+ <pre class="code-body"><code>{+ <span class="json-key">"name"</span>: <span class="json-str">"Atlas"</span>,+ <span class="json-key">"description"</span>: <span class="json-str">"3D research agent with voice and on-chain payments"</span>,+ <span class="json-key">"image"</span>: <span class="json-str">"https://three.ws/avatars/atlas.glb"</span>,+ <span class="json-key">"asset"</span>: <span class="json-str">"GmVe…ZdUtE"</span>,+ <span class="json-key">"chain"</span>: <span class="json-str">"solana-mainnet"</span>,+ <span class="json-key">"active"</span>: <span class="json-bool">true</span>,+ <span class="json-key">"services"</span>: [+ { <span class="json-key">"name"</span>: <span class="json-str">"web"</span>, <span class="json-key">"endpoint"</span>: <span class="json-str">"https://three.ws/agent/atlas"</span> },+ { <span class="json-key">"name"</span>: <span class="json-str">"A2A"</span>, <span class="json-key">"endpoint"</span>: <span class="json-str">"https://three.ws/api/agents/atlas"</span> },+ { <span class="json-key">"name"</span>: <span class="json-str">"MCP"</span>, <span class="json-key">"endpoint"</span>: <span class="json-str">"https://three.ws/.well-known/openapi.yaml"</span> },+ { <span class="json-key">"name"</span>: <span class="json-str">"x402"</span>, <span class="json-key">"endpoint"</span>: <span class="json-str">"https://three.ws/api/agents/x402/invoke"</span> }+ ],+ <span class="json-key">"supportedTrust"</span>: [<span class="json-str">"reputation"</span>, <span class="json-str">"attestation"</span>]+}</code></pre>+ </div>+ </section>++ <!-- Core capabilities -->+ <section class="section" id="capabilities">+ <h3 class="section-label scroll-reveal">What an Agent Can Do</h3>+ <div class="registry-grid">+ <div class="registry-card scroll-reveal">+ <div class="registry-icon" aria-hidden="true">🧍</div>+ <h4>3D Avatar</h4>+ <p>+ Any glTF / GLB renders in-browser with WebGL. Drag-drop animations,+ expressions, and a posable rig. Mobile, desktop, and XR-ready.+ </p>+ <ul class="registry-details">+ <li><code>GLB / glTF 2.0</code></li>+ <li><code>auto-rig + retarget</code></li>+ <li><code>WebGL · WebXR</code></li>+ </ul>+ </div>+ <div class="registry-card scroll-reveal">+ <div class="registry-icon" aria-hidden="true">🗣️</div>+ <h4>Voice & Persona</h4>+ <p>+ Low-latency voice via LiveKit, ElevenLabs voices, and a system+ prompt the owner controls. Memory is pinned per agent.+ </p>+ <ul class="registry-details">+ <li><code>livekit-token</code></li>+ <li><code>voice / persona</code></li>+ <li><code>memory / seed</code></li>+ </ul>+ </div>+ <div class="registry-card scroll-reveal">+ <div class="registry-icon" aria-hidden="true">🪪</div>+ <h4>On-Chain Identity</h4>+ <p>+ Each agent is a Metaplex Core asset on Solana. Transferable,+ composable, browsable in any wallet. The owner controls the keys.+ </p>+ <ul class="registry-details">+ <li><code>metaplex core</code></li>+ <li><code>register-prep / confirm</code></li>+ <li><code>attestations</code></li>+ </ul>+ </div>+ <div class="registry-card scroll-reveal">+ <div class="registry-icon" aria-hidden="true">💸</div>+ <h4>x402 Paid Skills</h4>+ <p>+ Charge per call in USDC over the x402 protocol. Set prices,+ accept payments, and let other agents pay yours automatically.+ </p>+ <ul class="registry-details">+ <li><code>skills/price</code></li>+ <li><code>x402/invoke</code></li>+ <li><code>payments / receipts</code></li>+ </ul>+ </div>+ <div class="registry-card scroll-reveal">+ <div class="registry-icon" aria-hidden="true">🧩</div>+ <h4>Embeds & SDKs</h4>+ <p>+ One-tag embed via <code><script src="/embed.js"></code> or+ the standalone <code>agent-3d</code> Web Component. Drop an agent+ on any page.+ </p>+ <ul class="registry-details">+ <li><code>embed.js</code></li>+ <li><code><agent-3d> web component</code></li>+ <li><code>oEmbed · iframe</code></li>+ </ul>+ </div>+ <div class="registry-card scroll-reveal">+ <div class="registry-icon" aria-hidden="true">⭐</div>+ <h4>Reputation</h4>+ <p>+ Signed feedback, call history, and validation events accrue to+ each agent — visible to anyone deciding whether to trust it.+ </p>+ <ul class="registry-details">+ <li><code>solana-reputation</code></li>+ <li><code>solana-attestations</code></li>+ <li><code>validation</code></li>+ </ul>+ </div>+ </div>+ </section>++ <!-- Integration -->+ <section class="section section-dark" id="integration">+ <h3 class="section-label scroll-reveal">Built for the Agent Web</h3>+ <div class="integration-grid">+ <div class="integration-item scroll-reveal">+ <h4>A2A & MCP</h4>+ <p>+ Every agent exposes a Model Context Protocol server and an+ Agent-to-Agent card. Plug into Claude, ChatGPT, or any A2A client.+ </p>+ </div>+ <div class="integration-item scroll-reveal">+ <h4>x402 Native</h4>+ <p>+ USDC micropayments are first-class. Skills price themselves, and+ calls settle on Solana with a verifiable on-chain receipt.+ </p>+ </div>+ <div class="integration-item scroll-reveal">+ <h4>Discoverable</h4>+ <p>+ Agents show up in <a href="/discover">/discover</a>, the+ <a href="/marketplace">marketplace</a>, and the bazaar — searchable+ by capability, price, and reputation.+ </p>+ </div>+ <div class="integration-item scroll-reveal">+ <h4>Portable</h4>+ <p>+ The asset is yours. Move it, list it, delegate it. The agent card+ is a public JSON URL — nothing is locked to this site.+ </p>+ </div>+ </div>+ </section>++ <!-- CTA -->+ <section class="section cta-section" id="cta">+ <div class="cta-content scroll-reveal">+ <h3>Ready to give your AI a body?</h3>+ <p>Spin up a 3D agent in under a minute — no install, no contracts.</p>+ <div class="hero-cta">+ <a href="/create" class="btn-primary">Create an agent</a>+ <a+ href="/docs"+ class="btn-ghost"+ aria-label="Read the three.ws docs"+ >Read the docs <span aria-hidden="true">→</span></a+ >+ </div>+ </div>+ </section>++ <footer class="features-footer">+ <p>+ three.ws ·+ <a href="/discover">Discover</a> ·+ <a href="/docs">Docs</a> ·+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ aria-label="three.ws on GitHub (opens in a new tab)"+ >GitHub</a+ >+ · Built on+ <a+ href="https://developers.metaplex.com/core"+ target="_blank"+ rel="noopener"+ aria-label="Metaplex Core (opens in a new tab)"+ >Metaplex Core</a+ >+ </p>+ </footer>+ </main>++ <script>+ (function () {+ const reveals = document.querySelectorAll('.scroll-reveal');+ const observer = new IntersectionObserver(+ (entries) => {+ entries.forEach((entry) => {+ if (entry.isIntersecting) {+ entry.target.classList.add('revealed');+ observer.unobserve(entry.target);+ }+ });+ },+ { threshold: 0.15, rootMargin: '0px 0px -60px 0px' },+ );+ reveals.forEach((el) => {+ const siblings = Array.from(+ el.parentElement.querySelectorAll('.scroll-reveal'),+ );+ const idx = siblings.indexOf(el);+ el.style.transitionDelay = idx * 0.1 + 's';+ observer.observe(el);+ });+ })();+ </script>+ </body>+</html>diff --git a/playground.html b/playground.htmlindex 5b745d4f3..451db4e3a 100644--- a/playground.html+++ b/playground.html@@ -3,223 +3,365 @@<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">- <title>Playground</title>+ <title>Playground · three.ws</title>+ <link rel="shortcut icon" href="/favicon.ico" /><link rel="stylesheet" href="/style.css">+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"+ rel="stylesheet"+ /><scripttype="module"src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <script defer src="/footer-newsletter.js"></script><style>- .agent-page-header {- position: sticky;- top: 0;- z-index: 100;- display: flex;- align-items: center;- gap: 1rem;- padding: 0.75rem 1.618rem;- border-bottom: 1px solid rgba(255, 255, 255, 0.08);- background: rgba(0, 0, 0, 0.85);- backdrop-filter: blur(12px);- -webkit-backdrop-filter: blur(12px);- }- .agent-page-header a {- color: rgba(255, 255, 255, 0.5);- text-decoration: none;- font-size: 0.764rem;- display: inline-flex;- align-items: center;- transition: color 0.15s;- }- .agent-page-header a:hover {- color: #fff;- }- .agent-header-logo {- height: 28px;- width: auto;- display: block;- }- .agent-header-nav {- display: flex;- align-items: center;- gap: 1.25rem;- margin-left: 1.5rem;- }- .agent-header-nav a {- font-size: 0.8rem;- color: rgba(255, 255, 255, 0.45);- }- .agent-header-nav a:hover {- color: rgba(255, 255, 255, 0.9);- }+ :root {+ --bg: #0a0a0a;+ --panel: #111;+ --panel-2: #161616;+ --border: #1f1f1f;+ --border-2: #2a2a2a;+ --text: #fafafa;+ --text-2: #a1a1aa;+ --text-3: #71717a;+ --accent: #a78bfa;+ --success: #34d399;+ }+ html, body {+ margin: 0;+ background: var(--bg);+ color: var(--text);+ font-family: 'Inter', system-ui, sans-serif;+ -webkit-font-smoothing: antialiased;+ }+ body {+ display: flex;+ flex-direction: column;+ min-height: 100vh;+ }+ a { color: inherit; }++ .agent-page-header {+ position: sticky;+ top: 0;+ z-index: 100;+ display: flex;+ align-items: center;+ gap: 1rem;+ padding: 0.75rem 1.618rem;+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);+ background: rgba(0, 0, 0, 0.85);+ backdrop-filter: blur(12px);+ -webkit-backdrop-filter: blur(12px);+ }+ .agent-page-header a {+ color: rgba(255, 255, 255, 0.5);+ text-decoration: none;+ font-size: 0.764rem;+ display: inline-flex;+ align-items: center;+ transition: color 0.15s;+ }+ .agent-page-header a:hover { color: #fff; }+ .agent-header-logo { height: 28px; width: auto; display: block; }+ .agent-header-nav {+ display: flex;+ align-items: center;+ gap: 1.25rem;+ margin-left: 1.5rem;+ }+ .agent-header-nav a { font-size: 0.8rem; color: rgba(255, 255, 255, 0.45); }+ .agent-header-nav a:hover { color: rgba(255, 255, 255, 0.9); }++ .pg-main {+ flex: 1;+ display: flex;+ flex-direction: column;+ align-items: center;+ padding: 2rem 1.5rem 4rem;+ gap: 1.5rem;+ }+ .pg-intro {+ max-width: 520px;+ text-align: center;+ color: var(--text-2);+ font-size: 14px;+ line-height: 1.55;+ }+ .pg-intro h1 {+ margin: 0 0 0.4rem;+ font-size: 22px;+ color: var(--text);+ font-weight: 600;+ letter-spacing: -0.01em;+ }.av-viewer {- background: radial-gradient(ellipse at center, rgba(154, 140, 255, 0.04) 0%, transparent 70%),- rgba(255, 255, 255, 0.02);- border: 1px solid rgba(255, 255, 255, 0.07);+ background: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.07) 0%, transparent 70%),+ var(--panel);+ border: 1px solid var(--border);border-radius: 16px;overflow: hidden;aspect-ratio: 1 / 1;+ width: 100%;max-width: 500px;- margin: 2rem auto;}- </style>- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <script defer src="/footer-newsletter.js"></script>- </head>- <header class="agent-page-header" style="justify-content: space-between">- <div style="display:inline-flex;align-items:center">- <a href="/marketplace.html?tab=mine" aria-label="Back to three.ws home">- <img src="/three.svg" alt="three.ws" class="agent-header-logo" />- </a>- <nav class="agent-header-nav" aria-label="Primary">- <a href="/discover">Discover</a>- <a href="/create">Create</a>- <a href="/studio">Studio</a>- <a href="/playground.html">Playground</a>- </nav>- </div>- </header>- <div class="av-viewer">- <model-viewer- id="viewer"- src="/avatars/default.glb"- alt="A 3D model of an avatar"- ar- ar-modes="webxr scene-viewer quick-look"- camera-controls- shadow-intensity="1"- environment-image="neutral"- auto-rotate- autoplay- ></model-viewer>- </div>- <div class="upload-container">- <input type="file" id="avatar-upload" accept=".glb">- <label for="avatar-upload">Upload your own avatar</label>- </div>- <div class="input-container">- <input type="text" id="avatar-name" placeholder="Enter a name for your avatar">- <button id="save-avatar">Save</button>- <button id="embed-avatar">Embed</button>- <button id="reset-avatar">Reset to Default</button>- </div>- <div id="embed-modal" class="modal">- <div class="modal-content">- <span class="close-button">×</span>- <h2>Embed your avatar</h2>- <p>Copy the code below to embed your avatar on your website.</p>- <textarea id="embed-code" readonly></textarea>- <button id="copy-embed-code">Copy</button>- </div>- </div>- <div id="loading-indicator" class="loading-indicator">- <div class="spinner"></div>- </div>- <style>- .upload-container {- display: flex;- justify-content: center;- margin-top: 2rem;- }- #avatar-upload {- display: none;- }- label[for="avatar-upload"] {- background: #ffd700;- color: #000;- padding: 0.5rem 1rem;- border-radius: 0.5rem;- cursor: pointer;- }- .input-container {- display: flex;- justify-content: center;- margin-top: 2rem;- gap: 1rem;- }- #avatar-name {- padding: 0.5rem;- border-radius: 0.5rem;- border: 1px solid #ccc;- }- #save-avatar, #embed-avatar, #reset-avatar, #copy-embed-code {- background: #ffd700;- color: #000;- padding: 0.5rem 1rem;- border-radius: 0.5rem;- cursor: pointer;- border: none;- }+ .av-viewer model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ }++ .pg-controls {+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 0.75rem;+ width: 100%;+ max-width: 500px;+ }+ .pg-upload-label {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ background: var(--panel);+ border: 1px dashed var(--border-2);+ color: var(--text-2);+ padding: 0.75rem 1.25rem;+ border-radius: 10px;+ cursor: pointer;+ font-size: 13px;+ transition: color 0.15s, border-color 0.15s, background 0.15s;+ width: 100%;+ box-sizing: border-box;+ }+ .pg-upload-label:hover {+ color: var(--text);+ border-color: var(--text-3);+ background: var(--panel-2);+ }+ #avatar-upload { display: none; }++ .pg-row {+ display: flex;+ gap: 0.5rem;+ width: 100%;+ flex-wrap: wrap;+ }+ #avatar-name {+ flex: 1 1 200px;+ min-width: 0;+ padding: 0.6rem 0.85rem;+ border-radius: 10px;+ border: 1px solid var(--border-2);+ background: var(--panel);+ color: var(--text);+ font-family: inherit;+ font-size: 13px;+ }+ #avatar-name::placeholder { color: var(--text-3); }+ #avatar-name:focus {+ outline: none;+ border-color: var(--accent);+ }+ .pg-btn {+ background: var(--panel);+ border: 1px solid var(--border-2);+ color: var(--text-2);+ padding: 0.6rem 1rem;+ border-radius: 10px;+ cursor: pointer;+ font-family: inherit;+ font-size: 13px;+ transition: color 0.15s, border-color 0.15s, background 0.15s;+ }+ .pg-btn:hover {+ color: var(--text);+ border-color: var(--text-3);+ background: var(--panel-2);+ }+ .pg-btn.primary {+ background: var(--accent);+ border-color: var(--accent);+ color: #0a0a0a;+ font-weight: 600;+ }+ .pg-btn.primary:hover {+ background: #8b6df0;+ border-color: #8b6df0;+ color: #0a0a0a;+ }+.modal {display: none;position: fixed;- z-index: 1;- left: 0;- top: 0;- width: 100%;- height: 100%;- overflow: auto;- background-color: rgba(0,0,0,0.4);+ inset: 0;+ z-index: 200;+ background-color: rgba(0, 0, 0, 0.65);+ backdrop-filter: blur(4px);+ -webkit-backdrop-filter: blur(4px);+ align-items: center;+ justify-content: center;+ padding: 1.5rem;}+ .modal.open { display: flex; }.modal-content {- background-color: #fefefe;- margin: 15% auto;- padding: 20px;- border: 1px solid #888;- width: 80%;- max-width: 500px;- border-radius: 0.5rem;+ background: var(--panel);+ border: 1px solid var(--border-2);+ padding: 1.5rem;+ width: 100%;+ max-width: 520px;+ border-radius: 14px;+ color: var(--text);+ position: relative;+ }+ .modal-content h2 {+ margin: 0 0 0.4rem;+ font-size: 16px;+ font-weight: 600;+ }+ .modal-content p {+ margin: 0 0 1rem;+ color: var(--text-2);+ font-size: 13px;}.close-button {- color: #aaa;- float: right;- font-size: 28px;- font-weight: bold;- }- .close-button:hover,- .close-button:focus {- color: black;- text-decoration: none;+ position: absolute;+ top: 0.75rem;+ right: 1rem;+ color: var(--text-3);+ font-size: 22px;+ font-weight: 400;cursor: pointer;+ line-height: 1;+ background: transparent;+ border: none;+ padding: 0;}+ .close-button:hover { color: var(--text); }#embed-code {width: 100%;- height: 100px;- margin-top: 1rem;- border-radius: 0.5rem;+ box-sizing: border-box;+ height: 120px;+ padding: 0.75rem;+ border-radius: 10px;+ border: 1px solid var(--border-2);+ background: var(--panel-2);+ color: var(--text-2);+ font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;+ font-size: 12px;+ resize: vertical;}+ #embed-code:focus { outline: none; border-color: var(--accent); }#copy-embed-code {- margin-top: 1rem;+ margin-top: 0.75rem;}+.loading-indicator {display: none;position: fixed;- z-index: 2;- left: 0;- top: 0;- width: 100%;- height: 100%;- background-color: rgba(0,0,0,0.4);+ inset: 0;+ z-index: 150;+ background-color: rgba(0, 0, 0, 0.5);+ backdrop-filter: blur(2px);+ -webkit-backdrop-filter: blur(2px);+ align-items: center;+ justify-content: center;}+ .loading-indicator.open { display: flex; }.spinner {- border: 16px solid #f3f3f3;- border-top: 16px solid #3498db;+ width: 48px;+ height: 48px;+ border: 3px solid rgba(255, 255, 255, 0.1);+ border-top-color: var(--accent);border-radius: 50%;- width: 120px;- height: 120px;- animation: spin 2s linear infinite;- position: absolute;- top: 50%;- left: 50%;- margin-top: -60px;- margin-left: -60px;+ animation: spin 0.9s linear infinite;}@keyframes spin {- 0% { transform: rotate(0deg); }- 100% { transform: rotate(360deg); }+ to { transform: rotate(360deg); }}- </style>++ .pg-status {+ color: var(--text-3);+ font-size: 12px;+ min-height: 16px;+ text-align: center;+ }+ .pg-status.ok { color: var(--success); }+ .pg-status.err { color: #f87171; }+ </style>+</head>+<body>+ <header class="agent-page-header" style="justify-content: space-between">+ <div style="display:inline-flex;align-items:center">+ <a href="/" aria-label="three.ws home">+ <img src="/three.svg" alt="three.ws" class="agent-header-logo" />+ </a>+ <nav class="agent-header-nav" aria-label="Primary">+ <a href="/discover">Discover</a>+ <a href="/create">Create</a>+ <a href="/studio">Studio</a>+ <a href="/playground.html">Playground</a>+ </nav>+ </div>+ </header>++ <main class="pg-main">+ <div class="pg-intro">+ <h1>Avatar Playground</h1>+ <p>Drop in a <code>.glb</code> avatar to preview it in 3D. Save it locally and grab an embed snippet for any site.</p>+ </div>++ <div class="av-viewer">+ <model-viewer+ id="viewer"+ src="/avatars/default.glb"+ alt="A 3D avatar"+ ar+ ar-modes="webxr scene-viewer quick-look"+ camera-controls+ shadow-intensity="1"+ environment-image="neutral"+ auto-rotate+ autoplay+ ></model-viewer>+ </div>++ <div class="pg-controls">+ <input type="file" id="avatar-upload" accept=".glb">+ <label for="avatar-upload" class="pg-upload-label">Upload a .glb avatar</label>++ <div class="pg-row">+ <input type="text" id="avatar-name" placeholder="Name your avatar">+ <button id="save-avatar" class="pg-btn primary" type="button">Save</button>+ <button id="embed-avatar" class="pg-btn" type="button">Embed</button>+ <button id="reset-avatar" class="pg-btn" type="button">Reset</button>+ </div>++ <div id="pg-status" class="pg-status"></div>+ </div>+ </main>++ <div id="embed-modal" class="modal" role="dialog" aria-modal="true" aria-labelledby="embed-modal-title">+ <div class="modal-content">+ <button class="close-button" type="button" aria-label="Close">×</button>+ <h2 id="embed-modal-title">Embed your avatar</h2>+ <p>Copy this snippet into any HTML page to embed your avatar.</p>+ <textarea id="embed-code" readonly></textarea>+ <button id="copy-embed-code" class="pg-btn primary" type="button">Copy snippet</button>+ </div>+ </div>++ <div id="loading-indicator" class="loading-indicator">+ <div class="spinner"></div>+ </div>++ <div id="footer-container"></div>+ <script src="/footer.js"></script>+<script>document.addEventListener('DOMContentLoaded', () => {const viewer = document.getElementById('viewer');@@ -229,104 +371,118 @@const resetButton = document.getElementById('reset-avatar');const avatarName = document.getElementById('avatar-name');const modal = document.getElementById('embed-modal');- const closeButton = document.querySelector('.close-button');+ const closeButton = modal.querySelector('.close-button');const copyEmbedCodeButton = document.getElementById('copy-embed-code');const loadingIndicator = document.getElementById('loading-indicator');+ const statusEl = document.getElementById('pg-status');- const defaultAvatar = {- name: 'Default Avatar',- file: '/avatars/default.glb'+ const defaultAvatar = { name: 'Default Avatar', file: '/avatars/default.glb' };++ let statusTimer = null;+ const setStatus = (msg, kind = '') => {+ statusEl.textContent = msg || '';+ statusEl.className = 'pg-status' + (kind ? ' ' + kind : '');+ if (statusTimer) clearTimeout(statusTimer);+ if (msg) statusTimer = setTimeout(() => setStatus(''), 3000);};- const showLoading = () => loadingIndicator.style.display = 'block';- const hideLoading = () => loadingIndicator.style.display = 'none';+ const showLoading = () => loadingIndicator.classList.add('open');+ const hideLoading = () => loadingIndicator.classList.remove('open');const loadAvatar = (avatar) => {showLoading();- avatarName.value = avatar.name;+ avatarName.value = avatar.name || '';viewer.src = avatar.file;- viewer.addEventListener('load', () => {+ viewer.addEventListener('load', hideLoading, { once: true });+ viewer.addEventListener('error', () => {hideLoading();+ setStatus('Could not load avatar.', 'err');}, { once: true });};- const handleFileUpload = (event) => {+ let pendingFile = null;++ upload.addEventListener('change', (event) => {const file = event.target.files[0];- if (file) {- if (file.name.endsWith('.glb')) {- const url = URL.createObjectURL(file);- loadAvatar({ name: file.name, file: url });- } else {- alert('Please upload a .glb file.');- }+ if (!file) return;+ if (!file.name.toLowerCase().endsWith('.glb')) {+ setStatus('Only .glb files are supported.', 'err');+ return;}- };+ pendingFile = file;+ const url = URL.createObjectURL(file);+ loadAvatar({ name: file.name.replace(/\.glb$/i, ''), file: url });+ });- const saveAvatar = () => {- const name = avatarName.value;- const file = upload.files[0];- if (name && file) {- const reader = new FileReader();- reader.onload = (event) => {- const avatar = {- name,- file: event.target.result- };- localStorage.setItem('avatar', JSON.stringify(avatar));- alert('Avatar saved!');- };- reader.readAsDataURL(file);- } else {- alert('Please enter a name and upload an avatar.');+ saveButton.addEventListener('click', () => {+ const name = avatarName.value.trim();+ if (!name) {+ setStatus('Enter a name first.', 'err');+ return;}- };+ if (!pendingFile) {+ setStatus('Upload a .glb to save.', 'err');+ return;+ }+ const reader = new FileReader();+ reader.onload = (event) => {+ try {+ localStorage.setItem('avatar', JSON.stringify({+ name,+ file: event.target.result,+ }));+ setStatus('Avatar saved to this browser.', 'ok');+ } catch (err) {+ setStatus('Avatar too large for local storage.', 'err');+ }+ };+ reader.onerror = () => setStatus('Could not read file.', 'err');+ reader.readAsDataURL(pendingFile);+ });- const openEmbedModal = () => {- const savedAvatar = JSON.parse(localStorage.getItem('avatar'));- if (savedAvatar) {- const embedCode = `<iframe src="${window.location.origin}/a-embed.html?avatar=${encodeURIComponent(savedAvatar.file)}" width="500" height="500" frameborder="0"></iframe>`;- const embedCodeTextarea = document.getElementById('embed-code');- embedCodeTextarea.value = embedCode;- modal.style.display = 'block';- } else {- alert('Please save an avatar first.');+ embedButton.addEventListener('click', () => {+ const saved = JSON.parse(localStorage.getItem('avatar') || 'null');+ if (!saved) {+ setStatus('Save an avatar first.', 'err');+ return;}- };+ const embedCode = `<iframe src="${window.location.origin}/a-embed.html?avatar=${encodeURIComponent(saved.file)}" width="500" height="500" frameborder="0" allow="xr-spatial-tracking"></iframe>`;+ document.getElementById('embed-code').value = embedCode;+ modal.classList.add('open');+ });- const closeModal = () => {- modal.style.display = 'none';- };+ const closeModal = () => modal.classList.remove('open');+ closeButton.addEventListener('click', closeModal);+ modal.addEventListener('click', (event) => {+ if (event.target === modal) closeModal();+ });+ document.addEventListener('keydown', (event) => {+ if (event.key === 'Escape' && modal.classList.contains('open')) closeModal();+ });- const copyEmbedCode = () => {- const embedCodeTextarea = document.getElementById('embed-code');- embedCodeTextarea.select();- document.execCommand('copy');- alert('Embed code copied to clipboard!');- };+ copyEmbedCodeButton.addEventListener('click', async () => {+ const textarea = document.getElementById('embed-code');+ try {+ await navigator.clipboard.writeText(textarea.value);+ setStatus('Embed snippet copied.', 'ok');+ } catch {+ textarea.select();+ document.execCommand('copy');+ setStatus('Embed snippet copied.', 'ok');+ }+ });- const resetToDefault = () => {+ resetButton.addEventListener('click', () => {localStorage.removeItem('avatar');+ pendingFile = null;+ upload.value = '';loadAvatar(defaultAvatar);- };-- upload.addEventListener('change', handleFileUpload);- saveButton.addEventListener('click', saveAvatar);- embedButton.addEventListener('click', openEmbedModal);- resetButton.addEventListener('click', resetToDefault);- closeButton.addEventListener('click', closeModal);- copyEmbedCodeButton.addEventListener('click', copyEmbedCode);- window.addEventListener('click', (event) => {- if (event.target == modal) {- closeModal();- }+ setStatus('Reset to default avatar.', 'ok');});- const savedAvatar = JSON.parse(localStorage.getItem('avatar'));- loadAvatar(savedAvatar || defaultAvatar);+ const saved = JSON.parse(localStorage.getItem('avatar') || 'null');+ loadAvatar(saved || defaultAvatar);});</script>-- <div id="footer-container"></div>- <script src="/footer.js"></script></body></html>diff --git a/public/agents/index.html b/public/agents/index.htmlindex 3bd9e261a..8fefc4681 100644--- a/public/agents/index.html+++ b/public/agents/index.html@@ -343,6 +343,11 @@</head><body><header>+ <div id="nav-container"></div>+ </header>+ <script src="/nav.js"></script>++ <header class="page-header"><a href="/" class="brand"><img src="/three.svg" alt="" class="header-logo" aria-hidden="true" />three.ws</a><h1>Agent Directory</h1><p>Discover registered agents across the ecosystem</p>@@ -387,6 +392,9 @@</div></div>+ <div id="footer-container"></div>+ <script src="/footer.js" defer></script>+<script type="module" src="/agents/boot.js"></script></body></html>diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.jsindex ccc950ef5..2570bc327 100644--- a/public/dashboard/dashboard.js+++ b/public/dashboard/dashboard.js@@ -122,25 +122,25 @@ export function currentRoute() {if (m && m[1]) return m[1];const hash = location.hash.slice(1);if (hash) return hash;- return 'agents';+ return 'avatars';}// Render a route into <main>. Does not touch the URL.function renderRoute(route) {- const [base, ...rest] = (route || 'agents').split('/');+ const [base, ...rest] = (route || 'avatars').split('/');document.querySelectorAll('aside a').forEach((a) => a.classList.toggle('active', a.dataset.tab === base));const main = document.getElementById('main');main.innerHTML = '';- const renderer = tabs[base] || tabs.agents;+ const renderer = tabs[base] || tabs.avatars;renderer(main, rest);}// Programmatic navigation: pushes /dashboard/<route> into history and renders.// Use this instead of `location.hash = ...`.export function goto(route) {- const clean = (route || 'agents').replace(/^#?\/+|\/+$/g, '').replace(/^#/, '');+ const clean = (route || 'avatars').replace(/^#?\/+|\/+$/g, '').replace(/^#/, '');const target = '/dashboard/' + clean;if (location.pathname + location.search !== target) {history.pushState({ route: clean }, '', target);@@ -240,7 +240,7 @@ async function renderAgents(root) {<div class="widgets-header"><div><h1>Your agents</h1>- <p class="sub">Agents you've created on three.ws — each has a wallet, skills, and an optional ERC-8004 on-chain identity.</p>+ <p class="sub">Agents you've created on three.ws — each has a wallet, skills, and an optional on-chain identity.</p></div><button id="agents-new" class="btn-primary" type="button">New agent</button></div>@@ -659,6 +659,7 @@ async function loadXPanel({ host, meterEl, bodyEl, avatar }) {</div><div data-x-msg style="margin-top:10px;font-size:13px"></div><div data-x-scheduled style="margin-top:14px"></div>+ <div data-x-triggers style="margin-top:18px;padding-top:14px;border-top:1px solid #22222e"></div>`;const textEl = bodyEl.querySelector('[data-x-text]');@@ -669,6 +670,7 @@ async function loadXPanel({ host, meterEl, bodyEl, avatar }) {const scheduleBtn = bodyEl.querySelector('[data-x-schedule]');const disconnectBtn = bodyEl.querySelector('[data-x-disconnect]');const scheduledEl = bodyEl.querySelector('[data-x-scheduled]');+ const triggersEl = bodyEl.querySelector('[data-x-triggers]');const setMsg = (text, color = '#9a8cff') => { msgEl.style.color = color; msgEl.innerHTML = text; };textEl.addEventListener('input', () => { countEl.textContent = textEl.value.length; });@@ -759,6 +761,135 @@ async function loadXPanel({ host, meterEl, bodyEl, avatar }) {});loadScheduledPosts(scheduledEl);+ loadXTriggers(triggersEl, avatar);+}++async function loadXTriggers(host, avatar) {+ if (!host) return;+ const agentId = avatar.agent_id || avatar.id;+ host.innerHTML = `<div class="muted" style="font-size:11px">Loading triggers…</div>`;+ let triggers = [];+ try {+ const r = await fetch('/api/x/triggers', { credentials: 'include' });+ triggers = (await r.json()).triggers || [];+ } catch {}+ triggers = triggers.filter((t) => !t.agent_id || t.agent_id === agentId);+ const byKind = Object.fromEntries(triggers.map((t) => [t.kind, t]));++ const row = (kind, label, summary, controlsHtml) => {+ const t = byKind[kind];+ const on = t?.enabled;+ return `+ <div style="display:flex;gap:10px;padding:10px 0;border-bottom:1px solid #1a1a24;align-items:flex-start">+ <label style="display:flex;align-items:center;cursor:pointer;padding-top:2px">+ <input type="checkbox" data-trig="${kind}" ${on ? 'checked' : ''} style="margin:0;width:auto">+ </label>+ <div style="flex:1;min-width:0">+ <div style="color:#ccc;font-size:13px;font-weight:500">${label}</div>+ <div class="muted" style="font-size:11px;margin-top:2px">${summary}</div>+ <div data-trig-config="${kind}" style="margin-top:8px;${on ? '' : 'display:none'}">${controlsHtml}</div>+ </div>+ </div>+ `;+ };++ const dailyHour = byKind.daily_persona?.config?.hour_utc ?? 13;+ const dailyTopic = byKind.daily_persona?.config?.topic ?? '';+ const weeklyDay = byKind.weekly_digest?.config?.day_of_week ?? 0;+ const weeklyHour = byKind.weekly_digest?.config?.hour_utc ?? 16;+ const priceThresholds = (byKind.price_milestone?.config?.thresholds_usd ?? [10000, 50000, 100000, 500000, 1000000]).join(', ');+ const paymentMin = byKind.payment_received?.config?.min_amount_usd ?? 1;++ host.innerHTML = `+ <div class="muted" style="font-size:11px;text-transform:uppercase;letter-spacing:0.07em;margin-bottom:8px">Auto-post triggers</div>+ ${row('daily_persona', 'Daily in-character post',+ 'Agent tweets once a day at your chosen UTC hour, in voice.',+ `<label style="font-size:12px;color:#888">UTC hour <input type="number" min="0" max="23" data-trig-input="daily_persona.hour_utc" value="${dailyHour}" style="width:60px;display:inline-block;margin-left:6px"></label>+ <label style="font-size:12px;color:#888;display:block;margin-top:6px">Topic hint (optional) <input type="text" data-trig-input="daily_persona.topic" value="${attr(dailyTopic)}" placeholder="What should I talk about?" style="width:100%;display:block;margin-top:4px"></label>`)}+ ${row('weekly_digest', 'Weekly digest',+ 'Once-a-week recap including token activity if linked.',+ `<label style="font-size:12px;color:#888">Day <select data-trig-input="weekly_digest.day_of_week" style="width:auto;display:inline-block;margin-left:6px">+ ${['Sun','Mon','Tue','Wed','Thu','Fri','Sat'].map((d,i)=>`<option value="${i}" ${i===weeklyDay?'selected':''}>${d}</option>`).join('')}+ </select></label>+ <label style="font-size:12px;color:#888;margin-left:10px">UTC hour <input type="number" min="0" max="23" data-trig-input="weekly_digest.hour_utc" value="${weeklyHour}" style="width:60px;display:inline-block;margin-left:6px"></label>`)}+ ${row('price_milestone', 'Token market-cap milestones',+ 'Auto-tweets when your pump.fun token crosses each threshold.',+ `<label style="font-size:12px;color:#888;display:block">USD thresholds (comma-separated) <input type="text" data-trig-input="price_milestone.thresholds_usd" value="${attr(priceThresholds)}" style="width:100%;display:block;margin-top:4px"></label>`)}+ ${row('payment_received', 'Thank-you on every payment',+ 'Tweets a thank-you when a user pays your agent for a skill.',+ `<label style="font-size:12px;color:#888">Minimum amount (USD) <input type="number" min="0" step="0.01" data-trig-input="payment_received.min_amount_usd" value="${paymentMin}" style="width:80px;display:inline-block;margin-left:6px"></label>`)}+ <div data-trig-msg style="margin-top:8px;font-size:12px"></div>+ `;++ const trigMsg = host.querySelector('[data-trig-msg]');+ const setTrigMsg = (text, color = '#9a8cff') => { trigMsg.style.color = color; trigMsg.textContent = text; };++ function readConfigFromUI(kind) {+ const get = (k) => host.querySelector(`[data-trig-input="${kind}.${k}"]`)?.value;+ if (kind === 'daily_persona') return { hour_utc: parseInt(get('hour_utc') || '0', 10), topic: (get('topic') || '').trim() || undefined };+ if (kind === 'weekly_digest') return { day_of_week: parseInt(get('day_of_week') || '0', 10), hour_utc: parseInt(get('hour_utc') || '0', 10) };+ if (kind === 'price_milestone') {+ const list = (get('thresholds_usd') || '').split(',').map((s) => parseFloat(s.trim())).filter((n) => Number.isFinite(n) && n > 0);+ return { thresholds_usd: list };+ }+ if (kind === 'payment_received') return { min_amount_usd: parseFloat(get('min_amount_usd') || '0') };+ return {};+ }++ async function upsertTrigger(kind, enabled) {+ const config = readConfigFromUI(kind);+ const existing = byKind[kind];+ if (existing) {+ const r = await fetch(`/api/x/triggers?id=${encodeURIComponent(existing.id)}`, {+ method: 'PATCH', credentials: 'include',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ enabled, config }),+ });+ if (!r.ok) throw new Error((await r.json()).error_description || 'update failed');+ byKind[kind] = (await r.json()).trigger;+ } else {+ const r = await fetch('/api/x/triggers', {+ method: 'POST', credentials: 'include',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ kind, config, enabled, agent_id: agentId }),+ });+ if (!r.ok) throw new Error((await r.json()).error_description || 'create failed');+ byKind[kind] = (await r.json()).trigger;+ }+ }++ host.querySelectorAll('[data-trig]').forEach((cb) => {+ cb.addEventListener('change', async () => {+ const kind = cb.getAttribute('data-trig');+ const configBox = host.querySelector(`[data-trig-config="${kind}"]`);+ if (configBox) configBox.style.display = cb.checked ? '' : 'none';+ try {+ await upsertTrigger(kind, cb.checked);+ setTrigMsg(`${cb.checked ? 'Enabled' : 'Disabled'} ${kind.replace('_', ' ')}.`);+ } catch (err) {+ cb.checked = !cb.checked;+ setTrigMsg(err.message, '#ffb3b3');+ }+ });+ });++ host.querySelectorAll('[data-trig-input]').forEach((inp) => {+ let timer;+ inp.addEventListener('input', () => {+ clearTimeout(timer);+ timer = setTimeout(async () => {+ const kind = inp.getAttribute('data-trig-input').split('.')[0];+ const cb = host.querySelector(`[data-trig="${kind}"]`);+ if (!cb?.checked) return;+ try {+ await upsertTrigger(kind, true);+ setTrigMsg('Saved.', '#888');+ } catch (err) {+ setTrigMsg(err.message, '#ffb3b3');+ }+ }, 600);+ });+ });}async function loadScheduledPosts(host) {@@ -4256,7 +4387,17 @@ async function renderPayments(root) {let data;try {const res = await fetch(`/api/agents/${agentId}/payments?${params}`, { credentials: 'include' });- if (!res.ok) throw new Error(await res.text());+ if (!res.ok) {+ const text = await res.text();+ let msg = text;+ try {+ const j = JSON.parse(text);+ msg = j.error_description || j.message || j.error || text;+ } catch { /* not JSON */ }+ const err = new Error(msg);+ err.status = res.status;+ throw err;+ }data = await res.json();} catch (e) {body.innerHTML = `<div class="err">${esc(String(e.message || e))}</div>`;diff --git a/public/dashboard/index.html b/public/dashboard/index.htmlindex 5fe2088f0..e8f8e7a9b 100644--- a/public/dashboard/index.html+++ b/public/dashboard/index.html@@ -1153,8 +1153,8 @@</header><div class="layout"><aside>- <a href="/dashboard/agents" class="active" data-tab="agents">Agents</a>- <a href="/dashboard/avatars" data-tab="avatars">Avatars</a>+ <a href="/dashboard/avatars" class="active" data-tab="avatars">Avatars</a>+ <a href="/dashboard/agents" data-tab="agents">Agents</a><a href="/dashboard/create" data-tab="create">Create from selfie</a><a href="/dashboard/upload" data-tab="upload">Upload</a><a href="/dashboard/animations" data-tab="animations">Animations</a>@@ -1169,6 +1169,7 @@<a href="/dashboard/revenue" data-tab="revenue">Revenue</a><a href="/dashboard/earnings" data-tab="earnings">Earnings</a><a href="/dashboard/account" data-tab="account">Account</a>+ <a href="/dashboard/portfolio">Portfolio</a><a href="/dashboard/wallets">Wallets</a><a href="/vanity-wallet">Vanity wallet ✦</a><a href="/eth-vanity">ETH vanity (CREATE2) ✦</a>diff --git a/public/dashboard/portfolio.html b/public/dashboard/portfolio.htmlnew file mode 100644index 000000000..8bde375d0--- /dev/null+++ b/public/dashboard/portfolio.html@@ -0,0 +1,560 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width,initial-scale=1" />+ <title>Portfolio · Dashboard · three.ws</title>+ <link rel="icon" href="/favicon.ico" />+ <style>+ :root {+ color-scheme: dark;+ --accent: #6a5cff;+ --accent2: #ff5ca8;+ --ok: #5ce0a8;+ --warn: #ffb35c;+ --err: #ff6a6a;+ --border: #22222e;+ --bg: #0b0b10;+ --panel: #14141c;+ }+ * { box-sizing: border-box; }+ body {+ font: 15px/1.55 -apple-system, system-ui, Segoe UI, Roboto, sans-serif;+ color: #eee;+ margin: 0;+ background: var(--bg);+ min-height: 100vh;+ }+ a { color: #9a8cff; text-decoration: none; }+ header {+ display: flex; align-items: center; justify-content: space-between;+ padding: 16px 24px; border-bottom: 1px solid var(--border);+ position: sticky; top: 0; background: var(--bg); z-index: 5;+ }+ .brand { font-weight: 600; letter-spacing: -0.01em; }+ .row { display: flex; align-items: center; gap: 8px; }+ main { padding: 28px; max-width: 1100px; margin: 0 auto; }+ h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }+ .sub { color: #888; margin: 0 0 22px; font-size: 14px; }+ .btn {+ padding: 9px 14px; border-radius: 9px; border: 0;+ font-size: 13px; font-weight: 600; cursor: pointer;+ background: var(--accent); color: #fff;+ }+ .btn:hover { filter: brightness(1.08); }+ .btn.sec { background: #222230; color: #ddd; }+ .btn.ghost { background: transparent; color: #ccc; border: 1px solid var(--border); }+ .btn:disabled { opacity: 0.5; cursor: not-allowed; }+ .btn.sm { padding: 6px 10px; font-size: 12px; }++ .top-card {+ background: linear-gradient(135deg, rgba(106,92,255,0.08), rgba(255,92,168,0.06));+ border: 1px solid var(--border);+ border-radius: 16px;+ padding: 24px 24px 0;+ margin-bottom: 18px;+ overflow: hidden;+ }+ .top-row {+ display: flex; align-items: baseline; justify-content: space-between;+ gap: 16px; flex-wrap: wrap; margin-bottom: 12px;+ }+ .tot-label { color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }+ .tot-value { font-size: 38px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }+ .tot-meta { color: #888; font-size: 13px; margin-top: 4px; }+ .tot-actions { display: flex; gap: 8px; flex-wrap: wrap; }+ #chart { height: 220px; margin: 0 -24px -1px; }+ #chart-empty {+ height: 220px; display: none; align-items: center; justify-content: center;+ color: #555; font-size: 13px; border-top: 1px solid var(--border);+ margin: 0 -24px -1px;+ }++ .section-head {+ display: flex; align-items: center; justify-content: space-between;+ margin: 24px 0 10px;+ }+ .section-head h2 { font-size: 14px; margin: 0; color: #aaa; text-transform: uppercase; letter-spacing: 0.06em; }++ .wallet-list { display: flex; flex-direction: column; gap: 10px; }+ .wcard {+ background: var(--panel); border: 1px solid var(--border);+ border-radius: 12px; padding: 14px 16px;+ }+ .wcard-head {+ display: flex; align-items: center; justify-content: space-between;+ gap: 12px; flex-wrap: wrap;+ }+ .wcard-name { font-weight: 600; font-size: 14px; }+ .wcard-addr {+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;+ font-size: 12px; color: #888;+ display: inline-flex; align-items: center; gap: 6px;+ }+ .copy-btn {+ background: none; border: none; color: #666; cursor: pointer;+ padding: 0 2px; font-size: 12px;+ }+ .copy-btn:hover { color: #aaa; }+ .pill {+ display: inline-flex; align-items: center; gap: 6px;+ font-size: 11px; padding: 3px 8px; border-radius: 99px;+ background: #20202c; color: #ccc; white-space: nowrap;+ text-transform: uppercase; letter-spacing: 0.05em;+ }+ .pill.sol { background: rgba(20,241,149,0.12); color: #5ce0a8; }+ .pill.evm { background: rgba(106,92,255,0.14); color: #9a8cff; }+ .pill.err { background: rgba(255,106,106,0.14); color: #ff9a9a; }+ .wcard-usd { font-size: 18px; font-weight: 600; }+ .wcard-actions { display: flex; gap: 6px; flex-wrap: wrap; }+ .tokens {+ display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));+ gap: 8px; margin-top: 12px; padding-top: 12px;+ border-top: 1px solid var(--border);+ }+ .tok { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: #0f0f17; }+ .tok img { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; background: #222; }+ .tok-sym { font-weight: 500; font-size: 13px; }+ .tok-amt { color: #888; font-size: 12px; margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }++ .empty {+ text-align: center; padding: 40px 20px;+ border: 1px dashed var(--border); border-radius: 14px; color: #888;+ }+ .err-banner {+ padding: 12px 14px; background: rgba(255,92,92,0.1);+ border: 1px solid rgba(255,92,92,0.3); border-radius: 10px;+ color: #ffb3b3; margin-bottom: 14px; display: none; font-size: 13px;+ }+ .muted { color: #888; font-size: 13px; }+ body[data-auth-pending] { visibility: hidden; }+ .header-logo { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }++ /* Modal */+ .scrim {+ position: fixed; inset: 0; background: rgba(5,5,9,0.72);+ display: none; align-items: center; justify-content: center;+ z-index: 50; padding: 20px;+ }+ .scrim[data-open="true"] { display: flex; }+ .modal {+ background: var(--panel); border: 1px solid var(--border);+ border-radius: 14px; padding: 22px;+ width: 100%; max-width: 460px; max-height: 90vh; overflow: auto;+ }+ .modal h3 { margin: 0 0 4px; font-size: 17px; }+ .modal .sub { margin: 0 0 16px; }+ .modal label { display: block; margin-bottom: 10px; }+ .modal label span { display: block; font-size: 12px; color: #aaa; margin-bottom: 4px; }+ .modal input, .modal select {+ width: 100%; padding: 10px 12px; border-radius: 8px;+ border: 1px solid var(--border); background: #0c0c14; color: #eee;+ font-size: 14px; font-family: inherit;+ }+ .modal input[data-mono] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }+ .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }+ .qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }+ .qr-wrap canvas { background: #fff; padding: 10px; border-radius: 10px; }+ .qr-addr {+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;+ font-size: 12px; color: #ccc; word-break: break-all; text-align: center; max-width: 100%;+ }+ </style>+ </head>+ <body data-auth-pending>+ <header>+ <div class="brand"><a href="/"><img src="/three.svg" alt="" class="header-logo" aria-hidden="true" />three.ws</a></div>+ <div class="row">+ <a href="/dashboard" class="muted" style="font-size:13px">← Dashboard</a>+ <div id="header-user-slot"></div>+ </div>+ </header>+ <main>+ <h1>Portfolio</h1>+ <p class="sub">Real-time value across every agent wallet under your account.</p>++ <div id="error" class="err-banner"></div>++ <div class="top-card">+ <div class="top-row">+ <div>+ <div class="tot-label">Total value</div>+ <div class="tot-value" id="tot-value">—</div>+ <div class="tot-meta" id="tot-meta">Click refresh to fetch live balances.</div>+ </div>+ <div class="tot-actions">+ <button id="refresh-btn" class="btn">Refresh</button>+ </div>+ </div>+ <div id="chart"></div>+ <div id="chart-empty">No snapshots yet — hit Refresh to capture your first.</div>+ </div>++ <div class="section-head">+ <h2>Agent wallets</h2>+ <span class="muted" id="wallet-count"></span>+ </div>+ <div id="wallets" class="wallet-list">+ <div class="muted" style="padding:20px 4px">Loading…</div>+ </div>+ </main>++ <div id="scrim" class="scrim" role="dialog" aria-modal="true">+ <div class="modal" id="modal-body"></div>+ </div>++ <script type="module">+ import { renderHeaderUser } from '/header-user.js';++ const apiUrl = '/api';+ let csrfToken = null;+ let chart = null;+ let series = null;+ let currentSummary = null;++ const $ = (id) => document.getElementById(id);++ function fmtUsd(n) {+ if (!Number.isFinite(n)) return '$0.00';+ if (n >= 1000) return '$' + n.toLocaleString('en-US', { maximumFractionDigits: 2 });+ return '$' + n.toFixed(2);+ }+ function shortAddr(a) {+ if (!a) return '';+ return a.length > 14 ? `${a.slice(0, 6)}…${a.slice(-4)}` : a;+ }+ function setError(msg) {+ const el = $('error');+ if (!msg) { el.style.display = 'none'; return; }+ el.textContent = msg;+ el.style.display = 'block';+ }++ async function fetchUser() {+ const res = await fetch(`${apiUrl}/auth/me`, { credentials: 'include' });+ const data = res.ok ? await res.json() : null;+ if (!data?.user) {+ location.href = '/login?next=' + encodeURIComponent(location.pathname);+ return null;+ }+ document.body.removeAttribute('data-auth-pending');+ return data;+ }++ async function getCsrf() {+ if (csrfToken) return csrfToken;+ const r = await fetch(`${apiUrl}/csrf-token`, { credentials: 'include' });+ if (!r.ok) throw new Error('csrf failed');+ const d = await r.json();+ csrfToken = d?.data?.token;+ return csrfToken;+ }++ async function loadHistory() {+ const r = await fetch(`${apiUrl}/portfolio/history?days=90`, { credentials: 'include' });+ if (!r.ok) return [];+ const d = await r.json();+ return d.points || [];+ }++ async function loadSummary({ snapshot = false } = {}) {+ const url = `${apiUrl}/portfolio/summary${snapshot ? '?snapshot=1' : ''}`;+ const r = await fetch(url, { credentials: 'include' });+ if (!r.ok) {+ const e = await r.json().catch(() => ({}));+ throw new Error(e.error_description || 'failed to load portfolio');+ }+ return r.json();+ }++ function renderTotal(summary) {+ $('tot-value').textContent = fmtUsd(summary.total_usd);+ const at = new Date(summary.captured_at);+ $('tot-meta').textContent = `Updated ${at.toLocaleTimeString()} · ${summary.wallets.length} wallets`;+ }++ function renderWallets(summary) {+ const container = $('wallets');+ $('wallet-count').textContent = summary.wallets.length ? `${summary.wallets.length} wallets` : '';+ if (!summary.wallets.length) {+ container.innerHTML = `+ <div class="empty">+ <p>No agent wallets yet.</p>+ <p class="muted">Create an agent and you'll get a Solana + EVM custodial wallet automatically.</p>+ <p style="margin-top:14px"><a href="/dashboard/agents" class="btn sec sm">Manage agents</a></p>+ </div>`;+ return;+ }+ container.innerHTML = summary.wallets.map((w, i) => walletCard(w, i)).join('');+ for (const w of summary.wallets) {+ const id = `w-${w.chain}-${w.address}`.replace(/[^a-z0-9-]/gi, '_');+ document.querySelectorAll(`[data-wid="${id}"]`).forEach((b) => {+ b.addEventListener('click', () => onAction(b.dataset.kind, w));+ });+ }+ container.querySelectorAll('.copy-btn').forEach((b) =>+ b.addEventListener('click', () => {+ navigator.clipboard.writeText(b.dataset.copy);+ const orig = b.textContent;+ b.textContent = '✓';+ setTimeout(() => (b.textContent = orig), 1200);+ }),+ );+ }++ function walletCard(w) {+ const id = `w-${w.chain}-${w.address}`.replace(/[^a-z0-9-]/gi, '_');+ const chainPill = w.ok === false+ ? `<span class="pill err" title="${w.error || ''}">${w.chain} · error</span>`+ : `<span class="pill ${w.chain === 'solana' ? 'sol' : 'evm'}">${w.chain === 'solana' ? 'Solana' : (w.chain_id === 8453 ? 'Base' : 'Ethereum')}</span>`;+ const tokens = (w.tokens || []).slice(0, 8).map((t) => `+ <div class="tok">+ ${t.logo ? `<img src="${t.logo}" alt="" onerror="this.style.visibility='hidden'" />` : '<span style="width:18px;height:18px"></span>'}+ <span class="tok-sym">${escapeHtml(t.symbol || '?')}</span>+ <span class="tok-amt">${fmtAmt(t.amount)}<br><span style="color:#666">${fmtUsd(t.usd)}</span></span>+ </div>`).join('');+ const nativeRow = (w.native?.amount > 0 || (w.native?.usd ?? 0) > 0)+ ? `<div class="tok">+ <span style="width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;background:${w.chain === 'solana' ? '#14f195' : '#627eea'};color:#000;font-size:9px;font-weight:700;border-radius:50%">${w.native.symbol}</span>+ <span class="tok-sym">${w.native.symbol}</span>+ <span class="tok-amt">${fmtAmt(w.native.amount)}<br><span style="color:#666">${fmtUsd(w.native.usd)}</span></span>+ </div>` : '';+ return `+ <div class="wcard">+ <div class="wcard-head">+ <div>+ <div class="wcard-name">${escapeHtml(w.agent_name)} ${chainPill}</div>+ <div class="wcard-addr">+ <span>${shortAddr(w.address)}</span>+ <button class="copy-btn" data-copy="${w.address}" title="Copy address">📋</button>+ </div>+ </div>+ <div style="text-align:right">+ <div class="wcard-usd">${fmtUsd(w.usd || 0)}</div>+ <div class="wcard-actions" style="margin-top:6px">+ <button class="btn ghost sm" data-wid="${id}" data-kind="receive">Receive</button>+ <button class="btn sec sm" data-wid="${id}" data-kind="send">Send</button>+ </div>+ </div>+ </div>+ ${(nativeRow || tokens) ? `<div class="tokens">${nativeRow}${tokens}</div>` : ''}+ </div>`;+ }++ function fmtAmt(n) {+ if (!Number.isFinite(n)) return '0';+ if (n === 0) return '0';+ if (n < 0.0001) return n.toExponential(2);+ if (n < 1) return n.toFixed(4);+ if (n < 1000) return n.toFixed(3);+ return n.toLocaleString('en-US', { maximumFractionDigits: 2 });+ }+ function escapeHtml(s) {+ return String(s).replace(/[&<>"']/g, (c) => ({ '&':'&','<':'<','>':'>','"':'"',"'":''' }[c]));+ }++ // ── Chart ─────────────────────────────────────────────────────────+ async function ensureChart() {+ if (chart) return;+ const mod = await import('https://esm.sh/[email protected]');+ const { createChart, AreaSeries } = mod;+ const el = $('chart');+ chart = createChart(el, {+ layout: { background: { color: 'transparent' }, textColor: '#888', fontFamily: 'inherit', fontSize: 11 },+ grid: { vertLines: { visible: false }, horzLines: { color: '#1a1a24' } },+ rightPriceScale: { borderVisible: false },+ timeScale: { borderVisible: false, timeVisible: false },+ crosshair: { vertLine: { color: '#333' }, horzLine: { color: '#333' } },+ handleScroll: false,+ handleScale: false,+ });+ series = chart.addAreaSeries+ ? chart.addAreaSeries({+ lineColor: '#9a8cff',+ topColor: 'rgba(106,92,255,0.32)',+ bottomColor: 'rgba(106,92,255,0)',+ lineWidth: 2,+ priceFormat: { type: 'price', precision: 2, minMove: 0.01 },+ })+ : chart.addSeries(AreaSeries, {+ lineColor: '#9a8cff',+ topColor: 'rgba(106,92,255,0.32)',+ bottomColor: 'rgba(106,92,255,0)',+ lineWidth: 2,+ priceFormat: { type: 'price', precision: 2, minMove: 0.01 },+ });+ new ResizeObserver(() => {+ if (el.clientWidth) chart.applyOptions({ width: el.clientWidth, height: el.clientHeight });+ }).observe(el);+ }+ async function renderChart(points) {+ if (!points || points.length < 1) {+ $('chart').style.display = 'none';+ $('chart-empty').style.display = 'flex';+ return;+ }+ $('chart').style.display = 'block';+ $('chart-empty').style.display = 'none';+ await ensureChart();+ const data = points.map((p) => ({ time: Math.floor(new Date(p.t).getTime() / 1000), value: Number(p.usd) }));+ series.setData(data);+ chart.timeScale().fitContent();+ }++ // ── Actions ───────────────────────────────────────────────────────+ function openModal(html, after) {+ $('modal-body').innerHTML = html;+ $('scrim').setAttribute('data-open', 'true');+ if (after) after();+ }+ function closeModal() { $('scrim').removeAttribute('data-open'); }+ $('scrim').addEventListener('click', (e) => { if (e.target.id === 'scrim') closeModal(); });++ async function onAction(kind, w) {+ if (kind === 'receive') return openReceive(w);+ if (kind === 'send') return openSend(w);+ }++ async function openReceive(w) {+ openModal(`+ <h3>Receive ${w.chain === 'solana' ? 'Solana' : 'EVM'}</h3>+ <p class="sub">Send tokens to this address from any wallet or exchange.</p>+ <div class="qr-wrap">+ <canvas id="qr-canvas" width="220" height="220"></canvas>+ <div class="qr-addr">${escapeHtml(w.address)}</div>+ <button class="btn sec sm" id="qr-copy">Copy address</button>+ </div>+ <div class="modal-actions">+ <button class="btn ghost" id="close">Done</button>+ </div>+ `, async () => {+ $('close').onclick = closeModal;+ $('qr-copy').onclick = () => navigator.clipboard.writeText(w.address);+ const mod = await import('https://esm.sh/[email protected]');+ const QR = mod.default ?? mod;+ await QR.toCanvas($('qr-canvas'), w.address, { width: 220, margin: 1, color: { dark: '#0b0b10', light: '#ffffff' } });+ });+ }++ function openSend(w) {+ const assets = [{ value: 'native', label: w.native?.symbol || (w.chain === 'solana' ? 'SOL' : 'ETH') }];+ for (const t of w.tokens || []) {+ const id = t.mint || t.contract;+ if (id) assets.push({ value: id, label: t.symbol });+ }+ openModal(`+ <h3>Send from ${escapeHtml(w.agent_name)}</h3>+ <p class="sub">${w.chain === 'solana' ? 'Solana' : (w.chain_id === 8453 ? 'Base' : 'Ethereum')} · ${shortAddr(w.address)}</p>+ <form id="send-form">+ <label><span>Asset</span>+ <select name="asset">${assets.map((a) => `<option value="${escapeHtml(a.value)}">${escapeHtml(a.label)}</option>`).join('')}</select>+ </label>+ <label><span>Recipient address</span>+ <input name="recipient" data-mono required placeholder="${w.chain === 'solana' ? 'Solana address (base58)' : '0x…'}" />+ </label>+ <label><span>Amount</span>+ <input name="amount" inputmode="decimal" required placeholder="0.0" pattern="[0-9]*\\.?[0-9]*" />+ </label>+ <div class="modal-actions">+ <button type="button" class="btn ghost" id="cancel">Cancel</button>+ <button type="submit" class="btn">Send</button>+ </div>+ <p id="send-err" class="muted" style="color:#ff9a9a;display:none;margin-top:10px"></p>+ </form>+ `, () => {+ $('cancel').onclick = closeModal;+ $('send-form').addEventListener('submit', (e) => onSendSubmit(e, w));+ });+ }++ async function onSendSubmit(e, w) {+ e.preventDefault();+ const f = e.target;+ const asset = f.asset.value;+ const recipient = f.recipient.value.trim();+ const amount = f.amount.value.trim();+ const submit = f.querySelector('button[type="submit"]');+ submit.disabled = true;+ $('send-err').style.display = 'none';+ try {+ const token = await getCsrf();+ const r = await fetch(`${apiUrl}/portfolio/send`, {+ method: 'POST',+ credentials: 'include',+ headers: { 'content-type': 'application/json', 'x-csrf-token': token },+ body: JSON.stringify({+ agent_id: w.agent_id,+ chain: w.chain,+ asset,+ recipient,+ amount,+ }),+ });+ const d = await r.json();+ if (!r.ok) throw new Error(d.error_description || 'send failed');+ csrfToken = null; // one-time use+ closeModal();+ await refresh({ snapshot: true });+ } catch (err) {+ $('send-err').textContent = err.message;+ $('send-err').style.display = 'block';+ csrfToken = null;+ } finally {+ submit.disabled = false;+ }+ }++ // ── Page lifecycle ────────────────────────────────────────────────+ async function refresh({ snapshot = true } = {}) {+ setError('');+ $('refresh-btn').disabled = true;+ $('refresh-btn').textContent = 'Loading…';+ try {+ const [summary, history] = await Promise.all([+ loadSummary({ snapshot }),+ loadHistory(),+ ]);+ currentSummary = summary;+ renderTotal(summary);+ renderWallets(summary);+ // Always include the live "now" point so the chart isn't empty+ // when there's only one snapshot.+ const points = [...history];+ const last = points[points.length - 1];+ if (!last || Math.abs(new Date(last.t).getTime() - new Date(summary.captured_at).getTime()) > 5000) {+ points.push({ t: summary.captured_at, usd: summary.total_usd });+ }+ await renderChart(points);+ } catch (err) {+ setError(err.message);+ } finally {+ $('refresh-btn').disabled = false;+ $('refresh-btn').textContent = 'Refresh';+ }+ }++ (async () => {+ const me = await fetchUser();+ if (!me) return;+ renderHeaderUser($('header-user-slot'), me.user, { activePath: '/dashboard/portfolio' });+ $('refresh-btn').addEventListener('click', () => refresh({ snapshot: true }));+ // Initial load: read existing snapshots but don't write a new one+ // until the user clicks Refresh.+ try {+ const [summary, history] = await Promise.all([loadSummary({ snapshot: false }), loadHistory()]);+ currentSummary = summary;+ renderTotal(summary);+ renderWallets(summary);+ const points = [...history];+ if (points.length || summary.total_usd > 0) {+ points.push({ t: summary.captured_at, usd: summary.total_usd });+ }+ await renderChart(points);+ } catch (err) {+ setError(err.message);+ $('wallets').innerHTML = '<div class="muted" style="padding:20px 4px">Failed to load.</div>';+ }+ })();+ </script>+ </body>+</html>diff --git a/public/discover/index.html b/public/discover/index.htmlindex d4e7491a7..9c87d4ee5 100644--- a/public/discover/index.html+++ b/public/discover/index.html@@ -59,7 +59,7 @@<span>View my agents →</span></a></div>- <h2>Every agent, every chain.</h2>+ <h1>Every agent, every chain.</h1><p class="explore-sub">The complete on-chain index of ERC-8004 agents. Click a 3D avatar to load it inthe viewer. Click any card for its on-chain passport.@@ -127,6 +127,9 @@</section></main>+ <div id="footer-container"></div>+ <script src="/footer.js" defer></script>+<script type="module" src="/discover/discover.js"></script></body></html>diff --git a/public/docs/agents-vs-avatars.md b/public/docs/agents-vs-avatars.mdnew file mode 100644index 000000000..508e983e7--- /dev/null+++ b/public/docs/agents-vs-avatars.md@@ -0,0 +1,58 @@+# Agents vs. Avatars++three.ws is built around two distinct concepts. Confusing them is the single most common source of "where do I click?" questions, so this page is the canonical reference.++## The one-sentence model++**An agent is a mind. An avatar is a body. You pair them.**++| | Agent | Avatar |+|---|---|---|+| What it is | Identity, skills, memory, wallet | A 3D model (glTF / GLB) |+| URL | `/agent/<id>` | `/avatars/<id>` |+| Primary action | Launch · Chat · Embed | Use this body · Download GLB |+| Reusable? | A user has one or many; each is unique | One avatar can be worn by many agents |+| Lives in | The agent system | The marketplace |+| Owns a wallet? | Yes (Solana + EVM) | No |+| Speaks? | Yes | No — it's just the body |++## The four nouns of three.ws++Every page on three.ws is one of these four things. If you ever feel lost, ask: "Which of the four am I looking at?"++1. **Avatar** — a 3D body. Lives at `/avatars/<id>`. Discoverable in the marketplace.+2. **Agent** — a mind that wears an avatar. Lives at `/agent/<id>`. Yours appear in your dashboard.+3. **Marketplace** — where avatars (and shared agents) are listed. `/marketplace`.+4. **Studio** — where you assemble: pick an avatar, configure an agent, wire skills. `/studio`.++## Pairing them++You don't use an avatar by itself, and you don't use an agent without a body. Pairing happens in three places:++- **From an avatar page** — click `Start an agent`. This creates a new agent that wears this avatar.+- **From an agent page (no body yet)** — click `Pick a body`. This takes you to the avatar marketplace; selecting an avatar attaches it to the agent.+- **From Studio** — pick both sides explicitly. Use this when you want full control over name, skills, description, and wallet setup before publishing.++## How to tell which page you're on++We surface a small type pill at the top of every profile page:++- `Agent` (gold) on `/agent/<id>`+- `Avatar · 3D Body` (cyan) on `/avatars/<id>`++The pill always has a small `?` next to it that links back to this page.++## Frequently confused++- **"My agent has no body."** → Open the agent page, click `Pick a body`. You're choosing an avatar to attach.+- **"I want to use this avatar."** → Open the avatar page, click `Start an agent`. You're creating an agent that wears it.+- **"Can two agents share an avatar?"** → Yes. Avatars are reusable bodies; agents are unique minds.+- **"Can one agent change its avatar?"** → Yes, in the editor or via `PATCH /api/agents/<id>` with a new `avatar_id`.+- **"Where does the wallet live?"** → On the agent. Avatars don't have wallets.++## Where to go next++- New here? Start with the [Getting started tutorial](/docs/tutorials/getting-started).+- Want to build your first agent? Read [Build your first agent](/docs/tutorials/first-agent).+- Want to ship a custom avatar? Read [Avatar creation](/docs/avatar-creation).+- Curious about the runtime? Read [How it works](/docs/how-it-works).diff --git a/public/docs/tutorials/getting-started.md b/public/docs/tutorials/getting-started.mdnew file mode 100644index 000000000..e5d6c3695--- /dev/null+++ b/public/docs/tutorials/getting-started.md@@ -0,0 +1,96 @@+# Getting started with three.ws++A guided tour of the hosted product, in five minutes. No code, no install. By the end you'll have an agent with a body, a personality, and a shareable URL.++> Want to self-host or write code instead? See [Build your first agent](/docs/tutorials/first-agent).++## Before you begin++Open [three.ws](https://three.ws/) in another tab and sign in. Sign-in uses your wallet (Coinbase Smart Wallet via Privy by default) — there's no email or password to remember.++If you've never used three.ws before, it helps to know the [two core concepts](/docs/agents-vs-avatars):++- **Agent** = the mind (name, skills, memory, wallet)+- **Avatar** = the body (a 3D model)++You pair an avatar with an agent. That's the whole product.++---++## Step 1 — Pick a body++Go to the [Marketplace](/marketplace). You'll see a gallery of avatars. Each tile is a 3D body someone has made available.++Click any avatar to open its profile. You're now on a page like `/avatars/<id>`. Look for the cyan **`Avatar · 3D Body`** pill at the top — that confirms what you're looking at.++You can:+- **Rotate the model** by clicking and dragging.+- **Read the description** under the name.+- **Chat with it** in the Chat tab — but note: the avatar has no agent attached yet, so this uses a default personality.+- **Click `Start an agent`** to use this body for a new agent.++When you find one you like, click **Start an agent**.++---++## Step 2 — Name your agent++After clicking `Start an agent`, you land on `/agent/<id>` — the agent profile page. Look for the gold **`Agent`** pill at the top.++This page is now yours. The agent already has:+- A name (placeholder — change it next)+- A wallet (Solana + EVM, auto-generated)+- A set of default skills (greet, remember, think)+- The avatar you just picked, attached as its body++Click **Open in editor** (visible because you own the agent) to set the name, write a one-line description, and pick a personality. Hit save and return.++---++## Step 3 — Talk to it++On the agent page, scroll to the agent card. There's a chat input. Type anything and the agent will respond using its configured model.++Voice works too — click the microphone icon. The agent's mouth and gestures sync to its speech.++If the agent doesn't have a body, the page will say **"This agent doesn't have a body yet"** and offer a `Pick a body →` button. Click it to go back to the marketplace and pair one.++---++## Step 4 — Share or embed++Two ways to share an agent:++**Share a link.** Click **Copy share link** under the 3D viewer. The link looks like `https://three.ws/agent/<id>`. Anyone who opens it sees your agent and can chat with it.++**Embed on your own site.** Scroll to the **Share & embed** section. You get three formats:++- `iframe` — paste-and-go HTML for any page.+- `link` — just the URL.+- `<agent-3d>` — a real web component for sites where you control the markup.++Copy any of them and drop it into your blog, portfolio, or product page.++---++## Step 5 — Find it again later++Your agents always appear on `/dashboard`. The dashboard groups them by status (draft, on-chain, with a launched token, etc.).++You can also visit `/agent` (no id) to see "My Agents" — the same list, rendered as a grid.++---++## What to learn next++- **More personality** → [Agent system](/docs/agent-system)+- **More abilities** → [Skills](/docs/skills) and [Create a custom skill](/docs/tutorials/custom-skill)+- **Make money from it** → [Solana pump.fun signals](/docs/solana-pumpfun) and [Register on-chain](/docs/tutorials/register-onchain)+- **Build your own avatar** → [Avatar creation](/docs/avatar-creation) and [Avaturn integration](/docs/avaturn)+- **Put it on your site** → [Embedding](/docs/embedding) and [Embed on a website](/docs/tutorials/embed-on-website)++## Stuck?++- Open [three.ws](https://three.ws/) and look for the small `?` next to any type pill — it links to context for that page.+- The [Troubleshooting](/docs/troubleshooting) page lists common errors.+- Open an issue on [GitHub](https://github.com/nirholas/three.ws/issues).diff --git a/public/header-user.js b/public/header-user.jsindex 5475bb6ba..9ffb96d7f 100644--- a/public/header-user.js+++ b/public/header-user.js@@ -130,6 +130,7 @@ const WALLET_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"const USER_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>';const SETTINGS_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>';const WALLETS_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0 0 4h16v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7"/><circle cx="17" cy="13" r="1" fill="currentColor" stroke="none"/></svg>';+const PORTFOLIO_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 17l5-5 4 4 8-8"/><polyline points="14 8 20 8 20 14"/></svg>';const COPY_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';const DASHBOARD_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="9" rx="1"/><rect x="14" y="3" width="7" height="5" rx="1"/><rect x="14" y="12" width="7" height="9" rx="1"/><rect x="3" y="16" width="7" height="5" rx="1"/></svg>';const SIGNOUT_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>';@@ -164,6 +165,7 @@ function buildMenu(user, identity, options) {if (options.activePath !== '/settings') {items.push(`<a class="hu-item" href="/settings">${SETTINGS_ICON}<span>Settings</span></a>`);}+ items.push(`<a class="hu-item" href="/dashboard/portfolio">${PORTFOLIO_ICON}<span>Portfolio</span></a>`);items.push(`<a class="hu-item" href="/dashboard/wallets">${WALLETS_ICON}<span>Linked wallets</span></a>`);const copyTarget = identity.walletAddr || (identity.hasRealEmail ? user.email : '');diff --git a/public/llms-full.txt b/public/llms-full.txtnew file mode 100644index 000000000..3d1fadec7--- /dev/null+++ b/public/llms-full.txt@@ -0,0 +1,413 @@+# three.ws — Complete Page Index++three.ws is the AI-agent layer for the open web: build, embed, monetize, and trade autonomous agents with real 3D avatars, on-chain identity (ERC-8004), pay-per-call (x402), and pump.fun token launches.++Canonical site: https://three.ws+Tagline: Give your AI a body.+Source code: https://github.com/nirholas/three.ws+Contact / social: https://x.com/trythreews++This file is generated from data/pages.json. It lists every public surface on the site, grouped by section, so AI agents and crawlers can navigate without scraping the home page.++## Main++Entry points into the product.++### Home++URL: https://three.ws/++Landing page. Pitch, live agent demos, and the front door to every flow.++### Discover++URL: https://three.ws/discover++On-chain agent directory (ERC-8004 + Solana). Browse, search, and inspect every registered agent.++### Avatar Gallery++URL: https://three.ws/gallery++Every public 3D avatar in the system, browsable as a grid.++### Marketplace++URL: https://three.ws/marketplace++Buy access to agents, skills, and avatars from other creators.++### Community++URL: https://three.ws/community++Featured creators, builds, and conversations from the three.ws community.++### Sitemap++URL: https://three.ws/sitemap++Human-readable index of every page on three.ws.++## Build++Create and customize an agent.++### Create Agent++URL: https://three.ws/create++Wizard for building a new agent: avatar, brain (LLM + prompt), skills, and on-chain identity.++### Viewer++URL: https://three.ws/app++Drag-and-drop glTF/GLB viewer for inspecting 3D models in the browser.++### glTF Validator++URL: https://three.ws/validation++Khronos-spec validator for glTF/GLB files. Paste a URL or upload a model.++### Widget Studio++URL: https://three.ws/studio++Pick an avatar, configure embed options, copy a one-line snippet for your site.++### Artifact Viewer++URL: https://three.ws/artifact++Renders Claude artifact bundles as standalone embeddable apps.++### Widgets Gallery++URL: https://three.ws/widgets++Pre-built chat, voice, and 3D-avatar widgets you can drop into any page.++### Hydrate++URL: https://three.ws/hydrate++Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.++## Crypto++On-chain features: pay-per-call, token launches, vanity wallets.++### Pay (x402)++URL: https://three.ws/pay++Pay-per-call gateway: invoke any x402-protocol paid API with a USDC micro-transaction.++### Pump.fun Stream++URL: https://three.ws/pumpfun++Mint and trade pump.fun agent tokens on Solana. Live feed of every launch.++### Pump Live++URL: https://three.ws/pump-live++Real-time SSE feed of every pump.fun launch as it happens.++### Pump Dashboard++URL: https://three.ws/pump-dashboard++Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.++### Strategy Lab++URL: https://three.ws/strategy-lab++Build DCA and subscription strategies that trade on-chain on your behalf.++### Solana Vanity Wallet++URL: https://three.ws/vanity-wallet++Grind a Solana address with a custom prefix using your browser's GPU.++### ETH Vanity (CREATE2)++URL: https://three.ws/eth-vanity++Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.++## Agent Tools++Manage, talk to, and deploy individual agents.++### Chat++URL: https://three.ws/chat++Talk to your agent. Voice, text, and tool-use in one interface.++### Agent Home++URL: https://three.ws/agent++Default landing for an agent instance — chat, embed, and remix actions.++### Agents Index++URL: https://three.ws/agents++Browse every registered agent on three.ws.++### My Agents++URL: https://three.ws/my-agents+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++Your private collection of agents and avatars. Requires sign-in.++### Reputation Explorer++URL: https://three.ws/reputation++Inspect on-chain reputation scores and attestations for any agent.++## Account++Sign-in, dashboard, billing.++### Sign in++URL: https://three.ws/login++Sign in with email, GitHub, or a connected wallet.++### Create account++URL: https://three.ws/register++Create a new three.ws account.++### Forgot password++URL: https://three.ws/forgot-password++Request a password-reset email.++### Dashboard++URL: https://three.ws/dashboard+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++Your account dashboard: agents, avatars, payments, keys, MCP servers, monetization, billing.++### Dashboard · Wallets++URL: https://three.ws/dashboard/wallets+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++Manage connected and agent-managed wallets.++### Dashboard · Usage++URL: https://three.ws/dashboard/usage+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++API call volume, x402 spend, and per-agent usage breakdowns.++### Dashboard · Storage++URL: https://three.ws/dashboard/storage+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++Avatar storage modes (R2 vs IPFS) and pin management.++### Dashboard · Sessions++URL: https://three.ws/dashboard/sessions+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++Active sign-in sessions across devices.++### Dashboard · Actions++URL: https://three.ws/dashboard/actions+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++Agent action history and approvals.++### Settings++URL: https://three.ws/settings+Auth: required (sign-in)+Indexable: no (excluded from sitemap)++Account, profile, and notification settings.++## Learn++Docs, tutorials, and reference.++### Docs++URL: https://three.ws/docs++Full documentation: SDKs, API reference, embedding, agent system, smart contracts.++### Docs · Quick Start++URL: https://three.ws/docs/quick-start++Five-minute walkthrough: create an agent, embed it, get a paid call.++### Docs · Agent System++URL: https://three.ws/docs/agent-system++How agents, avatars, skills, and memories fit together.++### Docs · ERC-8004++URL: https://three.ws/docs/erc8004++Reference for the on-chain agent identity standard.++### Docs · Embedding++URL: https://three.ws/docs/embedding++Embed an agent via iframe, oEmbed, or the <agent-3d> web component.++### Docs · <agent-3d>++URL: https://three.ws/docs/web-component++Reference for the <agent-3d> custom element.++### Docs · MCP++URL: https://three.ws/docs/mcp++Expose your agent as an MCP server for Claude, ChatGPT, and other clients.++### Docs · Skills++URL: https://three.ws/docs/skills++Write, package, and monetize agent skills.++### Docs · Widgets++URL: https://three.ws/docs/widgets++Build and publish reusable chat and 3D widgets.++### Docs · API Reference++URL: https://three.ws/docs/api-reference++Full HTTP API reference.++### Docs · SDK++URL: https://three.ws/docs/sdk++JavaScript / Node SDK for three.ws.++### Tutorials++URL: https://three.ws/tutorials++Step-by-step build guides.++## Legal++### Privacy Policy++URL: https://three.ws/legal/privacy++How three.ws handles user data.++### Terms of Use++URL: https://three.ws/legal/tos++Terms of service for three.ws.++## Machine-readable++Indexes and well-known files for crawlers and AI agents.++### sitemap.xml++URL: https://three.ws/sitemap.xml+Indexable: no (excluded from sitemap)++XML sitemap for search-engine crawlers.++### llms.txt++URL: https://three.ws/llms.txt+Indexable: no (excluded from sitemap)++AI-agent-friendly index of every public page (Howard convention).++### llms-full.txt++URL: https://three.ws/llms-full.txt+Indexable: no (excluded from sitemap)++Expanded llms.txt with full descriptions and content hints.++### robots.txt++URL: https://three.ws/robots.txt+Indexable: no (excluded from sitemap)++Crawler directives.++### OpenAPI++URL: https://three.ws/openapi.json+Indexable: no (excluded from sitemap)++Machine-readable HTTP API spec.++### .well-known/x402++URL: https://three.ws/.well-known/x402+Indexable: no (excluded from sitemap)++x402 paid-API discovery document.++### .well-known/agent-attestation-schemas++URL: https://three.ws/.well-known/agent-attestation-schemas+Indexable: no (excluded from sitemap)++JSON schemas for agent attestations.++### .well-known/oauth-authorization-server++URL: https://three.ws/.well-known/oauth-authorization-server+Indexable: no (excluded from sitemap)++OAuth 2.1 authorization-server metadata.++### .well-known/chat-plugin.json++URL: https://three.ws/.well-known/chat-plugin.json+Indexable: no (excluded from sitemap)++ChatGPT-style plugin manifest.diff --git a/public/llms.txt b/public/llms.txtnew file mode 100644index 000000000..d12202458--- /dev/null+++ b/public/llms.txt@@ -0,0 +1,82 @@+# three.ws++> three.ws is the AI-agent layer for the open web: build, embed, monetize, and trade autonomous agents with real 3D avatars, on-chain identity (ERC-8004), pay-per-call (x402), and pump.fun token launches.++Tagline: Give your AI a body.+Site: https://three.ws+Source: https://github.com/nirholas/three.ws+Contact: https://x.com/trythreews++## Main++Entry points into the product.++- [Home](https://three.ws/): Landing page. Pitch, live agent demos, and the front door to every flow.+- [Discover](https://three.ws/discover): On-chain agent directory (ERC-8004 + Solana). Browse, search, and inspect every registered agent.+- [Avatar Gallery](https://three.ws/gallery): Every public 3D avatar in the system, browsable as a grid.+- [Marketplace](https://three.ws/marketplace): Buy access to agents, skills, and avatars from other creators.+- [Community](https://three.ws/community): Featured creators, builds, and conversations from the three.ws community.+- [Sitemap](https://three.ws/sitemap): Human-readable index of every page on three.ws.++## Build++Create and customize an agent.++- [Create Agent](https://three.ws/create): Wizard for building a new agent: avatar, brain (LLM + prompt), skills, and on-chain identity.+- [Viewer](https://three.ws/app): Drag-and-drop glTF/GLB viewer for inspecting 3D models in the browser.+- [glTF Validator](https://three.ws/validation): Khronos-spec validator for glTF/GLB files. Paste a URL or upload a model.+- [Widget Studio](https://three.ws/studio): Pick an avatar, configure embed options, copy a one-line snippet for your site.+- [Artifact Viewer](https://three.ws/artifact): Renders Claude artifact bundles as standalone embeddable apps.+- [Widgets Gallery](https://three.ws/widgets): Pre-built chat, voice, and 3D-avatar widgets you can drop into any page.+- [Hydrate](https://three.ws/hydrate): Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.++## Crypto++On-chain features: pay-per-call, token launches, vanity wallets.++- [Pay (x402)](https://three.ws/pay): Pay-per-call gateway: invoke any x402-protocol paid API with a USDC micro-transaction.+- [Pump.fun Stream](https://three.ws/pumpfun): Mint and trade pump.fun agent tokens on Solana. Live feed of every launch.+- [Pump Live](https://three.ws/pump-live): Real-time SSE feed of every pump.fun launch as it happens.+- [Pump Dashboard](https://three.ws/pump-dashboard): Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.+- [Strategy Lab](https://three.ws/strategy-lab): Build DCA and subscription strategies that trade on-chain on your behalf.+- [Solana Vanity Wallet](https://three.ws/vanity-wallet): Grind a Solana address with a custom prefix using your browser's GPU.+- [ETH Vanity (CREATE2)](https://three.ws/eth-vanity): Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.++## Agent Tools++Manage, talk to, and deploy individual agents.++- [Chat](https://three.ws/chat): Talk to your agent. Voice, text, and tool-use in one interface.+- [Agent Home](https://three.ws/agent): Default landing for an agent instance — chat, embed, and remix actions.+- [Agents Index](https://three.ws/agents): Browse every registered agent on three.ws.+- [Reputation Explorer](https://three.ws/reputation): Inspect on-chain reputation scores and attestations for any agent.++## Account++Sign-in, dashboard, billing.++- [Sign in](https://three.ws/login): Sign in with email, GitHub, or a connected wallet.+- [Create account](https://three.ws/register): Create a new three.ws account.+- [Forgot password](https://three.ws/forgot-password): Request a password-reset email.++## Learn++Docs, tutorials, and reference.++- [Docs](https://three.ws/docs): Full documentation: SDKs, API reference, embedding, agent system, smart contracts.+- [Docs · Quick Start](https://three.ws/docs/quick-start): Five-minute walkthrough: create an agent, embed it, get a paid call.+- [Docs · Agent System](https://three.ws/docs/agent-system): How agents, avatars, skills, and memories fit together.+- [Docs · ERC-8004](https://three.ws/docs/erc8004): Reference for the on-chain agent identity standard.+- [Docs · Embedding](https://three.ws/docs/embedding): Embed an agent via iframe, oEmbed, or the <agent-3d> web component.+- [Docs · <agent-3d>](https://three.ws/docs/web-component): Reference for the <agent-3d> custom element.+- [Docs · MCP](https://three.ws/docs/mcp): Expose your agent as an MCP server for Claude, ChatGPT, and other clients.+- [Docs · Skills](https://three.ws/docs/skills): Write, package, and monetize agent skills.+- [Docs · Widgets](https://three.ws/docs/widgets): Build and publish reusable chat and 3D widgets.+- [Docs · API Reference](https://three.ws/docs/api-reference): Full HTTP API reference.+- [Docs · SDK](https://three.ws/docs/sdk): JavaScript / Node SDK for three.ws.+- [Tutorials](https://three.ws/tutorials): Step-by-step build guides.++## Legal++- [Privacy Policy](https://three.ws/legal/privacy): How three.ws handles user data.+- [Terms of Use](https://three.ws/legal/tos): Terms of service for three.ws.diff --git a/public/nav.html b/public/nav.htmlindex 8fcce230b..bb0a934bc 100644--- a/public/nav.html+++ b/public/nav.html@@ -105,6 +105,12 @@><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>+ <li role="none">+ <a href="/pump-visualizer" role="menuitem"+ ><span class="nav-mi-title">Pump Visualizer</span+ ><span class="nav-mi-sub">3D view of trending tokens</span></a+ >+ </li><li role="none"><a href="/vanity-wallet" role="menuitem"><span class="nav-mi-title">Vanity wallet</span@@ -154,6 +160,12 @@><span class="nav-mi-sub">Claude artifact bundle</span></a></li>+ <li role="none">+ <a href="/avatar-artifact" role="menuitem"+ ><span class="nav-mi-title">Avatar artifact</span+ ><span class="nav-mi-sub">Standalone Three.js viewer</span></a+ >+ </li><li role="none"><a href="/docs#embedding" role="menuitem"><span class="nav-mi-title">Embed docs</span@@ -197,6 +209,18 @@><span class="nav-mi-sub">SDKs + API reference</span></a></li>+ <li role="none">+ <a href="/pretext-demo" role="menuitem"+ ><span class="nav-mi-title">Demo</span+ ><span class="nav-mi-sub">Give your AI a body</span></a+ >+ </li>+ <li role="none">+ <a href="/launch-week" role="menuitem"+ ><span class="nav-mi-title">Launch Week</span+ ><span class="nav-mi-sub">Recap · stats · highlights</span></a+ >+ </li></ul></li><li class="nav-item" id="home-nav-my-agents-li" role="none" hidden>diff --git a/public/pay/calls/index.html b/public/pay/calls/index.htmlindex d88b4af07..b4affc0fb 100644--- a/public/pay/calls/index.html+++ b/public/pay/calls/index.html@@ -157,6 +157,11 @@<body><header>+ <div id="nav-container"></div>+</header>+<script src="/nav.js"></script>++<header class="page-header"><div class="brand"><a href="/pay"><div class="logo"></div></a><div>diff --git a/public/sitemap.xml b/public/sitemap.xmlindex 6824dce0a..229cc90ec 100644--- a/public/sitemap.xml+++ b/public/sitemap.xml@@ -13,40 +13,58 @@<priority>0.9</priority></url><url>- <loc>https://three.ws/marketplace</loc>+ <loc>https://three.ws/gallery</loc><lastmod>2026-05-13</lastmod><changefreq>daily</changefreq>- <priority>0.9</priority>+ <priority>0.8</priority></url><url>- <loc>https://three.ws/gallery</loc>+ <loc>https://three.ws/marketplace</loc><lastmod>2026-05-13</lastmod><changefreq>daily</changefreq><priority>0.8</priority></url><url>- <loc>https://three.ws/create</loc>+ <loc>https://three.ws/community</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.8</priority>+ <priority>0.6</priority></url><url>- <loc>https://three.ws/studio</loc>+ <loc>https://three.ws/sitemap</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.8</priority>+ <priority>0.4</priority>+ </url>+ <url>+ <loc>https://three.ws/create</loc>+ <lastmod>2026-05-13</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.9</priority></url><url><loc>https://three.ws/app</loc><lastmod>2026-05-13</lastmod>+ <changefreq>monthly</changefreq>+ <priority>0.7</priority>+ </url>+ <url>+ <loc>https://three.ws/validation</loc>+ <lastmod>2026-05-13</lastmod>+ <changefreq>monthly</changefreq>+ <priority>0.6</priority>+ </url>+ <url>+ <loc>https://three.ws/studio</loc>+ <lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq><priority>0.8</priority></url><url>- <loc>https://three.ws/agents</loc>+ <loc>https://three.ws/artifact</loc><lastmod>2026-05-13</lastmod>- <changefreq>daily</changefreq>- <priority>0.8</priority>+ <changefreq>monthly</changefreq>+ <priority>0.5</priority></url><url><loc>https://three.ws/widgets</loc>@@ -55,87 +73,157 @@<priority>0.7</priority></url><url>- <loc>https://three.ws/pay</loc>+ <loc>https://three.ws/hydrate</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq><priority>0.7</priority></url><url>- <loc>https://three.ws/pay/calls</loc>+ <loc>https://three.ws/pay</loc>+ <lastmod>2026-05-13</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.9</priority>+ </url>+ <url>+ <loc>https://three.ws/pumpfun</loc><lastmod>2026-05-13</lastmod><changefreq>daily</changefreq>- <priority>0.6</priority>+ <priority>0.8</priority></url><url><loc>https://three.ws/pump-live</loc><lastmod>2026-05-13</lastmod>- <changefreq>hourly</changefreq>- <priority>0.8</priority>+ <changefreq>daily</changefreq>+ <priority>0.7</priority></url><url><loc>https://three.ws/pump-dashboard</loc><lastmod>2026-05-13</lastmod>- <changefreq>hourly</changefreq>- <priority>0.7</priority>+ <changefreq>daily</changefreq>+ <priority>0.8</priority></url><url><loc>https://three.ws/strategy-lab</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.6</priority>+ <priority>0.7</priority></url><url>- <loc>https://three.ws/reputation</loc>+ <loc>https://three.ws/vanity-wallet</loc><lastmod>2026-05-13</lastmod>- <changefreq>weekly</changefreq>+ <changefreq>monthly</changefreq><priority>0.6</priority></url><url>- <loc>https://three.ws/validation</loc>+ <loc>https://three.ws/eth-vanity</loc><lastmod>2026-05-13</lastmod>- <changefreq>weekly</changefreq>+ <changefreq>monthly</changefreq><priority>0.6</priority></url><url>- <loc>https://three.ws/hydrate</loc>+ <loc>https://three.ws/chat</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.5</priority>+ <priority>0.8</priority></url><url>- <loc>https://three.ws/artifact</loc>+ <loc>https://three.ws/agent</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.5</priority>+ <priority>0.7</priority>+ </url>+ <url>+ <loc>https://three.ws/agents</loc>+ <lastmod>2026-05-13</lastmod>+ <changefreq>daily</changefreq>+ <priority>0.7</priority></url><url>- <loc>https://three.ws/cz</loc>+ <loc>https://three.ws/reputation</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.5</priority>+ <priority>0.6</priority></url><url>- <loc>https://three.ws/eth-vanity</loc>+ <loc>https://three.ws/login</loc><lastmod>2026-05-13</lastmod>- <changefreq>monthly</changefreq>- <priority>0.5</priority>+ <changefreq>yearly</changefreq>+ <priority>0.4</priority></url><url>- <loc>https://three.ws/tutorials</loc>+ <loc>https://three.ws/register</loc><lastmod>2026-05-13</lastmod>- <changefreq>weekly</changefreq>- <priority>0.7</priority>+ <changefreq>yearly</changefreq>+ <priority>0.4</priority>+ </url>+ <url>+ <loc>https://three.ws/forgot-password</loc>+ <lastmod>2026-05-13</lastmod>+ <changefreq>yearly</changefreq>+ <priority>0.2</priority></url><url><loc>https://three.ws/docs</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.7</priority>+ <priority>0.9</priority></url><url>- <loc>https://three.ws/docs/widgets</loc>+ <loc>https://three.ws/docs/quick-start</loc><lastmod>2026-05-13</lastmod><changefreq>weekly</changefreq>- <priority>0.6</priority>+ <priority>0.8</priority>+ </url>+ <url>+ <loc>https://three.ws/docs/agent-system</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/erc8004</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/embedding</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/web-component</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/mcp</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/skills</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/widgets</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/api-reference</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/docs/sdk</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/tutorials</loc>+ <lastmod>2026-05-13</lastmod>+ </url>+ <url>+ <loc>https://three.ws/legal/privacy</loc>+ <lastmod>2026-05-13</lastmod>+ <changefreq>yearly</changefreq>+ <priority>0.2</priority>+ </url>+ <url>+ <loc>https://three.ws/legal/tos</loc>+ <lastmod>2026-05-13</lastmod>+ <changefreq>yearly</changefreq>+ <priority>0.2</priority></url></urlset>diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlnew file mode 100644index 000000000..adb56204d--- /dev/null+++ b/public/sitemap/index.html@@ -0,0 +1,547 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width,initial-scale=1" />+<title>Sitemap · three.ws</title>+<meta name="description" content="Complete index of every public page on three.ws." />+<link rel="canonical" href="https://three.ws/sitemap" />+<link rel="alternate" type="application/xml" title="XML sitemap" href="/sitemap.xml" />+<link rel="alternate" type="text/plain" title="llms.txt" href="/llms.txt" />+<link rel="stylesheet" href="/nav.css" />+<link rel="stylesheet" href="/footer.css" />+<style>+ :root { color-scheme: dark; }+ body { margin: 0; background: #060611; color: #e7e7f5; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }+ .sm-wrap { max-width: 1080px; margin: 0 auto; padding: 96px 24px 64px; }+ .sm-hero { margin-bottom: 48px; }+ .sm-hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 12px; letter-spacing: -0.02em; }+ .sm-hero p { color: #b6b6cf; font-size: 17px; max-width: 64ch; margin: 0; line-height: 1.55; }+ .sm-formats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }+ .sm-formats a { padding: 6px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #d8d8ee; text-decoration: none; font-size: 13px; background: rgba(255,255,255,.02); transition: background .15s, border-color .15s; }+ .sm-formats a:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.24); }+ .sm-formats code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #9ad4ff; }+ .sm-toc { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.02); margin-bottom: 56px; }+ .sm-toc a { color: #cfd0e8; text-decoration: none; font-size: 13px; padding: 4px 10px; border-radius: 999px; }+ .sm-toc a:hover { background: rgba(255,255,255,.06); color: #fff; }+ .sm-section { margin-bottom: 56px; scroll-margin-top: 80px; }+ .sm-section h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }+ .sm-section-desc { color: #9b9bb7; margin: 0 0 18px; font-size: 14px; }+ .sm-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }+ .sm-list li { display: block; }+ .sm-list a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.015); color: inherit; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }+ .sm-list a:hover { background: rgba(120,140,255,.06); border-color: rgba(150,170,255,.30); transform: translateY(-1px); }+ .sm-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }+ .sm-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #7a85a8; }+ .sm-desc { color: #b6b6cf; font-size: 13px; line-height: 1.45; }+ .sm-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }+ .sm-badge-auth { background: rgba(255, 200, 80, .15); color: #ffcf66; }+ .sm-badge-internal { background: rgba(120,200,255,.12); color: #9ad4ff; }+</style>+</head>+<body>+ <div id="home-nav-mount"></div>+ <main class="sm-wrap">+ <div class="sm-hero">+ <h1>Sitemap</h1>+ <p>Every public page on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <div class="sm-formats">+ <a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>+ <a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>+ <a href="/llms-full.txt"><code>llms-full.txt</code> · long form</a>+ <a href="/openapi.json"><code>openapi.json</code> · HTTP API</a>+ </div>+ </div>+ <nav class="sm-toc" aria-label="Sections">+ <a href="#main">Main</a>+ <a href="#build">Build</a>+ <a href="#crypto">Crypto</a>+ <a href="#agent-tools">Agent Tools</a>+ <a href="#account">Account</a>+ <a href="#learn">Learn</a>+ <a href="#legal">Legal</a>+ <a href="#machine">Machine-readable</a>+ </nav>+ <section class="sm-section" id="main">+ <header>+ <h2>Main</h2>+ <p class="sm-section-desc">Entry points into the product.</p>+ </header>+ <ul class="sm-list">+ <li>+ <a href="/">+ <span class="sm-title">Home</span>+ <span class="sm-path">/</span>+ <span class="sm-desc">Landing page. Pitch, live agent demos, and the front door to every flow.</span>+ </a>+ </li>+ <li>+ <a href="/discover">+ <span class="sm-title">Discover</span>+ <span class="sm-path">/discover</span>+ <span class="sm-desc">On-chain agent directory (ERC-8004 + Solana). Browse, search, and inspect every registered agent.</span>+ </a>+ </li>+ <li>+ <a href="/gallery">+ <span class="sm-title">Avatar Gallery</span>+ <span class="sm-path">/gallery</span>+ <span class="sm-desc">Every public 3D avatar in the system, browsable as a grid.</span>+ </a>+ </li>+ <li>+ <a href="/marketplace">+ <span class="sm-title">Marketplace</span>+ <span class="sm-path">/marketplace</span>+ <span class="sm-desc">Buy access to agents, skills, and avatars from other creators.</span>+ </a>+ </li>+ <li>+ <a href="/community">+ <span class="sm-title">Community</span>+ <span class="sm-path">/community</span>+ <span class="sm-desc">Featured creators, builds, and conversations from the three.ws community.</span>+ </a>+ </li>+ <li>+ <a href="/sitemap">+ <span class="sm-title">Sitemap</span>+ <span class="sm-path">/sitemap</span>+ <span class="sm-desc">Human-readable index of every page on three.ws.</span>+ </a>+ </li>+ </ul>+ </section>++ <section class="sm-section" id="build">+ <header>+ <h2>Build</h2>+ <p class="sm-section-desc">Create and customize an agent.</p>+ </header>+ <ul class="sm-list">+ <li>+ <a href="/create">+ <span class="sm-title">Create Agent</span>+ <span class="sm-path">/create</span>+ <span class="sm-desc">Wizard for building a new agent: avatar, brain (LLM + prompt), skills, and on-chain identity.</span>+ </a>+ </li>+ <li>+ <a href="/app">+ <span class="sm-title">Viewer</span>+ <span class="sm-path">/app</span>+ <span class="sm-desc">Drag-and-drop glTF/GLB viewer for inspecting 3D models in the browser.</span>+ </a>+ </li>+ <li>+ <a href="/validation">+ <span class="sm-title">glTF Validator</span>+ <span class="sm-path">/validation</span>+ <span class="sm-desc">Khronos-spec validator for glTF/GLB files. Paste a URL or upload a model.</span>+ </a>+ </li>+ <li>+ <a href="/studio">+ <span class="sm-title">Widget Studio</span>+ <span class="sm-path">/studio</span>+ <span class="sm-desc">Pick an avatar, configure embed options, copy a one-line snippet for your site.</span>+ </a>+ </li>+ <li>+ <a href="/artifact">+ <span class="sm-title">Artifact Viewer</span>+ <span class="sm-path">/artifact</span>+ <span class="sm-desc">Renders Claude artifact bundles as standalone embeddable apps.</span>+ </a>+ </li>+ <li>+ <a href="/widgets">+ <span class="sm-title">Widgets Gallery</span>+ <span class="sm-path">/widgets</span>+ <span class="sm-desc">Pre-built chat, voice, and 3D-avatar widgets you can drop into any page.</span>+ </a>+ </li>+ <li>+ <a href="/hydrate">+ <span class="sm-title">Hydrate</span>+ <span class="sm-path">/hydrate</span>+ <span class="sm-desc">Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.</span>+ </a>+ </li>+ </ul>+ </section>++ <section class="sm-section" id="crypto">+ <header>+ <h2>Crypto</h2>+ <p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p>+ </header>+ <ul class="sm-list">+ <li>+ <a href="/pay">+ <span class="sm-title">Pay (x402)</span>+ <span class="sm-path">/pay</span>+ <span class="sm-desc">Pay-per-call gateway: invoke any x402-protocol paid API with a USDC micro-transaction.</span>+ </a>+ </li>+ <li>+ <a href="/pumpfun">+ <span class="sm-title">Pump.fun Stream</span>+ <span class="sm-path">/pumpfun</span>+ <span class="sm-desc">Mint and trade pump.fun agent tokens on Solana. Live feed of every launch.</span>+ </a>+ </li>+ <li>+ <a href="/pump-live">+ <span class="sm-title">Pump Live</span>+ <span class="sm-path">/pump-live</span>+ <span class="sm-desc">Real-time SSE feed of every pump.fun launch as it happens.</span>+ </a>+ </li>+ <li>+ <a href="/pump-dashboard">+ <span class="sm-title">Pump Dashboard</span>+ <span class="sm-path">/pump-dashboard</span>+ <span class="sm-desc">Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.</span>+ </a>+ </li>+ <li>+ <a href="/strategy-lab">+ <span class="sm-title">Strategy Lab</span>+ <span class="sm-path">/strategy-lab</span>+ <span class="sm-desc">Build DCA and subscription strategies that trade on-chain on your behalf.</span>+ </a>+ </li>+ <li>+ <a href="/vanity-wallet">+ <span class="sm-title">Solana Vanity Wallet</span>+ <span class="sm-path">/vanity-wallet</span>+ <span class="sm-desc">Grind a Solana address with a custom prefix using your browser's GPU.</span>+ </a>+ </li>+ <li>+ <a href="/eth-vanity">+ <span class="sm-title">ETH Vanity (CREATE2)</span>+ <span class="sm-path">/eth-vanity</span>+ <span class="sm-desc">Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.</span>+ </a>+ </li>+ </ul>+ </section>++ <section class="sm-section" id="agent-tools">+ <header>+ <h2>Agent Tools</h2>+ <p class="sm-section-desc">Manage, talk to, and deploy individual agents.</p>+ </header>+ <ul class="sm-list">+ <li>+ <a href="/chat">+ <span class="sm-title">Chat</span>+ <span class="sm-path">/chat</span>+ <span class="sm-desc">Talk to your agent. Voice, text, and tool-use in one interface.</span>+ </a>+ </li>+ <li>+ <a href="/agent">+ <span class="sm-title">Agent Home</span>+ <span class="sm-path">/agent</span>+ <span class="sm-desc">Default landing for an agent instance — chat, embed, and remix actions.</span>+ </a>+ </li>+ <li>+ <a href="/agents">+ <span class="sm-title">Agents Index</span>+ <span class="sm-path">/agents</span>+ <span class="sm-desc">Browse every registered agent on three.ws.</span>+ </a>+ </li>+ <li>+ <a href="/my-agents">+ <span class="sm-title">My Agents<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/my-agents</span>+ <span class="sm-desc">Your private collection of agents and avatars. Requires sign-in.</span>+ </a>+ </li>+ <li>+ <a href="/reputation">+ <span class="sm-title">Reputation Explorer</span>+ <span class="sm-path">/reputation</span>+ <span class="sm-desc">Inspect on-chain reputation scores and attestations for any agent.</span>+ </a>+ </li>+ </ul>+ </section>++ <section class="sm-section" id="account">+ <header>+ <h2>Account</h2>+ <p class="sm-section-desc">Sign-in, dashboard, billing.</p>+ </header>+ <ul class="sm-list">+ <li>+ <a href="/login">+ <span class="sm-title">Sign in</span>+ <span class="sm-path">/login</span>+ <span class="sm-desc">Sign in with email, GitHub, or a connected wallet.</span>+ </a>+ </li>+ <li>+ <a href="/register">+ <span class="sm-title">Create account</span>+ <span class="sm-path">/register</span>+ <span class="sm-desc">Create a new three.ws account.</span>+ </a>+ </li>+ <li>+ <a href="/forgot-password">+ <span class="sm-title">Forgot password</span>+ <span class="sm-path">/forgot-password</span>+ <span class="sm-desc">Request a password-reset email.</span>+ </a>+ </li>+ <li>+ <a href="/dashboard">+ <span class="sm-title">Dashboard<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/dashboard</span>+ <span class="sm-desc">Your account dashboard: agents, avatars, payments, keys, MCP servers, monetization, billing.</span>+ </a>+ </li>+ <li>+ <a href="/dashboard/wallets">+ <span class="sm-title">Dashboard · Wallets<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/dashboard/wallets</span>+ <span class="sm-desc">Manage connected and agent-managed wallets.</span>+ </a>+ </li>+ <li>+ <a href="/dashboard/usage">+ <span class="sm-title">Dashboard · Usage<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/dashboard/usage</span>+ <span class="sm-desc">API call volume, x402 spend, and per-agent usage breakdowns.</span>+ </a>+ </li>+ <li>+ <a href="/dashboard/storage">+ <span class="sm-title">Dashboard · Storage<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/dashboard/storage</span>+ <span class="sm-desc">Avatar storage modes (R2 vs IPFS) and pin management.</span>+ </a>+ </li>+ <li>+ <a href="/dashboard/sessions">+ <span class="sm-title">Dashboard · Sessions<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/dashboard/sessions</span>+ <span class="sm-desc">Active sign-in sessions across devices.</span>+ </a>+ </li>+ <li>+ <a href="/dashboard/actions">+ <span class="sm-title">Dashboard · Actions<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/dashboard/actions</span>+ <span class="sm-desc">Agent action history and approvals.</span>+ </a>+ </li>+ <li>+ <a href="/settings">+ <span class="sm-title">Settings<span class="sm-badge sm-badge-auth">sign-in</span><span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/settings</span>+ <span class="sm-desc">Account, profile, and notification settings.</span>+ </a>+ </li>+ </ul>+ </section>++ <section class="sm-section" id="learn">+ <header>+ <h2>Learn</h2>+ <p class="sm-section-desc">Docs, tutorials, and reference.</p>+ </header>+ <ul class="sm-list">+ <li>+ <a href="/docs">+ <span class="sm-title">Docs</span>+ <span class="sm-path">/docs</span>+ <span class="sm-desc">Full documentation: SDKs, API reference, embedding, agent system, smart contracts.</span>+ </a>+ </li>+ <li>+ <a href="/docs/quick-start">+ <span class="sm-title">Docs · Quick Start</span>+ <span class="sm-path">/docs/quick-start</span>+ <span class="sm-desc">Five-minute walkthrough: create an agent, embed it, get a paid call.</span>+ </a>+ </li>+ <li>+ <a href="/docs/agent-system">+ <span class="sm-title">Docs · Agent System</span>+ <span class="sm-path">/docs/agent-system</span>+ <span class="sm-desc">How agents, avatars, skills, and memories fit together.</span>+ </a>+ </li>+ <li>+ <a href="/docs/erc8004">+ <span class="sm-title">Docs · ERC-8004</span>+ <span class="sm-path">/docs/erc8004</span>+ <span class="sm-desc">Reference for the on-chain agent identity standard.</span>+ </a>+ </li>+ <li>+ <a href="/docs/embedding">+ <span class="sm-title">Docs · Embedding</span>+ <span class="sm-path">/docs/embedding</span>+ <span class="sm-desc">Embed an agent via iframe, oEmbed, or the <agent-3d> web component.</span>+ </a>+ </li>+ <li>+ <a href="/docs/web-component">+ <span class="sm-title">Docs · <agent-3d></span>+ <span class="sm-path">/docs/web-component</span>+ <span class="sm-desc">Reference for the <agent-3d> custom element.</span>+ </a>+ </li>+ <li>+ <a href="/docs/mcp">+ <span class="sm-title">Docs · MCP</span>+ <span class="sm-path">/docs/mcp</span>+ <span class="sm-desc">Expose your agent as an MCP server for Claude, ChatGPT, and other clients.</span>+ </a>+ </li>+ <li>+ <a href="/docs/skills">+ <span class="sm-title">Docs · Skills</span>+ <span class="sm-path">/docs/skills</span>+ <span class="sm-desc">Write, package, and monetize agent skills.</span>+ </a>+ </li>+ <li>+ <a href="/docs/widgets">+ <span class="sm-title">Docs · Widgets</span>+ <span class="sm-path">/docs/widgets</span>+ <span class="sm-desc">Build and publish reusable chat and 3D widgets.</span>+ </a>+ </li>+ <li>+ <a href="/docs/api-reference">+ <span class="sm-title">Docs · API Reference</span>+ <span class="sm-path">/docs/api-reference</span>+ <span class="sm-desc">Full HTTP API reference.</span>+ </a>+ </li>+ <li>+ <a href="/docs/sdk">+ <span class="sm-title">Docs · SDK</span>+ <span class="sm-path">/docs/sdk</span>+ <span class="sm-desc">JavaScript / Node SDK for three.ws.</span>+ </a>+ </li>+ <li>+ <a href="/tutorials">+ <span class="sm-title">Tutorials</span>+ <span class="sm-path">/tutorials</span>+ <span class="sm-desc">Step-by-step build guides.</span>+ </a>+ </li>+ </ul>+ </section>++ <section class="sm-section" id="legal">+ <header>+ <h2>Legal</h2>++ </header>+ <ul class="sm-list">+ <li>+ <a href="/legal/privacy">+ <span class="sm-title">Privacy Policy</span>+ <span class="sm-path">/legal/privacy</span>+ <span class="sm-desc">How three.ws handles user data.</span>+ </a>+ </li>+ <li>+ <a href="/legal/tos">+ <span class="sm-title">Terms of Use</span>+ <span class="sm-path">/legal/tos</span>+ <span class="sm-desc">Terms of service for three.ws.</span>+ </a>+ </li>+ </ul>+ </section>++ <section class="sm-section" id="machine">+ <header>+ <h2>Machine-readable</h2>+ <p class="sm-section-desc">Indexes and well-known files for crawlers and AI agents.</p>+ </header>+ <ul class="sm-list">+ <li>+ <a href="/sitemap.xml">+ <span class="sm-title">sitemap.xml<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/sitemap.xml</span>+ <span class="sm-desc">XML sitemap for search-engine crawlers.</span>+ </a>+ </li>+ <li>+ <a href="/llms.txt">+ <span class="sm-title">llms.txt<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/llms.txt</span>+ <span class="sm-desc">AI-agent-friendly index of every public page (Howard convention).</span>+ </a>+ </li>+ <li>+ <a href="/llms-full.txt">+ <span class="sm-title">llms-full.txt<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/llms-full.txt</span>+ <span class="sm-desc">Expanded llms.txt with full descriptions and content hints.</span>+ </a>+ </li>+ <li>+ <a href="/robots.txt">+ <span class="sm-title">robots.txt<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/robots.txt</span>+ <span class="sm-desc">Crawler directives.</span>+ </a>+ </li>+ <li>+ <a href="/openapi.json">+ <span class="sm-title">OpenAPI<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/openapi.json</span>+ <span class="sm-desc">Machine-readable HTTP API spec.</span>+ </a>+ </li>+ <li>+ <a href="/.well-known/x402">+ <span class="sm-title">.well-known/x402<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/.well-known/x402</span>+ <span class="sm-desc">x402 paid-API discovery document.</span>+ </a>+ </li>+ <li>+ <a href="/.well-known/agent-attestation-schemas">+ <span class="sm-title">.well-known/agent-attestation-schemas<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/.well-known/agent-attestation-schemas</span>+ <span class="sm-desc">JSON schemas for agent attestations.</span>+ </a>+ </li>+ <li>+ <a href="/.well-known/oauth-authorization-server">+ <span class="sm-title">.well-known/oauth-authorization-server<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/.well-known/oauth-authorization-server</span>+ <span class="sm-desc">OAuth 2.1 authorization-server metadata.</span>+ </a>+ </li>+ <li>+ <a href="/.well-known/chat-plugin.json">+ <span class="sm-title">.well-known/chat-plugin.json<span class="sm-badge sm-badge-internal">internal</span></span>+ <span class="sm-path">/.well-known/chat-plugin.json</span>+ <span class="sm-desc">ChatGPT-style plugin manifest.</span>+ </a>+ </li>+ </ul>+ </section>+ </main>+ <div id="home-footer-mount"></div>+ <script type="module" src="/nav.js"></script>+ <script type="module" src="/footer.js"></script>+</body>+</html>diff --git a/public/textures/cloud.png b/public/textures/cloud.pngnew file mode 100644index 000000000..81328f274Binary files /dev/null and b/public/textures/cloud.png differdiff --git a/scripts/apply-migrations.mjs b/scripts/apply-migrations.mjsindex e0f19b802..d7bd6f8d1 100755--- a/scripts/apply-migrations.mjs+++ b/scripts/apply-migrations.mjs@@ -35,7 +35,12 @@ for (const envFile of ['.env.local', '.env']) {const raw = readFileSync(path.resolve(REPO_ROOT, envFile), 'utf8');for (const line of raw.split('\n')) {const m = line.match(/^([A-Z_][A-Z0-9_]*)=(.*)$/);- if (m && !process.env[m[1]]) process.env[m[1]] = m[2].trim();+ if (!m || process.env[m[1]]) continue;+ let val = m[2].trim();+ if ((val.startsWith('"') && val.endsWith('"')) || (val.startsWith("'") && val.endsWith("'"))) {+ val = val.slice(1, -1);+ }+ process.env[m[1]] = val;}break;} catch { /* file not present */ }diff --git a/scripts/build-page-index.mjs b/scripts/build-page-index.mjsnew file mode 100644index 000000000..9bc97bc8f--- /dev/null+++ b/scripts/build-page-index.mjs@@ -0,0 +1,263 @@+#!/usr/bin/env node+/**+ * Generate every public discovery surface from data/pages.json:+ *+ * public/sitemap.xml — search-engine crawlers+ * public/llms.txt — AI-agent index (Jeremy Howard convention)+ * public/llms-full.txt — expanded, prose-friendly variant+ * public/sitemap/index.html — human-readable site map at /sitemap+ *+ * Run via `npm run build:pages` or automatically before `vite build`.+ */+import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';+import { resolve, dirname } from 'node:path';+import { fileURLToPath } from 'node:url';++const here = dirname(fileURLToPath(import.meta.url));+const root = resolve(here, '..');+const dataFile = resolve(root, 'data/pages.json');+const publicDir = resolve(root, 'public');++const data = JSON.parse(readFileSync(dataFile, 'utf8'));+const { site, sections } = data;+const baseUrl = site.url.replace(/\/$/, '');+const today = new Date().toISOString().slice(0, 10);++const allPages = sections.flatMap((s) =>+ s.pages.map((p) => ({ ...p, section: s })),+);++const indexable = (p) =>+ p.indexable !== false && !p.path.startsWith('/.') && !p.path.endsWith('.xml') && !p.path.endsWith('.txt') && !p.path.endsWith('.json');++const escapeXml = (s) =>+ String(s).replace(/[<>&'"]/g, (c) => ({+ '<': '<',+ '>': '>',+ '&': '&',+ "'": ''',+ '"': '"',+ })[c]);++const escapeHtml = (s) =>+ String(s).replace(/[<>&"]/g, (c) => ({+ '<': '<',+ '>': '>',+ '&': '&',+ '"': '"',+ })[c]);++// ────────────────────────────────────────────────────────────────────────+// sitemap.xml+// ────────────────────────────────────────────────────────────────────────+function buildSitemap() {+ const urls = allPages.filter(indexable).map((p) => {+ const lines = [+ `\t\t<loc>${escapeXml(baseUrl + p.path)}</loc>`,+ `\t\t<lastmod>${today}</lastmod>`,+ ];+ if (p.changefreq) lines.push(`\t\t<changefreq>${p.changefreq}</changefreq>`);+ if (p.priority != null) lines.push(`\t\t<priority>${p.priority.toFixed(1)}</priority>`);+ return `\t<url>\n${lines.join('\n')}\n\t</url>`;+ });+ return `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${urls.join('\n')}\n</urlset>\n`;+}++// ────────────────────────────────────────────────────────────────────────+// llms.txt — concise AI index per https://llmstxt.org/+// ────────────────────────────────────────────────────────────────────────+function buildLlmsTxt() {+ const lines = [];+ lines.push(`# ${site.name}`);+ lines.push('');+ lines.push(`> ${site.description}`);+ lines.push('');+ lines.push(`Tagline: ${site.tagline}`);+ lines.push(`Site: ${baseUrl}`);+ if (site.github) lines.push(`Source: ${site.github}`);+ if (site.contact) lines.push(`Contact: ${site.contact}`);+ lines.push('');+ for (const section of sections) {+ const pages = section.pages.filter(indexable);+ if (!pages.length) continue;+ lines.push(`## ${section.title}`);+ if (section.description) lines.push('');+ if (section.description) lines.push(section.description);+ lines.push('');+ for (const p of pages) {+ lines.push(`- [${p.title}](${baseUrl}${p.path}): ${p.description}`);+ }+ lines.push('');+ }+ return lines.join('\n');+}++// ────────────────────────────────────────────────────────────────────────+// llms-full.txt — same data, more prose; includes machine-readable section+// ────────────────────────────────────────────────────────────────────────+function buildLlmsFull() {+ const lines = [];+ lines.push(`# ${site.name} — Complete Page Index`);+ lines.push('');+ lines.push(site.description);+ lines.push('');+ lines.push(`Canonical site: ${baseUrl}`);+ lines.push(`Tagline: ${site.tagline}`);+ if (site.github) lines.push(`Source code: ${site.github}`);+ if (site.contact) lines.push(`Contact / social: ${site.contact}`);+ lines.push('');+ lines.push('This file is generated from data/pages.json. It lists every public surface on the site, grouped by section, so AI agents and crawlers can navigate without scraping the home page.');+ lines.push('');+ for (const section of sections) {+ lines.push(`## ${section.title}`);+ lines.push('');+ if (section.description) {+ lines.push(section.description);+ lines.push('');+ }+ for (const p of section.pages) {+ const url = p.path.startsWith('http') ? p.path : baseUrl + p.path;+ lines.push(`### ${p.title}`);+ lines.push('');+ lines.push(`URL: ${url}`);+ if (p.auth === 'required') lines.push('Auth: required (sign-in)');+ if (p.indexable === false) lines.push('Indexable: no (excluded from sitemap)');+ lines.push('');+ lines.push(p.description);+ lines.push('');+ }+ }+ return lines.join('\n');+}++// ────────────────────────────────────────────────────────────────────────+// /sitemap HTML page (human-readable)+// ────────────────────────────────────────────────────────────────────────+function buildSitemapHtml() {+ const sectionHtml = sections+ .map((section) => {+ const items = section.pages+ .map((p) => {+ const url = p.path.startsWith('http') ? p.path : p.path;+ const badges = [];+ if (p.auth === 'required') badges.push('<span class="sm-badge sm-badge-auth">sign-in</span>');+ if (p.indexable === false) badges.push('<span class="sm-badge sm-badge-internal">internal</span>');+ return `\t\t\t\t<li>+\t\t\t\t\t<a href="${escapeHtml(url)}">+\t\t\t\t\t\t<span class="sm-title">${escapeHtml(p.title)}${badges.join('')}</span>+\t\t\t\t\t\t<span class="sm-path">${escapeHtml(p.path)}</span>+\t\t\t\t\t\t<span class="sm-desc">${escapeHtml(p.description)}</span>+\t\t\t\t\t</a>+\t\t\t\t</li>`;+ })+ .join('\n');+ return `\t\t<section class="sm-section" id="${escapeHtml(section.id)}">+\t\t\t<header>+\t\t\t\t<h2>${escapeHtml(section.title)}</h2>+\t\t\t\t${section.description ? `<p class="sm-section-desc">${escapeHtml(section.description)}</p>` : ''}+\t\t\t</header>+\t\t\t<ul class="sm-list">+${items}+\t\t\t</ul>+\t\t</section>`;+ })+ .join('\n\n');++ const tocHtml = sections+ .map((s) => `\t\t\t<a href="#${escapeHtml(s.id)}">${escapeHtml(s.title)}</a>`)+ .join('\n');++ return `<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width,initial-scale=1" />+<title>Sitemap · ${escapeHtml(site.name)}</title>+<meta name="description" content="Complete index of every public page on ${escapeHtml(site.name)}." />+<link rel="canonical" href="${escapeHtml(baseUrl)}/sitemap" />+<link rel="alternate" type="application/xml" title="XML sitemap" href="/sitemap.xml" />+<link rel="alternate" type="text/plain" title="llms.txt" href="/llms.txt" />+<link rel="stylesheet" href="/nav.css" />+<link rel="stylesheet" href="/footer.css" />+<style>+\t:root { color-scheme: dark; }+\tbody { margin: 0; background: #060611; color: #e7e7f5; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }+\t.sm-wrap { max-width: 1080px; margin: 0 auto; padding: 96px 24px 64px; }+\t.sm-hero { margin-bottom: 48px; }+\t.sm-hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 12px; letter-spacing: -0.02em; }+\t.sm-hero p { color: #b6b6cf; font-size: 17px; max-width: 64ch; margin: 0; line-height: 1.55; }+\t.sm-formats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }+\t.sm-formats a { padding: 6px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #d8d8ee; text-decoration: none; font-size: 13px; background: rgba(255,255,255,.02); transition: background .15s, border-color .15s; }+\t.sm-formats a:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.24); }+\t.sm-formats code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #9ad4ff; }+\t.sm-toc { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.02); margin-bottom: 56px; }+\t.sm-toc a { color: #cfd0e8; text-decoration: none; font-size: 13px; padding: 4px 10px; border-radius: 999px; }+\t.sm-toc a:hover { background: rgba(255,255,255,.06); color: #fff; }+\t.sm-section { margin-bottom: 56px; scroll-margin-top: 80px; }+\t.sm-section h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }+\t.sm-section-desc { color: #9b9bb7; margin: 0 0 18px; font-size: 14px; }+\t.sm-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }+\t.sm-list li { display: block; }+\t.sm-list a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.015); color: inherit; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }+\t.sm-list a:hover { background: rgba(120,140,255,.06); border-color: rgba(150,170,255,.30); transform: translateY(-1px); }+\t.sm-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }+\t.sm-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #7a85a8; }+\t.sm-desc { color: #b6b6cf; font-size: 13px; line-height: 1.45; }+\t.sm-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }+\t.sm-badge-auth { background: rgba(255, 200, 80, .15); color: #ffcf66; }+\t.sm-badge-internal { background: rgba(120,200,255,.12); color: #9ad4ff; }+</style>+</head>+<body>+\t<div id="home-nav-mount"></div>+\t<main class="sm-wrap">+\t\t<div class="sm-hero">+\t\t\t<h1>Sitemap</h1>+\t\t\t<p>Every public page on ${escapeHtml(site.name)}, grouped by purpose. Looking for the machine-readable versions?</p>+\t\t\t<div class="sm-formats">+\t\t\t\t<a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>+\t\t\t\t<a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>+\t\t\t\t<a href="/llms-full.txt"><code>llms-full.txt</code> · long form</a>+\t\t\t\t<a href="/openapi.json"><code>openapi.json</code> · HTTP API</a>+\t\t\t</div>+\t\t</div>+\t\t<nav class="sm-toc" aria-label="Sections">+${tocHtml}+\t\t</nav>+${sectionHtml}+\t</main>+\t<div id="home-footer-mount"></div>+\t<script type="module" src="/nav.js"></script>+\t<script type="module" src="/footer.js"></script>+</body>+</html>+`;+}++// ────────────────────────────────────────────────────────────────────────+// emit+// ────────────────────────────────────────────────────────────────────────+function writeIfChanged(file, content) {+ mkdirSync(dirname(file), { recursive: true });+ let prev = null;+ try { prev = readFileSync(file, 'utf8'); } catch {}+ if (prev === content) return false;+ writeFileSync(file, content);+ return true;+}++const outputs = [+ { file: resolve(publicDir, 'sitemap.xml'), content: buildSitemap() },+ { file: resolve(publicDir, 'llms.txt'), content: buildLlmsTxt() },+ { file: resolve(publicDir, 'llms-full.txt'), content: buildLlmsFull() },+ { file: resolve(publicDir, 'sitemap/index.html'), content: buildSitemapHtml() },+];++let wrote = 0;+for (const { file, content } of outputs) {+ const changed = writeIfChanged(file, content);+ if (changed) wrote++;+ const rel = file.slice(root.length + 1);+ console.log(`${changed ? 'wrote ' : 'same '} ${rel}`);+}+console.log(`\n${allPages.length} pages across ${sections.length} sections — ${wrote}/${outputs.length} files updated.`);diff --git a/scripts/direct-pump-launch.mjs b/scripts/direct-pump-launch.mjsnew file mode 100644index 000000000..ca3e143cf--- /dev/null+++ b/scripts/direct-pump-launch.mjs@@ -0,0 +1,217 @@+#!/usr/bin/env node+// Direct pump.fun launcher — bypasses 3D-Agent's server entirely.+// Talks straight to @pump-fun/pump-sdk + Solana RPC so we can isolate+// whether the SDK / RPC / keypair path itself works.+//+// Usage:+// node scripts/direct-pump-launch.mjs gen # generate a fresh wallet+// node scripts/direct-pump-launch.mjs balance # show wallet + SOL balance+// node scripts/direct-pump-launch.mjs launch <name> <symbol> <metadataUrl> [--buy <sol>]+// # launch a coin+//+// Keypair lives at .fresh-pump-wallet.json (gitignored).++import fs from 'node:fs';+import path from 'node:path';+import process from 'node:process';+import { fileURLToPath } from 'node:url';+import {+ Connection,+ Keypair,+ PublicKey,+ TransactionMessage,+ VersionedTransaction,+ LAMPORTS_PER_SOL,+} from '@solana/web3.js';+import { AnchorProvider, Wallet } from '@coral-xyz/anchor';+import { PumpSdk, getBuyTokenAmountFromSolAmount } from '@pump-fun/pump-sdk';+import BN from 'bn.js';++const __dirname = path.dirname(fileURLToPath(import.meta.url));+const REPO_ROOT = path.resolve(__dirname, '..');+const WALLET_PATH = path.join(REPO_ROOT, '.fresh-pump-wallet.json');++// Load .env.local so HELIUS_API_KEY is available.+function loadDotenv() {+ const p = path.join(REPO_ROOT, '.env.local');+ if (!fs.existsSync(p)) return;+ for (const line of fs.readFileSync(p, 'utf8').split('\n')) {+ const m = line.match(/^([A-Z0-9_]+)=(.*)$/);+ if (!m) continue;+ if (process.env[m[1]] === undefined) {+ process.env[m[1]] = m[2].replace(/^['"]|['"]$/g, '');+ }+ }+}+loadDotenv();++const RPC_URL = process.env.SOLANA_RPC_URL+ || (process.env.HELIUS_API_KEY+ ? `https://mainnet.helius-rpc.com/?api-key=${process.env.HELIUS_API_KEY}`+ : 'https://api.mainnet-beta.solana.com');++function loadKeypair() {+ if (!fs.existsSync(WALLET_PATH)) {+ throw new Error(`No wallet at ${WALLET_PATH}. Run: node scripts/direct-pump-launch.mjs gen`);+ }+ const secret = JSON.parse(fs.readFileSync(WALLET_PATH, 'utf8'));+ return Keypair.fromSecretKey(Uint8Array.from(secret));+}++async function cmdGen() {+ if (fs.existsSync(WALLET_PATH)) {+ const kp = loadKeypair();+ console.log('Wallet already exists.');+ console.log('Address:', kp.publicKey.toBase58());+ console.log('File: ', WALLET_PATH);+ return;+ }+ const kp = Keypair.generate();+ fs.writeFileSync(WALLET_PATH, JSON.stringify(Array.from(kp.secretKey)), { mode: 0o600 });+ console.log('Fresh wallet generated.');+ console.log('Address:', kp.publicKey.toBase58());+ console.log('File: ', WALLET_PATH, '(gitignored, 0600)');+ console.log('');+ console.log('Fund this address with SOL on mainnet, then run:');+ console.log(' node scripts/direct-pump-launch.mjs balance');+}++async function cmdBalance() {+ const kp = loadKeypair();+ const conn = new Connection(RPC_URL, 'confirmed');+ const lamports = await conn.getBalance(kp.publicKey);+ console.log('Address:', kp.publicKey.toBase58());+ console.log('RPC: ', RPC_URL.replace(/api-key=[^&]+/, 'api-key=***'));+ console.log('Balance:', (lamports / LAMPORTS_PER_SOL).toFixed(6), 'SOL');+}++async function cmdLaunch(name, symbol, uri, opts) {+ if (!name || !symbol || !uri) {+ throw new Error('Usage: launch <name> <symbol> <metadataUrl> [--buy <sol>]');+ }+ const buySol = opts.buy ? parseFloat(opts.buy) : 0;+ if (Number.isNaN(buySol) || buySol < 0) throw new Error('Invalid --buy value');++ const kp = loadKeypair();+ const conn = new Connection(RPC_URL, 'confirmed');++ console.log('Creator: ', kp.publicKey.toBase58());+ console.log('RPC: ', RPC_URL.replace(/api-key=[^&]+/, 'api-key=***'));++ const lamports = await conn.getBalance(kp.publicKey);+ console.log('Balance: ', (lamports / LAMPORTS_PER_SOL).toFixed(6), 'SOL');+ const minNeeded = 0.022 + buySol; // pump.fun base cost + buy+ if (lamports / LAMPORTS_PER_SOL < minNeeded) {+ throw new Error(`Need at least ~${minNeeded.toFixed(3)} SOL; have ${(lamports / LAMPORTS_PER_SOL).toFixed(4)}`);+ }++ const mintKp = Keypair.generate();+ console.log('Mint: ', mintKp.publicKey.toBase58());+ console.log('Name: ', name);+ console.log('Symbol: ', symbol);+ console.log('Metadata: ', uri);+ console.log('Buy-in: ', buySol, 'SOL');+ console.log('');++ // Build pump SDK against this RPC.+ const wallet = new Wallet(kp);+ const provider = new AnchorProvider(conn, wallet, { commitment: 'confirmed' });+ const sdk = new PumpSdk(provider);++ const instructions = [];+ if (buySol > 0) {+ console.log('→ fetchGlobal...');+ const global = await sdk.fetchGlobal();+ const solAmount = new BN(Math.floor(buySol * LAMPORTS_PER_SOL));+ const tokenAmount = getBuyTokenAmountFromSolAmount(global, null, solAmount);+ console.log('→ createAndBuyInstructions...');+ const ixs = await sdk.createAndBuyInstructions({+ global,+ mint: mintKp.publicKey,+ name, symbol, uri,+ creator: kp.publicKey,+ user: kp.publicKey,+ solAmount,+ amount: tokenAmount,+ });+ instructions.push(...(Array.isArray(ixs) ? ixs : [ixs]));+ } else {+ console.log('→ createInstruction...');+ const ix = await sdk.createInstruction({+ mint: mintKp.publicKey,+ name, symbol, uri,+ creator: kp.publicKey,+ user: kp.publicKey,+ });+ instructions.push(ix);+ }+ console.log('Instructions built:', instructions.length);++ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash('confirmed');+ const msg = new TransactionMessage({+ payerKey: kp.publicKey,+ recentBlockhash: blockhash,+ instructions,+ }).compileToV0Message();+ const tx = new VersionedTransaction(msg);+ tx.sign([kp, mintKp]);++ console.log('→ simulate...');+ const sim = await conn.simulateTransaction(tx, { sigVerify: false });+ if (sim.value.err) {+ console.error('Simulation failed:', JSON.stringify(sim.value.err));+ console.error('Logs:');+ for (const l of sim.value.logs || []) console.error(' ', l);+ throw new Error('aborting before send (simulation failed)');+ }+ console.log('Simulation OK. Compute units used:', sim.value.unitsConsumed);++ console.log('→ sendRawTransaction...');+ const sig = await conn.sendRawTransaction(tx.serialize(), { skipPreflight: false, maxRetries: 3 });+ console.log('Signature:', sig);+ console.log('Solscan: https://solscan.io/tx/' + sig);++ console.log('→ confirm...');+ const conf = await conn.confirmTransaction({ signature: sig, blockhash, lastValidBlockHeight }, 'confirmed');+ if (conf.value.err) throw new Error('Confirmation error: ' + JSON.stringify(conf.value.err));++ console.log('');+ console.log('LAUNCHED.');+ console.log('Mint: ', mintKp.publicKey.toBase58());+ console.log('pump.fun: https://pump.fun/coin/' + mintKp.publicKey.toBase58());+}++function parseArgs(argv) {+ const cmd = argv[2];+ const rest = argv.slice(3);+ const positional = [];+ const opts = {};+ for (let i = 0; i < rest.length; i++) {+ const a = rest[i];+ if (a.startsWith('--')) {+ opts[a.slice(2)] = rest[++i];+ } else {+ positional.push(a);+ }+ }+ return { cmd, positional, opts };+}++const { cmd, positional, opts } = parseArgs(process.argv);++try {+ if (cmd === 'gen') await cmdGen();+ else if (cmd === 'balance') await cmdBalance();+ else if (cmd === 'launch') await cmdLaunch(positional[0], positional[1], positional[2], opts);+ else {+ console.error('Usage:');+ console.error(' node scripts/direct-pump-launch.mjs gen');+ console.error(' node scripts/direct-pump-launch.mjs balance');+ console.error(' node scripts/direct-pump-launch.mjs launch <name> <symbol> <metadataUrl> [--buy <sol>]');+ process.exit(1);+ }+} catch (e) {+ console.error('ERROR:', e.message);+ if (e.logs) for (const l of e.logs) console.error(' ', l);+ process.exit(1);+}diff --git a/src/agent-edit.js b/src/agent-edit.jsindex 607387c0f..1e6d39da4 100644--- a/src/agent-edit.js+++ b/src/agent-edit.js@@ -10,9 +10,10 @@ const initAvatarName = params.get('avatar_name') || null;const $ = (id) => document.getElementById(id);let agentData = null;+let outfitMounted = false;+let availableAvatars = null;async function loadAgent() {- // No existing agent ID — create a fresh one pre-loaded with the avatar.if (!agentId) {if (initAvatarId || initAvatarGlb) {await createAgentFromAvatar();@@ -22,10 +23,19 @@ async function loadAgent() {return;}try {- const r = await fetch(`${API_BASE}/marketplace/agents/${agentId}`);- if (!r.ok) throw new Error(`HTTP ${r.status}`);+ const r = await fetch(`${API_BASE}/agents/${agentId}`, { credentials: 'include' });+ if (r.status === 401) {+ sessionStorage.setItem('login_redirect', location.href);+ location.replace('/login');+ return;+ }+ if (!r.ok) {+ const j = await r.json().catch(() => ({}));+ throw new Error(j.error_description || j.error || `HTTP ${r.status}`);+ }const j = await r.json();- agentData = j.data.agent;+ agentData = j.agent;+ if (!agentData) throw new Error('agent not in response');render();} catch (err) {showError(err.message);@@ -35,7 +45,6 @@ async function loadAgent() {async function createAgentFromAvatar() {showLoading('Creating agent…');try {- // 1. Create a new agent.const name = initAvatarName ? `${initAvatarName} Agent` : 'My Agent';const createRes = await fetch(`${API_BASE}/agents`, {method: 'POST',@@ -54,7 +63,6 @@ async function createAgentFromAvatar() {}const { agent } = await createRes.json();- // 2. Attach the avatar if we have an ID (already in the user's account).if (initAvatarId) {const patchRes = await fetch(`${API_BASE}/agents/${agent.id}`, {method: 'PUT',@@ -63,16 +71,12 @@ async function createAgentFromAvatar() {body: JSON.stringify({ avatar_id: initAvatarId }),});if (!patchRes.ok) {- // Non-fatal — agent was created, avatar link just didn't stick.console.warn('[agent-edit] avatar attach failed', patchRes.status);}}- // 3. Replace URL so the page now "owns" this agent ID without re-creating- // on back-nav, then load normally.history.replaceState({}, '', `/agent-edit.html?id=${agent.id}`);agentData = agent;- // Seed a helpful prompt based on the avatar name.if (initAvatarName) {agentData.name = name;agentData.system_prompt = agentData.system_prompt ||@@ -105,22 +109,40 @@ function showBanner(msg) {function render() {$('loading').hidden = true;+ // Reveal the persona panel (the rest stay [hidden] until their tab is opened).+ $('panel-persona').hidden = false;$('panel-persona').classList.add('active');- $('agent-title').textContent = `Edit Agent: ${agentData.name}`;+ $('agent-title').textContent = `Edit Agent: ${agentData.name || 'Untitled'}`;$('back-link').href = `/agent-detail.html?id=${agentId}`;// Persona- $('f-name').value = agentData.name;- $('f-desc').value = agentData.description;+ $('f-name').value = agentData.name || '';+ $('f-desc').value = agentData.description || '';// Publish- $('f-category').value = agentData.category;+ $('f-category').value = agentData.category || '';$('f-tags').value = (agentData.tags || []).join(', ');- $('f-prompt').value = agentData.system_prompt;- $('f-greeting').value = agentData.greeting;+ $('f-prompt').value = agentData.system_prompt || '';+ $('f-greeting').value = agentData.greeting || '';// MonetizationrenderMonetization();++ // Autopilot+ $('f-strategy').value = formatStrategy(agentData.meta?.strategy);+}++function formatStrategy(strategy) {+ if (strategy == null) return '';+ if (typeof strategy === 'string') return strategy;+ try { return JSON.stringify(strategy, null, 2); } catch { return String(strategy); }+}++function parseStrategy(text) {+ const trimmed = text.trim();+ if (!trimmed) return null;+ // If it parses as JSON, store as object; otherwise as plain string (freeform).+ try { return JSON.parse(trimmed); } catch { return trimmed; }}function renderMonetization() {@@ -169,6 +191,100 @@ function renderMonetization() {});}+// ── Outfit tab ────────────────────────────────────────────────────────────+// Lazily mount the agent preview + avatar picker only when the user opens+// the tab so we don't pay for a WebGL context up front.++async function ensureOutfitTab() {+ if (outfitMounted) return;+ outfitMounted = true;++ const preview = $('outfit-preview');+ const a3d = document.createElement('agent-3d');+ a3d.setAttribute('agent-id', agentId);+ a3d.setAttribute('controls', 'orbit');+ a3d.style.cssText = 'width:100%;height:100%;display:block';+ preview.innerHTML = '';+ preview.appendChild(a3d);++ await renderAvatarList();+}++async function renderAvatarList() {+ const container = $('avatar-picker-list');+ container.textContent = 'Loading avatars…';+ try {+ const r = await fetch(`${API_BASE}/avatars?limit=50`, { credentials: 'include' });+ if (!r.ok) throw new Error(`HTTP ${r.status}`);+ const j = await r.json();+ availableAvatars = j.avatars || [];+ } catch (err) {+ container.innerHTML = `<div class="error-msg" style="padding:1rem">Could not load avatars: ${escapeHtml(err.message)}</div>`;+ return;+ }++ if (!availableAvatars.length) {+ container.innerHTML = '<div class="no-named-mats">You have no avatars yet. <a href="/dashboard/#avatars" style="color:#93c5fd">Create one in the dashboard ›</a></div>';+ return;+ }++ container.innerHTML = availableAvatars.map((av) => {+ const thumb = av.thumbnail_url || av.url || '';+ const isCurrent = av.id === agentData.avatar_id;+ return `+ <button type="button" class="avatar-tile${isCurrent ? ' current' : ''}" data-avatar-id="${escapeHtml(av.id)}" title="${escapeHtml(av.name || av.id)}">+ ${thumb ? `<img src="${escapeHtml(thumb)}" alt="" loading="lazy">` : '<div class="avatar-tile-ph">3D</div>'}+ <span class="avatar-tile-name">${escapeHtml(av.name || 'Untitled')}</span>+ ${isCurrent ? '<span class="avatar-tile-badge">Current</span>' : ''}+ </button>+ `;+ }).join('');++ container.querySelectorAll('.avatar-tile').forEach((btn) => {+ btn.addEventListener('click', () => selectAvatar(btn.dataset.avatarId));+ });+}++async function selectAvatar(avatarId) {+ if (!avatarId || avatarId === agentData.avatar_id) return;+ const status = $('outfit-status');+ status.textContent = 'Saving…';+ status.className = 'outfit-status saving';+ try {+ const r = await fetch(`${API_BASE}/agents/${agentId}`, {+ method: 'PUT',+ headers: { 'Content-Type': 'application/json' },+ credentials: 'include',+ body: JSON.stringify({ avatar_id: avatarId }),+ });+ if (!r.ok) {+ const j = await r.json().catch(() => ({}));+ throw new Error(j.error_description || j.error || `HTTP ${r.status}`);+ }+ agentData.avatar_id = avatarId;+ // Re-render the avatar tiles so the "Current" badge moves, and reload the+ // 3D preview so the new model paints.+ await renderAvatarList();+ reloadOutfitPreview();+ status.textContent = 'Saved.';+ status.className = 'outfit-status saved';+ setTimeout(() => { status.textContent = ''; status.className = 'outfit-status'; }, 2000);+ } catch (err) {+ status.textContent = `Error: ${err.message}`;+ status.className = 'outfit-status err';+ }+}++function reloadOutfitPreview() {+ const preview = $('outfit-preview');+ const a3d = document.createElement('agent-3d');+ a3d.setAttribute('agent-id', agentId);+ a3d.setAttribute('controls', 'orbit');+ a3d.style.cssText = 'width:100%;height:100%;display:block';+ preview.innerHTML = '';+ preview.appendChild(a3d);+}+function showError(msg) {$('loading').hidden = true;const errEl = $('error');@@ -177,13 +293,12 @@ function showError(msg) {}function escapeHtml(s) {- return String(s || '').replace(- /[&<>"']/g,- (ch) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[ch],- );+ return String(s || '').replace(+ /[&<>"']/g,+ (ch) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[ch],+ );}-// --- Event Listeners ---$('persona-save').addEventListener('click', async () => {@@ -311,15 +426,54 @@ $('monetization-save').addEventListener('click', async () => {}});+$('autopilot-save').addEventListener('click', async () => {+ const status = $('autopilot-status');+ const text = $('f-strategy').value;+ status.textContent = 'Saving…';+ status.className = 'form-status';+ try {+ const strategy = parseStrategy(text);+ const r = await fetch(`${API_BASE}/agent-strategy?id=${encodeURIComponent(agentId)}`, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ credentials: 'include',+ body: JSON.stringify({ strategy }),+ });+ if (!r.ok) {+ const j = await r.json().catch(() => ({}));+ throw new Error(j.error_description || j.error || `HTTP ${r.status}`);+ }+ agentData.meta = agentData.meta || {};+ agentData.meta.strategy = strategy;+ status.textContent = 'Strategy saved.';+ status.className = 'form-status ok';+ } catch (err) {+ status.textContent = `Error: ${err.message}`;+ status.className = 'form-status err';+ }+});++// --- Tab switching ----document.querySelectorAll('.edit-tab').forEach(tab => {+document.querySelectorAll('.edit-tab').forEach((tab) => {tab.addEventListener('click', (e) => {- document.querySelectorAll('.edit-tab').forEach(t => t.classList.remove('active'));- document.querySelectorAll('.edit-panel').forEach(p => p.classList.remove('active'));-- const tabId = e.target.dataset.tab;- e.target.classList.add('active');- $(`panel-${tabId}`).classList.add('active');+ const btn = e.currentTarget;+ const tabId = btn.dataset.tab;++ document.querySelectorAll('.edit-tab').forEach((t) => {+ const active = t === btn;+ t.classList.toggle('active', active);+ t.setAttribute('aria-selected', active ? 'true' : 'false');+ });++ document.querySelectorAll('.edit-panel').forEach((p) => {+ const active = p.id === `panel-${tabId}`;+ p.classList.toggle('active', active);+ if (active) p.removeAttribute('hidden');+ else p.setAttribute('hidden', '');+ });++ if (tabId === 'outfit' && agentData) ensureOutfitTab();});});diff --git a/src/agent-solana-wallet.js b/src/agent-solana-wallet.jsindex 7eb4b44cd..cd742a928 100644--- a/src/agent-solana-wallet.js+++ b/src/agent-solana-wallet.js@@ -279,7 +279,11 @@ export function mountAgentSolanaWalletCard({ panel, identity, onProvisioned }) {async function refreshBalance() {if (!state.address) return;+ // Host detached (route changed, parent re-rendered) — tear down and exit.+ if (!wrapper.isConnected) { stopBalancePoll(); return; }const r = await fetchAgentSolanaWallet(identity.id, state.network);+ // Session lost or ownership revoked mid-poll — stop hammering the API.+ if (r.status === 'forbidden') { stopBalancePoll(); return; }if (r.status === 'ok') {state.lamports = r.data.lamports;state.sol = r.data.sol;@@ -289,6 +293,7 @@ export function mountAgentSolanaWalletCard({ panel, identity, onProvisioned }) {function startBalancePoll() {stopBalancePoll();+ if (!wrapper.isConnected) return;balanceTimer = setInterval(refreshBalance, 30_000);}function stopBalancePoll() {diff --git a/src/avatar-page.js b/src/avatar-page.jsindex b1b77b265..611084cd6 100644--- a/src/avatar-page.js+++ b/src/avatar-page.js@@ -206,8 +206,17 @@ function renderShell(glbUrl) {<div class="av-side"><div class="av-side-head">- <div class="av-eyebrow">${avatar.demo ? 'Curated · Public Domain' : 'Community Avatar'}</div>+ <div class="av-eyebrow">+ <span>Avatar · 3D Body</span>+ <a+ class="av-eyebrow-help"+ href="/docs/agents-vs-avatars"+ title="An avatar is the 3D body. Pair it with an agent to give that agent a presence."+ aria-label="What is an avatar?"+ >?</a>+ </div><h1 class="av-name">${esc(avatar.name)}</h1>+ <div class="av-source-tag">${avatar.demo ? 'Curated · Public Domain' : 'Community avatar'}</div>${byLine}${tagsHtml ? `<div class="av-tags">${tagsHtml}</div>` : ''}</div>diff --git a/src/cloud.js b/src/cloud.jsindex 36866bdcc..25970aa3d 100644--- a/src/cloud.js+++ b/src/cloud.js@@ -12,8 +12,7 @@ import {Vector3,} from 'three';-const CLOUD_TEXTURE =- 'https://rawcdn.githack.com/pmndrs/drei-assets/9225a9f1fbd449d9411125c2f419b843d0308c9b/cloud.png';+const CLOUD_TEXTURE = '/textures/cloud.png';// mulberry32 — fast, seeded, deterministicfunction seededRand(seed) {diff --git a/src/pump/launch-token-boot.js b/src/pump/launch-token-boot.jsindex a7af88157..2e5254747 100644--- a/src/pump/launch-token-boot.js+++ b/src/pump/launch-token-boot.js@@ -33,13 +33,26 @@ function _mount() {window.open(`/pump-dashboard.html?agent=${agentId}`, '_blank');});} else {- // Not launched yet, show launch button+ const imageUrl =+ rawAgent.avatar_thumbnail_url || rawAgent.meta?.thumbnail_url || '';+ const onchain = rawAgent.onchain || rawAgent.meta?.onchain || null;+ const needsDeploy = !onchain || onchain.family !== 'solana';+btn.addEventListener('click', () => {openLaunchTokenModal({agentId,agentName: identity.name,- imageUrl:- rawAgent.avatar_thumbnail_url || rawAgent.meta?.thumbnail_url || '',+ imageUrl,+ needsDeploy,+ agentForDeploy: needsDeploy+ ? {+ id: agentId,+ name: rawAgent.name || identity.name,+ description: rawAgent.description || '',+ avatar_id: rawAgent.avatar_id || null,+ skills: rawAgent.skills || undefined,+ }+ : null,});});}diff --git a/src/pump/launch-token-modal.css b/src/pump/launch-token-modal.cssindex 40d1488ee..15ae6326f 100644--- a/src/pump/launch-token-modal.css+++ b/src/pump/launch-token-modal.css@@ -223,6 +223,33 @@}.ltm-status-msg.ltm-err { color: #fca5a5; }+/* Step 0 — deploy agent on-chain */+.ltm-deploy-intro {+ display: flex;+ flex-direction: column;+ gap: 0.55rem;+ padding: 0.1rem 0 0.25rem 0;+}+.ltm-deploy-title {+ font-size: 0.95rem;+ font-weight: 400;+ color: #e7e7ec;+}+.ltm-deploy-sub {+ font-size: 0.78rem;+ line-height: 1.45;+ color: rgba(255, 255, 255, 0.58);+}+.ltm-deploy-bullets {+ margin: 0.1rem 0 0 0;+ padding: 0 0 0 1.05rem;+ font-size: 0.76rem;+ line-height: 1.55;+ color: rgba(255, 255, 255, 0.55);+}+.ltm-deploy-bullets li { margin-bottom: 0.15rem; }+.ltm-deploy-bullets strong { color: #d8f5e2; font-weight: 500; }+/* Success state */.ltm-success {text-align: center;diff --git a/src/pump/launch-token-modal.js b/src/pump/launch-token-modal.jsindex 0e3cafdaf..45cec2cb0 100644--- a/src/pump/launch-token-modal.js+++ b/src/pump/launch-token-modal.js@@ -57,9 +57,21 @@ function _apiError(status, data) {export class LaunchTokenModal {/**- * @param {{ agentId: string, agentName?: string, imageUrl?: string }} opts+ * @param {{+ * agentId: string,+ * agentName?: string,+ * imageUrl?: string,+ * needsDeploy?: boolean,+ * agentForDeploy?: { id: string, name: string, description?: string, avatar_id?: string|null, skills?: string[] }|null,+ * }} opts*/- constructor({ agentId, agentName = 'Agent', imageUrl = '' }) {+ constructor({+ agentId,+ agentName = 'Agent',+ imageUrl = '',+ needsDeploy = false,+ agentForDeploy = null,+ }) {this.agentId = agentId;this._d = {name: String(agentName).slice(0, 32),@@ -69,11 +81,16 @@ export class LaunchTokenModal {initialBuySol: 0,cluster: 'mainnet',};- this._step = 1;+ this._needsDeploy = !!needsDeploy;+ this._agentForDeploy = agentForDeploy;+ // Step 0 = deploy-on-chain (only when needsDeploy is true).+ // Step 1..4 = the normal launch flow.+ this._step = needsDeploy ? 0 : 1;this._overlay = null;this._chart = null;this._keyHandler = null;this._solPriceUsd = null;+ this._deployBusy = false;}async _fetchSolPrice() {@@ -142,7 +159,8 @@ export class LaunchTokenModal {};window.addEventListener('keydown', this._keyHandler);requestAnimationFrame(() => el.classList.add('ltm-open'));- this._renderStep1();+ if (this._needsDeploy) this._renderStep0();+ else this._renderStep1();}_close() {@@ -162,7 +180,8 @@ export class LaunchTokenModal {}_stepDots() {- return [1, 2, 3, 4]+ const steps = this._needsDeploy ? [0, 1, 2, 3, 4] : [1, 2, 3, 4];+ return steps.map((i) =>`<div class="ltm-step-dot ${this._step === i ? 'active' : this._step > i ? 'done' : ''}"></div>`,@@ -195,6 +214,117 @@ export class LaunchTokenModal {this._overlay.querySelector('.ltm-close')?.addEventListener('click', () => this._close());}+ // ── Step 0 — Deploy agent on Solana (only when needsDeploy) ───────────────++ _renderStep0() {+ this._step = 0;+ this._paint(+ this._shell(+ 'Launch Token — Deploy Agent',+ `<div class="ltm-deploy-intro">+ <div class="ltm-deploy-title">Deploy your agent on Solana first</div>+ <div class="ltm-deploy-sub">+ Pump.fun tokens are tied to the agent's on-chain identity. We'll mint+ a Metaplex Core asset to your wallet — that asset becomes the agent's+ permanent on-chain record. The same wallet then launches the token.+ </div>+ <ul class="ltm-deploy-bullets">+ <li>You'll sign <strong>2 transactions</strong>: one to deploy, one to launch.</li>+ <li>Both use the same Solana wallet.</li>+ <li>Deploy cost is ~0.003 SOL of rent + network fees.</li>+ </ul>+ </div>+ <div class="ltm-status-msg" id="ltm-deploy-msg"></div>`,+ `<button class="ltm-btn" id="ltm-s0-cancel">Cancel</button>+ <button class="ltm-btn ltm-btn-primary" id="ltm-s0-deploy">Deploy on Solana →</button>`,+ ),+ );++ this._overlay.querySelector('#ltm-s0-cancel').addEventListener('click', () => this._close());+ this._overlay+ .querySelector('#ltm-s0-deploy')+ .addEventListener('click', () => this._runDeploy());+ }++ async _runDeploy() {+ if (this._deployBusy) return;+ const btn = this._overlay.querySelector('#ltm-s0-deploy');+ const cancel = this._overlay.querySelector('#ltm-s0-cancel');+ const setMsg = (text, err = false) => {+ const el = this._overlay?.querySelector('#ltm-deploy-msg');+ if (!el) return;+ el.textContent = text;+ el.className = `ltm-status-msg${err ? ' ltm-err' : ''}`;+ };++ if (!this._agentForDeploy?.id) {+ setMsg('Missing agent context — please reload and try again.', true);+ return;+ }++ this._deployBusy = true;+ btn.disabled = true;+ cancel.disabled = true;++ const labels = {+ connect: 'Connecting Solana wallet…',+ prep: 'Preparing on-chain manifest…',+ sign: 'Sign the deploy transaction in your wallet…',+ confirm: 'Confirming on Solana…',+ save: 'Linking agent to wallet…',+ };++ try {+ const [{ deployAgent }, { solana }] = await Promise.all([+ import('../onchain/deploy.js'),+ import('../onchain/chain-ref.js'),+ ]);++ const ref = solana(this._d.cluster === 'devnet' ? 'devnet' : 'mainnet');++ setMsg(labels.connect);+ await deployAgent({+ agent: this._agentForDeploy,+ ref,+ onProgress: (step) => {+ const text = labels[step] || step;+ setMsg(text);+ btn.textContent = text;+ },+ });++ this._needsDeploy = false;+ setMsg('Deployed. Continuing to token details…');+ // Brief pause so user sees the success state before advancing.+ setTimeout(() => {+ if (!this._overlay) return;+ this._renderStep1();+ }, 400);+ } catch (err) {+ // Re-import to avoid an extra round trip in the happy path.+ const { isUserRejection } = await import('../onchain/adapters/index.js');+ if (isUserRejection(err)) {+ setMsg('Deploy cancelled. Click Deploy on Solana to try again.', true);+ btn.textContent = 'Deploy on Solana →';+ btn.disabled = false;+ cancel.disabled = false;+ this._deployBusy = false;+ return;+ }+ if (err?.code === 'NO_PROVIDER') {+ const url = err.installUrl || 'https://phantom.app';+ setMsg(`No Solana wallet detected. Install Phantom: ${url}`, true);+ } else {+ const msg = err?.message || 'Deploy failed — please try again.';+ setMsg(msg, true);+ }+ btn.textContent = 'Retry deploy';+ btn.disabled = false;+ cancel.disabled = false;+ this._deployBusy = false;+ }+ }+// ── Step 1 — Token details ────────────────────────────────────────────────_renderStep1() {diff --git a/vercel.json b/vercel.jsonindex 3f4eb6907..9e8347da4 100644--- a/vercel.json+++ b/vercel.json@@ -96,14 +96,6 @@"src": "/api/agents/([^/]+)/unlocked-skills","dest": "/api/agents/[id]/unlocked-skills?id=$1"},- {- "src": "/api/billing/payout-wallet",- "dest": "/api/billing/payout-wallet"- },- {- "src": "/api/billing/withdraw",- "dest": "/api/billing/withdraw"- },{"src": "/api/billing/receipts","dest": "/api/billing/receipts"@@ -180,6 +172,22 @@"src": "/vanity-wallet/","dest": "/vanity-wallet.html"},+ {+ "src": "/pump-visualizer/?",+ "dest": "/pump-visualizer.html"+ },+ {+ "src": "/avatar-artifact/?",+ "dest": "/avatar-artifact.html"+ },+ {+ "src": "/pretext-demo/?",+ "dest": "/pretext-demo.html"+ },+ {+ "src": "/launch-week/?",+ "dest": "/three-ws-launch-week.html"+ },{"src": "/deploy","dest": "/app.html"@@ -200,6 +208,10 @@"src": "/dashboard/wallets","dest": "/dashboard/wallets.html"},+ {+ "src": "/dashboard/portfolio",+ "dest": "/dashboard/portfolio.html"+ },{"src": "/dashboard/sessions","dest": "/dashboard/sessions.html"@@ -736,7 +748,7 @@},{"src": "/api/auth/profile",- "dest": "/api/auth/profile"+ "dest": "/api/auth/[action]?action=profile"},{"src": "/a/(\\d+)/(\\d+)/edit",@@ -952,18 +964,6 @@"src": "/settings/(.*)","dest": "/settings/$1"},- {- "src": "/admin",- "dest": "/admin/index.html"- },- {- "src": "/admin/",- "dest": "/admin/index.html"- },- {- "src": "/admin/(.*)",- "dest": "/admin/$1"- },{"src": "/api/llm/anthropic","dest": "/api/llm/anthropic.js"@@ -1180,6 +1180,14 @@"src": "/create/","dest": "/create.html"},+ {+ "src": "/features",+ "dest": "/features.html"+ },+ {+ "src": "/features/",+ "dest": "/features.html"+ },{"src": "/","dest": "/home.html"@@ -1290,6 +1298,10 @@"path": "/api/cron/run-x-scheduled-posts","schedule": "* * * * *"},+ {+ "path": "/api/cron/run-x-triggers",+ "schedule": "*/5 * * * *"+ },{"path": "/api/cron/pumpfun-signals","schedule": "*/15 * * * *"diff --git a/vite.config.js b/vite.config.jsindex 068c0444a..d590959b1 100644--- a/vite.config.js+++ b/vite.config.js@@ -118,6 +118,7 @@ const appConfig = {app: resolve(__dirname, 'app.html'),'app-demo': resolve(__dirname, 'app-demo.html'),home: resolve(__dirname, 'home.html'),+ features: resolve(__dirname, 'features.html'),tutorials: resolve(__dirname, 'tutorials.html'),playground: resolve(__dirname, 'playground.html'),embed: resolve(__dirname, 'embed.html'),@@ -131,6 +132,10 @@ const appConfig = {'a-edit': resolve(__dirname, 'a-edit.html'),'pump-live': resolve(__dirname, 'pump-live.html'),'pump-dashboard': resolve(__dirname, 'pump-dashboard.html'),+ 'pump-visualizer': resolve(__dirname, 'pump-visualizer.html'),+ 'avatar-artifact': resolve(__dirname, 'avatar-artifact.html'),+ 'pretext-demo': resolve(__dirname, 'pretext-demo.html'),+ 'launch-week': resolve(__dirname, 'three-ws-launch-week.html'),community: resolve(__dirname, 'community.html'),profile: resolve(__dirname, 'profile.html'),'avatar-page': resolve(__dirname, 'avatar-page.html'),@@ -147,6 +152,7 @@ const appConfig = {'eth-vanity': resolve(__dirname, 'public/eth-vanity.html'),pay: resolve(__dirname, 'public/pay/index.html'),'pay-calls': resolve(__dirname, 'public/pay/calls/index.html'),+ sitemap: resolve(__dirname, 'public/sitemap/index.html'),},},},@@ -201,12 +207,22 @@ const appConfig = {'/pump-live/': resolve(root, 'pump-live.html'),'/pump-dashboard': resolve(root, 'pump-dashboard.html'),'/pump-dashboard/': resolve(root, 'pump-dashboard.html'),+ '/pump-visualizer': resolve(root, 'pump-visualizer.html'),+ '/pump-visualizer/': resolve(root, 'pump-visualizer.html'),+ '/avatar-artifact': resolve(root, 'avatar-artifact.html'),+ '/avatar-artifact/': resolve(root, 'avatar-artifact.html'),+ '/pretext-demo': resolve(root, 'pretext-demo.html'),+ '/pretext-demo/': resolve(root, 'pretext-demo.html'),+ '/launch-week': resolve(root, 'three-ws-launch-week.html'),+ '/launch-week/': resolve(root, 'three-ws-launch-week.html'),'/eth-vanity': resolve(root, 'public/eth-vanity.html'),'/eth-vanity/': resolve(root, 'public/eth-vanity.html'),'/strategy-lab': resolve(root, 'public/strategy-lab.html'),'/strategy-lab/': resolve(root, 'public/strategy-lab.html'),'/': resolve(root, 'home.html'),'/home': resolve(root, 'home.html'),+ '/features': resolve(root, 'features.html'),+ '/features/': resolve(root, 'features.html'),'/agent': resolve(root, 'agent-home.html'),'/docs': resolve(root, 'docs/index.html'),'/docs/': resolve(root, 'docs/index.html'),@@ -292,6 +308,11 @@ const appConfig = {filePath = resolve(root, 'public/dashboard/index.html');else if (!filePath && /^\/dashboard\/edit\/[^/]+\/?$/.test(path))filePath = resolve(root, 'public/dashboard/index.html');+ // /dashboard/<page> → corresponding static HTML page+ else if (!filePath && /^\/dashboard\/(?:portfolio|wallets|sessions|actions|embed-policy|agent-pumpfun|usage|storage)\/?$/.test(path)) {+ const slug = path.replace(/^\/dashboard\//, '').replace(/\/$/, '');+ filePath = resolve(root, `public/dashboard/${slug}.html`);+ }// Serve the rider webpack app as static files.// /footer-bot.js — serve the Vite-processed src/footer-bot.js at a// stable URL in dev so footer.js can load it without knowing the hash.