@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.
@@ -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 data-analytics first.",
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/data-analytics/
35
- custom/skills/data-analytics/SKILL.md
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 201,341 bytes received 562 bytes 403,806.00 bytes/sec
42
- total size is 199,037 speedup is 0.99
41
+ sent 202,033 bytes received 566 bytes 405,198.00 bytes/sec
42
+ total size is 199,749 speedup is 0.99
@@ -254,6 +254,7 @@ onMounted(async () => {
254
254
  agentStore.setIsTeleportedToBody(isTeleportedToBodyFromLocalStorage || props.meta.stickByDefault);
255
255
  }
256
256
  await agentStore.fetchSessionsList();
257
+ agentStore.setFullScreen(true);
257
258
  });
258
259
 
259
260
  function autoResize() {
@@ -11,12 +11,16 @@
11
11
  </template>
12
12
 
13
13
  <script setup lang="ts">
14
- import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
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 agentStore = useAgentStore();
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-full"
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) {
@@ -1,4 +1,4 @@
1
- name: data-analytics
1
+ name: analyze_data
2
2
  description: Analyze AdminForth resource data, summarize trends, and create charts from fetched rows.
3
3
  ---
4
4
 
@@ -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 data-analytics first.",
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.",
@@ -254,6 +254,7 @@ onMounted(async () => {
254
254
  agentStore.setIsTeleportedToBody(isTeleportedToBodyFromLocalStorage || props.meta.stickByDefault);
255
255
  }
256
256
  await agentStore.fetchSessionsList();
257
+ agentStore.setFullScreen(true);
257
258
  });
258
259
 
259
260
  function autoResize() {
@@ -11,12 +11,16 @@
11
11
  </template>
12
12
 
13
13
  <script setup lang="ts">
14
- import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
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 agentStore = useAgentStore();
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-full"
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) {
@@ -1,4 +1,4 @@
1
- name: data-analytics
1
+ name: analyze_data
2
2
  description: Analyze AdminForth resource data, summarize trends, and create charts from fetched rows.
3
3
  ---
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.24.12",
3
+ "version": "1.24.14",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",