@agent-link/server 0.1.19 → 0.1.20
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 +21 -4
- package/web/style.css +24 -0
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -112,6 +112,15 @@ const App = {
|
|
|
112
112
|
const sessionId = ref('');
|
|
113
113
|
const error = ref('');
|
|
114
114
|
const messages = ref([]);
|
|
115
|
+
const visibleLimit = ref(50);
|
|
116
|
+
const hasMoreMessages = computed(() => messages.value.length > visibleLimit.value);
|
|
117
|
+
const visibleMessages = computed(() => {
|
|
118
|
+
if (messages.value.length <= visibleLimit.value) return messages.value;
|
|
119
|
+
return messages.value.slice(messages.value.length - visibleLimit.value);
|
|
120
|
+
});
|
|
121
|
+
function loadMoreMessages() {
|
|
122
|
+
visibleLimit.value += 50;
|
|
123
|
+
}
|
|
115
124
|
const inputText = ref('');
|
|
116
125
|
const isProcessing = ref(false);
|
|
117
126
|
const isCompacting = ref(false);
|
|
@@ -436,8 +445,8 @@ const App = {
|
|
|
436
445
|
// ── Check if previous message is also assistant (to suppress repeated label) ──
|
|
437
446
|
function isPrevAssistant(idx) {
|
|
438
447
|
if (idx <= 0) return false;
|
|
439
|
-
const prev =
|
|
440
|
-
return prev.role === 'assistant' || prev.role === 'tool';
|
|
448
|
+
const prev = visibleMessages.value[idx - 1];
|
|
449
|
+
return prev && (prev.role === 'assistant' || prev.role === 'tool');
|
|
441
450
|
}
|
|
442
451
|
|
|
443
452
|
// ── Context summary toggle ──
|
|
@@ -676,6 +685,7 @@ const App = {
|
|
|
676
685
|
if (window.innerWidth <= 768) sidebarOpen.value = false;
|
|
677
686
|
// Clear current conversation
|
|
678
687
|
messages.value = [];
|
|
688
|
+
visibleLimit.value = 50;
|
|
679
689
|
messageIdCounter = 0;
|
|
680
690
|
streamingMessageId = null;
|
|
681
691
|
pendingText = '';
|
|
@@ -697,6 +707,7 @@ const App = {
|
|
|
697
707
|
// Auto-close sidebar on mobile
|
|
698
708
|
if (window.innerWidth <= 768) sidebarOpen.value = false;
|
|
699
709
|
messages.value = [];
|
|
710
|
+
visibleLimit.value = 50;
|
|
700
711
|
messageIdCounter = 0;
|
|
701
712
|
streamingMessageId = null;
|
|
702
713
|
pendingText = '';
|
|
@@ -985,6 +996,7 @@ const App = {
|
|
|
985
996
|
} else if (msg.type === 'workdir_changed') {
|
|
986
997
|
workDir.value = msg.workDir;
|
|
987
998
|
messages.value = [];
|
|
999
|
+
visibleLimit.value = 50;
|
|
988
1000
|
messageIdCounter = 0;
|
|
989
1001
|
streamingMessageId = null;
|
|
990
1002
|
pendingText = '';
|
|
@@ -1078,7 +1090,8 @@ const App = {
|
|
|
1078
1090
|
|
|
1079
1091
|
return {
|
|
1080
1092
|
status, agentName, hostname, workDir, sessionId, error,
|
|
1081
|
-
messages,
|
|
1093
|
+
messages, visibleMessages, hasMoreMessages, loadMoreMessages,
|
|
1094
|
+
inputText, isProcessing, isCompacting, canSend, inputRef,
|
|
1082
1095
|
sendMessage, handleKeydown, cancelExecution,
|
|
1083
1096
|
getRenderedContent, copyMessage, toggleTool, isPrevAssistant, toggleContextSummary,
|
|
1084
1097
|
getToolIcon, getToolSummary, isEditTool, getEditDiffHtml, getFormattedToolInput, autoResize,
|
|
@@ -1208,7 +1221,11 @@ const App = {
|
|
|
1208
1221
|
<span>Loading conversation history...</span>
|
|
1209
1222
|
</div>
|
|
1210
1223
|
|
|
1211
|
-
<div v-
|
|
1224
|
+
<div v-if="hasMoreMessages" class="load-more-wrapper">
|
|
1225
|
+
<button class="load-more-btn" @click="loadMoreMessages">Load earlier messages</button>
|
|
1226
|
+
</div>
|
|
1227
|
+
|
|
1228
|
+
<div v-for="(msg, msgIdx) in visibleMessages" :key="msg.id" :class="['message', 'message-' + msg.role]">
|
|
1212
1229
|
|
|
1213
1230
|
<!-- User message -->
|
|
1214
1231
|
<template v-if="msg.role === 'user'">
|
package/web/style.css
CHANGED
|
@@ -1171,6 +1171,30 @@ body {
|
|
|
1171
1171
|
animation: spin 0.8s linear infinite;
|
|
1172
1172
|
}
|
|
1173
1173
|
|
|
1174
|
+
/* ── Load more button ── */
|
|
1175
|
+
.load-more-wrapper {
|
|
1176
|
+
display: flex;
|
|
1177
|
+
justify-content: center;
|
|
1178
|
+
padding: 0.75rem 0;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
.load-more-btn {
|
|
1182
|
+
background: var(--bg-tertiary);
|
|
1183
|
+
color: var(--text-secondary);
|
|
1184
|
+
border: 1px solid var(--border);
|
|
1185
|
+
border-radius: 6px;
|
|
1186
|
+
padding: 0.4rem 1.2rem;
|
|
1187
|
+
font-size: 0.8rem;
|
|
1188
|
+
cursor: pointer;
|
|
1189
|
+
transition: background 0.15s, color 0.15s;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
.load-more-btn:hover {
|
|
1193
|
+
background: var(--accent);
|
|
1194
|
+
color: #fff;
|
|
1195
|
+
border-color: var(--accent);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1174
1198
|
/* ── Typing indicator ── */
|
|
1175
1199
|
.typing-indicator {
|
|
1176
1200
|
display: flex;
|