@agent-link/server 0.1.125 → 0.1.127
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/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/web/app.js +40 -6
- package/web/landing.html +19 -1
- package/web/landing.zh.html +1261 -0
- package/web/modules/connection.js +4 -0
- package/web/modules/filePreview.js +16 -0
- package/web/modules/sidebar.js +11 -1
- package/web/style.css +70 -0
|
@@ -20,6 +20,7 @@ export function createConnection(deps) {
|
|
|
20
20
|
authRequired, authPassword, authError, authAttempts, authLocked,
|
|
21
21
|
streaming, sidebar,
|
|
22
22
|
scrollToBottom,
|
|
23
|
+
workdirSwitching,
|
|
23
24
|
// Multi-session parallel
|
|
24
25
|
currentConversationId, processingConversations, conversationCache,
|
|
25
26
|
switchConversation,
|
|
@@ -504,6 +505,8 @@ export function createConnection(deps) {
|
|
|
504
505
|
sidebar.addToWorkdirHistory(msg.agent.workDir);
|
|
505
506
|
const savedDir = localStorage.getItem(`agentlink-workdir-${sessionId.value}`);
|
|
506
507
|
if (savedDir && savedDir !== msg.agent.workDir) {
|
|
508
|
+
workdirSwitching.value = true;
|
|
509
|
+
setTimeout(() => { workdirSwitching.value = false; }, 10000);
|
|
507
510
|
wsSend({ type: 'change_workdir', workDir: savedDir });
|
|
508
511
|
}
|
|
509
512
|
sidebar.requestSessionList();
|
|
@@ -797,6 +800,7 @@ export function createConnection(deps) {
|
|
|
797
800
|
} else if (msg.type === 'file_content') {
|
|
798
801
|
if (filePreview) filePreview.handleFileContent(msg);
|
|
799
802
|
} else if (msg.type === 'workdir_changed') {
|
|
803
|
+
workdirSwitching.value = false;
|
|
800
804
|
workDir.value = msg.workDir;
|
|
801
805
|
localStorage.setItem(`agentlink-workdir-${sessionId.value}`, msg.workDir);
|
|
802
806
|
sidebar.addToWorkdirHistory(msg.workDir);
|
|
@@ -11,9 +11,11 @@ export function createFilePreview(deps) {
|
|
|
11
11
|
previewPanelWidth,
|
|
12
12
|
previewFile,
|
|
13
13
|
previewLoading,
|
|
14
|
+
previewMarkdownRendered,
|
|
14
15
|
sidebarView,
|
|
15
16
|
sidebarOpen,
|
|
16
17
|
isMobile,
|
|
18
|
+
renderMarkdown,
|
|
17
19
|
} = deps;
|
|
18
20
|
|
|
19
21
|
// ── Open / Close ──
|
|
@@ -52,6 +54,7 @@ export function createFilePreview(deps) {
|
|
|
52
54
|
|
|
53
55
|
function handleFileContent(msg) {
|
|
54
56
|
previewLoading.value = false;
|
|
57
|
+
previewMarkdownRendered.value = false;
|
|
55
58
|
previewFile.value = {
|
|
56
59
|
filePath: msg.filePath,
|
|
57
60
|
fileName: msg.fileName,
|
|
@@ -174,6 +177,17 @@ export function createFilePreview(deps) {
|
|
|
174
177
|
localStorage.setItem('agentlink-preview-panel-width', String(previewPanelWidth.value));
|
|
175
178
|
}
|
|
176
179
|
|
|
180
|
+
// ── Markdown preview ──
|
|
181
|
+
|
|
182
|
+
function isMarkdownFile(fileName) {
|
|
183
|
+
const ext = (fileName || '').split('.').pop()?.toLowerCase();
|
|
184
|
+
return ext === 'md' || ext === 'mdx';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function renderedMarkdownHtml(content) {
|
|
188
|
+
return renderMarkdown(content || '');
|
|
189
|
+
}
|
|
190
|
+
|
|
177
191
|
return {
|
|
178
192
|
openPreview,
|
|
179
193
|
closePreview,
|
|
@@ -183,5 +197,7 @@ export function createFilePreview(deps) {
|
|
|
183
197
|
highlightCode,
|
|
184
198
|
formatFileSize,
|
|
185
199
|
onResizeStart,
|
|
200
|
+
isMarkdownFile,
|
|
201
|
+
renderedMarkdownHtml,
|
|
186
202
|
};
|
|
187
203
|
}
|
package/web/modules/sidebar.js
CHANGED
|
@@ -31,12 +31,20 @@ export function createSidebar(deps) {
|
|
|
31
31
|
loadingSessions, loadingHistory, workDir, visibleLimit,
|
|
32
32
|
folderPickerOpen, folderPickerPath, folderPickerEntries,
|
|
33
33
|
folderPickerLoading, folderPickerSelected, streaming,
|
|
34
|
-
hostname, workdirHistory,
|
|
34
|
+
hostname, workdirHistory, workdirSwitching,
|
|
35
35
|
// Multi-session parallel
|
|
36
36
|
currentConversationId, conversationCache, processingConversations,
|
|
37
37
|
switchConversation,
|
|
38
38
|
} = deps;
|
|
39
39
|
|
|
40
|
+
// ── Workdir switching timeout ──
|
|
41
|
+
let _workdirSwitchTimer = null;
|
|
42
|
+
function setWorkdirSwitching() {
|
|
43
|
+
workdirSwitching.value = true;
|
|
44
|
+
clearTimeout(_workdirSwitchTimer);
|
|
45
|
+
_workdirSwitchTimer = setTimeout(() => { workdirSwitching.value = false; }, 10000);
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
// ── Session management ──
|
|
41
49
|
|
|
42
50
|
let _sessionListTimer = null;
|
|
@@ -278,6 +286,7 @@ export function createSidebar(deps) {
|
|
|
278
286
|
path = path.replace(/[/\\]$/, '') + sep + folderPickerSelected.value;
|
|
279
287
|
}
|
|
280
288
|
folderPickerOpen.value = false;
|
|
289
|
+
setWorkdirSwitching();
|
|
281
290
|
wsSend({ type: 'change_workdir', workDir: path });
|
|
282
291
|
}
|
|
283
292
|
|
|
@@ -316,6 +325,7 @@ export function createSidebar(deps) {
|
|
|
316
325
|
}
|
|
317
326
|
|
|
318
327
|
function switchToWorkdir(path) {
|
|
328
|
+
setWorkdirSwitching();
|
|
319
329
|
wsSend({ type: 'change_workdir', workDir: path });
|
|
320
330
|
}
|
|
321
331
|
|
package/web/style.css
CHANGED
|
@@ -1939,6 +1939,42 @@ body {
|
|
|
1939
1939
|
color: var(--text-secondary);
|
|
1940
1940
|
}
|
|
1941
1941
|
|
|
1942
|
+
/* ── Workdir switching overlay ── */
|
|
1943
|
+
.workdir-switching-overlay {
|
|
1944
|
+
position: fixed;
|
|
1945
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
1946
|
+
background: rgba(0, 0, 0, 0.45);
|
|
1947
|
+
z-index: 1100;
|
|
1948
|
+
display: flex;
|
|
1949
|
+
flex-direction: column;
|
|
1950
|
+
align-items: center;
|
|
1951
|
+
justify-content: center;
|
|
1952
|
+
gap: 16px;
|
|
1953
|
+
backdrop-filter: blur(2px);
|
|
1954
|
+
}
|
|
1955
|
+
.workdir-switching-spinner {
|
|
1956
|
+
width: 36px;
|
|
1957
|
+
height: 36px;
|
|
1958
|
+
border: 3px solid rgba(255, 255, 255, 0.2);
|
|
1959
|
+
border-top-color: rgba(255, 255, 255, 0.8);
|
|
1960
|
+
border-radius: 50%;
|
|
1961
|
+
animation: workdir-spin 0.7s linear infinite;
|
|
1962
|
+
}
|
|
1963
|
+
@keyframes workdir-spin {
|
|
1964
|
+
to { transform: rotate(360deg); }
|
|
1965
|
+
}
|
|
1966
|
+
.workdir-switching-text {
|
|
1967
|
+
color: rgba(255, 255, 255, 0.9);
|
|
1968
|
+
font-size: 0.9rem;
|
|
1969
|
+
font-weight: 500;
|
|
1970
|
+
}
|
|
1971
|
+
.fade-enter-active, .fade-leave-active {
|
|
1972
|
+
transition: opacity 0.2s ease;
|
|
1973
|
+
}
|
|
1974
|
+
.fade-enter-from, .fade-leave-to {
|
|
1975
|
+
opacity: 0;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1942
1978
|
/* ── Folder Picker Modal ── */
|
|
1943
1979
|
.folder-picker-overlay {
|
|
1944
1980
|
position: fixed;
|
|
@@ -2618,6 +2654,40 @@ body {
|
|
|
2618
2654
|
color: var(--text);
|
|
2619
2655
|
}
|
|
2620
2656
|
|
|
2657
|
+
.preview-md-toggle {
|
|
2658
|
+
background: none;
|
|
2659
|
+
border: 1px solid var(--border);
|
|
2660
|
+
border-radius: 4px;
|
|
2661
|
+
cursor: pointer;
|
|
2662
|
+
color: var(--text-secondary);
|
|
2663
|
+
padding: 2px 6px;
|
|
2664
|
+
line-height: 1;
|
|
2665
|
+
display: flex;
|
|
2666
|
+
align-items: center;
|
|
2667
|
+
flex-shrink: 0;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
.preview-md-toggle:hover {
|
|
2671
|
+
color: var(--text);
|
|
2672
|
+
border-color: var(--text-secondary);
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
.preview-md-toggle.active {
|
|
2676
|
+
color: var(--accent, #6366f1);
|
|
2677
|
+
border-color: var(--accent, #6366f1);
|
|
2678
|
+
background: color-mix(in srgb, var(--accent, #6366f1) 10%, transparent);
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
.preview-header-actions {
|
|
2682
|
+
display: flex;
|
|
2683
|
+
align-items: center;
|
|
2684
|
+
gap: 0.5rem;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
.preview-markdown-rendered {
|
|
2688
|
+
padding: 1rem;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2621
2691
|
.preview-panel-body {
|
|
2622
2692
|
flex: 1;
|
|
2623
2693
|
overflow: auto;
|