claudeck 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +233 -0
- package/cli.js +2 -0
- package/config/agent-chains.json +16 -0
- package/config/agent-dags.json +16 -0
- package/config/agents.json +46 -0
- package/config/bot-prompt.json +3 -0
- package/config/folders.json +66 -0
- package/config/prompts.json +92 -0
- package/config/repos.json +86 -0
- package/config/telegram-config.json +17 -0
- package/config/workflows.json +90 -0
- package/db.js +1198 -0
- package/package.json +55 -0
- package/plugins/claude-editor/client.css +171 -0
- package/plugins/claude-editor/client.js +183 -0
- package/plugins/event-stream/client.css +207 -0
- package/plugins/event-stream/client.js +271 -0
- package/plugins/linear/client.css +345 -0
- package/plugins/linear/client.js +380 -0
- package/plugins/linear/config.json +5 -0
- package/plugins/linear/server.js +312 -0
- package/plugins/repos/client.css +549 -0
- package/plugins/repos/client.js +663 -0
- package/plugins/repos/server.js +232 -0
- package/plugins/sudoku/client.css +196 -0
- package/plugins/sudoku/client.js +329 -0
- package/plugins/tasks/client.css +414 -0
- package/plugins/tasks/client.js +394 -0
- package/plugins/tasks/server.js +116 -0
- package/plugins/tic-tac-toe/client.css +167 -0
- package/plugins/tic-tac-toe/client.js +241 -0
- package/public/css/core/components.css +232 -0
- package/public/css/core/layout.css +330 -0
- package/public/css/core/print.css +18 -0
- package/public/css/core/reset.css +36 -0
- package/public/css/core/responsive.css +378 -0
- package/public/css/core/theme.css +116 -0
- package/public/css/core/variables.css +93 -0
- package/public/css/features/agent-monitor.css +297 -0
- package/public/css/features/agent-sidebar.css +525 -0
- package/public/css/features/agents.css +996 -0
- package/public/css/features/analytics.css +181 -0
- package/public/css/features/background-sessions.css +321 -0
- package/public/css/features/cost-dashboard.css +168 -0
- package/public/css/features/home.css +313 -0
- package/public/css/features/retro-terminal.css +88 -0
- package/public/css/features/telegram.css +127 -0
- package/public/css/features/tour.css +148 -0
- package/public/css/features/voice-input.css +60 -0
- package/public/css/features/welcome.css +241 -0
- package/public/css/panels/assistant-bot.css +442 -0
- package/public/css/panels/dev-docs.css +292 -0
- package/public/css/panels/file-explorer.css +322 -0
- package/public/css/panels/git-panel.css +221 -0
- package/public/css/panels/mcp-manager.css +199 -0
- package/public/css/panels/tips-feed.css +353 -0
- package/public/css/ui/commands.css +273 -0
- package/public/css/ui/context-gauge.css +76 -0
- package/public/css/ui/file-picker.css +69 -0
- package/public/css/ui/image-attachments.css +106 -0
- package/public/css/ui/messages.css +884 -0
- package/public/css/ui/modals.css +122 -0
- package/public/css/ui/parallel.css +217 -0
- package/public/css/ui/permissions.css +110 -0
- package/public/css/ui/right-panel.css +481 -0
- package/public/css/ui/sessions.css +689 -0
- package/public/css/ui/status-bar.css +425 -0
- package/public/css/ui/toolbox.css +206 -0
- package/public/data/tips.json +218 -0
- package/public/icons/favicon.png +0 -0
- package/public/icons/icon-192.png +0 -0
- package/public/icons/icon-512.png +0 -0
- package/public/icons/whaly.png +0 -0
- package/public/index.html +1140 -0
- package/public/js/core/api.js +591 -0
- package/public/js/core/constants.js +3 -0
- package/public/js/core/dom.js +270 -0
- package/public/js/core/events.js +10 -0
- package/public/js/core/plugin-loader.js +153 -0
- package/public/js/core/store.js +39 -0
- package/public/js/core/utils.js +25 -0
- package/public/js/core/ws.js +64 -0
- package/public/js/features/agent-monitor.js +222 -0
- package/public/js/features/agents.js +1209 -0
- package/public/js/features/analytics.js +397 -0
- package/public/js/features/attachments.js +251 -0
- package/public/js/features/background-sessions.js +475 -0
- package/public/js/features/chat.js +589 -0
- package/public/js/features/cost-dashboard.js +152 -0
- package/public/js/features/dag-editor.js +399 -0
- package/public/js/features/easter-egg.js +46 -0
- package/public/js/features/home.js +270 -0
- package/public/js/features/projects.js +372 -0
- package/public/js/features/prompts.js +228 -0
- package/public/js/features/sessions.js +332 -0
- package/public/js/features/telegram.js +131 -0
- package/public/js/features/tour.js +210 -0
- package/public/js/features/voice-input.js +185 -0
- package/public/js/features/welcome.js +43 -0
- package/public/js/features/workflows.js +277 -0
- package/public/js/main.js +51 -0
- package/public/js/panels/assistant-bot.js +445 -0
- package/public/js/panels/dev-docs.js +380 -0
- package/public/js/panels/file-explorer.js +486 -0
- package/public/js/panels/git-panel.js +285 -0
- package/public/js/panels/mcp-manager.js +311 -0
- package/public/js/panels/tips-feed.js +303 -0
- package/public/js/ui/commands.js +114 -0
- package/public/js/ui/context-gauge.js +100 -0
- package/public/js/ui/diff.js +124 -0
- package/public/js/ui/disabled-tools.js +36 -0
- package/public/js/ui/export.js +74 -0
- package/public/js/ui/formatting.js +206 -0
- package/public/js/ui/header-dropdowns.js +72 -0
- package/public/js/ui/input-meta.js +71 -0
- package/public/js/ui/max-turns.js +21 -0
- package/public/js/ui/messages.js +387 -0
- package/public/js/ui/model-selector.js +20 -0
- package/public/js/ui/notifications.js +232 -0
- package/public/js/ui/parallel.js +176 -0
- package/public/js/ui/permissions.js +168 -0
- package/public/js/ui/right-panel.js +173 -0
- package/public/js/ui/shortcuts.js +143 -0
- package/public/js/ui/sidebar-toggle.js +29 -0
- package/public/js/ui/status-bar.js +172 -0
- package/public/js/ui/tab-sdk.js +623 -0
- package/public/js/ui/theme.js +38 -0
- package/public/manifest.json +13 -0
- package/public/offline.html +190 -0
- package/public/style.css +42 -0
- package/public/sw.js +91 -0
- package/server/agent-loop.js +385 -0
- package/server/dag-executor.js +265 -0
- package/server/orchestrator.js +514 -0
- package/server/paths.js +61 -0
- package/server/plugin-mount.js +56 -0
- package/server/push-sender.js +31 -0
- package/server/routes/agents.js +294 -0
- package/server/routes/bot.js +45 -0
- package/server/routes/exec.js +35 -0
- package/server/routes/files.js +218 -0
- package/server/routes/mcp.js +82 -0
- package/server/routes/messages.js +36 -0
- package/server/routes/notifications.js +37 -0
- package/server/routes/projects.js +207 -0
- package/server/routes/prompts.js +53 -0
- package/server/routes/sessions.js +103 -0
- package/server/routes/stats.js +143 -0
- package/server/routes/telegram.js +71 -0
- package/server/routes/tips.js +135 -0
- package/server/routes/workflows.js +81 -0
- package/server/summarizer.js +55 -0
- package/server/telegram-poller.js +205 -0
- package/server/telegram-sender.js +304 -0
- package/server/ws-handler.js +926 -0
- package/server.js +179 -0
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claudeck",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A browser-based UI for Claude Code — chat, run workflows, manage MCP servers, track costs, and orchestrate autonomous agents from a local web interface. Installable as a PWA.",
|
|
6
|
+
"main": "server.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"claudeck": "./cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"cli.js",
|
|
12
|
+
"server.js",
|
|
13
|
+
"db.js",
|
|
14
|
+
"server/",
|
|
15
|
+
"public/",
|
|
16
|
+
"config/",
|
|
17
|
+
"plugins/",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"claude",
|
|
23
|
+
"claude-code",
|
|
24
|
+
"ai",
|
|
25
|
+
"llm",
|
|
26
|
+
"web-ui",
|
|
27
|
+
"chat",
|
|
28
|
+
"mcp",
|
|
29
|
+
"agents",
|
|
30
|
+
"workflows",
|
|
31
|
+
"pwa",
|
|
32
|
+
"developer-tools"
|
|
33
|
+
],
|
|
34
|
+
"homepage": "https://github.com/hamedafarag/claudeck",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/hamedafarag/claudeck"
|
|
38
|
+
},
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"author": "Hamed Farag",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"start": "node server.js"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@anthropic-ai/claude-code": "^1.0.128",
|
|
49
|
+
"better-sqlite3": "^11",
|
|
50
|
+
"dotenv": "^17.3.1",
|
|
51
|
+
"express": "^4",
|
|
52
|
+
"web-push": "^3.6.7",
|
|
53
|
+
"ws": "^8"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* ── CLAUDE.md Editor ─────────────────────────────────── */
|
|
2
|
+
.claude-editor-tab {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
flex: 1;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
font-family: var(--font-sans);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* Toolbar */
|
|
11
|
+
.claude-editor-toolbar {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
padding: 8px 12px;
|
|
16
|
+
border-bottom: 1px solid var(--border);
|
|
17
|
+
background: var(--bg-secondary);
|
|
18
|
+
gap: 8px;
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.claude-editor-file-select {
|
|
23
|
+
background: var(--bg);
|
|
24
|
+
color: var(--text);
|
|
25
|
+
border: 1px solid var(--border);
|
|
26
|
+
border-radius: var(--radius);
|
|
27
|
+
padding: 4px 8px;
|
|
28
|
+
font-size: 11px;
|
|
29
|
+
font-family: var(--font-mono);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
outline: none;
|
|
32
|
+
transition: border-color 0.15s;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.claude-editor-file-select:focus {
|
|
36
|
+
border-color: var(--accent);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.claude-editor-actions {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 6px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.claude-editor-btn {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 4px;
|
|
49
|
+
background: none;
|
|
50
|
+
border: 1px solid var(--border);
|
|
51
|
+
border-radius: var(--radius);
|
|
52
|
+
color: var(--text-dim);
|
|
53
|
+
font-family: var(--font-sans);
|
|
54
|
+
font-size: 11px;
|
|
55
|
+
padding: 4px 8px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
transition: all 0.15s;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.claude-editor-btn:hover {
|
|
61
|
+
color: var(--text);
|
|
62
|
+
border-color: var(--text-dim);
|
|
63
|
+
background: rgba(255, 255, 255, 0.02);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.claude-editor-btn:disabled {
|
|
67
|
+
opacity: 0.35;
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.claude-editor-btn:disabled:hover {
|
|
72
|
+
color: var(--text-dim);
|
|
73
|
+
border-color: var(--border);
|
|
74
|
+
background: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.claude-editor-save--dirty {
|
|
78
|
+
color: var(--accent) !important;
|
|
79
|
+
border-color: var(--accent) !important;
|
|
80
|
+
background: var(--accent-dim) !important;
|
|
81
|
+
opacity: 1 !important;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.claude-editor-save--dirty:hover {
|
|
85
|
+
box-shadow: var(--glow);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Status bar */
|
|
89
|
+
.claude-editor-status {
|
|
90
|
+
padding: 5px 12px;
|
|
91
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
92
|
+
flex-shrink: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.claude-editor-status-text {
|
|
96
|
+
font-size: 10px;
|
|
97
|
+
font-family: var(--font-mono);
|
|
98
|
+
color: var(--text-dim);
|
|
99
|
+
letter-spacing: 0.02em;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.claude-editor-status--success {
|
|
103
|
+
color: var(--success);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.claude-editor-status--error {
|
|
107
|
+
color: var(--error);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.claude-editor-status--warning {
|
|
111
|
+
color: var(--warning);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Editor area */
|
|
115
|
+
.claude-editor-wrap {
|
|
116
|
+
flex: 1;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
position: relative;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.claude-editor-textarea {
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
background: var(--bg);
|
|
125
|
+
color: var(--text);
|
|
126
|
+
border: none;
|
|
127
|
+
padding: 14px 16px;
|
|
128
|
+
font-family: var(--font-mono);
|
|
129
|
+
font-size: 12.5px;
|
|
130
|
+
line-height: 1.65;
|
|
131
|
+
resize: none;
|
|
132
|
+
outline: none;
|
|
133
|
+
tab-size: 2;
|
|
134
|
+
white-space: pre-wrap;
|
|
135
|
+
word-wrap: break-word;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.claude-editor-textarea::placeholder {
|
|
139
|
+
color: var(--text-dim);
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.claude-editor-textarea:disabled {
|
|
144
|
+
opacity: 0.4;
|
|
145
|
+
cursor: not-allowed;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Hints footer */
|
|
149
|
+
.claude-editor-hints {
|
|
150
|
+
padding: 8px 12px;
|
|
151
|
+
border-top: 1px solid var(--border-subtle);
|
|
152
|
+
background: var(--bg-secondary);
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.claude-editor-hints p {
|
|
157
|
+
font-size: 10px;
|
|
158
|
+
color: var(--text-dim);
|
|
159
|
+
line-height: 1.5;
|
|
160
|
+
margin: 0;
|
|
161
|
+
font-family: var(--font-sans);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.claude-editor-hints p + p {
|
|
165
|
+
margin-top: 2px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Light theme */
|
|
169
|
+
html[data-theme="light"] .claude-editor-btn:hover {
|
|
170
|
+
background: rgba(0, 0, 0, 0.03);
|
|
171
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// CLAUDE.md Editor — Tab SDK plugin
|
|
2
|
+
import { registerTab } from '/js/ui/tab-sdk.js';
|
|
3
|
+
import { escapeHtml } from '/js/core/utils.js';
|
|
4
|
+
|
|
5
|
+
registerTab({
|
|
6
|
+
id: 'claude-md',
|
|
7
|
+
title: 'CLAUDE.md',
|
|
8
|
+
icon: '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>',
|
|
9
|
+
lazy: true,
|
|
10
|
+
|
|
11
|
+
init(ctx) {
|
|
12
|
+
let editor, statusEl, fileSelectEl, saveBtn, reloadBtn;
|
|
13
|
+
let currentFile = 'CLAUDE.md';
|
|
14
|
+
let originalContent = '';
|
|
15
|
+
let isDirty = false;
|
|
16
|
+
|
|
17
|
+
const FILES = [
|
|
18
|
+
{ value: 'CLAUDE.md', label: 'CLAUDE.md (project root)' },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
// ── Build DOM ─────────────────────────────────────
|
|
22
|
+
const root = document.createElement('div');
|
|
23
|
+
root.className = 'claude-editor-tab';
|
|
24
|
+
|
|
25
|
+
root.innerHTML = `
|
|
26
|
+
<div class="claude-editor-toolbar">
|
|
27
|
+
<select class="claude-editor-file-select">
|
|
28
|
+
${FILES.map(f => `<option value="${escapeHtml(f.value)}">${escapeHtml(f.label)}</option>`).join('')}
|
|
29
|
+
</select>
|
|
30
|
+
<div class="claude-editor-actions">
|
|
31
|
+
<button class="claude-editor-btn claude-editor-reload" title="Reload from disk">
|
|
32
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
|
|
33
|
+
</button>
|
|
34
|
+
<button class="claude-editor-btn claude-editor-save" title="Save (Cmd+S)" disabled>
|
|
35
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
|
|
36
|
+
Save
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="claude-editor-status">
|
|
41
|
+
<span class="claude-editor-status-text">No project selected</span>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="claude-editor-wrap">
|
|
44
|
+
<textarea class="claude-editor-textarea" placeholder="# CLAUDE.md\n\nAdd project instructions for Claude here..." spellcheck="false"></textarea>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="claude-editor-hints">
|
|
47
|
+
<p>This file is automatically included by the Claude Code SDK as context for every conversation in this project.</p>
|
|
48
|
+
<p>Common uses: coding standards, project structure, preferred patterns, things to avoid.</p>
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
editor = root.querySelector('.claude-editor-textarea');
|
|
53
|
+
statusEl = root.querySelector('.claude-editor-status-text');
|
|
54
|
+
fileSelectEl = root.querySelector('.claude-editor-file-select');
|
|
55
|
+
saveBtn = root.querySelector('.claude-editor-save');
|
|
56
|
+
reloadBtn = root.querySelector('.claude-editor-reload');
|
|
57
|
+
|
|
58
|
+
// ── State helpers ─────────────────────────────────
|
|
59
|
+
function setDirty(dirty) {
|
|
60
|
+
isDirty = dirty;
|
|
61
|
+
saveBtn.disabled = !dirty;
|
|
62
|
+
saveBtn.classList.toggle('claude-editor-save--dirty', dirty);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function setStatus(text, type = 'info') {
|
|
66
|
+
statusEl.textContent = text;
|
|
67
|
+
statusEl.className = 'claude-editor-status-text';
|
|
68
|
+
if (type === 'success') statusEl.classList.add('claude-editor-status--success');
|
|
69
|
+
if (type === 'error') statusEl.classList.add('claude-editor-status--error');
|
|
70
|
+
if (type === 'warning') statusEl.classList.add('claude-editor-status--warning');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ── Load file ─────────────────────────────────────
|
|
74
|
+
async function loadFile() {
|
|
75
|
+
const projectPath = ctx.getProjectPath();
|
|
76
|
+
if (!projectPath) {
|
|
77
|
+
setStatus('No project selected');
|
|
78
|
+
editor.value = '';
|
|
79
|
+
editor.disabled = true;
|
|
80
|
+
setDirty(false);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
editor.disabled = false;
|
|
85
|
+
setStatus(`Loading ${currentFile}...`);
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
const data = await ctx.api.fetchFileContent(projectPath, currentFile);
|
|
89
|
+
originalContent = data.content;
|
|
90
|
+
editor.value = originalContent;
|
|
91
|
+
setDirty(false);
|
|
92
|
+
setStatus(`${currentFile} loaded`, 'success');
|
|
93
|
+
} catch (err) {
|
|
94
|
+
if (err.message.includes('ENOENT') || err.message.includes('not found') || err.message.includes('no such file')) {
|
|
95
|
+
originalContent = '';
|
|
96
|
+
editor.value = '';
|
|
97
|
+
setDirty(false);
|
|
98
|
+
setStatus(`${currentFile} not found — create it by typing and saving`, 'warning');
|
|
99
|
+
} else {
|
|
100
|
+
setStatus(`Error: ${err.message}`, 'error');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ── Save file ─────────────────────────────────────
|
|
106
|
+
async function saveFile() {
|
|
107
|
+
const projectPath = ctx.getProjectPath();
|
|
108
|
+
if (!projectPath || !isDirty) return;
|
|
109
|
+
|
|
110
|
+
setStatus(`Saving ${currentFile}...`);
|
|
111
|
+
saveBtn.disabled = true;
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
await ctx.api.writeFileContent(projectPath, currentFile, editor.value);
|
|
115
|
+
originalContent = editor.value;
|
|
116
|
+
setDirty(false);
|
|
117
|
+
setStatus(`${currentFile} saved`, 'success');
|
|
118
|
+
} catch (err) {
|
|
119
|
+
setStatus(`Save failed: ${err.message}`, 'error');
|
|
120
|
+
saveBtn.disabled = false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ── Event bindings ────────────────────────────────
|
|
125
|
+
editor.addEventListener('input', () => {
|
|
126
|
+
setDirty(editor.value !== originalContent);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
saveBtn.addEventListener('click', saveFile);
|
|
130
|
+
reloadBtn.addEventListener('click', loadFile);
|
|
131
|
+
|
|
132
|
+
fileSelectEl.addEventListener('change', () => {
|
|
133
|
+
if (isDirty && !confirm('You have unsaved changes. Discard them?')) {
|
|
134
|
+
fileSelectEl.value = currentFile;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
currentFile = fileSelectEl.value;
|
|
138
|
+
loadFile();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Cmd+S / Ctrl+S to save
|
|
142
|
+
editor.addEventListener('keydown', (e) => {
|
|
143
|
+
if ((e.metaKey || e.ctrlKey) && e.key === 's') {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
if (isDirty) saveFile();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Tab key inserts spaces
|
|
150
|
+
editor.addEventListener('keydown', (e) => {
|
|
151
|
+
if (e.key === 'Tab') {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
const start = editor.selectionStart;
|
|
154
|
+
const end = editor.selectionEnd;
|
|
155
|
+
editor.value = editor.value.substring(0, start) + ' ' + editor.value.substring(end);
|
|
156
|
+
editor.selectionStart = editor.selectionEnd = start + 2;
|
|
157
|
+
setDirty(editor.value !== originalContent);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// Listen for project changes (projectSelect is a DOM <select>, not in store)
|
|
162
|
+
const projectSelect = document.getElementById('project-select');
|
|
163
|
+
if (projectSelect) {
|
|
164
|
+
projectSelect.addEventListener('change', () => {
|
|
165
|
+
if (isDirty && !confirm('You have unsaved CLAUDE.md changes. Discard them?')) return;
|
|
166
|
+
loadFile();
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Also reload when projects data arrives (covers initial page load)
|
|
171
|
+
ctx.onState('projectsData', () => {
|
|
172
|
+
setTimeout(() => loadFile(), 0);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Initial load
|
|
176
|
+
loadFile();
|
|
177
|
+
|
|
178
|
+
return root;
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
onActivate() {},
|
|
182
|
+
onDeactivate() {},
|
|
183
|
+
});
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/* Event Stream Panel */
|
|
2
|
+
.event-stream-toolbar {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 6px;
|
|
6
|
+
padding: 8px;
|
|
7
|
+
border-bottom: 1px solid var(--border);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.event-stream-filters {
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: 4px;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.event-filter-btn {
|
|
17
|
+
font-family: var(--font-mono);
|
|
18
|
+
font-size: 10px;
|
|
19
|
+
padding: 2px 8px;
|
|
20
|
+
border-radius: 10px;
|
|
21
|
+
border: 1px solid var(--border);
|
|
22
|
+
background: var(--bg-tertiary);
|
|
23
|
+
color: var(--text-secondary);
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
transition: background 0.15s, color 0.15s;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.event-filter-btn:hover {
|
|
29
|
+
background: var(--bg-secondary);
|
|
30
|
+
color: var(--text-primary);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.event-filter-btn.active {
|
|
34
|
+
background: var(--accent);
|
|
35
|
+
color: #fff;
|
|
36
|
+
border-color: var(--accent);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.event-stream-search {
|
|
40
|
+
flex-grow: 1;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
font-family: var(--font-mono);
|
|
43
|
+
font-size: 11px;
|
|
44
|
+
padding: 3px 8px;
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
border: 1px solid var(--border);
|
|
47
|
+
background: var(--bg-secondary);
|
|
48
|
+
color: var(--text-primary);
|
|
49
|
+
outline: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.event-stream-search:focus {
|
|
53
|
+
border-color: var(--accent);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.event-stream-clear-btn {
|
|
57
|
+
font-family: var(--font-mono);
|
|
58
|
+
font-size: 10px;
|
|
59
|
+
padding: 2px 8px;
|
|
60
|
+
border-radius: 4px;
|
|
61
|
+
border: 1px solid var(--border);
|
|
62
|
+
background: var(--bg-tertiary);
|
|
63
|
+
color: var(--error, #f85149);
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.event-stream-clear-btn:hover {
|
|
69
|
+
background: var(--error, #f85149);
|
|
70
|
+
color: #fff;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.event-stream-list {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
overflow-y: auto;
|
|
77
|
+
flex-grow: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.event-row {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: flex-start;
|
|
83
|
+
padding: 4px 8px;
|
|
84
|
+
gap: 8px;
|
|
85
|
+
border-bottom: 1px solid var(--border);
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
font-size: 11px;
|
|
88
|
+
font-family: var(--font-mono);
|
|
89
|
+
transition: background 0.1s;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.event-row:hover {
|
|
93
|
+
background: var(--bg-tertiary);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.event-row.expanded {
|
|
97
|
+
background: var(--bg-tertiary);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.event-time {
|
|
101
|
+
color: var(--text-secondary);
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
font-size: 10px;
|
|
104
|
+
line-height: 1.6;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.event-badge {
|
|
108
|
+
text-transform: uppercase;
|
|
109
|
+
font-size: 9px;
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
padding: 1px 5px;
|
|
112
|
+
border-radius: 3px;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
line-height: 1.6;
|
|
115
|
+
letter-spacing: 0.3px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.badge-tool {
|
|
119
|
+
background: rgba(56, 189, 248, 0.15);
|
|
120
|
+
color: #38bdf8;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.badge-result {
|
|
124
|
+
background: rgba(63, 185, 80, 0.15);
|
|
125
|
+
color: #3fb950;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.badge-error {
|
|
129
|
+
background: rgba(248, 81, 73, 0.15);
|
|
130
|
+
color: #f85149;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.badge-done {
|
|
134
|
+
background: rgba(var(--accent-rgb, 130, 80, 223), 0.15);
|
|
135
|
+
color: var(--accent);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.event-summary {
|
|
139
|
+
flex-grow: 1;
|
|
140
|
+
min-width: 0;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
text-overflow: ellipsis;
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
line-height: 1.6;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.event-detail {
|
|
148
|
+
display: none;
|
|
149
|
+
padding: 4px 0 4px 70px;
|
|
150
|
+
font-size: 10px;
|
|
151
|
+
color: var(--text-secondary);
|
|
152
|
+
white-space: pre-wrap;
|
|
153
|
+
max-height: 200px;
|
|
154
|
+
overflow: auto;
|
|
155
|
+
word-break: break-all;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.event-row.expanded .event-detail {
|
|
159
|
+
display: block;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.event-stream-footer {
|
|
163
|
+
display: flex;
|
|
164
|
+
justify-content: space-between;
|
|
165
|
+
align-items: center;
|
|
166
|
+
padding: 6px 8px;
|
|
167
|
+
font-size: 10px;
|
|
168
|
+
color: var(--text-secondary);
|
|
169
|
+
border-top: 1px solid var(--border);
|
|
170
|
+
font-family: var(--font-mono);
|
|
171
|
+
flex-shrink: 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.event-autoscroll-toggle {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: 4px;
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
user-select: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.event-autoscroll-toggle input[type="checkbox"] {
|
|
183
|
+
accent-color: var(--accent);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Empty state */
|
|
187
|
+
.event-stream-empty {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
align-items: center;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
padding: 32px 16px;
|
|
193
|
+
color: var(--text-dim);
|
|
194
|
+
font-size: 12px;
|
|
195
|
+
text-align: center;
|
|
196
|
+
gap: 8px;
|
|
197
|
+
flex: 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.event-stream-empty svg {
|
|
201
|
+
opacity: 0.4;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.event-stream-empty-hint {
|
|
205
|
+
font-size: 11px;
|
|
206
|
+
opacity: 0.6;
|
|
207
|
+
}
|