@oro.ad/nuxt-claude-devtools 1.0.7 → 1.1.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 +149 -13
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/{BpkYThsl.js → BRCY8pHC.js} +1 -1
- package/dist/client/_nuxt/BVHVIm9H.js +12 -0
- package/dist/client/_nuxt/BZrcCMrf.js +1 -0
- package/dist/client/_nuxt/BbEuL4Z6.js +1 -0
- package/dist/client/_nuxt/BmjlsnUc.js +1 -0
- package/dist/client/_nuxt/D2NL8Xro.js +7 -0
- package/dist/client/_nuxt/D9qGFoJm.js +4 -0
- package/dist/client/_nuxt/DImlDIT-.js +59 -0
- package/dist/client/_nuxt/{B1H6wO_D.js → DV075BoS.js} +1 -1
- package/dist/client/_nuxt/{D-z88P1l.js → DYNukx3V.js} +1 -1
- package/dist/client/_nuxt/Dbw96V2H.js +7 -0
- package/dist/client/_nuxt/FllXIyfS.js +8 -0
- package/dist/client/_nuxt/MarkdownContent.WwTYmYZK.css +1 -0
- package/dist/client/_nuxt/TvBJGid1.js +1 -0
- package/dist/client/_nuxt/XJ4dJUK2.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/e8ae4dbb-462d-47a2-9aa2-50bed9498ab2.json +1 -0
- package/dist/client/_nuxt/e7kgpy_n.js +4 -0
- package/dist/client/_nuxt/entry.DwDQaFYc.css +1 -0
- package/dist/client/_nuxt/index.Bomb3OYy.css +1 -0
- package/dist/client/agents/index.html +1 -0
- package/dist/client/commands/index.html +1 -0
- package/dist/client/docs/index.html +1 -0
- package/dist/client/index.html +1 -1
- package/dist/client/mcp/index.html +1 -1
- package/dist/client/skills/index.html +1 -0
- package/dist/module.json +1 -1
- package/dist/runtime/server/agents-manager.d.ts +31 -0
- package/dist/runtime/server/agents-manager.js +193 -0
- package/dist/runtime/server/claude-session.d.ts +15 -0
- package/dist/runtime/server/claude-session.js +456 -5
- package/dist/runtime/server/commands-manager.d.ts +24 -0
- package/dist/runtime/server/commands-manager.js +132 -0
- package/dist/runtime/server/docs-manager.d.ts +48 -0
- package/dist/runtime/server/docs-manager.js +189 -0
- package/dist/runtime/server/history-manager.d.ts +24 -0
- package/dist/runtime/server/history-manager.js +184 -0
- package/dist/runtime/server/skills-manager.d.ts +36 -0
- package/dist/runtime/server/skills-manager.js +210 -0
- package/dist/runtime/types.d.ts +156 -0
- package/dist/runtime/types.js +0 -0
- package/package.json +16 -1
- package/dist/client/_nuxt/C2ORx7Gd.js +0 -1
- package/dist/client/_nuxt/CfGtRVGd.js +0 -4
- package/dist/client/_nuxt/DJn_CTvm.js +0 -1
- package/dist/client/_nuxt/EMyRkg8p.js +0 -1
- package/dist/client/_nuxt/PGt8fA_Y.js +0 -1
- package/dist/client/_nuxt/builds/meta/88c99fa0-10e0-4015-a61a-e0c6d7a01859.json +0 -1
- package/dist/client/_nuxt/entry.Ci1n7Rlt.css +0 -1
package/README.md
CHANGED
|
@@ -5,19 +5,24 @@
|
|
|
5
5
|
[![License][license-src]][license-href]
|
|
6
6
|
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
7
|
|
|
8
|
-
Nuxt DevTools integration for [Claude Code](https://claude.
|
|
8
|
+
Nuxt DevTools integration for [Claude Code](https://claude.ai/code) AI assistant. Chat with Claude directly from your Nuxt DevTools panel with full support for skills, agents, and slash commands.
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
- **Chat Interface** — Interactive chat with Claude AI directly in DevTools
|
|
13
13
|
- **Streaming Responses** — Real-time streaming output from Claude
|
|
14
14
|
- **Session Management** — Start new conversations or continue previous ones
|
|
15
|
+
- **Chat History** — Browse and restore previous conversations
|
|
16
|
+
- **Skills** — Markdown-based skills to extend Claude's capabilities (`.claude/skills/<name>/SKILL.md`)
|
|
17
|
+
- **Subagents** — Specialized AI agents for delegated tasks (`.claude/agents/<name>.md`)
|
|
18
|
+
- **Slash Commands** — Custom commands with YAML frontmatter (`.claude/commands/<name>.md`)
|
|
19
|
+
- **Documentation** — Manage project docs that Claude can reference (`.claude/docs/`)
|
|
15
20
|
- **MCP Servers** — Manage Model Context Protocol servers (add, remove, list)
|
|
16
|
-
- **
|
|
21
|
+
- **Tunnel Support** — Remote access via cloudflared tunnel
|
|
17
22
|
|
|
18
23
|
## Prerequisites
|
|
19
24
|
|
|
20
|
-
- [Claude Code CLI](https://claude.
|
|
25
|
+
- [Claude Code CLI](https://claude.ai/code) must be installed and authenticated
|
|
21
26
|
- Nuxt 3.x or 4.x with DevTools enabled
|
|
22
27
|
|
|
23
28
|
## Quick Setup
|
|
@@ -76,6 +81,94 @@ export default defineNuxtConfig({
|
|
|
76
81
|
|
|
77
82
|
The module automatically uses `--continue` for follow-up messages within a session. Click "New Chat" to start a fresh conversation.
|
|
78
83
|
|
|
84
|
+
### Skills
|
|
85
|
+
|
|
86
|
+
Skills extend Claude's capabilities with specialized knowledge. Create markdown files with YAML frontmatter:
|
|
87
|
+
|
|
88
|
+
**Location:** `.claude/skills/<skill-name>/SKILL.md`
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
---
|
|
92
|
+
description: Vue 3 Composition API expert
|
|
93
|
+
model: sonnet
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
You are an expert in Vue 3 Composition API...
|
|
97
|
+
|
|
98
|
+
## Guidelines
|
|
99
|
+
- Always use `<script setup lang="ts">`
|
|
100
|
+
- Follow TypeScript best practices
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Frontmatter options:**
|
|
104
|
+
| Field | Description |
|
|
105
|
+
|-------|-------------|
|
|
106
|
+
| `description` | Brief description (required) |
|
|
107
|
+
| `model` | Model to use: `sonnet`, `opus`, `haiku` |
|
|
108
|
+
| `argumentHint` | Hint for skill arguments (e.g., `<query>`) |
|
|
109
|
+
|
|
110
|
+
### Subagents
|
|
111
|
+
|
|
112
|
+
Subagents are specialized AI agents that Claude can delegate tasks to:
|
|
113
|
+
|
|
114
|
+
**Location:** `.claude/agents/<agent-name>.md`
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
---
|
|
118
|
+
name: code-reviewer
|
|
119
|
+
description: Reviews code for quality and best practices
|
|
120
|
+
model: sonnet
|
|
121
|
+
tools: Read, Grep, Glob
|
|
122
|
+
skills:
|
|
123
|
+
- typescript-strict
|
|
124
|
+
- vue-composition-api
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
You are a code reviewer. Your job is to:
|
|
128
|
+
1. Review code for bugs and issues
|
|
129
|
+
2. Suggest improvements
|
|
130
|
+
3. Check for security vulnerabilities
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Frontmatter options:**
|
|
134
|
+
| Field | Description |
|
|
135
|
+
|-------|-------------|
|
|
136
|
+
| `name` | Agent name (kebab-case) |
|
|
137
|
+
| `description` | Brief description |
|
|
138
|
+
| `model` | Model: `sonnet`, `opus`, `haiku` |
|
|
139
|
+
| `tools` | Comma-separated list of allowed tools |
|
|
140
|
+
| `disallowedTools` | Tools to exclude |
|
|
141
|
+
| `skills` | Array of skill names to preload |
|
|
142
|
+
| `permissionMode` | `default`, `acceptEdits`, `dontAsk`, `bypassPermissions`, `plan` |
|
|
143
|
+
|
|
144
|
+
### Slash Commands
|
|
145
|
+
|
|
146
|
+
Create custom commands with markdown and YAML frontmatter:
|
|
147
|
+
|
|
148
|
+
**Location:** `.claude/commands/<command-name>.md`
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
---
|
|
152
|
+
description: Generate a Vue component
|
|
153
|
+
allowedTools: Read, Write, Edit
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
Generate a Vue 3 component with:
|
|
157
|
+
- `<script setup lang="ts">`
|
|
158
|
+
- Typed props with `defineProps<T>()`
|
|
159
|
+
- CSS variables for styling
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Invoke with `/<command-name>` in the chat.
|
|
163
|
+
|
|
164
|
+
### Documentation
|
|
165
|
+
|
|
166
|
+
Store project documentation that Claude can reference:
|
|
167
|
+
|
|
168
|
+
**Location:** `.claude/docs/`
|
|
169
|
+
|
|
170
|
+
Create markdown files for architecture, components, API reference, etc. Claude will use these as context when answering questions about your project.
|
|
171
|
+
|
|
79
172
|
### MCP Servers
|
|
80
173
|
|
|
81
174
|
Manage Model Context Protocol servers directly from DevTools:
|
|
@@ -97,20 +190,52 @@ Example MCP servers:
|
|
|
97
190
|
│ ┌───────────────────────────────────────────────────┐ │
|
|
98
191
|
│ │ Claude DevTools Panel │ │
|
|
99
192
|
│ │ (iframe at /__claude-devtools) │ │
|
|
193
|
+
│ │ │ │
|
|
194
|
+
│ │ Pages: │ │
|
|
195
|
+
│ │ - / Chat interface │ │
|
|
196
|
+
│ │ - /skills Skills manager │ │
|
|
197
|
+
│ │ - /agents Subagents manager │ │
|
|
198
|
+
│ │ - /commands Slash commands manager │ │
|
|
199
|
+
│ │ - /docs Documentation viewer │ │
|
|
200
|
+
│ │ - /mcp MCP servers config │ │
|
|
100
201
|
│ └───────────────────────────────────────────────────┘ │
|
|
101
202
|
└─────────────────────────────────────────────────────────┘
|
|
102
203
|
│
|
|
103
|
-
│ Socket.IO
|
|
204
|
+
│ Socket.IO
|
|
104
205
|
▼
|
|
105
206
|
┌─────────────────────────────────────────────────────────┐
|
|
106
207
|
│ Claude Session Server │
|
|
107
208
|
│ ┌─────────────────┐ ┌─────────────────────────────┐│
|
|
108
209
|
│ │ Socket.IO Hub │───▶│ Claude CLI Process ││
|
|
109
210
|
│ │ │ │ (spawn with --continue) ││
|
|
110
|
-
│
|
|
211
|
+
│ │ Managers: │ └─────────────────────────────┘│
|
|
212
|
+
│ │ - Skills │ │
|
|
213
|
+
│ │ - Agents │ ┌─────────────────────────────┐│
|
|
214
|
+
│ │ - Commands │ │ File Storage ││
|
|
215
|
+
│ │ - Docs │ │ .claude/skills/ ││
|
|
216
|
+
│ │ - History │ │ .claude/agents/ ││
|
|
217
|
+
│ └─────────────────┘ │ .claude/commands/ ││
|
|
218
|
+
│ │ .claude/docs/ ││
|
|
219
|
+
│ └─────────────────────────────┘│
|
|
111
220
|
└─────────────────────────────────────────────────────────┘
|
|
112
221
|
```
|
|
113
222
|
|
|
223
|
+
## File Structure
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
.claude/
|
|
227
|
+
├── settings.local.json # Local permissions
|
|
228
|
+
├── skills/ # Skills (markdown)
|
|
229
|
+
│ └── <skill-name>/
|
|
230
|
+
│ └── SKILL.md
|
|
231
|
+
├── agents/ # Subagents (markdown)
|
|
232
|
+
│ └── <agent-name>.md
|
|
233
|
+
├── commands/ # Slash commands (markdown)
|
|
234
|
+
│ └── <command-name>.md
|
|
235
|
+
└── docs/ # Documentation
|
|
236
|
+
└── *.md
|
|
237
|
+
```
|
|
238
|
+
|
|
114
239
|
## Development
|
|
115
240
|
|
|
116
241
|
```bash
|
|
@@ -139,24 +264,35 @@ npm run lint
|
|
|
139
264
|
|
|
140
265
|
```
|
|
141
266
|
├── src/
|
|
142
|
-
│ ├── module.ts
|
|
143
|
-
│ ├── devtools.ts
|
|
267
|
+
│ ├── module.ts # Nuxt module definition
|
|
268
|
+
│ ├── devtools.ts # DevTools UI setup
|
|
144
269
|
│ └── runtime/
|
|
270
|
+
│ ├── logger.ts # Logging utility
|
|
145
271
|
│ └── server/
|
|
146
|
-
│
|
|
147
|
-
├──
|
|
272
|
+
│ ├── claude-session.ts # Socket.IO server & Claude process
|
|
273
|
+
│ ├── skills-manager.ts # Skills CRUD operations
|
|
274
|
+
│ ├── agents-manager.ts # Agents CRUD operations
|
|
275
|
+
│ ├── commands-manager.ts # Commands CRUD operations
|
|
276
|
+
│ ├── docs-manager.ts # Documentation management
|
|
277
|
+
│ └── history-manager.ts # Chat history management
|
|
278
|
+
├── client/ # DevTools panel UI (Nuxt app)
|
|
148
279
|
│ ├── pages/
|
|
149
|
-
│ │ ├── index.vue
|
|
150
|
-
│ │
|
|
280
|
+
│ │ ├── index.vue # Chat interface
|
|
281
|
+
│ │ ├── skills.vue # Skills manager
|
|
282
|
+
│ │ ├── agents.vue # Subagents manager
|
|
283
|
+
│ │ ├── commands.vue # Slash commands manager
|
|
284
|
+
│ │ ├── docs.vue # Documentation viewer
|
|
285
|
+
│ │ └── mcp.vue # MCP servers management
|
|
151
286
|
│ └── nuxt.config.ts
|
|
152
|
-
└── playground/
|
|
287
|
+
└── playground/ # Development playground
|
|
153
288
|
```
|
|
154
289
|
|
|
155
290
|
## Security Notes
|
|
156
291
|
|
|
157
292
|
- The module only runs in development mode (`nuxt.options.dev`)
|
|
158
293
|
- Uses `--dangerously-skip-permissions` flag for Claude CLI (development only)
|
|
159
|
-
- Socket.IO server runs on a
|
|
294
|
+
- Socket.IO server runs on a dedicated port
|
|
295
|
+
- All file operations are scoped to `.claude/` directory
|
|
160
296
|
|
|
161
297
|
## License
|
|
162
298
|
|
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.DwDQaFYc.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/e7kgpy_n.js"><script type="module" src="/__claude-devtools/_nuxt/e7kgpy_n.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"e8ae4dbb-462d-47a2-9aa2-50bed9498ab2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1768962606353,false]</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.DwDQaFYc.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/e7kgpy_n.js"><script type="module" src="/__claude-devtools/_nuxt/e7kgpy_n.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"e8ae4dbb-462d-47a2-9aa2-50bed9498ab2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1768962606353,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o,c as s,o as a,a as t,t as r}from"./
|
|
1
|
+
import{_ as o,c as s,o as a,a as t,t as r}from"./e7kgpy_n.js";import{u as i}from"./DYNukx3V.js";const u={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},c={class:"max-w-520px text-center"},l=["textContent"],d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Internal server error"},description:{type:String,default:"This page is temporarily unavailable."},refresh:{type:String,default:"Refresh this page"}},setup(e){const n=e;return i({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(g,h)=>(a(),s("div",u,[t("div",c,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:r(e.statusCode)},null,8,l),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:r(e.statusMessage)},null,8,d),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:r(e.description)},null,8,p)])]))}},x=o(f,[["__scopeId","data-v-c415ba6a"]]);export{x as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{_ as ve}from"./TvBJGid1.js";import{u as me,l as fe,a as pe,_ as be,b as xe}from"./XJ4dJUK2.js";import{_ as ge}from"./DImlDIT-.js";import{_ as ye}from"./BZrcCMrf.js";import{g as ke,r as c,q as _e,j as Ce,k as we,c as i,a as t,b as l,w as u,d as o,n as E,T as Le,o as n,l as x,t as p,s as Y,F as _,m as G,x as H,p as J,y as De}from"./e7kgpy_n.js";const Ue={class:"relative flex flex-col h-screen n-bg-base"},he={class:"flex items-center justify-between p-4"},Ae={class:"flex items-center gap-3"},Se={class:"text-xl font-bold flex items-center gap-2"},Ee={class:"flex items-center gap-2"},Ve={class:"px-4 flex gap-2 border-b border-neutral-200 dark:border-neutral-800"},Me={class:"flex-1 overflow-auto p-4"},Ne={key:0,class:"h-full flex flex-col"},je={class:"flex items-center justify-between mb-4"},$e={class:"text-lg font-semibold flex items-center gap-2"},Te={key:0,class:"text-xs opacity-40 mt-1"},Fe={class:"flex gap-2"},Pe={key:0,class:"mb-4"},Re={class:"flex-1 n-bg-active rounded-lg overflow-hidden"},Be={key:1,class:"h-full p-4 overflow-auto"},ze={key:2,class:"h-full flex items-center justify-center opacity-50"},Ie={class:"text-center"},We={key:1,class:"flex gap-4 h-full"},qe={class:"w-64 flex-shrink-0 space-y-4"},Ye={key:0,class:"n-bg-active rounded-lg p-4 opacity-50 text-sm"},Ge={key:0,class:"text-xs opacity-50 font-medium px-2 pt-2"},He=["onClick"],Je={class:"flex items-center justify-between"},Ke={class:"flex items-center gap-2 truncate"},Oe={class:"truncate"},Qe={class:"text-xs opacity-40 pl-6"},Xe={class:"flex-1 flex flex-col n-bg-active rounded-lg overflow-hidden"},Ze={class:"p-4 border-b border-neutral-200 dark:border-neutral-800"},et={key:0,class:"mb-4"},tt={class:"space-y-4"},lt={class:"flex-1 p-4"},ot={class:"p-4 border-t border-neutral-200 dark:border-neutral-800 flex gap-2"},nt={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between"},st={class:"font-bold"},at={class:"text-xs opacity-50"},it={class:"flex gap-2"},dt={class:"flex-1 p-4 overflow-auto"},ut={key:2,class:"flex-1 flex items-center justify-center opacity-50"},rt={class:"text-center"},ct={key:2,class:"space-y-4"},vt={key:0,class:"n-bg-active rounded-lg p-4"},mt={key:0,class:"mb-4"},ft={class:"space-y-4"},pt={class:"flex gap-2"},bt={key:1,class:"n-bg-active rounded-lg p-4 opacity-50"},xt={key:2,class:"space-y-2"},gt={class:"flex items-start justify-between"},yt={class:"flex-1"},kt={class:"font-bold flex items-center gap-2"},_t={class:"text-sm opacity-70 font-mono mt-1"},Ct={key:0,class:"text-sm opacity-50 mt-1"},wt={class:"text-xs opacity-40 mt-2"},Et=ke({__name:"docs",setup(Lt){const I=me(),a=c(null),C=c(!1),V=c(!1),W=c([]),v=c(null),y=c(!1),g=c(""),M=c(!1),w=c(""),N=c(""),q=c([]),U=c(!1),h=c(""),j=c(""),$=c(""),A=c(""),T=c(!1),F=c(null),S=c(!1),k=c(""),m=c(""),b=c("claudemd"),Q=_e(()=>{const d={"":[]};for(const e of W.value){const R=e.path.split("/");if(R.length>1){const r=R.slice(0,-1).join("/");d[r]||(d[r]=[]),d[r].push(e)}else d[""].push(e)}return d});function X(){return I.isActive.value&&I.origin.value?I.origin.value:window.location.origin}function Z(){const d=X();console.log("[docs-client] Connecting to socket at",d),a.value=fe(d,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),a.value.on("connect",()=>{console.log("[docs-client] Connected"),C.value=!0,K()}),a.value.on("disconnect",()=>{console.log("[docs-client] Disconnected"),C.value=!1}),a.value.on("docs:list",e=>{console.log("[docs-client] Docs list received",e.length),W.value=e,V.value=!1}),a.value.on("docs:file",e=>{e&&(v.value=e,g.value=e.content)}),a.value.on("docs:saved",e=>{e.success&&e.file?(v.value=e.file,g.value=e.file.content,y.value=!1,M.value=!1,w.value="",N.value="",m.value=""):m.value=e.error||"Failed to save"}),a.value.on("docs:deleted",e=>{e.success&&v.value?.path===e.path&&(v.value=null,y.value=!1)}),a.value.on("llms:list",e=>{console.log("[docs-client] LLMS list received",e.length),q.value=e}),a.value.on("llms:added",e=>{e.success?(U.value=!1,h.value="",j.value="",$.value="",m.value=""):m.value=e.error||"Failed to add"}),a.value.on("claudemd:data",e=>{console.log("[docs-client] CLAUDE.md data received",e.exists),A.value=e.content,T.value=e.exists,F.value=e.updatedAt,k.value=e.content}),a.value.on("claudemd:saved",e=>{e.success?(A.value=e.content||"",T.value=!0,F.value=e.updatedAt||null,k.value=e.content||"",S.value=!1,m.value=""):m.value=e.error||"Failed to save"})}function K(){a.value&&(V.value=!0,a.value.emit("docs:list"),a.value.emit("llms:list"),a.value.emit("claudemd:get"))}function ee(){k.value=A.value,S.value=!0}function te(){a.value&&a.value.emit("claudemd:save",k.value)}function le(){k.value=A.value,S.value=!1}function oe(d){v.value=d,g.value=d.content,y.value=!1}function ne(){v.value&&(g.value=v.value.content,y.value=!0)}function se(){a.value&&v.value&&a.value.emit("docs:save",{path:v.value.path,content:g.value})}function ae(){v.value&&(g.value=v.value.content),y.value=!1}function ie(){if(!w.value.trim()){m.value="Path is required";return}a.value&&a.value.emit("docs:save",{path:w.value.trim(),content:N.value||`# ${w.value.split("/").pop()?.replace(".md","")||"New Doc"}
|
|
2
|
+
|
|
3
|
+
`})}function de(d){confirm(`Delete "${d}"?`)&&a.value&&a.value.emit("docs:delete",d)}function ue(){if(!h.value.trim()){m.value="URL is required";return}let d=h.value.trim();!d.startsWith("http://")&&!d.startsWith("https://")&&(d="https://"+d),a.value&&a.value.emit("llms:add",{url:d,title:j.value.trim()||void 0,description:$.value.trim()||void 0})}function re(d){confirm(`Remove "${d}"?`)&&a.value&&a.value.emit("llms:remove",d)}function P(d){return new Date(d).toLocaleDateString()}return Ce(()=>{Z()}),we(()=>{a.value&&a.value.disconnect()}),(d,e)=>{const R=ve,r=be,f=pe,L=xe,O=ge,B=ye;return n(),i("div",Ue,[t("div",he,[t("div",Ae,[l(R,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:u(()=>[...e[14]||(e[14]=[o(" ← Chat ",-1)])]),_:1}),t("h1",Se,[l(r,{class:"text-purple",icon:"carbon:document"}),e[15]||(e[15]=o(" Docs & LLMS ",-1))])]),t("div",Ee,[l(f,{disabled:!C.value||V.value,n:"gray",onClick:K},{default:u(()=>[l(r,{class:E([{"animate-spin":V.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[16]||(e[16]=o(" Refresh ",-1))]),_:1},8,["disabled"])])]),t("div",Ve,[t("button",{class:E([b.value==="claudemd"?"border-b-2 border-green-500 text-green-500":"opacity-60","px-4 py-2 font-medium"]),onClick:e[0]||(e[0]=s=>b.value="claudemd")},[l(r,{class:"mr-1",icon:"carbon:document-tasks"}),e[17]||(e[17]=o(" CLAUDE.md ",-1))],2),t("button",{class:E([b.value==="docs"?"border-b-2 border-purple-500 text-purple-500":"opacity-60","px-4 py-2 font-medium"]),onClick:e[1]||(e[1]=s=>b.value="docs")},[l(r,{class:"mr-1",icon:"carbon:folder"}),e[18]||(e[18]=o(" .claude/docs ",-1))],2),t("button",{class:E([b.value==="llms"?"border-b-2 border-blue-500 text-blue-500":"opacity-60","px-4 py-2 font-medium"]),onClick:e[2]||(e[2]=s=>b.value="llms")},[l(r,{class:"mr-1",icon:"carbon:link"}),e[19]||(e[19]=o(" LLMS Sources ",-1))],2)]),t("div",Me,[l(Le,{appear:"",mode:"out-in",name:"page"},{default:u(()=>[b.value==="claudemd"?(n(),i("div",Ne,[t("div",je,[t("div",null,[t("h2",$e,[l(r,{icon:"carbon:document-tasks"}),e[20]||(e[20]=o(" CLAUDE.md ",-1))]),e[21]||(e[21]=t("p",{class:"text-sm opacity-50"}," Project-level instructions for Claude. Located at project root. ",-1)),F.value?(n(),i("p",Te," Updated: "+p(P(F.value)),1)):x("",!0)]),t("div",Fe,[S.value?(n(),i(_,{key:0},[l(f,{n:"green",onClick:te},{default:u(()=>[l(r,{class:"mr-1",icon:"carbon:save"}),e[22]||(e[22]=o(" Save ",-1))]),_:1}),l(f,{n:"gray",onClick:le},{default:u(()=>[...e[23]||(e[23]=[o(" Cancel ",-1)])]),_:1})],64)):(n(),Y(f,{key:1,disabled:!C.value,n:"blue",onClick:ee},{default:u(()=>[l(r,{class:"mr-1",icon:"carbon:edit"}),o(" "+p(T.value?"Edit":"Create"),1)]),_:1},8,["disabled"]))])]),m.value&&b.value==="claudemd"?(n(),i("div",Pe,[l(L,{icon:"carbon:warning",n:"red"},{default:u(()=>[o(p(m.value),1)]),_:1})])):x("",!0),t("div",Re,[S.value?G((n(),i("textarea",{key:0,"onUpdate:modelValue":e[3]||(e[3]=s=>k.value=s),class:"w-full h-full p-4 font-mono text-sm n-bg-base resize-none focus:outline-none",placeholder:`# CLAUDE.md
|
|
4
|
+
|
|
5
|
+
Write project-level instructions for Claude here...
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
- This is a Vue 3 + Nuxt project
|
|
9
|
+
- Use TypeScript
|
|
10
|
+
- Follow existing code style`},null,512)),[[H,k.value]]):T.value?(n(),i("div",Be,[l(O,{content:A.value,class:"max-w-none"},null,8,["content"])])):(n(),i("div",ze,[t("div",Ie,[l(r,{class:"text-4xl mb-2",icon:"carbon:document-add"}),e[24]||(e[24]=t("p",null,"No CLAUDE.md file yet",-1)),e[25]||(e[25]=t("p",{class:"text-sm"},' Click "Create" to add project instructions ',-1))])]))]),l(L,{class:"mt-4",icon:"carbon:information",n:"gray"},{default:u(()=>[...e[26]||(e[26]=[o(" CLAUDE.md contains project-level instructions that Claude reads automatically. Use it to define coding standards, project structure, and preferences. ",-1)])]),_:1})])):b.value==="docs"?(n(),i("div",We,[t("div",qe,[l(f,{disabled:!C.value,class:"w-full",n:"purple",onClick:e[4]||(e[4]=s=>{M.value=!0,v.value=null})},{default:u(()=>[l(r,{class:"mr-1",icon:"carbon:add"}),e[27]||(e[27]=o(" New Doc ",-1))]),_:1},8,["disabled"]),l(L,{class:"text-xs",icon:"carbon:information",n:"gray"},{default:u(()=>[...e[28]||(e[28]=[o(" Files are stored in ",-1),t("code",{class:"font-mono"},".claude/docs/",-1),t("br",null,null,-1),o(" Use ",-1),t("code",{class:"font-mono text-blue-500"},"@docs/filename",-1),o(" in chat to attach. ",-1)])]),_:1}),W.value.length===0?(n(),i("div",Ye,[...e[29]||(e[29]=[o(" No doc files yet. ",-1),t("br",null,null,-1),o(" Create one to get started. ",-1)])])):x("",!0),(n(!0),i(_,null,J(Q.value,(s,z)=>(n(),i("div",{key:z,class:"space-y-1"},[z?(n(),i("div",Ge,p(z)+"/ ",1)):x("",!0),(n(!0),i(_,null,J(s,D=>(n(),i("div",{key:D.path,class:E([v.value?.path===D.path?"n-bg-active ring-1 ring-purple-500":"hover:n-bg-active","rounded-lg p-2 cursor-pointer group"]),onClick:ce=>oe(D)},[t("div",Je,[t("div",Ke,[l(r,{class:"opacity-50",icon:"carbon:document"}),t("span",Oe,p(D.name),1)]),l(f,{class:"opacity-0 group-hover:opacity-100",n:"red xs",onClick:De(ce=>de(D.path),["stop"])},{default:u(()=>[l(r,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]),t("div",Qe,p(P(D.updatedAt)),1)],10,He))),128))]))),128))]),t("div",Xe,[M.value?(n(),i(_,{key:0},[t("div",Ze,[e[32]||(e[32]=t("h3",{class:"font-bold mb-4"}," Create New Doc ",-1)),m.value?(n(),i("div",et,[l(L,{icon:"carbon:warning",n:"red"},{default:u(()=>[o(p(m.value),1)]),_:1})])):x("",!0),t("div",tt,[t("div",null,[e[30]||(e[30]=t("label",{class:"block text-sm font-medium mb-1"},"Path",-1)),l(B,{modelValue:w.value,"onUpdate:modelValue":e[5]||(e[5]=s=>w.value=s),class:"w-full font-mono",placeholder:"e.g. api/endpoints.md or readme.md"},null,8,["modelValue"]),e[31]||(e[31]=t("div",{class:"text-xs opacity-50 mt-1"}," Use / for subdirectories. .md extension added automatically. ",-1))])])]),t("div",lt,[e[33]||(e[33]=t("label",{class:"block text-sm font-medium mb-1"},"Content (optional)",-1)),G(t("textarea",{"onUpdate:modelValue":e[6]||(e[6]=s=>N.value=s),class:"w-full h-full min-h-[200px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none",placeholder:`# Your doc title
|
|
11
|
+
|
|
12
|
+
Write your documentation here...`},null,512),[[H,N.value]])]),t("div",ot,[l(f,{n:"purple",onClick:ie},{default:u(()=>[...e[34]||(e[34]=[o(" Create ",-1)])]),_:1}),l(f,{n:"gray",onClick:e[7]||(e[7]=s=>{M.value=!1,m.value=""})},{default:u(()=>[...e[35]||(e[35]=[o(" Cancel ",-1)])]),_:1})])],64)):v.value?(n(),i(_,{key:1},[t("div",nt,[t("div",null,[t("h3",st,p(v.value.path),1),t("div",at," Updated: "+p(P(v.value.updatedAt)),1)]),t("div",it,[y.value?(n(),i(_,{key:0},[l(f,{n:"green",onClick:se},{default:u(()=>[l(r,{class:"mr-1",icon:"carbon:save"}),e[36]||(e[36]=o(" Save ",-1))]),_:1}),l(f,{n:"gray",onClick:ae},{default:u(()=>[...e[37]||(e[37]=[o(" Cancel ",-1)])]),_:1})],64)):(n(),Y(f,{key:1,n:"blue",onClick:ne},{default:u(()=>[l(r,{class:"mr-1",icon:"carbon:edit"}),e[38]||(e[38]=o(" Edit ",-1))]),_:1}))])]),t("div",dt,[y.value?G((n(),i("textarea",{key:0,"onUpdate:modelValue":e[8]||(e[8]=s=>g.value=s),class:"w-full h-full min-h-[300px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none"},null,512)),[[H,g.value]]):(n(),Y(O,{key:1,content:v.value.content,class:"max-w-none"},null,8,["content"]))])],64)):(n(),i("div",ut,[t("div",rt,[l(r,{class:"text-4xl mb-2",icon:"carbon:document"}),e[39]||(e[39]=t("p",null,"Select a doc file or create a new one",-1))])]))])])):b.value==="llms"?(n(),i("div",ct,[l(f,{disabled:!C.value,n:"blue",onClick:e[9]||(e[9]=s=>U.value=!0)},{default:u(()=>[l(r,{class:"mr-1",icon:"carbon:add"}),e[40]||(e[40]=o(" Add LLMS Source ",-1))]),_:1},8,["disabled"]),U.value?(n(),i("div",vt,[e[47]||(e[47]=t("h3",{class:"font-bold mb-4"}," Add LLMS Source ",-1)),m.value?(n(),i("div",mt,[l(L,{icon:"carbon:warning",n:"red"},{default:u(()=>[o(p(m.value),1)]),_:1})])):x("",!0),t("div",ft,[t("div",null,[e[41]||(e[41]=t("label",{class:"block text-sm font-medium mb-1"},"URL",-1)),l(B,{modelValue:h.value,"onUpdate:modelValue":e[10]||(e[10]=s=>h.value=s),class:"w-full font-mono",placeholder:"e.g. https://example.com/llms.txt"},null,8,["modelValue"]),e[42]||(e[42]=t("div",{class:"text-xs opacity-50 mt-1"}," URL to the llms.txt file ",-1))]),t("div",null,[e[43]||(e[43]=t("label",{class:"block text-sm font-medium mb-1"},"Title (optional)",-1)),l(B,{modelValue:j.value,"onUpdate:modelValue":e[11]||(e[11]=s=>j.value=s),class:"w-full",placeholder:"e.g. Example Documentation"},null,8,["modelValue"])]),t("div",null,[e[44]||(e[44]=t("label",{class:"block text-sm font-medium mb-1"},"Description (optional)",-1)),l(B,{modelValue:$.value,"onUpdate:modelValue":e[12]||(e[12]=s=>$.value=s),class:"w-full",placeholder:"e.g. API documentation and guides"},null,8,["modelValue"])]),t("div",pt,[l(f,{n:"blue",onClick:ue},{default:u(()=>[...e[45]||(e[45]=[o(" Add ",-1)])]),_:1}),l(f,{n:"gray",onClick:e[13]||(e[13]=s=>{U.value=!1,m.value=""})},{default:u(()=>[...e[46]||(e[46]=[o(" Cancel ",-1)])]),_:1})])])])):x("",!0),q.value.length===0&&!U.value?(n(),i("div",bt,[...e[48]||(e[48]=[o(" No LLMS sources configured. ",-1),t("br",null,null,-1),o(" Add external llms.txt URLs to provide context to Claude. ",-1)])])):(n(),i("div",xt,[(n(!0),i(_,null,J(q.value,s=>(n(),i("div",{key:s.url,class:"n-bg-active rounded-lg p-4"},[t("div",gt,[t("div",yt,[t("div",kt,[l(r,{class:"text-blue",icon:"carbon:link"}),o(" "+p(s.title||s.domain),1)]),t("div",_t,p(s.url),1),s.description?(n(),i("div",Ct,p(s.description),1)):x("",!0),t("div",wt," Added: "+p(P(s.addedAt)),1)]),l(f,{n:"red",onClick:z=>re(s.url)},{default:u(()=>[l(r,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])])]))),128))])),l(L,{icon:"carbon:information",n:"blue"},{default:u(()=>[...e[49]||(e[49]=[o(" LLMS sources are external llms.txt files that provide documentation context. Claude can use these to better understand APIs and libraries you're working with. ",-1)])]),_:1})])):x("",!0)]),_:1})])])}}});export{Et as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as N}from"./XJ4dJUK2.js";import{G as _,r as h,B as S,D as B,q as V,c as w,o as $,H as k,m as D,s as I,l as J,I as C,C as E,a as G,J as O,K as T}from"./e7kgpy_n.js";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const F=n=>typeof n<"u";function M(n){return JSON.parse(JSON.stringify(n))}function U(n,s,f,m={}){var i,o;const{clone:l=!1,passive:c=!1,eventName:d,deep:p=!1,defaultValue:q,shouldEmit:v}=m,e=_(),y=f||e?.emit||(e==null||(i=e.$emit)===null||i===void 0?void 0:i.bind(e))||(e==null||(o=e.proxy)===null||o===void 0||(o=o.$emit)===null||o===void 0?void 0:o.bind(e?.proxy));let r=d;r=r||`update:${s.toString()}`;const g=t=>l?typeof l=="function"?l(t):M(t):t,b=()=>F(n[s])?g(n[s]):q,x=t=>{v?v(t)&&y(r,t):y(r,t)};if(c){const t=h(b());let a=!1;return S(()=>n[s],u=>{a||(a=!0,t.value=g(u),B(()=>a=!1))}),S(t,u=>{!a&&(u!==n[s]||p)&&x(u)},{deep:p}),t}else return V({get(){return b()},set(t){x(t)}})}const W={class:"n-text-input flex flex items-center border n-border-base rounded n-bg-base py-1 pl-1 pr-2 focus-within:border-context focus-within:n-focus-base"},P={__name:"NTextInput",props:{modelValue:{type:[String,Number],required:!1,default:""},icon:{type:String,required:!1},placeholder:{type:String,required:!1},disabled:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},readonly:{type:Boolean,required:!1},type:{type:String,required:!1,default:"text"}},emits:["keydown","keyup","change"],setup(n,{emit:s}){const i=U(n,"modelValue",s,{passive:!0});return(o,l)=>{const c=N;return $(),w("div",W,[k(o.$slots,"icon",{},()=>[n.icon?($(),I(c,{key:0,icon:n.icon,class:"ml-0.3em mr-0.1em text-1.1em op50"},null,8,["icon"])):J("",!0)]),D(G("input",O({"onUpdate:modelValue":l[0]||(l[0]=d=>T(i)?i.value=d:null)},o.$props,{class:"ml-0.4em w-full flex-auto n-bg-base !outline-none"}),null,16),[[C,E(i)]])])}}};export{P as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as n,c as s,o,H as t}from"./e7kgpy_n.js";const _={},c={class:"n-badge"};function a(e,r){return o(),s("span",c,[t(e.$slots,"default")])}const l=Object.assign(n(_,[["render",a]]),{__name:"NBadge"});export{l as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as L}from"./TvBJGid1.js";import{u as B,_ as R,a as E,b as q,l as D}from"./XJ4dJUK2.js";import{_ as H}from"./BZrcCMrf.js";import{_ as I}from"./BbEuL4Z6.js";import{g as z,r as p,j as G,k as J,c as r,o as u,a as t,b as n,w as i,d as a,n as K,l as C,t as c,m as b,v as x,F as V,p as O}from"./e7kgpy_n.js";const Q={class:"relative flex flex-col h-screen n-bg-base"},W={class:"flex items-center justify-between p-4"},X={class:"flex items-center gap-3"},Y={class:"text-xl font-bold flex items-center gap-2"},Z={class:"flex items-center gap-2"},h={class:"flex-1 overflow-auto p-4"},ee={class:"space-y-4"},te={key:0,class:"n-bg-active rounded-lg p-4"},le={key:0,class:"mb-4"},oe={class:"space-y-4"},ne={class:"flex gap-4"},se={class:"flex items-center gap-2"},ae={class:"flex items-center gap-2"},re={class:"flex items-center gap-2"},ue={key:1},ie={class:"flex gap-4"},de={class:"flex items-center gap-2"},me={class:"flex items-center gap-2"},pe={class:"flex gap-2 pt-2"},ce={key:1,class:"n-bg-active rounded-lg p-4 opacity-50"},ve={key:2,class:"space-y-2"},fe={class:"font-bold flex items-center gap-2"},ge={class:"text-sm opacity-70 font-mono"},Se=z({__name:"mcp",setup(be){const S=B(),s=p(null),_=p(!1),v=p(!1),w=p([]),f=p(!1),l=p({name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"}),m=p("");function A(){return S.isActive.value&&S.origin.value?S.origin.value:window.location.origin}function T(){const d=A();console.log("[mcp-client] Connecting to socket at",d),s.value=D(d,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),s.value.on("connect",()=>{console.log("[mcp-client] Connected to socket"),_.value=!0,U()}),s.value.on("disconnect",()=>{console.log("[mcp-client] Disconnected from socket"),_.value=!1}),s.value.on("mcp:list",e=>{console.log("[mcp-client] MCP list received",e),w.value=e,v.value=!1}),s.value.on("mcp:added",e=>{e.success?(f.value=!1,N()):m.value=e.error||"Failed to add MCP server"}),s.value.on("mcp:removed",e=>{e.success||alert(`Failed to remove: ${e.error}`)})}function U(){s.value&&(v.value=!0,s.value.emit("mcp:list"))}function N(){l.value={name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"},m.value=""}function $(){if(!l.value.name){m.value="Name is required";return}if(l.value.transport==="stdio"&&!l.value.command){m.value="Command is required for stdio transport";return}if((l.value.transport==="http"||l.value.transport==="sse")&&!l.value.url){m.value="URL is required for HTTP/SSE transport";return}if(s.value){const d=l.value.args.split(" ").map(e=>e.trim()).filter(e=>e.length>0);s.value.emit("mcp:add",{name:l.value.name,transport:l.value.transport,command:l.value.command,args:d,url:l.value.url,scope:l.value.scope})}}function j(d){confirm(`Remove MCP server "${d.name}"?`)&&s.value&&s.value.emit("mcp:remove",{name:d.name})}return G(()=>{T()}),J(()=>{s.value&&s.value.disconnect()}),(d,e)=>{const F=L,k=R,g=E,M=q,y=H,P=I;return u(),r("div",Q,[t("div",W,[t("div",X,[n(F,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:i(()=>[...e[11]||(e[11]=[a(" ← Chat ",-1)])]),_:1}),t("h1",Y,[n(k,{class:"text-blue",icon:"carbon:plug"}),e[12]||(e[12]=a(" MCP Servers ",-1))])]),t("div",Z,[n(g,{disabled:!_.value,n:"blue",onClick:e[0]||(e[0]=o=>f.value=!0)},{default:i(()=>[n(k,{class:"mr-1",icon:"carbon:add"}),e[13]||(e[13]=a(" Add Server ",-1))]),_:1},8,["disabled"]),n(g,{disabled:!_.value||v.value,n:"gray",onClick:U},{default:i(()=>[n(k,{class:K([{"animate-spin":v.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[14]||(e[14]=a(" Refresh ",-1))]),_:1},8,["disabled"])])]),t("div",h,[t("div",ee,[n(M,{class:"text-sm",icon:"carbon:information",n:"blue"},{default:i(()=>[...e[15]||(e[15]=[a(" Model Context Protocol (MCP) servers extend Claude's capabilities with custom tools and data sources. ",-1)])]),_:1}),f.value?(u(),r("div",te,[e[29]||(e[29]=t("h3",{class:"font-bold mb-4"}," Add MCP Server ",-1)),m.value?(u(),r("div",le,[n(M,{icon:"carbon:warning",n:"red"},{default:i(()=>[a(c(m.value),1)]),_:1})])):C("",!0),t("div",oe,[t("div",null,[e[16]||(e[16]=t("label",{class:"block text-sm font-medium mb-1"},"Name",-1)),n(y,{modelValue:l.value.name,"onUpdate:modelValue":e[1]||(e[1]=o=>l.value.name=o),class:"w-full",placeholder:"e.g. github, nuxt-ui-remote"},null,8,["modelValue"])]),t("div",null,[e[20]||(e[20]=t("label",{class:"block text-sm font-medium mb-1"},"Transport",-1)),t("div",ne,[t("label",se,[b(t("input",{"onUpdate:modelValue":e[2]||(e[2]=o=>l.value.transport=o),name:"transport",type:"radio",value:"stdio"},null,512),[[x,l.value.transport]]),e[17]||(e[17]=t("span",null,"stdio",-1))]),t("label",ae,[b(t("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>l.value.transport=o),name:"transport",type:"radio",value:"http"},null,512),[[x,l.value.transport]]),e[18]||(e[18]=t("span",null,"HTTP",-1))]),t("label",re,[b(t("input",{"onUpdate:modelValue":e[4]||(e[4]=o=>l.value.transport=o),name:"transport",type:"radio",value:"sse"},null,512),[[x,l.value.transport]]),e[19]||(e[19]=t("span",null,"SSE",-1))])])]),l.value.transport==="stdio"?(u(),r(V,{key:0},[t("div",null,[e[21]||(e[21]=t("label",{class:"block text-sm font-medium mb-1"},"Command",-1)),n(y,{modelValue:l.value.command,"onUpdate:modelValue":e[5]||(e[5]=o=>l.value.command=o),class:"w-full font-mono",placeholder:"e.g. npx"},null,8,["modelValue"])]),t("div",null,[e[22]||(e[22]=t("label",{class:"block text-sm font-medium mb-1"},"Arguments",-1)),n(y,{modelValue:l.value.args,"onUpdate:modelValue":e[6]||(e[6]=o=>l.value.args=o),class:"w-full font-mono",placeholder:"e.g. -y @modelcontextprotocol/server-github"},null,8,["modelValue"])])],64)):C("",!0),l.value.transport==="http"||l.value.transport==="sse"?(u(),r("div",ue,[e[23]||(e[23]=t("label",{class:"block text-sm font-medium mb-1"},"URL",-1)),n(y,{modelValue:l.value.url,"onUpdate:modelValue":e[7]||(e[7]=o=>l.value.url=o),class:"w-full font-mono",placeholder:"e.g. https://ui.nuxt.com/mcp"},null,8,["modelValue"])])):C("",!0),t("div",null,[e[26]||(e[26]=t("label",{class:"block text-sm font-medium mb-1"},"Scope",-1)),t("div",ie,[t("label",de,[b(t("input",{"onUpdate:modelValue":e[8]||(e[8]=o=>l.value.scope=o),name:"scope",type:"radio",value:"local"},null,512),[[x,l.value.scope]]),e[24]||(e[24]=t("span",null,"Local (this project)",-1))]),t("label",me,[b(t("input",{"onUpdate:modelValue":e[9]||(e[9]=o=>l.value.scope=o),name:"scope",type:"radio",value:"global"},null,512),[[x,l.value.scope]]),e[25]||(e[25]=t("span",null,"User (all projects)",-1))])])]),t("div",pe,[n(g,{n:"green",onClick:$},{default:i(()=>[...e[27]||(e[27]=[a(" Add Server ",-1)])]),_:1}),n(g,{n:"gray",onClick:e[10]||(e[10]=o=>{f.value=!1,N()})},{default:i(()=>[...e[28]||(e[28]=[a(" Cancel ",-1)])]),_:1})])])])):C("",!0),w.value.length===0&&!f.value&&!v.value?(u(),r("div",ce,' No MCP servers configured. Click "Add Server" to get started. ')):(u(),r("div",ve,[(u(!0),r(V,null,O(w.value,o=>(u(),r("div",{key:o.name,class:"n-bg-active rounded-lg p-4 flex items-center justify-between"},[t("div",null,[t("div",fe,[a(c(o.name)+" ",1),n(P,{n:o.transport==="stdio"?"gray":"blue",class:"text-xs"},{default:i(()=>[a(c(o.transport),1)]),_:2},1032,["n"]),n(P,{n:o.scope==="local"?"green":"purple",class:"text-xs"},{default:i(()=>[a(c(o.scope),1)]),_:2},1032,["n"])]),t("div",ge,[o.transport==="stdio"?(u(),r(V,{key:0},[a(c(o.command)+" "+c(o.args?.join(" ")),1)],64)):(u(),r(V,{key:1},[a(c(o.url),1)],64))])]),n(g,{n:"red",onClick:xe=>j(o)},{default:i(()=>[n(k,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]))),128))]))])])])}}});export{Se as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{_ as X}from"./TvBJGid1.js";import{u as Z,l as ee,a as le,b as te,_ as se}from"./XJ4dJUK2.js";import{_ as oe}from"./BbEuL4Z6.js";import{_ as ne}from"./BZrcCMrf.js";import{_ as ae}from"./DImlDIT-.js";import{g as ie,r as f,j as ue,k as re,c as i,a as l,b as a,w as d,d as u,l as g,F as b,p as w,m as D,E as P,x as R,t as m,s as C,o as n,n as B,y as de}from"./e7kgpy_n.js";const me={class:"relative flex flex-col h-screen n-bg-base"},ve={class:"flex items-center justify-between p-4"},ce={class:"flex items-center gap-3"},pe={class:"text-xl font-bold flex items-center gap-2"},fe={class:"flex items-center gap-2"},be={class:"flex-1 overflow-auto p-4"},ge={class:"flex gap-4 h-full"},xe={class:"w-72 flex-shrink-0 space-y-4"},ke={key:0,class:"n-bg-active rounded-lg p-4 opacity-50 text-sm"},_e={class:"space-y-2"},ye=["onClick"],we={class:"flex items-center justify-between"},Ce={class:"flex items-center gap-2"},Se={class:"font-medium"},Ve={class:"text-sm opacity-60 mt-1 pl-6 truncate"},he={class:"flex flex-wrap gap-1 mt-1 pl-6"},Ne={class:"flex-1 flex flex-col n-bg-active rounded-lg overflow-hidden"},Ae={class:"flex-1 overflow-auto"},Ue={class:"p-4 border-b border-neutral-200 dark:border-neutral-800"},De={key:0,class:"mb-4"},Be={class:"space-y-4"},$e=["value"],je={key:0},Ee={class:"flex flex-wrap gap-2"},Me=["onClick"],Te={class:"p-4"},Fe={class:"p-4 border-t border-neutral-200 dark:border-neutral-800 flex gap-2 flex-shrink-0"},Le={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between"},ze={class:"font-bold flex items-center gap-2"},Ge={class:"text-sm opacity-70"},Pe={class:"flex gap-2"},Re={key:0,class:"px-4 pt-4"},qe={class:"flex-1 p-4 overflow-auto"},Ie={class:"space-y-4 mb-4"},Oe=["value"],Ye={key:0},He={class:"flex flex-wrap gap-2"},We=["onClick"],Je={key:1,class:"space-y-4"},Ke={class:"flex flex-wrap gap-2"},Qe={class:"text-xs opacity-50"},Xe={key:0},Ze={class:"flex flex-wrap gap-1"},el={key:1},ll={class:"flex flex-wrap gap-1"},tl={key:2,class:"flex-1 flex items-center justify-center opacity-50"},sl={class:"text-center"},ml=ie({__name:"agents",setup(ol){const $=Z(),r=f(null),A=f(!1),S=f(!1),j=f([]),s=f(null),k=f(!1),U=f(!1),V=f([]),v=f({name:"",description:"",prompt:"",model:"",tools:"",skills:[]}),c=f({name:"",description:"",prompt:"",model:"",tools:"",skills:[]}),p=f(""),T=[{value:"",label:"Default"},{value:"sonnet",label:"Sonnet (fast)"},{value:"opus",label:"Opus (powerful)"},{value:"haiku",label:"Haiku (fastest)"}];function q(){return $.isActive.value&&$.origin.value?$.origin.value:window.location.origin}function I(){const o=q();console.log("[agents-client] Connecting to socket at",o),r.value=ee(o,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),r.value.on("connect",()=>{console.log("[agents-client] Connected"),A.value=!0,F(),O()}),r.value.on("skills:names",e=>{console.log("[agents-client] Skill names received",e),V.value=e}),r.value.on("disconnect",()=>{console.log("[agents-client] Disconnected"),A.value=!1}),r.value.on("agents:list",e=>{console.log("[agents-client] Agents list received",e),j.value=e,S.value=!1}),r.value.on("agents:saved",e=>{e.success&&e.agent?(s.value=e.agent,k.value=!1,U.value=!1,L(),p.value=""):p.value=e.error||"Failed to save agent"}),r.value.on("agents:deleted",e=>{e.success&&s.value?.name===e.name&&(s.value=null)})}function F(){r.value&&(S.value=!0,r.value.emit("agents:list"))}function O(){r.value&&r.value.emit("skills:names")}function L(){v.value={name:"",description:"",prompt:"",model:"",tools:"",skills:[]},p.value=""}function Y(o){s.value=o,c.value={name:o.name,description:o.description,prompt:o.prompt,model:o.model||"",tools:o.tools?.join(", ")||"",skills:o.skills||[]},k.value=!1}function H(){s.value&&(c.value={name:s.value.name,description:s.value.description,prompt:s.value.prompt,model:s.value.model||"",tools:s.value.tools?.join(", ")||"",skills:s.value.skills||[]},k.value=!0)}function z(){const o=k.value?c.value:v.value;if(!o.name){p.value="Name is required";return}if(!o.description){p.value="Description is required";return}if(!o.prompt){p.value="Prompt is required";return}if(r.value){const e=o.tools.split(",").map(_=>_.trim()).filter(_=>_.length>0);r.value.emit("agents:save",{name:o.name,description:o.description,prompt:o.prompt,model:o.model||void 0,tools:e.length>0?e:void 0,skills:o.skills.length>0?o.skills:void 0})}}function W(){s.value&&(c.value={name:s.value.name,description:s.value.description,prompt:s.value.prompt,model:s.value.model||"",tools:s.value.tools?.join(", ")||"",skills:s.value.skills||[]}),k.value=!1,p.value=""}function G(o,e){const _=e.skills.indexOf(o);_>=0?e.skills.splice(_,1):e.skills.push(o)}function J(o){return new Date(o).toLocaleDateString()}function K(o){confirm(`Delete agent "${o}"?`)&&r.value&&r.value.emit("agents:delete",o)}return ue(()=>{I()}),re(()=>{r.value&&r.value.disconnect()}),(o,e)=>{const _=X,x=se,y=le,E=te,h=oe,N=ne,Q=ae;return n(),i("div",me,[l("div",ve,[l("div",ce,[a(_,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:d(()=>[...e[11]||(e[11]=[u(" ← Chat ",-1)])]),_:1}),l("h1",pe,[a(x,{class:"text-purple",icon:"carbon:bot"}),e[12]||(e[12]=u(" Subagents ",-1))])]),l("div",fe,[a(y,{disabled:!A.value,n:"purple",onClick:e[0]||(e[0]=t=>{U.value=!0,s.value=null})},{default:d(()=>[a(x,{class:"mr-1",icon:"carbon:add"}),e[13]||(e[13]=u(" New Agent ",-1))]),_:1},8,["disabled"]),a(y,{disabled:!A.value||S.value,n:"gray",onClick:F},{default:d(()=>[a(x,{class:B([{"animate-spin":S.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[14]||(e[14]=u(" Refresh ",-1))]),_:1},8,["disabled"])])]),l("div",be,[l("div",ge,[l("div",xe,[a(E,{class:"text-xs",icon:"carbon:information",n:"purple"},{default:d(()=>[...e[15]||(e[15]=[u(" Subagents are specialized AI agents that Claude can delegate tasks to. ",-1),l("br",null,null,-1),u(" Stored as ",-1),l("code",{class:"font-mono"},".claude/agents/<name>.md",-1)])]),_:1}),j.value.length===0&&!S.value?(n(),i("div",ke,[...e[16]||(e[16]=[u(" No subagents configured. ",-1),l("br",null,null,-1),u(" Create one to get started. ",-1)])])):g("",!0),l("div",_e,[(n(!0),i(b,null,w(j.value,t=>(n(),i("div",{key:t.name,class:B([s.value?.name===t.name?"n-bg-active ring-1 ring-purple-500":"hover:n-bg-active","rounded-lg p-3 cursor-pointer group"]),onClick:M=>Y(t)},[l("div",we,[l("div",Ce,[a(x,{class:"text-purple-500",icon:"carbon:bot"}),l("span",Se,m(t.name),1)]),a(y,{class:"opacity-0 group-hover:opacity-100",n:"red xs",onClick:de(M=>K(t.name),["stop"])},{default:d(()=>[a(x,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]),l("div",Ve,m(t.description),1),l("div",he,[t.model?(n(),C(h,{key:0,class:"text-xs",n:"gray"},{default:d(()=>[u(m(t.model),1)]),_:2},1024)):g("",!0),t.skills&&t.skills.length>0?(n(),C(h,{key:1,class:"text-xs",n:"orange"},{default:d(()=>[u(m(t.skills.length)+" skill"+m(t.skills.length>1?"s":""),1)]),_:2},1024)):g("",!0)])],10,ye))),128))])]),l("div",Ne,[U.value?(n(),i(b,{key:0},[l("div",Ae,[l("div",Ue,[e[25]||(e[25]=l("h3",{class:"font-bold mb-4"}," Create New Subagent ",-1)),p.value?(n(),i("div",De,[a(E,{icon:"carbon:warning",n:"red"},{default:d(()=>[u(m(p.value),1)]),_:1})])):g("",!0),l("div",Be,[l("div",null,[e[17]||(e[17]=l("label",{class:"block text-sm font-medium mb-1"},"Name",-1)),a(N,{modelValue:v.value.name,"onUpdate:modelValue":e[1]||(e[1]=t=>v.value.name=t),class:"w-full font-mono",placeholder:"e.g. reviewer, test-runner, docs-writer"},null,8,["modelValue"]),e[18]||(e[18]=l("div",{class:"text-xs opacity-50 mt-1"}," Use lowercase with hyphens (kebab-case) ",-1))]),l("div",null,[e[19]||(e[19]=l("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),a(N,{modelValue:v.value.description,"onUpdate:modelValue":e[2]||(e[2]=t=>v.value.description=t),class:"w-full",placeholder:"Brief description of what this agent does"},null,8,["modelValue"])]),l("div",null,[e[20]||(e[20]=l("label",{class:"block text-sm font-medium mb-1"},"Model (optional)",-1)),D(l("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>v.value.model=t),class:"w-full p-2 rounded-lg n-bg-base border border-neutral-200 dark:border-neutral-800"},[(n(),i(b,null,w(T,t=>l("option",{key:t.value,value:t.value},m(t.label),9,$e)),64))],512),[[P,v.value.model]])]),l("div",null,[e[21]||(e[21]=l("label",{class:"block text-sm font-medium mb-1"},"Tools (optional)",-1)),a(N,{modelValue:v.value.tools,"onUpdate:modelValue":e[4]||(e[4]=t=>v.value.tools=t),class:"w-full font-mono",placeholder:"e.g. Read, Grep, Glob, Bash"},null,8,["modelValue"]),e[22]||(e[22]=l("div",{class:"text-xs opacity-50 mt-1"}," Comma-separated list. Leave empty for all tools. ",-1))]),V.value.length>0?(n(),i("div",je,[e[23]||(e[23]=l("label",{class:"block text-sm font-medium mb-1"},"Skills",-1)),l("div",Ee,[(n(!0),i(b,null,w(V.value,t=>(n(),i("button",{key:t,class:B([v.value.skills.includes(t)?"bg-orange-500 text-white":"n-bg-base","px-2 py-1 rounded text-sm border border-neutral-200 dark:border-neutral-700"]),type:"button",onClick:M=>G(t,v.value)},m(t),11,Me))),128))]),e[24]||(e[24]=l("div",{class:"text-xs opacity-50 mt-1"}," Click to add/remove skills. Skills will be preloaded for the agent. ",-1))])):g("",!0)])]),l("div",Te,[e[26]||(e[26]=l("label",{class:"block text-sm font-medium mb-1"},"System Prompt",-1)),D(l("textarea",{"onUpdate:modelValue":e[5]||(e[5]=t=>v.value.prompt=t),class:"w-full min-h-[200px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-y",placeholder:`Write the system prompt for this agent...
|
|
2
|
+
|
|
3
|
+
Example:
|
|
4
|
+
You are a code reviewer. Your job is to:
|
|
5
|
+
1. Review code for bugs and issues
|
|
6
|
+
2. Suggest improvements
|
|
7
|
+
3. Check for security vulnerabilities`},null,512),[[R,v.value.prompt]])])]),l("div",Fe,[a(y,{n:"purple",onClick:z},{default:d(()=>[...e[27]||(e[27]=[u(" Create Agent ",-1)])]),_:1}),a(y,{n:"gray",onClick:e[6]||(e[6]=t=>{U.value=!1,L()})},{default:d(()=>[...e[28]||(e[28]=[u(" Cancel ",-1)])]),_:1})])],64)):s.value?(n(),i(b,{key:1},[l("div",Le,[l("div",null,[l("h3",ze,[a(x,{class:"text-purple-500",icon:"carbon:bot"}),u(" "+m(s.value.name),1)]),l("div",Ge,m(s.value.description),1)]),l("div",Pe,[k.value?(n(),i(b,{key:0},[a(y,{n:"green",onClick:z},{default:d(()=>[a(x,{class:"mr-1",icon:"carbon:save"}),e[29]||(e[29]=u(" Save ",-1))]),_:1}),a(y,{n:"gray",onClick:W},{default:d(()=>[...e[30]||(e[30]=[u(" Cancel ",-1)])]),_:1})],64)):(n(),C(y,{key:1,n:"blue",onClick:H},{default:d(()=>[a(x,{class:"mr-1",icon:"carbon:edit"}),e[31]||(e[31]=u(" Edit ",-1))]),_:1}))])]),p.value&&k.value?(n(),i("div",Re,[a(E,{icon:"carbon:warning",n:"red"},{default:d(()=>[u(m(p.value),1)]),_:1})])):g("",!0),l("div",qe,[k.value?(n(),i(b,{key:0},[l("div",Ie,[l("div",null,[e[32]||(e[32]=l("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),a(N,{modelValue:c.value.description,"onUpdate:modelValue":e[7]||(e[7]=t=>c.value.description=t),class:"w-full",placeholder:"Brief description"},null,8,["modelValue"])]),l("div",null,[e[33]||(e[33]=l("label",{class:"block text-sm font-medium mb-1"},"Model",-1)),D(l("select",{"onUpdate:modelValue":e[8]||(e[8]=t=>c.value.model=t),class:"w-full p-2 rounded-lg n-bg-base border border-neutral-200 dark:border-neutral-800"},[(n(),i(b,null,w(T,t=>l("option",{key:t.value,value:t.value},m(t.label),9,Oe)),64))],512),[[P,c.value.model]])]),l("div",null,[e[34]||(e[34]=l("label",{class:"block text-sm font-medium mb-1"},"Tools",-1)),a(N,{modelValue:c.value.tools,"onUpdate:modelValue":e[9]||(e[9]=t=>c.value.tools=t),class:"w-full font-mono",placeholder:"e.g. Read, Grep, Glob, Bash"},null,8,["modelValue"])]),V.value.length>0?(n(),i("div",Ye,[e[35]||(e[35]=l("label",{class:"block text-sm font-medium mb-1"},"Skills",-1)),l("div",He,[(n(!0),i(b,null,w(V.value,t=>(n(),i("button",{key:t,class:B([c.value.skills.includes(t)?"bg-orange-500 text-white":"n-bg-base","px-2 py-1 rounded text-sm border border-neutral-200 dark:border-neutral-700"]),type:"button",onClick:M=>G(t,c.value)},m(t),11,We))),128))])])):g("",!0)]),e[36]||(e[36]=l("label",{class:"block text-sm font-medium mb-1"},"System Prompt",-1)),D(l("textarea",{"onUpdate:modelValue":e[10]||(e[10]=t=>c.value.prompt=t),class:"w-full h-full min-h-[300px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none"},null,512),[[R,c.value.prompt]])],64)):(n(),i("div",Je,[l("div",Ke,[s.value.model?(n(),C(h,{key:0,n:"purple"},{default:d(()=>[u(" Model: "+m(s.value.model),1)]),_:1})):g("",!0)]),l("div",Qe," Updated: "+m(J(s.value.updatedAt)),1),s.value.tools&&s.value.tools.length>0?(n(),i("div",Xe,[e[37]||(e[37]=l("div",{class:"text-sm font-medium opacity-50 mb-1"}," Tools ",-1)),l("div",Ze,[(n(!0),i(b,null,w(s.value.tools,t=>(n(),C(h,{key:t,class:"font-mono text-xs",n:"blue"},{default:d(()=>[u(m(t),1)]),_:2},1024))),128))])])):g("",!0),s.value.skills&&s.value.skills.length>0?(n(),i("div",el,[e[38]||(e[38]=l("div",{class:"text-sm font-medium opacity-50 mb-1"}," Skills ",-1)),l("div",ll,[(n(!0),i(b,null,w(s.value.skills,t=>(n(),C(h,{key:t,class:"text-xs",n:"orange"},{default:d(()=>[u(m(t),1)]),_:2},1024))),128))])])):g("",!0),l("div",null,[e[39]||(e[39]=l("div",{class:"text-sm font-medium opacity-50 mb-2"}," System Prompt ",-1)),a(Q,{content:s.value.prompt,class:"max-w-none"},null,8,["content"])])]))])],64)):(n(),i("div",tl,[l("div",sl,[a(x,{class:"text-4xl mb-2",icon:"carbon:bot"}),e[40]||(e[40]=l("p",null,"Select an agent or create a new one",-1))])]))])])])])}}});export{ml as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{_ as q,a as fe,u as Je,l as Qe,b as Xe}from"./XJ4dJUK2.js";import{g as J,s as P,w as M,T as re,o,c as i,l as w,a as t,b as r,d as E,F as H,p as G,n as z,t as C,_ as ie,z as Ge,A as Ye,r as k,q as A,y as te,B as ae,j as Ze,k as et,C as ve,m as tt,x as ot,D as ee}from"./e7kgpy_n.js";import{_ as me}from"./BbEuL4Z6.js";import{_ as nt}from"./TvBJGid1.js";import{_ as st}from"./DImlDIT-.js";const lt={key:0,class:"history-sidebar w-72 h-full border-r border-gray-200 dark:border-gray-700 flex flex-col n-bg-base absolute left-0 top-0 z-10 shadow-lg"},at={class:"p-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},rt={class:"p-3 border-b border-gray-200 dark:border-gray-700"},it={class:"flex-1 overflow-y-auto"},ct=["onClick"],ut={class:"flex items-start justify-between gap-2"},dt={class:"flex-1 min-w-0"},pt={class:"font-medium text-sm truncate"},vt={class:"text-xs opacity-50 mt-1 flex items-center gap-2"},ft=["onClick"],mt={key:0,class:"p-4 text-center opacity-50 text-sm"},gt=J({__name:"HistorySidebar",props:{conversations:{},activeId:{},isOpen:{type:Boolean}},emits:["select","delete","new","close"],setup(b,{emit:$}){const f=$;function x(u){const g=new Date(u),v=new Date().getTime()-g.getTime(),m=Math.floor(v/6e4),h=Math.floor(m/60),c=Math.floor(h/24);return m<1?"just now":m<60?`${m}m ago`:h<24?`${h}h ago`:c<7?`${c}d ago`:g.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function l(u,g){u.stopPropagation(),confirm("Delete this conversation?")&&f("delete",g)}return(u,g)=>{const p=q,v=fe;return o(),P(re,{name:"slide"},{default:M(()=>[b.isOpen?(o(),i("div",lt,[t("div",at,[g[2]||(g[2]=t("h2",{class:"font-semibold text-sm"}," Chat History ",-1)),t("button",{class:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors",onClick:g[0]||(g[0]=m=>f("close"))},[r(p,{icon:"carbon:close"})])]),t("div",rt,[r(v,{class:"w-full",n:"blue",onClick:g[1]||(g[1]=m=>f("new"))},{default:M(()=>[r(p,{class:"mr-1",icon:"carbon:add"}),g[3]||(g[3]=E(" New Chat ",-1))]),_:1})]),t("div",it,[(o(!0),i(H,null,G(b.conversations,m=>(o(),i("div",{key:m.id,class:z([{"bg-blue-500/10 border-l-2 border-l-blue-500":m.id===b.activeId},"p-3 border-b border-gray-100 dark:border-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 group transition-colors"]),onClick:h=>f("select",m.id)},[t("div",ut,[t("div",dt,[t("div",pt,C(m.title||"New conversation"),1),t("div",vt,[t("span",null,C(x(m.updatedAt)),1),g[4]||(g[4]=t("span",{class:"opacity-50"},"|",-1)),t("span",null,C(m.messages.length)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-100 dark:hover:bg-red-900/20 rounded transition-opacity",title:"Delete conversation",onClick:h=>l(h,m.id)},[r(p,{class:"text-red-500 text-sm",icon:"carbon:trash-can"})],8,ft)])],10,ct))),128)),b.conversations.length===0?(o(),i("div",mt,[r(p,{class:"text-2xl mb-2",icon:"carbon:chat"}),g[5]||(g[5]=t("p",null,"No conversations yet",-1))])):w("",!0)])])):w("",!0)]),_:1})}}}),ht=Object.assign(ie(gt,[["__scopeId","data-v-797cdae6"]]),{__name:"HistorySidebar"});let W;const Z=[];function ge(b){if(Z.push(b),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&Z.forEach($=>$(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set($){$&&Z.forEach(f=>f($))},get(){return W.value},configurable:!0}),()=>{Z.splice(Z.indexOf(b),1)}}function he(){W||(W=Ge(),ge($));function b(){W&&Ye(W)}function $(f){W.value=f,f.host&&f.host.hooks.hook("host:update:reactivity",b)}return W}const xt={class:"tool-call-block rounded-lg border border-gray-200 dark:border-gray-700 my-2 overflow-hidden text-sm"},_t={class:"flex items-center gap-2 px-3 py-2 bg-blue-500/10"},bt={class:"font-medium"},yt=["title"],kt=["href","title"],wt={key:2,class:"text-xs opacity-50 font-mono"},Ct={key:3,class:"ml-auto flex-shrink-0"},$t={key:4,class:"ml-auto flex-shrink-0"},St={key:0,class:"border-t border-gray-200 dark:border-gray-700"},Dt={class:"text-xs opacity-50"},Tt={key:0,class:"px-3 pb-2"},Rt={class:"text-xs n-bg-base p-2 rounded overflow-x-auto max-h-64 whitespace-pre-wrap"},Bt={class:"font-medium opacity-70"},It={key:0,class:"px-3 pb-2"},At={class:"text-xs n-bg-base p-2 rounded overflow-x-auto max-h-96 whitespace-pre-wrap"},Nt={key:1,class:"px-3 pb-2"},Mt={class:"text-xs opacity-50 truncate font-mono"},Et=J({__name:"ToolCallBlock",props:{toolUse:{},toolResult:{}},setup(b){const $=he(),f=b,x=k(!1),l=k(!1),u=A(()=>JSON.stringify(f.toolUse.input,null,2)),g=A(()=>Object.keys(f.toolUse.input).length),p=A(()=>f.toolResult?typeof f.toolResult.content=="string"?f.toolResult.content:JSON.stringify(f.toolResult.content,null,2):""),v=A(()=>{const d=p.value;return d.length<=100?d:d.substring(0,100)+"..."}),m=A(()=>({Read:"carbon:document",Write:"carbon:document-add",Edit:"carbon:edit",Bash:"carbon:terminal",Glob:"carbon:search",Grep:"carbon:search-locate",WebFetch:"carbon:cloud",WebSearch:"carbon:search",Task:"carbon:task",TodoWrite:"carbon:list-checked",AskUserQuestion:"carbon:help"})[f.toolUse.name]||"carbon:tool-box"),h=A(()=>f.toolUse.id.substring(0,12)),c=A(()=>{const d=f.toolUse.input,_=d.file_path||d.path||d.filePath||d.filename||d.file||null;return _?String(_):null}),D=A(()=>{const d=f.toolUse.input,_=d.url||d.uri||d.href||d.link||null;return _?String(_):null}),R=A(()=>{if(!D.value)return null;const d=D.value,_=50;if(d.length<=_)return d;try{const I=new URL(d),T=I.hostname,V=I.pathname+I.search;return V.length>_-T.length-3?T+V.substring(0,_-T.length-6)+"...":d}catch{return d.substring(0,_-3)+"..."}}),B=A(()=>{const d=f.toolUse.input;return d.line||d.lineNumber||d.offset||null}),N=A(()=>{if(!c.value)return null;const d=c.value,_=32;if(d.length<=_)return d;const I=d.slice(-_),T=I.indexOf("/");return T>0&&T<15?"..."+I.slice(T):"..."+I});async function O(){if(c.value)try{let d=c.value;if(B.value&&(d=`${d}:${B.value}`),$.value?.devtools?.rpc?.openInEditor&&await $.value.devtools.rpc.openInEditor(d))return;const _=`webstorm://open?file=${encodeURIComponent(c.value)}${B.value?`&line=${B.value}`:""}`;window.open(_,"_self")}catch(d){console.error("Failed to open file in IDE:",d)}}return(d,_)=>{const I=q,T=me;return o(),i("div",xt,[t("div",_t,[r(I,{icon:m.value,class:"text-blue-500 flex-shrink-0"},null,8,["icon"]),t("span",bt,C(b.toolUse.name),1),N.value?(o(),i("button",{key:0,title:`${c.value} (click to open in IDE)`,class:"text-xs text-blue-600 dark:text-blue-400 font-mono hover:underline cursor-pointer truncate max-w-[300px] text-right",onClick:te(O,["stop"])},C(N.value),9,yt)):R.value?(o(),i("a",{key:1,href:D.value,title:D.value,class:"text-xs text-blue-600 dark:text-blue-400 font-mono hover:underline truncate max-w-[300px] text-right",rel:"noopener noreferrer",target:"_blank",onClick:_[0]||(_[0]=te(()=>{},["stop"]))},C(R.value),9,kt)):(o(),i("span",wt,C(h.value),1)),b.toolResult?(o(),i("div",Ct,[b.toolResult.is_error?(o(),P(T,{key:0,n:"red"},{default:M(()=>[..._[3]||(_[3]=[E(" Error ",-1)])]),_:1})):(o(),P(T,{key:1,n:"green"},{default:M(()=>[..._[4]||(_[4]=[E(" Done ",-1)])]),_:1}))])):(o(),i("div",$t,[r(T,{n:"yellow"},{default:M(()=>[..._[5]||(_[5]=[E(" Running ",-1)])]),_:1})]))]),g.value>0?(o(),i("div",St,[t("button",{class:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",onClick:_[1]||(_[1]=V=>x.value=!x.value)},[r(I,{icon:x.value?"carbon:chevron-down":"carbon:chevron-right",class:"text-xs opacity-70"},null,8,["icon"]),_[6]||(_[6]=t("span",{class:"font-medium opacity-70"},"Parameters",-1)),t("span",Dt,C(g.value)+" "+C(g.value===1?"field":"fields"),1)]),x.value?(o(),i("div",Tt,[t("pre",Rt,C(u.value),1)])):w("",!0)])):w("",!0),b.toolResult?(o(),i("div",{key:1,class:z([{"bg-red-500/5":b.toolResult.is_error},"border-t border-gray-200 dark:border-gray-700"])},[t("button",{class:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",onClick:_[2]||(_[2]=V=>l.value=!l.value)},[r(I,{icon:l.value?"carbon:chevron-down":"carbon:chevron-right",class:"text-xs opacity-70"},null,8,["icon"]),t("span",Bt,C(b.toolResult.is_error?"Error":"Result"),1),b.toolResult.is_error?(o(),P(I,{key:0,class:"text-red-500",icon:"carbon:warning"})):w("",!0)]),l.value?(o(),i("div",It,[t("pre",At,C(p.value),1)])):p.value?(o(),i("div",Nt,[t("div",Mt,C(v.value),1)])):w("",!0)],2)):w("",!0)])}}}),Ot=Object.assign(Et,{__name:"ToolCallBlock"}),Pt={class:"thinking-block rounded-lg border border-purple-200 dark:border-purple-800 my-2 overflow-hidden text-sm bg-purple-500/5"},Ut={class:"text-xs opacity-50"},Lt={key:0,class:"px-3 pb-2"},jt={class:"text-xs n-bg-base p-2 rounded overflow-x-auto max-h-96 whitespace-pre-wrap text-purple-800 dark:text-purple-200"},Ht={key:1,class:"px-3 pb-2"},Vt={class:"text-xs opacity-50 truncate font-mono text-purple-700 dark:text-purple-300"},zt=J({__name:"ThinkingBlock",props:{thinking:{}},setup(b){const $=b,f=k(!1),x=A(()=>{const u=$.thinking;return u.length<=80?u:u.substring(0,80)+"..."}),l=A(()=>$.thinking.split(`
|
|
2
|
+
`).length);return(u,g)=>{const p=q;return o(),i("div",Pt,[t("button",{class:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-purple-500/10 transition-colors",onClick:g[0]||(g[0]=v=>f.value=!f.value)},[r(p,{icon:f.value?"carbon:chevron-down":"carbon:chevron-right",class:"text-xs text-purple-500"},null,8,["icon"]),r(p,{icon:"carbon:idea",class:"text-purple-500"}),g[1]||(g[1]=t("span",{class:"font-medium text-purple-700 dark:text-purple-300"},"Thinking",-1)),t("span",Ut,C(l.value)+" "+C(l.value===1?"line":"lines"),1)]),f.value?(o(),i("div",Lt,[t("pre",jt,C(b.thinking),1)])):(o(),i("div",Ht,[t("div",Vt,C(x.value),1)]))])}}}),Kt=Object.assign(zt,{__name:"ThinkingBlock"}),Ft={key:0,class:"mb-2"},Wt={class:"flex flex-wrap gap-2 mb-2"},qt={class:"font-mono"},Jt=["title"],Qt=["onClick"],Xt=J({__name:"ComponentContext",props:{components:{}},emits:["remove","toggle-picker","clear-all"],setup(b,{emit:$}){const f=b,x=$;function l(p){const v=p.split("/");return v[v.length-1].replace(".vue","")}function u(p){const v=p.match(/(?:components|pages|layouts|app)\/.*\.vue$/);return v?v[0]:p}const g=A(()=>f.components.length>0);return(p,v)=>{const m=q;return g.value?(o(),i("div",Ft,[t("div",Wt,[(o(!0),i(H,null,G(b.components,h=>(o(),i("div",{key:h.filePath,class:"flex items-center gap-1 px-2 py-1 bg-purple-500/20 text-purple-600 dark:text-purple-400 rounded-md text-sm group"},[r(m,{class:"text-purple-500",icon:"carbon:application"}),t("span",qt,C(l(h.filePath)),1),t("span",{title:h.filePath,class:"text-xs opacity-50 hidden sm:inline"}," ("+C(u(h.filePath))+") ",9,Jt),t("button",{class:"ml-1 opacity-50 hover:opacity-100 hover:text-red-500 transition-opacity",title:"Remove from context",onClick:te(c=>x("remove",h.filePath),["stop"])},[r(m,{icon:"carbon:close"})],8,Qt)]))),128)),b.components.length>1?(o(),i("button",{key:0,class:"flex items-center gap-1 px-2 py-1 text-xs opacity-50 hover:opacity-100 hover:text-red-500 transition-opacity",title:"Clear all components",onClick:v[0]||(v[0]=te(h=>x("clear-all"),["stop"]))},[r(m,{icon:"carbon:trash-can"}),v[1]||(v[1]=E(" Clear all ",-1))])):w("",!0)])])):w("",!0)}}}),Gt=Object.assign(Xt,{__name:"ComponentContext"}),Yt={key:0,class:"absolute bottom-full left-0 mb-1 w-full max-w-md z-50"},Zt={class:"n-bg-base border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden"},eo={class:"px-3 py-2 border-b border-neutral-200 dark:border-neutral-700 text-xs opacity-60 flex items-center gap-2"},to={class:"max-h-48 overflow-y-auto"},oo=["onClick","onMouseenter"],no={class:"truncate"},so={key:0,class:"px-3 py-4 text-center text-sm opacity-50"},lo=J({__name:"DocsAutocomplete",props:{docs:{},inputValue:{},cursorPosition:{},visible:{type:Boolean}},emits:["select","close"],setup(b,{expose:$,emit:f}){const x=b,l=f,u=k(0),g=A(()=>{if(!x.visible)return"";const c=x.inputValue.slice(0,x.cursorPosition).match(/@docs\/(\S*)$/);return c?c[1].toLowerCase():""}),p=A(()=>{const h=g.value;return h?x.docs.filter(c=>c.path.toLowerCase().includes(h)||c.name.toLowerCase().includes(h)):x.docs});ae(p,()=>{u.value=0});function v(h){if(!x.visible||p.value.length===0)return!1;switch(h.key){case"ArrowDown":return h.preventDefault(),u.value=(u.value+1)%p.value.length,!0;case"ArrowUp":return h.preventDefault(),u.value=u.value===0?p.value.length-1:u.value-1,!0;case"Tab":case"Enter":return h.preventDefault(),m(p.value[u.value]),!0;case"Escape":return h.preventDefault(),l("close"),!0}return!1}function m(h){l("select",h.path)}return $({handleKeydown:v}),(h,c)=>{const D=q;return o(),P(re,{name:"dropdown"},{default:M(()=>[b.visible&&p.value.length>0?(o(),i("div",Yt,[t("div",Zt,[t("div",eo,[r(D,{icon:"carbon:document"}),c[0]||(c[0]=t("span",null,"Select a document",-1)),c[1]||(c[1]=t("span",{class:"ml-auto opacity-50"},"Tab/Enter to select",-1))]),t("div",to,[(o(!0),i(H,null,G(p.value,(R,B)=>(o(),i("button",{key:R.path,class:z(["w-full px-3 py-2 text-left flex items-center gap-2 text-sm transition-colors",B===u.value?"bg-blue-500/20 text-blue-600 dark:text-blue-400":"hover:bg-neutral-100 dark:hover:bg-neutral-800"]),type:"button",onClick:N=>m(R),onMouseenter:N=>u.value=B},[r(D,{class:"opacity-50",icon:"carbon:document"}),t("span",no,C(R.path),1)],42,oo))),128))]),p.value.length===0?(o(),i("div",so," No documents found ")):w("",!0)])])):w("",!0)]),_:1})}}}),ao=Object.assign(ie(lo,[["__scopeId","data-v-9157fee2"]]),{__name:"DocsAutocomplete"}),ro={key:0,class:"absolute bottom-full left-0 mb-1 w-full max-w-md z-50"},io={class:"n-bg-base border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden"},co={class:"px-3 py-2 border-b border-neutral-200 dark:border-neutral-700 text-xs opacity-60 flex items-center gap-2"},uo={class:"max-h-48 overflow-y-auto"},po=["onClick","onMouseenter"],vo={class:"flex-1 min-w-0"},fo={class:"font-mono truncate"},mo={key:0,class:"text-xs opacity-50 truncate"},go=J({__name:"CommandsAutocomplete",props:{commands:{},inputValue:{},cursorPosition:{},visible:{type:Boolean}},emits:["select","close"],setup(b,{expose:$,emit:f}){const x=b,l=f,u=k(0),g=A(()=>{if(!x.visible)return"";const D=x.inputValue.slice(0,x.cursorPosition).match(/(?:^|\s)\/(\S*)$/);return D?D[1].toLowerCase():""}),p=A(()=>{const c=g.value;return x.commands.filter(R=>c?R.name.toLowerCase().includes(c)||R.description?.toLowerCase().includes(c):!0)}),v=A(()=>x.visible&&p.value.length>0);ae(p,()=>{u.value=0}),ae([p,g],([c,D])=>{x.visible&&c.length===0&&D.length>0&&l("close")});function m(c){if(!v.value)return!1;switch(c.key){case"ArrowDown":return c.preventDefault(),u.value=(u.value+1)%p.value.length,!0;case"ArrowUp":return c.preventDefault(),u.value=u.value===0?p.value.length-1:u.value-1,!0;case"Tab":case"Enter":return c.preventDefault(),h(p.value[u.value]),!0;case"Escape":return c.preventDefault(),l("close"),!0}return!1}function h(c){l("select",c.name)}return $({handleKeydown:m}),(c,D)=>{const R=q;return o(),P(re,{name:"dropdown"},{default:M(()=>[v.value?(o(),i("div",ro,[t("div",io,[t("div",co,[r(R,{icon:"carbon:terminal"}),D[0]||(D[0]=t("span",null,"Slash Commands",-1)),D[1]||(D[1]=t("span",{class:"ml-auto opacity-50"},"Tab/Enter to select",-1))]),t("div",uo,[(o(!0),i(H,null,G(p.value,(B,N)=>(o(),i("button",{key:B.name,class:z(["w-full px-3 py-2 text-left flex items-center gap-2 text-sm transition-colors",N===u.value?"bg-green-500/20 text-green-600 dark:text-green-400":"hover:bg-neutral-100 dark:hover:bg-neutral-800"]),type:"button",onClick:O=>h(B),onMouseenter:O=>u.value=N},[r(R,{class:"opacity-50 text-green-500",icon:"carbon:terminal"}),t("div",vo,[t("div",fo," /"+C(B.name),1),B.description?(o(),i("div",mo,C(B.description),1)):w("",!0)])],42,po))),128))])])])):w("",!0)]),_:1})}}}),ho=Object.assign(ie(go,[["__scopeId","data-v-58ca4e57"]]),{__name:"CommandsAutocomplete"}),xo={class:"relative flex flex-col h-screen n-bg-base overflow-hidden"},_o={class:"flex flex-col h-full"},bo={class:"flex items-center justify-between p-4"},yo={class:"flex items-center gap-3"},ko={class:"text-xl font-bold flex items-center gap-2"},wo={class:"flex items-center gap-2"},Co={class:"relative"},$o={key:0,class:"px-4 pt-4"},So={key:0,class:"text-xs opacity-50 mb-1"},Do={key:0,class:"ml-1"},To={key:1,class:"ml-2"},Ro={key:1,class:"whitespace-pre-wrap font-mono text-sm"},Bo={key:2,class:"opacity-50"},Io={class:"text-xs opacity-30 mt-1"},Ao={key:0,class:"flex items-center justify-center h-full opacity-50"},No={class:"text-center"},Mo={class:"p-4"},Eo={class:"flex items-center gap-2 mb-2"},Oo={class:"flex gap-2 items-center"},Po={class:"flex-1 relative"},Uo=["disabled"],Lo={key:0,class:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 text-red-500"},jo={class:"text-xs opacity-50 mt-2 flex items-center gap-3"},Ho={key:0,class:"text-green-500/70"},Vo={key:1,class:"text-blue-500/70"},Jo=J({__name:"index",setup(b){const $=he(),f=Je(),x=k([]),l=k(null),u=k([]),g=k([]),p=k(null),v=k(""),m=k(!1),h=k(!1),c=k(!1),D=k(null),R=k(null),B=k(!1),N=k(!1),O=k(null),d=k(!1),_=k([]),I=k(!1),T=k(0),V=k(null),oe=k([]),Q=k(!1),ne=k(null),Y=k(!1),se=k(new Map),xe=A(()=>m.value?c.value?"Processing...":"Ready":"Disconnected"),_e=A(()=>m.value?c.value?"blue":"green":"red");function X(){ee(()=>{D.value&&(D.value.scrollTop=D.value.scrollHeight)})}function be(){return Math.random().toString(36).substring(2,9)}function K(n,e,s=!1){const a={id:be(),role:n,content:e,timestamp:new Date,streaming:s};return u.value.push(a),X(),a}function ye(n){return(n instanceof Date?n:new Date(n)).toLocaleTimeString()}function ke(n,e){if(n)return n.find(s=>s.type==="tool_result"&&s.tool_use_id===e)}function we(){return f.isActive.value&&f.origin.value?f.origin.value:window.location.origin}function Ce(){const n=we();console.log("[claude-client] Connecting to socket at",n,"tunnel active:",f.isActive.value),l.value=Qe(n,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),l.value.on("connect",()=>{console.log("[claude-client] Connected to socket"),m.value=!0,l.value?.emit("docs:list"),l.value?.emit("commands:list")}),l.value.on("disconnect",()=>{console.log("[claude-client] Disconnected from socket"),m.value=!1,h.value=!1,c.value=!1,K("system","Disconnected from server")}),l.value.on("session:status",e=>{console.log("[claude-client] Session status:",e),h.value=e.active,c.value=e.processing}),l.value.on("history:loaded",e=>{console.log("[claude-client] History loaded:",e.id,e.messages.length,"messages"),p.value=e.id,u.value=e.messages.map(s=>({...s,timestamp:new Date(s.timestamp)})),X()}),l.value.on("history:list",e=>{console.log("[claude-client] Conversations list:",e.length),g.value=e}),l.value.on("history:switched",e=>{console.log("[claude-client] Switched to conversation:",e.id),p.value=e.id,u.value=e.messages.map(s=>({...s,timestamp:new Date(s.timestamp)})),B.value=!1,X()}),l.value.on("history:deleted",e=>{console.log("[claude-client] Conversation deleted:",e)}),l.value.on("docs:list",e=>{console.log("[claude-client] Docs list received:",e.length),_.value=e}),l.value.on("commands:list",e=>{console.log("[claude-client] Commands list received:",e.length),oe.value=e}),l.value.on("stream:message_start",e=>{console.log("[claude-client] Message start:",e.id),se.value.clear()}),l.value.on("stream:tool_use",e=>{console.log("[claude-client] Tool use:",e.name);const s={type:"tool_use",id:e.id,name:e.name,input:e.input};se.value.set(e.id,s);const a=u.value.findLast(S=>S.role==="assistant");a&&(a.contentBlocks||(a.contentBlocks=[]),a.contentBlocks.push(s),X())}),l.value.on("stream:tool_result",e=>{console.log("[claude-client] Tool result:",e.tool_use_id,e.is_error?"ERROR":"OK");const s={type:"tool_result",tool_use_id:e.tool_use_id,content:e.content,is_error:e.is_error},a=u.value.findLast(S=>S.role==="assistant");a&&(a.contentBlocks||(a.contentBlocks=[]),a.contentBlocks.push(s),X())}),l.value.on("stream:text_delta",e=>{const s=u.value.findLast(a=>a.role==="assistant");s&&s.streaming&&(s.content+=e.text,X())}),l.value.on("stream:message_complete",e=>{console.log("[claude-client] Message complete:",e.id);const s=u.value.findLast(a=>a.role==="assistant");s&&(s.streaming=!1,s.content=e.content,s.contentBlocks=e.contentBlocks,s.model=e.model),se.value.clear()}),l.value.on("stream:result",e=>{console.log("[claude-client] Result:",e.subtype,"cost:",e.cost_usd,"duration:",e.duration_ms)}),l.value.on("output:chunk",e=>{console.log("[claude-client] Output chunk:",e.length);const s=u.value.findLast(a=>a.role==="assistant");s&&s.streaming||K("assistant",e,!0)}),l.value.on("output:complete",()=>{console.log("[claude-client] Output complete");const e=u.value.findLast(s=>s.role==="assistant");e&&(e.streaming=!1)}),l.value.on("output:error",e=>{console.log("[claude-client] Output error:",e),K("system",`Error: ${e}`)}),l.value.on("session:error",e=>{console.log("[claude-client] Session error:",e),K("system",`Session error: ${e}`)}),l.value.on("session:closed",e=>{console.log("[claude-client] Session closed:",e),K("system",`Session ended (exit code: ${e.exitCode})`)})}function ce(){l.value&&(l.value.emit("session:reset"),u.value=[],B.value=!1)}function $e(){if(!v.value.trim()||c.value||!m.value)return;N.value&&O.value&&(O.value.stop(),N.value=!1);let n=v.value.trim();v.value="",R.value&&(R.value.style.height="auto"),x.value.length>0&&(n=`${x.value.map(s=>`@${s.filePath}`).join(" ")}
|
|
3
|
+
|
|
4
|
+
${n}`),K("user",n),K("assistant","",!0),l.value&&l.value.emit("message:send",n)}function Se(n){I.value&&V.value&&V.value.handleKeydown(n)||Q.value&&ne.value&&ne.value.handleKeydown(n)||n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),$e())}function De(){ue(),Te(),Re()}function Te(){const n=R.value;if(!n)return;T.value=n.selectionStart||0;const s=v.value.slice(0,T.value).match(/@docs\/\S*$/);I.value=!!s,I.value&&(Q.value=!1)}function Re(){const n=R.value;if(!n||I.value)return;T.value=n.selectionStart||0;const s=v.value.slice(0,T.value).match(/(?:^|\s)\/\S*$/);Q.value=!!s}function Be(n){const e=R.value;if(!e)return;const s=v.value.slice(0,T.value),a=v.value.slice(T.value);if(s.match(/@docs\/\S*$/)){const U=s.lastIndexOf("@docs/"),j=s.slice(0,U)+`@docs/${n}`+a;v.value=j,ee(()=>{const F=U+`@docs/${n}`.length;e.setSelectionRange(F,F),e.focus()})}I.value=!1}function Ie(n){const e=R.value;if(!e)return;const s=v.value.slice(0,T.value),a=v.value.slice(T.value),S=s.match(/(?:^|\s)(\/\S*)$/);if(S){const U=s.length-S[1].length,j=s.slice(0,U)+`/${n} `+a;v.value=j,ee(()=>{const F=U+`/${n} `.length;e.setSelectionRange(F,F),e.focus()})}Q.value=!1}function Ae(){I.value=!1}function Ne(){Q.value=!1}function ue(){const n=R.value;n&&(n.style.height="auto",n.style.height=Math.min(n.scrollHeight,200)+"px")}function de(){const n=window.SpeechRecognition||window.webkitSpeechRecognition;if(!n){d.value=!1;return}d.value=!0;const e=new n;e.continuous=!0,e.interimResults=!0,e.lang="ru-RU",e.onresult=s=>{let a="";for(let S=s.resultIndex;S<s.results.length;S++){const U=s.results[S][0].transcript;s.results[S].isFinal&&(a+=U)}a&&(v.value+=a,ee(ue))},e.onerror=s=>{console.error("Speech recognition error:",s.error),N.value=!1},e.onend=()=>{N.value=!1},O.value=e}function Me(){if(O.value||de(),!O.value){alert("Speech recognition is not supported in this browser. Try Chrome or Edge.");return}N.value?(O.value.stop(),N.value=!1):(O.value.start(),N.value=!0)}function Ee(){B.value=!B.value,B.value&&l.value&&l.value.emit("history:list")}function pe(){if(!$.value?.host?.inspector){console.warn("[claude-client] Inspector not available");return}$.value.host.inspector.toggle()}function Oe(n){if(console.log("[claude-client] Component selected:",n),x.value.some(S=>S.filePath===n))return;const e=n.split("/"),a=e[e.length-1].replace(".vue","");x.value.push({filePath:n,name:a,timestamp:Date.now()})}function Pe(n){x.value=x.value.filter(e=>e.filePath!==n)}function Ue(){x.value=[]}function Le(){return window.location.pathname.includes("__claude-devtools")}ge(n=>{console.log("[claude-client] DevTools client connected");const e=n.host.hooks,s=e.callHook.bind(e);e.callHook=async(a,...S)=>{if(a==="host:inspector:click"&&S[0]&&Le()){const U=S[0];console.log("[claude-client] Intercepted callHook:",a,U),Oe(U),n.host.inspector?.disable();return}return s(a,...S)},console.log("[claude-client] Monkey-patched hooks.callHook")});function je(n){l.value&&l.value.emit("history:switch",n)}function He(n){l.value&&l.value.emit("history:delete",n)}return Ze(()=>{Ce(),de()}),et(()=>{l.value&&l.value.disconnect(),O.value&&N.value&&O.value.stop()}),(n,e)=>{const s=ht,a=q,S=fe,U=me,j=nt,F=Xe,le=st,Ve=Ot,ze=Kt,Ke=Gt,Fe=ao,We=ho;return o(),i("div",xo,[r(s,{"active-id":p.value,conversations:g.value,"is-open":B.value,onClose:e[0]||(e[0]=y=>B.value=!1),onDelete:He,onNew:ce,onSelect:je},null,8,["active-id","conversations","is-open"]),t("div",_o,[t("div",bo,[t("div",yo,[r(S,{n:"gray",title:"Chat History",onClick:Ee},{default:M(()=>[r(a,{icon:"carbon:recently-viewed"})]),_:1}),t("h1",ko,[r(a,{class:"text-green",icon:"carbon:machine-learning-model"}),e[4]||(e[4]=E(" Claude AI ",-1))]),r(U,{n:_e.value},{default:M(()=>[E(C(xe.value),1)]),_:1},8,["n"])]),t("div",wo,[r(S,{disabled:!m.value||c.value,n:"blue",onClick:ce},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:add"}),e[5]||(e[5]=E(" New Chat ",-1))]),_:1},8,["disabled"]),r(j,{to:"/docs"},{default:M(()=>[r(S,{n:"gray"},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:document"}),e[6]||(e[6]=E(" Docs ",-1))]),_:1})]),_:1}),t("div",Co,[r(S,{n:"gray",onClick:e[1]||(e[1]=y=>Y.value=!Y.value)},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:overflow-menu-horizontal"}),e[7]||(e[7]=E(" More ",-1)),r(a,{class:z([{"rotate-180":Y.value},"ml-1 transition-transform"]),icon:"carbon:chevron-down"},null,8,["class"])]),_:1}),Y.value?(o(),i("div",{key:0,class:"absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg n-bg-base border border-neutral-200 dark:border-neutral-800 shadow-lg overflow-hidden",onClick:e[2]||(e[2]=y=>Y.value=!1)},[r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/mcp"},{default:M(()=>[r(a,{class:"text-blue-500",icon:"carbon:plug"}),e[8]||(e[8]=E(" MCP Servers ",-1))]),_:1}),r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/commands"},{default:M(()=>[r(a,{class:"text-green-500",icon:"carbon:terminal"}),e[9]||(e[9]=E(" Commands ",-1))]),_:1}),r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/skills"},{default:M(()=>[r(a,{class:"text-orange-500",icon:"carbon:lightning"}),e[10]||(e[10]=E(" Skills ",-1))]),_:1}),r(j,{class:"flex items-center gap-2 px-3 py-2 hover:n-bg-active transition-colors",to:"/agents"},{default:M(()=>[r(a,{class:"text-purple-500",icon:"carbon:bot"}),e[11]||(e[11]=E(" Agents ",-1))]),_:1})])):w("",!0)])])]),ve($)?w("",!0):(o(),i("div",$o,[r(F,{n:"yellow"},{default:M(()=>[...e[12]||(e[12]=[E(" Open this page inside Nuxt DevTools for best experience. ",-1)])]),_:1})])),t("div",{ref_key:"messagesContainer",ref:D,class:"flex-1 overflow-auto p-4 space-y-4"},[(o(!0),i(H,null,G(u.value,y=>(o(),i("div",{key:y.id,class:z([y.role==="user"?"justify-end":"justify-start","flex"])},[t("div",{class:z([{"bg-green-500/20 text-green-800 dark:text-green-100":y.role==="user","n-bg-active":y.role==="assistant","bg-yellow-500/20 text-yellow-800 dark:text-yellow-200 text-sm":y.role==="system"},"max-w-[85%] rounded-lg px-4 py-2"])},[y.role==="assistant"?(o(),i("div",So,[e[13]||(e[13]=E(" Claude ",-1)),y.model?(o(),i("span",Do,"("+C(y.model.split("-").slice(0,2).join("-"))+")",1)):w("",!0),y.streaming?(o(),i("span",To,[r(a,{class:"animate-pulse",icon:"carbon:circle-filled"})])):w("",!0)])):w("",!0),y.contentBlocks&&y.contentBlocks.length>0?(o(),i(H,{key:1},[(o(!0),i(H,null,G(y.contentBlocks,(L,qe)=>(o(),i(H,{key:qe},[L.type==="text"&&L.text?(o(),P(le,{key:0,content:L.text},null,8,["content"])):L.type==="tool_use"?(o(),P(Ve,{key:1,"tool-result":ke(y.contentBlocks,L.id),"tool-use":L},null,8,["tool-result","tool-use"])):L.type==="thinking"&&L.thinking?(o(),P(ze,{key:2,thinking:L.thinking},null,8,["thinking"])):w("",!0)],64))),128)),y.content&&!y.contentBlocks.some(L=>L.type==="text")?(o(),P(le,{key:0,content:y.content},null,8,["content"])):w("",!0)],64)):(o(),i(H,{key:2},[y.role==="assistant"&&y.content?(o(),P(le,{key:0,content:y.content},null,8,["content"])):y.content?(o(),i("div",Ro,C(y.content),1)):w("",!0),y.streaming&&!y.content?(o(),i("span",Bo,"Thinking...")):w("",!0)],64)),t("div",Io,C(ye(y.timestamp)),1)],2)],2))),128)),u.value.length===0?(o(),i("div",Ao,[t("div",No,[r(a,{class:"text-4xl mb-2",icon:"carbon:chat"}),e[14]||(e[14]=t("p",null,"Send a message to start chatting with Claude",-1))])])):w("",!0)],512),t("div",Mo,[r(Ke,{components:x.value,onRemove:Pe,onClearAll:Ue,onTogglePicker:pe},null,8,["components"]),t("div",Eo,[ve($)?(o(),P(S,{key:0,disabled:!m.value,n:"purple",title:"Select a component from the page to add as context",onClick:pe},{default:M(()=>[r(a,{class:"mr-1",icon:"carbon:touch-1"}),e[15]||(e[15]=E(" "+C("Add Component"),-1))]),_:1},8,["disabled"])):w("",!0)]),t("div",Oo,[t("div",Po,[r(Fe,{ref_key:"docsAutocompleteRef",ref:V,"cursor-position":T.value,docs:_.value,"input-value":v.value,visible:I.value,onClose:Ae,onSelect:Be},null,8,["cursor-position","docs","input-value","visible"]),r(We,{ref_key:"commandsAutocompleteRef",ref:ne,commands:oe.value,"cursor-position":T.value,"input-value":v.value,visible:Q.value,onClose:Ne,onSelect:Ie},null,8,["commands","cursor-position","input-value","visible"]),tt(t("textarea",{ref_key:"textareaRef",ref:R,"onUpdate:modelValue":e[3]||(e[3]=y=>v.value=y),class:z([{"opacity-50":!m.value||c.value},"w-full px-3 py-2 n-bg-base border border-neutral-200 dark:border-neutral-800 rounded-lg font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"]),disabled:!m.value||c.value,placeholder:"Type your message... (Shift+Enter for new line)",rows:"1",style:{"min-height":"42px","max-height":"200px"},onInput:De,onKeydown:Se},null,42,Uo),[[ot,v.value]]),N.value?(o(),i("div",Lo,[...e[16]||(e[16]=[t("span",{class:"w-2 h-2 bg-red-500 rounded-full animate-pulse"},null,-1),t("span",{class:"text-xs"},"Recording...",-1)])])):w("",!0)]),d.value?(o(),P(S,{key:0,disabled:!m.value||c.value,n:N.value?"red":"gray",title:N.value?"Stop recording":"Start voice input",class:"h-[42px] -mt-[6px]",onClick:Me},{default:M(()=>[r(a,{icon:N.value?"carbon:stop-filled":"carbon:microphone"},null,8,["icon"])]),_:1},8,["disabled","n","title"])):w("",!0)]),t("div",jo,[t("span",null,"Enter to send | Shift+Enter for new line"+C(d.value?" | Click mic for voice input":""),1),oe.value.length>0?(o(),i("span",Ho,[r(a,{class:"mr-1",icon:"carbon:terminal"}),e[17]||(e[17]=E("Type / for commands ",-1))])):w("",!0),_.value.length>0?(o(),i("span",Vo,[r(a,{class:"mr-1",icon:"carbon:document"}),e[18]||(e[18]=E("@docs/ for docs ",-1))])):w("",!0)])])])])}}});export{Jo as default};
|