{"_id":"@0x6d61/wn-core","_rev":"6-f905a03ca1d60e48548788d90e882a72","name":"@0x6d61/wn-core","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.0":{"name":"@0x6d61/wn-core","version":"0.1.0","keywords":["ai","agent","llm","json-rpc","claude","openai","ollama","gemini","mcp"],"author":{"name":"0x6d61"},"license":"MIT","_id":"@0x6d61/wn-core@0.1.0","maintainers":[{"name":"0x6d61","email":"0x6d61@gmail.com"}],"homepage":"https://github.com/0x6d61/wn-core#readme","bugs":{"url":"https://github.com/0x6d61/wn-core/issues"},"bin":{"wn-core":"dist/cli.js"},"dist":{"shasum":"82898e39d413c8d951fef7a78740b03ecd98b3ff","tarball":"https://registry.npmjs.org/@0x6d61/wn-core/-/wn-core-0.1.0.tgz","fileCount":17,"integrity":"sha512-uJ6L0juIHW+thd/ydt0IiChU1mqL3qAtXTjkriV5MhVsn7SSrwnnzKc47Pzwd86UM1lCm9OBiT/rpHAhZgSP7Q==","signatures":[{"sig":"MEUCIF6kMx6ljLGUZ0ZyLKnhCtR+9p91dfU3/DflFVu6MeYtAiEApvSdyEzL+GczYCTQIpJcTr7w/5/FYRE0izTh2mjwZHE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":291603},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"0bd596779dcafdf46d8b1709b8031dcbba331400","scripts":{"dev":"tsx src/index.ts","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run typecheck && npm run lint && npm test && npm run build"},"_npmUser":{"name":"0x6d61","email":"0x6d61@gmail.com"},"repository":{"url":"git+https://github.com/0x6d61/wn-core.git","type":"git"},"_npmVersion":"10.9.4","description":"Lightweight AI Agent Core Framework","directories":{},"_nodeVersion":"22.22.0","dependencies":{"openai":"^6.25.0","@anthropic-ai/sdk":"^0.78.0","@google/generative-ai":"^0.24.1","@modelcontextprotocol/sdk":"^1.27.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","eslint":"^10.0.2","vitest":"^4.0.18","prettier":"^3.8.1","@eslint/js":"^10.0.1","typescript":"^5.9.3","@types/node":"^25.3.0","typescript-eslint":"^8.56.1","@vitest/coverage-v8":"^4.0.18","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/wn-core_0.1.0_1772098940473_0.9950364172431703","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@0x6d61/wn-core","version":"0.1.2","keywords":["ai","agent","llm","json-rpc","claude","openai","ollama","gemini","mcp"],"author":{"name":"0x6d61"},"license":"MIT","_id":"@0x6d61/wn-core@0.1.2","maintainers":[{"name":"0x6d61","email":"0x6d61@gmail.com"}],"homepage":"https://github.com/0x6d61/wn-core#readme","bugs":{"url":"https://github.com/0x6d61/wn-core/issues"},"bin":{"wn-core":"dist/cli.js"},"dist":{"shasum":"b5633a784641e8781a0b2050c0abd0b544c4bdc2","tarball":"https://registry.npmjs.org/@0x6d61/wn-core/-/wn-core-0.1.2.tgz","fileCount":19,"integrity":"sha512-IGlwApky2677C2fPelZFBgbj7tkteb54F4BUQRNnlJjnx039Dabw0fRSocjykuFUiKLHYhq+A9KQz3Em70pvGg==","signatures":[{"sig":"MEYCIQCCE/lGRoPSTDy+SlSY7AVqFnuHe7ktyg7RSUzANJcpZQIhAPQZ/oljywEa/qChmiaJyovk1Fo8//3IqfCj0t1gYMek","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":307954},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"310e6e7d14a5d69391d567925a8da78bd73ab00c","scripts":{"dev":"tsx src/index.ts","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run typecheck && npm run lint && npm test && npm run build"},"_npmUser":{"name":"0x6d61","email":"0x6d61@gmail.com"},"repository":{"url":"git+https://github.com/0x6d61/wn-core.git","type":"git"},"_npmVersion":"10.9.4","description":"Lightweight AI Agent Core Framework","directories":{},"_nodeVersion":"22.22.0","dependencies":{"openai":"^6.25.0","@anthropic-ai/sdk":"^0.78.0","@google/generative-ai":"^0.24.1","@modelcontextprotocol/sdk":"^1.27.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","eslint":"^10.0.2","vitest":"^4.0.18","prettier":"^3.8.1","@eslint/js":"^10.0.1","typescript":"^5.9.3","@types/node":"^25.3.0","typescript-eslint":"^8.56.1","@vitest/coverage-v8":"^4.0.18","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/wn-core_0.1.2_1772111552760_0.7073490454101881","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@0x6d61/wn-core","version":"0.1.3","keywords":["ai","agent","llm","json-rpc","claude","openai","ollama","gemini","mcp"],"author":{"name":"0x6d61"},"license":"MIT","_id":"@0x6d61/wn-core@0.1.3","maintainers":[{"name":"0x6d61","email":"0x6d61@gmail.com"}],"homepage":"https://github.com/0x6d61/wn-core#readme","bugs":{"url":"https://github.com/0x6d61/wn-core/issues"},"bin":{"wn-core":"dist/cli.js"},"dist":{"shasum":"7e48ced9b2f1fd2a99a21f6730141c1ce6700b12","tarball":"https://registry.npmjs.org/@0x6d61/wn-core/-/wn-core-0.1.3.tgz","fileCount":19,"integrity":"sha512-5qawEu7iB7PtChDG38+qIT2Cl8iC56Ov1ew33ZUoVSUOhkonwOP/EKGePDsn7xc28O7ZgsDNfz2Kiz9H08QlaA==","signatures":[{"sig":"MEUCIQCj4o65r+U0rOwP/GQjc4qfCKPL4tlwfpc95HOKr0RBQgIgLavmchUsFsCMDBdibiRfCAJDcAMwTtqsw7KWQTUAsaA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":309143},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"51f81587d33fd827c3f48c9fbf0a499e2607d06c","scripts":{"dev":"tsx src/index.ts","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run typecheck && npm run lint && npm test && npm run build"},"_npmUser":{"name":"0x6d61","email":"0x6d61@gmail.com"},"repository":{"url":"git+https://github.com/0x6d61/wn-core.git","type":"git"},"_npmVersion":"10.9.4","description":"Lightweight AI Agent Core Framework","directories":{},"_nodeVersion":"22.22.0","dependencies":{"openai":"^6.25.0","@anthropic-ai/sdk":"^0.78.0","@google/generative-ai":"^0.24.1","@modelcontextprotocol/sdk":"^1.27.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","eslint":"^10.0.2","vitest":"^4.0.18","prettier":"^3.8.1","@eslint/js":"^10.0.1","typescript":"^5.9.3","@types/node":"^25.3.0","typescript-eslint":"^8.56.1","@vitest/coverage-v8":"^4.0.18","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/wn-core_0.1.3_1772135725175_0.6359904297932646","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@0x6d61/wn-core","version":"0.1.4","keywords":["ai","agent","llm","json-rpc","claude","openai","ollama","gemini","mcp"],"author":{"name":"0x6d61"},"license":"MIT","_id":"@0x6d61/wn-core@0.1.4","maintainers":[{"name":"0x6d61","email":"0x6d61@gmail.com"}],"homepage":"https://github.com/0x6d61/wn-core#readme","bugs":{"url":"https://github.com/0x6d61/wn-core/issues"},"bin":{"wn-core":"dist/cli.js"},"dist":{"shasum":"9ba42461e367a7a46a730aea7a2c2f020cc18e7a","tarball":"https://registry.npmjs.org/@0x6d61/wn-core/-/wn-core-0.1.4.tgz","fileCount":19,"integrity":"sha512-AXZIKOaZlG2EtzDB9WH9b7Noo0sPyoFH9Ce3XnkbwUM4ZzSJe3s5Nc3c/gA+YbbOMiZWE/HUz+qnGkCc81Rtvw==","signatures":[{"sig":"MEQCIBLHU3JX3rbnvraW3MU7Z8VQNM8IjWOLY/sIbFbV/rNEAiBFDNVeO4/JGnxCm/1QZ5mex6ZQmivA+fwvJSPxZkQRWQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":310274},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"40aff5b08182456b77c5a491f57dc0aff2854bb0","scripts":{"dev":"tsx src/index.ts","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run typecheck && npm run lint && npm test && npm run build"},"_npmUser":{"name":"0x6d61","email":"0x6d61@gmail.com"},"repository":{"url":"git+https://github.com/0x6d61/wn-core.git","type":"git"},"_npmVersion":"10.9.4","description":"Lightweight AI Agent Core Framework","directories":{},"_nodeVersion":"22.22.0","dependencies":{"openai":"^6.25.0","@anthropic-ai/sdk":"^0.78.0","@google/generative-ai":"^0.24.1","@modelcontextprotocol/sdk":"^1.27.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","eslint":"^10.0.2","vitest":"^4.0.18","prettier":"^3.8.1","@eslint/js":"^10.0.1","typescript":"^5.9.3","@types/node":"^25.3.0","typescript-eslint":"^8.56.1","@vitest/coverage-v8":"^4.0.18","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/wn-core_0.1.4_1772139356196_0.7114846379438449","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@0x6d61/wn-core","version":"0.1.5","keywords":["ai","agent","llm","json-rpc","claude","openai","ollama","gemini","mcp"],"author":{"name":"0x6d61"},"license":"MIT","_id":"@0x6d61/wn-core@0.1.5","maintainers":[{"name":"0x6d61","email":"0x6d61@gmail.com"}],"homepage":"https://github.com/0x6d61/wn-core#readme","bugs":{"url":"https://github.com/0x6d61/wn-core/issues"},"bin":{"wn-core":"dist/cli.js"},"dist":{"shasum":"828639f2b2af4c8344ece4d79eccd60ab5bc458d","tarball":"https://registry.npmjs.org/@0x6d61/wn-core/-/wn-core-0.1.5.tgz","fileCount":19,"integrity":"sha512-XTMwgPNlsnVtRLf1eAvZfFHe8Jpex0kSVKGgzJj3fsuFcPTOxAPHhqvNidg49BxIdd5xkDUA+NTUlIAhatBAIA==","signatures":[{"sig":"MEQCIHyo/NJ2qJh/RyBkHRaLuKVNJM2WlBlmoehc4P0i4lucAiAx4B/Plkng2ypL0Sl/5E9jnC4JJQxbQz/X5Rm7jrJQ7A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":310246},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"785d8656e62787f91cc87d296d3f33ff8351762c","scripts":{"dev":"tsx src/index.ts","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run typecheck && npm run lint && npm test && npm run build"},"_npmUser":{"name":"0x6d61","email":"0x6d61@gmail.com"},"repository":{"url":"git+https://github.com/0x6d61/wn-core.git","type":"git"},"_npmVersion":"10.9.4","description":"Lightweight AI Agent Core Framework","directories":{},"_nodeVersion":"22.22.0","dependencies":{"openai":"^6.25.0","@anthropic-ai/sdk":"^0.78.0","@google/generative-ai":"^0.24.1","@modelcontextprotocol/sdk":"^1.27.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","eslint":"^10.0.2","vitest":"^4.0.18","prettier":"^3.8.1","@eslint/js":"^10.0.1","typescript":"^5.9.3","@types/node":"^25.3.0","typescript-eslint":"^8.56.1","@vitest/coverage-v8":"^4.0.18","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/wn-core_0.1.5_1772235403678_0.07342584958755083","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@0x6d61/wn-core","version":"0.1.6","description":"Lightweight AI Agent Core Framework","type":"module","main":"dist/index.js","types":"dist/index.d.ts","bin":{"wn-core":"dist/cli.js"},"scripts":{"build":"tsup","dev":"tsx src/index.ts","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","lint":"eslint src/ tests/","lint:fix":"eslint src/ tests/ --fix","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","typecheck":"tsc --noEmit","prepublishOnly":"npm run typecheck && npm run lint && npm test && npm run build"},"engines":{"node":">=20"},"repository":{"type":"git","url":"git+https://github.com/0x6d61/wn-core.git"},"author":{"name":"0x6d61"},"license":"MIT","keywords":["ai","agent","llm","json-rpc","claude","openai","ollama","gemini","mcp"],"devDependencies":{"@eslint/js":"^10.0.1","@types/node":"^25.3.0","@vitest/coverage-v8":"^4.0.18","eslint":"^10.0.2","eslint-config-prettier":"^10.1.8","prettier":"^3.8.1","tsup":"^8.5.1","tsx":"^4.21.0","typescript":"^5.9.3","typescript-eslint":"^8.56.1","vitest":"^4.0.18"},"dependencies":{"@anthropic-ai/sdk":"^0.78.0","@google/generative-ai":"^0.24.1","@modelcontextprotocol/sdk":"^1.27.1","openai":"^6.25.0"},"_id":"@0x6d61/wn-core@0.1.6","gitHead":"f13ea9f9b618890eeaa290237d49d2037d7c1574","bugs":{"url":"https://github.com/0x6d61/wn-core/issues"},"homepage":"https://github.com/0x6d61/wn-core#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-SXZp8ezH5rI4e74uRVvo5uILZkv+7iaxWSA040BlAGHwed06PijqxNDT8xvnBBVQ4SEifncIzbOpnyh/b3kL5g==","shasum":"19f87be7fef2174a57bacbd81b095e9cc021e2bd","tarball":"https://registry.npmjs.org/@0x6d61/wn-core/-/wn-core-0.1.6.tgz","fileCount":19,"unpackedSize":315434,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA4yd8ne66sI0M77BWPGSsBDSMIzMm+RsA+jlNvkgJJUAiEAoYtoiECfaywNkUWOh3jtRZBPAZMPA1tnK8CLyyX3xps="}]},"_npmUser":{"name":"0x6d61","email":"0x6d61@gmail.com"},"directories":{},"maintainers":[{"name":"0x6d61","email":"0x6d61@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wn-core_0.1.6_1772278557598_0.5494584317714151"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-26T09:42:20.397Z","modified":"2026-02-28T11:35:57.867Z","0.1.0":"2026-02-26T09:42:20.629Z","0.1.2":"2026-02-26T13:12:32.927Z","0.1.3":"2026-02-26T19:55:25.369Z","0.1.4":"2026-02-26T20:55:56.461Z","0.1.5":"2026-02-27T23:36:43.843Z","0.1.6":"2026-02-28T11:35:57.754Z"},"bugs":{"url":"https://github.com/0x6d61/wn-core/issues"},"author":{"name":"0x6d61"},"license":"MIT","homepage":"https://github.com/0x6d61/wn-core#readme","keywords":["ai","agent","llm","json-rpc","claude","openai","ollama","gemini","mcp"],"repository":{"type":"git","url":"git+https://github.com/0x6d61/wn-core.git"},"description":"Lightweight AI Agent Core Framework","maintainers":[{"name":"0x6d61","email":"0x6d61@gmail.com"}],"readme":"# @0x6d61/wn-core\n\n[日本語](README.ja.md)\n\nLightweight AI Agent Core Framework for Node.js.\n\nBuild any AI agent by combining LLM providers, personas, skills, MCP tools, and built-in tools.\n\n## Features\n\n- **4 LLM Providers** — Claude, OpenAI, Ollama, and Gemini behind a unified interface\n- **Tool System** — Built-in tools (read / write / shell / grep) + MCP dynamic tool loading\n- **3-Layer Model** — Persona (system prompt) / Skill (action definition) / Agent (sub-agent) hierarchy\n- **JSON-RPC 2.0** — Core and UI communicate over stdin/stdout as separate processes\n- **Worker Threads** — Parallel sub-agent execution without blocking the main loop\n- **MCP Support** — Dynamically load tools from Model Context Protocol servers\n\n## Install\n\n```bash\nnpm install @0x6d61/wn-core\n```\n\nGlobal install (to use as CLI):\n\n```bash\nnpm install -g @0x6d61/wn-core\n```\n\n## Quick Start\n\n### CLI (JSON-RPC Server)\n\n```bash\nwn-core serve --provider claude --model claude-sonnet-4-20250514\n```\n\nListens on stdin/stdout for JSON-RPC 2.0 messages from a TUI or any client.\n\n```bash\n# Test: pipe a JSON-RPC message\necho '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"input\",\"params\":{\"text\":\"hello\"}}' | wn-core serve\n```\n\n### As a Library\n\n```typescript\nimport {\n  createClaudeProvider,\n  AgentLoop,\n  ToolRegistry,\n  createReadTool,\n  createWriteTool,\n  createShellTool,\n  createGrepTool,\n  createNoopHandler,\n} from '@0x6d61/wn-core'\n\n// 1. Create an LLM provider\nconst providerResult = createClaudeProvider(\n  { apiKey: process.env['ANTHROPIC_API_KEY'] },\n  'claude-sonnet-4-20250514',\n)\nif (!providerResult.ok) throw new Error(providerResult.error)\n\n// 2. Register built-in tools\nconst tools = new ToolRegistry()\ntools.register(createReadTool())\ntools.register(createWriteTool())\ntools.register(createShellTool())\ntools.register(createGrepTool())\n\n// 3. Build an AgentLoop\nconst loop = new AgentLoop({\n  provider: providerResult.data,\n  tools,\n  handler: createNoopHandler(),\n  systemMessage: 'You are a helpful assistant.',\n})\n\n// 4. Run a single conversation turn\nconst result = await loop.step('Read src/index.ts and summarize it')\nif (result.ok) {\n  console.log(result.data)\n}\n```\n\n## Configuration\n\nConfiguration is loaded from two levels: `~/.wn/config.json` (global) and `.wn/config.json` (project-local). CLI flags take the highest priority.\n\n```json\n{\n  \"defaultProvider\": \"claude\",\n  \"defaultModel\": \"claude-sonnet-4-20250514\",\n  \"defaultPersona\": \"default\",\n  \"providers\": {\n    \"claude\": { \"apiKey\": \"${ANTHROPIC_API_KEY}\" },\n    \"openai\": { \"apiKey\": \"${OPENAI_API_KEY}\" },\n    \"ollama\": { \"baseUrl\": \"http://localhost:11434\" },\n    \"gemini\": { \"apiKey\": \"${GEMINI_API_KEY}\" }\n  },\n  \"mcp\": {\n    \"servers\": [\n      {\n        \"name\": \"example\",\n        \"command\": \"npx\",\n        \"args\": [\"-y\", \"example-mcp-server\"]\n      }\n    ]\n  }\n}\n```\n\nAPI keys can reference environment variables using `${ENV_VAR}` syntax.\n\n**OAuth Token (authToken):** Claude provider also supports OAuth authentication via `authToken`. Use `authToken` instead of `apiKey` when authenticating with a Claude OAuth token:\n\n```json\n{\n  \"providers\": {\n    \"claude\": { \"authToken\": \"${ANTHROPIC_AUTH_TOKEN}\" }\n  }\n}\n```\n\n**Priority (highest to lowest):** CLI flags > project-local `.wn/` > global `~/.wn/`\n\n## Personas, Skills & Agents\n\nwn-core uses a 3-layer resource model. Resources are loaded from `~/.wn/` (global) and `.wn/` (project-local). Local resources override global ones with the same name.\n\n### Persona (System Prompt)\n\nA persona is a plain Markdown file that defines the system prompt for the LLM.\n\n**Directory:** `personas/`\n\n```\n~/.wn/personas/default.md\n.wn/personas/security-expert.md\n```\n\n**Example** (`personas/default.md`):\n\n```markdown\nYou are a helpful assistant.\nAnswer concisely and accurately.\n```\n\nNo frontmatter required — the entire file content becomes the system prompt. Select a persona by name (filename without `.md`) via `defaultPersona` in config or `--persona` CLI flag.\n\n### Skill (Action Definition)\n\nA skill defines a reusable action with a description, allowed tools, and instructions.\n\n**Directory:** `skills/<skill-name>/SKILL.md`\n\n```\n~/.wn/skills/code-review/SKILL.md\n.wn/skills/recon/SKILL.md\n```\n\n**Example** (`skills/code-review/SKILL.md`):\n\n```markdown\n---\nname: code-review\ndescription: Review source code for bugs and security issues\ntools: [read, grep, shell]\n---\n\n## Instructions\n\n1. Read the target files using the read tool.\n2. Check for common vulnerabilities (injection, XSS, etc.).\n3. Report findings with severity and remediation advice.\n```\n\n**Frontmatter fields:**\n\n| Field | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `name` | No | directory name | Skill identifier |\n| `description` | **Yes** | — | Short description of the skill |\n| `tools` | No | `[]` | List of tools the skill can use |\n\nThe body (after `---`) contains the detailed instructions.\n\n### Agent (Sub-Agent)\n\nAn agent definition configures a sub-agent with its own persona, skills, provider, and model.\n\n**Directory:** `agents/`\n\n```\n~/.wn/agents/scanner.md\n.wn/agents/code-reviewer.md\n```\n\n**Example** (`agents/scanner.md`):\n\n```markdown\n---\npersona: security-expert\nskills: [recon, port-scan]\nprovider: claude\nmodel: claude-sonnet-4-20250514\n---\n\nA sub-agent specialized in network reconnaissance.\nRuns port scans and service detection, then reports findings.\n```\n\n**Frontmatter fields:**\n\n| Field | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `name` | No | filename | Agent identifier |\n| `persona` | No | `\"\"` | Persona name to use as system prompt |\n| `skills` | No | `[]` | List of skills to enable |\n| `provider` | No | `\"\"` | LLM provider override |\n| `model` | No | `\"\"` | Model override |\n\nThe body becomes the agent's description.\n\n## Architecture\n\n```\nwn-tui (separate process) <-- JSON-RPC 2.0 --> wn-core\n                                                  |\n                                                  +-- AgentLoop\n                                                  +-- LLMProvider (Claude/OpenAI/Ollama/Gemini)\n                                                  +-- Loader (persona/skill/agent)\n                                                  +-- Tools (read/write/shell/grep + MCP)\n                                                  +-- SubAgentRunner (Worker Threads)\n                                                  +-- RPC Server (JSON-RPC 2.0)\n```\n\nSee [docs/architecture.md](docs/architecture.md) for details.\n\n## RPC Protocol\n\nCore and clients communicate via JSON-RPC 2.0 over stdin/stdout (NDJSON format).\n\n### Core -> Client (Notification)\n\n| Method | Params |\n|---|---|\n| `response` | `{ content: string }` |\n| `toolExec` | `{ event: 'start'\\|'end', name, args\\|result }` |\n| `stateChange` | `{ state: 'idle'\\|'thinking'\\|'tool_running' }` |\n| `log` | `{ level: 'info'\\|'warn'\\|'error', message }` |\n\n### Client -> Core (Request)\n\n| Method | Params | Result |\n|---|---|---|\n| `input` | `{ text: string }` | `{ accepted: boolean }` |\n| `abort` | `{}` | `{ aborted: boolean }` |\n| `configUpdate` | `{ persona?, provider?, model? }` | `{ applied: boolean }` |\n\n## Development\n\n```bash\nnpm install\nnpm test            # Run tests (344 tests)\nnpm run typecheck   # TypeScript type check\nnpm run lint        # ESLint\nnpm run build       # Build (tsup)\n```\n\n## Requirements\n\n- Node.js >= 20\n\n## License\n\nMIT\n","readmeFilename":"README.md"}