@agent-link/server 0.1.95 → 0.1.97
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/package.json +1 -1
- package/web/app.js +41 -10
- package/web/modules/connection.js +3 -0
- package/web/modules/sidebar.js +29 -0
- package/web/style.css +70 -7
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -69,6 +69,10 @@ const App = {
|
|
|
69
69
|
const deleteConfirmOpen = ref(false);
|
|
70
70
|
const deleteConfirmTitle = ref('');
|
|
71
71
|
|
|
72
|
+
// Rename session state
|
|
73
|
+
const renamingSessionId = ref(null);
|
|
74
|
+
const renameText = ref('');
|
|
75
|
+
|
|
72
76
|
// Working directory history
|
|
73
77
|
const workdirHistory = ref([]);
|
|
74
78
|
|
|
@@ -152,6 +156,7 @@ const App = {
|
|
|
152
156
|
folderPickerOpen, folderPickerPath, folderPickerEntries,
|
|
153
157
|
folderPickerLoading, folderPickerSelected, streaming,
|
|
154
158
|
deleteConfirmOpen, deleteConfirmTitle,
|
|
159
|
+
renamingSessionId, renameText,
|
|
155
160
|
hostname, workdirHistory,
|
|
156
161
|
});
|
|
157
162
|
|
|
@@ -319,6 +324,11 @@ const App = {
|
|
|
319
324
|
deleteSession: sidebar.deleteSession,
|
|
320
325
|
confirmDeleteSession: sidebar.confirmDeleteSession,
|
|
321
326
|
cancelDeleteSession: sidebar.cancelDeleteSession,
|
|
327
|
+
// Rename session
|
|
328
|
+
renamingSessionId, renameText,
|
|
329
|
+
startRename: sidebar.startRename,
|
|
330
|
+
confirmRename: sidebar.confirmRename,
|
|
331
|
+
cancelRename: sidebar.cancelRename,
|
|
322
332
|
// Working directory history
|
|
323
333
|
filteredWorkdirHistory: sidebar.filteredWorkdirHistory,
|
|
324
334
|
switchToWorkdir: sidebar.switchToWorkdir,
|
|
@@ -432,20 +442,41 @@ const App = {
|
|
|
432
442
|
<div
|
|
433
443
|
v-for="s in group.sessions" :key="s.sessionId"
|
|
434
444
|
:class="['session-item', { active: currentClaudeSessionId === s.sessionId }]"
|
|
435
|
-
@click="resumeSession(s)"
|
|
445
|
+
@click="renamingSessionId !== s.sessionId && resumeSession(s)"
|
|
436
446
|
:title="s.preview"
|
|
437
447
|
>
|
|
438
|
-
<div class="session-
|
|
448
|
+
<div v-if="renamingSessionId === s.sessionId" class="session-rename-row">
|
|
449
|
+
<input
|
|
450
|
+
class="session-rename-input"
|
|
451
|
+
v-model="renameText"
|
|
452
|
+
@click.stop
|
|
453
|
+
@keydown.enter.stop="confirmRename"
|
|
454
|
+
@keydown.escape.stop="cancelRename"
|
|
455
|
+
@vue:mounted="$event.el.focus()"
|
|
456
|
+
/>
|
|
457
|
+
<button class="session-rename-ok" @click.stop="confirmRename" title="Confirm">✓</button>
|
|
458
|
+
<button class="session-rename-cancel" @click.stop="cancelRename" title="Cancel">×</button>
|
|
459
|
+
</div>
|
|
460
|
+
<div v-else class="session-title">{{ s.title }}</div>
|
|
439
461
|
<div class="session-meta">
|
|
440
462
|
<span>{{ formatRelativeTime(s.lastModified) }}</span>
|
|
441
|
-
<
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
463
|
+
<span v-if="renamingSessionId !== s.sessionId && !isProcessing" class="session-actions">
|
|
464
|
+
<button
|
|
465
|
+
class="session-rename-btn"
|
|
466
|
+
@click.stop="startRename(s)"
|
|
467
|
+
title="Rename session"
|
|
468
|
+
>
|
|
469
|
+
<svg viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
|
|
470
|
+
</button>
|
|
471
|
+
<button
|
|
472
|
+
v-if="currentClaudeSessionId !== s.sessionId"
|
|
473
|
+
class="session-delete-btn"
|
|
474
|
+
@click.stop="deleteSession(s)"
|
|
475
|
+
title="Delete session"
|
|
476
|
+
>
|
|
477
|
+
<svg viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>
|
|
478
|
+
</button>
|
|
479
|
+
</span>
|
|
449
480
|
</div>
|
|
450
481
|
</div>
|
|
451
482
|
</div>
|
|
@@ -312,6 +312,9 @@ export function createConnection(deps) {
|
|
|
312
312
|
loadingSessions.value = false;
|
|
313
313
|
} else if (msg.type === 'session_deleted') {
|
|
314
314
|
historySessions.value = historySessions.value.filter(s => s.sessionId !== msg.sessionId);
|
|
315
|
+
} else if (msg.type === 'session_renamed') {
|
|
316
|
+
const session = historySessions.value.find(s => s.sessionId === msg.sessionId);
|
|
317
|
+
if (session) session.title = msg.newTitle;
|
|
315
318
|
} else if (msg.type === 'conversation_resumed') {
|
|
316
319
|
currentClaudeSessionId.value = msg.claudeSessionId;
|
|
317
320
|
if (msg.history && Array.isArray(msg.history)) {
|
package/web/modules/sidebar.js
CHANGED
|
@@ -109,6 +109,34 @@ export function createSidebar(deps) {
|
|
|
109
109
|
pendingDeleteSession = null;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
// ── Rename session ──
|
|
113
|
+
|
|
114
|
+
const renamingSessionId = deps.renamingSessionId;
|
|
115
|
+
const renameText = deps.renameText;
|
|
116
|
+
|
|
117
|
+
function startRename(session) {
|
|
118
|
+
if (isProcessing.value) return;
|
|
119
|
+
renamingSessionId.value = session.sessionId;
|
|
120
|
+
renameText.value = session.title || '';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function confirmRename() {
|
|
124
|
+
const sid = renamingSessionId.value;
|
|
125
|
+
const title = renameText.value.trim();
|
|
126
|
+
if (!sid || !title) {
|
|
127
|
+
cancelRename();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
wsSend({ type: 'rename_session', sessionId: sid, newTitle: title });
|
|
131
|
+
renamingSessionId.value = null;
|
|
132
|
+
renameText.value = '';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function cancelRename() {
|
|
136
|
+
renamingSessionId.value = null;
|
|
137
|
+
renameText.value = '';
|
|
138
|
+
}
|
|
139
|
+
|
|
112
140
|
// ── Folder picker ──
|
|
113
141
|
|
|
114
142
|
function openFolderPicker() {
|
|
@@ -253,6 +281,7 @@ export function createSidebar(deps) {
|
|
|
253
281
|
return {
|
|
254
282
|
requestSessionList, resumeSession, newConversation, toggleSidebar,
|
|
255
283
|
deleteSession, confirmDeleteSession, cancelDeleteSession,
|
|
284
|
+
startRename, confirmRename, cancelRename,
|
|
256
285
|
openFolderPicker, folderPickerNavigateUp, folderPickerSelectItem,
|
|
257
286
|
folderPickerEnter, folderPickerGoToPath, confirmFolderPicker,
|
|
258
287
|
groupedSessions,
|
package/web/style.css
CHANGED
|
@@ -328,7 +328,7 @@ body {
|
|
|
328
328
|
color: var(--text-primary);
|
|
329
329
|
}
|
|
330
330
|
.workdir-history-delete {
|
|
331
|
-
display:
|
|
331
|
+
display: flex;
|
|
332
332
|
align-items: center;
|
|
333
333
|
justify-content: center;
|
|
334
334
|
width: 18px;
|
|
@@ -341,9 +341,10 @@ body {
|
|
|
341
341
|
padding: 0;
|
|
342
342
|
flex-shrink: 0;
|
|
343
343
|
transition: color 0.15s, background 0.15s;
|
|
344
|
+
visibility: hidden;
|
|
344
345
|
}
|
|
345
346
|
.workdir-history-item:hover .workdir-history-delete {
|
|
346
|
-
|
|
347
|
+
visibility: visible;
|
|
347
348
|
}
|
|
348
349
|
.workdir-history-delete:hover {
|
|
349
350
|
color: var(--error);
|
|
@@ -510,8 +511,19 @@ body {
|
|
|
510
511
|
justify-content: space-between;
|
|
511
512
|
}
|
|
512
513
|
|
|
514
|
+
.session-actions {
|
|
515
|
+
display: flex;
|
|
516
|
+
align-items: center;
|
|
517
|
+
gap: 2px;
|
|
518
|
+
visibility: hidden;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.session-item:hover .session-actions {
|
|
522
|
+
visibility: visible;
|
|
523
|
+
}
|
|
524
|
+
|
|
513
525
|
.session-delete-btn {
|
|
514
|
-
display:
|
|
526
|
+
display: flex;
|
|
515
527
|
align-items: center;
|
|
516
528
|
justify-content: center;
|
|
517
529
|
width: 20px;
|
|
@@ -525,15 +537,66 @@ body {
|
|
|
525
537
|
transition: color 0.15s, background 0.15s;
|
|
526
538
|
}
|
|
527
539
|
|
|
528
|
-
.session-item:hover .session-delete-btn {
|
|
529
|
-
display: flex;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
540
|
.session-delete-btn:hover {
|
|
533
541
|
color: var(--error);
|
|
534
542
|
background: rgba(239, 68, 68, 0.1);
|
|
535
543
|
}
|
|
536
544
|
|
|
545
|
+
/* ── Rename session (pencil icon + inline edit) ── */
|
|
546
|
+
.session-rename-btn {
|
|
547
|
+
display: flex;
|
|
548
|
+
align-items: center;
|
|
549
|
+
justify-content: center;
|
|
550
|
+
width: 20px;
|
|
551
|
+
height: 20px;
|
|
552
|
+
background: none;
|
|
553
|
+
border: none;
|
|
554
|
+
border-radius: 4px;
|
|
555
|
+
color: var(--text-secondary);
|
|
556
|
+
cursor: pointer;
|
|
557
|
+
padding: 0;
|
|
558
|
+
transition: color 0.15s, background 0.15s;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.session-rename-btn:hover {
|
|
562
|
+
color: var(--accent);
|
|
563
|
+
background: rgba(99, 102, 241, 0.1);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.session-rename-row {
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
gap: 4px;
|
|
570
|
+
min-width: 0;
|
|
571
|
+
flex: 1;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.session-rename-input {
|
|
575
|
+
flex: 1;
|
|
576
|
+
min-width: 0;
|
|
577
|
+
background: var(--bg-primary);
|
|
578
|
+
border: 1px solid var(--accent);
|
|
579
|
+
border-radius: 4px;
|
|
580
|
+
color: var(--text-primary);
|
|
581
|
+
font-size: 0.82rem;
|
|
582
|
+
padding: 2px 6px;
|
|
583
|
+
outline: none;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.session-rename-ok,
|
|
587
|
+
.session-rename-cancel {
|
|
588
|
+
background: none;
|
|
589
|
+
border: none;
|
|
590
|
+
color: var(--text-secondary);
|
|
591
|
+
cursor: pointer;
|
|
592
|
+
font-size: 0.9rem;
|
|
593
|
+
padding: 0 2px;
|
|
594
|
+
line-height: 1;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.session-rename-ok:hover { color: var(--accent); }
|
|
598
|
+
.session-rename-cancel:hover { color: var(--error); }
|
|
599
|
+
|
|
537
600
|
/* ── Delete confirmation dialog ── */
|
|
538
601
|
.delete-confirm-dialog {
|
|
539
602
|
width: 360px;
|