The web transcript was built to mirror the TUI: every tool call as a shell line or a glyph row, the thinking trace between them, each at the position the stream delivered it. That is the right shape for a terminal session you sit and watch. On the web it reads as machinery in front of the answer, and the answer is what the page is for. `TurnEntries` now keeps only the two entries the reader must handle: a consent card (the agent is waiting on an answer, so hiding it would stall the turn) and an attachment card (the file it handed over). Everything else in the turn renders as the reply, through `AppMarkdown`. The mirror in `useTranscript` still folds tool and thinking events; only the render ignores them. Replay, the pending-echo dedupe and consent placement keep working unchanged, and the bottom-pin watch loses the thinking-length term it only needed while that block took height. `TurnToolRow` had no other caller and goes with it.
53 lines
1.6 KiB
Vue
53 lines
1.6 KiB
Vue
<script setup lang="ts">
|
|
// The turn's middle, as the web surface shows it: the agent's asks
|
|
// (consent cards) and its handovers (attachment cards), each at the
|
|
// position the stream delivered it. Tool calls and the thinking trace
|
|
// stay off this surface; the reply is what it shows, and these two
|
|
// cards are the only things the reader must act on or can open.
|
|
import { computed } from 'vue'
|
|
import type { TurnEntry } from '~/composables/useTranscript'
|
|
import type { ConsentAnswer } from '~/composables/useClaw'
|
|
|
|
const props = defineProps<{
|
|
entries: TurnEntry[]
|
|
}>()
|
|
|
|
/** Cards only: a turn's tool rows and thinking blocks never render. */
|
|
const cards = computed(() =>
|
|
props.entries.filter((entry) => entry.kind === 'consent' || entry.kind === 'attachment'),
|
|
)
|
|
|
|
const emit = defineEmits<{
|
|
consentAnswer: [id: string, answer: ConsentAnswer]
|
|
consentDeny: [id: string]
|
|
downloadAttachment: [id: string, name: string]
|
|
}>()
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="cards.length > 0" class="entries">
|
|
<template v-for="(entry, index) in cards" :key="index">
|
|
<TurnConsentCard
|
|
v-if="entry.kind === 'consent'"
|
|
:consent="entry.consent"
|
|
@answer="(id, answer) => emit('consentAnswer', id, answer)"
|
|
@deny="(id) => emit('consentDeny', id)"
|
|
/>
|
|
<TurnAttachmentCard
|
|
v-else-if="entry.kind === 'attachment'"
|
|
:attachment="entry.attachment"
|
|
@download="(id, name) => emit('downloadAttachment', id, name)"
|
|
/>
|
|
</template>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.entries {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
margin-bottom: 10px;
|
|
}
|
|
</style>
|