@adminforth/agent 1.13.0 → 1.14.1
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/agent/toolCallEvents.ts +20 -2
- package/build.log +2 -2
- package/custom/Message.vue +6 -1
- package/dist/agent/toolCallEvents.js +15 -2
- package/dist/custom/Message.vue +6 -1
- package/package.json +1 -1
package/agent/toolCallEvents.ts
CHANGED
|
@@ -26,19 +26,37 @@ const TOOL_MESSAGE_DEBUG_KEYS = new Set([
|
|
|
26
26
|
"response_metadata",
|
|
27
27
|
]);
|
|
28
28
|
|
|
29
|
+
function getToolCallDebugPayload(outputRecord: Record<string, unknown>) {
|
|
30
|
+
const lcKwargs =
|
|
31
|
+
typeof outputRecord.lc_kwargs === "object" && outputRecord.lc_kwargs !== null
|
|
32
|
+
? outputRecord.lc_kwargs as Record<string, unknown>
|
|
33
|
+
: null;
|
|
34
|
+
|
|
35
|
+
if (lcKwargs && "tool_call_id" in lcKwargs) {
|
|
36
|
+
return lcKwargs;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if ("tool_call_id" in outputRecord) {
|
|
40
|
+
return outputRecord;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
29
46
|
function sanitizeToolCallOutputForDebug(output: unknown) {
|
|
30
47
|
if (typeof output !== "object" || output === null) {
|
|
31
48
|
return output;
|
|
32
49
|
}
|
|
33
50
|
|
|
34
51
|
const outputRecord = output as Record<string, unknown>;
|
|
52
|
+
const debugPayload = getToolCallDebugPayload(outputRecord);
|
|
35
53
|
|
|
36
|
-
if (!
|
|
54
|
+
if (!debugPayload) {
|
|
37
55
|
return output;
|
|
38
56
|
}
|
|
39
57
|
|
|
40
58
|
return Object.fromEntries(
|
|
41
|
-
Object.entries(
|
|
59
|
+
Object.entries(debugPayload).filter(([key]) => !TOOL_MESSAGE_DEBUG_KEYS.has(key)),
|
|
42
60
|
);
|
|
43
61
|
}
|
|
44
62
|
|
package/build.log
CHANGED
|
@@ -31,5 +31,5 @@ custom/skills/fetch_data/SKILL.md
|
|
|
31
31
|
custom/skills/mutate_data/
|
|
32
32
|
custom/skills/mutate_data/SKILL.md
|
|
33
33
|
|
|
34
|
-
sent 180,
|
|
35
|
-
total size is 178,
|
|
34
|
+
sent 180,483 bytes received 436 bytes 361,838.00 bytes/sec
|
|
35
|
+
total size is 178,690 speedup is 0.99
|
package/custom/Message.vue
CHANGED
|
@@ -57,10 +57,12 @@
|
|
|
57
57
|
import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue';
|
|
58
58
|
import { useRouter } from 'vue-router';
|
|
59
59
|
import { IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
|
|
60
|
-
|
|
60
|
+
import { useAgentStore } from './composables/useAgentStore';
|
|
61
61
|
const IncremarkContent = defineAsyncComponent(() => import('@incremark/vue').then(module => module.IncremarkContent))
|
|
62
62
|
const ShikiCodeBlock = defineAsyncComponent(() => import('./incremark_code_renderers/IncremarkShikiCodeBlock.vue'))
|
|
63
63
|
|
|
64
|
+
const agentStore = useAgentStore();
|
|
65
|
+
|
|
64
66
|
const incremarkComponents = {
|
|
65
67
|
code: ShikiCodeBlock,
|
|
66
68
|
};
|
|
@@ -132,6 +134,9 @@
|
|
|
132
134
|
|
|
133
135
|
const internalRoute = resolveInternalRoute(href);
|
|
134
136
|
if (internalRoute !== null) {
|
|
137
|
+
if (agentStore.isFullScreen) {
|
|
138
|
+
agentStore.setFullScreen(false);
|
|
139
|
+
}
|
|
135
140
|
void router.push(internalRoute);
|
|
136
141
|
return;
|
|
137
142
|
}
|
|
@@ -6,15 +6,28 @@ const TOOL_MESSAGE_DEBUG_KEYS = new Set([
|
|
|
6
6
|
"additional_kwargs",
|
|
7
7
|
"response_metadata",
|
|
8
8
|
]);
|
|
9
|
+
function getToolCallDebugPayload(outputRecord) {
|
|
10
|
+
const lcKwargs = typeof outputRecord.lc_kwargs === "object" && outputRecord.lc_kwargs !== null
|
|
11
|
+
? outputRecord.lc_kwargs
|
|
12
|
+
: null;
|
|
13
|
+
if (lcKwargs && "tool_call_id" in lcKwargs) {
|
|
14
|
+
return lcKwargs;
|
|
15
|
+
}
|
|
16
|
+
if ("tool_call_id" in outputRecord) {
|
|
17
|
+
return outputRecord;
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
9
21
|
function sanitizeToolCallOutputForDebug(output) {
|
|
10
22
|
if (typeof output !== "object" || output === null) {
|
|
11
23
|
return output;
|
|
12
24
|
}
|
|
13
25
|
const outputRecord = output;
|
|
14
|
-
|
|
26
|
+
const debugPayload = getToolCallDebugPayload(outputRecord);
|
|
27
|
+
if (!debugPayload) {
|
|
15
28
|
return output;
|
|
16
29
|
}
|
|
17
|
-
return Object.fromEntries(Object.entries(
|
|
30
|
+
return Object.fromEntries(Object.entries(debugPayload).filter(([key]) => !TOOL_MESSAGE_DEBUG_KEYS.has(key)));
|
|
18
31
|
}
|
|
19
32
|
export function createToolCallTracker(params) {
|
|
20
33
|
var _a, _b;
|
package/dist/custom/Message.vue
CHANGED
|
@@ -57,10 +57,12 @@
|
|
|
57
57
|
import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue';
|
|
58
58
|
import { useRouter } from 'vue-router';
|
|
59
59
|
import { IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
|
|
60
|
-
|
|
60
|
+
import { useAgentStore } from './composables/useAgentStore';
|
|
61
61
|
const IncremarkContent = defineAsyncComponent(() => import('@incremark/vue').then(module => module.IncremarkContent))
|
|
62
62
|
const ShikiCodeBlock = defineAsyncComponent(() => import('./incremark_code_renderers/IncremarkShikiCodeBlock.vue'))
|
|
63
63
|
|
|
64
|
+
const agentStore = useAgentStore();
|
|
65
|
+
|
|
64
66
|
const incremarkComponents = {
|
|
65
67
|
code: ShikiCodeBlock,
|
|
66
68
|
};
|
|
@@ -132,6 +134,9 @@
|
|
|
132
134
|
|
|
133
135
|
const internalRoute = resolveInternalRoute(href);
|
|
134
136
|
if (internalRoute !== null) {
|
|
137
|
+
if (agentStore.isFullScreen) {
|
|
138
|
+
agentStore.setFullScreen(false);
|
|
139
|
+
}
|
|
135
140
|
void router.push(internalRoute);
|
|
136
141
|
return;
|
|
137
142
|
}
|