myaiforone 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -0
- package/agents/_template/CLAUDE.md +18 -0
- package/agents/_template/agent.json +7 -0
- package/agents/platform/agentcreator/CLAUDE.md +300 -0
- package/agents/platform/appcreator/CLAUDE.md +158 -0
- package/agents/platform/gym/CLAUDE.md +486 -0
- package/agents/platform/gym/agent.json +40 -0
- package/agents/platform/gym/programs/agent-building/program.json +160 -0
- package/agents/platform/gym/programs/automations-mastery/program.json +129 -0
- package/agents/platform/gym/programs/getting-started/program.json +124 -0
- package/agents/platform/gym/programs/mcp-integrations/program.json +116 -0
- package/agents/platform/gym/programs/multi-model-strategy/program.json +115 -0
- package/agents/platform/gym/programs/prompt-engineering/program.json +136 -0
- package/agents/platform/gym/souls/alex.md +12 -0
- package/agents/platform/gym/souls/jordan.md +12 -0
- package/agents/platform/gym/souls/morgan.md +12 -0
- package/agents/platform/gym/souls/riley.md +12 -0
- package/agents/platform/gym/souls/sam.md +12 -0
- package/agents/platform/hub/CLAUDE.md +372 -0
- package/agents/platform/promptcreator/CLAUDE.md +130 -0
- package/agents/platform/skillcreator/CLAUDE.md +163 -0
- package/bin/cli.js +566 -0
- package/config.example.json +310 -0
- package/dist/agent-registry.d.ts +32 -0
- package/dist/agent-registry.d.ts.map +1 -0
- package/dist/agent-registry.js +144 -0
- package/dist/agent-registry.js.map +1 -0
- package/dist/channels/discord.d.ts +17 -0
- package/dist/channels/discord.d.ts.map +1 -0
- package/dist/channels/discord.js +114 -0
- package/dist/channels/discord.js.map +1 -0
- package/dist/channels/imessage.d.ts +23 -0
- package/dist/channels/imessage.d.ts.map +1 -0
- package/dist/channels/imessage.js +214 -0
- package/dist/channels/imessage.js.map +1 -0
- package/dist/channels/slack.d.ts +19 -0
- package/dist/channels/slack.d.ts.map +1 -0
- package/dist/channels/slack.js +167 -0
- package/dist/channels/slack.js.map +1 -0
- package/dist/channels/telegram.d.ts +19 -0
- package/dist/channels/telegram.d.ts.map +1 -0
- package/dist/channels/telegram.js +274 -0
- package/dist/channels/telegram.js.map +1 -0
- package/dist/channels/types.d.ts +44 -0
- package/dist/channels/types.d.ts.map +1 -0
- package/dist/channels/types.js +18 -0
- package/dist/channels/types.js.map +1 -0
- package/dist/channels/whatsapp.d.ts +23 -0
- package/dist/channels/whatsapp.d.ts.map +1 -0
- package/dist/channels/whatsapp.js +189 -0
- package/dist/channels/whatsapp.js.map +1 -0
- package/dist/config.d.ts +134 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +127 -0
- package/dist/config.js.map +1 -0
- package/dist/cron.d.ts +8 -0
- package/dist/cron.d.ts.map +1 -0
- package/dist/cron.js +35 -0
- package/dist/cron.js.map +1 -0
- package/dist/decrypt-keys.d.ts +7 -0
- package/dist/decrypt-keys.d.ts.map +1 -0
- package/dist/decrypt-keys.js +53 -0
- package/dist/decrypt-keys.js.map +1 -0
- package/dist/encrypt-keys.d.ts +8 -0
- package/dist/encrypt-keys.d.ts.map +1 -0
- package/dist/encrypt-keys.js +62 -0
- package/dist/encrypt-keys.js.map +1 -0
- package/dist/executor.d.ts +31 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +2009 -0
- package/dist/executor.js.map +1 -0
- package/dist/gemini-executor.d.ts +27 -0
- package/dist/gemini-executor.d.ts.map +1 -0
- package/dist/gemini-executor.js +160 -0
- package/dist/gemini-executor.js.map +1 -0
- package/dist/goals.d.ts +24 -0
- package/dist/goals.d.ts.map +1 -0
- package/dist/goals.js +189 -0
- package/dist/goals.js.map +1 -0
- package/dist/gym/activity-digest.d.ts +30 -0
- package/dist/gym/activity-digest.d.ts.map +1 -0
- package/dist/gym/activity-digest.js +506 -0
- package/dist/gym/activity-digest.js.map +1 -0
- package/dist/gym/dimension-scorer.d.ts +76 -0
- package/dist/gym/dimension-scorer.d.ts.map +1 -0
- package/dist/gym/dimension-scorer.js +236 -0
- package/dist/gym/dimension-scorer.js.map +1 -0
- package/dist/gym/gym-router.d.ts +7 -0
- package/dist/gym/gym-router.d.ts.map +1 -0
- package/dist/gym/gym-router.js +718 -0
- package/dist/gym/gym-router.js.map +1 -0
- package/dist/gym/index.d.ts +11 -0
- package/dist/gym/index.d.ts.map +1 -0
- package/dist/gym/index.js +11 -0
- package/dist/gym/index.js.map +1 -0
- package/dist/heartbeat.d.ts +21 -0
- package/dist/heartbeat.d.ts.map +1 -0
- package/dist/heartbeat.js +163 -0
- package/dist/heartbeat.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +254 -0
- package/dist/index.js.map +1 -0
- package/dist/keystore.d.ts +22 -0
- package/dist/keystore.d.ts.map +1 -0
- package/dist/keystore.js +178 -0
- package/dist/keystore.js.map +1 -0
- package/dist/logger.d.ts +9 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +45 -0
- package/dist/logger.js.map +1 -0
- package/dist/memory/daily.d.ts +22 -0
- package/dist/memory/daily.d.ts.map +1 -0
- package/dist/memory/daily.js +82 -0
- package/dist/memory/daily.js.map +1 -0
- package/dist/memory/embeddings.d.ts +15 -0
- package/dist/memory/embeddings.d.ts.map +1 -0
- package/dist/memory/embeddings.js +154 -0
- package/dist/memory/embeddings.js.map +1 -0
- package/dist/memory/index.d.ts +32 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +159 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/search.d.ts +21 -0
- package/dist/memory/search.d.ts.map +1 -0
- package/dist/memory/search.js +77 -0
- package/dist/memory/search.js.map +1 -0
- package/dist/memory/store.d.ts +23 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +144 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/ollama-executor.d.ts +17 -0
- package/dist/ollama-executor.d.ts.map +1 -0
- package/dist/ollama-executor.js +112 -0
- package/dist/ollama-executor.js.map +1 -0
- package/dist/openai-executor.d.ts +38 -0
- package/dist/openai-executor.d.ts.map +1 -0
- package/dist/openai-executor.js +197 -0
- package/dist/openai-executor.js.map +1 -0
- package/dist/router.d.ts +11 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +185 -0
- package/dist/router.js.map +1 -0
- package/dist/test-message.d.ts +2 -0
- package/dist/test-message.d.ts.map +1 -0
- package/dist/test-message.js +60 -0
- package/dist/test-message.js.map +1 -0
- package/dist/utils/imsg-db-reader.d.ts +24 -0
- package/dist/utils/imsg-db-reader.d.ts.map +1 -0
- package/dist/utils/imsg-db-reader.js +92 -0
- package/dist/utils/imsg-db-reader.js.map +1 -0
- package/dist/utils/imsg-rpc.d.ts +25 -0
- package/dist/utils/imsg-rpc.d.ts.map +1 -0
- package/dist/utils/imsg-rpc.js +149 -0
- package/dist/utils/imsg-rpc.js.map +1 -0
- package/dist/utils/message-formatter.d.ts +3 -0
- package/dist/utils/message-formatter.d.ts.map +1 -0
- package/dist/utils/message-formatter.js +69 -0
- package/dist/utils/message-formatter.js.map +1 -0
- package/dist/web-ui.d.ts +12 -0
- package/dist/web-ui.d.ts.map +1 -0
- package/dist/web-ui.js +5784 -0
- package/dist/web-ui.js.map +1 -0
- package/dist/whatsapp-chats.d.ts +2 -0
- package/dist/whatsapp-chats.d.ts.map +1 -0
- package/dist/whatsapp-chats.js +76 -0
- package/dist/whatsapp-chats.js.map +1 -0
- package/dist/whatsapp-login.d.ts +2 -0
- package/dist/whatsapp-login.d.ts.map +1 -0
- package/dist/whatsapp-login.js +90 -0
- package/dist/whatsapp-login.js.map +1 -0
- package/dist/wiki-sync.d.ts +21 -0
- package/dist/wiki-sync.d.ts.map +1 -0
- package/dist/wiki-sync.js +147 -0
- package/dist/wiki-sync.js.map +1 -0
- package/docs/AddNewAgentGuide.md +100 -0
- package/docs/AddNewMcpGuide.md +72 -0
- package/docs/Architecture.md +795 -0
- package/docs/CLAUDE-AI-SETUP.md +166 -0
- package/docs/Setup.md +297 -0
- package/docs/ai-gym-architecture.md +1040 -0
- package/docs/ai-gym-build-plan.md +343 -0
- package/docs/ai-gym-onboarding.md +122 -0
- package/docs/appcreator_plan.md +348 -0
- package/docs/platform-mcp-audit.md +320 -0
- package/docs/server-deployment-plan.md +503 -0
- package/docs/superpowers/plans/2026-03-25-marketplace.md +1281 -0
- package/docs/superpowers/specs/2026-03-25-marketplace-design.md +287 -0
- package/docs/user-guide.md +2016 -0
- package/mcp-catalog.json +628 -0
- package/package.json +63 -0
- package/public/MyAIforOne-logomark-512.svg +16 -0
- package/public/MyAIforOne-logomark-transparent.svg +15 -0
- package/public/activity.html +314 -0
- package/public/admin.html +1674 -0
- package/public/agent-dashboard.html +670 -0
- package/public/api-docs.html +1106 -0
- package/public/automations.html +722 -0
- package/public/canvas.css +223 -0
- package/public/canvas.js +588 -0
- package/public/changelog.html +231 -0
- package/public/gym.html +2766 -0
- package/public/home.html +1930 -0
- package/public/index.html +2809 -0
- package/public/lab.html +1643 -0
- package/public/library.html +1442 -0
- package/public/marketplace.html +1101 -0
- package/public/mcp-docs.html +441 -0
- package/public/mini.html +390 -0
- package/public/monitor.html +584 -0
- package/public/org.html +4304 -0
- package/public/projects.html +734 -0
- package/public/settings.html +645 -0
- package/public/tasks.html +932 -0
- package/public/trainers/alex.svg +12 -0
- package/public/trainers/jordan.svg +12 -0
- package/public/trainers/morgan.svg +12 -0
- package/public/trainers/riley.svg +12 -0
- package/public/trainers/sam.svg +12 -0
- package/public/user-guide.html +218 -0
- package/registry/agents.json +3 -0
- package/registry/apps.json +20 -0
- package/registry/installed-drafts.json +3 -0
- package/registry/mcps.json +1084 -0
- package/registry/prompts/personal/mcp-test-prompt.md +6 -0
- package/registry/prompts/personal/memory-recall.md +6 -0
- package/registry/prompts/platform/brainstorm.md +15 -0
- package/registry/prompts/platform/code-review.md +16 -0
- package/registry/prompts/platform/explain.md +16 -0
- package/registry/prompts.json +58 -0
- package/registry/skills/external/brainstorming.md +5 -0
- package/registry/skills/external/code-review.md +40 -0
- package/registry/skills/external/frontend-patterns.md +642 -0
- package/registry/skills/external/frontend-slides.md +184 -0
- package/registry/skills/external/systematic-debugging.md +5 -0
- package/registry/skills/external/tdd.md +328 -0
- package/registry/skills/external/verification-before-completion.md +5 -0
- package/registry/skills/external/writing-plans.md +5 -0
- package/registry/skills/platform/ai41_app_build.md +930 -0
- package/registry/skills/platform/ai41_app_deploy.md +168 -0
- package/registry/skills/platform/ai41_app_orchestrator.md +239 -0
- package/registry/skills/platform/ai41_app_patterns.md +359 -0
- package/registry/skills/platform/ai41_app_register.md +85 -0
- package/registry/skills/platform/ai41_app_scaffold.md +421 -0
- package/registry/skills/platform/ai41_app_verify.md +107 -0
- package/registry/skills/platform/opProjectCreate.md +239 -0
- package/registry/skills/platform/op_devbrowser.md +136 -0
- package/registry/skills/platform/sop_brandguidelines.md +103 -0
- package/registry/skills/platform/sop_docx.md +117 -0
- package/registry/skills/platform/sop_frontenddesign.md +44 -0
- package/registry/skills/platform/sop_frontenddesign_v2.md +659 -0
- package/registry/skills/platform/sop_mcpbuilder.md +133 -0
- package/registry/skills/platform/sop_pdf.md +172 -0
- package/registry/skills/platform/sop_pptx.md +133 -0
- package/registry/skills/platform/sop_skillcreator.md +104 -0
- package/registry/skills/platform/sop_themefactory.md +128 -0
- package/registry/skills/platform/sop_webapptesting.md +75 -0
- package/registry/skills/platform/sop_webartifactsbuilder.md +97 -0
- package/registry/skills/platform/sop_xlsx.md +134 -0
- package/registry/skills.json +1055 -0
- package/scripts/discover-chats.sh +11 -0
- package/scripts/install-service-windows.ps1 +87 -0
- package/scripts/install-service.sh +52 -0
- package/scripts/seed-registry.ts +195 -0
- package/scripts/test-send.sh +5 -0
- package/scripts/tray-indicator.ps1 +35 -0
- package/scripts/uninstall-service-windows.ps1 +23 -0
- package/scripts/uninstall-service.sh +15 -0
- package/scripts/xbar-myagent.5s.sh +32 -0
- package/server/mcp-server/dist/index.d.ts +11 -0
- package/server/mcp-server/dist/index.js +1332 -0
- package/server/mcp-server/dist/lib/api-client.d.ts +165 -0
- package/server/mcp-server/dist/lib/api-client.js +241 -0
- package/server/mcp-server/index.ts +1545 -0
- package/server/mcp-server/lib/api-client.ts +366 -0
- package/server/mcp-server/tsconfig.json +14 -0
- package/src/agent-registry.ts +180 -0
- package/src/channels/discord.ts +129 -0
- package/src/channels/imessage.ts +261 -0
- package/src/channels/slack.ts +208 -0
- package/src/channels/telegram.ts +307 -0
- package/src/channels/types.ts +62 -0
- package/src/channels/whatsapp.ts +227 -0
- package/src/config.ts +281 -0
- package/src/cron.ts +43 -0
- package/src/decrypt-keys.ts +60 -0
- package/src/encrypt-keys.ts +70 -0
- package/src/executor.ts +2190 -0
- package/src/gemini-executor.ts +212 -0
- package/src/goals.ts +240 -0
- package/src/gym/activity-digest.ts +546 -0
- package/src/gym/dimension-scorer.ts +297 -0
- package/src/gym/gym-router.ts +801 -0
- package/src/gym/index.ts +19 -0
- package/src/heartbeat.ts +220 -0
- package/src/index.ts +275 -0
- package/src/keystore.ts +190 -0
- package/src/logger.ts +51 -0
- package/src/memory/daily.ts +101 -0
- package/src/memory/embeddings.ts +185 -0
- package/src/memory/index.ts +218 -0
- package/src/memory/search.ts +124 -0
- package/src/memory/store.ts +189 -0
- package/src/ollama-executor.ts +126 -0
- package/src/openai-executor.ts +259 -0
- package/src/router.ts +230 -0
- package/src/test-message.ts +72 -0
- package/src/utils/imsg-db-reader.ts +109 -0
- package/src/utils/imsg-rpc.ts +178 -0
- package/src/utils/message-formatter.ts +90 -0
- package/src/web-ui.ts +5778 -0
- package/src/whatsapp-chats.ts +91 -0
- package/src/whatsapp-login.ts +110 -0
- package/src/wiki-sync.ts +199 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# Marketplace Design Spec
|
|
2
|
+
**Date:** 2026-03-25
|
|
3
|
+
**Project:** channelToAgentToClaude
|
|
4
|
+
**Status:** Approved
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
A marketplace for browsing, installing, and assigning MCPs, skills, and agent templates. Users discover items (from the platform or external sources), install them in one click, and optionally assign them to one or more agents via a post-install modal.
|
|
11
|
+
|
|
12
|
+
Two-step model: **install** (makes the item available system-wide, writes to `config.mcps` if needed) → **assign** (attaches it to specific agents by writing to `agents[id].mcps[]` or `agents[id].skills[]`). These are independent — install does not force assignment.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Registry Data Layer
|
|
17
|
+
|
|
18
|
+
### Folder Structure
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
/registry/
|
|
22
|
+
mcps.json ← all MCPs (platform + external)
|
|
23
|
+
skills.json ← all skills (platform + external)
|
|
24
|
+
agents.json ← all agent templates (platform + external)
|
|
25
|
+
skills/
|
|
26
|
+
platform/ ← .md files for AgenticLedger skills
|
|
27
|
+
external/ ← downloaded external skill files (e.g. affaan-m)
|
|
28
|
+
agents/
|
|
29
|
+
platform/ ← agent CLAUDE.md + agent.json templates
|
|
30
|
+
external/ ← downloaded external agent templates
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Entry Schema (all three types share base fields)
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"id": "stripe",
|
|
38
|
+
"name": "Stripe",
|
|
39
|
+
"provider": "AgenticLedger",
|
|
40
|
+
"description": "Payment processing — customers, invoices, subscriptions, charges, refunds",
|
|
41
|
+
"category": "payments",
|
|
42
|
+
"verified": true,
|
|
43
|
+
"source": "agenticledger/platform",
|
|
44
|
+
"tags": ["payments", "invoices", "billing"],
|
|
45
|
+
"fetch": {
|
|
46
|
+
"type": "http",
|
|
47
|
+
"url": "https://stripemcp.agenticledger.ai/mcp"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### fetch.type Values
|
|
53
|
+
|
|
54
|
+
| type | used by | install action |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `http` | AgenticLedger MCPs | write full entry to `config.mcps[id]` (url + empty headers) |
|
|
57
|
+
| `npm` | community MCPs (e.g. GitHub MCP) | `npm install {package}`, write stdio entry to `config.mcps[id]` |
|
|
58
|
+
| `local` | local MCP scripts | copy file to `agents/_shared/mcps/{id}/`, write stdio entry to `config.mcps[id]` |
|
|
59
|
+
| `file` | skills, agent templates | copy `localPath` → destination |
|
|
60
|
+
|
|
61
|
+
### config.mcps Entry Structure by fetch.type
|
|
62
|
+
|
|
63
|
+
Every MCP must have a valid `config.mcps` entry before it can be assigned to any agent (the executor validates this at startup). Install writes this entry. Assign only writes to `agents[id].mcps[]`.
|
|
64
|
+
|
|
65
|
+
**http MCP entry (written at install):**
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"type": "http",
|
|
69
|
+
"url": "https://stripemcp.agenticledger.ai/mcp",
|
|
70
|
+
"headers": {}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**npm MCP entry (written at install):**
|
|
75
|
+
|
|
76
|
+
The registry entry for npm MCPs must include `fetch.package` (the npm package name) so the install handler knows what to install:
|
|
77
|
+
```json
|
|
78
|
+
"fetch": {
|
|
79
|
+
"type": "npm",
|
|
80
|
+
"package": "@modelcontextprotocol/server-github",
|
|
81
|
+
"args": ["-y", "@modelcontextprotocol/server-github"]
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The `config.mcps` entry written at install time:
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"type": "stdio",
|
|
89
|
+
"command": "npx",
|
|
90
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
91
|
+
"env": {}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**local MCP entry (written at install):**
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"type": "stdio",
|
|
99
|
+
"command": "node",
|
|
100
|
+
"args": ["agents/_shared/mcps/{id}/index.js"],
|
|
101
|
+
"env": {}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Skills localPath
|
|
106
|
+
|
|
107
|
+
Skills and agent templates add `"localPath"` pointing to their file in the registry:
|
|
108
|
+
```json
|
|
109
|
+
"localPath": "registry/skills/platform/sop_pptx.md"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### verified Flag
|
|
113
|
+
|
|
114
|
+
- `true` — AgenticLedger platform items. All 47 existing MCPs and all 67 skills are verified.
|
|
115
|
+
- `false` — external/community items. Marked clearly in UI.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 2. Registry Seeding
|
|
120
|
+
|
|
121
|
+
### MCPs
|
|
122
|
+
Migrate `mcp-catalog.json` → `registry/mcps.json`. Add `verified: true`, `fetch.type: "http"`, `source: "agenticledger/platform"` to each entry. Existing `requiredKeys` field retained.
|
|
123
|
+
|
|
124
|
+
### Skills — Seed Script (one-time, run at setup)
|
|
125
|
+
A script at `scripts/seed-registry.ts` scans `~/.claude/commands/` and generates `registry/skills.json`. Each file gets an entry with:
|
|
126
|
+
- `id` from filename (strip `.md`)
|
|
127
|
+
- `name` from first `# heading` in file, or title-cased id
|
|
128
|
+
- `description` from line after first heading, or empty
|
|
129
|
+
- `localPath` pointing to `registry/skills/platform/{id}.md`
|
|
130
|
+
- Files copied to `registry/skills/platform/`
|
|
131
|
+
|
|
132
|
+
The seed script is run once during setup. The registry does not auto-update when skills are added manually — re-run the script to refresh. Runtime API reads from `registry/skills.json` only (no live directory scan on every request).
|
|
133
|
+
|
|
134
|
+
### External Skills (affaan-m/everything-claude-code)
|
|
135
|
+
Curated set fetched once and saved to `registry/skills/external/`:
|
|
136
|
+
- `tdd`, `code-review`, `debug`, `plan`, `build-fix`, `verify`
|
|
137
|
+
- `verified: false`, `provider: "affaan-m"`
|
|
138
|
+
- Source tracked in `source` field for attribution and future updates
|
|
139
|
+
- Committed to the repo so all clones get them automatically
|
|
140
|
+
|
|
141
|
+
### Agent Templates
|
|
142
|
+
Initial `registry/agents.json` starts with a minimal set. New templates added manually.
|
|
143
|
+
|
|
144
|
+
**Agent template install must not write to config.json immediately** — `config.ts` throws a hard startup error if any agent has `routes.length === 0`. Draft agents are instead stored in a separate `registry/installed-drafts.json` file (outside config.json) until the user configures at least one route via the existing agent editor in `/org`. Once a route is saved, the agent editor's existing `POST /api/agents/:id` endpoint writes the full valid entry to config.json. The marketplace install step only creates the `agents/{id}/` directory, writes `agents/{id}/agent.json` with `draft: true`, and appends to `registry/installed-drafts.json`. The marketplace UI reads `installed-drafts.json` to show draft agents in an "Needs setup → Go to Org" state.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 3. Backend API
|
|
149
|
+
|
|
150
|
+
Three endpoints added to `src/web-ui.ts`. All reads use the in-memory `opts.config` object (not re-parsing config.json from disk) to stay consistent with what the executor sees. All writes update both config.json on disk AND `opts.config` in memory immediately.
|
|
151
|
+
|
|
152
|
+
**Note:** config.json writes follow the existing read→mutate→write pattern used throughout web-ui.ts. Concurrent rapid writes carry the same race risk as all other config writes in this codebase — a file-lock is deferred to a future refactor.
|
|
153
|
+
|
|
154
|
+
### GET `/api/marketplace/:type`
|
|
155
|
+
Returns all registry entries for `type` ∈ `mcps | skills | agents`, with computed status fields appended to each entry.
|
|
156
|
+
|
|
157
|
+
**installed detection:**
|
|
158
|
+
- skill → `existsSync(join(getPersonalAgentsDir(), "skills", "{id}.md")) || existsSync(join(homedir(), ".claude", "commands", "{id}.md"))` (checks both locations the executor uses, in order)
|
|
159
|
+
- MCP → `opts.config.mcps[id] !== undefined`
|
|
160
|
+
- agent template → `existsSync("agents/{id}/")`
|
|
161
|
+
|
|
162
|
+
**assignedTo detection:**
|
|
163
|
+
- Scan `opts.config.agents` — collect all agentIds where `agent.mcps.includes(id)` or `agent.skills.includes(id)`
|
|
164
|
+
|
|
165
|
+
Response shape:
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"items": [
|
|
169
|
+
{
|
|
170
|
+
...registryEntry,
|
|
171
|
+
"installed": true,
|
|
172
|
+
"assignedTo": ["myagent-dev", "mailcal"]
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### POST `/api/marketplace/install`
|
|
179
|
+
Body: `{ type: "skill" | "mcp" | "agent", id: string }`
|
|
180
|
+
|
|
181
|
+
**Install actions by type:**
|
|
182
|
+
|
|
183
|
+
| type | action |
|
|
184
|
+
|---|---|
|
|
185
|
+
| skill | copy `registry/skills/**/{id}.md` → `{personalAgentsSkillsDir}/{id}.md` (preferred) |
|
|
186
|
+
| MCP http | write full http entry to `config.mcps[id]` on disk + in `opts.config.mcps` |
|
|
187
|
+
| MCP npm | spawn `npm install {package}` (30s timeout), write stdio entry to `config.mcps[id]` on disk + memory |
|
|
188
|
+
| MCP local | copy file to `agents/_shared/mcps/{id}/`, write stdio entry to config |
|
|
189
|
+
| agent | copy `registry/agents/**/{id}/` → `agents/{id}/`, write `agents/{id}/agent.json` with `draft: true`, append to `registry/installed-drafts.json` (NOT config.json — see Section 2) |
|
|
190
|
+
|
|
191
|
+
Returns: `{ ok: true, item: { ...entry, installed: true }, requiresKeys: boolean }`
|
|
192
|
+
|
|
193
|
+
`requiresKeys: true` when the item is an MCP with non-empty `requiredKeys`. The frontend uses this flag to decide whether to show the key-entry step before or after the assign modal.
|
|
194
|
+
|
|
195
|
+
### POST `/api/marketplace/assign`
|
|
196
|
+
Body: `{ type: string, id: string, agentIds: string[] }`
|
|
197
|
+
|
|
198
|
+
For each agentId in agentIds:
|
|
199
|
+
- **skill** → add `id` to `opts.config.agents[agentId].skills[]` if not present; write to config.json
|
|
200
|
+
- **MCP** → add `id` to `opts.config.agents[agentId].mcps[]` if not present; write to config.json; if `requiredKeys` is non-empty and no key file exists at `agents/{agentId}/mcp-keys/{id}.env`, create an empty stub file so the executor does not throw — but the UI must alert the user that a real key is needed
|
|
201
|
+
|
|
202
|
+
Returns: `{ ok: true, assigned: agentIds, missingKeys: agentIds[] }`
|
|
203
|
+
|
|
204
|
+
`missingKeys` lists any agents that were assigned but have no API key yet — the frontend prompts the user to add keys for those.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 4. Frontend — `/marketplace`
|
|
209
|
+
|
|
210
|
+
### Page Structure
|
|
211
|
+
|
|
212
|
+
Standalone page at `/marketplace`. Linked from the top nav. File: `public/marketplace.html`.
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
[Nav: Dashboard | Org | Marketplace | Activity]
|
|
216
|
+
|
|
217
|
+
[MCPs] [Skills] [Agents] 🔍 Search... [All] [payments] [dev] [productivity] ...
|
|
218
|
+
|
|
219
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
220
|
+
│ Card │ │ Card │ │ Card │ │ Card │
|
|
221
|
+
└──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Card States
|
|
225
|
+
|
|
226
|
+
**Available (not installed):**
|
|
227
|
+
- Name, provider, verified badge (✓ green for platform, grey label for external)
|
|
228
|
+
- Description, category tag
|
|
229
|
+
- `[+ Install]` button (indigo)
|
|
230
|
+
|
|
231
|
+
**Installed:**
|
|
232
|
+
- Green `✓ Installed` badge top-right
|
|
233
|
+
- `[Manage]` button → opens assign modal for already-installed item
|
|
234
|
+
- If MCP with missing keys on any agent: amber `⚠ Needs key` indicator
|
|
235
|
+
|
|
236
|
+
### Post-Install Flow
|
|
237
|
+
|
|
238
|
+
1. `POST /api/marketplace/install` called on click
|
|
239
|
+
2. If `requiresKeys: true` → show key-entry step first (re-uses existing key input UI pattern)
|
|
240
|
+
3. Post-install assign modal opens:
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
✓ Stripe MCP installed
|
|
244
|
+
|
|
245
|
+
Assign to agents now? (optional)
|
|
246
|
+
|
|
247
|
+
☐ myagent-dev
|
|
248
|
+
☐ mailcal
|
|
249
|
+
☐ buildinpublic
|
|
250
|
+
...
|
|
251
|
+
|
|
252
|
+
[Assign selected] [Skip for now]
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
- Multi-select checkboxes
|
|
256
|
+
- "Assign selected" calls `POST /api/marketplace/assign`
|
|
257
|
+
- If response includes `missingKeys`, show inline alert: "Add API key for [agent] to activate"
|
|
258
|
+
- "Skip for now" closes modal
|
|
259
|
+
|
|
260
|
+
**Manage flow** (already-installed items): same modal, pre-checks agents that already have the item.
|
|
261
|
+
|
|
262
|
+
### Filters
|
|
263
|
+
|
|
264
|
+
- Tab filter: MCPs / Skills / Agents
|
|
265
|
+
- Category pills: dynamically generated from registry data
|
|
266
|
+
- Search: client-side filter on name + description + tags
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 5. Error Handling
|
|
271
|
+
|
|
272
|
+
- Install failure → toast error, card reverts to available state
|
|
273
|
+
- npm install timeout (>30s) → error toast with package name
|
|
274
|
+
- Assign failure → modal stays open, shows inline error
|
|
275
|
+
- Registry file missing/malformed → empty state with message
|
|
276
|
+
- Missing keys after assign → amber warning per-agent, not a blocking error
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 6. Out of Scope
|
|
281
|
+
|
|
282
|
+
- Uninstall / removing installed items
|
|
283
|
+
- Version management or auto-updates for external items
|
|
284
|
+
- User-submitted community listings
|
|
285
|
+
- Ratings or reviews
|
|
286
|
+
- Per-agent marketplace view (the assign modal covers this need)
|
|
287
|
+
- File-lock on config.json writes (existing technical debt, deferred)
|