@volter/supercode-terminal 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CAPABILITIES.md +57 -0
- package/LICENSE-SUBSTRATE +201 -0
- package/NOTICE-SUBSTRATE +14 -0
- package/README.md +190 -0
- package/client.d.ts +17 -0
- package/client.mjs +32 -0
- package/index.d.ts +195 -0
- package/index.mjs +981 -0
- package/package.json +156 -0
- package/react/stream.d.ts +3 -0
- package/react/stream.mjs +446 -0
- package/react/ui.d.ts +136 -0
- package/react/ui.mjs +892 -0
- package/stream.d.ts +3 -0
- package/stream.mjs +446 -0
- package/styles.css +160 -0
- package/substrate/attach.d.ts +29 -0
- package/substrate/attach.js +147 -0
- package/substrate/client.d.ts +62 -0
- package/substrate/client.js +138 -0
- package/substrate/docker-exec.d.ts +41 -0
- package/substrate/docker-exec.js +101 -0
- package/substrate/internal/exec.d.ts +15 -0
- package/substrate/internal/exec.js +192 -0
- package/substrate/internal/process-tree.d.ts +1 -0
- package/substrate/internal/process-tree.js +41 -0
- package/substrate/local-terminal.d.ts +13 -0
- package/substrate/local-terminal.js +41 -0
- package/substrate/native-host.d.ts +57 -0
- package/substrate/native-host.js +529 -0
- package/substrate/session-lifecycle.d.ts +162 -0
- package/substrate/session-lifecycle.js +1344 -0
- package/substrate/session-roll.d.ts +14 -0
- package/substrate/session-roll.js +407 -0
- package/substrate/tmux-stream.d.ts +32 -0
- package/substrate/tmux-stream.js +212 -0
- package/substrate/tmux.d.ts +144 -0
- package/substrate/tmux.js +899 -0
- package/ui.d.ts +136 -0
- package/ui.mjs +892 -0
package/react/ui.d.ts
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type TerminalUiAttachment = Readonly<{
|
|
4
|
+
id: string;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
mode: 'observe' | 'control';
|
|
7
|
+
/** Opaque catalog id; never a tmux target or socket handle. */
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
}>;
|
|
10
|
+
|
|
11
|
+
export type TerminalUiSession = Readonly<{
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
cwd: string | null;
|
|
15
|
+
activeCommand: string | null;
|
|
16
|
+
owned: boolean;
|
|
17
|
+
size?: Readonly<{ columns: number; rows: number }> | null;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export type TerminalUiState = Readonly<{
|
|
21
|
+
available: boolean;
|
|
22
|
+
canOpenLocal: boolean;
|
|
23
|
+
error: string | null;
|
|
24
|
+
sessions: readonly TerminalUiSession[];
|
|
25
|
+
attachment: TerminalUiAttachment | null;
|
|
26
|
+
}>;
|
|
27
|
+
|
|
28
|
+
export function normalizeTerminalUiState(value: unknown): TerminalUiState;
|
|
29
|
+
export function terminalWorkspaceShortcut(event: Readonly<{
|
|
30
|
+
altKey: boolean;
|
|
31
|
+
shiftKey: boolean;
|
|
32
|
+
ctrlKey: boolean;
|
|
33
|
+
metaKey: boolean;
|
|
34
|
+
code: string;
|
|
35
|
+
}>): Readonly<
|
|
36
|
+
| { action: 'new' | 'detach' | 'previous' | 'next' }
|
|
37
|
+
| { action: 'tab'; index: number }
|
|
38
|
+
> | null;
|
|
39
|
+
|
|
40
|
+
export type TerminalCreateAction = Readonly<{ id: string; label: string; icon?: ReactNode }>;
|
|
41
|
+
|
|
42
|
+
export type TerminalPanelLabels = Readonly<{
|
|
43
|
+
title?: string;
|
|
44
|
+
subtitle?: string;
|
|
45
|
+
refresh?: string;
|
|
46
|
+
view?: string;
|
|
47
|
+
control?: string;
|
|
48
|
+
stop?: string;
|
|
49
|
+
open?: string;
|
|
50
|
+
back?: string;
|
|
51
|
+
empty?: string;
|
|
52
|
+
/** What a session with no observed cwd or command is; `tmux session` by default. */
|
|
53
|
+
session?: string;
|
|
54
|
+
}>;
|
|
55
|
+
|
|
56
|
+
export type TerminalPanelProps = Readonly<{
|
|
57
|
+
state: TerminalUiState;
|
|
58
|
+
createActions?: readonly TerminalCreateAction[];
|
|
59
|
+
labels?: TerminalPanelLabels;
|
|
60
|
+
className?: string;
|
|
61
|
+
renderViewer?(attachment: TerminalUiAttachment): ReactNode;
|
|
62
|
+
onClose(): void;
|
|
63
|
+
onRefresh(): void | Promise<void>;
|
|
64
|
+
onCreate?(actionId: string): void | Promise<void>;
|
|
65
|
+
onAttach(sessionId: string, mode: 'observe' | 'control'): void | Promise<void>;
|
|
66
|
+
onStop(sessionId: string): void | Promise<void>;
|
|
67
|
+
onOpen?(sessionId: string): void | Promise<void>;
|
|
68
|
+
onDismiss(): void | Promise<void>;
|
|
69
|
+
}>;
|
|
70
|
+
|
|
71
|
+
export function terminalPath(value: string): Readonly<{
|
|
72
|
+
leading: string;
|
|
73
|
+
separator: string;
|
|
74
|
+
trailing: string;
|
|
75
|
+
}>;
|
|
76
|
+
export function TerminalPath(props: Readonly<{ value: string }>): ReactNode;
|
|
77
|
+
export function TerminalViewer(props: Readonly<{
|
|
78
|
+
active?: boolean;
|
|
79
|
+
connect?: TerminalConnector;
|
|
80
|
+
/** Convert bare LF output to CRLF for streams without PTY line discipline. */
|
|
81
|
+
convertEol?: boolean;
|
|
82
|
+
onReady?(handle: { focus(): void }): void;
|
|
83
|
+
attachment: TerminalUiAttachment;
|
|
84
|
+
onActivity?(): void;
|
|
85
|
+
onBell?(): void;
|
|
86
|
+
onOpenLink?(url: string): void;
|
|
87
|
+
onRetry?(): void;
|
|
88
|
+
onStatus?(status: string): void;
|
|
89
|
+
onTitle?(title: string): void;
|
|
90
|
+
}>): ReactNode;
|
|
91
|
+
export function TerminalPanel(props: TerminalPanelProps): ReactNode;
|
|
92
|
+
|
|
93
|
+
export type TerminalWorkspaceLabels = TerminalPanelLabels & Readonly<{
|
|
94
|
+
attach?: string;
|
|
95
|
+
closeTab?: string;
|
|
96
|
+
newTerminal?: string;
|
|
97
|
+
noTabs?: string;
|
|
98
|
+
sessions?: string;
|
|
99
|
+
terminal?: string;
|
|
100
|
+
fitViewport?: string;
|
|
101
|
+
scaleViewport?: string;
|
|
102
|
+
}>;
|
|
103
|
+
|
|
104
|
+
export type TerminalWorkspaceProps = Omit<TerminalPanelProps, 'onDismiss' | 'renderViewer'> & Readonly<{
|
|
105
|
+
labels?: TerminalWorkspaceLabels;
|
|
106
|
+
viewportMode?: 'scale' | 'fit';
|
|
107
|
+
onViewportModeChange?(mode: 'scale' | 'fit'): void | Promise<void>;
|
|
108
|
+
renderViewer?(
|
|
109
|
+
attachment: TerminalUiAttachment,
|
|
110
|
+
context: Readonly<{
|
|
111
|
+
active: boolean;
|
|
112
|
+
onActivity(): void;
|
|
113
|
+
onBell(): void;
|
|
114
|
+
onStatus(status: string): void;
|
|
115
|
+
onTitle(title: string): void;
|
|
116
|
+
retry(): void;
|
|
117
|
+
}>,
|
|
118
|
+
): ReactNode;
|
|
119
|
+
}>;
|
|
120
|
+
|
|
121
|
+
export function TerminalWorkspace(props: TerminalWorkspaceProps): ReactNode;
|
|
122
|
+
|
|
123
|
+
/** Stream adapters own process lifetime. Closing a viewer only detaches its stream. */
|
|
124
|
+
export interface TerminalStreamHandlers {
|
|
125
|
+
onOpen(): void;
|
|
126
|
+
onOutput(data: string): void;
|
|
127
|
+
onResize(cols: number, rows: number): void;
|
|
128
|
+
onError(message: string): void;
|
|
129
|
+
onExit(): void;
|
|
130
|
+
onClose(): void;
|
|
131
|
+
}
|
|
132
|
+
export type TerminalConnector = (
|
|
133
|
+
attachment: TerminalUiAttachment,
|
|
134
|
+
handlers: TerminalStreamHandlers,
|
|
135
|
+
size: { cols: number; rows: number },
|
|
136
|
+
) => { write(data: string): void; resize(cols: number, rows: number): void; close(): void };
|