feat(tui): add developer debug bar (#38359)
This commit is contained in:
parent
532292b5f3
commit
8a36abd328
9 changed files with 554 additions and 193 deletions
|
|
@ -762,23 +762,6 @@ export function Session() {
|
|||
options.format === "markdown"
|
||||
? formatSessionTranscript(sessionData, messages(), options.thinking)
|
||||
: await (async () => {
|
||||
if (options.debug) {
|
||||
const events: { readonly created: number }[] = []
|
||||
for await (const event of client.api.session.log({ sessionID: sessionData.id, follow: false })) {
|
||||
if (event.type !== "log.synced") events.push(event)
|
||||
}
|
||||
// Durable events stay in aggregate order even when their wall-clock timestamps differ.
|
||||
client.connection.internal.history().forEach((event) => {
|
||||
const index = events.findIndex((item) => item.created > event.created)
|
||||
if (index === -1) {
|
||||
events.push(event)
|
||||
return
|
||||
}
|
||||
events.splice(index, 0, event)
|
||||
})
|
||||
return JSON.stringify({ info: sessionData, events }, null, 2) + EOL
|
||||
}
|
||||
|
||||
const messages: unknown[] = []
|
||||
let cursor: string | undefined
|
||||
do {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue