Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sgr-agent-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div class="agent-reasoning-step">
<div class="agent-reasoning-step" :class="{ 'agent-reasoning-step--collapsed': isCollapsed }">
<div class="agent-reasoning-step__header" @click="toggleCollapsed">
<div class="agent-reasoning-step__title">
<span class="agent-reasoning-step__reasoning">{{ step.reasoning }}</span>
<span class="agent-reasoning-step__tool-name">{{
getToolDisplayName(step.tool_name_discriminator)
}}</span>
</div>
<div class="agent-reasoning-step__toggle">
<AppIconChevronDown24 :class="{ 'agent-reasoning-step__chevron--rotated': !isCollapsed }" />
<div v-if="hasContent" class="agent-reasoning-step__toggle">
<AppIconChevronDown24 :class="{ 'agent-reasoning-step__chevron--rotated': isCollapsed }" />
</div>
</div>

<div v-if="!isCollapsed" class="agent-reasoning-step__content">
<div v-if="!isCollapsed && hasContent" class="agent-reasoning-step__content">
<!-- Web Search Tool -->
<div
v-if="step.tool_name_discriminator === 'websearchtool'"
Expand Down Expand Up @@ -103,7 +103,7 @@
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ref, computed } from 'vue'
import AppIconChevronDown24 from '@/shared/ui/icons/AppIconChevronDown24.vue'

interface ReasoningStep {
Expand All @@ -118,7 +118,7 @@ interface ReasoningStep {
status?: string
}

defineProps<{
const props = defineProps<{
step: ReasoningStep
}>()

Expand All @@ -128,6 +128,19 @@ const toggleCollapsed = () => {
isCollapsed.value = !isCollapsed.value
}

// Check if content is empty
const hasContent = computed(() => {
return !!(
props.step.query ||
(props.step.urls && props.step.urls.length > 0) ||
props.step.title ||
props.step.content ||
(props.step.completed_steps && props.step.completed_steps.length > 0) ||
props.step.status
)
})
</script>

const getToolDisplayName = (toolName: string): string => {
const toolNames: Record<string, string> = {
websearchtool: 'Web Search',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div class="agent-reasoning-step">
<div class="agent-reasoning-step" :class="{ 'agent-reasoning-step--collapsed': isCollapsed, 'agent-reasoning-step--empty': !hasContent }">
<div class="agent-reasoning-step__header" @click="toggleCollapsed">
<div class="agent-reasoning-step__title">
<span class="agent-reasoning-step__reasoning">{{ data.reasoning }}</span>
<span class="agent-reasoning-step__tool-name">CLARIFICATIONTOOL</span>
</div>
<div class="agent-reasoning-step__toggle">
<div v-if="hasContent" class="agent-reasoning-step__toggle">
<AppIconChevronDown24
:class="{ 'agent-reasoning-step__chevron--rotated': !isCollapsed }"
:class="{ 'agent-reasoning-step__chevron--rotated': isCollapsed }"
/>
</div>
</div>

<div v-if="!isCollapsed" class="agent-reasoning-step__content">
<div v-if="!isCollapsed && hasContent" class="agent-reasoning-step__content">
<div class="agent-reasoning-step__details">
<!-- Questions -->
<div v-if="data.questions && data.questions.length" class="agent-reasoning-step__field">
Expand Down Expand Up @@ -61,7 +61,7 @@
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ref, computed } from 'vue'
import AppIconChevronDown24 from '@/shared/ui/icons/AppIconChevronDown24.vue'

interface Props {
Expand All @@ -73,11 +73,20 @@ interface Props {
}
}

defineProps<Props>()
const props = defineProps<Props>()

const isCollapsed = ref(true)

const toggleCollapsed = () => {
isCollapsed.value = !isCollapsed.value
}

// Check if content is empty
const hasContent = computed(() => {
return !!(
(props.data.questions && props.data.questions.length > 0) ||
(props.data.unclear_terms && props.data.unclear_terms.length > 0) ||
(props.data.assumptions && props.data.assumptions.length > 0)
)
})
</script>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div class="agent-reasoning-step">
<div class="agent-reasoning-step" :class="{ 'agent-reasoning-step--collapsed': isCollapsed, 'agent-reasoning-step--empty': !hasContent }">
<div class="agent-reasoning-step__header" @click="toggleCollapsed">
<div class="agent-reasoning-step__title">
<span class="agent-reasoning-step__reasoning">{{ data.reasoning }}</span>
<span class="agent-reasoning-step__tool-name">EXTRACTPAGECONTENTTOOL</span>
</div>
<div class="agent-reasoning-step__toggle">
<AppIconChevronDown24
:class="{ 'agent-reasoning-step__chevron--rotated': !isCollapsed }"
:class="{ 'agent-reasoning-step__chevron--rotated': isCollapsed }"
/>
</div>
</div>

<div v-if="!isCollapsed" class="agent-reasoning-step__content">
<div v-if="!isCollapsed && hasContent" class="agent-reasoning-step__content">
<div class="agent-reasoning-step__details">
<!-- URLs -->
<div v-if="data.urls && data.urls.length" class="agent-reasoning-step__field">
Expand All @@ -36,7 +36,7 @@
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ref, computed } from 'vue'
import AppIconChevronDown24 from '@/shared/ui/icons/AppIconChevronDown24.vue'

interface Props {
Expand All @@ -46,11 +46,16 @@ interface Props {
}
}

defineProps<Props>()
const props = defineProps<Props>()

const isCollapsed = ref(true)

const toggleCollapsed = () => {
isCollapsed.value = !isCollapsed.value
}

// Check if content is empty
const hasContent = computed(() => {
return !!(props.data.urls && props.data.urls.length > 0)
})
</script>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div class="agent-reasoning-step agent-reasoning-step--final-answer">
<div class="agent-reasoning-step agent-reasoning-step--final-answer" :class="{ 'agent-reasoning-step--collapsed': isCollapsed }">
<div class="agent-reasoning-step__header" @click="toggleCollapsed">
<div class="agent-reasoning-step__title">
<span class="agent-reasoning-step__reasoning">✅ Final Answer</span>
<span class="agent-reasoning-step__tool-name">FINALANSWERTOOL</span>
</div>
<div class="agent-reasoning-step__toggle">
<div v-if="hasContent" class="agent-reasoning-step__toggle">
<AppIconChevronDown24
:class="{ 'agent-reasoning-step__chevron--rotated': !isCollapsed }"
:class="{ 'agent-reasoning-step__chevron--rotated': isCollapsed }"
/>
</div>
</div>

<div v-if="!isCollapsed" class="agent-reasoning-step__content">
<div v-if="!isCollapsed && hasContent" class="agent-reasoning-step__content">
<div class="agent-reasoning-step__details">
<!-- Completed Steps -->
<div v-if="data.completed_steps && data.completed_steps.length" class="agent-reasoning-step__field">
Expand Down Expand Up @@ -48,7 +48,7 @@
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ref, computed } from 'vue'
import AppIconChevronDown24 from '@/shared/ui/icons/AppIconChevronDown24.vue'
import { MarkdownRenderer } from '@/shared/ui'

Expand All @@ -61,11 +61,20 @@ interface Props {
}
}

defineProps<Props>()
const props = defineProps<Props>()

const isCollapsed = ref(false) // Start expanded to show final answer immediately

const toggleCollapsed = () => {
isCollapsed.value = !isCollapsed.value
}

// Check if content is empty
const hasContent = computed(() => {
return !!(
(props.data.completed_steps && props.data.completed_steps.length > 0) ||
props.data.answer ||
props.data.status
)
})
</script>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="agent-reasoning-step">
<div class="agent-reasoning-step" :class="{ 'agent-reasoning-step--collapsed': isCollapsed, 'agent-reasoning-step--empty': !hasContent }">
<div class="agent-reasoning-step__header" @click="toggleCollapsed">
<div class="agent-reasoning-step__title">
<span class="agent-reasoning-step__reasoning">
Expand All @@ -11,7 +11,7 @@
</div>
<div class="agent-reasoning-step__toggle">
<AppIconChevronDown24
:class="{ 'agent-reasoning-step__chevron--rotated': !isCollapsed }"
:class="{ 'agent-reasoning-step__chevron--rotated': isCollapsed }"
/>
</div>
</div>
Expand All @@ -28,18 +28,23 @@
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ref, computed } from 'vue'
import AppIconChevronDown24 from '@/shared/ui/icons/AppIconChevronDown24.vue'

interface Props {
step: any
}

defineProps<Props>()
const props = defineProps<Props>()

const isCollapsed = ref(true)

const toggleCollapsed = () => {
isCollapsed.value = !isCollapsed.value
}

// Check if content is empty (has at least some data)
const hasContent = computed(() => {
return props.step && Object.keys(props.step).length > 0
})
</script>
Loading