@ibealec/create-zed-bridge 1.0.13 → 1.0.15
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/package.json +1 -1
- package/templates/@zed-controller/react-bridge/dist/index.cjs +2091 -1382
- package/templates/@zed-controller/react-bridge/dist/index.cjs.map +1 -1
- package/templates/@zed-controller/react-bridge/dist/index.d.cts +162 -5
- package/templates/@zed-controller/react-bridge/dist/index.d.ts +162 -5
- package/templates/@zed-controller/react-bridge/dist/index.js +2080 -1379
- package/templates/@zed-controller/react-bridge/dist/index.js.map +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
import { BrowserTask as BrowserTask$1, Session, SelectionContext } from '@zed-controller/shared';
|
|
3
|
+
import { BrowserTask as BrowserTask$1, Session as Session$1, SelectionContext } from '@zed-controller/shared';
|
|
4
4
|
export { BrowserTask, CreateTaskRequest, CreateTaskResponse, SelectionContext, Session, TaskProgressEvent } from '@zed-controller/shared';
|
|
5
5
|
|
|
6
|
+
type Session = Session$1;
|
|
6
7
|
type BrowserTask = BrowserTask$1;
|
|
7
8
|
interface ClaudeBridgeConfig {
|
|
8
9
|
serverUrl: string;
|
|
@@ -11,12 +12,15 @@ interface ClaudeBridgeConfig {
|
|
|
11
12
|
projectRoot?: string;
|
|
12
13
|
shortcut?: string;
|
|
13
14
|
questionShortcut?: string;
|
|
15
|
+
voiceShortcut?: string;
|
|
14
16
|
onTaskCreated?: (taskId: string) => void;
|
|
15
17
|
onTaskProgress?: (taskId: string, output: string) => void;
|
|
16
18
|
onTaskCompleted?: (taskId: string) => void;
|
|
17
19
|
onTaskFailed?: (taskId: string, error: string) => void;
|
|
18
20
|
onError?: (error: Error) => void;
|
|
19
21
|
}
|
|
22
|
+
/** Panel display modes */
|
|
23
|
+
type PanelMode = 'terminal' | 'prompt' | 'question';
|
|
20
24
|
interface ClaudeBridgeState {
|
|
21
25
|
connected: boolean;
|
|
22
26
|
selectionMode: boolean;
|
|
@@ -24,6 +28,10 @@ interface ClaudeBridgeState {
|
|
|
24
28
|
selectedElement: HTMLElement | null;
|
|
25
29
|
activeTask: BrowserTask | null;
|
|
26
30
|
tasks: BrowserTask[];
|
|
31
|
+
sessions: Session[];
|
|
32
|
+
activeSessionId: string | null;
|
|
33
|
+
panelExpanded: boolean;
|
|
34
|
+
panelMode: PanelMode;
|
|
27
35
|
}
|
|
28
36
|
interface ClaudeBridgeContextValue {
|
|
29
37
|
state: ClaudeBridgeState;
|
|
@@ -35,6 +43,9 @@ interface ClaudeBridgeContextValue {
|
|
|
35
43
|
submitTask: (prompt: string) => Promise<string | null>;
|
|
36
44
|
submitQuestion: (prompt: string, includeSelectedElement?: boolean) => Promise<string | null>;
|
|
37
45
|
continueTask: (taskId: string, prompt: string) => Promise<void>;
|
|
46
|
+
setActiveSession: (sessionId: string | null) => void;
|
|
47
|
+
setPanelExpanded: (expanded: boolean) => void;
|
|
48
|
+
setPanelMode: (mode: PanelMode) => void;
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
interface ClaudeBridgeProviderProps {
|
|
@@ -45,13 +56,14 @@ interface ClaudeBridgeProviderProps {
|
|
|
45
56
|
projectRoot?: string;
|
|
46
57
|
shortcut?: string;
|
|
47
58
|
questionShortcut?: string;
|
|
59
|
+
voiceShortcut?: string;
|
|
48
60
|
onTaskCreated?: (taskId: string) => void;
|
|
49
61
|
onTaskProgress?: (taskId: string, output: string) => void;
|
|
50
62
|
onTaskCompleted?: (taskId: string) => void;
|
|
51
63
|
onTaskFailed?: (taskId: string, error: string) => void;
|
|
52
64
|
onError?: (error: Error) => void;
|
|
53
65
|
}
|
|
54
|
-
declare function ClaudeBridgeProvider({ children, serverUrl, token, enabled, projectRoot, shortcut, questionShortcut, onTaskCreated, onTaskProgress, onTaskCompleted, onTaskFailed, onError, }: ClaudeBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function ClaudeBridgeProvider({ children, serverUrl, token, enabled, projectRoot, shortcut, questionShortcut, voiceShortcut, onTaskCreated, onTaskProgress, onTaskCompleted, onTaskFailed, onError, }: ClaudeBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
55
67
|
declare function useClaudeBridge(): ClaudeBridgeContextValue;
|
|
56
68
|
|
|
57
69
|
interface ClaudeTerminalProps {
|
|
@@ -62,11 +74,11 @@ interface ClaudeTerminalProps {
|
|
|
62
74
|
/** Session ID to attach to, or undefined to show session picker */
|
|
63
75
|
sessionId?: string;
|
|
64
76
|
/** Called when a session is selected (when sessionId is not provided) */
|
|
65
|
-
onSessionSelect?: (session: Session) => void;
|
|
77
|
+
onSessionSelect?: (session: Session$1) => void;
|
|
66
78
|
/** Called when connection status changes */
|
|
67
79
|
onConnectionChange?: (connected: boolean) => void;
|
|
68
80
|
/** Called when sessions list updates */
|
|
69
|
-
onSessionsUpdate?: (sessions: Session[]) => void;
|
|
81
|
+
onSessionsUpdate?: (sessions: Session$1[]) => void;
|
|
70
82
|
/** Custom terminal options */
|
|
71
83
|
terminalOptions?: {
|
|
72
84
|
fontSize?: number;
|
|
@@ -94,6 +106,83 @@ interface TaskStatusToastProps {
|
|
|
94
106
|
}
|
|
95
107
|
declare function TaskStatusToast({ task, serverUrl, token, onDismiss, killOnClose, }: TaskStatusToastProps): react_jsx_runtime.JSX.Element | null;
|
|
96
108
|
|
|
109
|
+
interface SessionPanelProps {
|
|
110
|
+
sessions: Session$1[];
|
|
111
|
+
activeSessionId: string | null;
|
|
112
|
+
onSessionSelect: (sessionId: string) => void;
|
|
113
|
+
onSessionClose?: (sessionId: string) => void;
|
|
114
|
+
serverUrl: string;
|
|
115
|
+
token: string;
|
|
116
|
+
expanded: boolean;
|
|
117
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
118
|
+
selectedElement: HTMLElement | null;
|
|
119
|
+
mode: PanelMode;
|
|
120
|
+
onModeChange: (mode: PanelMode) => void;
|
|
121
|
+
onPromptSubmit: (prompt: string) => void;
|
|
122
|
+
onQuestionSubmit: (prompt: string, includeElement: boolean) => void;
|
|
123
|
+
onClose: () => void;
|
|
124
|
+
isSubmitting: boolean;
|
|
125
|
+
voiceInputActive?: boolean;
|
|
126
|
+
onVoiceInputStart?: () => void;
|
|
127
|
+
activeTask: BrowserTask$1 | null;
|
|
128
|
+
}
|
|
129
|
+
declare function SessionPanel({ sessions, activeSessionId, onSessionSelect, onSessionClose, serverUrl, token, expanded, onExpandedChange, selectedElement, mode, onModeChange, onPromptSubmit, onQuestionSubmit, onClose, isSubmitting, voiceInputActive, onVoiceInputStart, activeTask, }: SessionPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
130
|
+
|
|
131
|
+
interface SessionTabsProps {
|
|
132
|
+
sessions: Session$1[];
|
|
133
|
+
activeSessionId: string | null;
|
|
134
|
+
onSessionSelect: (sessionId: string) => void;
|
|
135
|
+
onSessionClose?: (sessionId: string) => void;
|
|
136
|
+
/** ID of the session where the current task is running (if any) */
|
|
137
|
+
taskSessionId?: string | null;
|
|
138
|
+
}
|
|
139
|
+
declare function SessionTabs({ sessions, activeSessionId, onSessionSelect, onSessionClose, taskSessionId, }: SessionTabsProps): react_jsx_runtime.JSX.Element;
|
|
140
|
+
|
|
141
|
+
interface SessionStorageData {
|
|
142
|
+
lastSessionId: string;
|
|
143
|
+
projectRoot: string;
|
|
144
|
+
timestamp: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Hook for persisting and retrieving the last viewed session from localStorage.
|
|
148
|
+
* Sessions are scoped to project root and expire after 24 hours.
|
|
149
|
+
*/
|
|
150
|
+
declare function useSessionStorage(projectRoot: string | undefined): {
|
|
151
|
+
getStoredSessionId: () => string | null;
|
|
152
|
+
setStoredSessionId: (sessionId: string | null) => void;
|
|
153
|
+
clearStoredSession: () => void;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
interface UseSessionsOptions {
|
|
157
|
+
/** All sessions from the server */
|
|
158
|
+
sessions: Session$1[];
|
|
159
|
+
/** Project root to filter sessions by */
|
|
160
|
+
projectRoot?: string;
|
|
161
|
+
}
|
|
162
|
+
interface UseSessionsReturn {
|
|
163
|
+
/** Sessions filtered to the current project */
|
|
164
|
+
projectSessions: Session$1[];
|
|
165
|
+
/** All sessions (unfiltered) */
|
|
166
|
+
allSessions: Session$1[];
|
|
167
|
+
/** Check if a session belongs to this project */
|
|
168
|
+
isProjectSession: (session: Session$1) => boolean;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Hook for filtering and managing sessions by project root.
|
|
172
|
+
* Sessions are filtered by workingDir matching the projectRoot.
|
|
173
|
+
*/
|
|
174
|
+
declare function useSessions({ sessions, projectRoot, }: UseSessionsOptions): UseSessionsReturn;
|
|
175
|
+
/**
|
|
176
|
+
* Get a display name for a session.
|
|
177
|
+
* Prefers displayName, falls back to name, then to tmuxSession.
|
|
178
|
+
*/
|
|
179
|
+
declare function getSessionDisplayName(session: Session$1): string;
|
|
180
|
+
/**
|
|
181
|
+
* Check if a session appears to be actively running (based on recent activity).
|
|
182
|
+
* Considers a session "active" if it had activity within the last 60 seconds.
|
|
183
|
+
*/
|
|
184
|
+
declare function isSessionActive(session: Session$1): boolean;
|
|
185
|
+
|
|
97
186
|
/**
|
|
98
187
|
* Captures context about a selected DOM element for Claude.
|
|
99
188
|
* Uses multiple strategies to identify source location:
|
|
@@ -118,4 +207,72 @@ declare function captureElementScreenshot(element: HTMLElement, options?: {
|
|
|
118
207
|
maxHeight?: number;
|
|
119
208
|
}): Promise<string | undefined>;
|
|
120
209
|
|
|
121
|
-
|
|
210
|
+
interface VoiceInputProps {
|
|
211
|
+
onTranscript: (text: string) => void;
|
|
212
|
+
onListeningChange?: (isListening: boolean) => void;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
size?: 'small' | 'medium';
|
|
215
|
+
autoStart?: boolean;
|
|
216
|
+
}
|
|
217
|
+
declare function VoiceInput({ onTranscript, onListeningChange, disabled, size, autoStart, }: VoiceInputProps): react_jsx_runtime.JSX.Element | null;
|
|
218
|
+
|
|
219
|
+
interface SpeechRecognitionEvent extends Event {
|
|
220
|
+
results: SpeechRecognitionResultList;
|
|
221
|
+
resultIndex: number;
|
|
222
|
+
}
|
|
223
|
+
interface SpeechRecognitionResultList {
|
|
224
|
+
length: number;
|
|
225
|
+
item(index: number): SpeechRecognitionResult;
|
|
226
|
+
[index: number]: SpeechRecognitionResult;
|
|
227
|
+
}
|
|
228
|
+
interface SpeechRecognitionResult {
|
|
229
|
+
isFinal: boolean;
|
|
230
|
+
length: number;
|
|
231
|
+
item(index: number): SpeechRecognitionAlternative;
|
|
232
|
+
[index: number]: SpeechRecognitionAlternative;
|
|
233
|
+
}
|
|
234
|
+
interface SpeechRecognitionAlternative {
|
|
235
|
+
transcript: string;
|
|
236
|
+
confidence: number;
|
|
237
|
+
}
|
|
238
|
+
interface SpeechRecognitionErrorEvent extends Event {
|
|
239
|
+
error: string;
|
|
240
|
+
message?: string;
|
|
241
|
+
}
|
|
242
|
+
interface SpeechRecognition extends EventTarget {
|
|
243
|
+
continuous: boolean;
|
|
244
|
+
interimResults: boolean;
|
|
245
|
+
lang: string;
|
|
246
|
+
onresult: ((event: SpeechRecognitionEvent) => void) | null;
|
|
247
|
+
onerror: ((event: SpeechRecognitionErrorEvent) => void) | null;
|
|
248
|
+
onend: (() => void) | null;
|
|
249
|
+
onstart: (() => void) | null;
|
|
250
|
+
start(): void;
|
|
251
|
+
stop(): void;
|
|
252
|
+
abort(): void;
|
|
253
|
+
}
|
|
254
|
+
declare global {
|
|
255
|
+
interface Window {
|
|
256
|
+
SpeechRecognition?: new () => SpeechRecognition;
|
|
257
|
+
webkitSpeechRecognition?: new () => SpeechRecognition;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
interface UseVoiceInputOptions {
|
|
261
|
+
onTranscript?: (text: string, isFinal: boolean) => void;
|
|
262
|
+
onError?: (error: string) => void;
|
|
263
|
+
onStart?: () => void;
|
|
264
|
+
onEnd?: () => void;
|
|
265
|
+
language?: string;
|
|
266
|
+
}
|
|
267
|
+
interface UseVoiceInputReturn {
|
|
268
|
+
isListening: boolean;
|
|
269
|
+
isSupported: boolean;
|
|
270
|
+
transcript: string;
|
|
271
|
+
interimTranscript: string;
|
|
272
|
+
startListening: () => void;
|
|
273
|
+
stopListening: () => void;
|
|
274
|
+
error: string | null;
|
|
275
|
+
}
|
|
276
|
+
declare function useVoiceInput(options?: UseVoiceInputOptions): UseVoiceInputReturn;
|
|
277
|
+
|
|
278
|
+
export { type ClaudeBridgeConfig, type ClaudeBridgeContextValue, ClaudeBridgeProvider, type ClaudeBridgeState, ClaudeTerminal, type ClaudeTerminalProps, type PanelMode, SessionPanel, type SessionPanelProps, type SessionStorageData, SessionTabs, type SessionTabsProps, TaskStatusToast, type UseSessionsOptions, type UseSessionsReturn, type UseVoiceInputOptions, type UseVoiceInputReturn, VoiceInput, type VoiceInputProps, captureContext, captureElementScreenshot, capturePageContext, getSessionDisplayName, isSessionActive, useClaudeBridge, useSessionStorage, useSessions, useVoiceInput };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
import { BrowserTask as BrowserTask$1, Session, SelectionContext } from '@zed-controller/shared';
|
|
3
|
+
import { BrowserTask as BrowserTask$1, Session as Session$1, SelectionContext } from '@zed-controller/shared';
|
|
4
4
|
export { BrowserTask, CreateTaskRequest, CreateTaskResponse, SelectionContext, Session, TaskProgressEvent } from '@zed-controller/shared';
|
|
5
5
|
|
|
6
|
+
type Session = Session$1;
|
|
6
7
|
type BrowserTask = BrowserTask$1;
|
|
7
8
|
interface ClaudeBridgeConfig {
|
|
8
9
|
serverUrl: string;
|
|
@@ -11,12 +12,15 @@ interface ClaudeBridgeConfig {
|
|
|
11
12
|
projectRoot?: string;
|
|
12
13
|
shortcut?: string;
|
|
13
14
|
questionShortcut?: string;
|
|
15
|
+
voiceShortcut?: string;
|
|
14
16
|
onTaskCreated?: (taskId: string) => void;
|
|
15
17
|
onTaskProgress?: (taskId: string, output: string) => void;
|
|
16
18
|
onTaskCompleted?: (taskId: string) => void;
|
|
17
19
|
onTaskFailed?: (taskId: string, error: string) => void;
|
|
18
20
|
onError?: (error: Error) => void;
|
|
19
21
|
}
|
|
22
|
+
/** Panel display modes */
|
|
23
|
+
type PanelMode = 'terminal' | 'prompt' | 'question';
|
|
20
24
|
interface ClaudeBridgeState {
|
|
21
25
|
connected: boolean;
|
|
22
26
|
selectionMode: boolean;
|
|
@@ -24,6 +28,10 @@ interface ClaudeBridgeState {
|
|
|
24
28
|
selectedElement: HTMLElement | null;
|
|
25
29
|
activeTask: BrowserTask | null;
|
|
26
30
|
tasks: BrowserTask[];
|
|
31
|
+
sessions: Session[];
|
|
32
|
+
activeSessionId: string | null;
|
|
33
|
+
panelExpanded: boolean;
|
|
34
|
+
panelMode: PanelMode;
|
|
27
35
|
}
|
|
28
36
|
interface ClaudeBridgeContextValue {
|
|
29
37
|
state: ClaudeBridgeState;
|
|
@@ -35,6 +43,9 @@ interface ClaudeBridgeContextValue {
|
|
|
35
43
|
submitTask: (prompt: string) => Promise<string | null>;
|
|
36
44
|
submitQuestion: (prompt: string, includeSelectedElement?: boolean) => Promise<string | null>;
|
|
37
45
|
continueTask: (taskId: string, prompt: string) => Promise<void>;
|
|
46
|
+
setActiveSession: (sessionId: string | null) => void;
|
|
47
|
+
setPanelExpanded: (expanded: boolean) => void;
|
|
48
|
+
setPanelMode: (mode: PanelMode) => void;
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
interface ClaudeBridgeProviderProps {
|
|
@@ -45,13 +56,14 @@ interface ClaudeBridgeProviderProps {
|
|
|
45
56
|
projectRoot?: string;
|
|
46
57
|
shortcut?: string;
|
|
47
58
|
questionShortcut?: string;
|
|
59
|
+
voiceShortcut?: string;
|
|
48
60
|
onTaskCreated?: (taskId: string) => void;
|
|
49
61
|
onTaskProgress?: (taskId: string, output: string) => void;
|
|
50
62
|
onTaskCompleted?: (taskId: string) => void;
|
|
51
63
|
onTaskFailed?: (taskId: string, error: string) => void;
|
|
52
64
|
onError?: (error: Error) => void;
|
|
53
65
|
}
|
|
54
|
-
declare function ClaudeBridgeProvider({ children, serverUrl, token, enabled, projectRoot, shortcut, questionShortcut, onTaskCreated, onTaskProgress, onTaskCompleted, onTaskFailed, onError, }: ClaudeBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function ClaudeBridgeProvider({ children, serverUrl, token, enabled, projectRoot, shortcut, questionShortcut, voiceShortcut, onTaskCreated, onTaskProgress, onTaskCompleted, onTaskFailed, onError, }: ClaudeBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
55
67
|
declare function useClaudeBridge(): ClaudeBridgeContextValue;
|
|
56
68
|
|
|
57
69
|
interface ClaudeTerminalProps {
|
|
@@ -62,11 +74,11 @@ interface ClaudeTerminalProps {
|
|
|
62
74
|
/** Session ID to attach to, or undefined to show session picker */
|
|
63
75
|
sessionId?: string;
|
|
64
76
|
/** Called when a session is selected (when sessionId is not provided) */
|
|
65
|
-
onSessionSelect?: (session: Session) => void;
|
|
77
|
+
onSessionSelect?: (session: Session$1) => void;
|
|
66
78
|
/** Called when connection status changes */
|
|
67
79
|
onConnectionChange?: (connected: boolean) => void;
|
|
68
80
|
/** Called when sessions list updates */
|
|
69
|
-
onSessionsUpdate?: (sessions: Session[]) => void;
|
|
81
|
+
onSessionsUpdate?: (sessions: Session$1[]) => void;
|
|
70
82
|
/** Custom terminal options */
|
|
71
83
|
terminalOptions?: {
|
|
72
84
|
fontSize?: number;
|
|
@@ -94,6 +106,83 @@ interface TaskStatusToastProps {
|
|
|
94
106
|
}
|
|
95
107
|
declare function TaskStatusToast({ task, serverUrl, token, onDismiss, killOnClose, }: TaskStatusToastProps): react_jsx_runtime.JSX.Element | null;
|
|
96
108
|
|
|
109
|
+
interface SessionPanelProps {
|
|
110
|
+
sessions: Session$1[];
|
|
111
|
+
activeSessionId: string | null;
|
|
112
|
+
onSessionSelect: (sessionId: string) => void;
|
|
113
|
+
onSessionClose?: (sessionId: string) => void;
|
|
114
|
+
serverUrl: string;
|
|
115
|
+
token: string;
|
|
116
|
+
expanded: boolean;
|
|
117
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
118
|
+
selectedElement: HTMLElement | null;
|
|
119
|
+
mode: PanelMode;
|
|
120
|
+
onModeChange: (mode: PanelMode) => void;
|
|
121
|
+
onPromptSubmit: (prompt: string) => void;
|
|
122
|
+
onQuestionSubmit: (prompt: string, includeElement: boolean) => void;
|
|
123
|
+
onClose: () => void;
|
|
124
|
+
isSubmitting: boolean;
|
|
125
|
+
voiceInputActive?: boolean;
|
|
126
|
+
onVoiceInputStart?: () => void;
|
|
127
|
+
activeTask: BrowserTask$1 | null;
|
|
128
|
+
}
|
|
129
|
+
declare function SessionPanel({ sessions, activeSessionId, onSessionSelect, onSessionClose, serverUrl, token, expanded, onExpandedChange, selectedElement, mode, onModeChange, onPromptSubmit, onQuestionSubmit, onClose, isSubmitting, voiceInputActive, onVoiceInputStart, activeTask, }: SessionPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
130
|
+
|
|
131
|
+
interface SessionTabsProps {
|
|
132
|
+
sessions: Session$1[];
|
|
133
|
+
activeSessionId: string | null;
|
|
134
|
+
onSessionSelect: (sessionId: string) => void;
|
|
135
|
+
onSessionClose?: (sessionId: string) => void;
|
|
136
|
+
/** ID of the session where the current task is running (if any) */
|
|
137
|
+
taskSessionId?: string | null;
|
|
138
|
+
}
|
|
139
|
+
declare function SessionTabs({ sessions, activeSessionId, onSessionSelect, onSessionClose, taskSessionId, }: SessionTabsProps): react_jsx_runtime.JSX.Element;
|
|
140
|
+
|
|
141
|
+
interface SessionStorageData {
|
|
142
|
+
lastSessionId: string;
|
|
143
|
+
projectRoot: string;
|
|
144
|
+
timestamp: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Hook for persisting and retrieving the last viewed session from localStorage.
|
|
148
|
+
* Sessions are scoped to project root and expire after 24 hours.
|
|
149
|
+
*/
|
|
150
|
+
declare function useSessionStorage(projectRoot: string | undefined): {
|
|
151
|
+
getStoredSessionId: () => string | null;
|
|
152
|
+
setStoredSessionId: (sessionId: string | null) => void;
|
|
153
|
+
clearStoredSession: () => void;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
interface UseSessionsOptions {
|
|
157
|
+
/** All sessions from the server */
|
|
158
|
+
sessions: Session$1[];
|
|
159
|
+
/** Project root to filter sessions by */
|
|
160
|
+
projectRoot?: string;
|
|
161
|
+
}
|
|
162
|
+
interface UseSessionsReturn {
|
|
163
|
+
/** Sessions filtered to the current project */
|
|
164
|
+
projectSessions: Session$1[];
|
|
165
|
+
/** All sessions (unfiltered) */
|
|
166
|
+
allSessions: Session$1[];
|
|
167
|
+
/** Check if a session belongs to this project */
|
|
168
|
+
isProjectSession: (session: Session$1) => boolean;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Hook for filtering and managing sessions by project root.
|
|
172
|
+
* Sessions are filtered by workingDir matching the projectRoot.
|
|
173
|
+
*/
|
|
174
|
+
declare function useSessions({ sessions, projectRoot, }: UseSessionsOptions): UseSessionsReturn;
|
|
175
|
+
/**
|
|
176
|
+
* Get a display name for a session.
|
|
177
|
+
* Prefers displayName, falls back to name, then to tmuxSession.
|
|
178
|
+
*/
|
|
179
|
+
declare function getSessionDisplayName(session: Session$1): string;
|
|
180
|
+
/**
|
|
181
|
+
* Check if a session appears to be actively running (based on recent activity).
|
|
182
|
+
* Considers a session "active" if it had activity within the last 60 seconds.
|
|
183
|
+
*/
|
|
184
|
+
declare function isSessionActive(session: Session$1): boolean;
|
|
185
|
+
|
|
97
186
|
/**
|
|
98
187
|
* Captures context about a selected DOM element for Claude.
|
|
99
188
|
* Uses multiple strategies to identify source location:
|
|
@@ -118,4 +207,72 @@ declare function captureElementScreenshot(element: HTMLElement, options?: {
|
|
|
118
207
|
maxHeight?: number;
|
|
119
208
|
}): Promise<string | undefined>;
|
|
120
209
|
|
|
121
|
-
|
|
210
|
+
interface VoiceInputProps {
|
|
211
|
+
onTranscript: (text: string) => void;
|
|
212
|
+
onListeningChange?: (isListening: boolean) => void;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
size?: 'small' | 'medium';
|
|
215
|
+
autoStart?: boolean;
|
|
216
|
+
}
|
|
217
|
+
declare function VoiceInput({ onTranscript, onListeningChange, disabled, size, autoStart, }: VoiceInputProps): react_jsx_runtime.JSX.Element | null;
|
|
218
|
+
|
|
219
|
+
interface SpeechRecognitionEvent extends Event {
|
|
220
|
+
results: SpeechRecognitionResultList;
|
|
221
|
+
resultIndex: number;
|
|
222
|
+
}
|
|
223
|
+
interface SpeechRecognitionResultList {
|
|
224
|
+
length: number;
|
|
225
|
+
item(index: number): SpeechRecognitionResult;
|
|
226
|
+
[index: number]: SpeechRecognitionResult;
|
|
227
|
+
}
|
|
228
|
+
interface SpeechRecognitionResult {
|
|
229
|
+
isFinal: boolean;
|
|
230
|
+
length: number;
|
|
231
|
+
item(index: number): SpeechRecognitionAlternative;
|
|
232
|
+
[index: number]: SpeechRecognitionAlternative;
|
|
233
|
+
}
|
|
234
|
+
interface SpeechRecognitionAlternative {
|
|
235
|
+
transcript: string;
|
|
236
|
+
confidence: number;
|
|
237
|
+
}
|
|
238
|
+
interface SpeechRecognitionErrorEvent extends Event {
|
|
239
|
+
error: string;
|
|
240
|
+
message?: string;
|
|
241
|
+
}
|
|
242
|
+
interface SpeechRecognition extends EventTarget {
|
|
243
|
+
continuous: boolean;
|
|
244
|
+
interimResults: boolean;
|
|
245
|
+
lang: string;
|
|
246
|
+
onresult: ((event: SpeechRecognitionEvent) => void) | null;
|
|
247
|
+
onerror: ((event: SpeechRecognitionErrorEvent) => void) | null;
|
|
248
|
+
onend: (() => void) | null;
|
|
249
|
+
onstart: (() => void) | null;
|
|
250
|
+
start(): void;
|
|
251
|
+
stop(): void;
|
|
252
|
+
abort(): void;
|
|
253
|
+
}
|
|
254
|
+
declare global {
|
|
255
|
+
interface Window {
|
|
256
|
+
SpeechRecognition?: new () => SpeechRecognition;
|
|
257
|
+
webkitSpeechRecognition?: new () => SpeechRecognition;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
interface UseVoiceInputOptions {
|
|
261
|
+
onTranscript?: (text: string, isFinal: boolean) => void;
|
|
262
|
+
onError?: (error: string) => void;
|
|
263
|
+
onStart?: () => void;
|
|
264
|
+
onEnd?: () => void;
|
|
265
|
+
language?: string;
|
|
266
|
+
}
|
|
267
|
+
interface UseVoiceInputReturn {
|
|
268
|
+
isListening: boolean;
|
|
269
|
+
isSupported: boolean;
|
|
270
|
+
transcript: string;
|
|
271
|
+
interimTranscript: string;
|
|
272
|
+
startListening: () => void;
|
|
273
|
+
stopListening: () => void;
|
|
274
|
+
error: string | null;
|
|
275
|
+
}
|
|
276
|
+
declare function useVoiceInput(options?: UseVoiceInputOptions): UseVoiceInputReturn;
|
|
277
|
+
|
|
278
|
+
export { type ClaudeBridgeConfig, type ClaudeBridgeContextValue, ClaudeBridgeProvider, type ClaudeBridgeState, ClaudeTerminal, type ClaudeTerminalProps, type PanelMode, SessionPanel, type SessionPanelProps, type SessionStorageData, SessionTabs, type SessionTabsProps, TaskStatusToast, type UseSessionsOptions, type UseSessionsReturn, type UseVoiceInputOptions, type UseVoiceInputReturn, VoiceInput, type VoiceInputProps, captureContext, captureElementScreenshot, capturePageContext, getSessionDisplayName, isSessionActive, useClaudeBridge, useSessionStorage, useSessions, useVoiceInput };
|