@agent-link/server 0.1.54 → 0.1.55

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-link/server",
3
- "version": "0.1.54",
3
+ "version": "0.1.55",
4
4
  "description": "AgentLink relay server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/web/app.js CHANGED
@@ -68,6 +68,10 @@ const App = {
68
68
  const deleteConfirmOpen = ref(false);
69
69
  const deleteConfirmTitle = ref('');
70
70
 
71
+ // Working directory history state
72
+ const workDirHistory = ref([]);
73
+ const workDirHistoryOpen = ref(false);
74
+
71
75
  // File attachment state
72
76
  const attachments = ref([]);
73
77
  const fileInputRef = ref(null);
@@ -141,6 +145,7 @@ const App = {
141
145
  folderPickerOpen, folderPickerPath, folderPickerEntries,
142
146
  folderPickerLoading, folderPickerSelected, streaming,
143
147
  deleteConfirmOpen, deleteConfirmTitle,
148
+ workDirHistory, workDirHistoryOpen,
144
149
  });
145
150
 
146
151
  const { connect, wsSend, closeWs } = createConnection({
@@ -278,6 +283,11 @@ const App = {
278
283
  deleteSession: sidebar.deleteSession,
279
284
  confirmDeleteSession: sidebar.confirmDeleteSession,
280
285
  cancelDeleteSession: sidebar.cancelDeleteSession,
286
+ // Working directory history
287
+ workDirHistory, workDirHistoryOpen,
288
+ selectWorkDirHistory: sidebar.selectWorkDirHistory,
289
+ removeWorkDirHistory: sidebar.removeWorkDirHistory,
290
+ toggleWorkDirHistory: sidebar.toggleWorkDirHistory,
281
291
  // File attachments
282
292
  attachments, fileInputRef, dragOver,
283
293
  triggerFileInput: fileAttach.triggerFileInput,
@@ -335,11 +345,33 @@ const App = {
335
345
  </div>
336
346
  <div class="sidebar-workdir-header">
337
347
  <div class="sidebar-workdir-label">Working Directory</div>
338
- <button class="sidebar-change-dir-btn" @click="openFolderPicker" title="Change working directory" :disabled="isProcessing">
339
- <svg viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/></svg>
340
- </button>
348
+ <div class="sidebar-workdir-actions">
349
+ <button class="sidebar-change-dir-btn" @click="toggleWorkDirHistory" title="Recent directories" :disabled="isProcessing" v-if="workDirHistory.length > 1">
350
+ <svg viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M13 3a9 9 0 0 0-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0 0 13 21a9 9 0 0 0 0-18zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>
351
+ </button>
352
+ <button class="sidebar-change-dir-btn" @click="openFolderPicker" title="Change working directory" :disabled="isProcessing">
353
+ <svg viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/></svg>
354
+ </button>
355
+ </div>
341
356
  </div>
342
357
  <div class="sidebar-workdir-path" :title="workDir">{{ workDir }}</div>
358
+ <!-- Workdir history dropdown -->
359
+ <div v-if="workDirHistoryOpen && workDirHistory.length > 1" class="workdir-history-dropdown">
360
+ <div
361
+ v-for="dir in workDirHistory" :key="dir"
362
+ :class="['workdir-history-item', { active: dir === workDir }]"
363
+ @click="selectWorkDirHistory(dir)"
364
+ :title="dir"
365
+ >
366
+ <span class="workdir-history-path">{{ dir }}</span>
367
+ <button
368
+ v-if="dir !== workDir"
369
+ class="workdir-history-remove"
370
+ @click.stop="removeWorkDirHistory(dir)"
371
+ title="Remove from history"
372
+ >&times;</button>
373
+ </div>
374
+ </div>
343
375
  </div>
344
376
  </div>
345
377
 
@@ -145,6 +145,7 @@ export function createConnection(deps) {
145
145
  hostname.value = msg.agent.hostname || '';
146
146
  workDir.value = msg.agent.workDir;
147
147
  agentVersion.value = msg.agent.version || '';
148
+ sidebar.addToWorkDirHistory(msg.agent.workDir);
148
149
  const savedDir = localStorage.getItem('agentlink-workdir');
149
150
  if (savedDir && savedDir !== msg.agent.workDir) {
150
151
  wsSend({ type: 'change_workdir', workDir: savedDir });
@@ -341,6 +342,7 @@ export function createConnection(deps) {
341
342
  } else if (msg.type === 'workdir_changed') {
342
343
  workDir.value = msg.workDir;
343
344
  localStorage.setItem('agentlink-workdir', msg.workDir);
345
+ sidebar.addToWorkDirHistory(msg.workDir);
344
346
  messages.value = [];
345
347
  toolMsgMap.clear();
346
348
  visibleLimit.value = 50;
@@ -31,6 +31,44 @@ export function createSidebar(deps) {
31
31
  folderPickerLoading, folderPickerSelected, streaming,
32
32
  } = deps;
33
33
 
34
+ // ── Working directory history ──
35
+
36
+ const WORKDIR_HISTORY_KEY = 'agentlink-workdir-history';
37
+ const MAX_HISTORY = 10;
38
+ const workDirHistory = deps.workDirHistory;
39
+ const workDirHistoryOpen = deps.workDirHistoryOpen;
40
+
41
+ // Load from localStorage on init
42
+ try {
43
+ const saved = localStorage.getItem(WORKDIR_HISTORY_KEY);
44
+ if (saved) workDirHistory.value = JSON.parse(saved);
45
+ } catch { /* ignore */ }
46
+
47
+ function addToWorkDirHistory(dir) {
48
+ if (!dir) return;
49
+ const list = workDirHistory.value.filter(d => d !== dir);
50
+ list.unshift(dir);
51
+ if (list.length > MAX_HISTORY) list.length = MAX_HISTORY;
52
+ workDirHistory.value = list;
53
+ localStorage.setItem(WORKDIR_HISTORY_KEY, JSON.stringify(list));
54
+ }
55
+
56
+ function selectWorkDirHistory(dir) {
57
+ workDirHistoryOpen.value = false;
58
+ if (dir === workDir.value) return;
59
+ wsSend({ type: 'change_workdir', workDir: dir });
60
+ }
61
+
62
+ function removeWorkDirHistory(dir) {
63
+ const list = workDirHistory.value.filter(d => d !== dir);
64
+ workDirHistory.value = list;
65
+ localStorage.setItem(WORKDIR_HISTORY_KEY, JSON.stringify(list));
66
+ }
67
+
68
+ function toggleWorkDirHistory() {
69
+ workDirHistoryOpen.value = !workDirHistoryOpen.value;
70
+ }
71
+
34
72
  // ── Session management ──
35
73
 
36
74
  function requestSessionList() {
@@ -207,6 +245,7 @@ export function createSidebar(deps) {
207
245
  return {
208
246
  requestSessionList, resumeSession, newConversation, toggleSidebar,
209
247
  deleteSession, confirmDeleteSession, cancelDeleteSession,
248
+ addToWorkDirHistory, selectWorkDirHistory, removeWorkDirHistory, toggleWorkDirHistory,
210
249
  openFolderPicker, folderPickerNavigateUp, folderPickerSelectItem,
211
250
  folderPickerEnter, folderPickerGoToPath, confirmFolderPicker,
212
251
  groupedSessions,
package/web/style.css CHANGED
@@ -1543,6 +1543,79 @@ body {
1543
1543
  cursor: not-allowed;
1544
1544
  }
1545
1545
 
1546
+ .sidebar-workdir-actions {
1547
+ display: flex;
1548
+ gap: 4px;
1549
+ }
1550
+
1551
+ /* ── Workdir history dropdown ── */
1552
+ .workdir-history-dropdown {
1553
+ margin-top: 6px;
1554
+ border: 1px solid var(--border);
1555
+ border-radius: 6px;
1556
+ background: var(--bg-secondary);
1557
+ max-height: 200px;
1558
+ overflow-y: auto;
1559
+ }
1560
+
1561
+ .workdir-history-item {
1562
+ display: flex;
1563
+ align-items: center;
1564
+ padding: 6px 8px;
1565
+ font-size: 0.75rem;
1566
+ font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
1567
+ color: var(--text-primary);
1568
+ cursor: pointer;
1569
+ transition: background 0.1s;
1570
+ gap: 4px;
1571
+ }
1572
+
1573
+ .workdir-history-item:hover {
1574
+ background: var(--bg-tertiary);
1575
+ }
1576
+
1577
+ .workdir-history-item.active {
1578
+ color: var(--accent);
1579
+ font-weight: 600;
1580
+ }
1581
+
1582
+ .workdir-history-item + .workdir-history-item {
1583
+ border-top: 1px solid var(--border);
1584
+ }
1585
+
1586
+ .workdir-history-path {
1587
+ flex: 1;
1588
+ overflow: hidden;
1589
+ text-overflow: ellipsis;
1590
+ white-space: nowrap;
1591
+ }
1592
+
1593
+ .workdir-history-remove {
1594
+ flex-shrink: 0;
1595
+ display: none;
1596
+ align-items: center;
1597
+ justify-content: center;
1598
+ width: 18px;
1599
+ height: 18px;
1600
+ background: none;
1601
+ border: none;
1602
+ border-radius: 3px;
1603
+ color: var(--text-secondary);
1604
+ font-size: 0.85rem;
1605
+ cursor: pointer;
1606
+ padding: 0;
1607
+ line-height: 1;
1608
+ }
1609
+
1610
+ .workdir-history-item:hover .workdir-history-remove {
1611
+ display: flex;
1612
+ }
1613
+
1614
+ .workdir-history-remove:hover {
1615
+ color: var(--error);
1616
+ background: rgba(239, 68, 68, 0.1);
1617
+ }
1618
+
1546
1619
  /* ── Folder Picker Modal ── */
1547
1620
  .folder-picker-overlay {
1548
1621
  position: fixed;