groove-dev 0.27.73 → 0.27.74

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.
@@ -14,7 +14,7 @@ import { api } from '../lib/api';
14
14
  import { cn } from '../lib/cn';
15
15
  import { fmtUptime } from '../lib/format';
16
16
  import {
17
- Key, Eye, EyeOff, Check, Cpu, Download, Loader2,
17
+ Key, Eye, EyeOff, Check, Cpu, Download, Loader2, RefreshCw, Terminal, Copy,
18
18
  FolderOpen, FolderSearch, Users, Gauge, ChevronRight,
19
19
  ShieldCheck, Settings, Lock,
20
20
  Newspaper, Radio, Send, MessageSquare, MessageCircle,
@@ -62,6 +62,9 @@ function ProviderCard({ provider, onKeyChange }) {
62
62
  const installProgress = useGrooveStore((s) => s.providerInstallProgress[provider.id]);
63
63
  const loginProvider = useGrooveStore((s) => s.loginProvider);
64
64
  const setProviderPath = useGrooveStore((s) => s.setProviderPath);
65
+ const verifyProvider = useGrooveStore((s) => s.verifyProvider);
66
+ const installProvider = useGrooveStore((s) => s.installProvider);
67
+ const [checking, setChecking] = useState(false);
65
68
 
66
69
  const isLocal = provider.authType === 'local';
67
70
  const isSubscription = provider.authType === 'subscription';
@@ -221,20 +224,87 @@ function ProviderCard({ provider, onKeyChange }) {
221
224
  </div>
222
225
  )}
223
226
 
224
- {/* Not installed — prominent Install button */}
227
+ {/* Not installed */}
225
228
  {!provider.installed && !isInstalling && !settingKey && (
226
- <div className="flex flex-col items-center justify-center flex-1 gap-3 py-2">
227
- <p className="text-xs text-text-3 font-sans text-center">
228
- {provider.name} is not installed on this machine.
229
- </p>
229
+ <div className="flex flex-col gap-2.5 flex-1">
230
+ {/* Install error from last attempt */}
231
+ {installProgress?.error && (
232
+ <div className="p-2.5 bg-danger/5 border border-danger/15 rounded-md">
233
+ <p className="text-2xs text-danger font-sans break-all">{installProgress.error}</p>
234
+ </div>
235
+ )}
236
+
237
+ {/* Auto-install button */}
230
238
  <Button
231
239
  variant="primary"
232
240
  size="sm"
233
- onClick={() => openWizard(0)}
234
- className="h-8 px-4 text-xs gap-1.5"
241
+ onClick={() => installProvider(provider.id).catch(() => {})}
242
+ className="w-full h-8 text-2xs gap-1.5"
235
243
  >
236
- <Download size={12} /> Install {provider.name}
244
+ <Download size={11} /> Install {provider.name}
237
245
  </Button>
246
+
247
+ {/* Manual install command */}
248
+ {provider.installCommand && (
249
+ <div className="space-y-1">
250
+ <p className="text-2xs text-text-4 font-sans">Or install manually in your terminal:</p>
251
+ <div className="flex items-center gap-1">
252
+ <code className="flex-1 px-2 py-1.5 bg-surface-0 border border-border-subtle rounded text-2xs font-mono text-text-2 select-all">
253
+ {provider.installCommand}
254
+ </code>
255
+ <button
256
+ onClick={() => { navigator.clipboard.writeText(provider.installCommand); addToast('success', 'Copied'); }}
257
+ className="p-1.5 text-text-4 hover:text-text-2 cursor-pointer"
258
+ >
259
+ <Copy size={10} />
260
+ </button>
261
+ </div>
262
+ </div>
263
+ )}
264
+
265
+ {/* Re-check + custom path */}
266
+ <div className="flex items-center gap-2 pt-1">
267
+ <Button
268
+ variant="ghost"
269
+ size="sm"
270
+ onClick={async () => {
271
+ setChecking(true);
272
+ try {
273
+ await verifyProvider(provider.id);
274
+ if (onKeyChange) onKeyChange();
275
+ } catch { /* handled in store */ }
276
+ setChecking(false);
277
+ }}
278
+ disabled={checking}
279
+ className="h-7 text-2xs gap-1 px-2"
280
+ >
281
+ <RefreshCw size={10} className={checking ? 'animate-spin' : ''} /> Re-check
282
+ </Button>
283
+ <button
284
+ onClick={() => setCustomPathOpen(!customPathOpen)}
285
+ className="text-2xs text-text-4 hover:text-accent cursor-pointer font-sans"
286
+ >
287
+ Set custom path
288
+ </button>
289
+ </div>
290
+
291
+ {/* Custom path input (shown for not-installed too) */}
292
+ {customPathOpen && (
293
+ <div className="space-y-2">
294
+ <div className="flex gap-2">
295
+ <input
296
+ value={customPath}
297
+ onChange={(e) => setCustomPath(e.target.value)}
298
+ onKeyDown={(e) => e.key === 'Enter' && handleSavePath()}
299
+ placeholder={`/path/to/${provider.id}`}
300
+ className="flex-1 h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"
301
+ />
302
+ <Button variant="primary" size="sm" onClick={handleSavePath} disabled={!customPath.trim() || savingPath} className="h-7 text-2xs px-2.5">
303
+ {savingPath ? '...' : 'Save'}
304
+ </Button>
305
+ </div>
306
+ </div>
307
+ )}
238
308
  </div>
239
309
  )}
240
310