Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Installed marketplace skills now steer chat replies

nirholas813c58640216
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4a375d567..c6bcbe624 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-07-21
- **Docs · NVIDIA Inception membership** (`/docs/nvidia-inception`) — three.ws is a member of the NVIDIA Inception program: what the platform runs on NVIDIA today, what membership adds (GPU credits, ACE/NIM migration, ecosystem access), and who is building it.
+- **Installing a marketplace skill now actually teaches your agent** — Skills from the marketplace used to install into the void: you clicked Install, a badge flipped, and nothing changed. Now every knowledge skill you install loads its playbook into your agent's context in every signed-in chat, so an install visibly changes how your agent answers (install whale-wallet-tracking and ask about a token's whales to see it). Skill pages also explain what installing does up front and, once installed, hand you a 'Chat with your agent' shortcut. Developers can pull their full installed set, playbooks included, from GET /api/skills?installed=true. (`/marketplace?tab=skills`) `[feature, improvement]`
+- **Marketplace: submitting an agent no longer means typing a form** — The Submit Agent flow on /marketplace is now a chooser instead of a wall of text fields. The primary path sends you to the guided agent builder (3D avatar, persona, publish); a second path lists the agents you already have, with drafts publishable in one click right from the dialog; the old manual form and JSON import stay available behind an Advanced toggle. The featured hero is more compact so search and listings are visible without scrolling, the signed-out My Agents view got a proper call to action, and related agents on detail pages now show their 3D thumbnails. (`/marketplace`) `[improvement]`
+- **Sniper Experiments: every wallet and every decision, in the open** — The /sniper/experiments scoreboard now shows each strategy's live wallet: its address, a Solscan link, and its real-time SOL balance, plus the shared master wallet that auto-funds the fleet. Every arm also links straight to its Reasoning Ledger, a tamper-evident, on-chain-anchored record of every single buy decision: the exact market data and rationale the agent acted on at entry, and once the trade closes, the real outcome (win or loss, by how much). Nothing is hidden or summarized away; wins and losses are published with the same detail. (`/sniper/experiments`) `[feature, improvement]`
- **three.ws joins the NVIDIA Inception program** — three.ws LLC has been accepted into NVIDIA Inception, NVIDIA's global program for startups building with accelerated computing. It is a natural home for this platform: every 3D generation lane already runs on NVIDIA GPUs, from the free text-to-3D forge to photo avatars, auto-rigging, and motion capture. Membership opens access to NVIDIA's startup benefits, including GPU capacity, software, and engineering resources, and they will go straight into faster generations and higher-quality avatars. `[infra]`
## 2026-07-20
diff --git a/api/_lib/installed-skills.js b/api/_lib/installed-skills.js
new file mode 100644
index 000000000..3bc52a753
--- /dev/null
+++ b/api/_lib/installed-skills.js
@@ -0,0 +1,64 @@
+// Installed marketplace skills → chat context.
+//
+// Users install skills from /marketplace (skill_installs rows). This module
+// turns a user's installed knowledge skills (marketplace_skills.content) into
+// a system-prompt block for /api/chat, so an install actually changes how
+// their agent behaves. Tool-schema skills (schema_json) are not injected here:
+// the chat action-tool set is a fixed server-side contract, and a schema
+// without a handler cannot execute.
+//
+// Budget: newest installs win. At most MAX_SKILLS skills, each clipped to
+// MAX_SKILL_CHARS, the whole block clipped to MAX_TOTAL_CHARS, so a pile of
+// long skills can never crowd the persona or the user's message out of
+// context.
+
+import { sql } from './db.js';
+
+const MAX_SKILLS = 8;
+const MAX_SKILL_CHARS = 6000;
+const MAX_TOTAL_CHARS = 24000;
+
+/**
+ * Load the user's installed knowledge skills, newest install first.
+ * Returns [{ slug, name, content }]. Empty array for anonymous callers.
+ */
+export async function loadInstalledSkills(userId) {
+ if (!userId) return [];
+ const rows = await sql`
+ SELECT ms.slug, ms.name, ms.content
+ FROM skill_installs si
+ JOIN marketplace_skills ms ON ms.id = si.skill_id
+ WHERE si.user_id = ${userId}
+ AND ms.is_public = true
+ AND ms.content IS NOT NULL AND ms.content <> ''
+ ORDER BY si.installed_at DESC
+ LIMIT ${MAX_SKILLS}
+ `;
+ return rows.map((r) => ({ slug: r.slug, name: r.name, content: r.content }));
+}
+
+/**
+ * Render loaded skills as a system-prompt block. Returns '' when there is
+ * nothing to inject.
+ */
+export function skillsPromptBlock(skills) {
+ if (!Array.isArray(skills) || skills.length === 0) return '';
+ const parts = [
+ 'Installed skills: the user installed these playbooks from the three.ws marketplace. When a message falls in a skill\'s domain, follow that skill\'s framework and format (its guidance overrides the 2-3 sentence default). Skills that do not apply to the message are ignored.',
+ ];
+ let used = 0;
+ for (const s of skills) {
+ let body = s.content.length > MAX_SKILL_CHARS
+ ? s.content.slice(0, MAX_SKILL_CHARS) + '\n[…skill truncated]'
+ : s.content;
+ if (used + body.length > MAX_TOTAL_CHARS) {
+ const remaining = MAX_TOTAL_CHARS - used;
+ if (remaining < 500) break;
+ body = body.slice(0, remaining) + '\n[…skill truncated]';
+ }
+ used += body.length;
+ parts.push(`--- skill: ${s.slug} ---\n${body}`);
+ }
+ if (parts.length === 1) return '';
+ return parts.join('\n\n');
+}
diff --git a/api/_lib/token/microbuy.js b/api/_lib/token/microbuy.js
index 935963996..98368dc40 100644
--- a/api/_lib/token/microbuy.js
+++ b/api/_lib/token/microbuy.js
@@ -377,9 +377,19 @@ export async function executeMicrobuy(signer, plan) {
);
}
+ // jupiterSwapTx()'s default priority ceiling (0.001 SOL, 'medium') is sized for
+ // time-sensitive swaps elsewhere in the codebase. This lane broadcasts-and-goes
+ // with no confirm wait (see awaitConfirm() above), so nothing is waiting on fast
+ // inclusion — an occasional slower landing costs nothing. On a $0.01-$5 buy that
+ // ceiling can dwarf the trade itself, so cap it far tighter; 'medium' still
+ // prices adaptively off real network conditions, just bounded.
let swapB64;
try {
- swapB64 = await jupiterSwapTx({ quote: plan.quote, userPublicKey: payer.toBase58() });
+ swapB64 = await jupiterSwapTx({
+ quote: plan.quote,
+ userPublicKey: payer.toBase58(),
+ maxPriorityLamports: 25_000,
+ });
} catch (err) {
await releaseDailySpend(plan.spendUsdcAtomics);
throw err;
diff --git a/api/chat.js b/api/chat.js
index 76f9b791d..c49922ba6 100644
--- a/api/chat.js
+++ b/api/chat.js
@@ -52,6 +52,7 @@ import {
PER_CALL_TIMEOUT_MS,
} from './_lib/chat-models.js';
import { computeContext, searchMemories } from './_lib/memory-store.js';
+import { loadInstalledSkills, skillsPromptBlock } from './_lib/installed-skills.js';
import {
vertexClaudeEnabled,
vertexClaudePrimary,
@@ -540,7 +541,27 @@ export default wrap(async (req, res) => {
}
}
- const systemPrompt = buildSystemPrompt(body.context, personaPrompt, recalledMemories);
+ // Installed marketplace skills: a signed-in user's installed knowledge
+ // skills become standing playbooks in the system prompt, so installing a
+ // skill from /marketplace visibly changes how their agent answers. The
+ // slugs ride along in the done event as `skills_applied` so clients can
+ // show which skills were in play. Best-effort: a skills-store hiccup
+ // degrades to a skill-less reply, never a failed chat.
+ let installedSkills = [];
+ if (auth?.userId) {
+ try {
+ installedSkills = await loadInstalledSkills(auth.userId);
+ } catch (err) {
+ captureException(err, { route: 'chat', stage: 'installed-skills' });
+ }
+ }
+
+ const systemPrompt = buildSystemPrompt(
+ body.context,
+ personaPrompt,
+ recalledMemories,
+ installedSkills,
+ );
const history = body.history.map((m) => ({ role: m.role, content: m.content }));
history.push({ role: 'user', content: body.message });
@@ -936,6 +957,8 @@ export default wrap(async (req, res) => {
recalled: recalledMemories,
recalledSemantic,
recalledTs: new Date().toISOString(),
+ // Marketplace skills whose playbooks were in this reply's context.
+ skills_applied: installedSkills.map((s) => s.slug),
});
res.end();
@@ -1509,7 +1532,7 @@ async function recallForChat(agentId, message, isOwner) {
}));
}
-function buildSystemPrompt(ctx = {}, personaPrompt = null, recalled = []) {
+function buildSystemPrompt(ctx = {}, personaPrompt = null, recalled = [], installedSkills = []) {
const loaded = ctx.modelName
? `A model named "${ctx.modelName}" is loaded. Stats: ${fmt(ctx.vertices)} vertices, ${fmt(ctx.triangles)} triangles, ${fmt(ctx.materials)} materials, ${ctx.animations ?? 0} animations.`
: 'No model is currently loaded in the viewer.';
@@ -1528,6 +1551,8 @@ function buildSystemPrompt(ctx = {}, personaPrompt = null, recalled = []) {
'',
);
}
+ const skillsBlock = skillsPromptBlock(installedSkills);
+ if (skillsBlock) lines.push(skillsBlock, '');
lines.push(
'You are an embodied AI assistant rendered as a 3D avatar at three.ws — the platform for building, embedding, and monetising 3D AI agents.',
'',
diff --git a/api/skills/index.js b/api/skills/index.js
index bb6952f23..021c19d86 100644
--- a/api/skills/index.js
+++ b/api/skills/index.js
@@ -55,7 +55,7 @@ async function resolveOptionalAuth(req) {
return null;
}
-function toSkill(row, { includeInstalled = false, includeSchema = false } = {}) {
+function toSkill(row, { includeInstalled = false, includeSchema = false, includeContent = false } = {}) {
const hasContent = typeof row.content === 'string' && row.content.length > 0;
const skill = {
id: row.id,
@@ -76,7 +76,8 @@ function toSkill(row, { includeInstalled = false, includeSchema = false } = {})
content_preview: hasContent ? row.content.slice(0, 280) : null,
};
if (includeInstalled) skill.installed = !!row.installed;
- if (includeSchema) skill.schema_json = row.schema_json;
+ if (includeSchema) skill.schema_json = row.schema_json ?? null;
+ if (includeContent) skill.content = hasContent ? row.content : null;
return skill;
}
@@ -164,7 +165,16 @@ async function handleList(req, res) {
});
const hasMore = rows.length > limit;
- const skills = rows.slice(0, limit).map((r) => toSkill(r, { includeInstalled: userId != null }));
+ // The caller's own installed set (`?installed=true`) returns the full
+ // payload (content + schema_json) so clients can hydrate an agent from one
+ // request. Public browse lists stay slim: preview + has_content only.
+ const skills = rows.slice(0, limit).map((r) =>
+ toSkill(r, {
+ includeInstalled: userId != null,
+ includeSchema: installedOnly,
+ includeContent: installedOnly,
+ }),
+ );
const cacheHeaders = userId
? {}
@@ -195,6 +205,7 @@ function runListQuery(p) {
SELECT
ms.id, ms.name, ms.slug, ms.description, ms.category, ms.tags,
ms.install_count, ms.created_at, ms.author_id, ms.price_per_call_usd, ms.content,
+ CASE WHEN ${installedOnly} THEN ms.schema_json END AS schema_json,
u.display_name AS author_display_name,
ROUND(COALESCE(AVG(sr.rating), 0)::numeric, 1)::float AS avg_rating,
COUNT(sr.rating)::int AS rating_count,
@@ -239,6 +250,7 @@ function runListQuery(p) {
SELECT
ms.id, ms.name, ms.slug, ms.description, ms.category, ms.tags,
ms.install_count, ms.created_at, ms.author_id, ms.price_per_call_usd, ms.content,
+ CASE WHEN ${installedOnly} THEN ms.schema_json END AS schema_json,
u.display_name AS author_display_name,
ROUND(COALESCE(AVG(sr.rating), 0)::numeric, 1)::float AS avg_rating,
COUNT(sr.rating)::int AS rating_count,
@@ -282,7 +294,8 @@ function runListQuery(p) {
return sql`
SELECT
ms.id, ms.name, ms.slug, ms.description, ms.category, ms.tags,
- ms.install_count, ms.created_at, ms.author_id, ms.price_per_call_usd,
+ ms.install_count, ms.created_at, ms.author_id, ms.price_per_call_usd, ms.content,
+ CASE WHEN ${installedOnly} THEN ms.schema_json END AS schema_json,
u.display_name AS author_display_name,
ROUND(COALESCE(AVG(sr.rating), 0)::numeric, 1)::float AS avg_rating,
COUNT(sr.rating)::int AS rating_count,
diff --git a/data/changelog.json b/data/changelog.json
index b6c8760d7..0f1ae7b8a 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,15 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-07-21",
+ "title": "Marketplace: submitting an agent no longer means typing a form",
+ "summary": "The Submit Agent flow on /marketplace is now a chooser instead of a wall of text fields. The primary path sends you to the guided agent builder (3D avatar, persona, publish); a second path lists the agents you already have, with drafts publishable in one click right from the dialog; the old manual form and JSON import stay available behind an Advanced toggle. The featured hero is more compact so search and listings are visible without scrolling, the signed-out My Agents view got a proper call to action, and related agents on detail pages now show their 3D thumbnails.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/marketplace"
+ },
{
"date": "2026-07-20",
"title": "hood-traders gains an LLM-piloted strategy, hood-alerts now posts to X",
@@ -15185,6 +15194,16 @@
"improvement"
],
"link": "/sniper/experiments"
+ },
+ {
+ "date": "2026-07-21",
+ "title": "Installing a marketplace skill now actually teaches your agent",
+ "summary": "Skills from the marketplace used to install into the void: you clicked Install, a badge flipped, and nothing changed. Now every knowledge skill you install loads its playbook into your agent's context in every signed-in chat, so an install visibly changes how your agent answers (install whale-wallet-tracking and ask about a token's whales to see it). Skill pages also explain what installing does up front and, once installed, hand you a 'Chat with your agent' shortcut. Developers can pull their full installed set, playbooks included, from GET /api/skills?installed=true.",
+ "tags": [
+ "feature",
+ "improvement"
+ ],
+ "link": "/marketplace?tab=skills"
}
]
}
diff --git a/docs/skills.md b/docs/skills.md
index 899d275a4..ce7a6a046 100644
--- a/docs/skills.md
+++ b/docs/skills.md
@@ -704,6 +704,24 @@ For IPFS publishing, the CID of the directory becomes the stable URI. Agents can
---
+## Marketplace skills: install once, applied in every chat
+
+Alongside URI-addressed bundles, the platform hosts a community catalog at [/marketplace?tab=skills](https://three.ws/marketplace?tab=skills). A marketplace skill is a database-backed record with a description, category, tags, ratings, and either:
+
+- **content**: a markdown playbook (the equivalent of a standalone `SKILL.md`): analysis frameworks, trading checklists, integration guides. This is the common kind.
+- **schema_json**: a JSON tool-schema pack for agents that bring their own executor.
+
+Installing is free and instant (`POST /api/skills/:id/install`, sign-in required; `DELETE` uninstalls). What an install *does*:
+
+- **Knowledge skills load into your chats.** `/api/chat` reads your installed skills at request time (`api/_lib/installed-skills.js`) and injects their playbooks into the system prompt, so your agent follows them anywhere you chat signed-in on three.ws (the `/app` workspace included). Budgets keep prompts sane: newest 8 installs, 6k chars per skill, 24k total. Each reply's SSE `done` event lists the slugs that were in context as `skills_applied`.
+- **Your installed set is one API call away.** `GET /api/skills?installed=true` (authed) returns the full payload, `content` and `schema_json` included, so an external agent, MCP client, or script can hydrate itself from your library.
+
+Paid skills price per *call*, not per install: the detail page shows an x402 endpoint (`GET /api/x402/skill-call?skill=<slug>`) any wallet can pay in USDC on Base, settling to the author.
+
+Publish your own from the marketplace ("Publish a Skill") or `POST /api/skills` with `{ name, slug, description, category, tags, content }` (or `schema_json`).
+
+---
+
## Versioning
- `spec: "skill/0.1"` — the skill bundle format version.
diff --git a/docs/ux-flows/06-marketplace-skills.md b/docs/ux-flows/06-marketplace-skills.md
index b583dd2cc..e0bcc0d26 100644
--- a/docs/ux-flows/06-marketplace-skills.md
+++ b/docs/ux-flows/06-marketplace-skills.md
@@ -135,12 +135,12 @@ Routing facts confirmed in `vercel.json`:
3. (optional) User searches → `skillsState.q` → refetch; or toggles Free/Paid (client-side `isPaidSkill`).
4. (optional) User scrolls → cursor pagination appends more cards.
5. User clicks a card → `/marketplace/skills/:id` → `GET /api/skills/:id` renders the detail panel (header, meta pills, description, tool schemas, full content, related skills).
- 6. User clicks "Install" → `toggleSkillInstall()` POSTs `/api/skills/:id/install` (DELETE to remove); 401 → login redirect; on success the detail + grid refetch and the button flips to "Installed ✓ — Remove".
+ 6. User clicks "Install" → `toggleSkillInstall()` POSTs `/api/skills/:id/install` (DELETE to remove); 401 → login redirect; on success the detail + grid refetch, the button flips to "Installed ✓ — Remove", and the "what next" panel (`#skill-detail-next`) appears: knowledge skills get a "Chat with your agent →" CTA to `/app`, schema-only packs get the `GET /api/skills?installed=true` retrieval hint. Pre-install, `#skill-detail-how` explains what installing does.
7. (optional) User rates 1–5 stars → `POST /api/skills/:id/rate { rating }` → detail refetches with updated counts.
8. (optional, paid skills) Detail shows an x402 panel: endpoint `GET /api/x402/skill-call?skill=:slug`, price `$X.XXX/call`, and a copy-paste `@three-ws/x402-fetch` snippet — developers pay per call from their own wallet; the server settles to the author.
- **Decision points / branches:** free vs paid (paid = x402 per-call, not an install purchase); installed vs not; authed vs anon (install/rate gated). Marketplace skills (community tool packs with schema/content) are distinct from built-in agent skills in `src/agent-skills*.js`.
- **External calls / dependencies:** `/api/skills`, `/api/skills/categories`, `/api/skills/:id`, `/api/skills/:id/install` (POST/DELETE), `/api/skills/:id/rate`, `/api/x402/skill-call` (per-call payment), `/api/creators/:id` (author modal).
-- **Success state:** Skill installed (flips to "Installed ✓"), rating recorded, x402 snippet copyable; installs reflected on the user's agents.
+- **Success state:** Skill installed (flips to "Installed ✓" + the what-next panel), rating recorded, x402 snippet copyable. Installs take effect at chat time: `/api/chat` loads the signed-in user's installed knowledge skills (`api/_lib/installed-skills.js`, newest 8, content budget 24k chars) into the system prompt and reports them as `skills_applied` in the SSE `done` event; `GET /api/skills?installed=true` returns the full payload (content + schema_json) for external agents.
- **Empty / error states:** "No skills found" with Clear-filters / Publish-a-Skill CTAs; `renderErrorState('skills')` with retry; install button restores text + re-enables on error; auth redirect on 401.
- **Step count:** 3 required (+5 optional)
diff --git a/pages/marketplace.html b/pages/marketplace.html
index 319d5e07c..9db550f6e 100644
--- a/pages/marketplace.html
+++ b/pages/marketplace.html
@@ -3829,7 +3829,7 @@
<div class="market-mine-head">
<h2 class="market-section-heading" data-i18n="marketplace.skills_marketplace">Skills Marketplace</h2>
<span class="market-mine-sub" id="skills-subtitle"
- data-i18n="marketplace.browse_capabilities_you_can_unlock_or_fork">Browse capabilities you can unlock or fork</span
+ data-i18n="marketplace.skills_subtitle_install">Install a skill and your agent follows its playbook in every signed-in chat</span
>
</div>
<input
@@ -4197,6 +4197,23 @@
hidden
></button>
</div>
+ <p class="skill-detail-how" id="skill-detail-how" hidden>
+ Installing adds this skill to your account. Your agent reads its
+ playbook in every signed-in chat on three.ws and applies it whenever
+ the conversation is in its domain.
+ </p>
+ <div class="skill-detail-next" id="skill-detail-next" aria-live="polite" hidden>
+ <div class="skill-detail-next-head">
+ <span class="skill-detail-next-check" aria-hidden="true">✓</span>
+ <strong data-i18n="marketplace.skill_installed_title">Your agent has this skill</strong>
+ </div>
+ <p class="skill-detail-next-desc" id="skill-detail-next-desc">
+ Its playbook now loads into every chat you have while signed in.
+ Ask your agent something in this skill's domain and the reply
+ follows it.
+ </p>
+ <a class="skill-detail-next-cta" id="skill-detail-next-chat" href="/app" data-i18n="marketplace.skill_installed_cta">Chat with your agent →</a>
+ </div>
<section class="tool-detail-block" id="skill-detail-rating-wrap" hidden>
<h2 class="tool-detail-block-title" data-i18n="marketplace.rate_this_skill">Rate this skill</h2>
<div id="skill-detail-rating" class="market-skill-rating"></div>
@@ -4504,6 +4521,36 @@
</button>
</div>
+ <a class="market-submit-path" id="market-submit-builder" href="/create-agent">
+ <span class="msp-icon" aria-hidden="true">✦</span>
+ <span class="msp-copy">
+ <strong data-i18n="marketplace.submit_builder_title">Create a new agent</strong>
+ <span data-i18n="marketplace.submit_builder_desc"
+ >Guided builder: pick a 3D avatar, write the persona, publish. About two minutes.</span
+ >
+ </span>
+ <span class="msp-arrow" aria-hidden="true">→</span>
+ </a>
+
+ <section class="market-submit-mine" aria-labelledby="msm-title">
+ <h3 class="msm-title" id="msm-title" data-i18n="marketplace.submit_publish_existing">
+ Or publish one you already have
+ </h3>
+ <div class="msm-list" id="msm-list" aria-live="polite"></div>
+ </section>
+
+ <button
+ type="button"
+ id="market-quickform-toggle"
+ class="market-import-btn"
+ aria-expanded="false"
+ aria-controls="market-quickform"
+ data-i18n="marketplace.submit_manual_toggle"
+ >
+ Advanced: type the details manually ↓
+ </button>
+
+ <div id="market-quickform" hidden>
<div class="market-modal-import">
<button type="button" id="market-import-toggle" class="market-import-btn" data-i18n="marketplace.import_from_json">
Import from JSON ↓
@@ -4646,6 +4693,7 @@
</button>
</div>
</form>
+ </div>
</div>
</div>
diff --git a/public/changelog.json b/public/changelog.json
index 2bd79c551..33ccd564a 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-21T03:42:49.620Z",
+ "generated_at": "2026-07-21T07:40:34.738Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -16,6 +16,38 @@
"launch"
]
},
+ {
+ "date": "2026-07-21",
+ "type": "update",
+ "title": "Installing a marketplace skill now actually teaches your agent",
+ "summary": "Skills from the marketplace used to install into the void: you clicked Install, a badge flipped, and nothing changed. Now every knowledge skill you install loads its playbook into your agent's context in every signed-in chat, so an install visibly changes how your agent answers (install whale-wallet-tracking and ask about a token's whales to see it). Skill pages also explain what installing does up front and, once installed, hand you a 'Chat with your agent' shortcut. Developers can pull their full installed set, playbooks included, from GET /api/skills?installed=true.",
+ "link": "/marketplace?tab=skills",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-07-21",
+ "type": "update",
+ "title": "Marketplace: submitting an agent no longer means typing a form",
+ "summary": "The Submit Agent flow on /marketplace is now a chooser instead of a wall of text fields. The primary path sends you to the guided agent builder (3D avatar, persona, publish); a second path lists the agents you already have, with drafts publishable in one click right from the dialog; the old manual form and JSON import stay available behind an Advanced toggle. The featured hero is more compact so search and listings are visible without scrolling, the signed-out My Agents view got a proper call to action, and related agents on detail pages now show their 3D thumbnails.",
+ "link": "/marketplace",
+ "tags": [
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-07-21",
+ "type": "update",
+ "title": "Sniper Experiments: every wallet and every decision, in the open",
+ "summary": "The /sniper/experiments scoreboard now shows each strategy's live wallet: its address, a Solscan link, and its real-time SOL balance, plus the shared master wallet that auto-funds the fleet. Every arm also links straight to its Reasoning Ledger, a tamper-evident, on-chain-anchored record of every single buy decision: the exact market data and rationale the agent acted on at entry, and once the trade closes, the real outcome (win or loss, by how much). Nothing is hidden or summarized away; wins and losses are published with the same detail.",
+ "link": "/sniper/experiments",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-07-21",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 9fb3a7ff0..4063d5b85 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -14,6 +14,30 @@
<category>launch</category>
<description>three.ws is a member of the NVIDIA Inception program: what the platform runs on NVIDIA today, what membership adds (GPU credits, ACE/NIM migration, ecosystem access), and who is building it.</description>
</item>
+ <item>
+ <title>Installing a marketplace skill now actually teaches your agent</title>
+ <link>https://three.ws/marketplace?tab=skills</link>
+ <guid isPermaLink="false">2026-07-21:Installing a marketplace skill now actually teaches your agent</guid>
+ <pubDate>Tue, 21 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Skills from the marketplace used to install into the void: you clicked Install, a badge flipped, and nothing changed. Now every knowledge skill you install loads its playbook into your agent's context in every signed-in chat, so an install visibly changes how your agent answers (install whale-wallet-tracking and ask about a token's whales to see it). Skill pages also explain what installing does up front and, once installed, hand you a 'Chat with your agent' shortcut. Developers can pull their full installed set, playbooks included, from GET /api/skills?installed=true.</description>
+ </item>
+ <item>
+ <title>Marketplace: submitting an agent no longer means typing a form</title>
+ <link>https://three.ws/marketplace</link>
+ <guid isPermaLink="false">2026-07-21:Marketplace: submitting an agent no longer means typing a form</guid>
+ <pubDate>Tue, 21 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The Submit Agent flow on /marketplace is now a chooser instead of a wall of text fields. The primary path sends you to the guided agent builder (3D avatar, persona, publish); a second path lists the agents you already have, with drafts publishable in one click right from the dialog; the old manual form and JSON import stay available behind an Advanced toggle. The featured hero is more compact so search and listings are visible without scrolling, the signed-out My Agents view got a proper call to action, and related agents on detail pages now show their 3D thumbnails.</description>
+ </item>
+ <item>
+ <title>Sniper Experiments: every wallet and every decision, in the open</title>
+ <link>https://three.ws/sniper/experiments</link>
+ <guid isPermaLink="false">2026-07-21:Sniper Experiments: every wallet and every decision, in the open</guid>
+ <pubDate>Tue, 21 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The /sniper/experiments scoreboard now shows each strategy's live wallet: its address, a Solscan link, and its real-time SOL balance, plus the shared master wallet that auto-funds the fleet. Every arm also links straight to its Reasoning Ledger, a tamper-evident, on-chain-anchored record of every single buy decision: the exact market data and rationale the agent acted on at entry, and once the trade closes, the real outcome (win or loss, by how much). Nothing is hidden or summarized away; wins and losses are published with the same detail.</description>
+ </item>
<item>
<title>three.ws joins the NVIDIA Inception program</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index a5784e6c6..5558a53f1 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-21T03:42:49.606Z",
+ "generated_at": "2026-07-21T07:40:34.724Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/locales/en.json b/public/locales/en.json
index 6ae790f8c..8f1dbdbad 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -10855,9 +10855,12 @@
"show_only_paid_listings_title": "Show only paid listings",
"similar_agents": "Similar Agents",
"similar_avatars": "Similar avatars",
+ "skill_installed_cta": "Chat with your agent →",
+ "skill_installed_title": "Your agent has this skill",
"skill_not_found": "Skill not found",
"skills": "<span class=\"ico\">≡</span> <span>Skills</span>",
"skills_marketplace": "Skills Marketplace",
+ "skills_subtitle_install": "Install a skill and your agent follows its playbook in every signed-in chat",
"skip_to_content": "Skip to content",
"solana": "Solana",
"sort_marketplace_results": "Sort marketplace results",
@@ -10866,6 +10869,10 @@
"studio": "<span class=\"ico\">◆</span> <span>Studio</span>",
"submit_agent": "+ Submit Agent",
"submit_an_agent": "Submit an Agent",
+ "submit_builder_desc": "Guided builder: pick a 3D avatar, write the persona, publish. About two minutes.",
+ "submit_builder_title": "Create a new agent",
+ "submit_manual_toggle": "Advanced: type the details manually ↓",
+ "submit_publish_existing": "Or publish one you already have",
"submit_review": "Submit review",
"subscribe_for_exclusive_perks": "Subscribe for exclusive perks",
"system_prompt": "System Prompt <span class=\"req\">*</span>",
diff --git a/public/marketplace.css b/public/marketplace.css
index c4e57fae4..285e8f0ef 100644
--- a/public/marketplace.css
+++ b/public/marketplace.css
@@ -778,6 +778,72 @@ body.market-page > header {
}
.tool-detail-cta:hover { opacity: 0.88; }
.tool-detail-cta.installed { background: var(--surface-2); color: var(--ink); border: 1px solid var(--stroke-strong); }
+
+/* What installing does (pre-install) + where to go next (post-install) */
+.skill-detail-how {
+ margin: var(--space-md) 0 0;
+ font-size: 13px;
+ line-height: 1.6;
+ color: var(--ink-dim);
+ max-width: 62ch;
+}
+.skill-detail-next {
+ margin-top: var(--space-md);
+ padding: var(--space-md) var(--space-lg);
+ border-radius: var(--radius-md);
+ background: color-mix(in srgb, var(--success, #4ade80) 8%, transparent);
+ border: 1px solid color-mix(in srgb, var(--success, #4ade80) 28%, transparent);
+ animation: skill-next-in 0.25s ease-out;
+}
+@keyframes skill-next-in {
+ from { opacity: 0; transform: translateY(4px); }
+ to { opacity: 1; transform: none; }
+}
+.skill-detail-next-head {
+ display: flex;
+ align-items: center;
+ gap: var(--space-sm);
+ font-size: 14px;
+ color: var(--ink);
+}
+.skill-detail-next-check {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ background: color-mix(in srgb, var(--success, #4ade80) 18%, transparent);
+ color: var(--success, #4ade80);
+ font-size: 12px;
+ font-weight: 700;
+ flex: 0 0 auto;
+}
+.skill-detail-next-desc {
+ margin: var(--space-sm) 0 0;
+ font-size: 13px;
+ line-height: 1.6;
+ color: var(--ink-dim);
+ max-width: 62ch;
+}
+.skill-detail-next-cta {
+ display: inline-block;
+ margin-top: var(--space-md);
+ padding: var(--space-sm) var(--space-lg);
+ border-radius: var(--radius-md);
+ background: var(--ink);
+ color: var(--btn-primary-fg, #0a0a0a);
+ font-size: 14px;
+ font-weight: 700;
+ text-decoration: none;
+ transition: opacity 0.15s;
+}
+.skill-detail-next-cta:hover { opacity: 0.88; }
+.skill-detail-next-cta:focus-visible {
+ outline: 2px solid var(--accent, #00d9ff);
+ outline-offset: 2px;
+}
+.skill-detail-next-cta:active { opacity: 0.8; }
.market-tool-detail .btn-secondary {
display: inline-flex;
align-items: center;
@@ -1892,6 +1958,12 @@ body.market-page > header {
flex-shrink: 0;
}
+.related-card .av.av-img {
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+}
+
.related-card .name {
font-size: 13px;
font-weight: 600;
@@ -2435,6 +2507,210 @@ body.market-page > header {
border-radius: var(--radius-sm);
}
+/* ── Submit modal: choose-a-path layout ─────────────────────────────── */
+
+.market-submit-path {
+ display: flex;
+ align-items: center;
+ gap: var(--space-md);
+ padding: var(--space-md);
+ background: var(--ink);
+ color: var(--btn-primary-fg, #0a0a0a);
+ border-radius: var(--radius-md);
+ text-decoration: none;
+ transition:
+ transform 0.15s ease,
+ box-shadow 0.15s ease;
+}
+
+.market-submit-path:hover,
+.market-submit-path:focus-visible {
+ transform: translateY(-1px);
+ box-shadow: 0 6px 24px rgba(255, 255, 255, 0.08);
+}
+
+.market-submit-path .msp-icon {
+ font-size: 20px;
+ flex-shrink: 0;
+}
+
+.market-submit-path .msp-copy {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ min-width: 0;
+}
+
+.market-submit-path .msp-copy strong {
+ font-size: 14px;
+ font-weight: 700;
+}
+
+.market-submit-path .msp-copy span {
+ font-size: 12px;
+ opacity: 0.75;
+ line-height: 1.4;
+}
+
+.market-submit-path .msp-arrow {
+ margin-left: auto;
+ font-size: 18px;
+ flex-shrink: 0;
+ transition: transform 0.15s ease;
+}
+
+.market-submit-path:hover .msp-arrow {
+ transform: translateX(3px);
+}
+
+.market-submit-mine .msm-title {
+ margin: 0 0 var(--space-xs);
+ font-size: 12px;
+ font-weight: 600;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--ink-dim);
+}
+
+.msm-list {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-xs);
+ max-height: 264px;
+ overflow-y: auto;
+}
+
+.msm-row {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: var(--space-sm);
+ padding: var(--space-xs) var(--space-sm);
+ background: var(--surface-2);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-md);
+}
+
+.msm-row:hover {
+ border-color: var(--stroke-strong);
+}
+
+.msm-thumb {
+ width: 36px;
+ height: 36px;
+ border-radius: var(--radius-sm);
+ background: var(--surface-1) center/cover no-repeat;
+ display: grid;
+ place-items: center;
+ font-size: 15px;
+ color: var(--ink-dim);
+ flex-shrink: 0;
+}
+
+.msm-meta {
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 1px;
+}
+
+.msm-name {
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--ink);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.msm-status {
+ font-size: 11px;
+ color: var(--ink-dim);
+}
+
+.msm-status.live {
+ color: var(--success, #4ade80);
+}
+
+.msm-action {
+ margin-left: auto;
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ gap: var(--space-2xs);
+}
+
+.msm-category {
+ background: var(--surface-1);
+ border: 1px solid var(--stroke-strong);
+ color: var(--ink);
+ border-radius: var(--radius-sm);
+ font-size: 11px;
+ padding: 4px 6px;
+ max-width: 110px;
+}
+
+.msm-btn {
+ background: var(--ink);
+ color: var(--btn-primary-fg, #0a0a0a);
+ border: 0;
+ border-radius: var(--radius-sm);
+ padding: 6px 12px;
+ font-size: 12px;
+ font-weight: 600;
+ cursor: pointer;
+}
+
+.msm-btn:hover {
+ transform: translateY(-1px);
+}
+
+.msm-btn[disabled] {
+ opacity: 0.6;
+ cursor: default;
+ transform: none;
+}
+
+.msm-btn.sec {
+ background: transparent;
+ color: var(--ink);
+ border: 1px solid var(--stroke-strong);
+}
+
+.msm-note {
+ font-size: 12px;
+ color: var(--ink-dim);
+ padding: var(--space-sm);
+ background: var(--surface-2);
+ border: 1px dashed var(--stroke);
+ border-radius: var(--radius-md);
+ line-height: 1.5;
+}
+
+.msm-note .msm-note-cta {
+ color: var(--ink);
+ font-weight: 600;
+ cursor: pointer;
+ background: none;
+ border: 0;
+ padding: 0;
+ font-size: 12px;
+ text-decoration: underline;
+}
+
+.msm-error {
+ flex-basis: 100%;
+ font-size: 12px;
+ color: var(--danger);
+ padding: var(--space-2xs) 0;
+}
+
+#market-quickform {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-md);
+}
+
.market-modal-import {
display: flex;
flex-direction: column;
@@ -3110,19 +3386,22 @@ body.market-page > header {
.market-hero {
display: grid;
- grid-template-columns: minmax(280px, 480px) 1fr;
+ grid-template-columns: minmax(280px, 440px) 1fr;
gap: var(--space-lg);
- padding: var(--space-lg) var(--space-lg);
+ padding: var(--space-md) var(--space-lg);
border-bottom: 1px solid var(--stroke);
background:
radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.04), transparent 60%),
radial-gradient(ellipse at bottom left, rgba(253, 224, 71, 0.03), transparent 50%),
#000;
- min-height: 360px;
+ min-height: 300px;
position: relative;
overflow: hidden;
}
+/* 4/3 stage (not square): keeps the featured avatar prominent while leaving
+ the search toolbar and the first row of listings visible on a 900px-tall
+ viewport — the marketplace should show the market above the fold. */
.market-hero-stage {
position: relative;
border-radius: var(--radius-card);
@@ -3131,9 +3410,9 @@ body.market-page > header {
var(--surface-1);
border: 1px solid var(--stroke);
overflow: hidden;
- min-height: 320px;
- aspect-ratio: 1 / 1;
- max-width: 480px;
+ min-height: 280px;
+ aspect-ratio: 4 / 3;
+ max-width: 440px;
}
.market-hero-stage model-viewer {
diff --git a/robinhood/hood-alerts/Dockerfile b/robinhood/hood-alerts/Dockerfile
index a61ed46de..dc7c1c931 100644
--- a/robinhood/hood-alerts/Dockerfile
+++ b/robinhood/hood-alerts/Dockerfile
@@ -4,50 +4,31 @@
# server (/healthz + premium x402), and both bots (env-gated). Min-instances 1
# on Cloud Run; this is a service, not a job.
#
-# The build context MUST be the parent `robinhood/` directory so the local
-# file: siblings (robinhood-chain-sdk, hoodkit, hood402) resolve:
+# Standalone build: hoodchain/hoodkit/hood402 are ordinary published npm
+# dependencies (see package.json) — no monorepo siblings, no special build
+# context. Build from this directory:
#
-# docker build -f hood-alerts/Dockerfile -t hood-alerts . # run from robinhood/
-#
-# Once those packages are published to npm, switch the file: specs in
-# package.json to the published versions and the app builds from its own dir.
+# docker build -t hood-alerts .
# ---- build: full install (better-sqlite3 needs a toolchain) + tsc ----
FROM node:22-slim AS build
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
-WORKDIR /build
-# Prebuilt sibling packages (manifest + dist) for the file: links.
-COPY robinhood-chain-sdk/package.json ./robinhood-chain-sdk/package.json
-COPY robinhood-chain-sdk/dist ./robinhood-chain-sdk/dist
-COPY hoodkit/package.json ./hoodkit/package.json
-COPY hoodkit/dist ./hoodkit/dist
-COPY hood402/package.json ./hood402/package.json
-COPY hood402/dist ./hood402/dist
-WORKDIR /build/hood-alerts
-COPY hood-alerts/package.json ./package.json
-# --install-links copies the file: siblings into node_modules as real packages
-# (not symlinks), so their `viem` dependency hoists and resolves at runtime.
-RUN npm install --install-links --no-audit --no-fund
-COPY hood-alerts/tsconfig.json ./tsconfig.json
-COPY hood-alerts/src ./src
-COPY hood-alerts/scripts ./scripts
+WORKDIR /app
+COPY package.json package-lock.json ./
+RUN npm install --no-audit --no-fund
+COPY tsconfig.json ./tsconfig.json
+COPY src ./src
+COPY scripts ./scripts
RUN npm run build
# ---- prod-deps: runtime node_modules only (no tsc/tsx/vitest) ----
FROM node:22-slim AS prod-deps
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
-WORKDIR /build
-COPY robinhood-chain-sdk/package.json ./robinhood-chain-sdk/package.json
-COPY robinhood-chain-sdk/dist ./robinhood-chain-sdk/dist
-COPY hoodkit/package.json ./hoodkit/package.json
-COPY hoodkit/dist ./hoodkit/dist
-COPY hood402/package.json ./hood402/package.json
-COPY hood402/dist ./hood402/dist
-WORKDIR /build/hood-alerts
-COPY hood-alerts/package.json ./package.json
-RUN npm install --omit=dev --install-links --no-audit --no-fund
+WORKDIR /app
+COPY package.json package-lock.json ./
+RUN npm install --omit=dev --no-audit --no-fund
# ---- runtime ----
FROM node:22-slim AS runtime
@@ -55,9 +36,9 @@ ENV NODE_ENV=production
ENV PORT=8080
ENV HOOD_ALERTS_DB=/data/hood-alerts.db
WORKDIR /app
-COPY --from=prod-deps /build/hood-alerts/node_modules ./node_modules
-COPY --from=build /build/hood-alerts/dist ./dist
-COPY --from=build /build/hood-alerts/package.json ./package.json
+COPY --from=prod-deps /app/node_modules ./node_modules
+COPY --from=build /app/dist ./dist
+COPY --from=build /app/package.json ./package.json
# SQLite lives on a mounted volume so subscriptions survive restarts.
RUN mkdir -p /data
VOLUME ["/data"]
diff --git a/robinhood/robinhood-mcp b/robinhood/robinhood-mcp
index 074da11ab..d450fd26f 160000
--- a/robinhood/robinhood-mcp
+++ b/robinhood/robinhood-mcp
@@ -1 +1 @@
-Subproject commit 074da11ab01bd1cc3721ae78de2c049d061678c4
+Subproject commit d450fd26f67f401419bef1fe72e89ad862cd25c1
diff --git a/scripts/changelog-gaps.mjs b/scripts/changelog-gaps.mjs
index be35e8885..91c10c5bb 100644
--- a/scripts/changelog-gaps.mjs
+++ b/scripts/changelog-gaps.mjs
@@ -92,7 +92,14 @@ function overlap(a, b) {
// --- load data --------------------------------------------------------------
const entries = JSON.parse(readFileSync(resolve(root, 'data/changelog.json'), 'utf8')).entries;
-const entryTokens = entries.map((e) => ({ date: e.date, tok: tokens(`${e.title} ${e.summary}`) }));
+// New pages get their own changelog entry automatically from their `added`
+// date (see data/pages.json's $comment) — fold those in as covered too, or
+// every page-launch commit reads as a gap even though it's already logged.
+const pageLaunches = JSON.parse(readFileSync(resolve(root, 'data/pages.json'), 'utf8')).sections
+ .flatMap((s) => s.pages || [])
+ .filter((p) => p.added)
+ .map((p) => ({ date: p.added, title: p.title, summary: p.description }));
+const entryTokens = [...entries, ...pageLaunches].map((e) => ({ date: e.date, tok: tokens(`${e.title} ${e.summary}`) }));
function daysApart(a, b) {
return Math.abs((new Date(a) - new Date(b)) / 86400000);
diff --git a/src/marketplace.js b/src/marketplace.js
index c8a51ab71..88f72cfba 100644
--- a/src/marketplace.js
+++ b/src/marketplace.js
@@ -2548,6 +2548,31 @@ function renderSkillDetail(skill) {
installBtn.onclick = () => toggleSkillInstall(skill.id);
}
+ // What installing does, and where to go next. Knowledge skills (content)
+ // load into the signed-in user's /api/chat system prompt, so the payoff is
+ // a conversation with their agent; schema-only packs are consumed by
+ // agents through the skills API instead, so the CTA stays honest per kind.
+ const isKnowledgeSkill = Boolean(skill.content || skill.has_content);
+ const howEl = $('skill-detail-how');
+ if (howEl) {
+ howEl.textContent = isKnowledgeSkill
+ ? 'Installing adds this skill to your account. Your agent reads its playbook in every signed-in chat on three.ws and applies it whenever the conversation is in its domain.'
+ : 'Installing saves this tool pack to your account. Fetch it from the skills API (GET /api/skills?installed=true) and hand its tool definitions to any agent you run.';
+ howEl.hidden = !!skill.installed;
+ }
+ const nextEl = $('skill-detail-next');
+ if (nextEl) {
+ nextEl.hidden = !skill.installed;
+ const nextDesc = $('skill-detail-next-desc');
+ if (nextDesc) {
+ nextDesc.textContent = isKnowledgeSkill
+ ? `Its playbook now loads into every chat you have while signed in. Ask your agent something ${skill.category ? `about ${skill.category}` : 'in its domain'} and the reply follows it.`
+ : 'This tool pack is saved to your account. Fetch it with GET /api/skills?installed=true to wire its tools into your own agent.';
+ }
+ const nextChat = $('skill-detail-next-chat');
+ if (nextChat) nextChat.hidden = !isKnowledgeSkill;
+ }
+
// Share.
const shareBtn = $('skill-detail-share');
if (shareBtn) shareBtn.onclick = () => shareCurrentPage(shareBtn, `${skill.name} — three.ws skill`, skill.description || 'Check out this agent skill on three.ws');
@@ -2711,6 +2736,10 @@ async function toggleSkillInstall(id) {
skillsState.loaded = false;
await loadSkillDetail(id);
loadSkillsTab(true);
+ // A fresh install reveals the "what next" panel; make sure it's on screen.
+ if (!wasInstalled) {
+ $('skill-detail-next')?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
+ }
} catch (err) {
log.error('[marketplace] skill install', err);
btn.disabled = false;
@@ -4316,12 +4345,16 @@ async function loadMine(force = false) {
try {
const r = await fetch(`${API}/marketplace/agents/mine`, { credentials: 'include' });
if (r.status === 401) {
- grid.innerHTML = `<div class="market-empty-cta">
- <h3>Sign in to see your agents</h3>
- <p>Your published and draft agents will appear here.</p>
- <button id="mine-signin">Sign in</button>
- </div>`;
- $('mine-signin')?.addEventListener('click', () => {
+ grid.innerHTML = emptyStateHTML({
+ icon: '🤖',
+ title: 'Sign in to see your agents',
+ body: 'Your published agents and drafts live here — publish, price, and track them from one place.',
+ actions: [
+ { label: 'Sign in', id: 'mine-signin', primary: true },
+ { label: "What's an agent?", href: '/docs/agents-vs-avatars' },
+ ],
+ });
+ grid.querySelector('[data-sk-action="mine-signin"]')?.addEventListener('click', () => {
location.href = `/login?next=${encodeURIComponent(location.pathname + location.search)}`;
});
mineState.loading = false;
@@ -5402,7 +5435,11 @@ function renderSimilar(items) {
shown
.map(
(a) => `<div class="related-card" data-id="${a.id}">
- <div class="av">${initial(a.name)}</div>
+ ${
+ a.thumbnail_url
+ ? `<div class="av av-img" style="background-image:url('${escapeHtml(a.thumbnail_url)}')" role="img" aria-label="${escapeHtml(a.name || 'Agent')}"></div>`
+ : `<div class="av">${initial(a.name)}</div>`
+ }
<div style="min-width:0">
<div class="name">${escapeHtml(a.name || '')}</div>
<div class="desc">${escapeHtml(a.description || '')}</div>
@@ -6066,16 +6103,159 @@ function bindEvents() {
}
// ── Submit Modal ──────────────────────────────────────────────────────────
+//
+// Three paths, in order of how much work they ask of the user:
+// 1. "Create a new agent" → the /create-agent guided builder (primary).
+// 2. Publish an agent the user already has (drafts from the builder, forks,
+// imports) — fetched from /marketplace/agents/mine, one click to go live.
+// 3. An advanced manual form (+ LobeHub JSON import), collapsed by default.
function openSubmitModal() {
$('market-submit-overlay').hidden = false;
- $('sf-name').focus();
+ $('market-submit-builder')?.focus();
+ loadSubmitMine();
}
function closeSubmitModal() {
$('market-submit-overlay').hidden = true;
}
+const submitMine = { loading: false, items: null, authed: null };
+
+async function loadSubmitMine(force = false) {
+ const list = $('msm-list');
+ if (!list || submitMine.loading) return;
+ if (submitMine.items !== null && submitMine.authed !== null && !force) {
+ return renderSubmitMine();
+ }
+ submitMine.loading = true;
+ list.innerHTML = `<div class="msm-row" aria-hidden="true">
+ <div class="msm-thumb"></div>
+ <div class="msm-meta"><div class="msm-name" style="width:120px;background:var(--surface-1);border-radius:4px">&nbsp;</div></div>
+ </div>`;
+ try {
+ const r = await fetch(`${API}/marketplace/agents/mine`, { credentials: 'include' });
+ if (r.status === 401) {
+ submitMine.authed = false;
+ submitMine.items = [];
+ } else {
+ const j = await r.json().catch(() => ({}));
+ submitMine.authed = true;
+ submitMine.items = j?.data?.items ?? [];
+ }
+ } catch (err) {
+ log.error('[marketplace] submit mine', err);
+ submitMine.authed = null;
+ submitMine.items = null;
+ list.innerHTML = `<div class="msm-note">Couldn't load your agents.
+ <button type="button" class="msm-note-cta" id="msm-retry">Retry</button></div>`;
+ $('msm-retry')?.addEventListener('click', () => loadSubmitMine(true));
+ submitMine.loading = false;
+ return;
+ }
+ submitMine.loading = false;
+ renderSubmitMine();
+}
+
+function renderSubmitMine() {
+ const list = $('msm-list');
+ if (!list) return;
+
+ if (submitMine.authed === false) {
+ list.innerHTML = `<div class="msm-note">Sign in to see your agents here — drafts and
+ published agents both show up, ready to go live in one click.
+ <button type="button" class="msm-note-cta" id="msm-signin">Sign in</button></div>`;
+ $('msm-signin')?.addEventListener('click', () => {
+ location.href = `/login?next=${encodeURIComponent(location.pathname + location.search)}`;
+ });
+ return;
+ }
+
+ const items = submitMine.items || [];
+ if (!items.length) {
+ list.innerHTML = `<div class="msm-note">You don't have any agents yet.
+ The builder above walks you through your first one — avatar, persona, and all.</div>`;
+ return;
+ }
+
+ // Drafts first — they're the ones with a pending action.
+ const sorted = [...items].sort((a, b) => Number(a.is_published) - Number(b.is_published));
+ const categories = [...($('sf-category')?.options || [])]
+ .map((o) => o.value)
+ .filter(Boolean);
+
+ list.innerHTML = sorted
+ .map((a) => {
+ const thumb = a.thumbnail_url
+ ? `<div class="msm-thumb" style="background-image:url('${escapeHtml(a.thumbnail_url)}')"></div>`
+ : `<div class="msm-thumb">${escapeHtml(initial(a.name))}</div>`;
+ const status = a.is_published
+ ? '<span class="msm-status live">Published</span>'
+ : '<span class="msm-status">Draft</span>';
+ // The publish endpoint requires a category; drafts made outside the
+ // builder can lack one, so surface an inline picker only in that case.
+ const needsCategory = !a.is_published && !a.category;
+ const categorySelect = needsCategory
+ ? `<select class="msm-category" data-cat-for="${escapeHtml(a.id)}" aria-label="Category for ${escapeHtml(a.name || 'agent')}">
+ ${categories.map((c) => `<option value="${c}"${c === 'general' ? ' selected' : ''}>${c}</option>`).join('')}
+ </select>`
+ : '';
+ const action = a.is_published
+ ? `<button type="button" class="msm-btn sec" data-msm-view="${escapeHtml(a.id)}">View</button>`
+ : `${categorySelect}<button type="button" class="msm-btn" data-msm-publish="${escapeHtml(a.id)}">Publish</button>`;
+ return `<div class="msm-row" data-msm-id="${escapeHtml(a.id)}">
+ ${thumb}
+ <div class="msm-meta">
+ <span class="msm-name">${escapeHtml(a.name || 'Untitled agent')}</span>
+ ${status}
+ </div>
+ <div class="msm-action">${action}</div>
+ </div>`;
+ })
+ .join('');
+
+ list.querySelectorAll('[data-msm-view]').forEach((btn) => {
+ btn.addEventListener('click', () => {
+ closeSubmitModal();
+ navTo(`/marketplace/agents/${btn.dataset.msmView}`);
+ });
+ });
+ list.querySelectorAll('[data-msm-publish]').forEach((btn) => {
+ btn.addEventListener('click', () => publishExistingAgent(btn.dataset.msmPublish, btn));
+ });
+}
+
+async function publishExistingAgent(id, btn) {
+ const row = btn.closest('.msm-row');
+ const catSel = row?.querySelector(`[data-cat-for="${CSS.escape(id)}"]`);
+ btn.disabled = true;
+ btn.textContent = 'Publishing…';
+ row?.querySelector('.msm-error')?.remove();
+ try {
+ const body = catSel ? { category: catSel.value } : {};
+ const r = await fetch(`${API}/marketplace/agents/${id}/publish`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ credentials: 'include',
+ body: JSON.stringify(body),
+ });
+ const j = await r.json().catch(() => ({}));
+ if (!r.ok) throw new Error(j.error_description || 'Publish failed');
+ const item = (submitMine.items || []).find((a) => a.id === id);
+ if (item) item.is_published = true;
+ mineState.loaded = false;
+ renderSubmitMine();
+ loadList(true);
+ } catch (err) {
+ btn.disabled = false;
+ btn.textContent = 'Publish';
+ const errEl = document.createElement('div');
+ errEl.className = 'msm-error';
+ errEl.textContent = err.message;
+ row?.appendChild(errEl);
+ }
+}
+
// sf-price-rows state for the submit modal
const sfPriceRows = [];
@@ -6116,6 +6296,25 @@ function bindSubmit() {
$('market-submit-overlay').addEventListener('click', (e) => {
if (e.target === $('market-submit-overlay')) closeSubmitModal();
});
+ document.addEventListener('keydown', (e) => {
+ if (e.key === 'Escape' && !$('market-submit-overlay').hidden) closeSubmitModal();
+ });
+
+ // Advanced manual form, collapsed by default — the picker paths above cover
+ // the common cases; the form remains for hand-tuned or imported agents.
+ const quickToggle = $('market-quickform-toggle');
+ const quickForm = $('market-quickform');
+ if (quickToggle && quickForm) {
+ quickToggle.addEventListener('click', () => {
+ const open = quickForm.hidden;
+ quickForm.hidden = !open;
+ quickToggle.setAttribute('aria-expanded', String(open));
+ quickToggle.textContent = open
+ ? 'Advanced: type the details manually ↑'
+ : 'Advanced: type the details manually ↓';
+ if (open) $('sf-name').focus();
+ });
+ }
// Add skill price row in submit modal
$('sf-add-skill')?.addEventListener('click', () => {
@@ -6253,6 +6452,8 @@ function bindSubmit() {
}
sfPriceRows.length = 0;
+ mineState.loaded = false;
+ submitMine.items = null;
if (publish) {
closeSubmitModal();
loadList(true);
diff --git a/tests/installed-skills.test.js b/tests/installed-skills.test.js
new file mode 100644
index 000000000..f3c3798fa
--- /dev/null
+++ b/tests/installed-skills.test.js
@@ -0,0 +1,98 @@
+/**
+ * Installed marketplace skills → chat context (api/_lib/installed-skills.js).
+ *
+ * Installing a skill from /marketplace must actually change the user's agent:
+ * loadInstalledSkills pulls the user's installed knowledge skills and
+ * skillsPromptBlock renders them into the /api/chat system prompt under hard
+ * budgets, so a pile of huge skills can never crowd out the persona or the
+ * user's message. We mock only the DB boundary.
+ */
+
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+
+const H = vi.hoisted(() => ({ rows: [] }));
+
+vi.mock('../api/_lib/db.js', () => ({
+ sql: vi.fn(async () => H.rows),
+}));
+
+import { loadInstalledSkills, skillsPromptBlock } from '../api/_lib/installed-skills.js';
+import { sql } from '../api/_lib/db.js';
+
+beforeEach(() => {
+ H.rows = [];
+ vi.clearAllMocks();
+});
+
+describe('loadInstalledSkills', () => {
+ it('returns [] for anonymous callers without touching the DB', async () => {
+ expect(await loadInstalledSkills(null)).toEqual([]);
+ expect(await loadInstalledSkills(undefined)).toEqual([]);
+ expect(sql).not.toHaveBeenCalled();
+ });
+
+ it('maps rows to {slug, name, content}', async () => {
+ H.rows = [
+ { slug: 'whale-wallet-tracking', name: 'whale-wallet-tracking', content: '# Whale' },
+ { slug: 'defi-yield', name: 'DeFi Yield', content: '# Yield' },
+ ];
+ const skills = await loadInstalledSkills('00000000-0000-0000-0000-000000000001');
+ expect(skills).toEqual([
+ { slug: 'whale-wallet-tracking', name: 'whale-wallet-tracking', content: '# Whale' },
+ { slug: 'defi-yield', name: 'DeFi Yield', content: '# Yield' },
+ ]);
+ });
+});
+
+describe('skillsPromptBlock', () => {
+ it('returns empty string for no skills', () => {
+ expect(skillsPromptBlock([])).toBe('');
+ expect(skillsPromptBlock(null)).toBe('');
+ expect(skillsPromptBlock(undefined)).toBe('');
+ });
+
+ it('renders each skill under a slug header with the framing preamble', () => {
+ const block = skillsPromptBlock([
+ { slug: 'whale-wallet-tracking', name: 'Whale', content: 'Track whales.' },
+ { slug: 'defi-yield', name: 'Yield', content: 'Chase yield safely.' },
+ ]);
+ expect(block).toContain('Installed skills:');
+ expect(block).toContain('--- skill: whale-wallet-tracking ---\nTrack whales.');
+ expect(block).toContain('--- skill: defi-yield ---\nChase yield safely.');
+ });
+
+ it('clips a single oversized skill and marks the truncation', () => {
+ const block = skillsPromptBlock([
+ { slug: 'huge', name: 'Huge', content: 'x'.repeat(50000) },
+ ]);
+ expect(block.length).toBeLessThan(10000);
+ expect(block).toContain('[…skill truncated]');
+ });
+
+ it('bounds the whole block even across many large skills', () => {
+ const skills = Array.from({ length: 8 }, (_, i) => ({
+ slug: `s${i}`,
+ name: `S${i}`,
+ content: 'y'.repeat(6000),
+ }));
+ const block = skillsPromptBlock(skills);
+ // 24k content budget + headers/preamble slack.
+ expect(block.length).toBeLessThan(26000);
+ // The newest installs (front of the list) always make it in.
+ expect(block).toContain('--- skill: s0 ---');
+ });
+
+ it('drops trailing skills rather than including a sliver', () => {
+ const skills = [
+ { slug: 'a', name: 'A', content: 'a'.repeat(6000) },
+ { slug: 'b', name: 'B', content: 'b'.repeat(6000) },
+ { slug: 'c', name: 'C', content: 'c'.repeat(6000) },
+ { slug: 'd', name: 'D', content: 'd'.repeat(6000) },
+ { slug: 'e', name: 'E', content: 'e'.repeat(6000) },
+ ];
+ const block = skillsPromptBlock(skills);
+ expect(block).toContain('--- skill: d ---');
+ // e would only get a <500-char sliver, so it is omitted entirely.
+ expect(block).not.toContain('--- skill: e ---');
+ });
+});