@adminforth/agent 1.24.12 → 1.24.14
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/systemPrompt.ts +1 -1
- package/build.log +4 -4
- package/custom/ChatSurface.vue +1 -0
- package/custom/CustomAutoScrollContainer.vue +14 -3
- package/custom/conversation_area/ConversationArea.vue +11 -6
- package/custom/skills/{data-analytics → analyze_data}/SKILL.md +1 -1
- package/dist/agent/systemPrompt.js +1 -1
- package/dist/custom/ChatSurface.vue +1 -0
- package/dist/custom/CustomAutoScrollContainer.vue +14 -3
- package/dist/custom/conversation_area/ConversationArea.vue +11 -6
- package/dist/custom/skills/{data-analytics → analyze_data}/SKILL.md +1 -1
- package/package.json +1 -1
package/agent/systemPrompt.ts
CHANGED
|
@@ -83,7 +83,7 @@ export async function buildAgentSystemPrompt(adminforth: IAdminForth) {
|
|
|
83
83
|
"The fetched skill response starts with 'Tools mentioned in this skill'. Read that list first.",
|
|
84
84
|
"You can use get_resource immediately to inspect resource structure and column names.",
|
|
85
85
|
"If the user wants to create, update, delete, or run actions on records, load mutate_data first.",
|
|
86
|
-
"If the user wants to fetch records, load fetch_data first. If the user wants analytics or charts, load
|
|
86
|
+
"If the user wants to fetch records, load fetch_data first. If the user wants analytics or charts, load analyze_data first.",
|
|
87
87
|
"Only call fetch_tool_schema for tool names that are explicitly mentioned in a fetched skill and are not already available as base tools.",
|
|
88
88
|
"If a fetched skill lists a non-base tool you need, call fetch_tool_schema for it immediately instead of telling the user the tool is unavailable.",
|
|
89
89
|
"For example: for record creation load mutate_data, read its tool list, call fetch_tool_schema for create_record, and then use create_record after confirmation.",
|
package/build.log
CHANGED
|
@@ -31,12 +31,12 @@ custom/incremark_code_renderers/incremarkCodeHighlight.ts
|
|
|
31
31
|
custom/incremark_code_renderers/incremarkRenderer.ts
|
|
32
32
|
custom/incremark_code_renderers/renderIncremarkMarkdown.ts
|
|
33
33
|
custom/skills/
|
|
34
|
-
custom/skills/
|
|
35
|
-
custom/skills/
|
|
34
|
+
custom/skills/analyze_data/
|
|
35
|
+
custom/skills/analyze_data/SKILL.md
|
|
36
36
|
custom/skills/fetch_data/
|
|
37
37
|
custom/skills/fetch_data/SKILL.md
|
|
38
38
|
custom/skills/mutate_data/
|
|
39
39
|
custom/skills/mutate_data/SKILL.md
|
|
40
40
|
|
|
41
|
-
sent
|
|
42
|
-
total size is 199,
|
|
41
|
+
sent 202,033 bytes received 566 bytes 405,198.00 bytes/sec
|
|
42
|
+
total size is 199,749 speedup is 0.99
|
package/custom/ChatSurface.vue
CHANGED
|
@@ -11,12 +11,16 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script setup lang="ts">
|
|
14
|
-
import { ref, onMounted, onUnmounted, nextTick,
|
|
14
|
+
import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'
|
|
15
15
|
import CustomScrollbar from 'custom-vue-scrollbar';
|
|
16
16
|
import 'custom-vue-scrollbar/dist/style.css';
|
|
17
17
|
import { useAgentStore } from './composables/useAgentStore';
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const scrollParams = ref({
|
|
20
|
+
scrollTop: 0,
|
|
21
|
+
scrollHeight: 0,
|
|
22
|
+
clientHeight: 0
|
|
23
|
+
});
|
|
20
24
|
|
|
21
25
|
const props = withDefaults(defineProps<{
|
|
22
26
|
enabled?: boolean
|
|
@@ -42,6 +46,9 @@ function isNearBottom(): boolean {
|
|
|
42
46
|
if (!container) return true
|
|
43
47
|
|
|
44
48
|
const { scrollTop, scrollHeight, clientHeight } = container
|
|
49
|
+
scrollParams.value.scrollTop = scrollTop
|
|
50
|
+
scrollParams.value.scrollHeight = scrollHeight
|
|
51
|
+
scrollParams.value.clientHeight = clientHeight
|
|
45
52
|
return scrollHeight - scrollTop - clientHeight <= props.threshold
|
|
46
53
|
}
|
|
47
54
|
|
|
@@ -107,6 +114,9 @@ onMounted(() => {
|
|
|
107
114
|
}
|
|
108
115
|
|
|
109
116
|
lastScrollHeight = containerRef.value.scrollEl.scrollHeight
|
|
117
|
+
scrollParams.value.scrollTop = containerRef.value.scrollEl.scrollTop
|
|
118
|
+
scrollParams.value.scrollHeight = containerRef.value.scrollEl.scrollHeight
|
|
119
|
+
scrollParams.value.clientHeight = containerRef.value.scrollEl.clientHeight
|
|
110
120
|
if (props.enabled && !isUserScrolledUp.value) {
|
|
111
121
|
scrollToBottom()
|
|
112
122
|
}
|
|
@@ -128,7 +138,8 @@ defineExpose({
|
|
|
128
138
|
scrollToBottom: () => scrollToBottom(true),
|
|
129
139
|
isUserScrolledUp: () => isUserScrolledUp.value,
|
|
130
140
|
container: containerRef,
|
|
131
|
-
handleScroll
|
|
141
|
+
handleScroll,
|
|
142
|
+
scrollParams
|
|
132
143
|
})
|
|
133
144
|
</script>
|
|
134
145
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
class="absolute bg-black/10 backdrop-blur-md z-10 h-full w-full"
|
|
9
9
|
>
|
|
10
10
|
</div>
|
|
11
|
-
<div class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
|
|
11
|
+
<div ref="chatContainerRef" class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
|
|
12
12
|
<CustomAutoScrollContainer
|
|
13
13
|
v-if="showScrollContainer"
|
|
14
14
|
:enabled="!showScrollToBottomButton"
|
|
@@ -24,10 +24,6 @@
|
|
|
24
24
|
marginLeft: 'auto',
|
|
25
25
|
marginRight: 'auto',
|
|
26
26
|
}"
|
|
27
|
-
:contentStyle="{
|
|
28
|
-
height: '100%',
|
|
29
|
-
maxHeight: '100%',
|
|
30
|
-
}"
|
|
31
27
|
:style="{
|
|
32
28
|
maxWidth: agentStore.isFullScreen ? agentStore.MAX_WIDTH+'rem' : '100%',
|
|
33
29
|
transition: `
|
|
@@ -46,11 +42,15 @@
|
|
|
46
42
|
</div>
|
|
47
43
|
<div
|
|
48
44
|
v-if="props.messages.length === 0"
|
|
49
|
-
class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-
|
|
45
|
+
class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-max"
|
|
46
|
+
:style="{
|
|
47
|
+
height: chatContainerRef ? chatContainerRef.clientHeight + 'px' : '100%',
|
|
48
|
+
}"
|
|
50
49
|
>
|
|
51
50
|
<p>{{ $t('Start the conversation') }}</p>
|
|
52
51
|
<p class="tracking-normal text-base text">{{ $t('Give any input to begin') }}</p>
|
|
53
52
|
</div>
|
|
53
|
+
<div></div>
|
|
54
54
|
</CustomAutoScrollContainer>
|
|
55
55
|
<button @click="scrollContainer.scrollToBottom();">
|
|
56
56
|
<IconArrowDownOutline
|
|
@@ -83,6 +83,11 @@ const innerScrollContainerRef = ref(null);
|
|
|
83
83
|
const agentStore = useAgentStore();
|
|
84
84
|
const agentTransitions = useAgentTransitions();
|
|
85
85
|
const showScrollContainer = ref(true);
|
|
86
|
+
const chatContainerRef = ref(null);
|
|
87
|
+
|
|
88
|
+
const scrollHeight = computed(() => {
|
|
89
|
+
return scrollContainer.value ? scrollContainer.value.scrollParams.scrollHeight : 0;
|
|
90
|
+
});
|
|
86
91
|
|
|
87
92
|
function recalculateScroll() {
|
|
88
93
|
if (scrollContainer.value) {
|
|
@@ -74,7 +74,7 @@ export function buildAgentSystemPrompt(adminforth) {
|
|
|
74
74
|
"The fetched skill response starts with 'Tools mentioned in this skill'. Read that list first.",
|
|
75
75
|
"You can use get_resource immediately to inspect resource structure and column names.",
|
|
76
76
|
"If the user wants to create, update, delete, or run actions on records, load mutate_data first.",
|
|
77
|
-
"If the user wants to fetch records, load fetch_data first. If the user wants analytics or charts, load
|
|
77
|
+
"If the user wants to fetch records, load fetch_data first. If the user wants analytics or charts, load analyze_data first.",
|
|
78
78
|
"Only call fetch_tool_schema for tool names that are explicitly mentioned in a fetched skill and are not already available as base tools.",
|
|
79
79
|
"If a fetched skill lists a non-base tool you need, call fetch_tool_schema for it immediately instead of telling the user the tool is unavailable.",
|
|
80
80
|
"For example: for record creation load mutate_data, read its tool list, call fetch_tool_schema for create_record, and then use create_record after confirmation.",
|
|
@@ -11,12 +11,16 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script setup lang="ts">
|
|
14
|
-
import { ref, onMounted, onUnmounted, nextTick,
|
|
14
|
+
import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'
|
|
15
15
|
import CustomScrollbar from 'custom-vue-scrollbar';
|
|
16
16
|
import 'custom-vue-scrollbar/dist/style.css';
|
|
17
17
|
import { useAgentStore } from './composables/useAgentStore';
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const scrollParams = ref({
|
|
20
|
+
scrollTop: 0,
|
|
21
|
+
scrollHeight: 0,
|
|
22
|
+
clientHeight: 0
|
|
23
|
+
});
|
|
20
24
|
|
|
21
25
|
const props = withDefaults(defineProps<{
|
|
22
26
|
enabled?: boolean
|
|
@@ -42,6 +46,9 @@ function isNearBottom(): boolean {
|
|
|
42
46
|
if (!container) return true
|
|
43
47
|
|
|
44
48
|
const { scrollTop, scrollHeight, clientHeight } = container
|
|
49
|
+
scrollParams.value.scrollTop = scrollTop
|
|
50
|
+
scrollParams.value.scrollHeight = scrollHeight
|
|
51
|
+
scrollParams.value.clientHeight = clientHeight
|
|
45
52
|
return scrollHeight - scrollTop - clientHeight <= props.threshold
|
|
46
53
|
}
|
|
47
54
|
|
|
@@ -107,6 +114,9 @@ onMounted(() => {
|
|
|
107
114
|
}
|
|
108
115
|
|
|
109
116
|
lastScrollHeight = containerRef.value.scrollEl.scrollHeight
|
|
117
|
+
scrollParams.value.scrollTop = containerRef.value.scrollEl.scrollTop
|
|
118
|
+
scrollParams.value.scrollHeight = containerRef.value.scrollEl.scrollHeight
|
|
119
|
+
scrollParams.value.clientHeight = containerRef.value.scrollEl.clientHeight
|
|
110
120
|
if (props.enabled && !isUserScrolledUp.value) {
|
|
111
121
|
scrollToBottom()
|
|
112
122
|
}
|
|
@@ -128,7 +138,8 @@ defineExpose({
|
|
|
128
138
|
scrollToBottom: () => scrollToBottom(true),
|
|
129
139
|
isUserScrolledUp: () => isUserScrolledUp.value,
|
|
130
140
|
container: containerRef,
|
|
131
|
-
handleScroll
|
|
141
|
+
handleScroll,
|
|
142
|
+
scrollParams
|
|
132
143
|
})
|
|
133
144
|
</script>
|
|
134
145
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
class="absolute bg-black/10 backdrop-blur-md z-10 h-full w-full"
|
|
9
9
|
>
|
|
10
10
|
</div>
|
|
11
|
-
<div class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
|
|
11
|
+
<div ref="chatContainerRef" class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
|
|
12
12
|
<CustomAutoScrollContainer
|
|
13
13
|
v-if="showScrollContainer"
|
|
14
14
|
:enabled="!showScrollToBottomButton"
|
|
@@ -24,10 +24,6 @@
|
|
|
24
24
|
marginLeft: 'auto',
|
|
25
25
|
marginRight: 'auto',
|
|
26
26
|
}"
|
|
27
|
-
:contentStyle="{
|
|
28
|
-
height: '100%',
|
|
29
|
-
maxHeight: '100%',
|
|
30
|
-
}"
|
|
31
27
|
:style="{
|
|
32
28
|
maxWidth: agentStore.isFullScreen ? agentStore.MAX_WIDTH+'rem' : '100%',
|
|
33
29
|
transition: `
|
|
@@ -46,11 +42,15 @@
|
|
|
46
42
|
</div>
|
|
47
43
|
<div
|
|
48
44
|
v-if="props.messages.length === 0"
|
|
49
|
-
class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-
|
|
45
|
+
class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-max"
|
|
46
|
+
:style="{
|
|
47
|
+
height: chatContainerRef ? chatContainerRef.clientHeight + 'px' : '100%',
|
|
48
|
+
}"
|
|
50
49
|
>
|
|
51
50
|
<p>{{ $t('Start the conversation') }}</p>
|
|
52
51
|
<p class="tracking-normal text-base text">{{ $t('Give any input to begin') }}</p>
|
|
53
52
|
</div>
|
|
53
|
+
<div></div>
|
|
54
54
|
</CustomAutoScrollContainer>
|
|
55
55
|
<button @click="scrollContainer.scrollToBottom();">
|
|
56
56
|
<IconArrowDownOutline
|
|
@@ -83,6 +83,11 @@ const innerScrollContainerRef = ref(null);
|
|
|
83
83
|
const agentStore = useAgentStore();
|
|
84
84
|
const agentTransitions = useAgentTransitions();
|
|
85
85
|
const showScrollContainer = ref(true);
|
|
86
|
+
const chatContainerRef = ref(null);
|
|
87
|
+
|
|
88
|
+
const scrollHeight = computed(() => {
|
|
89
|
+
return scrollContainer.value ? scrollContainer.value.scrollParams.scrollHeight : 0;
|
|
90
|
+
});
|
|
86
91
|
|
|
87
92
|
function recalculateScroll() {
|
|
88
93
|
if (scrollContainer.value) {
|