agent-tower 0.4.1 → 0.4.3
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/dist/routes/filesystem.js +1 -1
- package/dist/routes/filesystem.js.map +1 -1
- package/dist/web/assets/{AgentDemoPage-BWRAHFkt.js → AgentDemoPage-Bm-3uhK_.js} +1 -1
- package/dist/web/assets/{DemoPage-BZ5M1SAB.js → DemoPage-TFE2qMhV.js} +1 -1
- package/dist/web/assets/{GeneralSettingsPage-BaOOwCVS.js → GeneralSettingsPage-CyQmiUK1.js} +1 -1
- package/dist/web/assets/{NotificationSettingsPage-BN6EqfjU.js → NotificationSettingsPage-CLAjR_nJ.js} +1 -1
- package/dist/web/assets/{ProfileSettingsPage-CIP6uixV.js → ProfileSettingsPage-ApLKiykg.js} +1 -1
- package/dist/web/assets/{ProjectKanbanPage-CFUQT6JK.js → ProjectKanbanPage-B1aozA_7.js} +3 -3
- package/dist/web/assets/{ProjectSettingsPage-CfNoBWSi.js → ProjectSettingsPage-BZXMxNIw.js} +1 -1
- package/dist/web/assets/{ProviderSettingsPage-DwDw9zUR.js → ProviderSettingsPage-CfLduglc.js} +1 -1
- package/dist/web/assets/{button-D_HFYACB.js → button-2amePQEd.js} +1 -1
- package/dist/web/assets/{chevron-down-9WClAEn8.js → chevron-down-wgZs074C.js} +1 -1
- package/dist/web/assets/{chevron-right-BtN8Zto2.js → chevron-right-BCroanpY.js} +1 -1
- package/dist/web/assets/{circle-alert-HHdlJNqe.js → circle-alert-j-2yKJ-Z.js} +1 -1
- package/dist/web/assets/{circle-check-cTH6ieYz.js → circle-check-DS-_9pC8.js} +1 -1
- package/dist/web/assets/{code-block-OCS4YCEC-CZZdDA2x.js → code-block-OCS4YCEC-IB4-8hzU.js} +1 -1
- package/dist/web/assets/{confirm-dialog-CDJoysvO.js → confirm-dialog-BLWrfawu.js} +1 -1
- package/dist/web/assets/folder-picker-C9TegXbq.js +1 -0
- package/dist/web/assets/{index-D7K8KUJH.js → index-CLOtb2Es.js} +2 -2
- package/dist/web/assets/{loader-circle-lo-fmqx0.js → loader-circle-BRpu-4c2.js} +1 -1
- package/dist/web/assets/{mermaid-NOHMQCX5-CvKYIlPK.js → mermaid-NOHMQCX5-COZZkjo8.js} +3 -3
- package/dist/web/assets/{modal-CUBMvXmY.js → modal-D6rHuqas.js} +1 -1
- package/dist/web/assets/{pencil-DYpEk25M.js → pencil-iSjdfCcI.js} +1 -1
- package/dist/web/assets/{rotate-ccw-CzrmYvZT.js → rotate-ccw-u0yrABr3.js} +1 -1
- package/dist/web/assets/{select-DfuMoG1o.js → select-HYu8EZw-.js} +1 -1
- package/dist/web/assets/{use-profiles-Dne_0dqT.js → use-profiles-BhAhQrOF.js} +1 -1
- package/dist/web/assets/{use-providers-BU-lcRuU.js → use-providers-KlDj-ZVv.js} +1 -1
- package/dist/web/index.html +1 -1
- package/node_modules/@shitiandmw/node-pty/LICENSE +69 -0
- package/node_modules/@shitiandmw/node-pty/README.md +165 -0
- package/node_modules/@shitiandmw/node-pty/lib/conpty_console_list_agent.js +16 -0
- package/node_modules/@shitiandmw/node-pty/lib/conpty_console_list_agent.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/eventEmitter2.js +47 -0
- package/node_modules/@shitiandmw/node-pty/lib/eventEmitter2.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/eventEmitter2.test.js +30 -0
- package/node_modules/@shitiandmw/node-pty/lib/eventEmitter2.test.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/index.js +52 -0
- package/node_modules/@shitiandmw/node-pty/lib/index.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/interfaces.js +7 -0
- package/node_modules/@shitiandmw/node-pty/lib/interfaces.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/shared/conout.js +11 -0
- package/node_modules/@shitiandmw/node-pty/lib/shared/conout.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/terminal.js +190 -0
- package/node_modules/@shitiandmw/node-pty/lib/terminal.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/terminal.test.js +139 -0
- package/node_modules/@shitiandmw/node-pty/lib/terminal.test.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/testUtils.test.js +28 -0
- package/node_modules/@shitiandmw/node-pty/lib/testUtils.test.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/types.js +7 -0
- package/node_modules/@shitiandmw/node-pty/lib/types.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/unixTerminal.js +346 -0
- package/node_modules/@shitiandmw/node-pty/lib/unixTerminal.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/unixTerminal.test.js +351 -0
- package/node_modules/@shitiandmw/node-pty/lib/unixTerminal.test.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/utils.js +39 -0
- package/node_modules/@shitiandmw/node-pty/lib/utils.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsConoutConnection.js +125 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsConoutConnection.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsPtyAgent.js +320 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsPtyAgent.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsPtyAgent.test.js +90 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsPtyAgent.test.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsTerminal.js +199 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsTerminal.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsTerminal.test.js +219 -0
- package/node_modules/@shitiandmw/node-pty/lib/windowsTerminal.test.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/node_modules/@shitiandmw/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
- package/node_modules/@shitiandmw/node-pty/package.json +66 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/darwin-x64/pty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/linux-arm64/pty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/linux-x64/pty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-arm64/pty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-x64/pty.node +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
- package/node_modules/@shitiandmw/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
- package/node_modules/@shitiandmw/node-pty/scripts/gen-compile-commands.js +8 -0
- package/node_modules/@shitiandmw/node-pty/scripts/increment-version.js +54 -0
- package/node_modules/@shitiandmw/node-pty/scripts/post-install.js +80 -0
- package/node_modules/@shitiandmw/node-pty/scripts/prebuild.js +34 -0
- package/node_modules/@shitiandmw/node-pty/scripts/verify-darwin-fd-leak.js +68 -0
- package/node_modules/@shitiandmw/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
- package/node_modules/@shitiandmw/node-pty/third_party/conpty/1.23.251008001/win10-arm64/conpty.dll +0 -0
- package/node_modules/@shitiandmw/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
- package/node_modules/@shitiandmw/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
- package/node_modules/@shitiandmw/node-pty/typings/node-pty.d.ts +215 -0
- package/package.json +2 -1
- package/dist/web/assets/folder-picker-N8GypL3a.js +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017, Daniel Imms (MIT License).
|
|
3
|
+
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
declare module 'node-pty' {
|
|
7
|
+
/**
|
|
8
|
+
* Forks a process as a pseudoterminal.
|
|
9
|
+
* @param file The file to launch.
|
|
10
|
+
* @param args The file's arguments as argv (string[]) or in a pre-escaped CommandLine format
|
|
11
|
+
* (string). Note that the CommandLine option is only available on Windows and is expected to be
|
|
12
|
+
* escaped properly.
|
|
13
|
+
* @param options The options of the terminal.
|
|
14
|
+
* @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
|
|
15
|
+
* @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
|
|
16
|
+
* @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
|
|
17
|
+
*/
|
|
18
|
+
export function spawn(file: string, args: string[] | string, options: IPtyForkOptions | IWindowsPtyForkOptions): IPty;
|
|
19
|
+
|
|
20
|
+
export interface IBasePtyForkOptions {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Name of the terminal to be set in environment ($TERM variable).
|
|
24
|
+
*/
|
|
25
|
+
name?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Number of intial cols of the pty.
|
|
29
|
+
*/
|
|
30
|
+
cols?: number;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Number of initial rows of the pty.
|
|
34
|
+
*/
|
|
35
|
+
rows?: number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Working directory to be set for the child program.
|
|
39
|
+
*/
|
|
40
|
+
cwd?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Environment to be set for the child program.
|
|
44
|
+
*/
|
|
45
|
+
env?: { [key: string]: string | undefined };
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* String encoding of the underlying pty.
|
|
49
|
+
* If set, incoming data will be decoded to strings and outgoing strings to bytes applying this encoding.
|
|
50
|
+
* If unset, incoming data will be delivered as raw bytes (Buffer type).
|
|
51
|
+
* By default 'utf8' is assumed, to unset it explicitly set it to `null`.
|
|
52
|
+
*/
|
|
53
|
+
encoding?: string | null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* (EXPERIMENTAL)
|
|
57
|
+
* Whether to enable flow control handling (false by default). If enabled a message of `flowControlPause`
|
|
58
|
+
* will pause the socket and thus blocking the child program execution due to buffer back pressure.
|
|
59
|
+
* A message of `flowControlResume` will resume the socket into flow mode.
|
|
60
|
+
* For performance reasons only a single message as a whole will match (no message part matching).
|
|
61
|
+
* If flow control is enabled the `flowControlPause` and `flowControlResume` messages are not forwarded to
|
|
62
|
+
* the underlying pseudoterminal.
|
|
63
|
+
*/
|
|
64
|
+
handleFlowControl?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* (EXPERIMENTAL)
|
|
68
|
+
* The string that should pause the pty when `handleFlowControl` is true. Default is XOFF ('\x13').
|
|
69
|
+
*/
|
|
70
|
+
flowControlPause?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* (EXPERIMENTAL)
|
|
74
|
+
* The string that should resume the pty when `handleFlowControl` is true. Default is XON ('\x11').
|
|
75
|
+
*/
|
|
76
|
+
flowControlResume?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface IPtyForkOptions extends IBasePtyForkOptions {
|
|
80
|
+
/**
|
|
81
|
+
* Security warning: use this option with great caution,
|
|
82
|
+
* as opened file descriptors with higher privileges might leak to the child program.
|
|
83
|
+
*/
|
|
84
|
+
uid?: number;
|
|
85
|
+
gid?: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
|
|
89
|
+
/**
|
|
90
|
+
* Whether to use the ConPTY system on Windows. When this is not set, ConPTY will be used when
|
|
91
|
+
* the Windows build number is >= 18309 (instead of winpty). Note that ConPTY is available from
|
|
92
|
+
* build 17134 but is too unstable to enable by default.
|
|
93
|
+
*
|
|
94
|
+
* This setting does nothing on non-Windows.
|
|
95
|
+
*/
|
|
96
|
+
useConpty?: boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* (EXPERIMENTAL)
|
|
100
|
+
*
|
|
101
|
+
* Whether to use the conpty.dll shipped with the node-pty package instead of the one built into
|
|
102
|
+
* Windows. Defaults to false.
|
|
103
|
+
*/
|
|
104
|
+
useConptyDll?: boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Whether to use PSEUDOCONSOLE_INHERIT_CURSOR in conpty.
|
|
108
|
+
* @see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole
|
|
109
|
+
*/
|
|
110
|
+
conptyInheritCursor?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* An interface representing a pseudoterminal, on Windows this is emulated via the winpty library.
|
|
115
|
+
*/
|
|
116
|
+
export interface IPty {
|
|
117
|
+
/**
|
|
118
|
+
* The process ID of the outer process.
|
|
119
|
+
*/
|
|
120
|
+
readonly pid: number;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The column size in characters.
|
|
124
|
+
*/
|
|
125
|
+
readonly cols: number;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The row size in characters.
|
|
129
|
+
*/
|
|
130
|
+
readonly rows: number;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The title of the active process.
|
|
134
|
+
*/
|
|
135
|
+
readonly process: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* (EXPERIMENTAL)
|
|
139
|
+
* Whether to handle flow control. Useful to disable/re-enable flow control during runtime.
|
|
140
|
+
* Use this for binary data that is likely to contain the `flowControlPause` string by accident.
|
|
141
|
+
*/
|
|
142
|
+
handleFlowControl: boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Adds an event listener for when a data event fires. This happens when data is returned from
|
|
146
|
+
* the pty.
|
|
147
|
+
* @returns an `IDisposable` to stop listening.
|
|
148
|
+
*/
|
|
149
|
+
readonly onData: IEvent<string>;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Adds an event listener for when an exit event fires. This happens when the pty exits.
|
|
153
|
+
* @returns an `IDisposable` to stop listening.
|
|
154
|
+
*/
|
|
155
|
+
readonly onExit: IEvent<{ exitCode: number, signal?: number }>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Resizes the dimensions of the pty.
|
|
159
|
+
* @param columns The number of columns to use.
|
|
160
|
+
* @param rows The number of rows to use.
|
|
161
|
+
*/
|
|
162
|
+
resize(columns: number, rows: number): void;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Clears the pty's internal representation of its buffer. This is a no-op
|
|
166
|
+
* unless on Windows/ConPTY. This is useful if the buffer is cleared on the
|
|
167
|
+
* frontend in order to synchronize state with the backend to avoid ConPTY
|
|
168
|
+
* possibly reprinting the screen.
|
|
169
|
+
*/
|
|
170
|
+
clear(): void;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Writes data to the pty.
|
|
174
|
+
* @param data The data to write.
|
|
175
|
+
*/
|
|
176
|
+
write(data: string | Buffer): void;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Kills the pty.
|
|
180
|
+
* @param signal The signal to use, defaults to SIGHUP. This parameter is not supported on
|
|
181
|
+
* Windows.
|
|
182
|
+
* @throws Will throw when signal is used on Windows.
|
|
183
|
+
*/
|
|
184
|
+
kill(signal?: string): void;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Pauses the pty for customizable flow control.
|
|
188
|
+
*/
|
|
189
|
+
pause(): void;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Resumes the pty for customizable flow control.
|
|
193
|
+
*/
|
|
194
|
+
resume(): void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* An object that can be disposed via a dispose function.
|
|
199
|
+
*/
|
|
200
|
+
export interface IDisposable {
|
|
201
|
+
dispose(): void;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* An event that can be listened to.
|
|
206
|
+
* @returns an `IDisposable` to stop listening.
|
|
207
|
+
*/
|
|
208
|
+
export interface IEvent<T> {
|
|
209
|
+
(listener: (e: T) => any): IDisposable;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare module '@shitiandmw/node-pty' {
|
|
214
|
+
export * from 'node-pty';
|
|
215
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-tower",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "AI Agent Task Management Dashboard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@fastify/static": "^7.0.4",
|
|
30
30
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
31
31
|
"@prisma/client": "^5.9.1",
|
|
32
|
+
"@shitiandmw/node-pty": "1.1.0-shitiandmw.2",
|
|
32
33
|
"cloudflared": "^0.7.1",
|
|
33
34
|
"fast-json-patch": "^3.1.1",
|
|
34
35
|
"fastify": "^4.26.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as A,r as a,g as k,j as e,F as C}from"./index-D7K8KUJH.js";import{c}from"./utils-CkSf8FUe.js";import{C as w}from"./chevron-right-BtN8Zto2.js";import{L as E}from"./loader-circle-lo-fmqx0.js";import{C as z}from"./circle-alert-HHdlJNqe.js";import{F as S}from"./rotate-ccw-CzrmYvZT.js";function Q({value:l,onChange:m,placeholder:G}){const{t:D}=A(),[x,R]=a.useState(""),[p,V]=a.useState([]),[h,F]=a.useState(""),[L,f]=a.useState(!1),[j,g]=a.useState(null),[d,N]=a.useState(l),[b,n]=a.useState(null),[P,v]=a.useState(!1),y=a.useRef(!1);a.useEffect(()=>{N(l)},[l]);const r=a.useCallback(async t=>{f(!0),g(null);try{const s={};t&&(s.path=t);const u=await k.get("/filesystem/browse",{params:s});R(u.current),F(u.parent),V(u.dirs)}catch(s){g(s instanceof Error?s.message:"Failed to browse directory")}finally{f(!1)}},[]);a.useEffect(()=>{y.current||(y.current=!0,r())},[r]);const i=a.useCallback(async t=>{v(!0),n(null);try{const s=await k.get("/filesystem/validate",{params:{path:t}});s.valid?(m(t),n(null)):n(s.error??"Not a Git repository")}catch(s){n(s instanceof Error?s.message:"Validation failed")}finally{v(!1)}},[m]),I=a.useCallback(t=>{t.isGitRepo?(i(t.path),r(t.path)):(r(t.path),n(null))},[i,r]),o=x?x.split("/").filter(Boolean):[],B=a.useCallback(t=>{const s="/"+o.slice(0,t+1).join("/");r(s),n(null)},[o,r]),K=a.useCallback(t=>{if(t.key==="Enter"&&!t.nativeEvent.isComposing&&t.nativeEvent.keyCode!==229){t.preventDefault();const s=d.trim();s&&(r(s),i(s))}},[d,r,i]);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:d,onChange:t=>N(t.target.value),onKeyDown:K,placeholder:G??"e.g., /Users/me/projects/my-repo",className:c("w-full px-3 py-2 border rounded-lg text-sm font-mono focus:outline-none transition-colors pr-8",l?"border-emerald-300 bg-emerald-50/50 focus:border-emerald-400":"border-neutral-200 focus:border-neutral-400")}),l&&e.jsx(C,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-emerald-500"})]}),e.jsx("p",{className:"text-xs text-neutral-400",children:D("Browse and select a Git repository, or type a path and press Enter")}),e.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-neutral-500 overflow-x-auto pb-1 scrollbar-none",children:[e.jsx("button",{onClick:()=>r("/"),className:"hover:text-neutral-900 transition-colors flex-shrink-0 px-1 py-0.5 rounded hover:bg-neutral-100",children:"/"}),o.map((t,s)=>e.jsxs("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:[e.jsx(w,{size:10,className:"text-neutral-300"}),e.jsx("button",{onClick:()=>B(s),className:c("px-1 py-0.5 rounded transition-colors truncate max-w-[120px]",s===o.length-1?"font-medium text-neutral-900":"hover:text-neutral-900 hover:bg-neutral-100"),children:t})]},s))]}),e.jsx("div",{className:"border border-neutral-200 rounded-lg overflow-hidden",children:e.jsx("div",{className:"max-h-[200px] overflow-y-auto",children:L?e.jsxs("div",{className:"flex items-center justify-center py-8 text-neutral-400",children:[e.jsx(E,{size:16,className:"animate-spin mr-2"}),e.jsx("span",{className:"text-xs",children:"Loading..."})]}):j?e.jsxs("div",{className:"flex items-center justify-center py-8 text-red-500 gap-2",children:[e.jsx(z,{size:14}),e.jsx("span",{className:"text-xs",children:j})]}):p.length===0?e.jsx("div",{className:"flex items-center justify-center py-8 text-neutral-400",children:e.jsx("span",{className:"text-xs",children:"No subdirectories"})}):e.jsxs("ul",{className:"divide-y divide-neutral-100",children:[x!==h&&e.jsx("li",{children:e.jsxs("button",{onClick:()=>r(h),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:bg-neutral-50 transition-colors group",children:[e.jsx(S,{size:14,className:"text-neutral-400 flex-shrink-0"}),e.jsx("span",{className:"text-xs text-neutral-500 group-hover:text-neutral-700",children:".."})]})}),p.map(t=>e.jsx("li",{children:e.jsxs("button",{onClick:()=>I(t),className:c("w-full flex items-center gap-2.5 px-3 py-2 text-left transition-colors group",t.path===l?"bg-emerald-50":"hover:bg-neutral-50"),children:[t.isGitRepo?e.jsx(C,{size:14,className:"text-emerald-500 flex-shrink-0"}):e.jsx(S,{size:14,className:"text-neutral-400 flex-shrink-0"}),e.jsx("span",{className:c("text-xs truncate",t.path===l?"font-medium text-emerald-700":"text-neutral-700 group-hover:text-neutral-900"),children:t.name}),t.isGitRepo&&e.jsx("span",{className:"ml-auto flex-shrink-0 text-[10px] font-medium bg-emerald-100 text-emerald-600 px-1.5 py-0.5 rounded",children:"Git"}),!t.isGitRepo&&e.jsx(w,{size:12,className:"ml-auto text-neutral-300 group-hover:text-neutral-400 flex-shrink-0"})]})},t.path))]})})}),P&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[e.jsx(E,{size:12,className:"animate-spin"}),e.jsx("span",{children:"Validating..."})]}),b&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-red-500",children:[e.jsx(z,{size:12}),e.jsx("span",{children:b})]})]})}export{Q as FolderPicker};
|