@industry-theme/agent-panels 0.2.23 → 0.2.25

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.
@@ -3002,16 +3002,35 @@ const abbreviateSourceName = (source2) => {
3002
3002
  const SkillCard = ({
3003
3003
  skill,
3004
3004
  onClick,
3005
- isSelected = false
3005
+ isSelected = false,
3006
+ filterContext
3006
3007
  }) => {
3007
3008
  var _a, _b, _c, _d, _e2, _f, _g, _h;
3008
3009
  const { theme: theme2 } = useTheme();
3009
3010
  const sourceConfig = getSourceConfig$1(skill.source);
3010
3011
  const [pathCopied, setPathCopied] = React2__default.useState(false);
3012
+ const getPathToCopy = () => {
3013
+ if (!filterContext || !skill.installedLocations || skill.installedLocations.length <= 1) {
3014
+ return skill.path;
3015
+ }
3016
+ if (filterContext === "project") {
3017
+ const projectInstallation = skill.installedLocations.find(
3018
+ (loc) => loc.source === "project-universal" || loc.source === "project-claude" || loc.source === "project-other"
3019
+ );
3020
+ return (projectInstallation == null ? void 0 : projectInstallation.path) || skill.path;
3021
+ } else if (filterContext === "global") {
3022
+ const globalInstallation = skill.installedLocations.find(
3023
+ (loc) => loc.source === "global-universal" || loc.source === "global-claude"
3024
+ );
3025
+ return (globalInstallation == null ? void 0 : globalInstallation.path) || skill.path;
3026
+ }
3027
+ return skill.path;
3028
+ };
3011
3029
  const handleCopyPath = async (e) => {
3012
3030
  e.stopPropagation();
3013
3031
  try {
3014
- await navigator.clipboard.writeText(skill.path);
3032
+ const pathToCopy = getPathToCopy();
3033
+ await navigator.clipboard.writeText(pathToCopy);
3015
3034
  setPathCopied(true);
3016
3035
  setTimeout(() => setPathCopied(false), 2e3);
3017
3036
  } catch (err) {
@@ -3068,7 +3087,7 @@ const SkillCard = ({
3068
3087
  }
3069
3088
  ),
3070
3089
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "4px", alignItems: "center", flexWrap: "wrap" }, children: [
3071
- /* @__PURE__ */ jsxs(
3090
+ !filterContext && /* @__PURE__ */ jsxs(
3072
3091
  "div",
3073
3092
  {
3074
3093
  style: {
@@ -3092,8 +3111,12 @@ const SkillCard = ({
3092
3111
  }
3093
3112
  ),
3094
3113
  ((_a = skill.metadata) == null ? void 0 : _a.owner) && ((_b = skill.metadata) == null ? void 0 : _b.repo) && /* @__PURE__ */ jsxs(
3095
- "div",
3114
+ "a",
3096
3115
  {
3116
+ href: skill.metadata.installedFrom || `https://github.com/${skill.metadata.owner}/${skill.metadata.repo}`,
3117
+ target: "_blank",
3118
+ rel: "noopener noreferrer",
3119
+ onClick: (e) => e.stopPropagation(),
3097
3120
  style: {
3098
3121
  display: "inline-flex",
3099
3122
  alignItems: "center",
@@ -3106,13 +3129,25 @@ const SkillCard = ({
3106
3129
  color: theme2.colors.textSecondary,
3107
3130
  fontWeight: 500,
3108
3131
  fontFamily: theme2.fonts.monospace,
3109
- width: "fit-content"
3132
+ width: "fit-content",
3133
+ textDecoration: "none",
3134
+ cursor: "pointer",
3135
+ transition: "all 0.2s ease"
3110
3136
  },
3111
- title: `From: ${skill.metadata.installedFrom}
3137
+ title: `Click to open: ${skill.metadata.installedFrom || `https://github.com/${skill.metadata.owner}/${skill.metadata.repo}`}
3112
3138
  Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).toLocaleString() : "Unknown"}`,
3139
+ onMouseEnter: (e) => {
3140
+ e.currentTarget.style.backgroundColor = `${theme2.colors.textSecondary}25`;
3141
+ e.currentTarget.style.borderColor = `${theme2.colors.textSecondary}50`;
3142
+ },
3143
+ onMouseLeave: (e) => {
3144
+ e.currentTarget.style.backgroundColor = `${theme2.colors.textSecondary}15`;
3145
+ e.currentTarget.style.borderColor = `${theme2.colors.textSecondary}30`;
3146
+ },
3113
3147
  children: [
3114
3148
  /* @__PURE__ */ jsx(Github, { size: 10 }),
3115
3149
  /* @__PURE__ */ jsxs("span", { children: [
3150
+ "From ",
3116
3151
  skill.metadata.owner,
3117
3152
  "/",
3118
3153
  skill.metadata.repo
@@ -3145,8 +3180,21 @@ Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).t
3145
3180
  }
3146
3181
  ),
3147
3182
  skill.installedLocations && skill.installedLocations.length > 1 && (() => {
3148
- const otherLocations = skill.installedLocations.filter((loc) => loc.path !== skill.path).map((loc) => abbreviateSourceName(loc.source));
3149
- const uniqueLocations = Array.from(new Set(otherLocations));
3183
+ let otherLocations = [];
3184
+ if (filterContext === "project") {
3185
+ otherLocations = skill.installedLocations.filter(
3186
+ (loc) => loc.source === "global-universal" || loc.source === "global-claude"
3187
+ );
3188
+ } else if (filterContext === "global") {
3189
+ otherLocations = skill.installedLocations.filter(
3190
+ (loc) => loc.source === "project-universal" || loc.source === "project-claude" || loc.source === "project-other"
3191
+ );
3192
+ } else {
3193
+ otherLocations = skill.installedLocations.filter((loc) => loc.path !== skill.path);
3194
+ }
3195
+ if (otherLocations.length === 0) return null;
3196
+ const locationNames = otherLocations.map((loc) => abbreviateSourceName(loc.source));
3197
+ const uniqueLocations = Array.from(new Set(locationNames));
3150
3198
  const locationText = uniqueLocations.join(", ");
3151
3199
  return /* @__PURE__ */ jsxs(
3152
3200
  "div",
@@ -3165,7 +3213,7 @@ Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).t
3165
3213
  width: "fit-content"
3166
3214
  },
3167
3215
  title: `Also installed in:
3168
- ${skill.installedLocations.filter((loc) => loc.path !== skill.path).map((loc) => `${abbreviateSourceName(loc.source)}: ${loc.path}`).join("\n")}`,
3216
+ ${otherLocations.map((loc) => `${abbreviateSourceName(loc.source)}: ${loc.path}`).join("\n")}`,
3169
3217
  children: [
3170
3218
  /* @__PURE__ */ jsx(Package, { size: 10 }),
3171
3219
  /* @__PURE__ */ jsxs("span", { children: [
@@ -3323,7 +3371,7 @@ ${skill.installedLocations.filter((loc) => loc.path !== skill.path).map((loc) =>
3323
3371
  transition: "all 0.2s ease",
3324
3372
  border: `1px solid ${pathCopied ? theme2.colors.success : "transparent"}`
3325
3373
  },
3326
- title: pathCopied ? "Copied!" : "Click to copy path",
3374
+ title: pathCopied ? "Copied!" : `Click to copy: ${getPathToCopy()}`,
3327
3375
  onMouseEnter: (e) => {
3328
3376
  if (!pathCopied) {
3329
3377
  e.currentTarget.style.background = theme2.colors.backgroundTertiary || theme2.colors.border;
@@ -3334,7 +3382,7 @@ ${skill.installedLocations.filter((loc) => loc.path !== skill.path).map((loc) =>
3334
3382
  e.currentTarget.style.background = theme2.colors.backgroundSecondary;
3335
3383
  }
3336
3384
  },
3337
- children: pathCopied ? "Copied!" : skill.path
3385
+ children: pathCopied ? "Copied!" : getPathToCopy()
3338
3386
  }
3339
3387
  )
3340
3388
  ]
@@ -3344,13 +3392,14 @@ ${skill.installedLocations.filter((loc) => loc.path !== skill.path).map((loc) =>
3344
3392
  const SkillsListPanel = ({
3345
3393
  context,
3346
3394
  events,
3347
- browseMode = false
3395
+ browseMode = false,
3396
+ supportsRefresh = false
3348
3397
  }) => {
3349
3398
  const { theme: theme2 } = useTheme();
3350
3399
  const panelRef = useRef(null);
3351
3400
  const [selectedSkillId, setSelectedSkillId] = useState(null);
3352
3401
  const [searchQuery, setSearchQuery] = useState("");
3353
- const [skillFilter, setSkillFilter] = useState("all");
3402
+ const [skillFilter, setSkillFilter] = useState("project");
3354
3403
  const [isRefreshing, setIsRefreshing] = useState(false);
3355
3404
  const { skills, isLoading, error, refreshSkills } = useSkillsData({ context });
3356
3405
  gt("skills-list", events, () => {
@@ -3378,13 +3427,23 @@ const SkillsListPanel = ({
3378
3427
  const filteredSkills = useMemo(() => {
3379
3428
  let filtered = skills;
3380
3429
  if (skillFilter === "project") {
3381
- filtered = filtered.filter(
3382
- (skill) => skill.source === "project-universal" || skill.source === "project-claude" || skill.source === "project-other"
3383
- );
3430
+ filtered = filtered.filter((skill) => {
3431
+ if (skill.installedLocations && skill.installedLocations.length > 0) {
3432
+ return skill.installedLocations.some(
3433
+ (loc) => loc.source === "project-universal" || loc.source === "project-claude" || loc.source === "project-other"
3434
+ );
3435
+ }
3436
+ return skill.source === "project-universal" || skill.source === "project-claude" || skill.source === "project-other";
3437
+ });
3384
3438
  } else if (skillFilter === "global") {
3385
- filtered = filtered.filter(
3386
- (skill) => skill.source === "global-universal" || skill.source === "global-claude"
3387
- );
3439
+ filtered = filtered.filter((skill) => {
3440
+ if (skill.installedLocations && skill.installedLocations.length > 0) {
3441
+ return skill.installedLocations.some(
3442
+ (loc) => loc.source === "global-universal" || loc.source === "global-claude"
3443
+ );
3444
+ }
3445
+ return skill.source === "global-universal" || skill.source === "global-claude";
3446
+ });
3388
3447
  }
3389
3448
  if (searchQuery.trim()) {
3390
3449
  const query = searchQuery.toLowerCase().trim();
@@ -3412,7 +3471,7 @@ const SkillsListPanel = ({
3412
3471
  });
3413
3472
  }
3414
3473
  };
3415
- const handleRefresh = async () => {
3474
+ const handleRefresh = () => {
3416
3475
  setIsRefreshing(true);
3417
3476
  if (events) {
3418
3477
  events.emit({
@@ -3423,11 +3482,9 @@ const SkillsListPanel = ({
3423
3482
  payload: {}
3424
3483
  });
3425
3484
  }
3426
- try {
3427
- await refreshSkills();
3428
- } finally {
3485
+ setTimeout(() => {
3429
3486
  setIsRefreshing(false);
3430
- }
3487
+ }, 800);
3431
3488
  };
3432
3489
  return /* @__PURE__ */ jsxs(
3433
3490
  "div",
@@ -3574,7 +3631,7 @@ const SkillsListPanel = ({
3574
3631
  ]
3575
3632
  }
3576
3633
  ),
3577
- /* @__PURE__ */ jsx(
3634
+ supportsRefresh && /* @__PURE__ */ jsx(
3578
3635
  "button",
3579
3636
  {
3580
3637
  onClick: handleRefresh,
@@ -3584,7 +3641,7 @@ const SkillsListPanel = ({
3584
3641
  border: `1px solid ${theme2.colors.border}`,
3585
3642
  borderRadius: theme2.radii[1],
3586
3643
  padding: "8px",
3587
- cursor: isRefreshing ? "wait" : "pointer",
3644
+ cursor: isRefreshing || isLoading ? "default" : "pointer",
3588
3645
  display: "flex",
3589
3646
  alignItems: "center",
3590
3647
  justifyContent: "center",
@@ -3616,33 +3673,12 @@ const SkillsListPanel = ({
3616
3673
  gap: "8px"
3617
3674
  },
3618
3675
  children: [
3619
- /* @__PURE__ */ jsx(
3620
- "button",
3621
- {
3622
- onClick: () => setSkillFilter("all"),
3623
- style: {
3624
- padding: "8px 16px",
3625
- fontSize: theme2.fontSizes[1],
3626
- fontFamily: theme2.fonts.body,
3627
- border: `1px solid ${skillFilter === "all" ? theme2.colors.primary : theme2.colors.border}`,
3628
- borderRadius: theme2.radii[1],
3629
- background: skillFilter === "all" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
3630
- color: skillFilter === "all" ? theme2.colors.primary : theme2.colors.text,
3631
- cursor: "pointer",
3632
- display: "flex",
3633
- alignItems: "center",
3634
- gap: "6px",
3635
- fontWeight: skillFilter === "all" ? 600 : 400,
3636
- transition: "all 0.2s ease"
3637
- },
3638
- children: "All Skills"
3639
- }
3640
- ),
3641
3676
  /* @__PURE__ */ jsx(
3642
3677
  "button",
3643
3678
  {
3644
3679
  onClick: () => setSkillFilter("project"),
3645
3680
  style: {
3681
+ flex: 1,
3646
3682
  padding: "8px 16px",
3647
3683
  fontSize: theme2.fontSizes[1],
3648
3684
  fontFamily: theme2.fonts.body,
@@ -3653,6 +3689,7 @@ const SkillsListPanel = ({
3653
3689
  cursor: "pointer",
3654
3690
  display: "flex",
3655
3691
  alignItems: "center",
3692
+ justifyContent: "center",
3656
3693
  gap: "6px",
3657
3694
  fontWeight: skillFilter === "project" ? 600 : 400,
3658
3695
  transition: "all 0.2s ease"
@@ -3665,6 +3702,7 @@ const SkillsListPanel = ({
3665
3702
  {
3666
3703
  onClick: () => setSkillFilter("global"),
3667
3704
  style: {
3705
+ flex: 1,
3668
3706
  padding: "8px 16px",
3669
3707
  fontSize: theme2.fontSizes[1],
3670
3708
  fontFamily: theme2.fonts.body,
@@ -3675,6 +3713,7 @@ const SkillsListPanel = ({
3675
3713
  cursor: "pointer",
3676
3714
  display: "flex",
3677
3715
  alignItems: "center",
3716
+ justifyContent: "center",
3678
3717
  gap: "6px",
3679
3718
  fontWeight: skillFilter === "global" ? 600 : 400,
3680
3719
  transition: "all 0.2s ease"
@@ -3762,7 +3801,8 @@ const SkillsListPanel = ({
3762
3801
  {
3763
3802
  skill,
3764
3803
  onClick: handleSkillClick,
3765
- isSelected: selectedSkillId === skill.id
3804
+ isSelected: selectedSkillId === skill.id,
3805
+ filterContext: skillFilter
3766
3806
  },
3767
3807
  skill.id
3768
3808
  ))
@@ -3855,7 +3895,8 @@ const useSkillsBrowseData = ({
3855
3895
  };
3856
3896
  const SkillsBrowsePanel = ({
3857
3897
  context,
3858
- events
3898
+ events,
3899
+ supportsRefresh = false
3859
3900
  }) => {
3860
3901
  const { theme: theme2 } = useTheme();
3861
3902
  const panelRef = useRef(null);
@@ -3909,7 +3950,7 @@ const SkillsBrowsePanel = ({
3909
3950
  });
3910
3951
  }
3911
3952
  };
3912
- const handleRefresh = async () => {
3953
+ const handleRefresh = () => {
3913
3954
  setIsRefreshing(true);
3914
3955
  if (events) {
3915
3956
  events.emit({
@@ -3920,11 +3961,9 @@ const SkillsBrowsePanel = ({
3920
3961
  payload: {}
3921
3962
  });
3922
3963
  }
3923
- try {
3924
- await refreshSkills();
3925
- } finally {
3964
+ setTimeout(() => {
3926
3965
  setIsRefreshing(false);
3927
- }
3966
+ }, 800);
3928
3967
  };
3929
3968
  return /* @__PURE__ */ jsxs(
3930
3969
  "div",
@@ -4071,7 +4110,7 @@ const SkillsBrowsePanel = ({
4071
4110
  ]
4072
4111
  }
4073
4112
  ),
4074
- /* @__PURE__ */ jsx(
4113
+ supportsRefresh && /* @__PURE__ */ jsx(
4075
4114
  "button",
4076
4115
  {
4077
4116
  onClick: handleRefresh,
@@ -4081,7 +4120,7 @@ const SkillsBrowsePanel = ({
4081
4120
  border: `1px solid ${theme2.colors.border}`,
4082
4121
  borderRadius: theme2.radii[1],
4083
4122
  padding: "8px",
4084
- cursor: isRefreshing ? "wait" : "pointer",
4123
+ cursor: isRefreshing || isLoading ? "default" : "pointer",
4085
4124
  display: "flex",
4086
4125
  alignItems: "center",
4087
4126
  justifyContent: "center",
@@ -51444,6 +51483,686 @@ const AgentDetailPanel = ({
51444
51483
  }
51445
51484
  return null;
51446
51485
  };
51486
+ const AgenticResourcesPanel = ({
51487
+ context,
51488
+ events
51489
+ }) => {
51490
+ const { theme: theme2 } = useTheme();
51491
+ const panelRef = useRef(null);
51492
+ const [mode, setMode] = useState("agents");
51493
+ const [selectedItemId, setSelectedItemId] = useState(null);
51494
+ const [searchQuery, setSearchQuery] = useState("");
51495
+ const [agentFilter, setAgentFilter] = useState("documentation");
51496
+ const [skillFilter, setSkillFilter] = useState("project");
51497
+ const [isRefreshing, setIsRefreshing] = useState(false);
51498
+ const {
51499
+ agents,
51500
+ isLoading: agentsLoading,
51501
+ error: agentsError,
51502
+ refreshAgents
51503
+ } = useAgentsData({ context });
51504
+ const {
51505
+ subagents,
51506
+ isLoading: subagentsLoading,
51507
+ error: subagentsError,
51508
+ refreshSubagents
51509
+ } = useSubagentsData({ context });
51510
+ const {
51511
+ skills,
51512
+ isLoading: skillsLoading,
51513
+ error: skillsError,
51514
+ refreshSkills
51515
+ } = useSkillsData({ context });
51516
+ const isLoading = mode === "agents" ? agentsLoading || subagentsLoading : skillsLoading;
51517
+ const error = mode === "agents" ? agentsError || subagentsError : skillsError;
51518
+ gt("agentic-resources", events, () => {
51519
+ var _a;
51520
+ return (_a = panelRef.current) == null ? void 0 : _a.focus();
51521
+ });
51522
+ useEffect(() => {
51523
+ if (mode !== "skills") return;
51524
+ const unsubscribeInstalled = events.on("skill:installed", () => {
51525
+ console.log("[AgenticResourcesPanel] Skill installed, refreshing...");
51526
+ refreshSkills();
51527
+ });
51528
+ const unsubscribeUninstalled = events.on("skill:uninstalled", () => {
51529
+ console.log("[AgenticResourcesPanel] Skill uninstalled, refreshing...");
51530
+ refreshSkills();
51531
+ });
51532
+ return () => {
51533
+ unsubscribeInstalled();
51534
+ unsubscribeUninstalled();
51535
+ };
51536
+ }, [events, mode, refreshSkills]);
51537
+ const allItems = useMemo(() => {
51538
+ const items = [];
51539
+ agents.forEach((agent) => {
51540
+ items.push({ type: "agent", data: agent });
51541
+ });
51542
+ subagents.forEach((subagent) => {
51543
+ items.push({ type: "subagent", data: subagent });
51544
+ });
51545
+ return items;
51546
+ }, [agents, subagents]);
51547
+ const filteredItems = useMemo(() => {
51548
+ let filtered = allItems;
51549
+ if (agentFilter === "documentation") {
51550
+ filtered = filtered.filter((item) => item.type === "agent");
51551
+ } else {
51552
+ filtered = filtered.filter((item) => item.type === "subagent");
51553
+ }
51554
+ if (searchQuery.trim()) {
51555
+ const query = searchQuery.toLowerCase().trim();
51556
+ filtered = filtered.filter((item) => {
51557
+ if (item.type === "agent") {
51558
+ const agent = item.data;
51559
+ if (agent.name.toLowerCase().includes(query)) return true;
51560
+ if (agent.path.toLowerCase().includes(query)) return true;
51561
+ if (agent.content.toLowerCase().includes(query)) return true;
51562
+ return false;
51563
+ } else {
51564
+ const subagent = item.data;
51565
+ if (subagent.name.toLowerCase().includes(query)) return true;
51566
+ if (subagent.path.toLowerCase().includes(query)) return true;
51567
+ if (subagent.frontmatter.description.toLowerCase().includes(query)) return true;
51568
+ if (subagent.prompt.toLowerCase().includes(query)) return true;
51569
+ return false;
51570
+ }
51571
+ });
51572
+ }
51573
+ return filtered;
51574
+ }, [allItems, searchQuery, agentFilter]);
51575
+ const hasRepository = useMemo(() => {
51576
+ const fileTreeSlice = context.getSlice("fileTree");
51577
+ return !!(fileTreeSlice == null ? void 0 : fileTreeSlice.data);
51578
+ }, [context]);
51579
+ const filteredSkills = useMemo(() => {
51580
+ let filtered = skills;
51581
+ if (skillFilter === "project") {
51582
+ filtered = filtered.filter((skill) => {
51583
+ if (skill.installedLocations && skill.installedLocations.length > 0) {
51584
+ return skill.installedLocations.some(
51585
+ (loc) => loc.source === "project-universal" || loc.source === "project-claude" || loc.source === "project-other"
51586
+ );
51587
+ }
51588
+ return skill.source === "project-universal" || skill.source === "project-claude" || skill.source === "project-other";
51589
+ });
51590
+ } else if (skillFilter === "global") {
51591
+ filtered = filtered.filter((skill) => {
51592
+ if (skill.installedLocations && skill.installedLocations.length > 0) {
51593
+ return skill.installedLocations.some(
51594
+ (loc) => loc.source === "global-universal" || loc.source === "global-claude"
51595
+ );
51596
+ }
51597
+ return skill.source === "global-universal" || skill.source === "global-claude";
51598
+ });
51599
+ }
51600
+ if (searchQuery.trim()) {
51601
+ const query = searchQuery.toLowerCase().trim();
51602
+ filtered = filtered.filter((skill) => {
51603
+ var _a, _b;
51604
+ if (skill.name.toLowerCase().includes(query)) return true;
51605
+ if ((_a = skill.description) == null ? void 0 : _a.toLowerCase().includes(query)) return true;
51606
+ if ((_b = skill.capabilities) == null ? void 0 : _b.some((cap2) => cap2.toLowerCase().includes(query))) return true;
51607
+ if (skill.path.toLowerCase().includes(query)) return true;
51608
+ return false;
51609
+ });
51610
+ }
51611
+ return filtered;
51612
+ }, [skills, searchQuery, skillFilter]);
51613
+ const handleItemClick = (item) => {
51614
+ const itemId = item.type === "agent" ? item.data.id : item.data.id;
51615
+ setSelectedItemId(itemId);
51616
+ if (events) {
51617
+ events.emit({
51618
+ type: item.type === "agent" ? "agent:selected" : "subagent:selected",
51619
+ source: "agentic-resources-panel",
51620
+ timestamp: Date.now(),
51621
+ payload: {
51622
+ id: itemId,
51623
+ type: item.type,
51624
+ data: item.data
51625
+ }
51626
+ });
51627
+ }
51628
+ };
51629
+ const handleSkillClick = (skill) => {
51630
+ setSelectedItemId(skill.id);
51631
+ if (events) {
51632
+ events.emit({
51633
+ type: "skill:selected",
51634
+ source: "agentic-resources-panel",
51635
+ timestamp: Date.now(),
51636
+ payload: { skillId: skill.id, skill }
51637
+ });
51638
+ }
51639
+ };
51640
+ const handleRefresh = async () => {
51641
+ setIsRefreshing(true);
51642
+ try {
51643
+ if (mode === "agents") {
51644
+ await Promise.all([refreshAgents(), refreshSubagents()]);
51645
+ } else {
51646
+ if (events) {
51647
+ events.emit({
51648
+ type: "skills:refresh",
51649
+ source: "agentic-resources-panel",
51650
+ timestamp: Date.now(),
51651
+ payload: {}
51652
+ });
51653
+ }
51654
+ setTimeout(() => {
51655
+ }, 800);
51656
+ }
51657
+ } finally {
51658
+ setIsRefreshing(false);
51659
+ }
51660
+ };
51661
+ const handleModeChange = (newMode) => {
51662
+ setMode(newMode);
51663
+ setSearchQuery("");
51664
+ setSelectedItemId(null);
51665
+ };
51666
+ const agentsCount = agents.length;
51667
+ const subagentsCount = subagents.length;
51668
+ return /* @__PURE__ */ jsxs(
51669
+ "div",
51670
+ {
51671
+ ref: panelRef,
51672
+ tabIndex: -1,
51673
+ style: {
51674
+ padding: "clamp(12px, 3vw, 20px)",
51675
+ fontFamily: theme2.fonts.body,
51676
+ height: "100%",
51677
+ boxSizing: "border-box",
51678
+ display: "flex",
51679
+ flexDirection: "column",
51680
+ gap: "16px",
51681
+ overflow: "hidden",
51682
+ backgroundColor: theme2.colors.background,
51683
+ color: theme2.colors.text,
51684
+ outline: "none"
51685
+ },
51686
+ children: [
51687
+ /* @__PURE__ */ jsxs(
51688
+ "div",
51689
+ {
51690
+ style: {
51691
+ flexShrink: 0,
51692
+ display: "flex",
51693
+ alignItems: "center",
51694
+ justifyContent: "space-between",
51695
+ gap: "12px",
51696
+ flexWrap: "wrap"
51697
+ },
51698
+ children: [
51699
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "4px", background: theme2.colors.backgroundSecondary, padding: "4px", borderRadius: theme2.radii[2], border: `1px solid ${theme2.colors.border}` }, children: [
51700
+ /* @__PURE__ */ jsxs(
51701
+ "button",
51702
+ {
51703
+ onClick: () => handleModeChange("agents"),
51704
+ style: {
51705
+ padding: "6px 14px",
51706
+ fontSize: theme2.fontSizes[1],
51707
+ fontFamily: theme2.fonts.body,
51708
+ border: "none",
51709
+ borderRadius: theme2.radii[1],
51710
+ background: mode === "agents" ? theme2.colors.background : "transparent",
51711
+ color: mode === "agents" ? theme2.colors.text : theme2.colors.textSecondary,
51712
+ cursor: "pointer",
51713
+ display: "flex",
51714
+ alignItems: "center",
51715
+ gap: "6px",
51716
+ fontWeight: mode === "agents" ? 600 : 400,
51717
+ transition: "all 0.2s ease",
51718
+ boxShadow: mode === "agents" ? "0 1px 3px rgba(0,0,0,0.1)" : "none"
51719
+ },
51720
+ children: [
51721
+ /* @__PURE__ */ jsx(Bot, { size: 14 }),
51722
+ "Agents"
51723
+ ]
51724
+ }
51725
+ ),
51726
+ /* @__PURE__ */ jsxs(
51727
+ "button",
51728
+ {
51729
+ onClick: () => handleModeChange("skills"),
51730
+ style: {
51731
+ padding: "6px 14px",
51732
+ fontSize: theme2.fontSizes[1],
51733
+ fontFamily: theme2.fonts.body,
51734
+ border: "none",
51735
+ borderRadius: theme2.radii[1],
51736
+ background: mode === "skills" ? theme2.colors.background : "transparent",
51737
+ color: mode === "skills" ? theme2.colors.text : theme2.colors.textSecondary,
51738
+ cursor: "pointer",
51739
+ display: "flex",
51740
+ alignItems: "center",
51741
+ gap: "6px",
51742
+ fontWeight: mode === "skills" ? 600 : 400,
51743
+ transition: "all 0.2s ease",
51744
+ boxShadow: mode === "skills" ? "0 1px 3px rgba(0,0,0,0.1)" : "none"
51745
+ },
51746
+ children: [
51747
+ /* @__PURE__ */ jsx(Wrench, { size: 14 }),
51748
+ "Skills"
51749
+ ]
51750
+ }
51751
+ )
51752
+ ] }),
51753
+ !isLoading && (mode === "agents" && allItems.length > 0 || mode === "skills" && skills.length > 0) && /* @__PURE__ */ jsx(
51754
+ "span",
51755
+ {
51756
+ style: {
51757
+ fontSize: theme2.fontSizes[1],
51758
+ color: theme2.colors.textSecondary,
51759
+ background: theme2.colors.backgroundSecondary,
51760
+ padding: "4px 10px",
51761
+ borderRadius: theme2.radii[1]
51762
+ },
51763
+ children: mode === "agents" ? `${filteredItems.length} ${filteredItems.length === 1 ? "item" : "items"}` : `${filteredSkills.length} ${filteredSkills.length === 1 ? "skill" : "skills"}`
51764
+ }
51765
+ ),
51766
+ (mode === "agents" && allItems.length >= 5 || mode === "skills" && skills.length >= 5) && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px", flex: "1 1 200px", maxWidth: "400px" }, children: [
51767
+ /* @__PURE__ */ jsxs(
51768
+ "div",
51769
+ {
51770
+ style: {
51771
+ position: "relative",
51772
+ flex: 1,
51773
+ minWidth: "150px"
51774
+ },
51775
+ children: [
51776
+ /* @__PURE__ */ jsx(
51777
+ Search,
51778
+ {
51779
+ size: 16,
51780
+ color: theme2.colors.textSecondary,
51781
+ style: {
51782
+ position: "absolute",
51783
+ left: "10px",
51784
+ top: "50%",
51785
+ transform: "translateY(-50%)",
51786
+ pointerEvents: "none"
51787
+ }
51788
+ }
51789
+ ),
51790
+ /* @__PURE__ */ jsx(
51791
+ "input",
51792
+ {
51793
+ type: "text",
51794
+ placeholder: mode === "agents" ? "Search agents..." : "Search skills...",
51795
+ value: searchQuery,
51796
+ onChange: (e) => setSearchQuery(e.target.value),
51797
+ style: {
51798
+ width: "100%",
51799
+ padding: "8px 32px 8px 32px",
51800
+ fontSize: theme2.fontSizes[1],
51801
+ fontFamily: theme2.fonts.body,
51802
+ border: `1px solid ${theme2.colors.border}`,
51803
+ borderRadius: theme2.radii[2],
51804
+ background: theme2.colors.backgroundSecondary,
51805
+ color: theme2.colors.text,
51806
+ outline: "none",
51807
+ boxSizing: "border-box"
51808
+ }
51809
+ }
51810
+ ),
51811
+ searchQuery && /* @__PURE__ */ jsx(
51812
+ "button",
51813
+ {
51814
+ onClick: () => setSearchQuery(""),
51815
+ style: {
51816
+ position: "absolute",
51817
+ right: "6px",
51818
+ top: "50%",
51819
+ transform: "translateY(-50%)",
51820
+ background: "transparent",
51821
+ border: "none",
51822
+ padding: "4px",
51823
+ cursor: "pointer",
51824
+ display: "flex",
51825
+ alignItems: "center",
51826
+ justifyContent: "center",
51827
+ color: theme2.colors.textSecondary
51828
+ },
51829
+ "aria-label": "Clear search",
51830
+ children: /* @__PURE__ */ jsx(X, { size: 14 })
51831
+ }
51832
+ )
51833
+ ]
51834
+ }
51835
+ ),
51836
+ /* @__PURE__ */ jsx(
51837
+ "button",
51838
+ {
51839
+ onClick: handleRefresh,
51840
+ disabled: isRefreshing || isLoading,
51841
+ style: {
51842
+ background: theme2.colors.backgroundSecondary,
51843
+ border: `1px solid ${theme2.colors.border}`,
51844
+ borderRadius: theme2.radii[1],
51845
+ padding: "8px",
51846
+ cursor: isRefreshing ? "wait" : "pointer",
51847
+ display: "flex",
51848
+ alignItems: "center",
51849
+ justifyContent: "center",
51850
+ transition: "all 0.2s ease"
51851
+ },
51852
+ title: mode === "agents" ? "Refresh agents" : "Refresh skills",
51853
+ children: /* @__PURE__ */ jsx(
51854
+ RefreshCw,
51855
+ {
51856
+ size: 16,
51857
+ color: theme2.colors.textSecondary,
51858
+ style: {
51859
+ animation: isRefreshing ? "spin 1s linear infinite" : "none"
51860
+ }
51861
+ }
51862
+ )
51863
+ }
51864
+ )
51865
+ ] })
51866
+ ]
51867
+ }
51868
+ ),
51869
+ mode === "agents" ? /* @__PURE__ */ jsxs(
51870
+ "div",
51871
+ {
51872
+ style: {
51873
+ flexShrink: 0,
51874
+ display: "flex",
51875
+ gap: "8px"
51876
+ },
51877
+ children: [
51878
+ /* @__PURE__ */ jsxs(
51879
+ "button",
51880
+ {
51881
+ onClick: () => setAgentFilter("documentation"),
51882
+ style: {
51883
+ flex: 1,
51884
+ padding: "8px 16px",
51885
+ fontSize: theme2.fontSizes[1],
51886
+ fontFamily: theme2.fonts.body,
51887
+ border: `1px solid ${agentFilter === "documentation" ? theme2.colors.primary : theme2.colors.border}`,
51888
+ borderRadius: theme2.radii[1],
51889
+ background: agentFilter === "documentation" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
51890
+ color: agentFilter === "documentation" ? theme2.colors.primary : theme2.colors.text,
51891
+ cursor: "pointer",
51892
+ display: "flex",
51893
+ alignItems: "center",
51894
+ justifyContent: "center",
51895
+ gap: "6px",
51896
+ fontWeight: agentFilter === "documentation" ? 600 : 400,
51897
+ transition: "all 0.2s ease"
51898
+ },
51899
+ children: [
51900
+ /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
51901
+ "Main Agent (",
51902
+ agentsCount,
51903
+ ")"
51904
+ ]
51905
+ }
51906
+ ),
51907
+ /* @__PURE__ */ jsxs(
51908
+ "button",
51909
+ {
51910
+ onClick: () => setAgentFilter("subagents"),
51911
+ style: {
51912
+ flex: 1,
51913
+ padding: "8px 16px",
51914
+ fontSize: theme2.fontSizes[1],
51915
+ fontFamily: theme2.fonts.body,
51916
+ border: `1px solid ${agentFilter === "subagents" ? theme2.colors.primary : theme2.colors.border}`,
51917
+ borderRadius: theme2.radii[1],
51918
+ background: agentFilter === "subagents" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
51919
+ color: agentFilter === "subagents" ? theme2.colors.primary : theme2.colors.text,
51920
+ cursor: "pointer",
51921
+ display: "flex",
51922
+ alignItems: "center",
51923
+ justifyContent: "center",
51924
+ gap: "6px",
51925
+ fontWeight: agentFilter === "subagents" ? 600 : 400,
51926
+ transition: "all 0.2s ease"
51927
+ },
51928
+ children: [
51929
+ /* @__PURE__ */ jsx(Bot, { size: 14 }),
51930
+ "Subagents (",
51931
+ subagentsCount,
51932
+ ")"
51933
+ ]
51934
+ }
51935
+ )
51936
+ ]
51937
+ }
51938
+ ) : hasRepository && /* @__PURE__ */ jsxs(
51939
+ "div",
51940
+ {
51941
+ style: {
51942
+ flexShrink: 0,
51943
+ display: "flex",
51944
+ gap: "8px"
51945
+ },
51946
+ children: [
51947
+ /* @__PURE__ */ jsx(
51948
+ "button",
51949
+ {
51950
+ onClick: () => setSkillFilter("project"),
51951
+ style: {
51952
+ flex: 1,
51953
+ padding: "8px 16px",
51954
+ fontSize: theme2.fontSizes[1],
51955
+ fontFamily: theme2.fonts.body,
51956
+ border: `1px solid ${skillFilter === "project" ? theme2.colors.primary : theme2.colors.border}`,
51957
+ borderRadius: theme2.radii[1],
51958
+ background: skillFilter === "project" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
51959
+ color: skillFilter === "project" ? theme2.colors.primary : theme2.colors.text,
51960
+ cursor: "pointer",
51961
+ display: "flex",
51962
+ alignItems: "center",
51963
+ justifyContent: "center",
51964
+ gap: "6px",
51965
+ fontWeight: skillFilter === "project" ? 600 : 400,
51966
+ transition: "all 0.2s ease"
51967
+ },
51968
+ children: "Project"
51969
+ }
51970
+ ),
51971
+ /* @__PURE__ */ jsx(
51972
+ "button",
51973
+ {
51974
+ onClick: () => setSkillFilter("global"),
51975
+ style: {
51976
+ flex: 1,
51977
+ padding: "8px 16px",
51978
+ fontSize: theme2.fontSizes[1],
51979
+ fontFamily: theme2.fonts.body,
51980
+ border: `1px solid ${skillFilter === "global" ? theme2.colors.primary : theme2.colors.border}`,
51981
+ borderRadius: theme2.radii[1],
51982
+ background: skillFilter === "global" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
51983
+ color: skillFilter === "global" ? theme2.colors.primary : theme2.colors.text,
51984
+ cursor: "pointer",
51985
+ display: "flex",
51986
+ alignItems: "center",
51987
+ justifyContent: "center",
51988
+ gap: "6px",
51989
+ fontWeight: skillFilter === "global" ? 600 : 400,
51990
+ transition: "all 0.2s ease"
51991
+ },
51992
+ children: "Global"
51993
+ }
51994
+ )
51995
+ ]
51996
+ }
51997
+ ),
51998
+ error && /* @__PURE__ */ jsxs(
51999
+ "div",
52000
+ {
52001
+ style: {
52002
+ flexShrink: 0,
52003
+ padding: "12px",
52004
+ background: `${theme2.colors.error}20`,
52005
+ border: `1px solid ${theme2.colors.error}`,
52006
+ borderRadius: theme2.radii[2],
52007
+ display: "flex",
52008
+ alignItems: "center",
52009
+ gap: "8px",
52010
+ color: theme2.colors.error,
52011
+ fontSize: theme2.fontSizes[1]
52012
+ },
52013
+ children: [
52014
+ /* @__PURE__ */ jsx(CircleAlert, { size: 16 }),
52015
+ /* @__PURE__ */ jsx("span", { children: error })
52016
+ ]
52017
+ }
52018
+ ),
52019
+ /* @__PURE__ */ jsx(
52020
+ "div",
52021
+ {
52022
+ style: {
52023
+ flex: 1,
52024
+ overflowY: "auto",
52025
+ minHeight: 0
52026
+ },
52027
+ children: mode === "agents" ? (
52028
+ // Agents view
52029
+ isLoading ? /* @__PURE__ */ jsx(
52030
+ "div",
52031
+ {
52032
+ style: {
52033
+ height: "100%",
52034
+ display: "flex",
52035
+ alignItems: "center",
52036
+ justifyContent: "center",
52037
+ color: theme2.colors.textSecondary,
52038
+ fontSize: theme2.fontSizes[2]
52039
+ },
52040
+ children: "Loading agents..."
52041
+ }
52042
+ ) : filteredItems.length === 0 ? /* @__PURE__ */ jsxs(
52043
+ "div",
52044
+ {
52045
+ style: {
52046
+ height: "100%",
52047
+ display: "flex",
52048
+ flexDirection: "column",
52049
+ alignItems: "center",
52050
+ justifyContent: "center",
52051
+ gap: "16px",
52052
+ color: theme2.colors.textSecondary,
52053
+ padding: "24px"
52054
+ },
52055
+ children: [
52056
+ /* @__PURE__ */ jsx(FileCode, { size: 48, color: theme2.colors.border }),
52057
+ /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
52058
+ /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: theme2.fontSizes[2] }, children: searchQuery ? "No agents match your search" : "No agents found" }),
52059
+ /* @__PURE__ */ jsx("p", { style: { margin: "8px 0 0 0", fontSize: theme2.fontSizes[1] }, children: searchQuery ? "Try a different search term" : "Add AGENTS.md or create subagents in .claude/agents/ to get started" })
52060
+ ] })
52061
+ ]
52062
+ }
52063
+ ) : /* @__PURE__ */ jsx(
52064
+ "div",
52065
+ {
52066
+ style: {
52067
+ display: "grid",
52068
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
52069
+ gap: "16px",
52070
+ padding: "4px"
52071
+ },
52072
+ children: filteredItems.map((item) => {
52073
+ if (item.type === "agent") {
52074
+ return /* @__PURE__ */ jsx(
52075
+ AgentCard,
52076
+ {
52077
+ agent: item.data,
52078
+ onClick: () => handleItemClick(item),
52079
+ isSelected: selectedItemId === item.data.id
52080
+ },
52081
+ item.data.id
52082
+ );
52083
+ } else {
52084
+ return /* @__PURE__ */ jsx(
52085
+ SubagentCard,
52086
+ {
52087
+ subagent: item.data,
52088
+ onClick: () => handleItemClick(item),
52089
+ isSelected: selectedItemId === item.data.id
52090
+ },
52091
+ item.data.id
52092
+ );
52093
+ }
52094
+ })
52095
+ }
52096
+ )
52097
+ ) : (
52098
+ // Skills view
52099
+ isLoading ? /* @__PURE__ */ jsx(
52100
+ "div",
52101
+ {
52102
+ style: {
52103
+ height: "100%",
52104
+ display: "flex",
52105
+ alignItems: "center",
52106
+ justifyContent: "center",
52107
+ color: theme2.colors.textSecondary,
52108
+ fontSize: theme2.fontSizes[2]
52109
+ },
52110
+ children: "Loading skills..."
52111
+ }
52112
+ ) : filteredSkills.length === 0 ? /* @__PURE__ */ jsxs(
52113
+ "div",
52114
+ {
52115
+ style: {
52116
+ height: "100%",
52117
+ display: "flex",
52118
+ flexDirection: "column",
52119
+ alignItems: "center",
52120
+ justifyContent: "center",
52121
+ gap: "16px",
52122
+ color: theme2.colors.textSecondary,
52123
+ padding: "24px"
52124
+ },
52125
+ children: [
52126
+ /* @__PURE__ */ jsx(FileCode, { size: 48, color: theme2.colors.border }),
52127
+ /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
52128
+ /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: theme2.fontSizes[2] }, children: searchQuery ? "No skills match your search" : "No skills found" }),
52129
+ /* @__PURE__ */ jsx("p", { style: { margin: "8px 0 0 0", fontSize: theme2.fontSizes[1] }, children: searchQuery ? "Try a different search term" : "Add SKILL.md files to your repository to get started" })
52130
+ ] })
52131
+ ]
52132
+ }
52133
+ ) : /* @__PURE__ */ jsx(
52134
+ "div",
52135
+ {
52136
+ style: {
52137
+ display: "grid",
52138
+ gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))",
52139
+ gap: "16px",
52140
+ padding: "4px"
52141
+ },
52142
+ children: filteredSkills.map((skill) => /* @__PURE__ */ jsx(
52143
+ SkillCard,
52144
+ {
52145
+ skill,
52146
+ onClick: handleSkillClick,
52147
+ isSelected: selectedItemId === skill.id,
52148
+ filterContext: skillFilter
52149
+ },
52150
+ skill.id
52151
+ ))
52152
+ }
52153
+ )
52154
+ )
52155
+ }
52156
+ ),
52157
+ /* @__PURE__ */ jsx("style", { children: `
52158
+ @keyframes spin {
52159
+ to { transform: rotate(360deg); }
52160
+ }
52161
+ ` })
52162
+ ]
52163
+ }
52164
+ );
52165
+ };
51447
52166
  const panels = [
51448
52167
  {
51449
52168
  metadata: {
@@ -51569,6 +52288,31 @@ const panels = [
51569
52288
  onUnmount: async (_context) => {
51570
52289
  console.log("Agent Detail Panel unmounting");
51571
52290
  }
52291
+ },
52292
+ {
52293
+ metadata: {
52294
+ id: "industry-theme.agentic-resources",
52295
+ name: "Agentic Resources",
52296
+ icon: "🔧",
52297
+ version: "0.1.0",
52298
+ author: "Principal ADE",
52299
+ description: "Unified panel for both Agents and Skills with mode toggle",
52300
+ slices: ["fileTree", "globalAgents", "globalSubagents", "globalSkills"]
52301
+ // Data slices this panel depends on
52302
+ },
52303
+ component: AgenticResourcesPanel,
52304
+ // Optional: Called when this specific panel is mounted
52305
+ onMount: async (context) => {
52306
+ var _a;
52307
+ console.log(
52308
+ "Agentic Resources Panel mounted",
52309
+ (_a = context.currentScope.repository) == null ? void 0 : _a.path
52310
+ );
52311
+ },
52312
+ // Optional: Called when this specific panel is unmounted
52313
+ onUnmount: async (_context) => {
52314
+ console.log("Agentic Resources Panel unmounting");
52315
+ }
51572
52316
  }
51573
52317
  ];
51574
52318
  const onPackageLoad = async () => {
@@ -51578,6 +52322,7 @@ const onPackageUnload = async () => {
51578
52322
  console.log("Panel package unloading - Agent Panels Extension");
51579
52323
  };
51580
52324
  export {
52325
+ AgenticResourcesPanel,
51581
52326
  SkillsBrowsePanel,
51582
52327
  onPackageLoad,
51583
52328
  onPackageUnload,