@adminforth/agent 2.0.10 → 2.2.0
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/README.md +333 -10
- package/dist/application/ports.d.ts +66 -0
- package/dist/application/runTurnUseCase.d.ts +71 -0
- package/dist/application/runTurnUseCase.js +364 -0
- package/dist/custom/ChatFooter.vue +58 -30
- package/dist/custom/SteerDebugPanel.vue +45 -0
- package/dist/custom/SteerQueue.vue +54 -0
- package/dist/custom/composables/agentStore/constants.ts +1 -0
- package/dist/custom/composables/agentStore/useAgentSessions.ts +35 -16
- package/dist/custom/composables/agentStore/useAgentSteerQueue.ts +114 -0
- package/dist/custom/composables/useAgentStore.ts +46 -1
- package/dist/custom/conversation_area/MessageRenderer.vue +7 -1
- package/dist/custom/speech_recognition_frontend/AudioLines.vue +1 -1
- package/dist/custom/speech_recognition_frontend/MicrophoneButon.vue +3 -3
- package/dist/{agentEvents.d.ts → domain/agentEvents.d.ts} +5 -1
- package/dist/domain/steerBuffer.d.ts +33 -0
- package/dist/domain/steerBuffer.js +51 -0
- package/dist/{agent → domain}/systemPrompt.js +1 -1
- package/dist/{agent/turn → domain}/turnTypes.d.ts +41 -37
- package/dist/{agent/turn/VegaLiteStreamBuffer.d.ts → domain/vegaLiteStreamBuffer.d.ts} +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +49 -35
- package/dist/{agent/runtime/AgentContext.d.ts → llm/agentContext.d.ts} +3 -3
- package/dist/{agent/simpleAgent.d.ts → llm/agentModels.d.ts} +18 -16
- package/dist/llm/agentModels.js +65 -0
- package/dist/{agent/runtime/AgentRuntime.d.ts → llm/agentRuntime.d.ts} +14 -2
- package/dist/{agent/runtime/AgentRuntime.js → llm/agentRuntime.js} +41 -6
- package/dist/llm/langGraphLlm.d.ts +25 -0
- package/dist/llm/langGraphLlm.js +54 -0
- package/dist/{agent/middleware/apiBasedTools.d.ts → llm/middleware/apiToolsMiddleware.d.ts} +1 -1
- package/dist/{agent/middleware/apiBasedTools.js → llm/middleware/apiToolsMiddleware.js} +8 -14
- package/dist/{agent → llm}/middleware/sequenceDebug.d.ts +1 -1
- package/dist/llm/middleware/steerMiddleware.d.ts +21 -0
- package/dist/llm/middleware/steerMiddleware.js +50 -0
- package/dist/{agent/models/AgentModelFactory.d.ts → llm/modelFactory.d.ts} +1 -1
- package/dist/{agent/models/AgentModelFactory.js → llm/modelFactory.js} +1 -1
- package/dist/llm/streamAdapter.d.ts +18 -0
- package/dist/llm/streamAdapter.js +117 -0
- package/dist/{sessionStore.d.ts → persistence/sessionStore.d.ts} +19 -2
- package/dist/{sessionStore.js → persistence/sessionStore.js} +53 -0
- package/dist/{agent/tools/AgentToolProvider.d.ts → tools/agentToolProvider.d.ts} +1 -1
- package/dist/{agent/tools/AgentToolProvider.js → tools/agentToolProvider.js} +1 -1
- package/dist/{apiBasedTools.js → tools/apiBasedTools.js} +0 -3
- package/dist/{agent/tools → tools}/apiTool.d.ts +1 -1
- package/dist/{agent/tools → tools}/fetchSkill.js +1 -1
- package/dist/{agent/tools → tools}/fetchToolSchema.d.ts +1 -1
- package/dist/{agent/tools → tools}/index.d.ts +1 -1
- package/dist/{agent/tools → tools}/navigateUser.d.ts +3 -3
- package/dist/{endpoints → transport/http}/context.d.ts +12 -4
- package/dist/transport/http/context.js +1 -0
- package/dist/{endpoints/core.js → transport/http/coreEndpoints.js} +23 -3
- package/dist/{endpoints/sessions.js → transport/http/sessionEndpoints.js} +36 -1
- package/dist/transport/sse/sseWriter.d.ts +29 -0
- package/dist/{surfaces/web-sse/createSseEventEmitter.js → transport/sse/sseWriter.js} +27 -0
- package/dist/{chatSurfaceService.d.ts → transport/surfaces/chatSurfaceService.d.ts} +3 -3
- package/dist/{chatSurfaceService.js → transport/surfaces/chatSurfaceService.js} +7 -5
- package/dist/{agent/speech/SpeechTurnService.d.ts → transport/surfaces/speechTurnService.d.ts} +1 -1
- package/dist/{agent/speech/SpeechTurnService.js → transport/surfaces/speechTurnService.js} +2 -2
- package/dist/types.d.ts +10 -4
- package/package.json +11 -2
- package/.woodpecker/buildRelease.sh +0 -13
- package/.woodpecker/buildSlackNotify.sh +0 -46
- package/.woodpecker/release.yml +0 -57
- package/agent/checkpointer.ts +0 -329
- package/agent/languageDetect.ts +0 -92
- package/agent/middleware/apiBasedTools.ts +0 -174
- package/agent/middleware/openAiResponsesContinuation.ts +0 -92
- package/agent/middleware/sequenceDebug.ts +0 -429
- package/agent/models/AgentModeResolver.ts +0 -9
- package/agent/models/AgentModelFactory.ts +0 -28
- package/agent/runtime/AgentContext.ts +0 -30
- package/agent/runtime/AgentRuntime.ts +0 -89
- package/agent/simpleAgent.ts +0 -199
- package/agent/skills/registry.ts +0 -162
- package/agent/speech/SpeechTurnService.ts +0 -179
- package/agent/systemPrompt.ts +0 -133
- package/agent/toolCallEvents.ts +0 -135
- package/agent/tools/AgentToolProvider.ts +0 -28
- package/agent/tools/apiTool.ts +0 -66
- package/agent/tools/fetchSkill.ts +0 -68
- package/agent/tools/fetchToolSchema.ts +0 -47
- package/agent/tools/getUserLocation.ts +0 -45
- package/agent/tools/index.ts +0 -31
- package/agent/tools/navigateUser.ts +0 -210
- package/agent/turn/TurnContextBuilder.ts +0 -36
- package/agent/turn/TurnLifecycleService.ts +0 -47
- package/agent/turn/TurnPersistenceService.ts +0 -33
- package/agent/turn/TurnPromptBuilder.ts +0 -51
- package/agent/turn/TurnStreamConsumer.ts +0 -69
- package/agent/turn/VegaLiteStreamBuffer.ts +0 -90
- package/agent/turn/turnTypes.ts +0 -100
- package/agentEvents.ts +0 -75
- package/agentTurnService.ts +0 -314
- package/apiBasedTools.ts +0 -712
- package/build.log +0 -67
- package/chatSurfaceService.ts +0 -319
- package/custom/ChatFooter.vue +0 -173
- package/custom/ChatHeader.vue +0 -78
- package/custom/ChatSurface.vue +0 -160
- package/custom/CustomAutoScrollContainer.vue +0 -164
- package/custom/SessionsHistory.vue +0 -88
- package/custom/chat.ts +0 -82
- package/custom/composables/agentAudio/utils.ts +0 -220
- package/custom/composables/agentStore/constants.ts +0 -19
- package/custom/composables/agentStore/pageContext.ts +0 -8
- package/custom/composables/agentStore/useAgentChat.ts +0 -241
- package/custom/composables/agentStore/useAgentPlaceholder.ts +0 -142
- package/custom/composables/agentStore/useAgentSessions.ts +0 -350
- package/custom/composables/useAgentAudio.ts +0 -272
- package/custom/composables/useAgentStore.ts +0 -510
- package/custom/composables/useAgentTransitions.ts +0 -58
- package/custom/conversation_area/ConversationArea.vue +0 -301
- package/custom/conversation_area/MessageRenderer.vue +0 -49
- package/custom/conversation_area/ProcessingTimeline.vue +0 -286
- package/custom/conversation_area/ReasoningRenderer.vue +0 -79
- package/custom/conversation_area/SystemMessageRenderer.vue +0 -28
- package/custom/conversation_area/TextRenderer.vue +0 -182
- package/custom/conversation_area/ThreeDotsAnimation.vue +0 -35
- package/custom/conversation_area/ToolApprovalRenderer.vue +0 -98
- package/custom/conversation_area/ToolRenderer.vue +0 -178
- package/custom/conversation_area/ToolsGroup.vue +0 -59
- package/custom/env.d.ts +0 -7
- package/custom/incremark_code_renderers/IncremarkShikiCodeBlock.vue +0 -393
- package/custom/incremark_code_renderers/incremarkCodeHighlight.ts +0 -285
- package/custom/incremark_code_renderers/incremarkRenderer.ts +0 -653
- package/custom/incremark_code_renderers/renderIncremarkMarkdown.ts +0 -118
- package/custom/package.json +0 -30
- package/custom/pnpm-lock.yaml +0 -2394
- package/custom/public/agentAudio/agent-processing.mp3 +0 -0
- package/custom/skills/analyze_data/SKILL.md +0 -25
- package/custom/skills/charts/SKILL.md +0 -193
- package/custom/skills/fetch_data/SKILL.md +0 -31
- package/custom/skills/mutate_data/SKILL.md +0 -121
- package/custom/speech_recognition_frontend/AudioLines.vue +0 -43
- package/custom/speech_recognition_frontend/MicrophoneButon.vue +0 -185
- package/custom/speech_recognition_frontend/types/voice-activity-detection.d.ts +0 -22
- package/custom/speech_recognition_frontend/voiceActivityDetection.ts +0 -62
- package/custom/tsconfig.json +0 -15
- package/custom/types.ts +0 -108
- package/custom/utils.ts +0 -38
- package/dist/agent/middleware/openAiResponsesContinuation.d.ts +0 -1
- package/dist/agent/middleware/openAiResponsesContinuation.js +0 -66
- package/dist/agent/models/AgentModeResolver.d.ts +0 -9
- package/dist/agent/models/AgentModeResolver.js +0 -9
- package/dist/agent/simpleAgent.js +0 -118
- package/dist/agent/turn/TurnContextBuilder.d.ts +0 -14
- package/dist/agent/turn/TurnContextBuilder.js +0 -31
- package/dist/agent/turn/TurnLifecycleService.d.ts +0 -24
- package/dist/agent/turn/TurnLifecycleService.js +0 -47
- package/dist/agent/turn/TurnPersistenceService.d.ts +0 -13
- package/dist/agent/turn/TurnPersistenceService.js +0 -35
- package/dist/agent/turn/TurnPromptBuilder.d.ts +0 -19
- package/dist/agent/turn/TurnPromptBuilder.js +0 -43
- package/dist/agent/turn/TurnStreamConsumer.d.ts +0 -11
- package/dist/agent/turn/TurnStreamConsumer.js +0 -84
- package/dist/agentTurnService.d.ts +0 -24
- package/dist/agentTurnService.js +0 -269
- package/dist/surfaces/web-sse/createSseEventEmitter.d.ts +0 -14
- package/endpoints/chatSurfaces.ts +0 -66
- package/endpoints/context.ts +0 -52
- package/endpoints/core.ts +0 -181
- package/endpoints/sessions.ts +0 -183
- package/errors.ts +0 -10
- package/index.ts +0 -192
- package/pnpm-workspace.yaml +0 -4
- package/sanitizeSpeechText.ts +0 -32
- package/sessionStore.ts +0 -105
- package/surfaces/web-sse/createSseEventEmitter.ts +0 -311
- package/tsconfig.json +0 -14
- package/types.ts +0 -127
- /package/dist/{agent/turn/turnTypes.js → application/ports.js} +0 -0
- /package/dist/{agentEvents.js → domain/agentEvents.js} +0 -0
- /package/dist/{agent → domain}/languageDetect.d.ts +0 -0
- /package/dist/{agent → domain}/languageDetect.js +0 -0
- /package/dist/{agent → domain}/systemPrompt.d.ts +0 -0
- /package/dist/{agent → domain}/toolCallEvents.d.ts +0 -0
- /package/dist/{agent → domain}/toolCallEvents.js +0 -0
- /package/dist/{endpoints/context.js → domain/turnTypes.js} +0 -0
- /package/dist/{agent/turn/VegaLiteStreamBuffer.js → domain/vegaLiteStreamBuffer.js} +0 -0
- /package/dist/{agent/runtime/AgentContext.js → llm/agentContext.js} +0 -0
- /package/dist/{agent → llm}/middleware/sequenceDebug.js +0 -0
- /package/dist/{agent/checkpointer.d.ts → persistence/checkpointStore.d.ts} +0 -0
- /package/dist/{agent/checkpointer.js → persistence/checkpointStore.js} +0 -0
- /package/dist/{errors.d.ts → shared/errors.d.ts} +0 -0
- /package/dist/{errors.js → shared/errors.js} +0 -0
- /package/dist/{sanitizeSpeechText.d.ts → shared/sanitizeSpeechText.d.ts} +0 -0
- /package/dist/{sanitizeSpeechText.js → shared/sanitizeSpeechText.js} +0 -0
- /package/dist/{apiBasedTools.d.ts → tools/apiBasedTools.d.ts} +0 -0
- /package/dist/{agent/tools → tools}/apiTool.js +0 -0
- /package/dist/{agent/tools → tools}/fetchSkill.d.ts +0 -0
- /package/dist/{agent/tools → tools}/fetchToolSchema.js +0 -0
- /package/dist/{agent/tools → tools}/getUserLocation.d.ts +0 -0
- /package/dist/{agent/tools → tools}/getUserLocation.js +0 -0
- /package/dist/{agent/tools → tools}/index.js +0 -0
- /package/dist/{agent/tools → tools}/navigateUser.js +0 -0
- /package/dist/{agent → tools}/skills/registry.d.ts +0 -0
- /package/dist/{agent → tools}/skills/registry.js +0 -0
- /package/dist/{endpoints/chatSurfaces.d.ts → transport/http/chatSurfaceEndpoints.d.ts} +0 -0
- /package/dist/{endpoints/chatSurfaces.js → transport/http/chatSurfaceEndpoints.js} +0 -0
- /package/dist/{endpoints/core.d.ts → transport/http/coreEndpoints.d.ts} +0 -0
- /package/dist/{endpoints/sessions.d.ts → transport/http/sessionEndpoints.d.ts} +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li class="mb-6 mx-2 mt-2 px-2 z-50 overflow-hidden">
|
|
3
|
-
<span class="bg-lightNavbar dark:bg-darkNavbar absolute flex items-center text-listTableHeadingText dark:text-darkListTableHeadingText justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar dark:ring-darkNavbar ring-default">
|
|
4
|
-
<div class="w-5 h-5 rounded-full flex items-center justify-center">
|
|
5
|
-
<IconBrainOutline class="w-4 h-4" />
|
|
6
|
-
</div>
|
|
7
|
-
</span>
|
|
8
|
-
<h3
|
|
9
|
-
class=" flex items-center mb-1 text-sm ml-3 gap-1 cursor-pointer select-none hover:opacity-80 text-listTableHeadingText dark:text-darkListTableHeadingText"
|
|
10
|
-
@click="isExpanded = !isExpanded"
|
|
11
|
-
>
|
|
12
|
-
<span class="font-semibold">{{ reasoningTitle }}</span>
|
|
13
|
-
<ThreeDotsAnimation v-if="isStreaming"/>
|
|
14
|
-
<IconAngleDownOutline
|
|
15
|
-
:class="isExpanded ? 'rotate-180' : 'rotate-0'"
|
|
16
|
-
class="transition-transform duration-200"
|
|
17
|
-
/>
|
|
18
|
-
</h3>
|
|
19
|
-
<transition name="expand">
|
|
20
|
-
<IncremarkContent
|
|
21
|
-
v-if="isExpanded"
|
|
22
|
-
v-show="isExpanded"
|
|
23
|
-
class="pl-4 text-sm"
|
|
24
|
-
:content="reasoningText"
|
|
25
|
-
/>
|
|
26
|
-
</transition>
|
|
27
|
-
</li>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<script setup lang="ts">
|
|
33
|
-
import { IconBrainOutline, IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
|
|
34
|
-
import type { IPart } from '../types';
|
|
35
|
-
import { ref, computed, watch, defineAsyncComponent } from 'vue';
|
|
36
|
-
import ThreeDotsAnimation from './ThreeDotsAnimation.vue';
|
|
37
|
-
import { extractTitleAndTextFromReasoning } from '../utils';
|
|
38
|
-
|
|
39
|
-
const props = defineProps<{
|
|
40
|
-
state?: IPart['state']
|
|
41
|
-
text?: string
|
|
42
|
-
}>();
|
|
43
|
-
|
|
44
|
-
const IncremarkContent = defineAsyncComponent(() => import('@incremark/vue').then(module => module.IncremarkContent))
|
|
45
|
-
|
|
46
|
-
const isExpanded = ref(true);
|
|
47
|
-
const isStreaming = computed(() => props.state === 'streaming');
|
|
48
|
-
const parsedReasoning = computed(() => extractTitleAndTextFromReasoning(props.text ?? ''));
|
|
49
|
-
const reasoningTitle = computed(() => parsedReasoning.value.title ?? '');
|
|
50
|
-
const reasoningText = computed(() => parsedReasoning.value.body);
|
|
51
|
-
|
|
52
|
-
watch(() => props.state, (newValue: IPart['state']) => {
|
|
53
|
-
if ( newValue !== 'streaming') {
|
|
54
|
-
isExpanded.value = false;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<style scoped>
|
|
62
|
-
.expand-enter-active,
|
|
63
|
-
.expand-leave-active {
|
|
64
|
-
transition: all 300ms ease;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.expand-enter-from,
|
|
68
|
-
.expand-leave-to {
|
|
69
|
-
opacity: 0;
|
|
70
|
-
max-height: 0;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.expand-enter-to,
|
|
74
|
-
.expand-leave-from {
|
|
75
|
-
opacity: 1;
|
|
76
|
-
max-height: 256px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
</style>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<p :class="`${TEXT_CLASSES}`" v-if="message === RESERVED_SYSTEM_MESSAGE_CONTENT.START_AUDIO_CHAT">
|
|
3
|
-
<IconPhoneSolid class="inline-block w-4 h-4 mr-1" />
|
|
4
|
-
{{$t('Audio chat started')}}
|
|
5
|
-
</p>
|
|
6
|
-
<p :class="`${TEXT_CLASSES}`" v-else-if="message === RESERVED_SYSTEM_MESSAGE_CONTENT.END_AUDIO_CHAT">
|
|
7
|
-
<IconPhoneHangupSolid class="inline-block w-4 h-4 mr-1" />
|
|
8
|
-
{{$t('Audio chat ended')}}
|
|
9
|
-
</p>
|
|
10
|
-
<p :class="`${TEXT_CLASSES}`" v-else-if="message === RESERVED_SYSTEM_MESSAGE_CONTENT.AGENT_RESPONSE_ABORTED">
|
|
11
|
-
{{$t('Agent response aborted')}}
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import { RESERVED_SYSTEM_MESSAGE_CONTENT } from '../composables/agentStore/constants';
|
|
20
|
-
import { IconPhoneSolid, IconPhoneHangupSolid } from '@iconify-prerendered/vue-flowbite';
|
|
21
|
-
|
|
22
|
-
const TEXT_CLASSES = 'text-center italic text-lightListTableHeadingText dark:text-darkListTableHeadingText flex items-center justify-center';
|
|
23
|
-
|
|
24
|
-
const props = defineProps<{
|
|
25
|
-
message: string
|
|
26
|
-
}>();
|
|
27
|
-
|
|
28
|
-
</script>
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="flex rounded-xl border px-4 border-gray-200 dark:border-gray-700 min-w-0"
|
|
4
|
-
@click="handleMarkdownLinkClick"
|
|
5
|
-
:class="[
|
|
6
|
-
hasVegaLite ? 'w-full my-2' : 'm-2',
|
|
7
|
-
props.role === 'user' ? 'bg-lightListTableHeading dark:bg-darkListTableHeading self-end max-w-[80%] mr-4'
|
|
8
|
-
: 'border-none self-start max-w-full'
|
|
9
|
-
]"
|
|
10
|
-
>
|
|
11
|
-
<IncremarkContent
|
|
12
|
-
class="text-wrap break-words w-full max-w-full"
|
|
13
|
-
v-if="content"
|
|
14
|
-
:content="content"
|
|
15
|
-
:is-finished="isFinished"
|
|
16
|
-
:components="incremarkComponents"
|
|
17
|
-
:incremark-options="incremarkOptions"
|
|
18
|
-
/>
|
|
19
|
-
<!-- <p v-else class="text-red-500 py-2">
|
|
20
|
-
{{ $t('No content to render') }}
|
|
21
|
-
</p> -->
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script setup lang="ts">
|
|
26
|
-
|
|
27
|
-
import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue';
|
|
28
|
-
import { useRouter } from 'vue-router';
|
|
29
|
-
import { useAgentStore } from '../composables/useAgentStore';
|
|
30
|
-
import { useCoreStore } from '@/stores/core';
|
|
31
|
-
import type { IMessage } from '../types';
|
|
32
|
-
|
|
33
|
-
const props = defineProps<{
|
|
34
|
-
message: string | undefined,
|
|
35
|
-
state: string | undefined,
|
|
36
|
-
role: IMessage['role']
|
|
37
|
-
}>();
|
|
38
|
-
|
|
39
|
-
const emit = defineEmits(['toggle-thoughts']);
|
|
40
|
-
|
|
41
|
-
const IncremarkContent = defineAsyncComponent(() => import('@incremark/vue').then(module => module.IncremarkContent))
|
|
42
|
-
const ShikiCodeBlock = defineAsyncComponent(() => import('../incremark_code_renderers/IncremarkShikiCodeBlock.vue'))
|
|
43
|
-
|
|
44
|
-
const agentStore = useAgentStore();
|
|
45
|
-
const coreStore = useCoreStore();
|
|
46
|
-
const router = useRouter();
|
|
47
|
-
|
|
48
|
-
const isThoughtsExpanded = ref(true);
|
|
49
|
-
|
|
50
|
-
const content = computed(() => props.message)
|
|
51
|
-
const isFinished = computed(() => props.state === 'done')
|
|
52
|
-
const hasVegaLite = computed(() => props.message?.includes('```vega-lite'))
|
|
53
|
-
const isStateStreaming = computed(() => props.state === 'streaming')
|
|
54
|
-
|
|
55
|
-
const incremarkComponents = {
|
|
56
|
-
code: ShikiCodeBlock,
|
|
57
|
-
};
|
|
58
|
-
const incremarkOptions = {
|
|
59
|
-
gfm: true,
|
|
60
|
-
math: { tex: true },
|
|
61
|
-
containers: true,
|
|
62
|
-
htmlTree: true,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
onMounted(async () => {
|
|
66
|
-
void import('katex/dist/katex.min.css')
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
watch(isStateStreaming, (newValue: boolean) => {
|
|
70
|
-
if (!newValue) {
|
|
71
|
-
isThoughtsExpanded.value = false;
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
watch(isThoughtsExpanded, (newValue: boolean) => {
|
|
76
|
-
emit('toggle-thoughts', newValue);
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
function handleMarkdownLinkClick(event: MouseEvent) {
|
|
80
|
-
if (event.defaultPrevented || event.button !== 0) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const target = event.target;
|
|
87
|
-
if (!(target instanceof Element)) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const anchor = target.closest('a');
|
|
91
|
-
if (!(anchor instanceof HTMLAnchorElement)) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const href = anchor.getAttribute('href');
|
|
95
|
-
if (!href || href.startsWith('mailto:') || href.startsWith('tel:')) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
const internalRoute = resolveInternalRoute(href);
|
|
100
|
-
if (internalRoute !== null) {
|
|
101
|
-
if (agentStore.isFullScreen && !coreStore.isMobile) {
|
|
102
|
-
agentStore.setFullScreen(false);
|
|
103
|
-
} else if (coreStore.isMobile) {
|
|
104
|
-
agentStore.setIsChatOpen(false);
|
|
105
|
-
}
|
|
106
|
-
void router.push(internalRoute);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
window.location.assign(new URL(href, window.location.href).toString());
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function resolveInternalRoute(href: string): string | null {
|
|
114
|
-
if (href.startsWith('#')) {
|
|
115
|
-
return `${window.location.pathname}${window.location.search}${href}`;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const isAbsoluteWithScheme = /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(href);
|
|
119
|
-
const baseUrl = isAbsoluteWithScheme
|
|
120
|
-
? undefined
|
|
121
|
-
: `${window.location.origin}/`;
|
|
122
|
-
const resolvedUrl = new URL(href, baseUrl ?? window.location.href);
|
|
123
|
-
if (resolvedUrl.origin !== window.location.origin) {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return `${resolvedUrl.pathname}${resolvedUrl.search}${resolvedUrl.hash}`;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
</script>
|
|
131
|
-
|
|
132
|
-
<style lang="scss">
|
|
133
|
-
.incremark a.incremark-link,
|
|
134
|
-
.incremark a.incremark-link:visited {
|
|
135
|
-
display: inline-block;
|
|
136
|
-
text-decoration: underline;
|
|
137
|
-
text-underline-offset: 4px;
|
|
138
|
-
text-decoration-style:dotted;
|
|
139
|
-
color: rgb(0, 0, 0);
|
|
140
|
-
transition: color 0.2s ease;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.incremark a.incremark-link:hover {
|
|
144
|
-
color: rgb(74, 74, 255);
|
|
145
|
-
text-decoration: underline;
|
|
146
|
-
text-underline-offset: 4px;
|
|
147
|
-
text-decoration-style:dotted;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
html[data-theme="dark"] .incremark a.incremark-link,
|
|
151
|
-
html[data-theme="dark"] .incremark a.incremark-link:visited {
|
|
152
|
-
color: rgb(220, 220, 220);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
html[data-theme="dark"] .incremark a.incremark-link:hover {
|
|
156
|
-
color: rgb(147, 147, 255);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
a.incremark-link::after {
|
|
160
|
-
content: "";
|
|
161
|
-
display: inline-block;
|
|
162
|
-
width: 16px;
|
|
163
|
-
height: 16px;
|
|
164
|
-
vertical-align: middle;
|
|
165
|
-
rotate: -45deg;
|
|
166
|
-
background-color: currentColor;
|
|
167
|
-
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 12H2m12 0l-4 4m4-4l-4-4'/%3E%3C/svg%3E") no-repeat center;
|
|
168
|
-
mask-size: contain;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.incremark-table a.incremark-link {
|
|
172
|
-
word-break: break-word;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.incremark-list {
|
|
176
|
-
list-style: disc;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.incremark-paragraph {
|
|
180
|
-
margin: 8px 0;
|
|
181
|
-
}
|
|
182
|
-
</style>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span class="bounce-dot1 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
|
|
3
|
-
<span class="bounce-dot2 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
|
|
4
|
-
<span class="bounce-dot3 rounded-full w-2 h-2 bg-lightPrimary dark:bg-darkPrimary"></span>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<style scoped>
|
|
8
|
-
.bounce-dot1 {
|
|
9
|
-
animation: bounce 1.5s infinite;
|
|
10
|
-
animation-delay: 0s;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.bounce-dot2 {
|
|
14
|
-
animation: bounce 1.5s infinite;
|
|
15
|
-
animation-delay: 0.1s;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.bounce-dot3 {
|
|
19
|
-
animation: bounce 1.5s infinite;
|
|
20
|
-
animation-delay: 0.2s;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@keyframes bounce {
|
|
24
|
-
0%, 100% {
|
|
25
|
-
transform: translateY(20%);
|
|
26
|
-
opacity: 0.3;
|
|
27
|
-
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
|
|
28
|
-
}
|
|
29
|
-
50% {
|
|
30
|
-
transform: none;
|
|
31
|
-
opacity: 1;
|
|
32
|
-
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
</style>
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="mx-4 my-3 max-w-[min(34rem,calc(100%-2rem))] rounded-lg border border-lightPrimary/30 bg-lightNavbar p-4 text-lightListTableHeadingText shadow-sm dark:border-darkPrimary/40 dark:bg-darkNavbar dark:text-darkListTableHeadingText">
|
|
3
|
-
<div class="flex items-start gap-3">
|
|
4
|
-
<div class="mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-lightPrimary/10 text-lightPrimary dark:bg-darkPrimary/15 dark:text-darkPrimary">
|
|
5
|
-
<IconExclamationCircleOutline class="h-5 w-5" />
|
|
6
|
-
</div>
|
|
7
|
-
<div class="min-w-0 flex-1">
|
|
8
|
-
<h3 class="text-sm font-semibold leading-5">{{ $t('Approval required') }}</h3>
|
|
9
|
-
<p class="mt-1 text-sm leading-5 text-lightListTableText dark:text-darkListTableText">
|
|
10
|
-
{{ $t('Review the agent message before continuing.') }}
|
|
11
|
-
</p>
|
|
12
|
-
<button
|
|
13
|
-
v-if="data.messages?.length"
|
|
14
|
-
type="button"
|
|
15
|
-
class="mt-3 inline-flex items-center gap-2 text-sm font-medium text-lightListTableHeadingText transition hover:opacity-80 dark:text-darkListTableHeadingText"
|
|
16
|
-
@click="isExpanded = !isExpanded"
|
|
17
|
-
>
|
|
18
|
-
<IconChevronDownOutline
|
|
19
|
-
class="h-4 w-4 transition-transform"
|
|
20
|
-
:class="isExpanded ? 'rotate-180' : ''"
|
|
21
|
-
/>
|
|
22
|
-
{{ isExpanded ? $t('Hide details') : $t('Show details') }}
|
|
23
|
-
<span class="rounded-full bg-lightListTableText/10 px-2 py-0.5 text-xs text-lightListTableHeadingText dark:bg-darkListTableText/10 dark:text-darkListTableHeadingText">
|
|
24
|
-
{{ data.messages.length }}
|
|
25
|
-
</span>
|
|
26
|
-
</button>
|
|
27
|
-
<ul
|
|
28
|
-
v-if="isExpanded && data.messages?.length"
|
|
29
|
-
class="mt-3 space-y-1 text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText"
|
|
30
|
-
>
|
|
31
|
-
<li
|
|
32
|
-
v-for="message in data.messages"
|
|
33
|
-
:key="message"
|
|
34
|
-
class="flex gap-2"
|
|
35
|
-
>
|
|
36
|
-
<span class="mt-2 h-1.5 w-1.5 shrink-0 rounded-full bg-lightListTableHeadingText dark:bg-darkListTableHeadingText" />
|
|
37
|
-
<span>{{ message }}</span>
|
|
38
|
-
</li>
|
|
39
|
-
</ul>
|
|
40
|
-
<div class="mt-4 flex flex-wrap gap-2">
|
|
41
|
-
<template v-if="data.status === 'pending'">
|
|
42
|
-
<button
|
|
43
|
-
type="button"
|
|
44
|
-
class="inline-flex h-9 items-center gap-2 rounded-md border border-lightButtonsBorder bg-lightButtonsBackground px-3 text-sm font-medium text-lightButtonsText transition hover:bg-lightButtonsHover dark:border-darkButtonsBorder dark:bg-darkButtonsBackground dark:text-darkButtonsText dark:hover:bg-darkButtonsHover"
|
|
45
|
-
@click="submit('approve')"
|
|
46
|
-
>
|
|
47
|
-
<IconCheckOutline class="h-4 w-4" />
|
|
48
|
-
{{ $t('Approve') }}
|
|
49
|
-
</button>
|
|
50
|
-
<button
|
|
51
|
-
type="button"
|
|
52
|
-
class="inline-flex h-9 items-center gap-2 rounded-md border border-lightListTableText/20 bg-transparent px-3 text-sm font-medium text-lightListTableHeadingText transition hover:bg-lightListTableText/10 dark:border-darkListTableText/20 dark:text-darkListTableHeadingText dark:hover:bg-darkListTableText/10"
|
|
53
|
-
@click="submit('reject')"
|
|
54
|
-
>
|
|
55
|
-
<IconCloseOutline class="h-4 w-4" />
|
|
56
|
-
{{ $t('Reject') }}
|
|
57
|
-
</button>
|
|
58
|
-
</template>
|
|
59
|
-
<span
|
|
60
|
-
v-else
|
|
61
|
-
class="inline-flex h-8 items-center gap-2 rounded-md border px-2.5 text-sm font-medium"
|
|
62
|
-
:class="data.status === 'processing'
|
|
63
|
-
? 'border-lightListTableText/20 bg-lightListTableText/10 text-lightListTableHeadingText dark:border-darkListTableText/20 dark:bg-darkListTableText/10 dark:text-darkListTableHeadingText'
|
|
64
|
-
: data.status === 'approved'
|
|
65
|
-
? 'border-lightListTableText/20 bg-lightListTableText/10 text-lightListTableHeadingText dark:border-darkListTableText/20 dark:bg-darkListTableText/10 dark:text-darkListTableHeadingText'
|
|
66
|
-
: 'border-lightListTableText/20 bg-lightListTableText/10 text-lightListTableHeadingText dark:border-darkListTableText/20 dark:bg-darkListTableText/10 dark:text-darkListTableHeadingText'"
|
|
67
|
-
>
|
|
68
|
-
<IconCheckOutline v-if="data.status === 'approved'" class="h-4 w-4" />
|
|
69
|
-
<IconCloseOutline v-else-if="data.status === 'rejected'" class="h-4 w-4" />
|
|
70
|
-
{{ data.status === 'processing' ? $t('Processing') : data.status === 'approved' ? $t('Approved') : $t('Rejected') }}
|
|
71
|
-
</span>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</template>
|
|
77
|
-
|
|
78
|
-
<script setup lang="ts">
|
|
79
|
-
import type { IPartData } from '../types';
|
|
80
|
-
import { useAgentStore } from '../composables/useAgentStore';
|
|
81
|
-
import { ref } from 'vue';
|
|
82
|
-
import { IconCheckOutline, IconChevronDownOutline, IconCloseOutline, IconExclamationCircleOutline } from '@iconify-prerendered/vue-flowbite';
|
|
83
|
-
|
|
84
|
-
const props = defineProps<{
|
|
85
|
-
data: IPartData;
|
|
86
|
-
}>();
|
|
87
|
-
|
|
88
|
-
const agentStore = useAgentStore();
|
|
89
|
-
const isExpanded = ref(false);
|
|
90
|
-
|
|
91
|
-
function submit(decision: 'approve' | 'reject') {
|
|
92
|
-
if (!props.data.sessionId || props.data.status !== 'pending') {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
agentStore.submitToolApproval(props.data.sessionId, decision);
|
|
97
|
-
}
|
|
98
|
-
</script>
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="toolRendererRef"
|
|
4
|
-
class="py-1 inline-flex justify-center m-2 max-w-full min-w-0
|
|
5
|
-
flex-col gap-3 rounded-xl px-2 text-lightListTableHeadingText
|
|
6
|
-
dark:text-darkListTableHeadingText select-none
|
|
7
|
-
"
|
|
8
|
-
:class="[
|
|
9
|
-
isInputOutputExpanded ? 'items-start border-none' : '',
|
|
10
|
-
activateShrinkedStyle ? 'border items-center' : '',
|
|
11
|
-
activateFullWidth ? 'w-full' : '',
|
|
12
|
-
]"
|
|
13
|
-
:style="{
|
|
14
|
-
maxWidth: activateShrinkedStyle ? toolRendererInitialWidth + 'px' : '',
|
|
15
|
-
}"
|
|
16
|
-
>
|
|
17
|
-
<div
|
|
18
|
-
class="flex items-center gap-1 cursor-pointer"
|
|
19
|
-
@click="toggleInputOutput()"
|
|
20
|
-
>
|
|
21
|
-
<div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-lightNavbar dark:bg-darkNavbar">
|
|
22
|
-
<Spinner v-if="isRunning" class="h-4 w-4" />
|
|
23
|
-
<IconCheckOutline v-else-if="!props.data.toolInfo.error" class="h-4 w-4 text-lightPrimary dark:text-darkPrimary" />
|
|
24
|
-
<IconCloseOutline v-else class="h-4 w-4 text-red-500" />
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div class="min-w-0">
|
|
28
|
-
<p class="break-words font-mono text-sm leading-5">
|
|
29
|
-
{{ props.data?.toolInfo?.toolInfo ? props.data.toolInfo.toolInfo : props.data?.toolInfo?.toolName}}
|
|
30
|
-
</p>
|
|
31
|
-
</div>
|
|
32
|
-
<IconAngleDownOutline
|
|
33
|
-
v-if="hasToolSections"
|
|
34
|
-
:class="isInputOutputExpanded ? 'rotate-180' : 'rotate-0'"
|
|
35
|
-
@transitionend="finishTransition()"
|
|
36
|
-
class="shrink-0 cursor-pointer transition-transform duration-300 hover:scale-105"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
<transition name="expand">
|
|
40
|
-
<div v-if="isInputOutputExpanded" v-show="isInputOutputExpanded" class="max-h-72 space-y-3 overflow-y-auto pr-1 w-full">
|
|
41
|
-
<section
|
|
42
|
-
v-for="section in toolSections"
|
|
43
|
-
:key="section.label"
|
|
44
|
-
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"
|
|
45
|
-
>
|
|
46
|
-
<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">
|
|
47
|
-
{{ section.label }}
|
|
48
|
-
</header>
|
|
49
|
-
<div class="select-all 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">
|
|
50
|
-
<template v-for="line in section.lines" :key="`${section.label}-${line.number}`">
|
|
51
|
-
<span class=" text-[0.7rem] text-gray-400 dark:text-gray-500 select-none">{{ line.number }}</span>
|
|
52
|
-
<span class="whitespace-pre-wrap break-words">{{ line.content || ' ' }}</span>
|
|
53
|
-
</template>
|
|
54
|
-
</div>
|
|
55
|
-
</section>
|
|
56
|
-
</div>
|
|
57
|
-
</transition>
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script setup lang="ts">
|
|
62
|
-
import { computed, ref, watch, onMounted, nextTick } from 'vue';
|
|
63
|
-
import { type IFormattedToolCallPart } from '../types';
|
|
64
|
-
import { Spinner } from '@/afcl';
|
|
65
|
-
import { IconAngleDownOutline, IconCheckOutline, IconCloseOutline } from '@iconify-prerendered/vue-flowbite';
|
|
66
|
-
|
|
67
|
-
const props = defineProps<{
|
|
68
|
-
data: IFormattedToolCallPart
|
|
69
|
-
}>();
|
|
70
|
-
|
|
71
|
-
interface IToolSection {
|
|
72
|
-
label: string;
|
|
73
|
-
lines: Array<{
|
|
74
|
-
number: number;
|
|
75
|
-
content: string;
|
|
76
|
-
}>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const isInputOutputExpanded = ref(false);
|
|
80
|
-
const activateShrinkedStyle = ref(true);
|
|
81
|
-
const toolRendererInitialWidth = ref<number | null>(null);
|
|
82
|
-
const toolRendererRef = ref<HTMLElement | null>(null);
|
|
83
|
-
const activateFullWidth = ref(false);
|
|
84
|
-
const blockClicksDuringAnimation = ref(false);
|
|
85
|
-
const ANIMATION_DURATION = 300;
|
|
86
|
-
|
|
87
|
-
const isRunning = computed(() => props.data?.toolInfo?.phase === 'start');
|
|
88
|
-
const toolSections = computed<IToolSection[]>(() => {
|
|
89
|
-
const sections = [
|
|
90
|
-
{
|
|
91
|
-
label: 'Input',
|
|
92
|
-
content: normalizeToolPayload(props.data.toolInfo.input),
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
label: 'Output',
|
|
96
|
-
content: normalizeToolPayload(props.data.toolInfo.output),
|
|
97
|
-
},
|
|
98
|
-
];
|
|
99
|
-
|
|
100
|
-
return sections
|
|
101
|
-
.filter((section): section is { label: string; content: string } => Boolean(section.content))
|
|
102
|
-
.map(section => ({
|
|
103
|
-
label: section.label,
|
|
104
|
-
lines: section.content.split('\n').map((content, index) => ({
|
|
105
|
-
number: index + 1,
|
|
106
|
-
content,
|
|
107
|
-
})),
|
|
108
|
-
}));
|
|
109
|
-
});
|
|
110
|
-
const hasToolSections = computed(() => toolSections.value.length > 0);
|
|
111
|
-
|
|
112
|
-
onMounted(async () => {
|
|
113
|
-
await nextTick();
|
|
114
|
-
if (toolRendererRef.value && props.data.toolInfo) {
|
|
115
|
-
const contentWidth = Math.ceil(toolRendererRef.value.getBoundingClientRect().width);
|
|
116
|
-
const parentWidth = toolRendererRef.value.parentElement?.clientWidth ?? Infinity;
|
|
117
|
-
toolRendererInitialWidth.value = Math.min(contentWidth, parentWidth);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
watch(isInputOutputExpanded, (newValue) => {
|
|
122
|
-
if (newValue) {
|
|
123
|
-
activateShrinkedStyle.value = false;
|
|
124
|
-
activateFullWidth.value = true;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
function finishTransition() {
|
|
129
|
-
if (!isInputOutputExpanded.value) {
|
|
130
|
-
activateFullWidth.value = false;
|
|
131
|
-
activateShrinkedStyle.value = true;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function toggleInputOutput() {
|
|
136
|
-
if (blockClicksDuringAnimation.value) return;
|
|
137
|
-
isInputOutputExpanded.value = !isInputOutputExpanded.value;
|
|
138
|
-
blockClicksDuringAnimation.value = true;
|
|
139
|
-
setTimeout(() => {
|
|
140
|
-
blockClicksDuringAnimation.value = false;
|
|
141
|
-
}, ANIMATION_DURATION);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const normalizeToolPayload = (value: unknown): string | null => {
|
|
145
|
-
if (value === null || value === undefined || value === '') {
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (typeof value === 'string') {
|
|
150
|
-
return value.trim();
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return JSON.stringify(value, null, 2);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
</script>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
<style scoped>
|
|
160
|
-
|
|
161
|
-
.expand-enter-active,
|
|
162
|
-
.expand-leave-active {
|
|
163
|
-
transition: all 300ms ease;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.expand-enter-from,
|
|
167
|
-
.expand-leave-to {
|
|
168
|
-
opacity: 0;
|
|
169
|
-
max-height: 0;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.expand-enter-to,
|
|
173
|
-
.expand-leave-from {
|
|
174
|
-
opacity: 1;
|
|
175
|
-
max-height: 288px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
</style>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<template >
|
|
2
|
-
<template v-if="toolGroup.length > 0">
|
|
3
|
-
<li class="mb-6 ms-2 z-50">
|
|
4
|
-
<span class="text-listTableHeadingText dark:text-darkListTableHeadingText bg-lightNavbar dark:bg-darkNavbar absolute flex items-center justify-center w-5 h-5 bg-brand-softer rounded-full -start-[0.68rem] ring-4 ring-lightNavbar dark:ring-darkNavbar ring-default">
|
|
5
|
-
<div class="w-5 h-5 rounded-full flex items-center justify-center">
|
|
6
|
-
<IconWrenchSolid class="w-4 h-4" />
|
|
7
|
-
</div>
|
|
8
|
-
</span>
|
|
9
|
-
<h3
|
|
10
|
-
class="flex items-center mb-1 text-sm my-2 ml-3 gap-1 text-listTableHeadingText dark:text-darkListTableHeadingText"
|
|
11
|
-
>
|
|
12
|
-
<span class="font-semibold select-none ">{{ $t('Call tools') }}</span>
|
|
13
|
-
</h3>
|
|
14
|
-
<div class="flex flex-wrap">
|
|
15
|
-
<template v-for="group in props.toolGroup" :key="group.title">
|
|
16
|
-
<ToolRenderer
|
|
17
|
-
v-if="isExpanded"
|
|
18
|
-
v-for="part in group.groupedTools"
|
|
19
|
-
:key="part.toolInfo.toolCallId"
|
|
20
|
-
:data="part"
|
|
21
|
-
/>
|
|
22
|
-
</template>
|
|
23
|
-
</div>
|
|
24
|
-
</li>
|
|
25
|
-
</template>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script setup lang="ts">
|
|
29
|
-
import ToolRenderer from './ToolRenderer.vue';
|
|
30
|
-
import type { IToolGroup } from '../types';
|
|
31
|
-
import { IconWrenchSolid } from '@iconify-prerendered/vue-heroicons';
|
|
32
|
-
|
|
33
|
-
const props = defineProps<{
|
|
34
|
-
toolGroup: IToolGroup[]
|
|
35
|
-
isExpanded: boolean
|
|
36
|
-
}>();
|
|
37
|
-
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<style scoped>
|
|
41
|
-
|
|
42
|
-
.expand-enter-active,
|
|
43
|
-
.expand-leave-active {
|
|
44
|
-
transition: all 0.3s ease;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.expand-enter-from,
|
|
48
|
-
.expand-leave-to {
|
|
49
|
-
opacity: 0;
|
|
50
|
-
max-height: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.expand-enter-to,
|
|
54
|
-
.expand-leave-from {
|
|
55
|
-
opacity: 1;
|
|
56
|
-
max-height: 288px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
</style>
|