@industry-theme/alexandria-panels 0.1.2 → 0.1.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.
Files changed (36) hide show
  1. package/dist/index.d.ts +5 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/mocks/panelContext.d.ts.map +1 -1
  4. package/dist/panels/DependenciesPanel/DependenciesPanel.stories.d.ts +59 -0
  5. package/dist/panels/DependenciesPanel/DependenciesPanel.stories.d.ts.map +1 -0
  6. package/dist/panels/DependenciesPanel/components/DependencyInfoModal.d.ts +8 -0
  7. package/dist/panels/DependenciesPanel/components/DependencyInfoModal.d.ts.map +1 -0
  8. package/dist/panels/DependenciesPanel/components/DependencyRow.d.ts +8 -0
  9. package/dist/panels/DependenciesPanel/components/DependencyRow.d.ts.map +1 -0
  10. package/dist/panels/DependenciesPanel/components/FilterBar.d.ts +17 -0
  11. package/dist/panels/DependenciesPanel/components/FilterBar.d.ts.map +1 -0
  12. package/dist/panels/DependenciesPanel/components/index.d.ts +4 -0
  13. package/dist/panels/DependenciesPanel/components/index.d.ts.map +1 -0
  14. package/dist/panels/DependenciesPanel/index.d.ts +7 -0
  15. package/dist/panels/DependenciesPanel/index.d.ts.map +1 -0
  16. package/dist/panels/DependenciesPanel/tools.d.ts +35 -0
  17. package/dist/panels/DependenciesPanel/tools.d.ts.map +1 -0
  18. package/dist/panels/DependenciesPanel/types.d.ts +36 -0
  19. package/dist/panels/DependenciesPanel/types.d.ts.map +1 -0
  20. package/dist/panels/LocalProjectsPanel/LocalProjectCard.d.ts.map +1 -1
  21. package/dist/panels/LocalProjectsPanel/types.d.ts +11 -1
  22. package/dist/panels/LocalProjectsPanel/types.d.ts.map +1 -1
  23. package/dist/panels/WorkspaceRepositoriesPanel/index.d.ts +2 -2
  24. package/dist/panels/WorkspaceRepositoriesPanel/index.d.ts.map +1 -1
  25. package/dist/panels/WorkspaceRepositoriesPanel/types.d.ts +0 -23
  26. package/dist/panels/WorkspaceRepositoriesPanel/types.d.ts.map +1 -1
  27. package/dist/panels.bundle.js +1362 -461
  28. package/dist/panels.bundle.js.map +1 -1
  29. package/dist/tools/index.d.ts +3 -24
  30. package/dist/tools/index.d.ts.map +1 -1
  31. package/dist/tools.bundle.js +194 -2
  32. package/dist/types/index.d.ts +1 -0
  33. package/dist/types/index.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/panels/WorkspaceRepositoriesPanel/WorkspaceRepositoryCard.d.ts +0 -10
  36. package/dist/panels/WorkspaceRepositoriesPanel/WorkspaceRepositoryCard.d.ts.map +0 -1
@@ -320,7 +320,46 @@ 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$e = [
323
+ const __iconNode$j = [
324
+ [
325
+ "path",
326
+ {
327
+ d: "M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",
328
+ key: "lc1i9w"
329
+ }
330
+ ],
331
+ ["path", { d: "m7 16.5-4.74-2.85", key: "1o9zyk" }],
332
+ ["path", { d: "m7 16.5 5-3", key: "va8pkn" }],
333
+ ["path", { d: "M7 16.5v5.17", key: "jnp8gn" }],
334
+ [
335
+ "path",
336
+ {
337
+ d: "M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",
338
+ key: "8zsnat"
339
+ }
340
+ ],
341
+ ["path", { d: "m17 16.5-5-3", key: "8arw3v" }],
342
+ ["path", { d: "m17 16.5 4.74-2.85", key: "8rfmw" }],
343
+ ["path", { d: "M17 16.5v5.17", key: "k6z78m" }],
344
+ [
345
+ "path",
346
+ {
347
+ d: "M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",
348
+ key: "1xygjf"
349
+ }
350
+ ],
351
+ ["path", { d: "M12 8 7.26 5.15", key: "1vbdud" }],
352
+ ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
353
+ ["path", { d: "M12 13.5V8", key: "1io7kd" }]
354
+ ];
355
+ const Boxes = createLucideIcon("boxes", __iconNode$j);
356
+ /**
357
+ * @license lucide-react v0.552.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */
362
+ const __iconNode$i = [
324
363
  ["path", { d: "M10 12h4", key: "a56b0p" }],
325
364
  ["path", { d: "M10 8h4", key: "1sr2af" }],
326
365
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -333,47 +372,71 @@ const __iconNode$e = [
333
372
  ],
334
373
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
335
374
  ];
336
- const Building2 = createLucideIcon("building-2", __iconNode$e);
375
+ const Building2 = createLucideIcon("building-2", __iconNode$i);
337
376
  /**
338
377
  * @license lucide-react v0.552.0 - ISC
339
378
  *
340
379
  * This source code is licensed under the ISC license.
341
380
  * See the LICENSE file in the root directory of this source tree.
342
381
  */
343
- const __iconNode$d = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
344
- const Check = createLucideIcon("check", __iconNode$d);
382
+ const __iconNode$h = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
383
+ const Check = createLucideIcon("check", __iconNode$h);
345
384
  /**
346
385
  * @license lucide-react v0.552.0 - ISC
347
386
  *
348
387
  * This source code is licensed under the ISC license.
349
388
  * See the LICENSE file in the root directory of this source tree.
350
389
  */
351
- const __iconNode$c = [
390
+ const __iconNode$g = [
391
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
392
+ ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
393
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
394
+ ];
395
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$g);
396
+ /**
397
+ * @license lucide-react v0.552.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */
402
+ const __iconNode$f = [
352
403
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
353
404
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
354
405
  ];
355
- const Copy = createLucideIcon("copy", __iconNode$c);
406
+ const Copy = createLucideIcon("copy", __iconNode$f);
356
407
  /**
357
408
  * @license lucide-react v0.552.0 - ISC
358
409
  *
359
410
  * This source code is licensed under the ISC license.
360
411
  * See the LICENSE file in the root directory of this source tree.
361
412
  */
362
- const __iconNode$b = [
413
+ const __iconNode$e = [
414
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
415
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
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" }]
417
+ ];
418
+ const ExternalLink = createLucideIcon("external-link", __iconNode$e);
419
+ /**
420
+ * @license lucide-react v0.552.0 - ISC
421
+ *
422
+ * This source code is licensed under the ISC license.
423
+ * See the LICENSE file in the root directory of this source tree.
424
+ */
425
+ const __iconNode$d = [
363
426
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
364
427
  ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
365
428
  ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
366
429
  ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
367
430
  ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }]
368
431
  ];
369
- const Focus = createLucideIcon("focus", __iconNode$b);
432
+ const Focus = createLucideIcon("focus", __iconNode$d);
370
433
  /**
371
434
  * @license lucide-react v0.552.0 - ISC
372
435
  *
373
436
  * This source code is licensed under the ISC license.
374
437
  * See the LICENSE file in the root directory of this source tree.
375
438
  */
376
- const __iconNode$a = [
439
+ const __iconNode$c = [
377
440
  [
378
441
  "path",
379
442
  {
@@ -385,14 +448,14 @@ const __iconNode$a = [
385
448
  ["path", { d: "M18 19c-2.8 0-5-2.2-5-5v8", key: "pkpw2h" }],
386
449
  ["circle", { cx: "20", cy: "19", r: "2", key: "1obnsp" }]
387
450
  ];
388
- const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$a);
451
+ const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$c);
389
452
  /**
390
453
  * @license lucide-react v0.552.0 - ISC
391
454
  *
392
455
  * This source code is licensed under the ISC license.
393
456
  * See the LICENSE file in the root directory of this source tree.
394
457
  */
395
- const __iconNode$9 = [
458
+ const __iconNode$b = [
396
459
  [
397
460
  "path",
398
461
  {
@@ -401,14 +464,14 @@ const __iconNode$9 = [
401
464
  }
402
465
  ]
403
466
  ];
404
- const FolderOpen = createLucideIcon("folder-open", __iconNode$9);
467
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$b);
405
468
  /**
406
469
  * @license lucide-react v0.552.0 - ISC
407
470
  *
408
471
  * This source code is licensed under the ISC license.
409
472
  * See the LICENSE file in the root directory of this source tree.
410
473
  */
411
- const __iconNode$8 = [
474
+ const __iconNode$a = [
412
475
  [
413
476
  "path",
414
477
  {
@@ -417,14 +480,14 @@ const __iconNode$8 = [
417
480
  }
418
481
  ]
419
482
  ];
420
- const Folder = createLucideIcon("folder", __iconNode$8);
483
+ const Folder = createLucideIcon("folder", __iconNode$a);
421
484
  /**
422
485
  * @license lucide-react v0.552.0 - ISC
423
486
  *
424
487
  * This source code is licensed under the ISC license.
425
488
  * See the LICENSE file in the root directory of this source tree.
426
489
  */
427
- const __iconNode$7 = [
490
+ const __iconNode$9 = [
428
491
  ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
429
492
  [
430
493
  "path",
@@ -434,33 +497,52 @@ const __iconNode$7 = [
434
497
  }
435
498
  ]
436
499
  ];
437
- const House = createLucideIcon("house", __iconNode$7);
500
+ const House = createLucideIcon("house", __iconNode$9);
438
501
  /**
439
502
  * @license lucide-react v0.552.0 - ISC
440
503
  *
441
504
  * This source code is licensed under the ISC license.
442
505
  * See the LICENSE file in the root directory of this source tree.
443
506
  */
444
- const __iconNode$6 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
445
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$6);
507
+ const __iconNode$8 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
508
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$8);
446
509
  /**
447
510
  * @license lucide-react v0.552.0 - ISC
448
511
  *
449
512
  * This source code is licensed under the ISC license.
450
513
  * See the LICENSE file in the root directory of this source tree.
451
514
  */
452
- const __iconNode$5 = [
515
+ const __iconNode$7 = [
453
516
  ["path", { d: "M8 6L12 2L16 6", key: "1yvkyx" }],
454
517
  ["path", { d: "M12 2V22", key: "r89rzk" }]
455
518
  ];
456
- const MoveUp = createLucideIcon("move-up", __iconNode$5);
519
+ const MoveUp = createLucideIcon("move-up", __iconNode$7);
457
520
  /**
458
521
  * @license lucide-react v0.552.0 - ISC
459
522
  *
460
523
  * This source code is licensed under the ISC license.
461
524
  * See the LICENSE file in the root directory of this source tree.
462
525
  */
463
- const __iconNode$4 = [
526
+ const __iconNode$6 = [
527
+ [
528
+ "path",
529
+ {
530
+ d: "M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",
531
+ key: "1a0edw"
532
+ }
533
+ ],
534
+ ["path", { d: "M12 22V12", key: "d0xqtd" }],
535
+ ["polyline", { points: "3.29 7 12 12 20.71 7", key: "ousv84" }],
536
+ ["path", { d: "m7.5 4.27 9 5.15", key: "1c824w" }]
537
+ ];
538
+ const Package = createLucideIcon("package", __iconNode$6);
539
+ /**
540
+ * @license lucide-react v0.552.0 - ISC
541
+ *
542
+ * This source code is licensed under the ISC license.
543
+ * See the LICENSE file in the root directory of this source tree.
544
+ */
545
+ const __iconNode$5 = [
464
546
  [
465
547
  "path",
466
548
  {
@@ -470,18 +552,32 @@ const __iconNode$4 = [
470
552
  ],
471
553
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
472
554
  ];
473
- const Pencil = createLucideIcon("pencil", __iconNode$4);
555
+ const Pencil = createLucideIcon("pencil", __iconNode$5);
474
556
  /**
475
557
  * @license lucide-react v0.552.0 - ISC
476
558
  *
477
559
  * This source code is licensed under the ISC license.
478
560
  * See the LICENSE file in the root directory of this source tree.
479
561
  */
480
- const __iconNode$3 = [
562
+ const __iconNode$4 = [
481
563
  ["path", { d: "M5 12h14", key: "1ays0h" }],
482
564
  ["path", { d: "M12 5v14", key: "s699le" }]
483
565
  ];
484
- const Plus = createLucideIcon("plus", __iconNode$3);
566
+ const Plus = createLucideIcon("plus", __iconNode$4);
567
+ /**
568
+ * @license lucide-react v0.552.0 - ISC
569
+ *
570
+ * This source code is licensed under the ISC license.
571
+ * See the LICENSE file in the root directory of this source tree.
572
+ */
573
+ const __iconNode$3 = [
574
+ ["path", { d: "m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z", key: "7g6ntu" }],
575
+ ["path", { d: "m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z", key: "ijws7r" }],
576
+ ["path", { d: "M7 21h10", key: "1b0cd5" }],
577
+ ["path", { d: "M12 3v18", key: "108xh3" }],
578
+ ["path", { d: "M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2", key: "3gwbw2" }]
579
+ ];
580
+ const Scale = createLucideIcon("scale", __iconNode$3);
485
581
  /**
486
582
  * @license lucide-react v0.552.0 - ISC
487
583
  *
@@ -604,13 +700,20 @@ const LocalProjectCard = ({
604
700
  onOpen,
605
701
  onRemove,
606
702
  onAddToWorkspace,
703
+ onRemoveFromWorkspace,
704
+ onMoveToWorkspace,
607
705
  isLoading = false,
608
706
  windowState = "closed",
609
- compact: _compact = false
707
+ compact: _compact = false,
708
+ isEditMode = false,
709
+ isInWorkspaceDirectory,
710
+ workspacePath
610
711
  }) => {
611
712
  var _a, _b, _c, _d;
612
713
  const { theme: theme2 } = useTheme();
613
714
  const [copiedPath, setCopiedPath] = useState(false);
715
+ const [isMoving, setIsMoving] = useState(false);
716
+ const [isRemoving, setIsRemoving] = useState(false);
614
717
  const highlightColor = theme2.colors.primary;
615
718
  const avatarUrl = ((_a = entry.github) == null ? void 0 : _a.owner) ? `https://github.com/${entry.github.owner}.png` : null;
616
719
  const handleCardClick = () => {
@@ -628,6 +731,33 @@ const LocalProjectCard = ({
628
731
  e.stopPropagation();
629
732
  onAddToWorkspace == null ? void 0 : onAddToWorkspace(entry);
630
733
  };
734
+ const handleRemoveFromWorkspaceClick = async (e) => {
735
+ e.stopPropagation();
736
+ try {
737
+ setIsRemoving(true);
738
+ onRemoveFromWorkspace == null ? void 0 : onRemoveFromWorkspace(entry);
739
+ } finally {
740
+ setIsRemoving(false);
741
+ }
742
+ };
743
+ const handleMoveToWorkspaceClick = async (e) => {
744
+ e.stopPropagation();
745
+ try {
746
+ setIsMoving(true);
747
+ onMoveToWorkspace == null ? void 0 : onMoveToWorkspace(entry);
748
+ } finally {
749
+ setIsMoving(false);
750
+ }
751
+ };
752
+ const displayPath = useMemo(() => {
753
+ if (actionMode === "workspace" && isInWorkspaceDirectory && workspacePath) {
754
+ if (entry.path.startsWith(workspacePath)) {
755
+ const relativePath = entry.path.slice(workspacePath.length);
756
+ return relativePath.startsWith("/") ? relativePath.slice(1) : relativePath;
757
+ }
758
+ }
759
+ return entry.path;
760
+ }, [actionMode, isInWorkspaceDirectory, workspacePath, entry.path]);
631
761
  const handleCopyPath = async (e) => {
632
762
  e.stopPropagation();
633
763
  try {
@@ -672,6 +802,100 @@ const LocalProjectCard = ({
672
802
  }
673
803
  );
674
804
  }
805
+ if (actionMode === "workspace") {
806
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
807
+ isEditMode && isInWorkspaceDirectory === false && onMoveToWorkspace && /* @__PURE__ */ jsxs(
808
+ "button",
809
+ {
810
+ type: "button",
811
+ onClick: handleMoveToWorkspaceClick,
812
+ disabled: isMoving,
813
+ title: "Move to workspace directory",
814
+ style: {
815
+ flex: buttonFlex,
816
+ display: "inline-flex",
817
+ alignItems: "center",
818
+ justifyContent: "center",
819
+ padding: "6px 10px",
820
+ gap: "4px",
821
+ borderRadius: "4px",
822
+ border: `1px solid ${theme2.colors.primary || "#3b82f6"}`,
823
+ backgroundColor: `${theme2.colors.primary || "#3b82f6"}15`,
824
+ color: theme2.colors.primary || "#3b82f6",
825
+ fontSize: `${theme2.fontSizes[0]}px`,
826
+ fontWeight: theme2.fontWeights.medium,
827
+ cursor: isMoving ? "wait" : "pointer",
828
+ opacity: isMoving ? 0.6 : 1,
829
+ transition: "all 0.15s ease"
830
+ },
831
+ children: [
832
+ isMoving ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx(MoveUp, { size: 12 }),
833
+ isMoving ? "Moving..." : "Move"
834
+ ]
835
+ }
836
+ ),
837
+ /* @__PURE__ */ jsxs(
838
+ "button",
839
+ {
840
+ type: "button",
841
+ onClick: handleOpenClick,
842
+ title: "Open repository",
843
+ style: {
844
+ flex: buttonFlex,
845
+ display: "inline-flex",
846
+ alignItems: "center",
847
+ justifyContent: "center",
848
+ padding: "6px 10px",
849
+ gap: "4px",
850
+ borderRadius: "4px",
851
+ border: `1px solid ${theme2.colors.success || "#10b981"}`,
852
+ backgroundColor: `${theme2.colors.success || "#10b981"}15`,
853
+ color: theme2.colors.success || "#10b981",
854
+ fontSize: `${theme2.fontSizes[0]}px`,
855
+ fontWeight: theme2.fontWeights.medium,
856
+ cursor: "pointer",
857
+ transition: "all 0.15s ease"
858
+ },
859
+ children: [
860
+ /* @__PURE__ */ jsx(FolderOpen, { size: 12 }),
861
+ "Open"
862
+ ]
863
+ }
864
+ ),
865
+ isEditMode && onRemoveFromWorkspace && /* @__PURE__ */ jsxs(
866
+ "button",
867
+ {
868
+ type: "button",
869
+ onClick: handleRemoveFromWorkspaceClick,
870
+ disabled: isRemoving,
871
+ title: "Remove from workspace",
872
+ style: {
873
+ flex: buttonFlex,
874
+ display: "inline-flex",
875
+ alignItems: "center",
876
+ justifyContent: "center",
877
+ minWidth: isCompact ? void 0 : "28px",
878
+ height: "28px",
879
+ padding: isCompact ? "6px 10px" : 0,
880
+ gap: "4px",
881
+ borderRadius: "4px",
882
+ border: isCompact ? `1px solid ${theme2.colors.error || "#ef4444"}` : "none",
883
+ backgroundColor: isCompact ? `${theme2.colors.error || "#ef4444"}15` : "transparent",
884
+ color: isCompact ? theme2.colors.error || "#ef4444" : theme2.colors.textSecondary,
885
+ fontSize: `${theme2.fontSizes[0]}px`,
886
+ fontWeight: theme2.fontWeights.medium,
887
+ cursor: isRemoving ? "wait" : "pointer",
888
+ opacity: isRemoving ? 0.6 : 1,
889
+ transition: "all 0.15s ease"
890
+ },
891
+ children: [
892
+ isRemoving ? /* @__PURE__ */ jsx(LoaderCircle, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ jsx(X, { size: 14 }),
893
+ isCompact && (isRemoving ? "Removing..." : "Remove")
894
+ ]
895
+ }
896
+ )
897
+ ] });
898
+ }
675
899
  return /* @__PURE__ */ jsxs(Fragment, { children: [
676
900
  /* @__PURE__ */ jsxs(
677
901
  "button",
@@ -809,7 +1033,7 @@ const LocalProjectCard = ({
809
1033
  title: copiedPath ? "Copied!" : `Click to copy: ${entry.path}`,
810
1034
  children: [
811
1035
  copiedPath ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 }),
812
- entry.path
1036
+ displayPath
813
1037
  ]
814
1038
  }
815
1039
  ),
@@ -844,10 +1068,10 @@ const LocalProjectCard = ({
844
1068
  }
845
1069
  );
846
1070
  };
847
- const PANEL_ID$3 = "industry-theme.local-projects";
1071
+ const PANEL_ID$4 = "industry-theme.local-projects";
848
1072
  const createPanelEvent$1 = (type, payload) => ({
849
1073
  type,
850
- source: PANEL_ID$3,
1074
+ source: PANEL_ID$4,
851
1075
  timestamp: Date.now(),
852
1076
  payload
853
1077
  });
@@ -883,7 +1107,7 @@ const LocalProjectsPanelContent = ({
883
1107
  try {
884
1108
  await panelActions.openRepository(entry);
885
1109
  setWindowStates((prev) => new Map(prev).set(entry.path, "ready"));
886
- events.emit(createPanelEvent$1(`${PANEL_ID$3}:repository-opened`, { entry }));
1110
+ events.emit(createPanelEvent$1(`${PANEL_ID$4}:repository-opened`, { entry }));
887
1111
  } catch (error) {
888
1112
  console.error("Error opening repository:", error);
889
1113
  setWindowStates((prev) => new Map(prev).set(entry.path, "closed"));
@@ -894,14 +1118,14 @@ const LocalProjectsPanelContent = ({
894
1118
  useEffect(() => {
895
1119
  const unsubscribers = [
896
1120
  // Filter event from tools
897
- events.on(`${PANEL_ID$3}:filter`, (event) => {
1121
+ events.on(`${PANEL_ID$4}:filter`, (event) => {
898
1122
  var _a2;
899
1123
  if (((_a2 = event.payload) == null ? void 0 : _a2.filter) !== void 0) {
900
1124
  setFilter(event.payload.filter);
901
1125
  }
902
1126
  }),
903
1127
  // Select repository event from tools
904
- events.on(`${PANEL_ID$3}:select-repository`, (event) => {
1128
+ events.on(`${PANEL_ID$4}:select-repository`, (event) => {
905
1129
  var _a2;
906
1130
  const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
907
1131
  if (identifier) {
@@ -910,12 +1134,12 @@ const LocalProjectsPanelContent = ({
910
1134
  );
911
1135
  if (entry) {
912
1136
  setSelectedEntry(entry);
913
- events.emit(createPanelEvent$1(`${PANEL_ID$3}:repository-selected`, { entry }));
1137
+ events.emit(createPanelEvent$1(`${PANEL_ID$4}:repository-selected`, { entry }));
914
1138
  }
915
1139
  }
916
1140
  }),
917
1141
  // Open repository event from tools
918
- events.on(`${PANEL_ID$3}:open-repository`, (event) => {
1142
+ events.on(`${PANEL_ID$4}:open-repository`, (event) => {
919
1143
  var _a2;
920
1144
  const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
921
1145
  if (identifier) {
@@ -963,7 +1187,7 @@ const LocalProjectsPanelContent = ({
963
1187
  };
964
1188
  const handleSelectRepository = (entry) => {
965
1189
  setSelectedEntry(entry);
966
- events.emit(createPanelEvent$1(`${PANEL_ID$3}:repository-selected`, { entry }));
1190
+ events.emit(createPanelEvent$1(`${PANEL_ID$4}:repository-selected`, { entry }));
967
1191
  };
968
1192
  const normalizedFilter = filter.trim().toLowerCase();
969
1193
  const filteredAndSortedRepositories = useMemo(() => {
@@ -1224,365 +1448,47 @@ const LocalProjectsPanelPreview = () => {
1224
1448
  }
1225
1449
  );
1226
1450
  };
1227
- const WorkspaceRepositoryCard = ({
1228
- repository,
1229
- workspace,
1451
+ const PANEL_ID$3 = "industry-theme.workspace-repositories";
1452
+ const createPanelEvent = (type, payload) => ({
1453
+ type,
1454
+ source: PANEL_ID$3,
1455
+ timestamp: Date.now(),
1456
+ payload
1457
+ });
1458
+ const WorkspaceRepositoriesPanelContent = ({
1459
+ context,
1230
1460
  actions,
1231
- isEditMode = false,
1232
- isInWorkspaceDirectory,
1233
- onSelect,
1234
- onOpen,
1235
- onRemoveFromWorkspace,
1236
- onMoveToWorkspace
1461
+ events
1237
1462
  }) => {
1238
- var _a, _b;
1239
1463
  const { theme: theme2 } = useTheme();
1240
- const [isRemoving, setIsRemoving] = useState(false);
1241
- const [copiedPath, setCopiedPath] = useState(false);
1242
- const [isMoving, setIsMoving] = useState(false);
1243
- const handleCardClick = () => {
1244
- onSelect == null ? void 0 : onSelect(repository);
1245
- };
1246
- const handleOpenClick = (e) => {
1247
- e.stopPropagation();
1248
- onOpen == null ? void 0 : onOpen(repository);
1249
- };
1250
- const handleRemoveFromWorkspace = async (e) => {
1251
- e.stopPropagation();
1252
- if (!(workspace == null ? void 0 : workspace.id)) return;
1253
- if (!confirm(
1254
- `Remove ${repository.name} from workspace "${workspace.name}"?
1255
-
1256
- This will not delete any files, only remove the repository from this workspace.`
1257
- )) {
1258
- return;
1259
- }
1260
- try {
1261
- setIsRemoving(true);
1262
- onRemoveFromWorkspace == null ? void 0 : onRemoveFromWorkspace(repository);
1263
- } finally {
1264
- setIsRemoving(false);
1265
- }
1266
- };
1267
- const handleCopyPath = async (e) => {
1268
- e.stopPropagation();
1269
- try {
1270
- if (actions.copyToClipboard) {
1271
- await actions.copyToClipboard(repository.path);
1272
- } else {
1273
- await navigator.clipboard.writeText(repository.path);
1274
- }
1275
- setCopiedPath(true);
1276
- setTimeout(() => setCopiedPath(false), 2e3);
1277
- } catch (err) {
1278
- console.error("Failed to copy path:", err);
1279
- }
1280
- };
1281
- const handleMoveToWorkspace = async (e) => {
1282
- e.stopPropagation();
1283
- if (!(workspace == null ? void 0 : workspace.id) || !workspace.suggestedClonePath) return;
1284
- if (!confirm(
1285
- `Move ${repository.name} to ${workspace.suggestedClonePath}?
1286
-
1287
- This will move all files to the workspace directory.`
1288
- )) {
1289
- return;
1290
- }
1291
- try {
1292
- setIsMoving(true);
1293
- onMoveToWorkspace == null ? void 0 : onMoveToWorkspace(repository);
1294
- } finally {
1295
- setIsMoving(false);
1296
- }
1297
- };
1298
- const avatarUrl = ((_a = repository.github) == null ? void 0 : _a.owner) ? `https://github.com/${repository.github.owner}.png` : null;
1299
- const displayPath = React2.useMemo(() => {
1300
- if (isInWorkspaceDirectory && (workspace == null ? void 0 : workspace.suggestedClonePath)) {
1301
- const workspacePath = workspace.suggestedClonePath;
1302
- if (repository.path.startsWith(workspacePath)) {
1303
- const relativePath = repository.path.slice(workspacePath.length);
1304
- return relativePath.startsWith("/") ? relativePath.slice(1) : relativePath;
1464
+ const [isEditMode, setIsEditMode] = React2.useState(false);
1465
+ const [repositoryLocations, setRepositoryLocations] = React2.useState(
1466
+ /* @__PURE__ */ new Map()
1467
+ );
1468
+ const panelActions = actions;
1469
+ const workspaceSlice = context.getSlice("workspace");
1470
+ const repositoriesSlice = context.getSlice("workspaceRepositories");
1471
+ const workspace = (workspaceSlice == null ? void 0 : workspaceSlice.data) ?? null;
1472
+ const isLoading = (workspaceSlice == null ? void 0 : workspaceSlice.loading) || (repositoriesSlice == null ? void 0 : repositoriesSlice.loading) || false;
1473
+ const sortedRepositories = useMemo(() => {
1474
+ const repos = (repositoriesSlice == null ? void 0 : repositoriesSlice.data) ?? [];
1475
+ return [...repos].sort((a, b) => a.name.localeCompare(b.name));
1476
+ }, [repositoriesSlice == null ? void 0 : repositoriesSlice.data]);
1477
+ useEffect(() => {
1478
+ const checkLocations = async () => {
1479
+ if (!(workspace == null ? void 0 : workspace.id) || !panelActions.isRepositoryInWorkspaceDirectory || !sortedRepositories.length) {
1480
+ return;
1305
1481
  }
1306
- }
1307
- return repository.path;
1308
- }, [isInWorkspaceDirectory, workspace, repository.path]);
1309
- return /* @__PURE__ */ jsxs(
1310
- "div",
1311
- {
1312
- style: {
1313
- display: "flex",
1314
- alignItems: "center",
1315
- gap: "12px",
1316
- padding: "8px 12px",
1317
- borderRadius: "4px",
1318
- backgroundColor: "transparent",
1319
- border: "1px solid transparent",
1320
- cursor: "pointer",
1321
- transition: "background-color 0.15s"
1322
- },
1323
- onClick: handleCardClick,
1324
- onMouseEnter: (event) => {
1325
- event.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary;
1326
- },
1327
- onMouseLeave: (event) => {
1328
- event.currentTarget.style.backgroundColor = "transparent";
1329
- },
1330
- children: [
1331
- /* @__PURE__ */ jsx(
1332
- RepositoryAvatar,
1333
- {
1334
- customAvatarUrl: avatarUrl,
1335
- size: 32,
1336
- fallbackIcon: /* @__PURE__ */ jsx(
1337
- "div",
1338
- {
1339
- style: {
1340
- color: theme2.colors.textSecondary,
1341
- fontSize: `${theme2.fontSizes[1]}px`,
1342
- fontWeight: theme2.fontWeights.semibold,
1343
- fontFamily: theme2.fonts.body
1344
- },
1345
- children: ((_b = repository.name[0]) == null ? void 0 : _b.toUpperCase()) || "?"
1346
- }
1347
- )
1348
- }
1349
- ),
1350
- /* @__PURE__ */ jsxs(
1351
- "div",
1352
- {
1353
- style: {
1354
- flex: 1,
1355
- minWidth: 0,
1356
- display: "flex",
1357
- flexDirection: "column",
1358
- gap: "4px"
1359
- },
1360
- children: [
1361
- /* @__PURE__ */ jsx(
1362
- "div",
1363
- {
1364
- style: {
1365
- display: "flex",
1366
- alignItems: "center",
1367
- gap: "6px",
1368
- flexWrap: "wrap"
1369
- },
1370
- children: /* @__PURE__ */ jsx(
1371
- "span",
1372
- {
1373
- style: {
1374
- fontSize: `${theme2.fontSizes[2]}px`,
1375
- fontWeight: theme2.fontWeights.medium,
1376
- fontFamily: theme2.fonts.body,
1377
- color: theme2.colors.text
1378
- },
1379
- children: repository.name
1380
- }
1381
- )
1382
- }
1383
- ),
1384
- /* @__PURE__ */ jsxs(
1385
- "div",
1386
- {
1387
- onClick: handleCopyPath,
1388
- style: {
1389
- fontSize: `${theme2.fontSizes[0]}px`,
1390
- fontFamily: theme2.fonts.monospace,
1391
- color: copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.textTertiary || theme2.colors.textSecondary,
1392
- overflow: "hidden",
1393
- textOverflow: "ellipsis",
1394
- whiteSpace: "nowrap",
1395
- cursor: "pointer",
1396
- display: "flex",
1397
- alignItems: "center",
1398
- gap: "4px",
1399
- transition: "color 0.15s ease"
1400
- },
1401
- title: copiedPath ? "Copied!" : `Click to copy: ${repository.path}`,
1402
- onMouseEnter: (event) => {
1403
- if (!copiedPath) {
1404
- event.currentTarget.style.color = theme2.colors.textSecondary;
1405
- }
1406
- },
1407
- onMouseLeave: (event) => {
1408
- if (!copiedPath) {
1409
- event.currentTarget.style.color = theme2.colors.textTertiary || theme2.colors.textSecondary;
1410
- }
1411
- },
1412
- children: [
1413
- copiedPath ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 }),
1414
- displayPath
1415
- ]
1416
- }
1417
- )
1418
- ]
1419
- }
1420
- ),
1421
- /* @__PURE__ */ jsxs(
1422
- "div",
1423
- {
1424
- style: {
1425
- display: "flex",
1426
- gap: "4px",
1427
- flexShrink: 0,
1428
- alignItems: "center"
1429
- },
1430
- children: [
1431
- isEditMode && workspace && workspace.suggestedClonePath && isInWorkspaceDirectory === false && /* @__PURE__ */ jsxs(
1432
- "button",
1433
- {
1434
- type: "button",
1435
- onClick: handleMoveToWorkspace,
1436
- disabled: isMoving,
1437
- title: `Move to ${workspace.suggestedClonePath}`,
1438
- style: {
1439
- display: "inline-flex",
1440
- alignItems: "center",
1441
- justifyContent: "center",
1442
- padding: "6px 10px",
1443
- gap: "4px",
1444
- borderRadius: "4px",
1445
- border: `1px solid ${theme2.colors.primary || "#3b82f6"}`,
1446
- backgroundColor: `${theme2.colors.primary || "#3b82f6"}15`,
1447
- color: theme2.colors.primary || "#3b82f6",
1448
- fontSize: `${theme2.fontSizes[0]}px`,
1449
- fontWeight: theme2.fontWeights.medium,
1450
- fontFamily: theme2.fonts.body,
1451
- cursor: isMoving ? "wait" : "pointer",
1452
- opacity: isMoving ? 0.6 : 1,
1453
- transition: "all 0.15s ease"
1454
- },
1455
- onMouseEnter: (event) => {
1456
- if (!isMoving) {
1457
- event.currentTarget.style.backgroundColor = `${theme2.colors.primary || "#3b82f6"}25`;
1458
- }
1459
- },
1460
- onMouseLeave: (event) => {
1461
- event.currentTarget.style.backgroundColor = `${theme2.colors.primary || "#3b82f6"}15`;
1462
- },
1463
- children: [
1464
- isMoving ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx(MoveUp, { size: 12 }),
1465
- isMoving ? "Moving..." : "Move"
1466
- ]
1467
- }
1468
- ),
1469
- /* @__PURE__ */ jsxs(
1470
- "button",
1471
- {
1472
- type: "button",
1473
- onClick: handleOpenClick,
1474
- title: "Open repository",
1475
- style: {
1476
- display: "inline-flex",
1477
- alignItems: "center",
1478
- justifyContent: "center",
1479
- padding: "6px 10px",
1480
- gap: "4px",
1481
- borderRadius: "4px",
1482
- border: `1px solid ${theme2.colors.success || "#10b981"}`,
1483
- backgroundColor: `${theme2.colors.success || "#10b981"}15`,
1484
- color: theme2.colors.success || "#10b981",
1485
- fontSize: `${theme2.fontSizes[0]}px`,
1486
- fontWeight: theme2.fontWeights.medium,
1487
- fontFamily: theme2.fonts.body,
1488
- cursor: "pointer",
1489
- transition: "all 0.15s ease"
1490
- },
1491
- onMouseEnter: (event) => {
1492
- event.currentTarget.style.backgroundColor = `${theme2.colors.success || "#10b981"}25`;
1493
- },
1494
- onMouseLeave: (event) => {
1495
- event.currentTarget.style.backgroundColor = `${theme2.colors.success || "#10b981"}15`;
1496
- },
1497
- children: [
1498
- /* @__PURE__ */ jsx(FolderOpen, { size: 12 }),
1499
- "Open"
1500
- ]
1501
- }
1502
- ),
1503
- isEditMode && workspace && /* @__PURE__ */ jsx(
1504
- "button",
1505
- {
1506
- type: "button",
1507
- onClick: handleRemoveFromWorkspace,
1508
- disabled: isRemoving,
1509
- title: `Remove from workspace "${workspace.name}"`,
1510
- style: {
1511
- display: "inline-flex",
1512
- alignItems: "center",
1513
- justifyContent: "center",
1514
- width: "28px",
1515
- height: "28px",
1516
- padding: 0,
1517
- borderRadius: "4px",
1518
- border: "none",
1519
- backgroundColor: "transparent",
1520
- color: theme2.colors.textSecondary,
1521
- cursor: isRemoving ? "wait" : "pointer",
1522
- opacity: isRemoving ? 0.6 : 1,
1523
- transition: "all 0.15s ease"
1524
- },
1525
- onMouseEnter: (event) => {
1526
- if (!isRemoving) {
1527
- event.currentTarget.style.backgroundColor = theme2.colors.error || "#ef4444";
1528
- event.currentTarget.style.color = "#fff";
1529
- }
1530
- },
1531
- onMouseLeave: (event) => {
1532
- event.currentTarget.style.backgroundColor = "transparent";
1533
- event.currentTarget.style.color = theme2.colors.textSecondary;
1534
- },
1535
- children: isRemoving ? /* @__PURE__ */ jsx(LoaderCircle, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ jsx(X, { size: 14 })
1536
- }
1537
- )
1538
- ]
1539
- }
1540
- )
1541
- ]
1542
- }
1543
- );
1544
- };
1545
- const PANEL_ID$2 = "industry-theme.workspace-repositories";
1546
- const createPanelEvent = (type, payload) => ({
1547
- type,
1548
- source: PANEL_ID$2,
1549
- timestamp: Date.now(),
1550
- payload
1551
- });
1552
- const WorkspaceRepositoriesPanelContent = ({
1553
- context,
1554
- actions,
1555
- events
1556
- }) => {
1557
- const { theme: theme2 } = useTheme();
1558
- const [isEditMode, setIsEditMode] = React2.useState(false);
1559
- const [repositoryLocations, setRepositoryLocations] = React2.useState(
1560
- /* @__PURE__ */ new Map()
1561
- );
1562
- const panelActions = actions;
1563
- const workspaceSlice = context.getSlice("workspace");
1564
- const repositoriesSlice = context.getSlice("workspaceRepositories");
1565
- const workspace = (workspaceSlice == null ? void 0 : workspaceSlice.data) ?? null;
1566
- const isLoading = (workspaceSlice == null ? void 0 : workspaceSlice.loading) || (repositoriesSlice == null ? void 0 : repositoriesSlice.loading) || false;
1567
- const sortedRepositories = useMemo(() => {
1568
- const repos = (repositoriesSlice == null ? void 0 : repositoriesSlice.data) ?? [];
1569
- return [...repos].sort((a, b) => a.name.localeCompare(b.name));
1570
- }, [repositoriesSlice == null ? void 0 : repositoriesSlice.data]);
1571
- useEffect(() => {
1572
- const checkLocations = async () => {
1573
- if (!(workspace == null ? void 0 : workspace.id) || !panelActions.isRepositoryInWorkspaceDirectory || !sortedRepositories.length) {
1574
- return;
1575
- }
1576
- const locationMap = /* @__PURE__ */ new Map();
1577
- await Promise.all(
1578
- sortedRepositories.map(async (repo) => {
1579
- try {
1580
- const isInWorkspace = await panelActions.isRepositoryInWorkspaceDirectory(repo, workspace.id);
1581
- if (isInWorkspace !== null) {
1582
- locationMap.set(repo.path, isInWorkspace);
1583
- }
1584
- } catch (error) {
1585
- console.error(`Failed to check location for ${repo.name}:`, error);
1482
+ const locationMap = /* @__PURE__ */ new Map();
1483
+ await Promise.all(
1484
+ sortedRepositories.map(async (repo) => {
1485
+ try {
1486
+ const isInWorkspace = await panelActions.isRepositoryInWorkspaceDirectory(repo, workspace.id);
1487
+ if (isInWorkspace !== null) {
1488
+ locationMap.set(repo.path, isInWorkspace);
1489
+ }
1490
+ } catch (error) {
1491
+ console.error(`Failed to check location for ${repo.name}:`, error);
1586
1492
  }
1587
1493
  })
1588
1494
  );
@@ -1661,7 +1567,7 @@ const WorkspaceRepositoriesPanelContent = ({
1661
1567
  );
1662
1568
  useEffect(() => {
1663
1569
  const unsubscribers = [
1664
- events.on(`${PANEL_ID$2}:select-repository`, (event) => {
1570
+ events.on(`${PANEL_ID$3}:select-repository`, (event) => {
1665
1571
  var _a;
1666
1572
  const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
1667
1573
  if (path) {
@@ -1671,7 +1577,7 @@ const WorkspaceRepositoriesPanelContent = ({
1671
1577
  }
1672
1578
  }
1673
1579
  }),
1674
- events.on(`${PANEL_ID$2}:open-repository`, (event) => {
1580
+ events.on(`${PANEL_ID$3}:open-repository`, (event) => {
1675
1581
  var _a;
1676
1582
  const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
1677
1583
  if (path) {
@@ -2004,13 +1910,13 @@ const WorkspaceRepositoriesPanelContent = ({
2004
1910
  }
2005
1911
  ),
2006
1912
  /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesInWorkspace.map((repository) => /* @__PURE__ */ jsx(
2007
- WorkspaceRepositoryCard,
1913
+ LocalProjectCard,
2008
1914
  {
2009
- repository,
2010
- workspace,
2011
- actions: panelActions,
1915
+ entry: repository,
1916
+ actionMode: "workspace",
2012
1917
  isEditMode,
2013
1918
  isInWorkspaceDirectory: true,
1919
+ workspacePath: workspace.suggestedClonePath,
2014
1920
  onSelect: handleSelectRepository,
2015
1921
  onOpen: handleOpenRepository,
2016
1922
  onRemoveFromWorkspace: handleRemoveFromWorkspace,
@@ -2070,13 +1976,13 @@ const WorkspaceRepositoriesPanelContent = ({
2070
1976
  }
2071
1977
  ),
2072
1978
  /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesOutsideWorkspace.map((repository) => /* @__PURE__ */ jsx(
2073
- WorkspaceRepositoryCard,
1979
+ LocalProjectCard,
2074
1980
  {
2075
- repository,
2076
- workspace,
2077
- actions: panelActions,
1981
+ entry: repository,
1982
+ actionMode: "workspace",
2078
1983
  isEditMode,
2079
1984
  isInWorkspaceDirectory: false,
1985
+ workspacePath: workspace.suggestedClonePath,
2080
1986
  onSelect: handleSelectRepository,
2081
1987
  onOpen: handleOpenRepository,
2082
1988
  onRemoveFromWorkspace: handleRemoveFromWorkspace,
@@ -2093,63 +1999,943 @@ const WorkspaceRepositoriesPanelContent = ({
2093
1999
  const WorkspaceRepositoriesPanel = (props) => {
2094
2000
  return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(WorkspaceRepositoriesPanelContent, { ...props }) });
2095
2001
  };
2096
- const PANEL_ID$1 = "industry-theme.local-projects";
2097
- const filterProjectsTool = {
2098
- name: "filter_projects",
2099
- description: "Filter the local projects list by name, owner, or path",
2100
- inputs: {
2101
- type: "object",
2102
- properties: {
2103
- filter: {
2104
- type: "string",
2105
- description: "Search term to filter projects (matches name, owner, or path)"
2106
- }
2107
- },
2108
- required: ["filter"]
2109
- },
2110
- outputs: {
2111
- type: "object",
2112
- properties: {
2113
- success: { type: "boolean" },
2114
- message: { type: "string" }
2002
+ const DependencyInfoModal = ({
2003
+ isOpen,
2004
+ onClose
2005
+ }) => {
2006
+ const { theme: theme2 } = useTheme();
2007
+ if (!isOpen) return null;
2008
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2009
+ "div",
2010
+ {
2011
+ style: {
2012
+ position: "fixed",
2013
+ top: 0,
2014
+ left: 0,
2015
+ right: 0,
2016
+ bottom: 0,
2017
+ backgroundColor: theme2.colors.muted,
2018
+ zIndex: theme2.zIndices[4],
2019
+ display: "flex",
2020
+ alignItems: "center",
2021
+ justifyContent: "center"
2022
+ },
2023
+ onClick: onClose,
2024
+ children: /* @__PURE__ */ jsxs(
2025
+ "div",
2026
+ {
2027
+ style: {
2028
+ backgroundColor: theme2.colors.background,
2029
+ borderRadius: `${theme2.radii[3]}px`,
2030
+ maxWidth: "600px",
2031
+ maxHeight: "80vh",
2032
+ width: "90%",
2033
+ overflow: "hidden",
2034
+ display: "flex",
2035
+ flexDirection: "column",
2036
+ boxShadow: theme2.shadows[3]
2037
+ },
2038
+ onClick: (e) => e.stopPropagation(),
2039
+ children: [
2040
+ /* @__PURE__ */ jsxs(
2041
+ "div",
2042
+ {
2043
+ style: {
2044
+ padding: `${theme2.space[4]}px`,
2045
+ borderBottom: `1px solid ${theme2.colors.border}`,
2046
+ display: "flex",
2047
+ alignItems: "center",
2048
+ justifyContent: "space-between"
2049
+ },
2050
+ children: [
2051
+ /* @__PURE__ */ jsxs(
2052
+ "h2",
2053
+ {
2054
+ style: {
2055
+ fontSize: `${theme2.fontSizes[4]}px`,
2056
+ fontWeight: theme2.fontWeights.semibold,
2057
+ color: theme2.colors.text,
2058
+ display: "flex",
2059
+ alignItems: "center",
2060
+ gap: `${theme2.space[2]}px`,
2061
+ margin: 0
2062
+ },
2063
+ children: [
2064
+ /* @__PURE__ */ jsx(CircleQuestionMark, { size: 20 }),
2065
+ "Understanding Dependencies"
2066
+ ]
2067
+ }
2068
+ ),
2069
+ /* @__PURE__ */ jsx(
2070
+ "button",
2071
+ {
2072
+ onClick: onClose,
2073
+ style: {
2074
+ background: "none",
2075
+ border: "none",
2076
+ color: theme2.colors.textSecondary,
2077
+ cursor: "pointer",
2078
+ padding: `${theme2.space[1]}px`
2079
+ },
2080
+ children: /* @__PURE__ */ jsx(X, { size: 20 })
2081
+ }
2082
+ )
2083
+ ]
2084
+ }
2085
+ ),
2086
+ /* @__PURE__ */ jsxs(
2087
+ "div",
2088
+ {
2089
+ style: {
2090
+ padding: `${theme2.space[4]}px`,
2091
+ overflow: "auto",
2092
+ flex: 1
2093
+ },
2094
+ children: [
2095
+ /* @__PURE__ */ jsxs(
2096
+ Section,
2097
+ {
2098
+ icon: /* @__PURE__ */ jsx(Package, { size: 18 }),
2099
+ title: "Dependency Types",
2100
+ theme: theme2,
2101
+ children: [
2102
+ /* @__PURE__ */ jsx(
2103
+ InfoItem,
2104
+ {
2105
+ badge: { text: "prod", color: theme2.colors.primary },
2106
+ title: "Production Dependencies",
2107
+ description: "Required for your application to run in production. These are bundled with your app and affect its size and security.",
2108
+ theme: theme2
2109
+ }
2110
+ ),
2111
+ /* @__PURE__ */ jsx(
2112
+ InfoItem,
2113
+ {
2114
+ badge: { text: "dev", color: theme2.colors.secondary },
2115
+ title: "Development Dependencies",
2116
+ description: "Only needed during development (build tools, testing, linters). Not included in production builds.",
2117
+ theme: theme2
2118
+ }
2119
+ ),
2120
+ /* @__PURE__ */ jsx(
2121
+ InfoItem,
2122
+ {
2123
+ badge: { text: "peer", color: theme2.colors.accent },
2124
+ title: "Peer Dependencies",
2125
+ description: "Expected to be provided by the consumer of your package. Important for library authors to specify compatibility.",
2126
+ theme: theme2
2127
+ }
2128
+ )
2129
+ ]
2130
+ }
2131
+ ),
2132
+ /* @__PURE__ */ jsxs(
2133
+ Section,
2134
+ {
2135
+ icon: /* @__PURE__ */ jsx(Scale, { size: 18 }),
2136
+ title: "Common Licenses",
2137
+ theme: theme2,
2138
+ children: [
2139
+ /* @__PURE__ */ jsx(
2140
+ InfoItem,
2141
+ {
2142
+ badge: { text: "MIT", color: theme2.colors.success },
2143
+ title: "Permissive Licenses (MIT, Apache, BSD)",
2144
+ description: "Few restrictions. Can use in commercial projects. Must include copyright notice.",
2145
+ theme: theme2
2146
+ }
2147
+ ),
2148
+ /* @__PURE__ */ jsx(
2149
+ InfoItem,
2150
+ {
2151
+ badge: { text: "GPL", color: theme2.colors.warning },
2152
+ title: "Copyleft Licenses (GPL, LGPL, AGPL)",
2153
+ description: "Requires sharing source code of derivative works. Can impact your project's licensing.",
2154
+ theme: theme2
2155
+ }
2156
+ )
2157
+ ]
2158
+ }
2159
+ )
2160
+ ]
2161
+ }
2162
+ )
2163
+ ]
2164
+ }
2165
+ )
2115
2166
  }
2116
- },
2117
- tags: ["filter", "search", "projects"],
2118
- tool_call_template: {
2119
- call_template_type: "panel_event",
2120
- event_type: `${PANEL_ID$1}:filter`
2121
- }
2167
+ ) });
2122
2168
  };
2123
- const selectProjectTool = {
2124
- name: "select_project",
2125
- description: "Select a project by name or path to view its details",
2126
- inputs: {
2127
- type: "object",
2128
- properties: {
2129
- identifier: {
2130
- type: "string",
2131
- description: "Project name or full path to select"
2132
- }
2133
- },
2134
- required: ["identifier"]
2135
- },
2136
- outputs: {
2137
- type: "object",
2138
- properties: {
2139
- success: { type: "boolean" },
2140
- selectedProject: { type: "string" }
2169
+ const Section = ({ icon, title, theme: theme2, children }) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: `${theme2.space[5]}px` }, children: [
2170
+ /* @__PURE__ */ jsxs(
2171
+ "h3",
2172
+ {
2173
+ style: {
2174
+ fontSize: `${theme2.fontSizes[2]}px`,
2175
+ fontWeight: theme2.fontWeights.semibold,
2176
+ color: theme2.colors.text,
2177
+ marginBottom: `${theme2.space[3]}px`,
2178
+ display: "flex",
2179
+ alignItems: "center",
2180
+ gap: `${theme2.space[2]}px`
2181
+ },
2182
+ children: [
2183
+ icon,
2184
+ title
2185
+ ]
2141
2186
  }
2142
- },
2143
- tags: ["select", "project", "navigation"],
2144
- tool_call_template: {
2145
- call_template_type: "panel_event",
2146
- event_type: `${PANEL_ID$1}:select-repository`
2147
- }
2148
- };
2149
- const openProjectTool = {
2150
- name: "open_project",
2151
- description: "Open a local project in the development workspace",
2152
- inputs: {
2187
+ ),
2188
+ /* @__PURE__ */ jsx(
2189
+ "div",
2190
+ {
2191
+ style: {
2192
+ display: "flex",
2193
+ flexDirection: "column",
2194
+ gap: `${theme2.space[2]}px`
2195
+ },
2196
+ children
2197
+ }
2198
+ )
2199
+ ] });
2200
+ const InfoItem = ({ badge, title, description, theme: theme2 }) => /* @__PURE__ */ jsxs(
2201
+ "div",
2202
+ {
2203
+ style: {
2204
+ padding: `${theme2.space[3]}px`,
2205
+ backgroundColor: theme2.colors.backgroundSecondary,
2206
+ borderRadius: `${theme2.radii[2]}px`,
2207
+ border: `1px solid ${theme2.colors.border}`
2208
+ },
2209
+ children: [
2210
+ /* @__PURE__ */ jsxs(
2211
+ "div",
2212
+ {
2213
+ style: {
2214
+ display: "flex",
2215
+ alignItems: "center",
2216
+ gap: `${theme2.space[2]}px`,
2217
+ marginBottom: `${theme2.space[1]}px`
2218
+ },
2219
+ children: [
2220
+ /* @__PURE__ */ jsx(
2221
+ "span",
2222
+ {
2223
+ style: {
2224
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
2225
+ borderRadius: `${theme2.radii[1]}px`,
2226
+ fontSize: `${theme2.fontSizes[0]}px`,
2227
+ fontWeight: theme2.fontWeights.medium,
2228
+ backgroundColor: `${badge.color}20`,
2229
+ color: badge.color
2230
+ },
2231
+ children: badge.text
2232
+ }
2233
+ ),
2234
+ /* @__PURE__ */ jsx(
2235
+ "span",
2236
+ {
2237
+ style: {
2238
+ fontSize: `${theme2.fontSizes[1]}px`,
2239
+ fontWeight: theme2.fontWeights.medium,
2240
+ color: theme2.colors.text
2241
+ },
2242
+ children: title
2243
+ }
2244
+ )
2245
+ ]
2246
+ }
2247
+ ),
2248
+ /* @__PURE__ */ jsx(
2249
+ "div",
2250
+ {
2251
+ style: {
2252
+ fontSize: `${theme2.fontSizes[1]}px`,
2253
+ color: theme2.colors.textSecondary,
2254
+ lineHeight: theme2.lineHeights.relaxed
2255
+ },
2256
+ children: description
2257
+ }
2258
+ )
2259
+ ]
2260
+ }
2261
+ );
2262
+ const DependencyRow = ({ dependency }) => {
2263
+ const { theme: theme2 } = useTheme();
2264
+ const getDependencyTypeBadgeStyle = (type) => {
2265
+ const baseStyle = {
2266
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
2267
+ borderRadius: `${theme2.radii[1]}px`,
2268
+ fontSize: `${theme2.fontSizes[0]}px`,
2269
+ fontWeight: theme2.fontWeights.medium,
2270
+ minWidth: "36px",
2271
+ textAlign: "center"
2272
+ };
2273
+ switch (type) {
2274
+ case "production":
2275
+ return {
2276
+ ...baseStyle,
2277
+ backgroundColor: `${theme2.colors.primary}20`,
2278
+ color: theme2.colors.primary
2279
+ };
2280
+ case "development":
2281
+ return {
2282
+ ...baseStyle,
2283
+ backgroundColor: `${theme2.colors.secondary}20`,
2284
+ color: theme2.colors.secondary
2285
+ };
2286
+ case "peer":
2287
+ return {
2288
+ ...baseStyle,
2289
+ backgroundColor: `${theme2.colors.accent}20`,
2290
+ color: theme2.colors.accent
2291
+ };
2292
+ default:
2293
+ return {
2294
+ ...baseStyle,
2295
+ backgroundColor: theme2.colors.backgroundLight,
2296
+ color: theme2.colors.textSecondary
2297
+ };
2298
+ }
2299
+ };
2300
+ return /* @__PURE__ */ jsxs(
2301
+ "div",
2302
+ {
2303
+ style: {
2304
+ display: "flex",
2305
+ alignItems: "center",
2306
+ justifyContent: "space-between",
2307
+ padding: `${theme2.space[2]}px ${theme2.space[3]}px`,
2308
+ backgroundColor: theme2.colors.background,
2309
+ borderRadius: `${theme2.radii[1]}px`,
2310
+ fontSize: `${theme2.fontSizes[1]}px`,
2311
+ border: `1px solid ${theme2.colors.border}`,
2312
+ transition: "all 0.2s"
2313
+ },
2314
+ children: [
2315
+ /* @__PURE__ */ jsxs(
2316
+ "div",
2317
+ {
2318
+ style: {
2319
+ display: "flex",
2320
+ alignItems: "center",
2321
+ gap: `${theme2.space[2]}px`,
2322
+ flex: 1,
2323
+ minWidth: 0
2324
+ },
2325
+ children: [
2326
+ /* @__PURE__ */ jsx("span", { style: getDependencyTypeBadgeStyle(dependency.dependencyType), children: dependency.dependencyType === "production" ? "prod" : dependency.dependencyType === "development" ? "dev" : "peer" }),
2327
+ /* @__PURE__ */ jsx(
2328
+ "span",
2329
+ {
2330
+ style: {
2331
+ fontWeight: theme2.fontWeights.medium,
2332
+ color: theme2.colors.text,
2333
+ overflow: "hidden",
2334
+ textOverflow: "ellipsis",
2335
+ whiteSpace: "nowrap"
2336
+ },
2337
+ children: dependency.name
2338
+ }
2339
+ )
2340
+ ]
2341
+ }
2342
+ ),
2343
+ /* @__PURE__ */ jsxs(
2344
+ "div",
2345
+ {
2346
+ style: {
2347
+ display: "flex",
2348
+ alignItems: "center",
2349
+ gap: "8px"
2350
+ },
2351
+ children: [
2352
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: dependency.version }),
2353
+ /* @__PURE__ */ jsx(
2354
+ "a",
2355
+ {
2356
+ href: `https://www.npmjs.com/package/${dependency.name}`,
2357
+ target: "_blank",
2358
+ rel: "noopener noreferrer",
2359
+ style: {
2360
+ padding: `${theme2.space[1]}px`,
2361
+ borderRadius: `${theme2.radii[1]}px`,
2362
+ display: "flex",
2363
+ alignItems: "center",
2364
+ transition: "background-color 0.2s"
2365
+ },
2366
+ title: "View on npm",
2367
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 12, color: theme2.colors.textSecondary })
2368
+ }
2369
+ )
2370
+ ]
2371
+ }
2372
+ )
2373
+ ]
2374
+ }
2375
+ );
2376
+ };
2377
+ const FilterBar = ({
2378
+ activeFilters,
2379
+ onToggleFilter,
2380
+ searchQuery,
2381
+ onSearchChange,
2382
+ counts
2383
+ }) => {
2384
+ const { theme: theme2 } = useTheme();
2385
+ const availableFilters = [
2386
+ ...counts.peer > 0 ? ["peer"] : [],
2387
+ ...counts.production > 0 ? ["production"] : [],
2388
+ ...counts.development > 0 ? ["development"] : []
2389
+ ];
2390
+ const showFilters = availableFilters.length > 1;
2391
+ return /* @__PURE__ */ jsxs(
2392
+ "div",
2393
+ {
2394
+ style: {
2395
+ display: "flex",
2396
+ flexDirection: "column",
2397
+ gap: `${theme2.space[2]}px`
2398
+ },
2399
+ children: [
2400
+ /* @__PURE__ */ jsxs(
2401
+ "div",
2402
+ {
2403
+ style: {
2404
+ position: "relative",
2405
+ display: "flex",
2406
+ alignItems: "center"
2407
+ },
2408
+ children: [
2409
+ /* @__PURE__ */ jsx(
2410
+ Search,
2411
+ {
2412
+ size: 14,
2413
+ style: {
2414
+ position: "absolute",
2415
+ left: `${theme2.space[3]}px`,
2416
+ color: theme2.colors.textSecondary,
2417
+ pointerEvents: "none"
2418
+ }
2419
+ }
2420
+ ),
2421
+ /* @__PURE__ */ jsx(
2422
+ "input",
2423
+ {
2424
+ type: "text",
2425
+ placeholder: "Search dependencies...",
2426
+ value: searchQuery,
2427
+ onChange: (e) => onSearchChange(e.target.value),
2428
+ style: {
2429
+ width: "100%",
2430
+ padding: `${theme2.space[2]}px ${theme2.space[5]}px`,
2431
+ borderRadius: `${theme2.radii[2]}px`,
2432
+ border: `1px solid ${theme2.colors.border}`,
2433
+ backgroundColor: theme2.colors.backgroundSecondary,
2434
+ color: theme2.colors.text,
2435
+ fontSize: `${theme2.fontSizes[1]}px`,
2436
+ fontFamily: theme2.fonts.body,
2437
+ outline: "none",
2438
+ transition: "all 0.2s"
2439
+ }
2440
+ }
2441
+ ),
2442
+ searchQuery && /* @__PURE__ */ jsx(
2443
+ "button",
2444
+ {
2445
+ onClick: () => onSearchChange(""),
2446
+ style: {
2447
+ position: "absolute",
2448
+ right: `${theme2.space[2]}px`,
2449
+ padding: `${theme2.space[1]}px`,
2450
+ display: "flex",
2451
+ alignItems: "center",
2452
+ justifyContent: "center",
2453
+ backgroundColor: "transparent",
2454
+ border: "none",
2455
+ cursor: "pointer",
2456
+ borderRadius: `${theme2.radii[1]}px`
2457
+ },
2458
+ title: "Clear search",
2459
+ children: /* @__PURE__ */ jsx(X, { size: 14, color: theme2.colors.textSecondary })
2460
+ }
2461
+ )
2462
+ ]
2463
+ }
2464
+ ),
2465
+ showFilters && /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: `${theme2.space[1]}px`, width: "100%" }, children: availableFilters.map((type) => {
2466
+ const isActive = activeFilters.has(type);
2467
+ return /* @__PURE__ */ jsxs(
2468
+ "button",
2469
+ {
2470
+ onClick: () => onToggleFilter(type),
2471
+ style: {
2472
+ flex: 1,
2473
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
2474
+ fontSize: `${theme2.fontSizes[0]}px`,
2475
+ fontWeight: theme2.fontWeights.medium,
2476
+ fontFamily: theme2.fonts.body,
2477
+ borderRadius: `${theme2.radii[1]}px`,
2478
+ border: `1px solid ${isActive ? theme2.colors.primary : theme2.colors.border}`,
2479
+ backgroundColor: isActive ? `${theme2.colors.primary}20` : theme2.colors.backgroundSecondary,
2480
+ color: isActive ? theme2.colors.primary : theme2.colors.text,
2481
+ cursor: "pointer",
2482
+ transition: "all 0.2s"
2483
+ },
2484
+ children: [
2485
+ type === "production" ? "Prod" : type === "development" ? "Dev" : "Peer",
2486
+ /* @__PURE__ */ jsxs(
2487
+ "span",
2488
+ {
2489
+ style: { marginLeft: `${theme2.space[1]}px`, opacity: 0.7 },
2490
+ children: [
2491
+ "(",
2492
+ counts[type],
2493
+ ")"
2494
+ ]
2495
+ }
2496
+ )
2497
+ ]
2498
+ },
2499
+ type
2500
+ );
2501
+ }) })
2502
+ ]
2503
+ }
2504
+ );
2505
+ };
2506
+ const dependencyTypeOrder = {
2507
+ peer: 0,
2508
+ production: 1,
2509
+ development: 2
2510
+ };
2511
+ function extractDependencies(packageLayer) {
2512
+ const { dependencies, devDependencies, peerDependencies } = packageLayer.packageData;
2513
+ const items = [];
2514
+ if (dependencies) {
2515
+ Object.entries(dependencies).forEach(([name, version]) => {
2516
+ items.push({ name, version, dependencyType: "production" });
2517
+ });
2518
+ }
2519
+ if (devDependencies) {
2520
+ Object.entries(devDependencies).forEach(([name, version]) => {
2521
+ items.push({ name, version, dependencyType: "development" });
2522
+ });
2523
+ }
2524
+ if (peerDependencies) {
2525
+ Object.entries(peerDependencies).forEach(([name, version]) => {
2526
+ items.push({ name, version, dependencyType: "peer" });
2527
+ });
2528
+ }
2529
+ return items.sort((a, b) => {
2530
+ const typeCompare = dependencyTypeOrder[a.dependencyType] - dependencyTypeOrder[b.dependencyType];
2531
+ if (typeCompare !== 0) return typeCompare;
2532
+ return a.name.localeCompare(b.name);
2533
+ });
2534
+ }
2535
+ const DependenciesPanelContent = ({
2536
+ context
2537
+ }) => {
2538
+ var _a;
2539
+ const { theme: theme2 } = useTheme();
2540
+ const [selectedPackagePath, setSelectedPackagePath] = useState(
2541
+ null
2542
+ );
2543
+ const [activeFilters, setActiveFilters] = useState(/* @__PURE__ */ new Set());
2544
+ const [searchQuery, setSearchQuery] = useState("");
2545
+ const [showInfoModal, setShowInfoModal] = useState(false);
2546
+ const packagesSlice = context.getSlice("packages");
2547
+ const isLoading = context.isSliceLoading("packages");
2548
+ const hasPackages = context.hasSlice("packages");
2549
+ const packages = useMemo(() => {
2550
+ var _a2;
2551
+ return ((_a2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a2.packages) ?? [];
2552
+ }, [(_a = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a.packages]);
2553
+ const effectiveSelectedPath = useMemo(() => {
2554
+ if (selectedPackagePath !== null) return selectedPackagePath;
2555
+ if (packages.length === 1) return packages[0].packageData.path;
2556
+ const rootPackage = packages.find((p) => p.packageData.path === "");
2557
+ if (rootPackage) return "";
2558
+ return null;
2559
+ }, [selectedPackagePath, packages]);
2560
+ const selectedPackage = useMemo(() => {
2561
+ if (effectiveSelectedPath === null) return null;
2562
+ return packages.find((p) => p.packageData.path === effectiveSelectedPath);
2563
+ }, [effectiveSelectedPath, packages]);
2564
+ const dependencyItems = useMemo(() => {
2565
+ if (!selectedPackage) return [];
2566
+ return extractDependencies(selectedPackage);
2567
+ }, [selectedPackage]);
2568
+ const counts = useMemo(() => {
2569
+ return {
2570
+ all: dependencyItems.length,
2571
+ production: dependencyItems.filter((d) => d.dependencyType === "production").length,
2572
+ development: dependencyItems.filter(
2573
+ (d) => d.dependencyType === "development"
2574
+ ).length,
2575
+ peer: dependencyItems.filter((d) => d.dependencyType === "peer").length
2576
+ };
2577
+ }, [dependencyItems]);
2578
+ const handleToggleFilter = (type) => {
2579
+ setActiveFilters((prev) => {
2580
+ const next = new Set(prev);
2581
+ if (next.has(type)) {
2582
+ next.delete(type);
2583
+ } else {
2584
+ next.add(type);
2585
+ }
2586
+ return next;
2587
+ });
2588
+ };
2589
+ const filteredDependencies = useMemo(() => {
2590
+ let filtered = [...dependencyItems];
2591
+ if (searchQuery.trim()) {
2592
+ const query = searchQuery.toLowerCase();
2593
+ filtered = filtered.filter(
2594
+ (dep) => dep.name.toLowerCase().includes(query)
2595
+ );
2596
+ }
2597
+ const allTypes = ["production", "development", "peer"];
2598
+ const availableTypes = allTypes.filter((t) => counts[t] > 0);
2599
+ const isAllSelected = activeFilters.size === 0 || availableTypes.every((t) => activeFilters.has(t));
2600
+ if (!isAllSelected && activeFilters.size > 0) {
2601
+ filtered = filtered.filter((dep) => activeFilters.has(dep.dependencyType));
2602
+ }
2603
+ return filtered;
2604
+ }, [dependencyItems, searchQuery, activeFilters, counts]);
2605
+ if (isLoading) {
2606
+ return /* @__PURE__ */ jsx(
2607
+ "div",
2608
+ {
2609
+ style: {
2610
+ padding: `${theme2.space[3]}px`,
2611
+ height: "100%",
2612
+ display: "flex",
2613
+ alignItems: "center",
2614
+ justifyContent: "center",
2615
+ color: theme2.colors.textSecondary,
2616
+ backgroundColor: theme2.colors.background,
2617
+ fontFamily: theme2.fonts.body
2618
+ },
2619
+ children: "Loading packages..."
2620
+ }
2621
+ );
2622
+ }
2623
+ if (!hasPackages || packages.length === 0) {
2624
+ return /* @__PURE__ */ jsxs(
2625
+ "div",
2626
+ {
2627
+ style: {
2628
+ padding: `${theme2.space[3]}px`,
2629
+ height: "100%",
2630
+ display: "flex",
2631
+ flexDirection: "column",
2632
+ alignItems: "center",
2633
+ justifyContent: "center",
2634
+ gap: `${theme2.space[2]}px`,
2635
+ color: theme2.colors.textSecondary,
2636
+ backgroundColor: theme2.colors.background,
2637
+ fontFamily: theme2.fonts.body
2638
+ },
2639
+ children: [
2640
+ /* @__PURE__ */ jsx(Package, { size: 32 }),
2641
+ /* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: "No package data available" })
2642
+ ]
2643
+ }
2644
+ );
2645
+ }
2646
+ return /* @__PURE__ */ jsxs(
2647
+ "div",
2648
+ {
2649
+ style: {
2650
+ height: "100%",
2651
+ display: "flex",
2652
+ flexDirection: "column",
2653
+ backgroundColor: theme2.colors.background,
2654
+ color: theme2.colors.text,
2655
+ fontFamily: theme2.fonts.body,
2656
+ overflow: "hidden"
2657
+ },
2658
+ children: [
2659
+ /* @__PURE__ */ jsxs(
2660
+ "div",
2661
+ {
2662
+ style: {
2663
+ flexShrink: 0,
2664
+ padding: `${theme2.space[3]}px`,
2665
+ paddingBottom: `${theme2.space[2]}px`,
2666
+ display: "flex",
2667
+ flexDirection: "column",
2668
+ gap: `${theme2.space[2]}px`,
2669
+ borderBottom: `1px solid ${theme2.colors.border}`
2670
+ },
2671
+ children: [
2672
+ /* @__PURE__ */ jsxs(
2673
+ "div",
2674
+ {
2675
+ style: {
2676
+ display: "flex",
2677
+ alignItems: "center",
2678
+ justifyContent: "space-between"
2679
+ },
2680
+ children: [
2681
+ /* @__PURE__ */ jsx(
2682
+ "h3",
2683
+ {
2684
+ style: {
2685
+ fontSize: `${theme2.fontSizes[2]}px`,
2686
+ fontWeight: theme2.fontWeights.semibold,
2687
+ color: theme2.colors.text,
2688
+ display: "flex",
2689
+ alignItems: "center",
2690
+ gap: `${theme2.space[2]}px`,
2691
+ margin: 0
2692
+ },
2693
+ children: packages.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
2694
+ /* @__PURE__ */ jsx(Boxes, { size: 16 }),
2695
+ "Monorepo Dependencies",
2696
+ /* @__PURE__ */ jsxs(
2697
+ "span",
2698
+ {
2699
+ style: {
2700
+ fontSize: `${theme2.fontSizes[0]}px`,
2701
+ fontWeight: theme2.fontWeights.body,
2702
+ color: theme2.colors.textSecondary
2703
+ },
2704
+ children: [
2705
+ "(",
2706
+ packages.length,
2707
+ ")"
2708
+ ]
2709
+ }
2710
+ )
2711
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2712
+ /* @__PURE__ */ jsx(Package, { size: 16 }),
2713
+ "Dependencies"
2714
+ ] })
2715
+ }
2716
+ ),
2717
+ /* @__PURE__ */ jsxs(
2718
+ "button",
2719
+ {
2720
+ onClick: () => setShowInfoModal(true),
2721
+ style: {
2722
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
2723
+ fontSize: `${theme2.fontSizes[0]}px`,
2724
+ fontWeight: theme2.fontWeights.medium,
2725
+ fontFamily: theme2.fonts.body,
2726
+ borderRadius: `${theme2.radii[1]}px`,
2727
+ border: `1px solid ${theme2.colors.border}`,
2728
+ backgroundColor: theme2.colors.backgroundSecondary,
2729
+ color: theme2.colors.primary,
2730
+ cursor: "pointer",
2731
+ display: "flex",
2732
+ alignItems: "center",
2733
+ gap: `${theme2.space[1]}px`,
2734
+ transition: "all 0.2s"
2735
+ },
2736
+ children: [
2737
+ /* @__PURE__ */ jsx(CircleQuestionMark, { size: 12 }),
2738
+ "Learn More"
2739
+ ]
2740
+ }
2741
+ )
2742
+ ]
2743
+ }
2744
+ ),
2745
+ packages.length > 1 && /* @__PURE__ */ jsx(
2746
+ "select",
2747
+ {
2748
+ value: effectiveSelectedPath ?? "__none__",
2749
+ onChange: (e) => setSelectedPackagePath(e.target.value === "__none__" ? null : e.target.value),
2750
+ style: {
2751
+ width: "100%",
2752
+ padding: `${theme2.space[2]}px`,
2753
+ borderRadius: `${theme2.radii[1]}px`,
2754
+ border: `1px solid ${theme2.colors.border}`,
2755
+ backgroundColor: theme2.colors.backgroundSecondary,
2756
+ color: theme2.colors.text,
2757
+ fontSize: `${theme2.fontSizes[1]}px`,
2758
+ fontFamily: theme2.fonts.body,
2759
+ cursor: "pointer"
2760
+ },
2761
+ children: packages.map((pkg) => /* @__PURE__ */ jsxs("option", { value: pkg.packageData.path, children: [
2762
+ pkg.packageData.name,
2763
+ " (",
2764
+ pkg.packageData.path || "root",
2765
+ ")"
2766
+ ] }, pkg.packageData.path || "__root__"))
2767
+ }
2768
+ ),
2769
+ packages.length === 1 && selectedPackage && /* @__PURE__ */ jsxs(
2770
+ "div",
2771
+ {
2772
+ style: {
2773
+ fontSize: `${theme2.fontSizes[0]}px`,
2774
+ color: theme2.colors.textSecondary
2775
+ },
2776
+ children: [
2777
+ selectedPackage.packageData.name,
2778
+ " • ",
2779
+ dependencyItems.length,
2780
+ " dependencies"
2781
+ ]
2782
+ }
2783
+ ),
2784
+ selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsx(
2785
+ FilterBar,
2786
+ {
2787
+ activeFilters,
2788
+ onToggleFilter: handleToggleFilter,
2789
+ searchQuery,
2790
+ onSearchChange: setSearchQuery,
2791
+ counts
2792
+ }
2793
+ )
2794
+ ]
2795
+ }
2796
+ ),
2797
+ selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsxs(
2798
+ "div",
2799
+ {
2800
+ style: {
2801
+ flex: 1,
2802
+ overflow: "auto",
2803
+ padding: `${theme2.space[2]}px ${theme2.space[3]}px ${theme2.space[3]}px`
2804
+ },
2805
+ children: [
2806
+ /* @__PURE__ */ jsxs(
2807
+ "div",
2808
+ {
2809
+ style: {
2810
+ fontSize: `${theme2.fontSizes[0]}px`,
2811
+ color: theme2.colors.textSecondary,
2812
+ marginBottom: `${theme2.space[2]}px`
2813
+ },
2814
+ children: [
2815
+ "Showing ",
2816
+ filteredDependencies.length,
2817
+ " of ",
2818
+ dependencyItems.length,
2819
+ " dependencies"
2820
+ ]
2821
+ }
2822
+ ),
2823
+ /* @__PURE__ */ jsx(
2824
+ "div",
2825
+ {
2826
+ style: {
2827
+ display: "flex",
2828
+ flexDirection: "column",
2829
+ gap: `${theme2.space[1]}px`
2830
+ },
2831
+ children: filteredDependencies.length === 0 ? /* @__PURE__ */ jsx(
2832
+ "div",
2833
+ {
2834
+ style: {
2835
+ padding: `${theme2.space[3]}px`,
2836
+ textAlign: "center",
2837
+ color: theme2.colors.textSecondary,
2838
+ fontSize: `${theme2.fontSizes[1]}px`
2839
+ },
2840
+ children: "No dependencies match your filters"
2841
+ }
2842
+ ) : filteredDependencies.map((dep) => /* @__PURE__ */ jsx(
2843
+ DependencyRow,
2844
+ {
2845
+ dependency: dep
2846
+ },
2847
+ `${dep.name}-${dep.dependencyType}`
2848
+ ))
2849
+ }
2850
+ )
2851
+ ]
2852
+ }
2853
+ ),
2854
+ !selectedPackage && packages.length > 1 && /* @__PURE__ */ jsx(
2855
+ "div",
2856
+ {
2857
+ style: {
2858
+ flex: 1,
2859
+ display: "flex",
2860
+ alignItems: "center",
2861
+ justifyContent: "center",
2862
+ color: theme2.colors.textSecondary,
2863
+ fontSize: `${theme2.fontSizes[1]}px`
2864
+ },
2865
+ children: "Select a package to view its dependencies"
2866
+ }
2867
+ ),
2868
+ /* @__PURE__ */ jsx(
2869
+ DependencyInfoModal,
2870
+ {
2871
+ isOpen: showInfoModal,
2872
+ onClose: () => setShowInfoModal(false)
2873
+ }
2874
+ )
2875
+ ]
2876
+ }
2877
+ );
2878
+ };
2879
+ const DependenciesPanel = (props) => {
2880
+ return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(DependenciesPanelContent, { ...props }) });
2881
+ };
2882
+ const PANEL_ID$2 = "industry-theme.local-projects";
2883
+ const filterProjectsTool = {
2884
+ name: "filter_projects",
2885
+ description: "Filter the local projects list by name, owner, or path",
2886
+ inputs: {
2887
+ type: "object",
2888
+ properties: {
2889
+ filter: {
2890
+ type: "string",
2891
+ description: "Search term to filter projects (matches name, owner, or path)"
2892
+ }
2893
+ },
2894
+ required: ["filter"]
2895
+ },
2896
+ outputs: {
2897
+ type: "object",
2898
+ properties: {
2899
+ success: { type: "boolean" },
2900
+ message: { type: "string" }
2901
+ }
2902
+ },
2903
+ tags: ["filter", "search", "projects"],
2904
+ tool_call_template: {
2905
+ call_template_type: "panel_event",
2906
+ event_type: `${PANEL_ID$2}:filter`
2907
+ }
2908
+ };
2909
+ const selectProjectTool = {
2910
+ name: "select_project",
2911
+ description: "Select a project by name or path to view its details",
2912
+ inputs: {
2913
+ type: "object",
2914
+ properties: {
2915
+ identifier: {
2916
+ type: "string",
2917
+ description: "Project name or full path to select"
2918
+ }
2919
+ },
2920
+ required: ["identifier"]
2921
+ },
2922
+ outputs: {
2923
+ type: "object",
2924
+ properties: {
2925
+ success: { type: "boolean" },
2926
+ selectedProject: { type: "string" }
2927
+ }
2928
+ },
2929
+ tags: ["select", "project", "navigation"],
2930
+ tool_call_template: {
2931
+ call_template_type: "panel_event",
2932
+ event_type: `${PANEL_ID$2}:select-repository`
2933
+ }
2934
+ };
2935
+ const openProjectTool = {
2936
+ name: "open_project",
2937
+ description: "Open a local project in the development workspace",
2938
+ inputs: {
2153
2939
  type: "object",
2154
2940
  properties: {
2155
2941
  identifier: {
@@ -2169,7 +2955,7 @@ const openProjectTool = {
2169
2955
  tags: ["open", "project", "workspace"],
2170
2956
  tool_call_template: {
2171
2957
  call_template_type: "panel_event",
2172
- event_type: `${PANEL_ID$1}:open-repository`
2958
+ event_type: `${PANEL_ID$2}:open-repository`
2173
2959
  }
2174
2960
  };
2175
2961
  const localProjectsPanelTools = [
@@ -2178,12 +2964,12 @@ const localProjectsPanelTools = [
2178
2964
  openProjectTool
2179
2965
  ];
2180
2966
  const localProjectsPanelToolsMetadata = {
2181
- id: PANEL_ID$1,
2967
+ id: PANEL_ID$2,
2182
2968
  name: "Local Projects Panel",
2183
2969
  description: "Tools for browsing and managing local Alexandria repositories",
2184
2970
  tools: localProjectsPanelTools
2185
2971
  };
2186
- const PANEL_ID = "industry-theme.workspace-repositories";
2972
+ const PANEL_ID$1 = "industry-theme.workspace-repositories";
2187
2973
  const selectRepositoryTool = {
2188
2974
  name: "select_workspace_repository",
2189
2975
  description: "Selects a repository in the workspace panel",
@@ -2207,7 +2993,7 @@ const selectRepositoryTool = {
2207
2993
  tags: ["workspace", "repository", "select"],
2208
2994
  tool_call_template: {
2209
2995
  call_template_type: "panel_event",
2210
- event_type: `${PANEL_ID}:select-repository`
2996
+ event_type: `${PANEL_ID$1}:select-repository`
2211
2997
  }
2212
2998
  };
2213
2999
  const refreshWorkspaceTool = {
@@ -2232,7 +3018,7 @@ const refreshWorkspaceTool = {
2232
3018
  tags: ["workspace", "refresh"],
2233
3019
  tool_call_template: {
2234
3020
  call_template_type: "panel_event",
2235
- event_type: `${PANEL_ID}:refresh-workspace`
3021
+ event_type: `${PANEL_ID$1}:refresh-workspace`
2236
3022
  }
2237
3023
  };
2238
3024
  const openRepositoryTool = {
@@ -2258,7 +3044,7 @@ const openRepositoryTool = {
2258
3044
  tags: ["workspace", "repository", "open"],
2259
3045
  tool_call_template: {
2260
3046
  call_template_type: "panel_event",
2261
- event_type: `${PANEL_ID}:open-repository`
3047
+ event_type: `${PANEL_ID$1}:open-repository`
2262
3048
  }
2263
3049
  };
2264
3050
  const workspaceRepositoriesPanelTools = [
@@ -2267,11 +3053,102 @@ const workspaceRepositoriesPanelTools = [
2267
3053
  openRepositoryTool
2268
3054
  ];
2269
3055
  const workspaceRepositoriesPanelToolsMetadata = {
2270
- id: PANEL_ID,
3056
+ id: PANEL_ID$1,
2271
3057
  name: "Workspace Repositories Panel",
2272
3058
  description: "Tools provided by the workspace repositories panel",
2273
3059
  tools: workspaceRepositoriesPanelTools
2274
3060
  };
3061
+ const PANEL_ID = "principal-ade.dependencies-panel";
3062
+ const filterDependenciesTool = {
3063
+ name: "filter_dependencies",
3064
+ description: "Filter the dependencies list by package name",
3065
+ inputs: {
3066
+ type: "object",
3067
+ properties: {
3068
+ filter: {
3069
+ type: "string",
3070
+ description: "Search term to filter dependencies by name"
3071
+ }
3072
+ },
3073
+ required: ["filter"]
3074
+ },
3075
+ outputs: {
3076
+ type: "object",
3077
+ properties: {
3078
+ success: { type: "boolean" },
3079
+ message: { type: "string" }
3080
+ }
3081
+ },
3082
+ tags: ["filter", "search", "dependencies"],
3083
+ tool_call_template: {
3084
+ call_template_type: "panel_event",
3085
+ event_type: `${PANEL_ID}:filter`
3086
+ }
3087
+ };
3088
+ const selectDependencyTypeTool = {
3089
+ name: "select_dependency_type",
3090
+ description: "Filter dependencies by type (production, development, or peer)",
3091
+ inputs: {
3092
+ type: "object",
3093
+ properties: {
3094
+ type: {
3095
+ type: "string",
3096
+ enum: ["production", "development", "peer", "all"],
3097
+ description: "The dependency type to filter by"
3098
+ }
3099
+ },
3100
+ required: ["type"]
3101
+ },
3102
+ outputs: {
3103
+ type: "object",
3104
+ properties: {
3105
+ success: { type: "boolean" },
3106
+ selectedType: { type: "string" }
3107
+ }
3108
+ },
3109
+ tags: ["filter", "type", "dependencies"],
3110
+ tool_call_template: {
3111
+ call_template_type: "panel_event",
3112
+ event_type: `${PANEL_ID}:select-type`
3113
+ }
3114
+ };
3115
+ const selectPackageTool = {
3116
+ name: "select_package",
3117
+ description: "Select a package to view its dependencies (for monorepos)",
3118
+ inputs: {
3119
+ type: "object",
3120
+ properties: {
3121
+ packagePath: {
3122
+ type: "string",
3123
+ description: "The path of the package to select"
3124
+ }
3125
+ },
3126
+ required: ["packagePath"]
3127
+ },
3128
+ outputs: {
3129
+ type: "object",
3130
+ properties: {
3131
+ success: { type: "boolean" },
3132
+ selectedPackage: { type: "string" }
3133
+ }
3134
+ },
3135
+ tags: ["select", "package", "monorepo"],
3136
+ tool_call_template: {
3137
+ call_template_type: "panel_event",
3138
+ event_type: `${PANEL_ID}:select-package`
3139
+ }
3140
+ };
3141
+ const dependenciesPanelTools = [
3142
+ filterDependenciesTool,
3143
+ selectDependencyTypeTool,
3144
+ selectPackageTool
3145
+ ];
3146
+ const dependenciesPanelToolsMetadata = {
3147
+ id: PANEL_ID,
3148
+ name: "Dependencies Panel",
3149
+ description: "Tools for viewing and exploring package dependencies",
3150
+ tools: dependenciesPanelTools
3151
+ };
2275
3152
  const panels = [
2276
3153
  {
2277
3154
  metadata: {
@@ -2314,6 +3191,25 @@ const panels = [
2314
3191
  onUnmount: async (_context) => {
2315
3192
  console.log("Workspace Repositories Panel unmounting");
2316
3193
  }
3194
+ },
3195
+ {
3196
+ metadata: {
3197
+ id: "principal-ade.dependencies-panel",
3198
+ name: "Dependencies",
3199
+ icon: "Package",
3200
+ version: "0.1.0",
3201
+ author: "Principal ADE",
3202
+ description: "View and explore package dependencies",
3203
+ slices: ["packages"],
3204
+ tools: dependenciesPanelTools
3205
+ },
3206
+ component: DependenciesPanel,
3207
+ onMount: async (_context) => {
3208
+ console.log("Dependencies Panel mounted");
3209
+ },
3210
+ onUnmount: async (_context) => {
3211
+ console.log("Dependencies Panel unmounting");
3212
+ }
2317
3213
  }
2318
3214
  ];
2319
3215
  const onPackageLoad = async () => {
@@ -2323,12 +3219,15 @@ const onPackageUnload = async () => {
2323
3219
  console.log("Alexandria Panels package unloading");
2324
3220
  };
2325
3221
  export {
3222
+ DependenciesPanel,
2326
3223
  LocalProjectCard,
2327
3224
  LocalProjectsPanel,
2328
3225
  LocalProjectsPanelPreview,
2329
3226
  RepositoryAvatar,
2330
3227
  WorkspaceRepositoriesPanel,
2331
- WorkspaceRepositoryCard,
3228
+ dependenciesPanelTools,
3229
+ dependenciesPanelToolsMetadata,
3230
+ filterDependenciesTool,
2332
3231
  filterProjectsTool,
2333
3232
  localProjectsPanelTools,
2334
3233
  localProjectsPanelToolsMetadata,
@@ -2338,6 +3237,8 @@ export {
2338
3237
  openRepositoryTool,
2339
3238
  panels,
2340
3239
  refreshWorkspaceTool,
3240
+ selectDependencyTypeTool,
3241
+ selectPackageTool,
2341
3242
  selectProjectTool,
2342
3243
  selectRepositoryTool,
2343
3244
  workspaceRepositoriesPanelTools,