@adminforth/agent 1.18.1 → 1.18.3
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/build.log +2 -2
- package/custom/ConversationArea.vue +24 -12
- package/custom/ToolRenderer.vue +2 -2
- package/custom/ToolsGroup.vue +1 -1
- package/dist/custom/ConversationArea.vue +24 -12
- package/dist/custom/ToolRenderer.vue +2 -2
- package/dist/custom/ToolsGroup.vue +1 -1
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -32,5 +32,5 @@ custom/skills/fetch_data/SKILL.md
|
|
|
32
32
|
custom/skills/mutate_data/
|
|
33
33
|
custom/skills/mutate_data/SKILL.md
|
|
34
34
|
|
|
35
|
-
sent
|
|
36
|
-
total size is
|
|
35
|
+
sent 187,006 bytes received 455 bytes 374,922.00 bytes/sec
|
|
36
|
+
total size is 185,154 speedup is 0.99
|
|
@@ -37,9 +37,8 @@
|
|
|
37
37
|
class="flex flex-col w-full"
|
|
38
38
|
:class="message.role === 'user' ? 'self-end' : 'self-start'"
|
|
39
39
|
>
|
|
40
|
-
<ToolsGroup :toolGroup="groupToolCallParts(message)" />
|
|
41
40
|
<template
|
|
42
|
-
v-for="part in getParts(message)"
|
|
41
|
+
v-for="(part, index) in getParts(message)"
|
|
43
42
|
:key="part.type"
|
|
44
43
|
>
|
|
45
44
|
<Message
|
|
@@ -52,6 +51,7 @@
|
|
|
52
51
|
@toggle-thoughts="() => clicks++"
|
|
53
52
|
>
|
|
54
53
|
</Message>
|
|
54
|
+
<ToolsGroup v-else :toolGroup="groupToolCallParts(message, index, part)" />
|
|
55
55
|
</template>
|
|
56
56
|
</div>
|
|
57
57
|
<!-- Show a placeholder message if the last message is not of type 'text' or 'reasoning' -->
|
|
@@ -154,27 +154,39 @@ const formatToolCallTextPart = ((part: IPart, currentMessage: IMessage) => {
|
|
|
154
154
|
return null;
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
const groupToolCallParts = (message: IMessage) => {
|
|
158
|
-
const groupedParts = [];
|
|
159
|
-
let currentToolName = null;
|
|
157
|
+
const groupToolCallParts = (message: IMessage, currentPartIndex: number, currentPart: IPart) => {
|
|
158
|
+
const groupedParts: { title: string; groupedTools: IPart[] }[] = [];
|
|
159
|
+
let currentToolName: string | null = null;
|
|
160
160
|
const parts = getParts(message);
|
|
161
161
|
if (!parts) return [];
|
|
162
162
|
const formatedToolParts = parts.map(part => {
|
|
163
163
|
return formatToolCallTextPart(part as IPart, message)
|
|
164
164
|
});
|
|
165
|
+
const currentPartIndexInFormatedParts = formatedToolParts.findIndex(part => part?.toolInfo?.toolCallId === currentPart.data?.toolCallId);
|
|
166
|
+
if (currentPartIndexInFormatedParts === -1) {
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
165
169
|
for( const[index, part] of formatedToolParts.entries()){
|
|
166
|
-
if(
|
|
170
|
+
if ( index < currentPartIndexInFormatedParts - 1 ) {
|
|
167
171
|
continue;
|
|
168
172
|
}
|
|
169
|
-
if
|
|
170
|
-
groupedParts[groupedParts.length - 1].groupedTools.push(part);
|
|
173
|
+
if(!part || !part.toolInfo) {
|
|
171
174
|
continue;
|
|
172
175
|
}
|
|
173
176
|
currentToolName = part.toolInfo.toolName;
|
|
174
|
-
groupedParts.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
if (!groupedParts.find(group => group.title === currentToolName)) {
|
|
178
|
+
groupedParts.push({
|
|
179
|
+
title: currentToolName,
|
|
180
|
+
groupedTools: []
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
if( formatedToolParts[currentPartIndexInFormatedParts - 1]?.toolInfo.toolName === part.toolInfo.toolName) {
|
|
184
|
+
continue;
|
|
185
|
+
} else if ( formatedToolParts[currentPartIndexInFormatedParts + 1]?.toolInfo.toolName === part.toolInfo.toolName) {
|
|
186
|
+
groupedParts[groupedParts.length - 1].groupedTools.push(formatedToolParts[currentPartIndexInFormatedParts + 1] as IPart);
|
|
187
|
+
} else {
|
|
188
|
+
groupedParts[groupedParts.length - 1].groupedTools.push(part);
|
|
189
|
+
}
|
|
178
190
|
}
|
|
179
191
|
return groupedParts;
|
|
180
192
|
}
|
package/custom/ToolRenderer.vue
CHANGED
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
:key="section.label"
|
|
32
32
|
class="overflow-hidden rounded-xl border border-black/5 bg-white/70 shadow-sm backdrop-blur-sm dark:border-white/10 dark:bg-slate-900/50"
|
|
33
33
|
>
|
|
34
|
-
<header class="border-b border-black/5 px-3 py-2 text-[
|
|
34
|
+
<header class="border-b border-black/5 px-3 py-2 text-[0.7rem] font-semibold uppercase tracking-[0.22em] text-gray-500 dark:border-white/10 dark:text-gray-400">
|
|
35
35
|
{{ section.label }}
|
|
36
36
|
</header>
|
|
37
37
|
<div class="grid grid-cols-[auto,1fr] gap-x-3 gap-y-1 px-3 py-3 font-mono text-xs leading-5 text-gray-700 dark:text-gray-200">
|
|
38
38
|
<template v-for="line in section.lines" :key="`${section.label}-${line.number}`">
|
|
39
|
-
<span class="select-none text-[
|
|
39
|
+
<span class="select-none text-[0.7rem] text-gray-400 dark:text-gray-500">{{ line.number }}</span>
|
|
40
40
|
<span class="whitespace-pre-wrap break-words">{{ line.content || ' ' }}</span>
|
|
41
41
|
</template>
|
|
42
42
|
</div>
|
package/custom/ToolsGroup.vue
CHANGED
|
@@ -37,9 +37,8 @@
|
|
|
37
37
|
class="flex flex-col w-full"
|
|
38
38
|
:class="message.role === 'user' ? 'self-end' : 'self-start'"
|
|
39
39
|
>
|
|
40
|
-
<ToolsGroup :toolGroup="groupToolCallParts(message)" />
|
|
41
40
|
<template
|
|
42
|
-
v-for="part in getParts(message)"
|
|
41
|
+
v-for="(part, index) in getParts(message)"
|
|
43
42
|
:key="part.type"
|
|
44
43
|
>
|
|
45
44
|
<Message
|
|
@@ -52,6 +51,7 @@
|
|
|
52
51
|
@toggle-thoughts="() => clicks++"
|
|
53
52
|
>
|
|
54
53
|
</Message>
|
|
54
|
+
<ToolsGroup v-else :toolGroup="groupToolCallParts(message, index, part)" />
|
|
55
55
|
</template>
|
|
56
56
|
</div>
|
|
57
57
|
<!-- Show a placeholder message if the last message is not of type 'text' or 'reasoning' -->
|
|
@@ -154,27 +154,39 @@ const formatToolCallTextPart = ((part: IPart, currentMessage: IMessage) => {
|
|
|
154
154
|
return null;
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
const groupToolCallParts = (message: IMessage) => {
|
|
158
|
-
const groupedParts = [];
|
|
159
|
-
let currentToolName = null;
|
|
157
|
+
const groupToolCallParts = (message: IMessage, currentPartIndex: number, currentPart: IPart) => {
|
|
158
|
+
const groupedParts: { title: string; groupedTools: IPart[] }[] = [];
|
|
159
|
+
let currentToolName: string | null = null;
|
|
160
160
|
const parts = getParts(message);
|
|
161
161
|
if (!parts) return [];
|
|
162
162
|
const formatedToolParts = parts.map(part => {
|
|
163
163
|
return formatToolCallTextPart(part as IPart, message)
|
|
164
164
|
});
|
|
165
|
+
const currentPartIndexInFormatedParts = formatedToolParts.findIndex(part => part?.toolInfo?.toolCallId === currentPart.data?.toolCallId);
|
|
166
|
+
if (currentPartIndexInFormatedParts === -1) {
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
165
169
|
for( const[index, part] of formatedToolParts.entries()){
|
|
166
|
-
if(
|
|
170
|
+
if ( index < currentPartIndexInFormatedParts - 1 ) {
|
|
167
171
|
continue;
|
|
168
172
|
}
|
|
169
|
-
if
|
|
170
|
-
groupedParts[groupedParts.length - 1].groupedTools.push(part);
|
|
173
|
+
if(!part || !part.toolInfo) {
|
|
171
174
|
continue;
|
|
172
175
|
}
|
|
173
176
|
currentToolName = part.toolInfo.toolName;
|
|
174
|
-
groupedParts.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
if (!groupedParts.find(group => group.title === currentToolName)) {
|
|
178
|
+
groupedParts.push({
|
|
179
|
+
title: currentToolName,
|
|
180
|
+
groupedTools: []
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
if( formatedToolParts[currentPartIndexInFormatedParts - 1]?.toolInfo.toolName === part.toolInfo.toolName) {
|
|
184
|
+
continue;
|
|
185
|
+
} else if ( formatedToolParts[currentPartIndexInFormatedParts + 1]?.toolInfo.toolName === part.toolInfo.toolName) {
|
|
186
|
+
groupedParts[groupedParts.length - 1].groupedTools.push(formatedToolParts[currentPartIndexInFormatedParts + 1] as IPart);
|
|
187
|
+
} else {
|
|
188
|
+
groupedParts[groupedParts.length - 1].groupedTools.push(part);
|
|
189
|
+
}
|
|
178
190
|
}
|
|
179
191
|
return groupedParts;
|
|
180
192
|
}
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
:key="section.label"
|
|
32
32
|
class="overflow-hidden rounded-xl border border-black/5 bg-white/70 shadow-sm backdrop-blur-sm dark:border-white/10 dark:bg-slate-900/50"
|
|
33
33
|
>
|
|
34
|
-
<header class="border-b border-black/5 px-3 py-2 text-[
|
|
34
|
+
<header class="border-b border-black/5 px-3 py-2 text-[0.7rem] font-semibold uppercase tracking-[0.22em] text-gray-500 dark:border-white/10 dark:text-gray-400">
|
|
35
35
|
{{ section.label }}
|
|
36
36
|
</header>
|
|
37
37
|
<div class="grid grid-cols-[auto,1fr] gap-x-3 gap-y-1 px-3 py-3 font-mono text-xs leading-5 text-gray-700 dark:text-gray-200">
|
|
38
38
|
<template v-for="line in section.lines" :key="`${section.label}-${line.number}`">
|
|
39
|
-
<span class="select-none text-[
|
|
39
|
+
<span class="select-none text-[0.7rem] text-gray-400 dark:text-gray-500">{{ line.number }}</span>
|
|
40
40
|
<span class="whitespace-pre-wrap break-words">{{ line.content || ' ' }}</span>
|
|
41
41
|
</template>
|
|
42
42
|
</div>
|