chore: establish YCode replication baseline and TODO
This commit is contained in:
commit
6dc59f89ba
1118 files changed
+196002
No files matched your search
@@ -0,0 +1,33 @@
|
||||
/** Local PTY handles are scoped to their creating window and conversation. */
|
||||
export interface TerminalReplayChunk { data: string; cols: number; rows: number }
|
||||
export interface TerminalHostView {
|
||||
id: string
|
||||
sessionId?: string
|
||||
cwd: string
|
||||
title: string
|
||||
shell: string
|
||||
cols: number
|
||||
rows: number
|
||||
/** Bounded ANSI output replay; credentials are never added to the shell environment. */
|
||||
buffer: string
|
||||
replay: TerminalReplayChunk[]
|
||||
sequence: number
|
||||
exited: boolean
|
||||
exitCode?: number
|
||||
}
|
||||
export type TerminalHostEvent = {
|
||||
id: string
|
||||
sessionId?: string
|
||||
sequence: number
|
||||
} & ({ type: 'data'; data: string } | { type: 'exit'; exitCode: number })
|
||||
|
||||
export interface TerminalHostApi {
|
||||
create(sessionId?: string, cols?: number, rows?: number): Promise<TerminalHostView>
|
||||
get(id: string, sessionId?: string): Promise<TerminalHostView>
|
||||
write(id: string, data: string, sessionId?: string): Promise<void>
|
||||
resize(id: string, cols: number, rows: number, sessionId?: string): Promise<void>
|
||||
clear(id: string, sessionId?: string): Promise<void>
|
||||
rebind(id: string, previousSessionId: string | undefined, nextSessionId: string): Promise<TerminalHostView>
|
||||
close(id: string, sessionId?: string): Promise<void>
|
||||
onEvent(listener: (event: TerminalHostEvent) => void): () => void
|
||||
}
|
||||
Reference in new issue
Block a user