mirror of
https://github.com/stablyai/orca.git
synced 2026-09-30 00:03:15 +00:00
Improve Orca CLI terminal read pagination (#2553)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
+9
-1
@@ -174,10 +174,18 @@ export function formatTerminalShow(result: { terminal: RuntimeTerminalShow }): s
|
||||
|
||||
export function formatTerminalRead(result: { terminal: RuntimeTerminalRead }): string {
|
||||
const terminal = result.terminal
|
||||
const oldestCursor =
|
||||
typeof terminal.oldestCursor === 'string' ? [`oldest cursor: ${terminal.oldestCursor}`] : []
|
||||
const latestCursor =
|
||||
typeof terminal.latestCursor === 'string' ? [`latest cursor: ${terminal.latestCursor}`] : []
|
||||
const header = [
|
||||
`handle: ${terminal.handle}`,
|
||||
`status: ${terminal.status}`,
|
||||
...(terminal.nextCursor !== null ? [`cursor: ${terminal.nextCursor}`] : [])
|
||||
...(terminal.nextCursor !== null ? [`cursor: ${terminal.nextCursor}`] : []),
|
||||
...oldestCursor,
|
||||
...latestCursor,
|
||||
...(terminal.truncated ? ['warning: older output is no longer retained'] : []),
|
||||
...(terminal.limited ? ['warning: output limited; read again with the returned cursor'] : [])
|
||||
]
|
||||
return [...header, '', ...terminal.tail].join('\n')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user