@industry-theme/github-panels 0.1.9 → 0.1.11

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.
@@ -320,20 +320,48 @@ const createLucideIcon = (iconName, iconNode) => {
320
320
  * This source code is licensed under the ISC license.
321
321
  * See the LICENSE file in the root directory of this source tree.
322
322
  */
323
- const __iconNode$f = [
323
+ const __iconNode$o = [
324
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
325
+ ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
326
+ ];
327
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$o);
328
+ /**
329
+ * @license lucide-react v0.552.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */
334
+ const __iconNode$n = [
324
335
  ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
325
336
  ["path", { d: "M17 20V4", key: "1ejh1v" }],
326
337
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
327
338
  ["path", { d: "M7 4v16", key: "1glfcx" }]
328
339
  ];
329
- const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$f);
340
+ const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$n);
330
341
  /**
331
342
  * @license lucide-react v0.552.0 - ISC
332
343
  *
333
344
  * This source code is licensed under the ISC license.
334
345
  * See the LICENSE file in the root directory of this source tree.
335
346
  */
336
- const __iconNode$e = [
347
+ const __iconNode$m = [
348
+ ["path", { d: "M12 7v14", key: "1akyts" }],
349
+ [
350
+ "path",
351
+ {
352
+ d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
353
+ key: "ruj8y"
354
+ }
355
+ ]
356
+ ];
357
+ const BookOpen = createLucideIcon("book-open", __iconNode$m);
358
+ /**
359
+ * @license lucide-react v0.552.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */
364
+ const __iconNode$l = [
337
365
  ["path", { d: "M10 12h4", key: "a56b0p" }],
338
366
  ["path", { d: "M10 8h4", key: "1sr2af" }],
339
367
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -346,55 +374,55 @@ const __iconNode$e = [
346
374
  ],
347
375
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
348
376
  ];
349
- const Building2 = createLucideIcon("building-2", __iconNode$e);
377
+ const Building2 = createLucideIcon("building-2", __iconNode$l);
350
378
  /**
351
379
  * @license lucide-react v0.552.0 - ISC
352
380
  *
353
381
  * This source code is licensed under the ISC license.
354
382
  * See the LICENSE file in the root directory of this source tree.
355
383
  */
356
- const __iconNode$d = [
384
+ const __iconNode$k = [
357
385
  ["path", { d: "M8 2v4", key: "1cmpym" }],
358
386
  ["path", { d: "M16 2v4", key: "4m81vk" }],
359
387
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
360
388
  ["path", { d: "M3 10h18", key: "8toen8" }]
361
389
  ];
362
- const Calendar = createLucideIcon("calendar", __iconNode$d);
390
+ const Calendar = createLucideIcon("calendar", __iconNode$k);
363
391
  /**
364
392
  * @license lucide-react v0.552.0 - ISC
365
393
  *
366
394
  * This source code is licensed under the ISC license.
367
395
  * See the LICENSE file in the root directory of this source tree.
368
396
  */
369
- const __iconNode$c = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
370
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$c);
397
+ const __iconNode$j = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
398
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$j);
371
399
  /**
372
400
  * @license lucide-react v0.552.0 - ISC
373
401
  *
374
402
  * This source code is licensed under the ISC license.
375
403
  * See the LICENSE file in the root directory of this source tree.
376
404
  */
377
- const __iconNode$b = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
378
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$b);
405
+ const __iconNode$i = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
406
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$i);
379
407
  /**
380
408
  * @license lucide-react v0.552.0 - ISC
381
409
  *
382
410
  * This source code is licensed under the ISC license.
383
411
  * See the LICENSE file in the root directory of this source tree.
384
412
  */
385
- const __iconNode$a = [
413
+ const __iconNode$h = [
386
414
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
387
415
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
388
416
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
389
417
  ];
390
- const ExternalLink = createLucideIcon("external-link", __iconNode$a);
418
+ const ExternalLink = createLucideIcon("external-link", __iconNode$h);
391
419
  /**
392
420
  * @license lucide-react v0.552.0 - ISC
393
421
  *
394
422
  * This source code is licensed under the ISC license.
395
423
  * See the LICENSE file in the root directory of this source tree.
396
424
  */
397
- const __iconNode$9 = [
425
+ const __iconNode$g = [
398
426
  [
399
427
  "path",
400
428
  {
@@ -403,14 +431,14 @@ const __iconNode$9 = [
403
431
  }
404
432
  ]
405
433
  ];
406
- const Folder = createLucideIcon("folder", __iconNode$9);
434
+ const Folder = createLucideIcon("folder", __iconNode$g);
407
435
  /**
408
436
  * @license lucide-react v0.552.0 - ISC
409
437
  *
410
438
  * This source code is licensed under the ISC license.
411
439
  * See the LICENSE file in the root directory of this source tree.
412
440
  */
413
- const __iconNode$8 = [
441
+ const __iconNode$f = [
414
442
  [
415
443
  "path",
416
444
  {
@@ -419,28 +447,41 @@ const __iconNode$8 = [
419
447
  }
420
448
  ]
421
449
  ];
422
- const Funnel = createLucideIcon("funnel", __iconNode$8);
450
+ const Funnel = createLucideIcon("funnel", __iconNode$f);
423
451
  /**
424
452
  * @license lucide-react v0.552.0 - ISC
425
453
  *
426
454
  * This source code is licensed under the ISC license.
427
455
  * See the LICENSE file in the root directory of this source tree.
428
456
  */
429
- const __iconNode$7 = [
457
+ const __iconNode$e = [
458
+ ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
459
+ ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
460
+ ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
461
+ ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
462
+ ];
463
+ const GitBranch = createLucideIcon("git-branch", __iconNode$e);
464
+ /**
465
+ * @license lucide-react v0.552.0 - ISC
466
+ *
467
+ * This source code is licensed under the ISC license.
468
+ * See the LICENSE file in the root directory of this source tree.
469
+ */
470
+ const __iconNode$d = [
430
471
  ["circle", { cx: "12", cy: "18", r: "3", key: "1mpf1b" }],
431
472
  ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
432
473
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
433
474
  ["path", { d: "M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9", key: "1uq4wg" }],
434
475
  ["path", { d: "M12 12v3", key: "158kv8" }]
435
476
  ];
436
- const GitFork = createLucideIcon("git-fork", __iconNode$7);
477
+ const GitFork = createLucideIcon("git-fork", __iconNode$d);
437
478
  /**
438
479
  * @license lucide-react v0.552.0 - ISC
439
480
  *
440
481
  * This source code is licensed under the ISC license.
441
482
  * See the LICENSE file in the root directory of this source tree.
442
483
  */
443
- const __iconNode$6 = [
484
+ const __iconNode$c = [
444
485
  [
445
486
  "path",
446
487
  {
@@ -450,61 +491,122 @@ const __iconNode$6 = [
450
491
  ],
451
492
  ["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
452
493
  ];
453
- const Github = createLucideIcon("github", __iconNode$6);
494
+ const Github = createLucideIcon("github", __iconNode$c);
454
495
  /**
455
496
  * @license lucide-react v0.552.0 - ISC
456
497
  *
457
498
  * This source code is licensed under the ISC license.
458
499
  * See the LICENSE file in the root directory of this source tree.
459
500
  */
460
- const __iconNode$5 = [
501
+ const __iconNode$b = [
502
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
503
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
504
+ ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
505
+ ];
506
+ const History = createLucideIcon("history", __iconNode$b);
507
+ /**
508
+ * @license lucide-react v0.552.0 - ISC
509
+ *
510
+ * This source code is licensed under the ISC license.
511
+ * See the LICENSE file in the root directory of this source tree.
512
+ */
513
+ const __iconNode$a = [
461
514
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
462
515
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
463
516
  ];
464
- const Lock = createLucideIcon("lock", __iconNode$5);
517
+ const Lock = createLucideIcon("lock", __iconNode$a);
465
518
  /**
466
519
  * @license lucide-react v0.552.0 - ISC
467
520
  *
468
521
  * This source code is licensed under the ISC license.
469
522
  * See the LICENSE file in the root directory of this source tree.
470
523
  */
471
- const __iconNode$4 = [
524
+ const __iconNode$9 = [
472
525
  ["path", { d: "m10 17 5-5-5-5", key: "1bsop3" }],
473
526
  ["path", { d: "M15 12H3", key: "6jk70r" }],
474
527
  ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }]
475
528
  ];
476
- const LogIn = createLucideIcon("log-in", __iconNode$4);
529
+ const LogIn = createLucideIcon("log-in", __iconNode$9);
477
530
  /**
478
531
  * @license lucide-react v0.552.0 - ISC
479
532
  *
480
533
  * This source code is licensed under the ISC license.
481
534
  * See the LICENSE file in the root directory of this source tree.
482
535
  */
483
- const __iconNode$3 = [
536
+ const __iconNode$8 = [
537
+ [
538
+ "path",
539
+ {
540
+ d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
541
+ key: "18887p"
542
+ }
543
+ ]
544
+ ];
545
+ const MessageSquare = createLucideIcon("message-square", __iconNode$8);
546
+ /**
547
+ * @license lucide-react v0.552.0 - ISC
548
+ *
549
+ * This source code is licensed under the ISC license.
550
+ * See the LICENSE file in the root directory of this source tree.
551
+ */
552
+ const __iconNode$7 = [
553
+ ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
554
+ ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
555
+ ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
556
+ ["path", { d: "M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3", key: "1jsf9p" }],
557
+ ["path", { d: "M12 12V8", key: "2874zd" }]
558
+ ];
559
+ const Network = createLucideIcon("network", __iconNode$7);
560
+ /**
561
+ * @license lucide-react v0.552.0 - ISC
562
+ *
563
+ * This source code is licensed under the ISC license.
564
+ * See the LICENSE file in the root directory of this source tree.
565
+ */
566
+ const __iconNode$6 = [
484
567
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
485
568
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
486
569
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
487
570
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
488
571
  ];
489
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$3);
572
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$6);
490
573
  /**
491
574
  * @license lucide-react v0.552.0 - ISC
492
575
  *
493
576
  * This source code is licensed under the ISC license.
494
577
  * See the LICENSE file in the root directory of this source tree.
495
578
  */
496
- const __iconNode$2 = [
579
+ const __iconNode$5 = [
497
580
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
498
581
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
499
582
  ];
500
- const Search = createLucideIcon("search", __iconNode$2);
583
+ const Search = createLucideIcon("search", __iconNode$5);
501
584
  /**
502
585
  * @license lucide-react v0.552.0 - ISC
503
586
  *
504
587
  * This source code is licensed under the ISC license.
505
588
  * See the LICENSE file in the root directory of this source tree.
506
589
  */
507
- const __iconNode$1 = [
590
+ const __iconNode$4 = [
591
+ [
592
+ "path",
593
+ {
594
+ d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",
595
+ key: "1s2grr"
596
+ }
597
+ ],
598
+ ["path", { d: "M20 2v4", key: "1rf3ol" }],
599
+ ["path", { d: "M22 4h-4", key: "gwowj6" }],
600
+ ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }]
601
+ ];
602
+ const Sparkles = createLucideIcon("sparkles", __iconNode$4);
603
+ /**
604
+ * @license lucide-react v0.552.0 - ISC
605
+ *
606
+ * This source code is licensed under the ISC license.
607
+ * See the LICENSE file in the root directory of this source tree.
608
+ */
609
+ const __iconNode$3 = [
508
610
  [
509
611
  "path",
510
612
  {
@@ -513,18 +615,43 @@ const __iconNode$1 = [
513
615
  }
514
616
  ]
515
617
  ];
516
- const Star = createLucideIcon("star", __iconNode$1);
618
+ const Star = createLucideIcon("star", __iconNode$3);
517
619
  /**
518
620
  * @license lucide-react v0.552.0 - ISC
519
621
  *
520
622
  * This source code is licensed under the ISC license.
521
623
  * See the LICENSE file in the root directory of this source tree.
522
624
  */
523
- const __iconNode = [
625
+ const __iconNode$2 = [
626
+ ["path", { d: "M10 11v6", key: "nco0om" }],
627
+ ["path", { d: "M14 11v6", key: "outv1u" }],
628
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
629
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
630
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
631
+ ];
632
+ const Trash2 = createLucideIcon("trash-2", __iconNode$2);
633
+ /**
634
+ * @license lucide-react v0.552.0 - ISC
635
+ *
636
+ * This source code is licensed under the ISC license.
637
+ * See the LICENSE file in the root directory of this source tree.
638
+ */
639
+ const __iconNode$1 = [
524
640
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
525
641
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
526
642
  ];
527
- const User = createLucideIcon("user", __iconNode);
643
+ const User = createLucideIcon("user", __iconNode$1);
644
+ /**
645
+ * @license lucide-react v0.552.0 - ISC
646
+ *
647
+ * This source code is licensed under the ISC license.
648
+ * See the LICENSE file in the root directory of this source tree.
649
+ */
650
+ const __iconNode = [
651
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
652
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
653
+ ];
654
+ const X = createLucideIcon("x", __iconNode);
528
655
  function getLanguageColor(language) {
529
656
  const colors = {
530
657
  TypeScript: "#3178c6",
@@ -2221,119 +2348,1435 @@ const OwnerRepositoriesPanelMetadata = {
2221
2348
  slices: [],
2222
2349
  surfaces: ["panel"]
2223
2350
  };
2224
- const listRepositoriesTool = {
2225
- name: "list_repositories",
2226
- description: "Get a list of GitHub repositories the user has access to, including owned repos, starred repos, and organization repos.",
2227
- inputs: {
2228
- type: "object",
2229
- properties: {},
2230
- required: []
2231
- },
2232
- outputs: {
2233
- type: "object",
2234
- properties: {
2235
- success: { type: "boolean" }
2351
+ const STORAGE_KEY = "recent-repositories";
2352
+ const OWNERS_STORAGE_KEY = "recent-owners";
2353
+ const MAX_RECENT_ITEMS = 50;
2354
+ function loadRecentRepositories() {
2355
+ try {
2356
+ const stored = localStorage.getItem(STORAGE_KEY);
2357
+ if (stored) {
2358
+ const items = JSON.parse(stored);
2359
+ return items.map((item) => ({ ...item, type: "repository" }));
2236
2360
  }
2237
- },
2238
- tags: ["github", "repository", "list", "browse"],
2239
- tool_call_template: {
2240
- call_template_type: "panel_event",
2241
- event_type: "github:list-repositories"
2361
+ } catch (err) {
2362
+ console.error("Failed to load recent repositories:", err);
2242
2363
  }
2243
- };
2244
- const selectRepositoryTool = {
2245
- name: "select_repository",
2246
- description: 'Select a GitHub repository to view its details, README, and files. Use the full repository name in "owner/repo" format.',
2247
- inputs: {
2248
- type: "object",
2249
- properties: {
2250
- repository: {
2251
- type: "string",
2252
- description: 'The full repository name in "owner/repo" format (e.g., "facebook/react")'
2253
- }
2254
- },
2255
- required: ["repository"]
2256
- },
2257
- outputs: {
2258
- type: "object",
2259
- properties: {
2260
- success: { type: "boolean" },
2261
- repository: { type: "string" }
2364
+ return [];
2365
+ }
2366
+ function loadRecentOwners() {
2367
+ try {
2368
+ const stored = localStorage.getItem(OWNERS_STORAGE_KEY);
2369
+ if (stored) {
2370
+ return JSON.parse(stored);
2262
2371
  }
2263
- },
2264
- tags: ["github", "repository", "select", "navigate"],
2265
- tool_call_template: {
2266
- call_template_type: "panel_event",
2267
- event_type: "repository:selected"
2372
+ } catch (err) {
2373
+ console.error("Failed to load recent owners:", err);
2268
2374
  }
2269
- };
2270
- const previewRepositoryTool = {
2271
- name: "preview_repository",
2272
- description: "Preview a GitHub repository's README in the viewer without navigating to it.",
2273
- inputs: {
2274
- type: "object",
2275
- properties: {
2276
- repository: {
2277
- type: "string",
2278
- description: 'The full repository name in "owner/repo" format (e.g., "facebook/react")'
2279
- }
2280
- },
2281
- required: ["repository"]
2282
- },
2283
- outputs: {
2284
- type: "object",
2285
- properties: {
2286
- success: { type: "boolean" }
2287
- }
2288
- },
2289
- tags: ["github", "repository", "preview", "readme"],
2290
- tool_call_template: {
2291
- call_template_type: "panel_event",
2292
- event_type: "repository:preview"
2375
+ return [];
2376
+ }
2377
+ function saveRecentRepositories(repos) {
2378
+ try {
2379
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(repos));
2380
+ } catch (err) {
2381
+ console.error("Failed to save recent repositories:", err);
2293
2382
  }
2294
- };
2295
- const searchRepositoriesTool = {
2296
- name: "search_repositories",
2297
- description: "Search through the user's GitHub repositories by name, description, or language.",
2298
- inputs: {
2299
- type: "object",
2300
- properties: {
2301
- query: {
2302
- type: "string",
2303
- description: "The search query to filter repositories"
2304
- }
2383
+ }
2384
+ function saveRecentOwners(owners) {
2385
+ try {
2386
+ localStorage.setItem(OWNERS_STORAGE_KEY, JSON.stringify(owners));
2387
+ } catch (err) {
2388
+ console.error("Failed to save recent owners:", err);
2389
+ }
2390
+ }
2391
+ function addRecentRepository(repo) {
2392
+ const recent = loadRecentRepositories();
2393
+ const filtered = recent.filter((r) => r.id !== repo.id);
2394
+ const newEntry = {
2395
+ type: "repository",
2396
+ id: repo.id,
2397
+ name: repo.name,
2398
+ full_name: repo.full_name,
2399
+ owner: {
2400
+ login: repo.owner.login,
2401
+ avatar_url: repo.owner.avatar_url
2305
2402
  },
2306
- required: ["query"]
2307
- },
2308
- outputs: {
2309
- type: "object",
2310
- properties: {
2311
- success: { type: "boolean" }
2403
+ description: repo.description,
2404
+ language: repo.language,
2405
+ html_url: repo.html_url,
2406
+ stargazers_count: repo.stargazers_count,
2407
+ forks_count: repo.forks_count,
2408
+ visitedAt: Date.now()
2409
+ };
2410
+ const updated = [newEntry, ...filtered].slice(0, MAX_RECENT_ITEMS);
2411
+ saveRecentRepositories(updated);
2412
+ window.dispatchEvent(new CustomEvent("recent-items-updated"));
2413
+ }
2414
+ function addRecentOwner(owner) {
2415
+ const recent = loadRecentOwners();
2416
+ const filtered = recent.filter((o) => o.id !== owner.id);
2417
+ const newEntry = {
2418
+ type: "owner",
2419
+ id: owner.id,
2420
+ login: owner.login,
2421
+ avatar_url: owner.avatar_url,
2422
+ name: owner.name,
2423
+ bio: owner.bio,
2424
+ ownerType: owner.type,
2425
+ public_repos: owner.public_repos,
2426
+ followers: owner.followers,
2427
+ visitedAt: Date.now()
2428
+ };
2429
+ const updated = [newEntry, ...filtered].slice(0, MAX_RECENT_ITEMS);
2430
+ saveRecentOwners(updated);
2431
+ window.dispatchEvent(new CustomEvent("recent-items-updated"));
2432
+ }
2433
+ const RecentRepositoriesPanelContent = ({
2434
+ events,
2435
+ onNavigate
2436
+ }) => {
2437
+ const { theme: theme2 } = useTheme();
2438
+ const [items, setItems] = useState([]);
2439
+ const [selectedId, setSelectedId] = useState(null);
2440
+ const [hoveredId, setHoveredId] = useState(null);
2441
+ const [filter, setFilter] = useState("all");
2442
+ const getItemId = (item) => {
2443
+ return item.type === "repository" ? `repo-${item.id}` : `owner-${item.id}`;
2444
+ };
2445
+ useEffect(() => {
2446
+ const loadItems = () => {
2447
+ const repos = loadRecentRepositories();
2448
+ const owners = loadRecentOwners();
2449
+ const merged = [...repos, ...owners].sort(
2450
+ (a, b) => b.visitedAt - a.visitedAt
2451
+ );
2452
+ setItems(merged);
2453
+ };
2454
+ loadItems();
2455
+ const handleUpdate = () => loadItems();
2456
+ window.addEventListener("recent-items-updated", handleUpdate);
2457
+ window.addEventListener("recent-repositories-updated", handleUpdate);
2458
+ return () => {
2459
+ window.removeEventListener("recent-items-updated", handleUpdate);
2460
+ window.removeEventListener("recent-repositories-updated", handleUpdate);
2461
+ };
2462
+ }, []);
2463
+ const filteredItems = items.filter((item) => {
2464
+ if (filter === "all") return true;
2465
+ if (filter === "repos") return item.type === "repository";
2466
+ if (filter === "owners") return item.type === "owner";
2467
+ return true;
2468
+ });
2469
+ const formatRelativeTime = (timestamp) => {
2470
+ const now = Date.now();
2471
+ const diffMs = now - timestamp;
2472
+ const diffMins = Math.floor(diffMs / (1e3 * 60));
2473
+ const diffHours = Math.floor(diffMs / (1e3 * 60 * 60));
2474
+ const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
2475
+ if (diffMins < 1) return "just now";
2476
+ if (diffMins < 60) return `${diffMins}m ago`;
2477
+ if (diffHours < 24) return `${diffHours}h ago`;
2478
+ if (diffDays === 1) return "yesterday";
2479
+ if (diffDays < 7) return `${diffDays}d ago`;
2480
+ if (diffDays < 30) return `${Math.floor(diffDays / 7)}w ago`;
2481
+ return `${Math.floor(diffDays / 30)}mo ago`;
2482
+ };
2483
+ const formatNumber = (num) => {
2484
+ if (num >= 1e6) return `${(num / 1e6).toFixed(1)}M`;
2485
+ if (num >= 1e3) return `${(num / 1e3).toFixed(1)}K`;
2486
+ return num.toString();
2487
+ };
2488
+ const handleSelectRepository = useCallback((repo) => {
2489
+ setSelectedId(getItemId(repo));
2490
+ const githubRepo = {
2491
+ id: repo.id,
2492
+ name: repo.name,
2493
+ full_name: repo.full_name,
2494
+ owner: {
2495
+ login: repo.owner.login,
2496
+ avatar_url: repo.owner.avatar_url
2497
+ },
2498
+ private: false,
2499
+ html_url: repo.html_url,
2500
+ description: repo.description,
2501
+ fork: false,
2502
+ clone_url: `https://github.com/${repo.full_name}.git`,
2503
+ language: repo.language,
2504
+ default_branch: "main",
2505
+ stargazers_count: repo.stargazers_count,
2506
+ forks_count: repo.forks_count
2507
+ };
2508
+ events.emit({
2509
+ type: "repository:preview",
2510
+ source: "recent-repositories-panel",
2511
+ timestamp: Date.now(),
2512
+ payload: {
2513
+ repository: githubRepo,
2514
+ source: "click"
2515
+ }
2516
+ });
2517
+ }, [events]);
2518
+ const handleOpenRepository = useCallback((repo) => {
2519
+ if (onNavigate) {
2520
+ onNavigate(`/${repo.full_name}`);
2521
+ } else {
2522
+ const githubRepo = {
2523
+ id: repo.id,
2524
+ name: repo.name,
2525
+ full_name: repo.full_name,
2526
+ owner: {
2527
+ login: repo.owner.login,
2528
+ avatar_url: repo.owner.avatar_url
2529
+ },
2530
+ private: false,
2531
+ html_url: repo.html_url,
2532
+ description: repo.description,
2533
+ fork: false,
2534
+ clone_url: `https://github.com/${repo.full_name}.git`,
2535
+ language: repo.language,
2536
+ default_branch: "main",
2537
+ stargazers_count: repo.stargazers_count,
2538
+ forks_count: repo.forks_count
2539
+ };
2540
+ events.emit({
2541
+ type: "repository:selected",
2542
+ source: "recent-repositories-panel",
2543
+ timestamp: Date.now(),
2544
+ payload: {
2545
+ repository: githubRepo,
2546
+ source: "click"
2547
+ }
2548
+ });
2312
2549
  }
2313
- },
2314
- tags: ["github", "repository", "search", "filter"],
2315
- tool_call_template: {
2316
- call_template_type: "panel_event",
2317
- event_type: "github:search-repositories"
2318
- }
2319
- };
2320
- const openRepositorySwitcherTool = {
2321
- name: "open_repository_switcher",
2322
- description: "Open the repository switcher modal to browse and select a different repository.",
2323
- inputs: {
2324
- type: "object",
2325
- properties: {},
2326
- required: []
2327
- },
2328
- outputs: {
2329
- type: "object",
2330
- properties: {
2331
- success: { type: "boolean" }
2550
+ }, [events, onNavigate]);
2551
+ const handleSelectOwner = useCallback((owner) => {
2552
+ setSelectedId(getItemId(owner));
2553
+ events.emit({
2554
+ type: "owner:preview",
2555
+ source: "recent-repositories-panel",
2556
+ timestamp: Date.now(),
2557
+ payload: { owner }
2558
+ });
2559
+ }, [events]);
2560
+ const handleOpenOwner = useCallback((owner) => {
2561
+ if (onNavigate) {
2562
+ onNavigate(`/${owner.login}`);
2563
+ } else {
2564
+ events.emit({
2565
+ type: "owner:selected",
2566
+ source: "recent-repositories-panel",
2567
+ timestamp: Date.now(),
2568
+ payload: { owner }
2569
+ });
2332
2570
  }
2333
- },
2334
- tags: ["github", "repository", "switch", "modal"],
2335
- tool_call_template: {
2336
- call_template_type: "panel_event",
2571
+ }, [events, onNavigate]);
2572
+ const handleRemoveItem = useCallback((item, e) => {
2573
+ e.stopPropagation();
2574
+ if (item.type === "repository") {
2575
+ const repos = loadRecentRepositories().filter((r) => r.id !== item.id);
2576
+ saveRecentRepositories(repos);
2577
+ } else {
2578
+ const owners = loadRecentOwners().filter((o) => o.id !== item.id);
2579
+ saveRecentOwners(owners);
2580
+ }
2581
+ setItems((prev) => prev.filter((i) => getItemId(i) !== getItemId(item)));
2582
+ if (selectedId === getItemId(item)) {
2583
+ setSelectedId(null);
2584
+ }
2585
+ }, [selectedId]);
2586
+ const handleClearAll = useCallback(() => {
2587
+ if (filter === "all" || filter === "repos") {
2588
+ saveRecentRepositories([]);
2589
+ }
2590
+ if (filter === "all" || filter === "owners") {
2591
+ saveRecentOwners([]);
2592
+ }
2593
+ if (filter === "all") {
2594
+ setItems([]);
2595
+ } else {
2596
+ setItems((prev) => prev.filter(
2597
+ (item) => filter === "repos" ? item.type !== "repository" : item.type !== "owner"
2598
+ ));
2599
+ }
2600
+ setSelectedId(null);
2601
+ }, [filter]);
2602
+ return /* @__PURE__ */ jsxs(
2603
+ "div",
2604
+ {
2605
+ style: {
2606
+ height: "100%",
2607
+ display: "flex",
2608
+ flexDirection: "column",
2609
+ backgroundColor: theme2.colors.background,
2610
+ color: theme2.colors.text,
2611
+ fontFamily: theme2.fonts.body
2612
+ },
2613
+ children: [
2614
+ /* @__PURE__ */ jsxs(
2615
+ "div",
2616
+ {
2617
+ style: {
2618
+ padding: "16px",
2619
+ borderBottom: `1px solid ${theme2.colors.border}`,
2620
+ display: "flex",
2621
+ alignItems: "center",
2622
+ justifyContent: "space-between"
2623
+ },
2624
+ children: [
2625
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
2626
+ /* @__PURE__ */ jsx(History, { size: 24, color: theme2.colors.primary }),
2627
+ /* @__PURE__ */ jsx(
2628
+ "h2",
2629
+ {
2630
+ style: {
2631
+ margin: 0,
2632
+ fontSize: `${theme2.fontSizes[3]}px`,
2633
+ fontWeight: theme2.fontWeights.semibold
2634
+ },
2635
+ children: "Recent"
2636
+ }
2637
+ )
2638
+ ] }),
2639
+ items.length > 0 && /* @__PURE__ */ jsxs(
2640
+ "button",
2641
+ {
2642
+ onClick: handleClearAll,
2643
+ style: {
2644
+ padding: "6px 12px",
2645
+ borderRadius: "6px",
2646
+ border: `1px solid ${theme2.colors.border}`,
2647
+ background: "transparent",
2648
+ cursor: "pointer",
2649
+ color: theme2.colors.textSecondary,
2650
+ fontSize: `${theme2.fontSizes[1]}px`,
2651
+ display: "flex",
2652
+ alignItems: "center",
2653
+ gap: "6px"
2654
+ },
2655
+ title: "Clear history",
2656
+ children: [
2657
+ /* @__PURE__ */ jsx(Trash2, { size: 14 }),
2658
+ "Clear"
2659
+ ]
2660
+ }
2661
+ )
2662
+ ]
2663
+ }
2664
+ ),
2665
+ items.length > 0 && /* @__PURE__ */ jsx(
2666
+ "div",
2667
+ {
2668
+ style: {
2669
+ padding: "8px 16px",
2670
+ borderBottom: `1px solid ${theme2.colors.border}`,
2671
+ display: "flex",
2672
+ gap: "4px"
2673
+ },
2674
+ children: [
2675
+ { key: "all", label: "All" },
2676
+ { key: "repos", label: "Repositories" },
2677
+ { key: "owners", label: "Owners" }
2678
+ ].map(({ key, label }) => /* @__PURE__ */ jsx(
2679
+ "button",
2680
+ {
2681
+ onClick: () => setFilter(key),
2682
+ style: {
2683
+ padding: "6px 12px",
2684
+ borderRadius: "6px",
2685
+ border: "none",
2686
+ background: filter === key ? theme2.colors.primary : theme2.colors.backgroundSecondary,
2687
+ color: filter === key ? "#fff" : theme2.colors.text,
2688
+ fontSize: `${theme2.fontSizes[1]}px`,
2689
+ cursor: "pointer",
2690
+ fontWeight: filter === key ? theme2.fontWeights.semibold : theme2.fontWeights.body
2691
+ },
2692
+ children: label
2693
+ },
2694
+ key
2695
+ ))
2696
+ }
2697
+ ),
2698
+ filteredItems.length === 0 && /* @__PURE__ */ jsxs(
2699
+ "div",
2700
+ {
2701
+ style: {
2702
+ flex: 1,
2703
+ display: "flex",
2704
+ flexDirection: "column",
2705
+ alignItems: "center",
2706
+ justifyContent: "center",
2707
+ padding: "32px",
2708
+ color: theme2.colors.textSecondary
2709
+ },
2710
+ children: [
2711
+ /* @__PURE__ */ jsx(Github, { size: 48, color: theme2.colors.border, style: { marginBottom: 16 } }),
2712
+ /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: `${theme2.fontSizes[2]}px` }, children: items.length === 0 ? "No recent activity" : "No items match filter" }),
2713
+ /* @__PURE__ */ jsx("p", { style: { margin: "8px 0 0", fontSize: `${theme2.fontSizes[1]}px` }, children: items.length === 0 ? "Repositories and owners you visit will appear here" : "Try a different filter" })
2714
+ ]
2715
+ }
2716
+ ),
2717
+ filteredItems.length > 0 && /* @__PURE__ */ jsx(
2718
+ "div",
2719
+ {
2720
+ style: {
2721
+ flex: 1,
2722
+ overflowY: "auto",
2723
+ padding: "8px"
2724
+ },
2725
+ children: filteredItems.map((item) => {
2726
+ const itemId = getItemId(item);
2727
+ const isSelected = selectedId === itemId;
2728
+ const isHovered = hoveredId === itemId;
2729
+ if (item.type === "repository") {
2730
+ return /* @__PURE__ */ jsxs(
2731
+ "button",
2732
+ {
2733
+ type: "button",
2734
+ onClick: () => handleSelectRepository(item),
2735
+ onDoubleClick: () => handleOpenRepository(item),
2736
+ onMouseEnter: () => setHoveredId(itemId),
2737
+ onMouseLeave: () => setHoveredId(null),
2738
+ style: {
2739
+ width: "100%",
2740
+ padding: "12px",
2741
+ margin: "4px 0",
2742
+ borderRadius: "8px",
2743
+ border: isSelected ? `2px solid ${theme2.colors.primary}` : `1px solid ${theme2.colors.border}`,
2744
+ backgroundColor: isSelected ? `${theme2.colors.primary}10` : theme2.colors.surface,
2745
+ cursor: "pointer",
2746
+ textAlign: "left",
2747
+ display: "flex",
2748
+ flexDirection: "column",
2749
+ gap: "8px",
2750
+ transition: "all 0.15s ease",
2751
+ position: "relative"
2752
+ },
2753
+ children: [
2754
+ isHovered && /* @__PURE__ */ jsx(
2755
+ "button",
2756
+ {
2757
+ onClick: (e) => handleRemoveItem(item, e),
2758
+ style: {
2759
+ position: "absolute",
2760
+ top: "8px",
2761
+ right: "8px",
2762
+ padding: "4px",
2763
+ borderRadius: "4px",
2764
+ border: "none",
2765
+ background: theme2.colors.backgroundSecondary,
2766
+ cursor: "pointer",
2767
+ color: theme2.colors.textSecondary,
2768
+ display: "flex",
2769
+ alignItems: "center",
2770
+ justifyContent: "center"
2771
+ },
2772
+ title: "Remove from history",
2773
+ children: /* @__PURE__ */ jsx(X, { size: 14 })
2774
+ }
2775
+ ),
2776
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
2777
+ /* @__PURE__ */ jsx(BookOpen, { size: 16, color: theme2.colors.textSecondary }),
2778
+ item.owner.avatar_url && /* @__PURE__ */ jsx(
2779
+ "img",
2780
+ {
2781
+ src: item.owner.avatar_url,
2782
+ alt: item.owner.login,
2783
+ style: {
2784
+ width: 24,
2785
+ height: 24,
2786
+ borderRadius: "50%",
2787
+ border: `1px solid ${theme2.colors.border}`
2788
+ }
2789
+ }
2790
+ ),
2791
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 0 }, children: [
2792
+ /* @__PURE__ */ jsx(
2793
+ "span",
2794
+ {
2795
+ style: {
2796
+ fontSize: `${theme2.fontSizes[1]}px`,
2797
+ color: theme2.colors.textSecondary
2798
+ },
2799
+ children: item.owner.login
2800
+ }
2801
+ ),
2802
+ /* @__PURE__ */ jsx(
2803
+ "span",
2804
+ {
2805
+ style: {
2806
+ fontSize: `${theme2.fontSizes[2]}px`,
2807
+ fontWeight: theme2.fontWeights.semibold,
2808
+ color: theme2.colors.primary
2809
+ },
2810
+ children: item.name
2811
+ }
2812
+ )
2813
+ ] })
2814
+ ] }),
2815
+ item.description && /* @__PURE__ */ jsx(
2816
+ "p",
2817
+ {
2818
+ style: {
2819
+ margin: 0,
2820
+ fontSize: `${theme2.fontSizes[1]}px`,
2821
+ color: theme2.colors.textSecondary,
2822
+ overflow: "hidden",
2823
+ textOverflow: "ellipsis",
2824
+ display: "-webkit-box",
2825
+ WebkitLineClamp: 2,
2826
+ WebkitBoxOrient: "vertical"
2827
+ },
2828
+ children: item.description
2829
+ }
2830
+ ),
2831
+ /* @__PURE__ */ jsxs(
2832
+ "div",
2833
+ {
2834
+ style: {
2835
+ display: "flex",
2836
+ alignItems: "center",
2837
+ gap: "16px",
2838
+ fontSize: `${theme2.fontSizes[1]}px`,
2839
+ color: theme2.colors.textSecondary
2840
+ },
2841
+ children: [
2842
+ item.language && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
2843
+ /* @__PURE__ */ jsx(
2844
+ "span",
2845
+ {
2846
+ style: {
2847
+ width: 10,
2848
+ height: 10,
2849
+ borderRadius: "50%",
2850
+ backgroundColor: theme2.colors.info
2851
+ }
2852
+ }
2853
+ ),
2854
+ item.language
2855
+ ] }),
2856
+ item.stargazers_count !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
2857
+ /* @__PURE__ */ jsx(Star, { size: 14 }),
2858
+ formatNumber(item.stargazers_count)
2859
+ ] }),
2860
+ item.forks_count !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
2861
+ /* @__PURE__ */ jsx(GitFork, { size: 14 }),
2862
+ formatNumber(item.forks_count)
2863
+ ] }),
2864
+ /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
2865
+ /* @__PURE__ */ jsx(Calendar, { size: 14 }),
2866
+ formatRelativeTime(item.visitedAt)
2867
+ ] }),
2868
+ /* @__PURE__ */ jsx(
2869
+ "a",
2870
+ {
2871
+ href: item.html_url,
2872
+ target: "_blank",
2873
+ rel: "noopener noreferrer",
2874
+ onClick: (e) => e.stopPropagation(),
2875
+ style: {
2876
+ marginLeft: "auto",
2877
+ color: theme2.colors.textSecondary,
2878
+ display: "flex",
2879
+ alignItems: "center"
2880
+ },
2881
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
2882
+ }
2883
+ )
2884
+ ]
2885
+ }
2886
+ )
2887
+ ]
2888
+ },
2889
+ itemId
2890
+ );
2891
+ }
2892
+ return /* @__PURE__ */ jsxs(
2893
+ "button",
2894
+ {
2895
+ type: "button",
2896
+ onClick: () => handleSelectOwner(item),
2897
+ onDoubleClick: () => handleOpenOwner(item),
2898
+ onMouseEnter: () => setHoveredId(itemId),
2899
+ onMouseLeave: () => setHoveredId(null),
2900
+ style: {
2901
+ width: "100%",
2902
+ padding: "12px",
2903
+ margin: "4px 0",
2904
+ borderRadius: "8px",
2905
+ border: isSelected ? `2px solid ${theme2.colors.primary}` : `1px solid ${theme2.colors.border}`,
2906
+ backgroundColor: isSelected ? `${theme2.colors.primary}10` : theme2.colors.surface,
2907
+ cursor: "pointer",
2908
+ textAlign: "left",
2909
+ display: "flex",
2910
+ flexDirection: "column",
2911
+ gap: "8px",
2912
+ transition: "all 0.15s ease",
2913
+ position: "relative"
2914
+ },
2915
+ children: [
2916
+ isHovered && /* @__PURE__ */ jsx(
2917
+ "button",
2918
+ {
2919
+ onClick: (e) => handleRemoveItem(item, e),
2920
+ style: {
2921
+ position: "absolute",
2922
+ top: "8px",
2923
+ right: "8px",
2924
+ padding: "4px",
2925
+ borderRadius: "4px",
2926
+ border: "none",
2927
+ background: theme2.colors.backgroundSecondary,
2928
+ cursor: "pointer",
2929
+ color: theme2.colors.textSecondary,
2930
+ display: "flex",
2931
+ alignItems: "center",
2932
+ justifyContent: "center"
2933
+ },
2934
+ title: "Remove from history",
2935
+ children: /* @__PURE__ */ jsx(X, { size: 14 })
2936
+ }
2937
+ ),
2938
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
2939
+ item.ownerType === "Organization" ? /* @__PURE__ */ jsx(Building2, { size: 16, color: theme2.colors.textSecondary }) : /* @__PURE__ */ jsx(User, { size: 16, color: theme2.colors.textSecondary }),
2940
+ item.avatar_url && /* @__PURE__ */ jsx(
2941
+ "img",
2942
+ {
2943
+ src: item.avatar_url,
2944
+ alt: item.login,
2945
+ style: {
2946
+ width: 32,
2947
+ height: 32,
2948
+ borderRadius: item.ownerType === "Organization" ? 8 : "50%",
2949
+ border: `1px solid ${theme2.colors.border}`
2950
+ }
2951
+ }
2952
+ ),
2953
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 0 }, children: [
2954
+ /* @__PURE__ */ jsx(
2955
+ "span",
2956
+ {
2957
+ style: {
2958
+ fontSize: `${theme2.fontSizes[2]}px`,
2959
+ fontWeight: theme2.fontWeights.semibold,
2960
+ color: theme2.colors.primary
2961
+ },
2962
+ children: item.name || item.login
2963
+ }
2964
+ ),
2965
+ item.name && /* @__PURE__ */ jsxs(
2966
+ "span",
2967
+ {
2968
+ style: {
2969
+ fontSize: `${theme2.fontSizes[1]}px`,
2970
+ color: theme2.colors.textSecondary
2971
+ },
2972
+ children: [
2973
+ "@",
2974
+ item.login
2975
+ ]
2976
+ }
2977
+ )
2978
+ ] })
2979
+ ] }),
2980
+ item.bio && /* @__PURE__ */ jsx(
2981
+ "p",
2982
+ {
2983
+ style: {
2984
+ margin: 0,
2985
+ fontSize: `${theme2.fontSizes[1]}px`,
2986
+ color: theme2.colors.textSecondary,
2987
+ overflow: "hidden",
2988
+ textOverflow: "ellipsis",
2989
+ display: "-webkit-box",
2990
+ WebkitLineClamp: 2,
2991
+ WebkitBoxOrient: "vertical"
2992
+ },
2993
+ children: item.bio
2994
+ }
2995
+ ),
2996
+ /* @__PURE__ */ jsxs(
2997
+ "div",
2998
+ {
2999
+ style: {
3000
+ display: "flex",
3001
+ alignItems: "center",
3002
+ gap: "16px",
3003
+ fontSize: `${theme2.fontSizes[1]}px`,
3004
+ color: theme2.colors.textSecondary
3005
+ },
3006
+ children: [
3007
+ item.public_repos !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
3008
+ /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
3009
+ formatNumber(item.public_repos),
3010
+ " repos"
3011
+ ] }),
3012
+ item.followers !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
3013
+ /* @__PURE__ */ jsx(User, { size: 14 }),
3014
+ formatNumber(item.followers),
3015
+ " followers"
3016
+ ] }),
3017
+ /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
3018
+ /* @__PURE__ */ jsx(Calendar, { size: 14 }),
3019
+ formatRelativeTime(item.visitedAt)
3020
+ ] }),
3021
+ /* @__PURE__ */ jsx(
3022
+ "a",
3023
+ {
3024
+ href: `https://github.com/${item.login}`,
3025
+ target: "_blank",
3026
+ rel: "noopener noreferrer",
3027
+ onClick: (e) => e.stopPropagation(),
3028
+ style: {
3029
+ marginLeft: "auto",
3030
+ color: theme2.colors.textSecondary,
3031
+ display: "flex",
3032
+ alignItems: "center"
3033
+ },
3034
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
3035
+ }
3036
+ )
3037
+ ]
3038
+ }
3039
+ )
3040
+ ]
3041
+ },
3042
+ itemId
3043
+ );
3044
+ })
3045
+ }
3046
+ )
3047
+ ]
3048
+ }
3049
+ );
3050
+ };
3051
+ const RecentRepositoriesPanel = (props) => {
3052
+ return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(RecentRepositoriesPanelContent, { ...props }) });
3053
+ };
3054
+ const RecentRepositoriesPanelMetadata = {
3055
+ id: "recent-repositories",
3056
+ name: "Recent",
3057
+ description: "View and navigate to recently visited repositories and owners",
3058
+ icon: "history",
3059
+ version: "0.1.0",
3060
+ slices: [],
3061
+ surfaces: ["panel"]
3062
+ };
3063
+ var Logo = {};
3064
+ var hasRequiredLogo;
3065
+ function requireLogo() {
3066
+ if (hasRequiredLogo) return Logo;
3067
+ hasRequiredLogo = 1;
3068
+ var __importDefault = Logo && Logo.__importDefault || function(mod) {
3069
+ return mod && mod.__esModule ? mod : { "default": mod };
3070
+ };
3071
+ Object.defineProperty(Logo, "__esModule", { value: true });
3072
+ Logo.Logo = void 0;
3073
+ const react_1 = __importDefault(React2);
3074
+ const Logo$1 = ({ width = 150, height = 150, color = "currentColor", particleColor, opacity = 0.9 }) => {
3075
+ const finalParticleColor = particleColor || color;
3076
+ return react_1.default.createElement(
3077
+ "svg",
3078
+ { width, height, viewBox: "0 0 200 200", xmlns: "http://www.w3.org/2000/svg", style: { opacity } },
3079
+ react_1.default.createElement(
3080
+ "defs",
3081
+ null,
3082
+ react_1.default.createElement(
3083
+ "radialGradient",
3084
+ { id: "sphereGlow", cx: "50%", cy: "50%", r: "50%" },
3085
+ react_1.default.createElement("stop", { offset: "0%", style: { stopColor: color, stopOpacity: 0.3 } }),
3086
+ react_1.default.createElement("stop", { offset: "100%", style: { stopColor: color, stopOpacity: 0 } })
3087
+ ),
3088
+ react_1.default.createElement(
3089
+ "radialGradient",
3090
+ { id: "centerPulse", cx: "50%", cy: "50%", r: "50%" },
3091
+ react_1.default.createElement(
3092
+ "stop",
3093
+ { offset: "0%", style: { stopColor: color, stopOpacity: 0.8 } },
3094
+ react_1.default.createElement("animate", { attributeName: "stop-opacity", values: "0.8;0.3;0.8", dur: "2s", repeatCount: "indefinite" })
3095
+ ),
3096
+ react_1.default.createElement("stop", { offset: "100%", style: { stopColor: color, stopOpacity: 0 } })
3097
+ )
3098
+ ),
3099
+ react_1.default.createElement("circle", { cx: "100", cy: "100", r: "80", fill: "url(#sphereGlow)", opacity: "0.5" }),
3100
+ react_1.default.createElement(
3101
+ "circle",
3102
+ { r: "2.5", fill: finalParticleColor, cx: "167", cy: "100", opacity: "0" },
3103
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "1s", path: "M 0,0 A 67,27 0 1,0 -134,0 A 67,27 0 1,0 0,0" }),
3104
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;1;0.5;0;0", keyTimes: "0;0.2;0.4;0.5;1", dur: "8s", begin: "1s", repeatCount: "indefinite" })
3105
+ ),
3106
+ react_1.default.createElement(
3107
+ "circle",
3108
+ { r: "2.5", fill: finalParticleColor, cx: "167", cy: "100", opacity: "0" },
3109
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "2s", path: "M 0,0 A 67,40 0 1,0 -134,0 A 67,40 0 1,0 0,0" }),
3110
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;1;0.5;0;0", keyTimes: "0;0.2;0.4;0.5;1", dur: "8s", begin: "2s", repeatCount: "indefinite" })
3111
+ ),
3112
+ react_1.default.createElement(
3113
+ "circle",
3114
+ { r: "2.5", fill: finalParticleColor, cx: "167", cy: "100", opacity: "0" },
3115
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "3s", path: "M 0,0 A 67,53 0 1,0 -134,0 A 67,53 0 1,0 0,0" }),
3116
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;1;0.5;0;0", keyTimes: "0;0.2;0.4;0.5;1", dur: "8s", begin: "3s", repeatCount: "indefinite" })
3117
+ ),
3118
+ react_1.default.createElement(
3119
+ "circle",
3120
+ { r: "2.5", fill: finalParticleColor, cx: "100", cy: "167", opacity: "0" },
3121
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "1.5s", path: "M 0,0 A 27,67 0 1,0 0,-134 A 27,67 0 1,0 0,0" }),
3122
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;1;0.5;0;0", keyTimes: "0;0.2;0.4;0.5;1", dur: "8s", begin: "1.5s", repeatCount: "indefinite" })
3123
+ ),
3124
+ react_1.default.createElement(
3125
+ "circle",
3126
+ { r: "2.5", fill: finalParticleColor, cx: "100", cy: "167", opacity: "0" },
3127
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "2.5s", path: "M 0,0 A 40,67 0 1,0 0,-134 A 40,67 0 1,0 0,0" }),
3128
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;1;0.5;0;0", keyTimes: "0;0.2;0.4;0.5;1", dur: "8s", begin: "2.5s", repeatCount: "indefinite" })
3129
+ ),
3130
+ react_1.default.createElement(
3131
+ "circle",
3132
+ { r: "2.5", fill: finalParticleColor, cx: "100", cy: "167", opacity: "0" },
3133
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "3.5s", path: "M 0,0 A 53,67 0 1,0 0,-134 A 53,67 0 1,0 0,0" }),
3134
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;1;0.5;0;0", keyTimes: "0;0.2;0.4;0.5;1", dur: "8s", begin: "3.5s", repeatCount: "indefinite" })
3135
+ ),
3136
+ react_1.default.createElement("circle", { cx: "93", cy: "85", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3137
+ react_1.default.createElement("circle", { cx: "93", cy: "90", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3138
+ react_1.default.createElement("circle", { cx: "93", cy: "95", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3139
+ react_1.default.createElement("circle", { cx: "93", cy: "100", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3140
+ react_1.default.createElement("circle", { cx: "93", cy: "105", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3141
+ react_1.default.createElement("circle", { cx: "93", cy: "110", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3142
+ react_1.default.createElement("circle", { cx: "93", cy: "115", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3143
+ react_1.default.createElement("circle", { cx: "98", cy: "85", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3144
+ react_1.default.createElement("circle", { cx: "103", cy: "85", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3145
+ react_1.default.createElement("circle", { cx: "108", cy: "90", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3146
+ react_1.default.createElement("circle", { cx: "108", cy: "95", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3147
+ react_1.default.createElement("circle", { cx: "103", cy: "100", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3148
+ react_1.default.createElement("circle", { cx: "98", cy: "100", r: "2", fill: finalParticleColor, opacity: "0.9" }),
3149
+ react_1.default.createElement("circle", { cx: "100", cy: "100", r: "67", fill: "none", stroke: color, strokeWidth: "1.5", opacity: "0.9" }),
3150
+ react_1.default.createElement("path", { d: "M 33,100 A 67,13 0 0,1 73,88.1", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3151
+ react_1.default.createElement("path", { d: "M 127,88.1 A 67,13 0 0,1 167,100", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3152
+ react_1.default.createElement("path", { d: "M 33,100 A 67,13 0 0,0 73,111.9", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3153
+ react_1.default.createElement("path", { d: "M 127,111.9 A 67,13 0 0,0 167,100", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3154
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "67", ry: "27", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3155
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "67", ry: "40", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3156
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "67", ry: "53", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3157
+ react_1.default.createElement("path", { d: "M 100,33 A 13,67 0 0,0 87,73", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3158
+ react_1.default.createElement("path", { d: "M 113,73 A 13,67 0 0,0 100,33", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3159
+ react_1.default.createElement("path", { d: "M 100,167 A 13,67 0 0,1 87,127", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3160
+ react_1.default.createElement("path", { d: "M 113,127 A 13,67 0 0,1 100,167", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3161
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "27", ry: "67", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3162
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "40", ry: "67", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3163
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "53", ry: "67", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.7" }),
3164
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "67", ry: "33", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.6", transform: "rotate(30 100 100)" }),
3165
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "67", ry: "33", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.6", transform: "rotate(60 100 100)" }),
3166
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "67", ry: "33", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.6", transform: "rotate(120 100 100)" }),
3167
+ react_1.default.createElement("ellipse", { cx: "100", cy: "100", rx: "67", ry: "33", fill: "none", stroke: color, strokeWidth: "1", opacity: "0.6", transform: "rotate(150 100 100)" }),
3168
+ react_1.default.createElement("line", { x1: "33", y1: "100", x2: "73", y2: "100", stroke: color, strokeWidth: "1.5", opacity: "0.8" }),
3169
+ react_1.default.createElement("line", { x1: "127", y1: "100", x2: "167", y2: "100", stroke: color, strokeWidth: "1.5", opacity: "0.8" }),
3170
+ react_1.default.createElement("line", { x1: "100", y1: "33", x2: "100", y2: "73", stroke: color, strokeWidth: "1.5", opacity: "0.8" }),
3171
+ react_1.default.createElement("line", { x1: "100", y1: "127", x2: "100", y2: "167", stroke: color, strokeWidth: "1.5", opacity: "0.8" }),
3172
+ react_1.default.createElement(
3173
+ "circle",
3174
+ { r: "2.5", fill: finalParticleColor, cx: "167", cy: "100", opacity: "0" },
3175
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "1s", path: "M 0,0 A 67,27 0 1,0 -134,0 A 67,27 0 1,0 0,0" }),
3176
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;0;0.5;1;1;0.5;0", keyTimes: "0;0.5;0.6;0.75;0.9;0.95;1", dur: "8s", begin: "1s", repeatCount: "indefinite" })
3177
+ ),
3178
+ react_1.default.createElement(
3179
+ "circle",
3180
+ { r: "2.5", fill: finalParticleColor, cx: "167", cy: "100", opacity: "0" },
3181
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "2s", path: "M 0,0 A 67,40 0 1,0 -134,0 A 67,40 0 1,0 0,0" }),
3182
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;0;0.5;1;1;0.5;0", keyTimes: "0;0.5;0.6;0.75;0.9;0.95;1", dur: "8s", begin: "2s", repeatCount: "indefinite" })
3183
+ ),
3184
+ react_1.default.createElement(
3185
+ "circle",
3186
+ { r: "2.5", fill: finalParticleColor, cx: "167", cy: "100", opacity: "0" },
3187
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "3s", path: "M 0,0 A 67,53 0 1,0 -134,0 A 67,53 0 1,0 0,0" }),
3188
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;0;0.5;1;1;0.5;0", keyTimes: "0;0.5;0.6;0.75;0.9;0.95;1", dur: "8s", begin: "3s", repeatCount: "indefinite" })
3189
+ ),
3190
+ react_1.default.createElement(
3191
+ "circle",
3192
+ { r: "2.5", fill: finalParticleColor, cx: "100", cy: "167", opacity: "0" },
3193
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "1.5s", path: "M 0,0 A 27,67 0 1,0 0,-134 A 27,67 0 1,0 0,0" }),
3194
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;0;0.5;1;1;0.5;0", keyTimes: "0;0.5;0.6;0.75;0.9;0.95;1", dur: "8s", begin: "1.5s", repeatCount: "indefinite" })
3195
+ ),
3196
+ react_1.default.createElement(
3197
+ "circle",
3198
+ { r: "2.5", fill: finalParticleColor, cx: "100", cy: "167", opacity: "0" },
3199
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "2.5s", path: "M 0,0 A 40,67 0 1,0 0,-134 A 40,67 0 1,0 0,0" }),
3200
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;0;0.5;1;1;0.5;0", keyTimes: "0;0.5;0.6;0.75;0.9;0.95;1", dur: "8s", begin: "2.5s", repeatCount: "indefinite" })
3201
+ ),
3202
+ react_1.default.createElement(
3203
+ "circle",
3204
+ { r: "2.5", fill: finalParticleColor, cx: "100", cy: "167", opacity: "0" },
3205
+ react_1.default.createElement("animateMotion", { dur: "8s", repeatCount: "indefinite", begin: "3.5s", path: "M 0,0 A 53,67 0 1,0 0,-134 A 53,67 0 1,0 0,0" }),
3206
+ react_1.default.createElement("animate", { attributeName: "opacity", values: "0;0;0.5;1;1;0.5;0", keyTimes: "0;0.5;0.6;0.75;0.9;0.95;1", dur: "8s", begin: "3.5s", repeatCount: "indefinite" })
3207
+ )
3208
+ );
3209
+ };
3210
+ Logo.Logo = Logo$1;
3211
+ return Logo;
3212
+ }
3213
+ var LogoExports = requireLogo();
3214
+ function parseGitHubInput(input) {
3215
+ const trimmed = input.trim();
3216
+ const urlMatch = trimmed.match(/github\.com\/([^/]+)\/([^/]+)/);
3217
+ if (urlMatch) {
3218
+ return { owner: urlMatch[1], repo: urlMatch[2].replace(/\.git$/, "") };
3219
+ }
3220
+ const shortMatch = trimmed.match(/^([^/]+)\/([^/]+)$/);
3221
+ if (shortMatch) {
3222
+ return { owner: shortMatch[1], repo: shortMatch[2] };
3223
+ }
3224
+ return null;
3225
+ }
3226
+ const FeatureCard = ({ icon, title, description, theme: theme2 }) => /* @__PURE__ */ jsxs(
3227
+ "div",
3228
+ {
3229
+ style: {
3230
+ padding: "24px",
3231
+ borderRadius: "12px",
3232
+ backgroundColor: theme2.colors.surface,
3233
+ border: `1px solid ${theme2.colors.border}`,
3234
+ display: "flex",
3235
+ flexDirection: "column",
3236
+ gap: "12px",
3237
+ flex: 1,
3238
+ minWidth: "200px"
3239
+ },
3240
+ children: [
3241
+ /* @__PURE__ */ jsx(
3242
+ "div",
3243
+ {
3244
+ style: {
3245
+ width: 48,
3246
+ height: 48,
3247
+ borderRadius: "10px",
3248
+ backgroundColor: `${theme2.colors.primary}15`,
3249
+ display: "flex",
3250
+ alignItems: "center",
3251
+ justifyContent: "center",
3252
+ color: theme2.colors.primary
3253
+ },
3254
+ children: icon
3255
+ }
3256
+ ),
3257
+ /* @__PURE__ */ jsx(
3258
+ "h3",
3259
+ {
3260
+ style: {
3261
+ margin: 0,
3262
+ fontSize: `${theme2.fontSizes[3]}px`,
3263
+ fontWeight: theme2.fontWeights.semibold,
3264
+ color: theme2.colors.text
3265
+ },
3266
+ children: title
3267
+ }
3268
+ ),
3269
+ /* @__PURE__ */ jsx(
3270
+ "p",
3271
+ {
3272
+ style: {
3273
+ margin: 0,
3274
+ fontSize: `${theme2.fontSizes[2]}px`,
3275
+ color: theme2.colors.textSecondary,
3276
+ lineHeight: 1.5
3277
+ },
3278
+ children: description
3279
+ }
3280
+ )
3281
+ ]
3282
+ }
3283
+ );
3284
+ const WelcomePanelContent = ({
3285
+ onNavigate
3286
+ }) => {
3287
+ const { theme: theme2 } = useTheme();
3288
+ const [repoInput, setRepoInput] = useState("");
3289
+ const [error, setError] = useState(null);
3290
+ const handleSubmit = useCallback((e) => {
3291
+ e.preventDefault();
3292
+ setError(null);
3293
+ const parsed = parseGitHubInput(repoInput);
3294
+ if (!parsed) {
3295
+ setError("Enter a valid format: owner/repo or GitHub URL");
3296
+ return;
3297
+ }
3298
+ if (onNavigate) {
3299
+ onNavigate(parsed.owner, parsed.repo);
3300
+ } else {
3301
+ window.location.href = `/${parsed.owner}/${parsed.repo}`;
3302
+ }
3303
+ }, [repoInput, onNavigate]);
3304
+ return /* @__PURE__ */ jsxs(
3305
+ "div",
3306
+ {
3307
+ style: {
3308
+ height: "100%",
3309
+ display: "flex",
3310
+ flexDirection: "column",
3311
+ backgroundColor: theme2.colors.background,
3312
+ color: theme2.colors.text,
3313
+ fontFamily: theme2.fonts.body,
3314
+ overflowY: "auto"
3315
+ },
3316
+ children: [
3317
+ /* @__PURE__ */ jsxs(
3318
+ "div",
3319
+ {
3320
+ style: {
3321
+ padding: "48px 32px",
3322
+ display: "flex",
3323
+ flexDirection: "column",
3324
+ alignItems: "center",
3325
+ textAlign: "center",
3326
+ borderBottom: `1px solid ${theme2.colors.border}`
3327
+ },
3328
+ children: [
3329
+ /* @__PURE__ */ jsxs(
3330
+ "div",
3331
+ {
3332
+ style: {
3333
+ display: "flex",
3334
+ alignItems: "center",
3335
+ gap: "16px",
3336
+ marginBottom: "24px"
3337
+ },
3338
+ children: [
3339
+ /* @__PURE__ */ jsx(
3340
+ LogoExports.Logo,
3341
+ {
3342
+ width: 56,
3343
+ height: 56,
3344
+ color: theme2.colors.primary
3345
+ }
3346
+ ),
3347
+ /* @__PURE__ */ jsx(
3348
+ "span",
3349
+ {
3350
+ style: {
3351
+ fontSize: `${theme2.fontSizes[5]}px`,
3352
+ fontWeight: theme2.fontWeights.bold,
3353
+ color: theme2.colors.text
3354
+ },
3355
+ children: "Principal AI"
3356
+ }
3357
+ )
3358
+ ]
3359
+ }
3360
+ ),
3361
+ /* @__PURE__ */ jsx(
3362
+ "h1",
3363
+ {
3364
+ style: {
3365
+ margin: "0 0 16px",
3366
+ fontSize: `${theme2.fontSizes[6] || 32}px`,
3367
+ fontWeight: theme2.fontWeights.bold,
3368
+ color: theme2.colors.text,
3369
+ maxWidth: "600px"
3370
+ },
3371
+ children: "Explore repositories like never before"
3372
+ }
3373
+ ),
3374
+ /* @__PURE__ */ jsx(
3375
+ "p",
3376
+ {
3377
+ style: {
3378
+ margin: "0 0 32px",
3379
+ fontSize: `${theme2.fontSizes[3]}px`,
3380
+ color: theme2.colors.textSecondary,
3381
+ maxWidth: "500px",
3382
+ lineHeight: 1.6
3383
+ },
3384
+ children: "Interactive diagrams, intelligent chat, and visual exploration to understand any codebase in minutes."
3385
+ }
3386
+ ),
3387
+ /* @__PURE__ */ jsxs(
3388
+ "form",
3389
+ {
3390
+ onSubmit: handleSubmit,
3391
+ style: {
3392
+ width: "100%",
3393
+ maxWidth: "500px"
3394
+ },
3395
+ children: [
3396
+ /* @__PURE__ */ jsxs(
3397
+ "div",
3398
+ {
3399
+ style: {
3400
+ display: "flex",
3401
+ gap: "8px",
3402
+ padding: "6px",
3403
+ borderRadius: "12px",
3404
+ backgroundColor: theme2.colors.surface,
3405
+ border: `2px solid ${error ? theme2.colors.error : theme2.colors.border}`
3406
+ },
3407
+ children: [
3408
+ /* @__PURE__ */ jsx(
3409
+ "div",
3410
+ {
3411
+ style: {
3412
+ display: "flex",
3413
+ alignItems: "center",
3414
+ paddingLeft: "12px",
3415
+ color: theme2.colors.textSecondary
3416
+ },
3417
+ children: /* @__PURE__ */ jsx(Github, { size: 20 })
3418
+ }
3419
+ ),
3420
+ /* @__PURE__ */ jsx(
3421
+ "input",
3422
+ {
3423
+ type: "text",
3424
+ value: repoInput,
3425
+ onChange: (e) => {
3426
+ setRepoInput(e.target.value);
3427
+ setError(null);
3428
+ },
3429
+ placeholder: "owner/repo or paste GitHub URL",
3430
+ style: {
3431
+ flex: 1,
3432
+ padding: "12px 8px",
3433
+ border: "none",
3434
+ background: "transparent",
3435
+ color: theme2.colors.text,
3436
+ fontSize: `${theme2.fontSizes[2]}px`,
3437
+ outline: "none"
3438
+ }
3439
+ }
3440
+ ),
3441
+ /* @__PURE__ */ jsxs(
3442
+ "button",
3443
+ {
3444
+ type: "submit",
3445
+ style: {
3446
+ padding: "12px 20px",
3447
+ borderRadius: "8px",
3448
+ border: "none",
3449
+ backgroundColor: theme2.colors.primary,
3450
+ color: "#fff",
3451
+ fontSize: `${theme2.fontSizes[2]}px`,
3452
+ fontWeight: theme2.fontWeights.semibold,
3453
+ cursor: "pointer",
3454
+ display: "flex",
3455
+ alignItems: "center",
3456
+ gap: "8px"
3457
+ },
3458
+ children: [
3459
+ "Explore",
3460
+ /* @__PURE__ */ jsx(ArrowRight, { size: 18 })
3461
+ ]
3462
+ }
3463
+ )
3464
+ ]
3465
+ }
3466
+ ),
3467
+ error && /* @__PURE__ */ jsx(
3468
+ "p",
3469
+ {
3470
+ style: {
3471
+ margin: "8px 0 0",
3472
+ fontSize: `${theme2.fontSizes[1]}px`,
3473
+ color: theme2.colors.error
3474
+ },
3475
+ children: error
3476
+ }
3477
+ )
3478
+ ]
3479
+ }
3480
+ )
3481
+ ]
3482
+ }
3483
+ ),
3484
+ /* @__PURE__ */ jsxs(
3485
+ "div",
3486
+ {
3487
+ style: {
3488
+ padding: "48px 32px",
3489
+ display: "flex",
3490
+ flexDirection: "column",
3491
+ alignItems: "center"
3492
+ },
3493
+ children: [
3494
+ /* @__PURE__ */ jsxs(
3495
+ "div",
3496
+ {
3497
+ style: {
3498
+ display: "flex",
3499
+ alignItems: "center",
3500
+ gap: "8px",
3501
+ marginBottom: "12px"
3502
+ },
3503
+ children: [
3504
+ /* @__PURE__ */ jsx(Sparkles, { size: 20, color: theme2.colors.primary }),
3505
+ /* @__PURE__ */ jsx(
3506
+ "span",
3507
+ {
3508
+ style: {
3509
+ fontSize: `${theme2.fontSizes[1]}px`,
3510
+ fontWeight: theme2.fontWeights.semibold,
3511
+ color: theme2.colors.primary,
3512
+ textTransform: "uppercase",
3513
+ letterSpacing: "0.05em"
3514
+ },
3515
+ children: "Features"
3516
+ }
3517
+ )
3518
+ ]
3519
+ }
3520
+ ),
3521
+ /* @__PURE__ */ jsx(
3522
+ "h2",
3523
+ {
3524
+ style: {
3525
+ margin: "0 0 32px",
3526
+ fontSize: `${theme2.fontSizes[4]}px`,
3527
+ fontWeight: theme2.fontWeights.semibold,
3528
+ color: theme2.colors.text,
3529
+ textAlign: "center"
3530
+ },
3531
+ children: "Understand code faster"
3532
+ }
3533
+ ),
3534
+ /* @__PURE__ */ jsxs(
3535
+ "div",
3536
+ {
3537
+ style: {
3538
+ display: "flex",
3539
+ gap: "20px",
3540
+ flexWrap: "wrap",
3541
+ justifyContent: "center",
3542
+ maxWidth: "900px"
3543
+ },
3544
+ children: [
3545
+ /* @__PURE__ */ jsx(
3546
+ FeatureCard,
3547
+ {
3548
+ icon: /* @__PURE__ */ jsx(Network, { size: 24 }),
3549
+ title: "Interactive Diagrams",
3550
+ description: "Visualize repository structure, dependencies, and architecture with auto-generated diagrams you can explore.",
3551
+ theme: theme2
3552
+ }
3553
+ ),
3554
+ /* @__PURE__ */ jsx(
3555
+ FeatureCard,
3556
+ {
3557
+ icon: /* @__PURE__ */ jsx(MessageSquare, { size: 24 }),
3558
+ title: "Chat with Code",
3559
+ description: "Ask questions about any repository and get instant, context-aware answers powered by AI.",
3560
+ theme: theme2
3561
+ }
3562
+ ),
3563
+ /* @__PURE__ */ jsx(
3564
+ FeatureCard,
3565
+ {
3566
+ icon: /* @__PURE__ */ jsx(GitBranch, { size: 24 }),
3567
+ title: "Deep Git Insights",
3568
+ description: "Explore commits, branches, and history with visual timelines and contributor analytics.",
3569
+ theme: theme2
3570
+ }
3571
+ )
3572
+ ]
3573
+ }
3574
+ )
3575
+ ]
3576
+ }
3577
+ ),
3578
+ /* @__PURE__ */ jsx(
3579
+ "div",
3580
+ {
3581
+ style: {
3582
+ padding: "24px 32px 48px",
3583
+ display: "flex",
3584
+ justifyContent: "center"
3585
+ },
3586
+ children: /* @__PURE__ */ jsxs(
3587
+ "p",
3588
+ {
3589
+ style: {
3590
+ margin: 0,
3591
+ fontSize: `${theme2.fontSizes[1]}px`,
3592
+ color: theme2.colors.textSecondary
3593
+ },
3594
+ children: [
3595
+ "Try it with",
3596
+ " ",
3597
+ /* @__PURE__ */ jsx(
3598
+ "button",
3599
+ {
3600
+ onClick: () => {
3601
+ if (onNavigate) {
3602
+ onNavigate("facebook", "react");
3603
+ } else {
3604
+ window.location.href = "/facebook/react";
3605
+ }
3606
+ },
3607
+ style: {
3608
+ background: "none",
3609
+ border: "none",
3610
+ color: theme2.colors.primary,
3611
+ cursor: "pointer",
3612
+ padding: 0,
3613
+ fontSize: "inherit",
3614
+ fontWeight: theme2.fontWeights.medium,
3615
+ textDecoration: "underline"
3616
+ },
3617
+ children: "facebook/react"
3618
+ }
3619
+ ),
3620
+ " ",
3621
+ "or",
3622
+ " ",
3623
+ /* @__PURE__ */ jsx(
3624
+ "button",
3625
+ {
3626
+ onClick: () => {
3627
+ if (onNavigate) {
3628
+ onNavigate("vercel", "next.js");
3629
+ } else {
3630
+ window.location.href = "/vercel/next.js";
3631
+ }
3632
+ },
3633
+ style: {
3634
+ background: "none",
3635
+ border: "none",
3636
+ color: theme2.colors.primary,
3637
+ cursor: "pointer",
3638
+ padding: 0,
3639
+ fontSize: "inherit",
3640
+ fontWeight: theme2.fontWeights.medium,
3641
+ textDecoration: "underline"
3642
+ },
3643
+ children: "vercel/next.js"
3644
+ }
3645
+ )
3646
+ ]
3647
+ }
3648
+ )
3649
+ }
3650
+ )
3651
+ ]
3652
+ }
3653
+ );
3654
+ };
3655
+ const WelcomePanel = (props) => {
3656
+ return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(WelcomePanelContent, { ...props }) });
3657
+ };
3658
+ const WelcomePanelMetadata = {
3659
+ id: "welcome",
3660
+ name: "Welcome",
3661
+ description: "Landing page with branding and repository search",
3662
+ icon: "home",
3663
+ version: "0.1.0",
3664
+ slices: [],
3665
+ surfaces: ["panel"]
3666
+ };
3667
+ const listRepositoriesTool = {
3668
+ name: "list_repositories",
3669
+ description: "Get a list of GitHub repositories the user has access to, including owned repos, starred repos, and organization repos.",
3670
+ inputs: {
3671
+ type: "object",
3672
+ properties: {},
3673
+ required: []
3674
+ },
3675
+ outputs: {
3676
+ type: "object",
3677
+ properties: {
3678
+ success: { type: "boolean" }
3679
+ }
3680
+ },
3681
+ tags: ["github", "repository", "list", "browse"],
3682
+ tool_call_template: {
3683
+ call_template_type: "panel_event",
3684
+ event_type: "github:list-repositories"
3685
+ }
3686
+ };
3687
+ const selectRepositoryTool = {
3688
+ name: "select_repository",
3689
+ description: 'Select a GitHub repository to view its details, README, and files. Use the full repository name in "owner/repo" format.',
3690
+ inputs: {
3691
+ type: "object",
3692
+ properties: {
3693
+ repository: {
3694
+ type: "string",
3695
+ description: 'The full repository name in "owner/repo" format (e.g., "facebook/react")'
3696
+ }
3697
+ },
3698
+ required: ["repository"]
3699
+ },
3700
+ outputs: {
3701
+ type: "object",
3702
+ properties: {
3703
+ success: { type: "boolean" },
3704
+ repository: { type: "string" }
3705
+ }
3706
+ },
3707
+ tags: ["github", "repository", "select", "navigate"],
3708
+ tool_call_template: {
3709
+ call_template_type: "panel_event",
3710
+ event_type: "repository:selected"
3711
+ }
3712
+ };
3713
+ const previewRepositoryTool = {
3714
+ name: "preview_repository",
3715
+ description: "Preview a GitHub repository's README in the viewer without navigating to it.",
3716
+ inputs: {
3717
+ type: "object",
3718
+ properties: {
3719
+ repository: {
3720
+ type: "string",
3721
+ description: 'The full repository name in "owner/repo" format (e.g., "facebook/react")'
3722
+ }
3723
+ },
3724
+ required: ["repository"]
3725
+ },
3726
+ outputs: {
3727
+ type: "object",
3728
+ properties: {
3729
+ success: { type: "boolean" }
3730
+ }
3731
+ },
3732
+ tags: ["github", "repository", "preview", "readme"],
3733
+ tool_call_template: {
3734
+ call_template_type: "panel_event",
3735
+ event_type: "repository:preview"
3736
+ }
3737
+ };
3738
+ const searchRepositoriesTool = {
3739
+ name: "search_repositories",
3740
+ description: "Search through the user's GitHub repositories by name, description, or language.",
3741
+ inputs: {
3742
+ type: "object",
3743
+ properties: {
3744
+ query: {
3745
+ type: "string",
3746
+ description: "The search query to filter repositories"
3747
+ }
3748
+ },
3749
+ required: ["query"]
3750
+ },
3751
+ outputs: {
3752
+ type: "object",
3753
+ properties: {
3754
+ success: { type: "boolean" }
3755
+ }
3756
+ },
3757
+ tags: ["github", "repository", "search", "filter"],
3758
+ tool_call_template: {
3759
+ call_template_type: "panel_event",
3760
+ event_type: "github:search-repositories"
3761
+ }
3762
+ };
3763
+ const openRepositorySwitcherTool = {
3764
+ name: "open_repository_switcher",
3765
+ description: "Open the repository switcher modal to browse and select a different repository.",
3766
+ inputs: {
3767
+ type: "object",
3768
+ properties: {},
3769
+ required: []
3770
+ },
3771
+ outputs: {
3772
+ type: "object",
3773
+ properties: {
3774
+ success: { type: "boolean" }
3775
+ }
3776
+ },
3777
+ tags: ["github", "repository", "switch", "modal"],
3778
+ tool_call_template: {
3779
+ call_template_type: "panel_event",
2337
3780
  event_type: "repository:open-switcher"
2338
3781
  }
2339
3782
  };
@@ -2409,6 +3852,26 @@ const panels = [
2409
3852
  onUnmount: async (_context) => {
2410
3853
  console.log("Owner Repositories Panel unmounting");
2411
3854
  }
3855
+ },
3856
+ {
3857
+ metadata: RecentRepositoriesPanelMetadata,
3858
+ component: RecentRepositoriesPanel,
3859
+ onMount: async (_context) => {
3860
+ console.log("Recent Repositories Panel mounted");
3861
+ },
3862
+ onUnmount: async (_context) => {
3863
+ console.log("Recent Repositories Panel unmounting");
3864
+ }
3865
+ },
3866
+ {
3867
+ metadata: WelcomePanelMetadata,
3868
+ component: WelcomePanel,
3869
+ onMount: async (_context) => {
3870
+ console.log("Welcome Panel mounted");
3871
+ },
3872
+ onUnmount: async (_context) => {
3873
+ console.log("Welcome Panel unmounting");
3874
+ }
2412
3875
  }
2413
3876
  ];
2414
3877
  const onPackageLoad = async () => {
@@ -2422,6 +3885,10 @@ export {
2422
3885
  GitHubProjectsPanel,
2423
3886
  GitHubSearchPanel,
2424
3887
  OwnerRepositoriesPanel,
3888
+ RecentRepositoriesPanel,
3889
+ WelcomePanel,
3890
+ addRecentOwner,
3891
+ addRecentRepository,
2425
3892
  githubTools,
2426
3893
  githubToolsMetadata,
2427
3894
  listRepositoriesTool,