@agent-link/server 0.1.14 → 0.1.16
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 +29 -2
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -920,7 +920,8 @@ const App = {
|
|
|
920
920
|
} else {
|
|
921
921
|
messages.value.push({
|
|
922
922
|
id: ++messageIdCounter, role: 'user',
|
|
923
|
-
content: h.content,
|
|
923
|
+
content: h.content, isCommandOutput: !!h.isCommandOutput,
|
|
924
|
+
timestamp: h.timestamp ? new Date(h.timestamp) : new Date(),
|
|
924
925
|
});
|
|
925
926
|
}
|
|
926
927
|
} else if (h.role === 'assistant') {
|
|
@@ -1033,6 +1034,31 @@ const App = {
|
|
|
1033
1034
|
scrollToBottom();
|
|
1034
1035
|
return;
|
|
1035
1036
|
}
|
|
1037
|
+
|
|
1038
|
+
// Command output (e.g. /cost, /context) — user message with content containing stdout/stderr tags
|
|
1039
|
+
if (data.type === 'user' && data.message && data.message.content) {
|
|
1040
|
+
const raw = typeof data.message.content === 'string'
|
|
1041
|
+
? data.message.content
|
|
1042
|
+
: Array.isArray(data.message.content)
|
|
1043
|
+
? data.message.content.filter(b => b.type === 'text').map(b => b.text || '').join('')
|
|
1044
|
+
: '';
|
|
1045
|
+
if (raw.trim()) {
|
|
1046
|
+
const stdoutMatch = raw.match(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/);
|
|
1047
|
+
const stderrMatch = raw.match(/<local-command-stderr>([\s\S]*?)<\/local-command-stderr>/);
|
|
1048
|
+
const cmdOutput = (stdoutMatch && stdoutMatch[1].trim()) || (stderrMatch && stderrMatch[1].trim());
|
|
1049
|
+
if (cmdOutput) {
|
|
1050
|
+
flushReveal();
|
|
1051
|
+
finalizeStreamingMsg();
|
|
1052
|
+
messages.value.push({
|
|
1053
|
+
id: ++messageIdCounter, role: 'user',
|
|
1054
|
+
content: cmdOutput, isCommandOutput: true,
|
|
1055
|
+
timestamp: new Date(),
|
|
1056
|
+
});
|
|
1057
|
+
scrollToBottom();
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1036
1062
|
}
|
|
1037
1063
|
|
|
1038
1064
|
// Apply syntax highlighting after DOM updates
|
|
@@ -1188,7 +1214,8 @@ const App = {
|
|
|
1188
1214
|
<template v-if="msg.role === 'user'">
|
|
1189
1215
|
<div class="message-role-label user-label">You</div>
|
|
1190
1216
|
<div class="message-bubble user-bubble">
|
|
1191
|
-
<div class="message-content"
|
|
1217
|
+
<div v-if="msg.isCommandOutput" class="message-content markdown-body" v-html="getRenderedContent(msg)"></div>
|
|
1218
|
+
<div v-else class="message-content">{{ msg.content }}</div>
|
|
1192
1219
|
<div v-if="msg.attachments && msg.attachments.length" class="message-attachments">
|
|
1193
1220
|
<div v-for="(att, ai) in msg.attachments" :key="ai" class="message-attachment-chip">
|
|
1194
1221
|
<img v-if="att.isImage && att.thumbUrl" :src="att.thumbUrl" class="message-attachment-thumb" />
|