claude-memory-layer 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/.claude-plugin/commands/memory-forget.md +42 -0
- package/.claude-plugin/commands/memory-history.md +34 -0
- package/.claude-plugin/commands/memory-import.md +56 -0
- package/.claude-plugin/commands/memory-list.md +37 -0
- package/.claude-plugin/commands/memory-search.md +36 -0
- package/.claude-plugin/commands/memory-stats.md +34 -0
- package/.claude-plugin/hooks.json +59 -0
- package/.claude-plugin/plugin.json +24 -0
- package/.history/package_20260201112328.json +45 -0
- package/.history/package_20260201113602.json +45 -0
- package/.history/package_20260201113713.json +45 -0
- package/.history/package_20260201114110.json +45 -0
- package/Memo.txt +558 -0
- package/README.md +520 -0
- package/context.md +636 -0
- package/dist/.claude-plugin/commands/memory-forget.md +42 -0
- package/dist/.claude-plugin/commands/memory-history.md +34 -0
- package/dist/.claude-plugin/commands/memory-import.md +56 -0
- package/dist/.claude-plugin/commands/memory-list.md +37 -0
- package/dist/.claude-plugin/commands/memory-search.md +36 -0
- package/dist/.claude-plugin/commands/memory-stats.md +34 -0
- package/dist/.claude-plugin/hooks.json +59 -0
- package/dist/.claude-plugin/plugin.json +24 -0
- package/dist/cli/index.js +3539 -0
- package/dist/cli/index.js.map +7 -0
- package/dist/core/index.js +4408 -0
- package/dist/core/index.js.map +7 -0
- package/dist/hooks/session-end.js +2971 -0
- package/dist/hooks/session-end.js.map +7 -0
- package/dist/hooks/session-start.js +2969 -0
- package/dist/hooks/session-start.js.map +7 -0
- package/dist/hooks/stop.js +3123 -0
- package/dist/hooks/stop.js.map +7 -0
- package/dist/hooks/user-prompt-submit.js +2960 -0
- package/dist/hooks/user-prompt-submit.js.map +7 -0
- package/dist/services/memory-service.js +2931 -0
- package/dist/services/memory-service.js.map +7 -0
- package/package.json +45 -0
- package/plan.md +1642 -0
- package/scripts/build.ts +102 -0
- package/spec.md +624 -0
- package/specs/citations-system/context.md +243 -0
- package/specs/citations-system/plan.md +495 -0
- package/specs/citations-system/spec.md +371 -0
- package/specs/endless-mode/context.md +305 -0
- package/specs/endless-mode/plan.md +620 -0
- package/specs/endless-mode/spec.md +455 -0
- package/specs/entity-edge-model/context.md +401 -0
- package/specs/entity-edge-model/plan.md +459 -0
- package/specs/entity-edge-model/spec.md +391 -0
- package/specs/evidence-aligner-v2/context.md +401 -0
- package/specs/evidence-aligner-v2/plan.md +303 -0
- package/specs/evidence-aligner-v2/spec.md +312 -0
- package/specs/mcp-desktop-integration/context.md +278 -0
- package/specs/mcp-desktop-integration/plan.md +550 -0
- package/specs/mcp-desktop-integration/spec.md +494 -0
- package/specs/post-tool-use-hook/context.md +319 -0
- package/specs/post-tool-use-hook/plan.md +469 -0
- package/specs/post-tool-use-hook/spec.md +364 -0
- package/specs/private-tags/context.md +288 -0
- package/specs/private-tags/plan.md +412 -0
- package/specs/private-tags/spec.md +345 -0
- package/specs/progressive-disclosure/context.md +346 -0
- package/specs/progressive-disclosure/plan.md +663 -0
- package/specs/progressive-disclosure/spec.md +415 -0
- package/specs/task-entity-system/context.md +297 -0
- package/specs/task-entity-system/plan.md +301 -0
- package/specs/task-entity-system/spec.md +314 -0
- package/specs/vector-outbox-v2/context.md +470 -0
- package/specs/vector-outbox-v2/plan.md +562 -0
- package/specs/vector-outbox-v2/spec.md +466 -0
- package/specs/web-viewer-ui/context.md +384 -0
- package/specs/web-viewer-ui/plan.md +797 -0
- package/specs/web-viewer-ui/spec.md +516 -0
- package/src/cli/index.ts +570 -0
- package/src/core/canonical-key.ts +186 -0
- package/src/core/citation-generator.ts +63 -0
- package/src/core/consolidated-store.ts +279 -0
- package/src/core/consolidation-worker.ts +384 -0
- package/src/core/context-formatter.ts +276 -0
- package/src/core/continuity-manager.ts +336 -0
- package/src/core/edge-repo.ts +324 -0
- package/src/core/embedder.ts +124 -0
- package/src/core/entity-repo.ts +342 -0
- package/src/core/event-store.ts +672 -0
- package/src/core/evidence-aligner.ts +635 -0
- package/src/core/graduation.ts +365 -0
- package/src/core/index.ts +32 -0
- package/src/core/matcher.ts +210 -0
- package/src/core/metadata-extractor.ts +203 -0
- package/src/core/privacy/filter.ts +179 -0
- package/src/core/privacy/index.ts +20 -0
- package/src/core/privacy/tag-parser.ts +145 -0
- package/src/core/progressive-retriever.ts +415 -0
- package/src/core/retriever.ts +235 -0
- package/src/core/task/blocker-resolver.ts +325 -0
- package/src/core/task/index.ts +9 -0
- package/src/core/task/task-matcher.ts +238 -0
- package/src/core/task/task-projector.ts +345 -0
- package/src/core/task/task-resolver.ts +414 -0
- package/src/core/types.ts +841 -0
- package/src/core/vector-outbox.ts +295 -0
- package/src/core/vector-store.ts +182 -0
- package/src/core/vector-worker.ts +488 -0
- package/src/core/working-set-store.ts +244 -0
- package/src/hooks/post-tool-use.ts +127 -0
- package/src/hooks/session-end.ts +78 -0
- package/src/hooks/session-start.ts +57 -0
- package/src/hooks/stop.ts +78 -0
- package/src/hooks/user-prompt-submit.ts +54 -0
- package/src/mcp/handlers.ts +212 -0
- package/src/mcp/index.ts +47 -0
- package/src/mcp/tools.ts +78 -0
- package/src/server/api/citations.ts +101 -0
- package/src/server/api/events.ts +101 -0
- package/src/server/api/index.ts +18 -0
- package/src/server/api/search.ts +98 -0
- package/src/server/api/sessions.ts +111 -0
- package/src/server/api/stats.ts +97 -0
- package/src/server/index.ts +91 -0
- package/src/services/memory-service.ts +626 -0
- package/src/services/session-history-importer.ts +367 -0
- package/tests/canonical-key.test.ts +101 -0
- package/tests/evidence-aligner.test.ts +152 -0
- package/tests/matcher.test.ts +112 -0
- package/tsconfig.json +24 -0
- package/vitest.config.ts +15 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
# Web Viewer UI Specification
|
|
2
|
+
|
|
3
|
+
> **Version**: 1.0.0
|
|
4
|
+
> **Status**: Draft
|
|
5
|
+
> **Created**: 2026-02-01
|
|
6
|
+
> **Reference**: claude-mem (thedotmack/claude-mem)
|
|
7
|
+
|
|
8
|
+
## 1. 개요
|
|
9
|
+
|
|
10
|
+
### 1.1 문제 정의
|
|
11
|
+
|
|
12
|
+
현재 시스템에서 메모리 상태 시각화가 어려움:
|
|
13
|
+
|
|
14
|
+
1. **CLI 한계**: 대량 데이터 탐색 불편
|
|
15
|
+
2. **실시간 모니터링 없음**: 세션 진행 중 메모리 변화 확인 불가
|
|
16
|
+
3. **디버깅 어려움**: 메모리 저장/검색 과정 추적 어려움
|
|
17
|
+
|
|
18
|
+
### 1.2 해결 방향
|
|
19
|
+
|
|
20
|
+
**Web Viewer UI**:
|
|
21
|
+
- HTTP API 서버 (localhost:37777)
|
|
22
|
+
- 실시간 메모리 스트림 대시보드
|
|
23
|
+
- 세션/프로젝트별 탐색 인터페이스
|
|
24
|
+
|
|
25
|
+
## 2. 핵심 개념
|
|
26
|
+
|
|
27
|
+
### 2.1 시스템 아키텍처
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
31
|
+
│ Claude Code │
|
|
32
|
+
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
|
33
|
+
│ │ Hooks │ │ CLI │ │ Memory │ │ Web │ │
|
|
34
|
+
│ │ │ │ │ │ Service │ │ Server │ │
|
|
35
|
+
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
|
|
36
|
+
│ │ │ │ │ │
|
|
37
|
+
│ └────────────┴────────────┴────────────┘ │
|
|
38
|
+
│ │ │
|
|
39
|
+
└──────────────────────────┼───────────────────────────────────┘
|
|
40
|
+
│
|
|
41
|
+
▼
|
|
42
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
43
|
+
│ Web Server (Bun) │
|
|
44
|
+
│ localhost:37777 │
|
|
45
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
46
|
+
│ │ REST API │ │ WebSocket │ │ Static │ │
|
|
47
|
+
│ │ /api/* │ │ /ws │ │ / │ │
|
|
48
|
+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
|
49
|
+
└─────────────────────────────────────────────────────────────┘
|
|
50
|
+
│
|
|
51
|
+
▼
|
|
52
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
53
|
+
│ Web Browser │
|
|
54
|
+
│ ┌─────────────────────────────────────────────────────┐ │
|
|
55
|
+
│ │ Memory Dashboard │ │
|
|
56
|
+
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
|
|
57
|
+
│ │ │ Sessions │ │ Timeline │ │ Search │ │ │
|
|
58
|
+
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
|
|
59
|
+
│ └─────────────────────────────────────────────────────┘ │
|
|
60
|
+
└─────────────────────────────────────────────────────────────┘
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 2.2 주요 기능
|
|
64
|
+
|
|
65
|
+
| 기능 | 설명 |
|
|
66
|
+
|------|------|
|
|
67
|
+
| **Session Browser** | 세션 목록, 세션별 이벤트 탐색 |
|
|
68
|
+
| **Memory Timeline** | 시간순 메모리 스트림 (실시간) |
|
|
69
|
+
| **Search Interface** | 벡터 검색 + 필터링 |
|
|
70
|
+
| **Stats Dashboard** | 저장소 통계, 사용량 |
|
|
71
|
+
| **Debug View** | Outbox 상태, 임베딩 진행률 |
|
|
72
|
+
| **Settings** | 설정 조회/수정 |
|
|
73
|
+
|
|
74
|
+
### 2.3 포트 및 경로
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
http://localhost:37777
|
|
78
|
+
├── / # 대시보드 메인
|
|
79
|
+
├── /sessions # 세션 목록
|
|
80
|
+
├── /sessions/:id # 세션 상세
|
|
81
|
+
├── /timeline # 실시간 타임라인
|
|
82
|
+
├── /search # 검색 인터페이스
|
|
83
|
+
├── /stats # 통계
|
|
84
|
+
├── /settings # 설정
|
|
85
|
+
└── /api # REST API
|
|
86
|
+
├── /api/sessions
|
|
87
|
+
├── /api/events
|
|
88
|
+
├── /api/search
|
|
89
|
+
├── /api/stats
|
|
90
|
+
└── /api/config
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 3. REST API 스키마
|
|
94
|
+
|
|
95
|
+
### 3.1 Sessions API
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// GET /api/sessions
|
|
99
|
+
interface SessionsResponse {
|
|
100
|
+
sessions: {
|
|
101
|
+
sessionId: string;
|
|
102
|
+
projectPath: string;
|
|
103
|
+
startedAt: Date;
|
|
104
|
+
endedAt?: Date;
|
|
105
|
+
eventCount: number;
|
|
106
|
+
status: 'active' | 'ended';
|
|
107
|
+
}[];
|
|
108
|
+
total: number;
|
|
109
|
+
page: number;
|
|
110
|
+
pageSize: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// GET /api/sessions/:id
|
|
114
|
+
interface SessionDetailResponse {
|
|
115
|
+
session: {
|
|
116
|
+
sessionId: string;
|
|
117
|
+
projectPath: string;
|
|
118
|
+
startedAt: Date;
|
|
119
|
+
endedAt?: Date;
|
|
120
|
+
summary?: string;
|
|
121
|
+
};
|
|
122
|
+
events: Event[];
|
|
123
|
+
stats: {
|
|
124
|
+
promptCount: number;
|
|
125
|
+
responseCount: number;
|
|
126
|
+
toolCount: number;
|
|
127
|
+
totalTokens: number;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 3.2 Events API
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// GET /api/events?sessionId=xxx&type=xxx&limit=100
|
|
136
|
+
interface EventsResponse {
|
|
137
|
+
events: {
|
|
138
|
+
eventId: string;
|
|
139
|
+
eventType: string;
|
|
140
|
+
timestamp: Date;
|
|
141
|
+
sessionId: string;
|
|
142
|
+
preview: string; // 100자 미리보기
|
|
143
|
+
metadata: {
|
|
144
|
+
tokenCount?: number;
|
|
145
|
+
hasCode?: boolean;
|
|
146
|
+
};
|
|
147
|
+
}[];
|
|
148
|
+
total: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// GET /api/events/:id
|
|
152
|
+
interface EventDetailResponse {
|
|
153
|
+
event: {
|
|
154
|
+
eventId: string;
|
|
155
|
+
eventType: string;
|
|
156
|
+
timestamp: Date;
|
|
157
|
+
sessionId: string;
|
|
158
|
+
payload: unknown; // 전체 페이로드
|
|
159
|
+
};
|
|
160
|
+
related: {
|
|
161
|
+
previous?: string;
|
|
162
|
+
next?: string;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 3.3 Search API
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
// POST /api/search
|
|
171
|
+
interface SearchRequest {
|
|
172
|
+
query: string;
|
|
173
|
+
filters?: {
|
|
174
|
+
sessionId?: string;
|
|
175
|
+
eventType?: string[];
|
|
176
|
+
dateFrom?: Date;
|
|
177
|
+
dateTo?: Date;
|
|
178
|
+
};
|
|
179
|
+
options?: {
|
|
180
|
+
topK?: number;
|
|
181
|
+
minScore?: number;
|
|
182
|
+
progressive?: boolean;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface SearchResponse {
|
|
187
|
+
results: {
|
|
188
|
+
id: string;
|
|
189
|
+
score: number;
|
|
190
|
+
type: string;
|
|
191
|
+
timestamp: Date;
|
|
192
|
+
sessionId: string;
|
|
193
|
+
preview: string;
|
|
194
|
+
highlight?: string; // 매칭된 부분 강조
|
|
195
|
+
}[];
|
|
196
|
+
meta: {
|
|
197
|
+
totalMatches: number;
|
|
198
|
+
searchTime: number;
|
|
199
|
+
mode: 'vector' | 'fts' | 'hybrid';
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 3.4 Stats API
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
// GET /api/stats
|
|
208
|
+
interface StatsResponse {
|
|
209
|
+
storage: {
|
|
210
|
+
eventCount: number;
|
|
211
|
+
vectorCount: number;
|
|
212
|
+
dbSizeMB: number;
|
|
213
|
+
vectorSizeMB: number;
|
|
214
|
+
};
|
|
215
|
+
sessions: {
|
|
216
|
+
total: number;
|
|
217
|
+
active: number;
|
|
218
|
+
thisWeek: number;
|
|
219
|
+
};
|
|
220
|
+
embeddings: {
|
|
221
|
+
pending: number;
|
|
222
|
+
processed: number;
|
|
223
|
+
failed: number;
|
|
224
|
+
avgProcessTime: number;
|
|
225
|
+
};
|
|
226
|
+
memory: {
|
|
227
|
+
heapUsed: number;
|
|
228
|
+
heapTotal: number;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// GET /api/stats/timeline
|
|
233
|
+
interface TimelineStatsResponse {
|
|
234
|
+
daily: {
|
|
235
|
+
date: string;
|
|
236
|
+
eventCount: number;
|
|
237
|
+
sessionCount: number;
|
|
238
|
+
}[];
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 3.5 Config API
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
// GET /api/config
|
|
246
|
+
interface ConfigResponse {
|
|
247
|
+
config: MemoryConfig;
|
|
248
|
+
editable: string[]; // 수정 가능한 필드 목록
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// PATCH /api/config
|
|
252
|
+
interface ConfigUpdateRequest {
|
|
253
|
+
updates: Partial<MemoryConfig>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
interface ConfigUpdateResponse {
|
|
257
|
+
success: boolean;
|
|
258
|
+
config: MemoryConfig;
|
|
259
|
+
restartRequired?: boolean;
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## 4. WebSocket 인터페이스
|
|
264
|
+
|
|
265
|
+
### 4.1 실시간 이벤트 스트림
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
// 연결: ws://localhost:37777/ws
|
|
269
|
+
|
|
270
|
+
// 클라이언트 → 서버 메시지
|
|
271
|
+
interface WSClientMessage {
|
|
272
|
+
type: 'subscribe' | 'unsubscribe';
|
|
273
|
+
channels: ('events' | 'stats' | 'outbox')[];
|
|
274
|
+
filters?: {
|
|
275
|
+
sessionId?: string;
|
|
276
|
+
eventType?: string[];
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// 서버 → 클라이언트 메시지
|
|
281
|
+
interface WSServerMessage {
|
|
282
|
+
channel: 'events' | 'stats' | 'outbox';
|
|
283
|
+
data: EventMessage | StatsMessage | OutboxMessage;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
interface EventMessage {
|
|
287
|
+
type: 'new_event';
|
|
288
|
+
event: {
|
|
289
|
+
eventId: string;
|
|
290
|
+
eventType: string;
|
|
291
|
+
timestamp: Date;
|
|
292
|
+
sessionId: string;
|
|
293
|
+
preview: string;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
interface OutboxMessage {
|
|
298
|
+
type: 'outbox_update';
|
|
299
|
+
pending: number;
|
|
300
|
+
processing: string[];
|
|
301
|
+
completed: string[];
|
|
302
|
+
failed: string[];
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### 4.2 연결 예시
|
|
307
|
+
|
|
308
|
+
```typescript
|
|
309
|
+
// 클라이언트 코드
|
|
310
|
+
const ws = new WebSocket('ws://localhost:37777/ws');
|
|
311
|
+
|
|
312
|
+
ws.onopen = () => {
|
|
313
|
+
ws.send(JSON.stringify({
|
|
314
|
+
type: 'subscribe',
|
|
315
|
+
channels: ['events', 'outbox']
|
|
316
|
+
}));
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
ws.onmessage = (event) => {
|
|
320
|
+
const msg = JSON.parse(event.data);
|
|
321
|
+
if (msg.channel === 'events') {
|
|
322
|
+
addToTimeline(msg.data.event);
|
|
323
|
+
} else if (msg.channel === 'outbox') {
|
|
324
|
+
updateOutboxStatus(msg.data);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## 5. UI 컴포넌트
|
|
330
|
+
|
|
331
|
+
### 5.1 대시보드 레이아웃
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
335
|
+
│ 🧠 Code Memory [Search] [Settings]│
|
|
336
|
+
├─────────────────────────────────────────────────────────────┤
|
|
337
|
+
│ ┌─────────────┐ ┌───────────────────────────────────────┐ │
|
|
338
|
+
│ │ │ │ │ │
|
|
339
|
+
│ │ Sessions │ │ Main Content Area │ │
|
|
340
|
+
│ │ ───────── │ │ │ │
|
|
341
|
+
│ │ > session1 │ │ - Timeline View │ │
|
|
342
|
+
│ │ session2 │ │ - Search Results │ │
|
|
343
|
+
│ │ session3 │ │ - Session Details │ │
|
|
344
|
+
│ │ ... │ │ - Stats Dashboard │ │
|
|
345
|
+
│ │ │ │ │ │
|
|
346
|
+
│ │ ───────── │ │ │ │
|
|
347
|
+
│ │ Projects │ │ │ │
|
|
348
|
+
│ │ > project1 │ │ │ │
|
|
349
|
+
│ │ project2 │ │ │ │
|
|
350
|
+
│ │ │ │ │ │
|
|
351
|
+
│ └─────────────┘ └───────────────────────────────────────┘ │
|
|
352
|
+
├─────────────────────────────────────────────────────────────┤
|
|
353
|
+
│ Events: 1,234 │ Vectors: 987 │ Outbox: 5 pending │
|
|
354
|
+
└─────────────────────────────────────────────────────────────┘
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### 5.2 Timeline View
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
361
|
+
│ 📅 Timeline [Filter ▼] [Live ●] │
|
|
362
|
+
├─────────────────────────────────────────────────────────────┤
|
|
363
|
+
│ │
|
|
364
|
+
│ ○─── 14:35 ───────────────────────────────────────────────│
|
|
365
|
+
│ │ │
|
|
366
|
+
│ │ 💬 User Prompt │
|
|
367
|
+
│ │ "DuckDB 스키마를 어떻게 설계할까요?" │
|
|
368
|
+
│ │ │
|
|
369
|
+
│ ○─── 14:36 ───────────────────────────────────────────────│
|
|
370
|
+
│ │ │
|
|
371
|
+
│ │ 🛠️ Tool: Read │
|
|
372
|
+
│ │ /src/core/event-store.ts │
|
|
373
|
+
│ │ │
|
|
374
|
+
│ ○─── 14:37 ───────────────────────────────────────────────│
|
|
375
|
+
│ │ │
|
|
376
|
+
│ │ 🤖 Assistant Response │
|
|
377
|
+
│ │ "DuckDB를 사용하여 이벤트 소싱 패턴을..." │
|
|
378
|
+
│ │ [Show Full] [Copy] │
|
|
379
|
+
│ │ │
|
|
380
|
+
│ ○─── 14:40 ───────────────────────────────────────────────│
|
|
381
|
+
│ │
|
|
382
|
+
└─────────────────────────────────────────────────────────────┘
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### 5.3 Search View
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
389
|
+
│ 🔍 Search │
|
|
390
|
+
├─────────────────────────────────────────────────────────────┤
|
|
391
|
+
│ ┌─────────────────────────────────────────────────────┐ │
|
|
392
|
+
│ │ Type to search memories... │ │
|
|
393
|
+
│ └─────────────────────────────────────────────────────┘ │
|
|
394
|
+
│ │
|
|
395
|
+
│ Filters: [All Types ▼] [All Sessions ▼] [Date Range ▼] │
|
|
396
|
+
│ │
|
|
397
|
+
│ ───────────────────────────────────────────────────────── │
|
|
398
|
+
│ │
|
|
399
|
+
│ 📄 Result 1 (score: 0.94) │
|
|
400
|
+
│ Session: abc123 │ 2026-01-30 14:05 │
|
|
401
|
+
│ "DuckDB를 사용하여 이벤트 소싱 패턴을 구현하는 방법을..." │
|
|
402
|
+
│ [View] [Timeline] [Copy ID] │
|
|
403
|
+
│ │
|
|
404
|
+
│ 📄 Result 2 (score: 0.87) │
|
|
405
|
+
│ Session: def456 │ 2026-01-29 10:20 │
|
|
406
|
+
│ "타입 시스템 리팩토링 시 고려할 점..." │
|
|
407
|
+
│ [View] [Timeline] [Copy ID] │
|
|
408
|
+
│ │
|
|
409
|
+
└─────────────────────────────────────────────────────────────┘
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### 5.4 Stats Dashboard
|
|
413
|
+
|
|
414
|
+
```
|
|
415
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
416
|
+
│ 📊 Statistics [Refresh] [Export] │
|
|
417
|
+
├─────────────────────────────────────────────────────────────┤
|
|
418
|
+
│ │
|
|
419
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
|
420
|
+
│ │ Events │ │ Vectors │ │ Sessions │ │
|
|
421
|
+
│ │ 1,234 │ │ 987 │ │ 45 │ │
|
|
422
|
+
│ │ ↑12 today │ │ ↑8 today │ │ 3 active │ │
|
|
423
|
+
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
|
424
|
+
│ │
|
|
425
|
+
│ Storage │
|
|
426
|
+
│ ┌─────────────────────────────────────────────────────┐ │
|
|
427
|
+
│ │ DuckDB [████████░░] 156 MB / 500 MB │ │
|
|
428
|
+
│ │ LanceDB [███░░░░░░░] 45 MB / 500 MB │ │
|
|
429
|
+
│ └─────────────────────────────────────────────────────┘ │
|
|
430
|
+
│ │
|
|
431
|
+
│ Embedding Pipeline │
|
|
432
|
+
│ ┌─────────────────────────────────────────────────────┐ │
|
|
433
|
+
│ │ Pending: 5 │ Processing: 2 │ Failed: 0 │ │
|
|
434
|
+
│ │ Avg Time: 125ms │ │
|
|
435
|
+
│ └─────────────────────────────────────────────────────┘ │
|
|
436
|
+
│ │
|
|
437
|
+
│ Activity (Last 7 Days) │
|
|
438
|
+
│ ┌─────────────────────────────────────────────────────┐ │
|
|
439
|
+
│ │ ▂▄█▆▃▂▄ │ │
|
|
440
|
+
│ │ Mon Tue Wed Thu Fri Sat Sun │ │
|
|
441
|
+
│ └─────────────────────────────────────────────────────┘ │
|
|
442
|
+
│ │
|
|
443
|
+
└─────────────────────────────────────────────────────────────┘
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
## 6. 기술 스택
|
|
447
|
+
|
|
448
|
+
### 6.1 서버
|
|
449
|
+
|
|
450
|
+
| 컴포넌트 | 기술 | 이유 |
|
|
451
|
+
|----------|------|------|
|
|
452
|
+
| HTTP Server | Bun.serve | 빠른 성능, 번들 불필요 |
|
|
453
|
+
| WebSocket | Bun WebSocket | 내장 지원 |
|
|
454
|
+
| Router | Hono | 경량, Bun 최적화 |
|
|
455
|
+
|
|
456
|
+
### 6.2 클라이언트
|
|
457
|
+
|
|
458
|
+
| 컴포넌트 | 기술 | 이유 |
|
|
459
|
+
|----------|------|------|
|
|
460
|
+
| UI Framework | Preact + HTM | 번들 크기 최소 |
|
|
461
|
+
| Styling | Tailwind CSS | 빠른 개발 |
|
|
462
|
+
| State | Signals | 경량 반응성 |
|
|
463
|
+
| Charts | Chart.js | 간단한 통계 시각화 |
|
|
464
|
+
|
|
465
|
+
### 6.3 대안
|
|
466
|
+
|
|
467
|
+
| 옵션 | 장점 | 단점 |
|
|
468
|
+
|------|------|------|
|
|
469
|
+
| React + Vite | 생태계 | 번들 크기 |
|
|
470
|
+
| Vue 3 | 간결함 | 추가 학습 |
|
|
471
|
+
| Svelte | 번들 최소 | 생태계 작음 |
|
|
472
|
+
| **Preact + HTM** | 초경량, JSX 없이 | 생태계 제한 |
|
|
473
|
+
|
|
474
|
+
## 7. 보안
|
|
475
|
+
|
|
476
|
+
### 7.1 접근 제어
|
|
477
|
+
|
|
478
|
+
```typescript
|
|
479
|
+
// localhost만 허용
|
|
480
|
+
const server = Bun.serve({
|
|
481
|
+
hostname: '127.0.0.1', // localhost만
|
|
482
|
+
port: 37777,
|
|
483
|
+
// ...
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// 또는 토큰 기반
|
|
487
|
+
const AUTH_TOKEN = process.env.MEMORY_VIEWER_TOKEN;
|
|
488
|
+
|
|
489
|
+
function authMiddleware(req: Request): boolean {
|
|
490
|
+
const token = req.headers.get('Authorization');
|
|
491
|
+
return token === `Bearer ${AUTH_TOKEN}`;
|
|
492
|
+
}
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### 7.2 민감 정보 필터링
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
// API 응답에서 민감 정보 제거
|
|
499
|
+
function sanitizeEvent(event: Event): SanitizedEvent {
|
|
500
|
+
return {
|
|
501
|
+
...event,
|
|
502
|
+
payload: maskSensitiveFields(event.payload)
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
## 8. 성공 기준
|
|
508
|
+
|
|
509
|
+
- [ ] localhost:37777에서 대시보드 접근 가능
|
|
510
|
+
- [ ] 세션 목록 및 상세 조회 동작
|
|
511
|
+
- [ ] 실시간 이벤트 스트림 표시
|
|
512
|
+
- [ ] 검색 기능 동작 (벡터 + FTS)
|
|
513
|
+
- [ ] 통계 대시보드 표시
|
|
514
|
+
- [ ] WebSocket 연결 안정적
|
|
515
|
+
- [ ] 첫 로드 < 1초
|
|
516
|
+
- [ ] API 응답 < 200ms
|