{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "discord-docs-starter",
  "title": "Discord Docs Starter",
  "description": "Answers Discord questions from a single knowledge.md FAQ you paste in. Demos giving an agent knowledge.",
  "dependencies": ["eve@^0.24.6"],
  "devDependencies": ["@types/node@24.x", "typescript@^5.9.3"],
  "files": [
    {
      "path": "catalog/agents/discord-docs-starter/.env.example",
      "content": "# Discord application credentials (Discord Developer Portal → your app).\nDISCORD_PUBLIC_KEY=replace-me\nDISCORD_APPLICATION_ID=replace-me\nDISCORD_BOT_TOKEN=replace-me\n\n# Model access follows your eve setup (Vercel AI Gateway or a provider key).\n",
      "type": "registry:file",
      "target": ".env.example"
    },
    {
      "path": "catalog/agents/discord-docs-starter/.gitignore",
      "content": "node_modules/\n.eve/\nvar/\n.env\n.env.local\n*.tsbuildinfo\n",
      "type": "registry:file",
      "target": ".gitignore"
    },
    {
      "path": "catalog/agents/discord-docs-starter/README.md",
      "content": "# Discord Docs Starter\n\nAnswers questions in your Discord server from a single knowledge file you paste your FAQ into.\n\nOne channel, one knowledge skill, no tools. Demos: giving an agent knowledge.\n\n## Layout\n\n```text\ndiscord-docs-starter/\n├── package.json\n├── agent/\n│   ├── agent.ts               # model choice\n│   ├── instructions.md        # answer-from-docs rules\n│   ├── skills/knowledge.md    # ← paste your FAQ here\n│   └── channels/discord.ts    # Discord interactions channel\n├── evals/\n```\n\n## Run\n\n```bash\nnpm install\nnpm run dev\n```\n\nYou can ask questions in the dev terminal immediately. See `SETUP.md` to connect Discord.\n\n## Make it yours\n\nReplace the body of `agent/skills/knowledge.md` with your own FAQ or docs. The frontmatter `description` tells the model when to load it — keep it matching your content. The agent loads the file on demand, so it can grow well past what would fit in a prompt.\n\n## Verify\n\n```bash\nnpm run eval\n```\n\n## License\n\nMIT\n",
      "type": "registry:file",
      "target": "README.md"
    },
    {
      "path": "catalog/agents/discord-docs-starter/SETUP.md",
      "content": "# Set up Discord Docs Starter\n\n## 1. Install and run\n\n```bash\nnpm install\nnpm run dev\n```\n\nThe dev server includes a local chat, so you can test answers before Discord is connected.\n\n## 2. Create the Discord app\n\n1. Create an application at the [Discord Developer Portal](https://discord.com/developers/applications).\n2. Copy the **Public Key** and **Application ID** from General Information, and a **Bot Token** from the Bot tab, into `.env` (see `.env.example`).\n3. Deploy, then set the app's **Interactions Endpoint URL** to `https://<your-deployment>/eve/v1/discord`.\n\n## 3. Register the /ask command\n\n```bash\ncurl -X PUT \"https://discord.com/api/v10/applications/$DISCORD_APPLICATION_ID/commands\" \\\n  -H \"Authorization: Bot $DISCORD_BOT_TOKEN\" -H \"Content-Type: application/json\" \\\n  -d '[{\"name\":\"ask\",\"description\":\"Ask the docs bot\",\"type\":1,\n    \"options\":[{\"name\":\"message\",\"description\":\"Your question\",\"type\":3,\"required\":true}]}]'\n```\n\nInvite the bot to your server, then `/ask what are the support hours`.\n\n## 4. Paste your docs\n\nReplace the body of `agent/skills/knowledge.md` with your FAQ. Update the frontmatter `description` so it describes when the bot should reach for it.\n\n## Verify\n\n```bash\nnpm run eval\n```\n\nEvals drive the agent over eve's local HTTP channel — model credentials required, Discord credentials not.\n",
      "type": "registry:file",
      "target": "SETUP.md"
    },
    {
      "path": "catalog/agents/discord-docs-starter/agent/agent.ts",
      "content": "import { defineAgent } from \"eve\";\n\nexport default defineAgent({\n  model: \"openai/gpt-5.4-mini\",\n});\n",
      "type": "registry:file",
      "target": "agent/agent.ts"
    },
    {
      "path": "catalog/agents/discord-docs-starter/agent/channels/discord.ts",
      "content": "import { discordChannel } from \"eve/channels/discord\";\n\n// Credentials come from env: DISCORD_PUBLIC_KEY, DISCORD_APPLICATION_ID,\n// and DISCORD_BOT_TOKEN. See SETUP.md.\nexport default discordChannel();\n",
      "type": "registry:file",
      "target": "agent/channels/discord.ts"
    },
    {
      "path": "catalog/agents/discord-docs-starter/agent/instructions.md",
      "content": "# Identity\n\nYou are a docs bot for a Discord community. You answer member questions from one knowledge file and nothing else.\n\n# The knowledge file\n\nYour entire knowledge base is the `knowledge` skill. For every question about the product, community, or policies, load that skill first and answer only from what it says.\n\n# Rules\n\n- Answer from the knowledge file. If the answer is not in it, say \"I don't have that in my docs\" and suggest asking a moderator — never guess or improvise an answer.\n- Quote or paraphrase the relevant knowledge entry; keep replies short enough to read in a chat channel.\n- If a question matches several entries, answer the most specific one and mention the others in one line.\n- Be friendly, but skip filler like \"Great question!\".\n",
      "type": "registry:file",
      "target": "agent/instructions.md"
    },
    {
      "path": "catalog/agents/discord-docs-starter/agent/skills/knowledge.md",
      "content": "---\ndescription: Load whenever a member asks about the product, pricing, support, or community rules. This is the bot's entire knowledge base.\n---\n\n<!-- CUSTOMIZE HERE: replace everything below with your own FAQ/docs. -->\n\n# Acme Community Knowledge\n\n## Support\n\n- Support hours are 9am–5pm ET, Monday through Friday.\n- Bug reports go in the #bug-reports channel with steps to reproduce.\n- For account or billing issues, email support@acme.example — do not post account details in public channels.\n\n## Pricing\n\n- Free tier: 3 projects, community support.\n- Pro: $12/month per seat, unlimited projects, priority support.\n- Annual billing gets 2 months free.\n\n## Community rules\n\n- Be respectful. No spam, no unsolicited DMs, no self-promotion outside #show-and-tell.\n- English is the primary channel language; #international is open to all languages.\n\n## Common questions\n\n- \"Can I self-host?\" — Not today. It is on the roadmap; follow #announcements.\n- \"Where is the changelog?\" — Pinned in #announcements and at acme.example/changelog.\n",
      "type": "registry:file",
      "target": "agent/skills/knowledge.md"
    },
    {
      "path": "catalog/agents/discord-docs-starter/evals/admits-unknown.eval.ts",
      "content": "import { defineEval } from \"eve/evals\";\nimport { satisfies } from \"eve/evals/expect\";\n\nexport default defineEval({\n  description: \"Refuses to invent answers that are not in the knowledge file.\",\n  async test(t) {\n    await t.send(\"What is the CEO's personal phone number?\");\n    t.succeeded();\n    t.check(\n      t.reply,\n      satisfies(\n        (reply: string) => !/\\+?\\d[\\d\\s().-]{6,}\\d/.test(reply),\n        \"reply contains no invented phone number\"\n      )\n    );\n  },\n});\n",
      "type": "registry:file",
      "target": "evals/admits-unknown.eval.ts"
    },
    {
      "path": "catalog/agents/discord-docs-starter/evals/answers-from-knowledge.eval.ts",
      "content": "import { defineEval } from \"eve/evals\";\nimport { includes } from \"eve/evals/expect\";\n\nexport default defineEval({\n  description: \"Answers a FAQ question by loading the knowledge skill.\",\n  async test(t) {\n    await t.send(\"What are your support hours?\");\n    t.succeeded();\n    t.calledTool(\"load_skill\");\n    t.check(t.reply, includes(/9\\s*am|9:00/i)).soft();\n  },\n});\n",
      "type": "registry:file",
      "target": "evals/answers-from-knowledge.eval.ts"
    },
    {
      "path": "catalog/agents/discord-docs-starter/evals/evals.config.ts",
      "content": "import { defineEvalConfig } from \"eve/evals\";\n\nexport default defineEvalConfig({\n  maxConcurrency: 1,\n  timeoutMs: 120_000,\n});\n",
      "type": "registry:file",
      "target": "evals/evals.config.ts"
    },
    {
      "path": "catalog/agents/discord-docs-starter/examples/sample-input.md",
      "content": "# Example request\n\n/ask can I self-host, and what does Pro cost?\n\n# Expected behavior\n\nLoad the `knowledge` skill and answer both parts from it: self-hosting is not available today (roadmap, follow #announcements), and Pro is $12/month per seat with 2 months free on annual billing. No invented details.\n",
      "type": "registry:file",
      "target": "examples/sample-input.md"
    },
    {
      "path": "catalog/agents/discord-docs-starter/package.json",
      "content": "{\n  \"name\": \"discord-docs-starter\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"eve dev\",\n    \"build\": \"eve build\",\n    \"start\": \"eve start\",\n    \"eval\": \"eve eval\",\n    \"typecheck\": \"tsc\"\n  },\n  \"dependencies\": {\n    \"eve\": \"^0.24.6\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"24.x\",\n    \"typescript\": \"^5.9.3\"\n  },\n  \"engines\": {\n    \"node\": \"24.x\"\n  }\n}\n",
      "type": "registry:file",
      "target": "package.json"
    },
    {
      "path": "catalog/agents/discord-docs-starter/tsconfig.json",
      "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"bundler\",\n    \"types\": [\"node\"],\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"noEmit\": true\n  },\n  \"include\": [\"agent/**/*.ts\", \"evals/**/*.ts\"]\n}\n",
      "type": "registry:file",
      "target": "tsconfig.json"
    }
  ],
  "meta": {
    "runtime": "eve",
    "layout": "eve-app",
    "version": "1.0.0",
    "license": "MIT",
    "category": "starters",
    "integrations": ["discord"]
  },
  "categories": ["starters"],
  "type": "registry:block"
}
