@agent-link/server 0.1.95 → 0.1.96
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 +66 -5
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
|
@@ -510,9 +510,19 @@ body {
|
|
|
510
510
|
justify-content: space-between;
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
.session-
|
|
513
|
+
.session-actions {
|
|
514
514
|
display: none;
|
|
515
515
|
align-items: center;
|
|
516
|
+
gap: 2px;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.session-item:hover .session-actions {
|
|
520
|
+
display: flex;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.session-delete-btn {
|
|
524
|
+
display: flex;
|
|
525
|
+
align-items: center;
|
|
516
526
|
justify-content: center;
|
|
517
527
|
width: 20px;
|
|
518
528
|
height: 20px;
|
|
@@ -525,15 +535,66 @@ body {
|
|
|
525
535
|
transition: color 0.15s, background 0.15s;
|
|
526
536
|
}
|
|
527
537
|
|
|
528
|
-
.session-item:hover .session-delete-btn {
|
|
529
|
-
display: flex;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
538
|
.session-delete-btn:hover {
|
|
533
539
|
color: var(--error);
|
|
534
540
|
background: rgba(239, 68, 68, 0.1);
|
|
535
541
|
}
|
|
536
542
|
|
|
543
|
+
/* ── Rename session (pencil icon + inline edit) ── */
|
|
544
|
+
.session-rename-btn {
|
|
545
|
+
display: flex;
|
|
546
|
+
align-items: center;
|
|
547
|
+
justify-content: center;
|
|
548
|
+
width: 20px;
|
|
549
|
+
height: 20px;
|
|
550
|
+
background: none;
|
|
551
|
+
border: none;
|
|
552
|
+
border-radius: 4px;
|
|
553
|
+
color: var(--text-secondary);
|
|
554
|
+
cursor: pointer;
|
|
555
|
+
padding: 0;
|
|
556
|
+
transition: color 0.15s, background 0.15s;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.session-rename-btn:hover {
|
|
560
|
+
color: var(--accent);
|
|
561
|
+
background: rgba(99, 102, 241, 0.1);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.session-rename-row {
|
|
565
|
+
display: flex;
|
|
566
|
+
align-items: center;
|
|
567
|
+
gap: 4px;
|
|
568
|
+
min-width: 0;
|
|
569
|
+
flex: 1;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.session-rename-input {
|
|
573
|
+
flex: 1;
|
|
574
|
+
min-width: 0;
|
|
575
|
+
background: var(--bg-primary);
|
|
576
|
+
border: 1px solid var(--accent);
|
|
577
|
+
border-radius: 4px;
|
|
578
|
+
color: var(--text-primary);
|
|
579
|
+
font-size: 0.82rem;
|
|
580
|
+
padding: 2px 6px;
|
|
581
|
+
outline: none;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.session-rename-ok,
|
|
585
|
+
.session-rename-cancel {
|
|
586
|
+
background: none;
|
|
587
|
+
border: none;
|
|
588
|
+
color: var(--text-secondary);
|
|
589
|
+
cursor: pointer;
|
|
590
|
+
font-size: 0.9rem;
|
|
591
|
+
padding: 0 2px;
|
|
592
|
+
line-height: 1;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.session-rename-ok:hover { color: var(--accent); }
|
|
596
|
+
.session-rename-cancel:hover { color: var(--error); }
|
|
597
|
+
|
|
537
598
|
/* ── Delete confirmation dialog ── */
|
|
538
599
|
.delete-confirm-dialog {
|
|
539
600
|
width: 360px;
|