@industry-theme/agent-panels 0.2.44 → 0.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/panels/AgentDetailPanel.d.ts +2 -2
- package/dist/panels/AgentDetailPanel.d.ts.map +1 -1
- package/dist/panels/AgenticResourcesPanel.d.ts +2 -2
- package/dist/panels/AgenticResourcesPanel.d.ts.map +1 -1
- package/dist/panels/GlobalSkillsPanel.d.ts +2 -2
- package/dist/panels/GlobalSkillsPanel.d.ts.map +1 -1
- package/dist/panels/SkillDetailPanel.d.ts +2 -2
- package/dist/panels/SkillDetailPanel.d.ts.map +1 -1
- package/dist/panels/SkillsBrowsePanel.d.ts +2 -2
- package/dist/panels/SkillsBrowsePanel.d.ts.map +1 -1
- package/dist/panels/agents/hooks/useAgentsData.d.ts +3 -2
- package/dist/panels/agents/hooks/useAgentsData.d.ts.map +1 -1
- package/dist/panels/agents/hooks/useSubagentsData.d.ts +3 -2
- package/dist/panels/agents/hooks/useSubagentsData.d.ts.map +1 -1
- package/dist/panels/skills/hooks/useSkillsBrowseData.d.ts +3 -2
- package/dist/panels/skills/hooks/useSkillsBrowseData.d.ts.map +1 -1
- package/dist/panels/skills/hooks/useSkillsData.d.ts +3 -2
- package/dist/panels/skills/hooks/useSkillsData.d.ts.map +1 -1
- package/dist/panels.bundle.js +617 -1560
- package/dist/panels.bundle.js.map +1 -1
- package/dist/types/agent-panels.types.d.ts +66 -0
- package/dist/types/agent-panels.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/panels/AgentsListPanel.d.ts +0 -13
- package/dist/panels/AgentsListPanel.d.ts.map +0 -1
- package/dist/panels/SkillsListPanel.d.ts +0 -25
- package/dist/panels/SkillsListPanel.d.ts.map +0 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -2795,133 +2795,62 @@ const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, i
|
|
|
2795
2795
|
};
|
|
2796
2796
|
};
|
|
2797
2797
|
const EMPTY_SKILLS_ARRAY$1 = [];
|
|
2798
|
-
const
|
|
2799
|
-
var _a, _b, _c;
|
|
2800
|
-
if (((_a = skill.metadata) == null ? void 0 : _a.owner) && ((_b = skill.metadata) == null ? void 0 : _b.repo) && ((_c = skill.metadata) == null ? void 0 : _c.skillPath)) {
|
|
2801
|
-
return `github:${skill.metadata.owner}/${skill.metadata.repo}/${skill.metadata.skillPath}`;
|
|
2802
|
-
}
|
|
2803
|
-
const normalizedName = skill.name.toLowerCase().replace(/\s+/g, "-");
|
|
2804
|
-
return `name:${normalizedName}`;
|
|
2805
|
-
};
|
|
2806
|
-
const comparePriority = (skill1, skill2) => {
|
|
2807
|
-
var _a, _b;
|
|
2808
|
-
if (skill1.priority !== skill2.priority) {
|
|
2809
|
-
return skill1.priority < skill2.priority;
|
|
2810
|
-
}
|
|
2811
|
-
const time1 = ((_a = skill1.metadata) == null ? void 0 : _a.installedAt) ? new Date(skill1.metadata.installedAt).getTime() : 0;
|
|
2812
|
-
const time2 = ((_b = skill2.metadata) == null ? void 0 : _b.installedAt) ? new Date(skill2.metadata.installedAt).getTime() : 0;
|
|
2813
|
-
return time1 > time2;
|
|
2814
|
-
};
|
|
2815
|
-
const skillToInstallation = (skill) => ({
|
|
2816
|
-
path: skill.path,
|
|
2817
|
-
source: skill.source,
|
|
2818
|
-
priority: skill.priority,
|
|
2819
|
-
skillFolderPath: skill.skillFolderPath,
|
|
2820
|
-
metadata: skill.metadata
|
|
2821
|
-
});
|
|
2822
|
-
const deduplicateSkills = (skills, isBrowserMode = false) => {
|
|
2823
|
-
if (isBrowserMode) {
|
|
2824
|
-
return skills;
|
|
2825
|
-
}
|
|
2826
|
-
if (skills.length === 0) {
|
|
2827
|
-
return skills;
|
|
2828
|
-
}
|
|
2829
|
-
const skillGroups = /* @__PURE__ */ new Map();
|
|
2830
|
-
for (const skill of skills) {
|
|
2831
|
-
const key = getDeduplicationKey(skill);
|
|
2832
|
-
const group = skillGroups.get(key) || [];
|
|
2833
|
-
group.push(skill);
|
|
2834
|
-
skillGroups.set(key, group);
|
|
2835
|
-
}
|
|
2836
|
-
const deduplicatedSkills = [];
|
|
2837
|
-
for (const group of skillGroups.values()) {
|
|
2838
|
-
if (group.length === 1) {
|
|
2839
|
-
deduplicatedSkills.push({
|
|
2840
|
-
...group[0],
|
|
2841
|
-
installedLocations: [skillToInstallation(group[0])]
|
|
2842
|
-
});
|
|
2843
|
-
continue;
|
|
2844
|
-
}
|
|
2845
|
-
const sortedByPriority = [...group].sort(
|
|
2846
|
-
(a, b) => comparePriority(a, b) ? -1 : 1
|
|
2847
|
-
);
|
|
2848
|
-
const primary = sortedByPriority[0];
|
|
2849
|
-
const installations = group.map(skillToInstallation);
|
|
2850
|
-
installations.sort((a, b) => a.priority - b.priority);
|
|
2851
|
-
deduplicatedSkills.push({
|
|
2852
|
-
...primary,
|
|
2853
|
-
installedLocations: installations
|
|
2854
|
-
});
|
|
2855
|
-
}
|
|
2856
|
-
return deduplicatedSkills;
|
|
2857
|
-
};
|
|
2858
|
-
const useSkillsData = ({
|
|
2798
|
+
const useSkillsBrowseData = ({
|
|
2859
2799
|
context
|
|
2860
2800
|
}) => {
|
|
2861
|
-
var _a, _b
|
|
2801
|
+
var _a, _b;
|
|
2862
2802
|
const [skills, setSkills] = useState(EMPTY_SKILLS_ARRAY$1);
|
|
2863
2803
|
const [isLoading, setIsLoading] = useState(true);
|
|
2864
2804
|
const [error, setError] = useState(null);
|
|
2865
|
-
const fileTreeSlice = context.
|
|
2805
|
+
const fileTreeSlice = context.fileTree;
|
|
2866
2806
|
const fileTree = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
2867
2807
|
const fileTreeSha = fileTree == null ? void 0 : fileTree.sha;
|
|
2868
|
-
const
|
|
2869
|
-
const
|
|
2870
|
-
const globalSkillsCount = globalSkills.length;
|
|
2871
|
-
const repoPath = (_b = context.currentScope.repository) == null ? void 0 : _b.path;
|
|
2872
|
-
const fileSystem = (_c = context.adapters) == null ? void 0 : _c.fileSystem;
|
|
2808
|
+
const repoPath = (_a = context.currentScope.repository) == null ? void 0 : _a.path;
|
|
2809
|
+
const fileSystem = (_b = context.adapters) == null ? void 0 : _b.fileSystem;
|
|
2873
2810
|
const lastLoadedSha = useRef(void 0);
|
|
2874
|
-
const lastGlobalSkillsCount = useRef(0);
|
|
2875
2811
|
const loadSkills = useCallback(async () => {
|
|
2876
|
-
if (fileTreeSha === lastLoadedSha.current
|
|
2812
|
+
if (fileTreeSha === lastLoadedSha.current) {
|
|
2877
2813
|
return;
|
|
2878
2814
|
}
|
|
2879
2815
|
setIsLoading(true);
|
|
2880
2816
|
setError(null);
|
|
2881
2817
|
try {
|
|
2882
|
-
let
|
|
2883
|
-
let isBrowserMode = false;
|
|
2818
|
+
let repoSkills = [];
|
|
2884
2819
|
if (fileTree && (fileSystem == null ? void 0 : fileSystem.readFile) && repoPath) {
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2820
|
+
const isGithubRepo = !repoPath.startsWith("/");
|
|
2821
|
+
if (!isGithubRepo) {
|
|
2822
|
+
console.warn("[useSkillsBrowseData] Not a GitHub repo, skipping skill load");
|
|
2823
|
+
setSkills(EMPTY_SKILLS_ARRAY$1);
|
|
2824
|
+
lastLoadedSha.current = fileTreeSha;
|
|
2825
|
+
setIsLoading(false);
|
|
2826
|
+
return;
|
|
2827
|
+
}
|
|
2828
|
+
const skillPaths = findSkillFiles(fileTree, true);
|
|
2892
2829
|
const skillPromises = skillPaths.map(async (skillPath) => {
|
|
2893
2830
|
try {
|
|
2894
|
-
const
|
|
2895
|
-
|
|
2896
|
-
return parseSkillContent(content2, skillPath, fileTree, fileSystem, isBrowserMode);
|
|
2831
|
+
const content2 = await fileSystem.readFile(skillPath);
|
|
2832
|
+
return parseSkillContent(content2, skillPath, fileTree, fileSystem, true);
|
|
2897
2833
|
} catch (err) {
|
|
2898
|
-
console.error(`Failed to read skill at ${skillPath}:`, err);
|
|
2834
|
+
console.error(`[useSkillsBrowseData] Failed to read skill at ${skillPath}:`, err);
|
|
2899
2835
|
return null;
|
|
2900
2836
|
}
|
|
2901
2837
|
});
|
|
2902
|
-
|
|
2838
|
+
repoSkills = (await Promise.all(skillPromises)).filter(
|
|
2903
2839
|
(skill) => skill !== null
|
|
2904
2840
|
);
|
|
2905
2841
|
}
|
|
2906
|
-
|
|
2907
|
-
const allSkills = [...localSkills, ...globalSkills];
|
|
2908
|
-
console.log("[useSkillsData] Total skills before deduplication:", allSkills.length);
|
|
2909
|
-
const deduplicatedSkills = deduplicateSkills(allSkills, isBrowserMode);
|
|
2910
|
-
console.log("[useSkillsData] Total skills after deduplication:", deduplicatedSkills.length);
|
|
2911
|
-
setSkills(deduplicatedSkills);
|
|
2842
|
+
setSkills(repoSkills);
|
|
2912
2843
|
lastLoadedSha.current = fileTreeSha;
|
|
2913
|
-
lastGlobalSkillsCount.current = globalSkillsCount;
|
|
2914
2844
|
} catch (err) {
|
|
2915
2845
|
const errorMessage = err instanceof Error ? err.message : "Failed to load skills";
|
|
2916
2846
|
setError(errorMessage);
|
|
2917
|
-
console.error("Error loading skills:", err);
|
|
2847
|
+
console.error("[useSkillsBrowseData] Error loading skills:", err);
|
|
2918
2848
|
} finally {
|
|
2919
2849
|
setIsLoading(false);
|
|
2920
2850
|
}
|
|
2921
|
-
}, [fileTree, fileTreeSha,
|
|
2851
|
+
}, [fileTree, fileTreeSha, repoPath, fileSystem]);
|
|
2922
2852
|
const refreshSkills = useCallback(async () => {
|
|
2923
2853
|
lastLoadedSha.current = void 0;
|
|
2924
|
-
lastGlobalSkillsCount.current = -1;
|
|
2925
2854
|
await loadSkills();
|
|
2926
2855
|
}, [loadSkills]);
|
|
2927
2856
|
useEffect(() => {
|
|
@@ -3528,22 +3457,32 @@ ${otherLocations.map((loc) => `${abbreviateSourceName(loc.source)}: ${loc.path}`
|
|
|
3528
3457
|
}
|
|
3529
3458
|
);
|
|
3530
3459
|
};
|
|
3531
|
-
const
|
|
3460
|
+
const SkillsBrowsePanel = ({
|
|
3532
3461
|
context,
|
|
3533
3462
|
events,
|
|
3534
|
-
browseMode = false,
|
|
3535
3463
|
supportsRefresh = false
|
|
3536
3464
|
}) => {
|
|
3465
|
+
var _a, _b;
|
|
3537
3466
|
const { theme: theme2 } = useTheme();
|
|
3538
3467
|
const panelRef = useRef(null);
|
|
3539
3468
|
const [selectedSkillId, setSelectedSkillId] = useState(null);
|
|
3540
3469
|
const [searchQuery, setSearchQuery] = useState("");
|
|
3541
|
-
const [skillFilter, setSkillFilter] = useState("project");
|
|
3542
3470
|
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
3543
|
-
const { skills, isLoading, error, refreshSkills } =
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3471
|
+
const { skills, isLoading, error, refreshSkills } = useSkillsBrowseData({ context });
|
|
3472
|
+
const fileTreeSlice = context.fileTree;
|
|
3473
|
+
const fileTree = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
3474
|
+
const sourceInfo = (_a = fileTree == null ? void 0 : fileTree.metadata) == null ? void 0 : _a.sourceInfo;
|
|
3475
|
+
const owner = sourceInfo == null ? void 0 : sourceInfo.owner;
|
|
3476
|
+
const repo = sourceInfo == null ? void 0 : sourceInfo.repo;
|
|
3477
|
+
const globalSkillsSlice = context.globalSkills;
|
|
3478
|
+
const installedSkillNames = useMemo(() => {
|
|
3479
|
+
var _a2;
|
|
3480
|
+
const globalSkills = ((_a2 = globalSkillsSlice == null ? void 0 : globalSkillsSlice.data) == null ? void 0 : _a2.skills) || [];
|
|
3481
|
+
return new Set(globalSkills.map((skill) => skill.name));
|
|
3482
|
+
}, [(_b = globalSkillsSlice == null ? void 0 : globalSkillsSlice.data) == null ? void 0 : _b.skills]);
|
|
3483
|
+
gt("skills-browse", events, () => {
|
|
3484
|
+
var _a2;
|
|
3485
|
+
return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
|
|
3547
3486
|
});
|
|
3548
3487
|
useEffect(() => {
|
|
3549
3488
|
const unsubscribeInstalled = events.on("skill:installed", () => {
|
|
@@ -3557,52 +3496,29 @@ const SkillsListPanel = ({
|
|
|
3557
3496
|
unsubscribeUninstalled();
|
|
3558
3497
|
};
|
|
3559
3498
|
}, [events, refreshSkills]);
|
|
3560
|
-
const hasRepository = useMemo(() => {
|
|
3561
|
-
const fileTreeSlice = context.getSlice("fileTree");
|
|
3562
|
-
return !!(fileTreeSlice == null ? void 0 : fileTreeSlice.data);
|
|
3563
|
-
}, [context]);
|
|
3564
3499
|
const filteredSkills = useMemo(() => {
|
|
3565
3500
|
let filtered = skills;
|
|
3566
|
-
if (skillFilter === "project") {
|
|
3567
|
-
filtered = filtered.filter((skill) => {
|
|
3568
|
-
if (skill.installedLocations && skill.installedLocations.length > 0) {
|
|
3569
|
-
return skill.installedLocations.some(
|
|
3570
|
-
(loc) => loc.source === "project-universal" || loc.source === "project-claude" || loc.source === "project-other"
|
|
3571
|
-
);
|
|
3572
|
-
}
|
|
3573
|
-
return skill.source === "project-universal" || skill.source === "project-claude" || skill.source === "project-other";
|
|
3574
|
-
});
|
|
3575
|
-
} else if (skillFilter === "global") {
|
|
3576
|
-
filtered = filtered.filter((skill) => {
|
|
3577
|
-
if (skill.installedLocations && skill.installedLocations.length > 0) {
|
|
3578
|
-
return skill.installedLocations.some(
|
|
3579
|
-
(loc) => loc.source === "global-universal" || loc.source === "global-claude"
|
|
3580
|
-
);
|
|
3581
|
-
}
|
|
3582
|
-
return skill.source === "global-universal" || skill.source === "global-claude";
|
|
3583
|
-
});
|
|
3584
|
-
}
|
|
3585
3501
|
if (searchQuery.trim()) {
|
|
3586
3502
|
const query = searchQuery.toLowerCase().trim();
|
|
3587
3503
|
filtered = filtered.filter((skill) => {
|
|
3588
|
-
var
|
|
3504
|
+
var _a2, _b2;
|
|
3589
3505
|
if (skill.name.toLowerCase().includes(query)) return true;
|
|
3590
|
-
if ((
|
|
3591
|
-
if ((
|
|
3506
|
+
if ((_a2 = skill.description) == null ? void 0 : _a2.toLowerCase().includes(query)) return true;
|
|
3507
|
+
if ((_b2 = skill.capabilities) == null ? void 0 : _b2.some((cap2) => cap2.toLowerCase().includes(query)))
|
|
3592
3508
|
return true;
|
|
3593
3509
|
if (skill.path.toLowerCase().includes(query)) return true;
|
|
3594
3510
|
return false;
|
|
3595
3511
|
});
|
|
3596
3512
|
}
|
|
3597
3513
|
return filtered;
|
|
3598
|
-
}, [skills, searchQuery
|
|
3514
|
+
}, [skills, searchQuery]);
|
|
3599
3515
|
const handleSkillClick = (skill) => {
|
|
3600
3516
|
setSelectedSkillId(skill.id);
|
|
3601
3517
|
if (events) {
|
|
3602
3518
|
events.emit({
|
|
3603
3519
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3604
3520
|
type: "skill:selected",
|
|
3605
|
-
source: "skills-
|
|
3521
|
+
source: "skills-browse-panel",
|
|
3606
3522
|
timestamp: Date.now(),
|
|
3607
3523
|
payload: { skillId: skill.id, skill }
|
|
3608
3524
|
});
|
|
@@ -3614,7 +3530,7 @@ const SkillsListPanel = ({
|
|
|
3614
3530
|
events.emit({
|
|
3615
3531
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3616
3532
|
type: "skills:refresh",
|
|
3617
|
-
source: "skills-
|
|
3533
|
+
source: "skills-browse-panel",
|
|
3618
3534
|
timestamp: Date.now(),
|
|
3619
3535
|
payload: {}
|
|
3620
3536
|
});
|
|
@@ -3655,7 +3571,50 @@ const SkillsListPanel = ({
|
|
|
3655
3571
|
},
|
|
3656
3572
|
children: [
|
|
3657
3573
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
3658
|
-
/* @__PURE__ */
|
|
3574
|
+
owner && repo ? /* @__PURE__ */ jsxs(
|
|
3575
|
+
"a",
|
|
3576
|
+
{
|
|
3577
|
+
href: `https://github.com/${owner}/${repo}`,
|
|
3578
|
+
target: "_blank",
|
|
3579
|
+
rel: "noopener noreferrer",
|
|
3580
|
+
style: {
|
|
3581
|
+
textDecoration: "none",
|
|
3582
|
+
display: "flex",
|
|
3583
|
+
flexDirection: "column",
|
|
3584
|
+
gap: "2px"
|
|
3585
|
+
},
|
|
3586
|
+
children: [
|
|
3587
|
+
/* @__PURE__ */ jsx(
|
|
3588
|
+
"h2",
|
|
3589
|
+
{
|
|
3590
|
+
style: {
|
|
3591
|
+
margin: 0,
|
|
3592
|
+
fontSize: theme2.fontSizes[4],
|
|
3593
|
+
color: theme2.colors.text,
|
|
3594
|
+
fontFamily: theme2.fonts.monospace,
|
|
3595
|
+
lineHeight: 1.2
|
|
3596
|
+
},
|
|
3597
|
+
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
3598
|
+
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
3599
|
+
children: String(repo || "")
|
|
3600
|
+
}
|
|
3601
|
+
),
|
|
3602
|
+
/* @__PURE__ */ jsx(
|
|
3603
|
+
"div",
|
|
3604
|
+
{
|
|
3605
|
+
style: {
|
|
3606
|
+
fontSize: theme2.fontSizes[1],
|
|
3607
|
+
color: theme2.colors.textSecondary,
|
|
3608
|
+
fontFamily: theme2.fonts.monospace
|
|
3609
|
+
},
|
|
3610
|
+
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
3611
|
+
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
3612
|
+
children: String(owner || "")
|
|
3613
|
+
}
|
|
3614
|
+
)
|
|
3615
|
+
]
|
|
3616
|
+
}
|
|
3617
|
+
) : /* @__PURE__ */ jsx(
|
|
3659
3618
|
"h2",
|
|
3660
3619
|
{
|
|
3661
3620
|
style: {
|
|
@@ -3675,7 +3634,7 @@ const SkillsListPanel = ({
|
|
|
3675
3634
|
},
|
|
3676
3635
|
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
3677
3636
|
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
3678
|
-
children: "
|
|
3637
|
+
children: "Browse Skills"
|
|
3679
3638
|
}
|
|
3680
3639
|
)
|
|
3681
3640
|
}
|
|
@@ -3801,66 +3760,6 @@ const SkillsListPanel = ({
|
|
|
3801
3760
|
]
|
|
3802
3761
|
}
|
|
3803
3762
|
),
|
|
3804
|
-
hasRepository && /* @__PURE__ */ jsxs(
|
|
3805
|
-
"div",
|
|
3806
|
-
{
|
|
3807
|
-
style: {
|
|
3808
|
-
flexShrink: 0,
|
|
3809
|
-
display: "flex",
|
|
3810
|
-
gap: "8px"
|
|
3811
|
-
},
|
|
3812
|
-
children: [
|
|
3813
|
-
/* @__PURE__ */ jsx(
|
|
3814
|
-
"button",
|
|
3815
|
-
{
|
|
3816
|
-
onClick: () => setSkillFilter("project"),
|
|
3817
|
-
style: {
|
|
3818
|
-
flex: 1,
|
|
3819
|
-
padding: "8px 16px",
|
|
3820
|
-
fontSize: theme2.fontSizes[1],
|
|
3821
|
-
fontFamily: theme2.fonts.body,
|
|
3822
|
-
border: `1px solid ${skillFilter === "project" ? theme2.colors.primary : theme2.colors.border}`,
|
|
3823
|
-
borderRadius: theme2.radii[1],
|
|
3824
|
-
background: skillFilter === "project" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
|
|
3825
|
-
color: skillFilter === "project" ? theme2.colors.primary : theme2.colors.text,
|
|
3826
|
-
cursor: "pointer",
|
|
3827
|
-
display: "flex",
|
|
3828
|
-
alignItems: "center",
|
|
3829
|
-
justifyContent: "center",
|
|
3830
|
-
gap: "6px",
|
|
3831
|
-
fontWeight: skillFilter === "project" ? 600 : 400,
|
|
3832
|
-
transition: "all 0.2s ease"
|
|
3833
|
-
},
|
|
3834
|
-
children: browseMode ? "Git Repo" : "Project"
|
|
3835
|
-
}
|
|
3836
|
-
),
|
|
3837
|
-
/* @__PURE__ */ jsx(
|
|
3838
|
-
"button",
|
|
3839
|
-
{
|
|
3840
|
-
onClick: () => setSkillFilter("global"),
|
|
3841
|
-
style: {
|
|
3842
|
-
flex: 1,
|
|
3843
|
-
padding: "8px 16px",
|
|
3844
|
-
fontSize: theme2.fontSizes[1],
|
|
3845
|
-
fontFamily: theme2.fonts.body,
|
|
3846
|
-
border: `1px solid ${skillFilter === "global" ? theme2.colors.primary : theme2.colors.border}`,
|
|
3847
|
-
borderRadius: theme2.radii[1],
|
|
3848
|
-
background: skillFilter === "global" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
|
|
3849
|
-
color: skillFilter === "global" ? theme2.colors.primary : theme2.colors.text,
|
|
3850
|
-
cursor: "pointer",
|
|
3851
|
-
display: "flex",
|
|
3852
|
-
alignItems: "center",
|
|
3853
|
-
justifyContent: "center",
|
|
3854
|
-
gap: "6px",
|
|
3855
|
-
fontWeight: skillFilter === "global" ? 600 : 400,
|
|
3856
|
-
transition: "all 0.2s ease"
|
|
3857
|
-
},
|
|
3858
|
-
children: "Global"
|
|
3859
|
-
}
|
|
3860
|
-
)
|
|
3861
|
-
]
|
|
3862
|
-
}
|
|
3863
|
-
),
|
|
3864
3763
|
error && /* @__PURE__ */ jsxs(
|
|
3865
3764
|
"div",
|
|
3866
3765
|
{
|
|
@@ -3901,7 +3800,7 @@ const SkillsListPanel = ({
|
|
|
3901
3800
|
color: theme2.colors.textSecondary,
|
|
3902
3801
|
fontSize: theme2.fontSizes[2]
|
|
3903
3802
|
},
|
|
3904
|
-
children: "Loading skills..."
|
|
3803
|
+
children: "Loading skills from repository..."
|
|
3905
3804
|
}
|
|
3906
3805
|
) : filteredSkills.length === 0 ? /* @__PURE__ */ jsxs(
|
|
3907
3806
|
"div",
|
|
@@ -3919,8 +3818,8 @@ const SkillsListPanel = ({
|
|
|
3919
3818
|
children: [
|
|
3920
3819
|
/* @__PURE__ */ jsx(FileCode, { size: 48, color: theme2.colors.border }),
|
|
3921
3820
|
/* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
3922
|
-
/* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: theme2.fontSizes[2] }, children: searchQuery ? "No skills match your search" : "No skills found" }),
|
|
3923
|
-
/* @__PURE__ */ jsx("p", { style: { margin: "8px 0 0 0", fontSize: theme2.fontSizes[1] }, children: searchQuery ? "Try a different search term" : "
|
|
3821
|
+
/* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: theme2.fontSizes[2] }, children: searchQuery ? "No skills match your search" : "No skills found in this repository" }),
|
|
3822
|
+
/* @__PURE__ */ jsx("p", { style: { margin: "8px 0 0 0", fontSize: theme2.fontSizes[1] }, children: searchQuery ? "Try a different search term" : "This repository does not contain any SKILL.md files" })
|
|
3924
3823
|
] })
|
|
3925
3824
|
]
|
|
3926
3825
|
}
|
|
@@ -3939,7 +3838,7 @@ const SkillsListPanel = ({
|
|
|
3939
3838
|
skill,
|
|
3940
3839
|
onClick: handleSkillClick,
|
|
3941
3840
|
isSelected: selectedSkillId === skill.id,
|
|
3942
|
-
|
|
3841
|
+
isInstalled: installedSkillNames.has(skill.name)
|
|
3943
3842
|
},
|
|
3944
3843
|
skill.id
|
|
3945
3844
|
))
|
|
@@ -3957,62 +3856,133 @@ const SkillsListPanel = ({
|
|
|
3957
3856
|
);
|
|
3958
3857
|
};
|
|
3959
3858
|
const EMPTY_SKILLS_ARRAY = [];
|
|
3960
|
-
const
|
|
3859
|
+
const getDeduplicationKey = (skill) => {
|
|
3860
|
+
var _a, _b, _c;
|
|
3861
|
+
if (((_a = skill.metadata) == null ? void 0 : _a.owner) && ((_b = skill.metadata) == null ? void 0 : _b.repo) && ((_c = skill.metadata) == null ? void 0 : _c.skillPath)) {
|
|
3862
|
+
return `github:${skill.metadata.owner}/${skill.metadata.repo}/${skill.metadata.skillPath}`;
|
|
3863
|
+
}
|
|
3864
|
+
const normalizedName = skill.name.toLowerCase().replace(/\s+/g, "-");
|
|
3865
|
+
return `name:${normalizedName}`;
|
|
3866
|
+
};
|
|
3867
|
+
const comparePriority = (skill1, skill2) => {
|
|
3868
|
+
var _a, _b;
|
|
3869
|
+
if (skill1.priority !== skill2.priority) {
|
|
3870
|
+
return skill1.priority < skill2.priority;
|
|
3871
|
+
}
|
|
3872
|
+
const time1 = ((_a = skill1.metadata) == null ? void 0 : _a.installedAt) ? new Date(skill1.metadata.installedAt).getTime() : 0;
|
|
3873
|
+
const time2 = ((_b = skill2.metadata) == null ? void 0 : _b.installedAt) ? new Date(skill2.metadata.installedAt).getTime() : 0;
|
|
3874
|
+
return time1 > time2;
|
|
3875
|
+
};
|
|
3876
|
+
const skillToInstallation = (skill) => ({
|
|
3877
|
+
path: skill.path,
|
|
3878
|
+
source: skill.source,
|
|
3879
|
+
priority: skill.priority,
|
|
3880
|
+
skillFolderPath: skill.skillFolderPath,
|
|
3881
|
+
metadata: skill.metadata
|
|
3882
|
+
});
|
|
3883
|
+
const deduplicateSkills = (skills, isBrowserMode = false) => {
|
|
3884
|
+
if (isBrowserMode) {
|
|
3885
|
+
return skills;
|
|
3886
|
+
}
|
|
3887
|
+
if (skills.length === 0) {
|
|
3888
|
+
return skills;
|
|
3889
|
+
}
|
|
3890
|
+
const skillGroups = /* @__PURE__ */ new Map();
|
|
3891
|
+
for (const skill of skills) {
|
|
3892
|
+
const key = getDeduplicationKey(skill);
|
|
3893
|
+
const group = skillGroups.get(key) || [];
|
|
3894
|
+
group.push(skill);
|
|
3895
|
+
skillGroups.set(key, group);
|
|
3896
|
+
}
|
|
3897
|
+
const deduplicatedSkills = [];
|
|
3898
|
+
for (const group of skillGroups.values()) {
|
|
3899
|
+
if (group.length === 1) {
|
|
3900
|
+
deduplicatedSkills.push({
|
|
3901
|
+
...group[0],
|
|
3902
|
+
installedLocations: [skillToInstallation(group[0])]
|
|
3903
|
+
});
|
|
3904
|
+
continue;
|
|
3905
|
+
}
|
|
3906
|
+
const sortedByPriority = [...group].sort(
|
|
3907
|
+
(a, b) => comparePriority(a, b) ? -1 : 1
|
|
3908
|
+
);
|
|
3909
|
+
const primary = sortedByPriority[0];
|
|
3910
|
+
const installations = group.map(skillToInstallation);
|
|
3911
|
+
installations.sort((a, b) => a.priority - b.priority);
|
|
3912
|
+
deduplicatedSkills.push({
|
|
3913
|
+
...primary,
|
|
3914
|
+
installedLocations: installations
|
|
3915
|
+
});
|
|
3916
|
+
}
|
|
3917
|
+
return deduplicatedSkills;
|
|
3918
|
+
};
|
|
3919
|
+
const useSkillsData = ({
|
|
3961
3920
|
context
|
|
3962
3921
|
}) => {
|
|
3963
|
-
var _a, _b;
|
|
3922
|
+
var _a, _b, _c;
|
|
3964
3923
|
const [skills, setSkills] = useState(EMPTY_SKILLS_ARRAY);
|
|
3965
3924
|
const [isLoading, setIsLoading] = useState(true);
|
|
3966
3925
|
const [error, setError] = useState(null);
|
|
3967
|
-
const fileTreeSlice = context.
|
|
3926
|
+
const fileTreeSlice = context.fileTree;
|
|
3968
3927
|
const fileTree = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
3969
3928
|
const fileTreeSha = fileTree == null ? void 0 : fileTree.sha;
|
|
3970
|
-
const
|
|
3971
|
-
const
|
|
3929
|
+
const globalSkillsSlice = context.globalSkills;
|
|
3930
|
+
const globalSkills = ((_a = globalSkillsSlice == null ? void 0 : globalSkillsSlice.data) == null ? void 0 : _a.skills) ?? EMPTY_SKILLS_ARRAY;
|
|
3931
|
+
const globalSkillsCount = globalSkills.length;
|
|
3932
|
+
const repoPath = (_b = context.currentScope.repository) == null ? void 0 : _b.path;
|
|
3933
|
+
const fileSystem = (_c = context.adapters) == null ? void 0 : _c.fileSystem;
|
|
3972
3934
|
const lastLoadedSha = useRef(void 0);
|
|
3935
|
+
const lastGlobalSkillsCount = useRef(0);
|
|
3973
3936
|
const loadSkills = useCallback(async () => {
|
|
3974
|
-
if (fileTreeSha === lastLoadedSha.current) {
|
|
3937
|
+
if (fileTreeSha === lastLoadedSha.current && globalSkillsCount === lastGlobalSkillsCount.current) {
|
|
3975
3938
|
return;
|
|
3976
3939
|
}
|
|
3977
3940
|
setIsLoading(true);
|
|
3978
3941
|
setError(null);
|
|
3979
3942
|
try {
|
|
3980
|
-
let
|
|
3943
|
+
let localSkills = [];
|
|
3944
|
+
let isBrowserMode = false;
|
|
3981
3945
|
if (fileTree && (fileSystem == null ? void 0 : fileSystem.readFile) && repoPath) {
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
}
|
|
3990
|
-
const skillPaths = findSkillFiles(fileTree, true);
|
|
3946
|
+
isBrowserMode = !repoPath.startsWith("/");
|
|
3947
|
+
console.log("[useSkillsData] fileTree:", fileTree);
|
|
3948
|
+
console.log("[useSkillsData] typeof fileTree:", typeof fileTree);
|
|
3949
|
+
console.log("[useSkillsData] fileTree keys:", Object.keys(fileTree));
|
|
3950
|
+
console.log("[useSkillsData] Browser mode:", isBrowserMode);
|
|
3951
|
+
const skillPaths = findSkillFiles(fileTree, isBrowserMode);
|
|
3952
|
+
console.log("[useSkillsData] Found skill paths:", skillPaths);
|
|
3991
3953
|
const skillPromises = skillPaths.map(async (skillPath) => {
|
|
3992
3954
|
try {
|
|
3993
|
-
const
|
|
3994
|
-
|
|
3955
|
+
const fullPath = isBrowserMode ? skillPath : `${repoPath}/${skillPath}`;
|
|
3956
|
+
const content2 = await fileSystem.readFile(fullPath);
|
|
3957
|
+
return parseSkillContent(content2, skillPath, fileTree, fileSystem, isBrowserMode);
|
|
3995
3958
|
} catch (err) {
|
|
3996
|
-
console.error(`
|
|
3959
|
+
console.error(`Failed to read skill at ${skillPath}:`, err);
|
|
3997
3960
|
return null;
|
|
3998
3961
|
}
|
|
3999
3962
|
});
|
|
4000
|
-
|
|
3963
|
+
localSkills = (await Promise.all(skillPromises)).filter(
|
|
4001
3964
|
(skill) => skill !== null
|
|
4002
3965
|
);
|
|
4003
3966
|
}
|
|
4004
|
-
|
|
3967
|
+
console.log("[useSkillsData] Global skills:", globalSkills);
|
|
3968
|
+
const allSkills = [...localSkills, ...globalSkills];
|
|
3969
|
+
console.log("[useSkillsData] Total skills before deduplication:", allSkills.length);
|
|
3970
|
+
const deduplicatedSkills = deduplicateSkills(allSkills, isBrowserMode);
|
|
3971
|
+
console.log("[useSkillsData] Total skills after deduplication:", deduplicatedSkills.length);
|
|
3972
|
+
setSkills(deduplicatedSkills);
|
|
4005
3973
|
lastLoadedSha.current = fileTreeSha;
|
|
3974
|
+
lastGlobalSkillsCount.current = globalSkillsCount;
|
|
4006
3975
|
} catch (err) {
|
|
4007
3976
|
const errorMessage = err instanceof Error ? err.message : "Failed to load skills";
|
|
4008
3977
|
setError(errorMessage);
|
|
4009
|
-
console.error("
|
|
3978
|
+
console.error("Error loading skills:", err);
|
|
4010
3979
|
} finally {
|
|
4011
3980
|
setIsLoading(false);
|
|
4012
3981
|
}
|
|
4013
|
-
}, [fileTree, fileTreeSha, repoPath, fileSystem]);
|
|
3982
|
+
}, [fileTree, fileTreeSha, globalSkills, globalSkillsCount, repoPath, fileSystem]);
|
|
4014
3983
|
const refreshSkills = useCallback(async () => {
|
|
4015
3984
|
lastLoadedSha.current = void 0;
|
|
3985
|
+
lastGlobalSkillsCount.current = -1;
|
|
4016
3986
|
await loadSkills();
|
|
4017
3987
|
}, [loadSkills]);
|
|
4018
3988
|
useEffect(() => {
|
|
@@ -4025,404 +3995,6 @@ const useSkillsBrowseData = ({
|
|
|
4025
3995
|
refreshSkills
|
|
4026
3996
|
};
|
|
4027
3997
|
};
|
|
4028
|
-
const SkillsBrowsePanel = ({
|
|
4029
|
-
context,
|
|
4030
|
-
events,
|
|
4031
|
-
supportsRefresh = false
|
|
4032
|
-
}) => {
|
|
4033
|
-
var _a, _b;
|
|
4034
|
-
const { theme: theme2 } = useTheme();
|
|
4035
|
-
const panelRef = useRef(null);
|
|
4036
|
-
const [selectedSkillId, setSelectedSkillId] = useState(null);
|
|
4037
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
4038
|
-
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
4039
|
-
const { skills, isLoading, error, refreshSkills } = useSkillsBrowseData({ context });
|
|
4040
|
-
const fileTreeSlice = context.getSlice("fileTree");
|
|
4041
|
-
const fileTree = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
4042
|
-
const sourceInfo = (_a = fileTree == null ? void 0 : fileTree.metadata) == null ? void 0 : _a.sourceInfo;
|
|
4043
|
-
const owner = sourceInfo == null ? void 0 : sourceInfo.owner;
|
|
4044
|
-
const repo = sourceInfo == null ? void 0 : sourceInfo.repo;
|
|
4045
|
-
const globalSkillsSlice = context.getSlice("globalSkills");
|
|
4046
|
-
const installedSkillNames = useMemo(() => {
|
|
4047
|
-
var _a2;
|
|
4048
|
-
const globalSkills = ((_a2 = globalSkillsSlice == null ? void 0 : globalSkillsSlice.data) == null ? void 0 : _a2.skills) || [];
|
|
4049
|
-
return new Set(globalSkills.map((skill) => skill.name));
|
|
4050
|
-
}, [(_b = globalSkillsSlice == null ? void 0 : globalSkillsSlice.data) == null ? void 0 : _b.skills]);
|
|
4051
|
-
gt("skills-browse", events, () => {
|
|
4052
|
-
var _a2;
|
|
4053
|
-
return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
|
|
4054
|
-
});
|
|
4055
|
-
useEffect(() => {
|
|
4056
|
-
const unsubscribeInstalled = events.on("skill:installed", () => {
|
|
4057
|
-
refreshSkills();
|
|
4058
|
-
});
|
|
4059
|
-
const unsubscribeUninstalled = events.on("skill:uninstalled", () => {
|
|
4060
|
-
refreshSkills();
|
|
4061
|
-
});
|
|
4062
|
-
return () => {
|
|
4063
|
-
unsubscribeInstalled();
|
|
4064
|
-
unsubscribeUninstalled();
|
|
4065
|
-
};
|
|
4066
|
-
}, [events, refreshSkills]);
|
|
4067
|
-
const filteredSkills = useMemo(() => {
|
|
4068
|
-
let filtered = skills;
|
|
4069
|
-
if (searchQuery.trim()) {
|
|
4070
|
-
const query = searchQuery.toLowerCase().trim();
|
|
4071
|
-
filtered = filtered.filter((skill) => {
|
|
4072
|
-
var _a2, _b2;
|
|
4073
|
-
if (skill.name.toLowerCase().includes(query)) return true;
|
|
4074
|
-
if ((_a2 = skill.description) == null ? void 0 : _a2.toLowerCase().includes(query)) return true;
|
|
4075
|
-
if ((_b2 = skill.capabilities) == null ? void 0 : _b2.some((cap2) => cap2.toLowerCase().includes(query)))
|
|
4076
|
-
return true;
|
|
4077
|
-
if (skill.path.toLowerCase().includes(query)) return true;
|
|
4078
|
-
return false;
|
|
4079
|
-
});
|
|
4080
|
-
}
|
|
4081
|
-
return filtered;
|
|
4082
|
-
}, [skills, searchQuery]);
|
|
4083
|
-
const handleSkillClick = (skill) => {
|
|
4084
|
-
setSelectedSkillId(skill.id);
|
|
4085
|
-
if (events) {
|
|
4086
|
-
events.emit({
|
|
4087
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4088
|
-
type: "skill:selected",
|
|
4089
|
-
source: "skills-browse-panel",
|
|
4090
|
-
timestamp: Date.now(),
|
|
4091
|
-
payload: { skillId: skill.id, skill }
|
|
4092
|
-
});
|
|
4093
|
-
}
|
|
4094
|
-
};
|
|
4095
|
-
const handleRefresh = () => {
|
|
4096
|
-
setIsRefreshing(true);
|
|
4097
|
-
if (events) {
|
|
4098
|
-
events.emit({
|
|
4099
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4100
|
-
type: "skills:refresh",
|
|
4101
|
-
source: "skills-browse-panel",
|
|
4102
|
-
timestamp: Date.now(),
|
|
4103
|
-
payload: {}
|
|
4104
|
-
});
|
|
4105
|
-
}
|
|
4106
|
-
setTimeout(() => {
|
|
4107
|
-
setIsRefreshing(false);
|
|
4108
|
-
}, 800);
|
|
4109
|
-
};
|
|
4110
|
-
return /* @__PURE__ */ jsxs(
|
|
4111
|
-
"div",
|
|
4112
|
-
{
|
|
4113
|
-
ref: panelRef,
|
|
4114
|
-
tabIndex: -1,
|
|
4115
|
-
style: {
|
|
4116
|
-
padding: "clamp(12px, 3vw, 20px)",
|
|
4117
|
-
fontFamily: theme2.fonts.body,
|
|
4118
|
-
height: "100%",
|
|
4119
|
-
boxSizing: "border-box",
|
|
4120
|
-
display: "flex",
|
|
4121
|
-
flexDirection: "column",
|
|
4122
|
-
gap: "16px",
|
|
4123
|
-
overflow: "hidden",
|
|
4124
|
-
backgroundColor: theme2.colors.background,
|
|
4125
|
-
color: theme2.colors.text,
|
|
4126
|
-
outline: "none"
|
|
4127
|
-
},
|
|
4128
|
-
children: [
|
|
4129
|
-
/* @__PURE__ */ jsxs(
|
|
4130
|
-
"div",
|
|
4131
|
-
{
|
|
4132
|
-
style: {
|
|
4133
|
-
flexShrink: 0,
|
|
4134
|
-
display: "flex",
|
|
4135
|
-
alignItems: "center",
|
|
4136
|
-
justifyContent: "space-between",
|
|
4137
|
-
gap: "12px",
|
|
4138
|
-
flexWrap: "wrap"
|
|
4139
|
-
},
|
|
4140
|
-
children: [
|
|
4141
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
4142
|
-
owner && repo ? /* @__PURE__ */ jsxs(
|
|
4143
|
-
"a",
|
|
4144
|
-
{
|
|
4145
|
-
href: `https://github.com/${owner}/${repo}`,
|
|
4146
|
-
target: "_blank",
|
|
4147
|
-
rel: "noopener noreferrer",
|
|
4148
|
-
style: {
|
|
4149
|
-
textDecoration: "none",
|
|
4150
|
-
display: "flex",
|
|
4151
|
-
flexDirection: "column",
|
|
4152
|
-
gap: "2px"
|
|
4153
|
-
},
|
|
4154
|
-
children: [
|
|
4155
|
-
/* @__PURE__ */ jsx(
|
|
4156
|
-
"h2",
|
|
4157
|
-
{
|
|
4158
|
-
style: {
|
|
4159
|
-
margin: 0,
|
|
4160
|
-
fontSize: theme2.fontSizes[4],
|
|
4161
|
-
color: theme2.colors.text,
|
|
4162
|
-
fontFamily: theme2.fonts.monospace,
|
|
4163
|
-
lineHeight: 1.2
|
|
4164
|
-
},
|
|
4165
|
-
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
4166
|
-
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
4167
|
-
children: repo
|
|
4168
|
-
}
|
|
4169
|
-
),
|
|
4170
|
-
/* @__PURE__ */ jsx(
|
|
4171
|
-
"div",
|
|
4172
|
-
{
|
|
4173
|
-
style: {
|
|
4174
|
-
fontSize: theme2.fontSizes[1],
|
|
4175
|
-
color: theme2.colors.textSecondary,
|
|
4176
|
-
fontFamily: theme2.fonts.monospace
|
|
4177
|
-
},
|
|
4178
|
-
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
4179
|
-
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
4180
|
-
children: owner
|
|
4181
|
-
}
|
|
4182
|
-
)
|
|
4183
|
-
]
|
|
4184
|
-
}
|
|
4185
|
-
) : /* @__PURE__ */ jsx(
|
|
4186
|
-
"h2",
|
|
4187
|
-
{
|
|
4188
|
-
style: {
|
|
4189
|
-
margin: 0,
|
|
4190
|
-
fontSize: theme2.fontSizes[4],
|
|
4191
|
-
color: theme2.colors.text
|
|
4192
|
-
},
|
|
4193
|
-
children: /* @__PURE__ */ jsx(
|
|
4194
|
-
"a",
|
|
4195
|
-
{
|
|
4196
|
-
href: "https://agentskills.io/",
|
|
4197
|
-
target: "_blank",
|
|
4198
|
-
rel: "noopener noreferrer",
|
|
4199
|
-
style: {
|
|
4200
|
-
color: "inherit",
|
|
4201
|
-
textDecoration: "none"
|
|
4202
|
-
},
|
|
4203
|
-
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
4204
|
-
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
4205
|
-
children: "Browse Skills"
|
|
4206
|
-
}
|
|
4207
|
-
)
|
|
4208
|
-
}
|
|
4209
|
-
),
|
|
4210
|
-
!isLoading && /* @__PURE__ */ jsxs(
|
|
4211
|
-
"span",
|
|
4212
|
-
{
|
|
4213
|
-
style: {
|
|
4214
|
-
fontSize: theme2.fontSizes[1],
|
|
4215
|
-
color: theme2.colors.textSecondary,
|
|
4216
|
-
background: theme2.colors.backgroundSecondary,
|
|
4217
|
-
padding: "4px 10px",
|
|
4218
|
-
borderRadius: theme2.radii[1]
|
|
4219
|
-
},
|
|
4220
|
-
children: [
|
|
4221
|
-
filteredSkills.length,
|
|
4222
|
-
" ",
|
|
4223
|
-
filteredSkills.length === 1 ? "skill" : "skills"
|
|
4224
|
-
]
|
|
4225
|
-
}
|
|
4226
|
-
)
|
|
4227
|
-
] }),
|
|
4228
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px", flex: "1 1 200px", maxWidth: "400px" }, children: [
|
|
4229
|
-
/* @__PURE__ */ jsxs(
|
|
4230
|
-
"div",
|
|
4231
|
-
{
|
|
4232
|
-
style: {
|
|
4233
|
-
position: "relative",
|
|
4234
|
-
flex: 1,
|
|
4235
|
-
minWidth: "150px"
|
|
4236
|
-
},
|
|
4237
|
-
children: [
|
|
4238
|
-
/* @__PURE__ */ jsx(
|
|
4239
|
-
Search,
|
|
4240
|
-
{
|
|
4241
|
-
size: 16,
|
|
4242
|
-
color: theme2.colors.textSecondary,
|
|
4243
|
-
style: {
|
|
4244
|
-
position: "absolute",
|
|
4245
|
-
left: "10px",
|
|
4246
|
-
top: "50%",
|
|
4247
|
-
transform: "translateY(-50%)",
|
|
4248
|
-
pointerEvents: "none"
|
|
4249
|
-
}
|
|
4250
|
-
}
|
|
4251
|
-
),
|
|
4252
|
-
/* @__PURE__ */ jsx(
|
|
4253
|
-
"input",
|
|
4254
|
-
{
|
|
4255
|
-
type: "text",
|
|
4256
|
-
placeholder: "Search skills...",
|
|
4257
|
-
value: searchQuery,
|
|
4258
|
-
onChange: (e) => setSearchQuery(e.target.value),
|
|
4259
|
-
style: {
|
|
4260
|
-
width: "100%",
|
|
4261
|
-
padding: "8px 32px 8px 32px",
|
|
4262
|
-
fontSize: theme2.fontSizes[1],
|
|
4263
|
-
fontFamily: theme2.fonts.body,
|
|
4264
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
4265
|
-
borderRadius: theme2.radii[2],
|
|
4266
|
-
background: theme2.colors.backgroundSecondary,
|
|
4267
|
-
color: theme2.colors.text,
|
|
4268
|
-
outline: "none",
|
|
4269
|
-
boxSizing: "border-box"
|
|
4270
|
-
}
|
|
4271
|
-
}
|
|
4272
|
-
),
|
|
4273
|
-
searchQuery && /* @__PURE__ */ jsx(
|
|
4274
|
-
"button",
|
|
4275
|
-
{
|
|
4276
|
-
onClick: () => setSearchQuery(""),
|
|
4277
|
-
style: {
|
|
4278
|
-
position: "absolute",
|
|
4279
|
-
right: "6px",
|
|
4280
|
-
top: "50%",
|
|
4281
|
-
transform: "translateY(-50%)",
|
|
4282
|
-
background: "transparent",
|
|
4283
|
-
border: "none",
|
|
4284
|
-
padding: "4px",
|
|
4285
|
-
cursor: "pointer",
|
|
4286
|
-
display: "flex",
|
|
4287
|
-
alignItems: "center",
|
|
4288
|
-
justifyContent: "center",
|
|
4289
|
-
color: theme2.colors.textSecondary
|
|
4290
|
-
},
|
|
4291
|
-
"aria-label": "Clear search",
|
|
4292
|
-
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
4293
|
-
}
|
|
4294
|
-
)
|
|
4295
|
-
]
|
|
4296
|
-
}
|
|
4297
|
-
),
|
|
4298
|
-
supportsRefresh && /* @__PURE__ */ jsx(
|
|
4299
|
-
"button",
|
|
4300
|
-
{
|
|
4301
|
-
onClick: handleRefresh,
|
|
4302
|
-
disabled: isRefreshing || isLoading,
|
|
4303
|
-
style: {
|
|
4304
|
-
background: theme2.colors.backgroundSecondary,
|
|
4305
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
4306
|
-
borderRadius: theme2.radii[1],
|
|
4307
|
-
padding: "8px",
|
|
4308
|
-
cursor: isRefreshing || isLoading ? "default" : "pointer",
|
|
4309
|
-
display: "flex",
|
|
4310
|
-
alignItems: "center",
|
|
4311
|
-
justifyContent: "center",
|
|
4312
|
-
transition: "all 0.2s ease"
|
|
4313
|
-
},
|
|
4314
|
-
title: "Refresh skills",
|
|
4315
|
-
children: /* @__PURE__ */ jsx(
|
|
4316
|
-
RefreshCw,
|
|
4317
|
-
{
|
|
4318
|
-
size: 16,
|
|
4319
|
-
color: theme2.colors.textSecondary,
|
|
4320
|
-
style: {
|
|
4321
|
-
animation: isRefreshing ? "spin 1s linear infinite" : "none"
|
|
4322
|
-
}
|
|
4323
|
-
}
|
|
4324
|
-
)
|
|
4325
|
-
}
|
|
4326
|
-
)
|
|
4327
|
-
] })
|
|
4328
|
-
]
|
|
4329
|
-
}
|
|
4330
|
-
),
|
|
4331
|
-
error && /* @__PURE__ */ jsxs(
|
|
4332
|
-
"div",
|
|
4333
|
-
{
|
|
4334
|
-
style: {
|
|
4335
|
-
flexShrink: 0,
|
|
4336
|
-
padding: "12px",
|
|
4337
|
-
background: `${theme2.colors.error}20`,
|
|
4338
|
-
border: `1px solid ${theme2.colors.error}`,
|
|
4339
|
-
borderRadius: theme2.radii[2],
|
|
4340
|
-
display: "flex",
|
|
4341
|
-
alignItems: "center",
|
|
4342
|
-
gap: "8px",
|
|
4343
|
-
color: theme2.colors.error,
|
|
4344
|
-
fontSize: theme2.fontSizes[1]
|
|
4345
|
-
},
|
|
4346
|
-
children: [
|
|
4347
|
-
/* @__PURE__ */ jsx(CircleAlert, { size: 16 }),
|
|
4348
|
-
/* @__PURE__ */ jsx("span", { children: error })
|
|
4349
|
-
]
|
|
4350
|
-
}
|
|
4351
|
-
),
|
|
4352
|
-
/* @__PURE__ */ jsx(
|
|
4353
|
-
"div",
|
|
4354
|
-
{
|
|
4355
|
-
style: {
|
|
4356
|
-
flex: 1,
|
|
4357
|
-
overflowY: "auto",
|
|
4358
|
-
minHeight: 0
|
|
4359
|
-
},
|
|
4360
|
-
children: isLoading ? /* @__PURE__ */ jsx(
|
|
4361
|
-
"div",
|
|
4362
|
-
{
|
|
4363
|
-
style: {
|
|
4364
|
-
height: "100%",
|
|
4365
|
-
display: "flex",
|
|
4366
|
-
alignItems: "center",
|
|
4367
|
-
justifyContent: "center",
|
|
4368
|
-
color: theme2.colors.textSecondary,
|
|
4369
|
-
fontSize: theme2.fontSizes[2]
|
|
4370
|
-
},
|
|
4371
|
-
children: "Loading skills from repository..."
|
|
4372
|
-
}
|
|
4373
|
-
) : filteredSkills.length === 0 ? /* @__PURE__ */ jsxs(
|
|
4374
|
-
"div",
|
|
4375
|
-
{
|
|
4376
|
-
style: {
|
|
4377
|
-
height: "100%",
|
|
4378
|
-
display: "flex",
|
|
4379
|
-
flexDirection: "column",
|
|
4380
|
-
alignItems: "center",
|
|
4381
|
-
justifyContent: "center",
|
|
4382
|
-
gap: "16px",
|
|
4383
|
-
color: theme2.colors.textSecondary,
|
|
4384
|
-
padding: "24px"
|
|
4385
|
-
},
|
|
4386
|
-
children: [
|
|
4387
|
-
/* @__PURE__ */ jsx(FileCode, { size: 48, color: theme2.colors.border }),
|
|
4388
|
-
/* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
4389
|
-
/* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: theme2.fontSizes[2] }, children: searchQuery ? "No skills match your search" : "No skills found in this repository" }),
|
|
4390
|
-
/* @__PURE__ */ jsx("p", { style: { margin: "8px 0 0 0", fontSize: theme2.fontSizes[1] }, children: searchQuery ? "Try a different search term" : "This repository does not contain any SKILL.md files" })
|
|
4391
|
-
] })
|
|
4392
|
-
]
|
|
4393
|
-
}
|
|
4394
|
-
) : /* @__PURE__ */ jsx(
|
|
4395
|
-
"div",
|
|
4396
|
-
{
|
|
4397
|
-
style: {
|
|
4398
|
-
display: "grid",
|
|
4399
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))",
|
|
4400
|
-
gap: "16px",
|
|
4401
|
-
padding: "4px"
|
|
4402
|
-
},
|
|
4403
|
-
children: filteredSkills.map((skill) => /* @__PURE__ */ jsx(
|
|
4404
|
-
SkillCard,
|
|
4405
|
-
{
|
|
4406
|
-
skill,
|
|
4407
|
-
onClick: handleSkillClick,
|
|
4408
|
-
isSelected: selectedSkillId === skill.id,
|
|
4409
|
-
isInstalled: installedSkillNames.has(skill.name)
|
|
4410
|
-
},
|
|
4411
|
-
skill.id
|
|
4412
|
-
))
|
|
4413
|
-
}
|
|
4414
|
-
)
|
|
4415
|
-
}
|
|
4416
|
-
),
|
|
4417
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
4418
|
-
@keyframes spin {
|
|
4419
|
-
to { transform: rotate(360deg); }
|
|
4420
|
-
}
|
|
4421
|
-
` })
|
|
4422
|
-
]
|
|
4423
|
-
}
|
|
4424
|
-
);
|
|
4425
|
-
};
|
|
4426
3998
|
const GlobalSkillsPanel = ({
|
|
4427
3999
|
context,
|
|
4428
4000
|
events,
|
|
@@ -50633,10 +50205,10 @@ const useAgentsData = ({
|
|
|
50633
50205
|
const [agents, setAgents] = useState(EMPTY_AGENTS_ARRAY);
|
|
50634
50206
|
const [isLoading, setIsLoading] = useState(true);
|
|
50635
50207
|
const [error, setError] = useState(null);
|
|
50636
|
-
const fileTreeSlice = context.
|
|
50208
|
+
const fileTreeSlice = context.fileTree;
|
|
50637
50209
|
const fileTree = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
50638
50210
|
const fileTreeSha = fileTree == null ? void 0 : fileTree.sha;
|
|
50639
|
-
const globalAgentsSlice = context.
|
|
50211
|
+
const globalAgentsSlice = context.globalAgents;
|
|
50640
50212
|
const globalAgents = useMemo(
|
|
50641
50213
|
() => {
|
|
50642
50214
|
var _a2;
|
|
@@ -50778,10 +50350,10 @@ const useSubagentsData = ({
|
|
|
50778
50350
|
const [subagents, setSubagents] = useState(EMPTY_SUBAGENTS_ARRAY);
|
|
50779
50351
|
const [isLoading, setIsLoading] = useState(true);
|
|
50780
50352
|
const [error, setError] = useState(null);
|
|
50781
|
-
const fileTreeSlice = context.
|
|
50353
|
+
const fileTreeSlice = context.fileTree;
|
|
50782
50354
|
const fileTree = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
50783
50355
|
const fileTreeSha = fileTree == null ? void 0 : fileTree.sha;
|
|
50784
|
-
const globalSubagentsSlice = context.
|
|
50356
|
+
const globalSubagentsSlice = context.globalSubagents;
|
|
50785
50357
|
const globalSubagents = useMemo(
|
|
50786
50358
|
() => {
|
|
50787
50359
|
var _a2;
|
|
@@ -50845,887 +50417,6 @@ const useSubagentsData = ({
|
|
|
50845
50417
|
refreshSubagents
|
|
50846
50418
|
};
|
|
50847
50419
|
};
|
|
50848
|
-
const getSourceBadge$1 = (source2) => {
|
|
50849
|
-
switch (source2) {
|
|
50850
|
-
case "project-root":
|
|
50851
|
-
return {
|
|
50852
|
-
label: "Root",
|
|
50853
|
-
icon: /* @__PURE__ */ jsx(FileText, { size: 12 }),
|
|
50854
|
-
color: "#10b981",
|
|
50855
|
-
bgColor: "#10b98120"
|
|
50856
|
-
};
|
|
50857
|
-
case "project-nested":
|
|
50858
|
-
return {
|
|
50859
|
-
label: "Nested",
|
|
50860
|
-
icon: /* @__PURE__ */ jsx(FolderTree, { size: 12 }),
|
|
50861
|
-
color: "#3b82f6",
|
|
50862
|
-
bgColor: "#3b82f620"
|
|
50863
|
-
};
|
|
50864
|
-
case "global-universal":
|
|
50865
|
-
return {
|
|
50866
|
-
label: "Global",
|
|
50867
|
-
icon: /* @__PURE__ */ jsx(Folder, { size: 12 }),
|
|
50868
|
-
color: "#8b5cf6",
|
|
50869
|
-
bgColor: "#8b5cf620"
|
|
50870
|
-
};
|
|
50871
|
-
}
|
|
50872
|
-
};
|
|
50873
|
-
const AgentCard = ({ agent, onClick, isSelected }) => {
|
|
50874
|
-
var _a;
|
|
50875
|
-
const { theme: theme2 } = useTheme();
|
|
50876
|
-
const sourceBadge = getSourceBadge$1(agent.source);
|
|
50877
|
-
const [pathCopied, setPathCopied] = React2__default.useState(false);
|
|
50878
|
-
const preview = ((_a = agent.content.split("\n").find((line) => line.trim() && !line.startsWith("#"))) == null ? void 0 : _a.substring(0, 150)) || "No description available";
|
|
50879
|
-
const handleCopyPath = async (e) => {
|
|
50880
|
-
e.stopPropagation();
|
|
50881
|
-
try {
|
|
50882
|
-
await navigator.clipboard.writeText(agent.path);
|
|
50883
|
-
setPathCopied(true);
|
|
50884
|
-
setTimeout(() => setPathCopied(false), 2e3);
|
|
50885
|
-
} catch (err) {
|
|
50886
|
-
console.error("Failed to copy path:", err);
|
|
50887
|
-
}
|
|
50888
|
-
};
|
|
50889
|
-
return /* @__PURE__ */ jsxs(
|
|
50890
|
-
"div",
|
|
50891
|
-
{
|
|
50892
|
-
onClick: () => onClick(agent),
|
|
50893
|
-
style: {
|
|
50894
|
-
padding: "16px",
|
|
50895
|
-
background: isSelected ? `${theme2.colors.primary}10` : theme2.colors.backgroundSecondary,
|
|
50896
|
-
border: `1px solid ${isSelected ? theme2.colors.primary : theme2.colors.border}`,
|
|
50897
|
-
borderRadius: theme2.radii[2],
|
|
50898
|
-
cursor: "pointer",
|
|
50899
|
-
transition: "all 0.2s ease",
|
|
50900
|
-
display: "flex",
|
|
50901
|
-
flexDirection: "column",
|
|
50902
|
-
gap: "12px"
|
|
50903
|
-
},
|
|
50904
|
-
onMouseEnter: (e) => {
|
|
50905
|
-
if (!isSelected) {
|
|
50906
|
-
e.currentTarget.style.borderColor = theme2.colors.textSecondary;
|
|
50907
|
-
}
|
|
50908
|
-
},
|
|
50909
|
-
onMouseLeave: (e) => {
|
|
50910
|
-
if (!isSelected) {
|
|
50911
|
-
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
50912
|
-
}
|
|
50913
|
-
},
|
|
50914
|
-
children: [
|
|
50915
|
-
/* @__PURE__ */ jsxs(
|
|
50916
|
-
"div",
|
|
50917
|
-
{
|
|
50918
|
-
style: {
|
|
50919
|
-
display: "flex",
|
|
50920
|
-
alignItems: "flex-start",
|
|
50921
|
-
justifyContent: "space-between",
|
|
50922
|
-
gap: "8px"
|
|
50923
|
-
},
|
|
50924
|
-
children: [
|
|
50925
|
-
/* @__PURE__ */ jsx(
|
|
50926
|
-
"h3",
|
|
50927
|
-
{
|
|
50928
|
-
style: {
|
|
50929
|
-
margin: 0,
|
|
50930
|
-
fontSize: theme2.fontSizes[2],
|
|
50931
|
-
color: theme2.colors.text,
|
|
50932
|
-
fontWeight: 600,
|
|
50933
|
-
flex: 1
|
|
50934
|
-
},
|
|
50935
|
-
children: agent.name
|
|
50936
|
-
}
|
|
50937
|
-
),
|
|
50938
|
-
/* @__PURE__ */ jsxs(
|
|
50939
|
-
"div",
|
|
50940
|
-
{
|
|
50941
|
-
style: {
|
|
50942
|
-
display: "flex",
|
|
50943
|
-
alignItems: "center",
|
|
50944
|
-
gap: "4px",
|
|
50945
|
-
padding: "4px 8px",
|
|
50946
|
-
fontSize: theme2.fontSizes[0],
|
|
50947
|
-
color: sourceBadge.color,
|
|
50948
|
-
background: sourceBadge.bgColor,
|
|
50949
|
-
border: `1px solid ${sourceBadge.color}40`,
|
|
50950
|
-
borderRadius: theme2.radii[1],
|
|
50951
|
-
flexShrink: 0
|
|
50952
|
-
},
|
|
50953
|
-
children: [
|
|
50954
|
-
sourceBadge.icon,
|
|
50955
|
-
/* @__PURE__ */ jsx("span", { children: sourceBadge.label })
|
|
50956
|
-
]
|
|
50957
|
-
}
|
|
50958
|
-
)
|
|
50959
|
-
]
|
|
50960
|
-
}
|
|
50961
|
-
),
|
|
50962
|
-
/* @__PURE__ */ jsx(
|
|
50963
|
-
"div",
|
|
50964
|
-
{
|
|
50965
|
-
onClick: handleCopyPath,
|
|
50966
|
-
style: {
|
|
50967
|
-
fontSize: theme2.fontSizes[0],
|
|
50968
|
-
color: pathCopied ? theme2.colors.success : theme2.colors.textMuted,
|
|
50969
|
-
fontFamily: theme2.fonts.monospace,
|
|
50970
|
-
background: pathCopied ? `${theme2.colors.success}15` : theme2.colors.background,
|
|
50971
|
-
padding: "4px 8px",
|
|
50972
|
-
borderRadius: theme2.radii[1],
|
|
50973
|
-
overflow: "hidden",
|
|
50974
|
-
textOverflow: "ellipsis",
|
|
50975
|
-
whiteSpace: "nowrap",
|
|
50976
|
-
cursor: "pointer",
|
|
50977
|
-
transition: "all 0.2s ease",
|
|
50978
|
-
border: `1px solid ${pathCopied ? theme2.colors.success : "transparent"}`
|
|
50979
|
-
},
|
|
50980
|
-
title: pathCopied ? "Copied!" : `Click to copy: ${agent.path}`,
|
|
50981
|
-
onMouseEnter: (e) => {
|
|
50982
|
-
if (!pathCopied) {
|
|
50983
|
-
e.currentTarget.style.background = theme2.colors.backgroundTertiary || theme2.colors.border;
|
|
50984
|
-
}
|
|
50985
|
-
},
|
|
50986
|
-
onMouseLeave: (e) => {
|
|
50987
|
-
if (!pathCopied) {
|
|
50988
|
-
e.currentTarget.style.background = theme2.colors.background;
|
|
50989
|
-
}
|
|
50990
|
-
},
|
|
50991
|
-
children: pathCopied ? "Copied!" : agent.path
|
|
50992
|
-
}
|
|
50993
|
-
),
|
|
50994
|
-
/* @__PURE__ */ jsx(
|
|
50995
|
-
"div",
|
|
50996
|
-
{
|
|
50997
|
-
style: {
|
|
50998
|
-
fontSize: theme2.fontSizes[1],
|
|
50999
|
-
color: theme2.colors.textSecondary,
|
|
51000
|
-
lineHeight: 1.5,
|
|
51001
|
-
overflow: "hidden",
|
|
51002
|
-
textOverflow: "ellipsis",
|
|
51003
|
-
display: "-webkit-box",
|
|
51004
|
-
WebkitLineClamp: 3,
|
|
51005
|
-
WebkitBoxOrient: "vertical"
|
|
51006
|
-
},
|
|
51007
|
-
children: preview
|
|
51008
|
-
}
|
|
51009
|
-
),
|
|
51010
|
-
agent.sections && Object.keys(agent.sections).length > 0 && /* @__PURE__ */ jsx(
|
|
51011
|
-
"div",
|
|
51012
|
-
{
|
|
51013
|
-
style: {
|
|
51014
|
-
display: "flex",
|
|
51015
|
-
flexWrap: "wrap",
|
|
51016
|
-
gap: "6px",
|
|
51017
|
-
marginTop: "4px"
|
|
51018
|
-
},
|
|
51019
|
-
children: Object.keys(agent.sections).map((section) => /* @__PURE__ */ jsx(
|
|
51020
|
-
"span",
|
|
51021
|
-
{
|
|
51022
|
-
style: {
|
|
51023
|
-
fontSize: theme2.fontSizes[0],
|
|
51024
|
-
padding: "2px 8px",
|
|
51025
|
-
background: theme2.colors.background,
|
|
51026
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
51027
|
-
borderRadius: theme2.radii[1],
|
|
51028
|
-
color: theme2.colors.textSecondary,
|
|
51029
|
-
textTransform: "capitalize"
|
|
51030
|
-
},
|
|
51031
|
-
children: section
|
|
51032
|
-
},
|
|
51033
|
-
section
|
|
51034
|
-
))
|
|
51035
|
-
}
|
|
51036
|
-
)
|
|
51037
|
-
]
|
|
51038
|
-
}
|
|
51039
|
-
);
|
|
51040
|
-
};
|
|
51041
|
-
const getSourceBadge = (source2) => {
|
|
51042
|
-
switch (source2) {
|
|
51043
|
-
case "project-claude":
|
|
51044
|
-
return {
|
|
51045
|
-
label: "Project",
|
|
51046
|
-
icon: /* @__PURE__ */ jsx(Folder, { size: 12 }),
|
|
51047
|
-
color: "#06b6d4",
|
|
51048
|
-
bgColor: "#06b6d420"
|
|
51049
|
-
};
|
|
51050
|
-
case "global-claude":
|
|
51051
|
-
return {
|
|
51052
|
-
label: "Global",
|
|
51053
|
-
icon: /* @__PURE__ */ jsx(Globe, { size: 12 }),
|
|
51054
|
-
color: "#8b5cf6",
|
|
51055
|
-
bgColor: "#8b5cf620"
|
|
51056
|
-
};
|
|
51057
|
-
}
|
|
51058
|
-
};
|
|
51059
|
-
const getModelColor = (model) => {
|
|
51060
|
-
switch (model) {
|
|
51061
|
-
case "opus":
|
|
51062
|
-
return "#f59e0b";
|
|
51063
|
-
case "sonnet":
|
|
51064
|
-
return "#10b981";
|
|
51065
|
-
case "haiku":
|
|
51066
|
-
return "#3b82f6";
|
|
51067
|
-
case "inherit":
|
|
51068
|
-
return "#6b7280";
|
|
51069
|
-
default:
|
|
51070
|
-
return "#10b981";
|
|
51071
|
-
}
|
|
51072
|
-
};
|
|
51073
|
-
const SubagentCard = ({ subagent, onClick, isSelected }) => {
|
|
51074
|
-
const { theme: theme2 } = useTheme();
|
|
51075
|
-
const sourceBadge = getSourceBadge(subagent.source);
|
|
51076
|
-
const modelColor = getModelColor(subagent.frontmatter.model);
|
|
51077
|
-
const hasTools = subagent.frontmatter.tools;
|
|
51078
|
-
const toolsArray = hasTools ? hasTools.split(",").map((t) => t.trim()) : null;
|
|
51079
|
-
return /* @__PURE__ */ jsxs(
|
|
51080
|
-
"div",
|
|
51081
|
-
{
|
|
51082
|
-
onClick: () => onClick(subagent),
|
|
51083
|
-
style: {
|
|
51084
|
-
padding: "16px",
|
|
51085
|
-
background: isSelected ? `${theme2.colors.primary}10` : theme2.colors.backgroundSecondary,
|
|
51086
|
-
border: `1px solid ${isSelected ? theme2.colors.primary : theme2.colors.border}`,
|
|
51087
|
-
borderRadius: theme2.radii[2],
|
|
51088
|
-
cursor: "pointer",
|
|
51089
|
-
transition: "all 0.2s ease",
|
|
51090
|
-
display: "flex",
|
|
51091
|
-
flexDirection: "column",
|
|
51092
|
-
gap: "12px"
|
|
51093
|
-
},
|
|
51094
|
-
onMouseEnter: (e) => {
|
|
51095
|
-
if (!isSelected) {
|
|
51096
|
-
e.currentTarget.style.borderColor = theme2.colors.textSecondary;
|
|
51097
|
-
}
|
|
51098
|
-
},
|
|
51099
|
-
onMouseLeave: (e) => {
|
|
51100
|
-
if (!isSelected) {
|
|
51101
|
-
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
51102
|
-
}
|
|
51103
|
-
},
|
|
51104
|
-
children: [
|
|
51105
|
-
/* @__PURE__ */ jsxs(
|
|
51106
|
-
"div",
|
|
51107
|
-
{
|
|
51108
|
-
style: {
|
|
51109
|
-
display: "flex",
|
|
51110
|
-
alignItems: "flex-start",
|
|
51111
|
-
justifyContent: "space-between",
|
|
51112
|
-
gap: "8px"
|
|
51113
|
-
},
|
|
51114
|
-
children: [
|
|
51115
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flex: 1 }, children: [
|
|
51116
|
-
/* @__PURE__ */ jsx(Bot, { size: 18, color: theme2.colors.primary }),
|
|
51117
|
-
/* @__PURE__ */ jsx(
|
|
51118
|
-
"h3",
|
|
51119
|
-
{
|
|
51120
|
-
style: {
|
|
51121
|
-
margin: 0,
|
|
51122
|
-
fontSize: theme2.fontSizes[2],
|
|
51123
|
-
color: theme2.colors.text,
|
|
51124
|
-
fontWeight: 600
|
|
51125
|
-
},
|
|
51126
|
-
children: subagent.name
|
|
51127
|
-
}
|
|
51128
|
-
)
|
|
51129
|
-
] }),
|
|
51130
|
-
/* @__PURE__ */ jsxs(
|
|
51131
|
-
"div",
|
|
51132
|
-
{
|
|
51133
|
-
style: {
|
|
51134
|
-
display: "flex",
|
|
51135
|
-
alignItems: "center",
|
|
51136
|
-
gap: "4px",
|
|
51137
|
-
padding: "4px 8px",
|
|
51138
|
-
fontSize: theme2.fontSizes[0],
|
|
51139
|
-
color: sourceBadge.color,
|
|
51140
|
-
background: sourceBadge.bgColor,
|
|
51141
|
-
border: `1px solid ${sourceBadge.color}40`,
|
|
51142
|
-
borderRadius: theme2.radii[1],
|
|
51143
|
-
flexShrink: 0
|
|
51144
|
-
},
|
|
51145
|
-
children: [
|
|
51146
|
-
sourceBadge.icon,
|
|
51147
|
-
/* @__PURE__ */ jsx("span", { children: sourceBadge.label })
|
|
51148
|
-
]
|
|
51149
|
-
}
|
|
51150
|
-
)
|
|
51151
|
-
]
|
|
51152
|
-
}
|
|
51153
|
-
),
|
|
51154
|
-
/* @__PURE__ */ jsx(
|
|
51155
|
-
"div",
|
|
51156
|
-
{
|
|
51157
|
-
style: {
|
|
51158
|
-
fontSize: theme2.fontSizes[1],
|
|
51159
|
-
color: theme2.colors.textSecondary,
|
|
51160
|
-
lineHeight: 1.5
|
|
51161
|
-
},
|
|
51162
|
-
children: subagent.frontmatter.description
|
|
51163
|
-
}
|
|
51164
|
-
),
|
|
51165
|
-
/* @__PURE__ */ jsx(
|
|
51166
|
-
"div",
|
|
51167
|
-
{
|
|
51168
|
-
style: {
|
|
51169
|
-
fontSize: theme2.fontSizes[0],
|
|
51170
|
-
color: theme2.colors.textSecondary,
|
|
51171
|
-
fontFamily: theme2.fonts.monospace,
|
|
51172
|
-
wordBreak: "break-all",
|
|
51173
|
-
opacity: 0.7
|
|
51174
|
-
},
|
|
51175
|
-
children: subagent.path
|
|
51176
|
-
}
|
|
51177
|
-
),
|
|
51178
|
-
/* @__PURE__ */ jsxs(
|
|
51179
|
-
"div",
|
|
51180
|
-
{
|
|
51181
|
-
style: {
|
|
51182
|
-
display: "flex",
|
|
51183
|
-
flexWrap: "wrap",
|
|
51184
|
-
gap: "6px",
|
|
51185
|
-
marginTop: "4px"
|
|
51186
|
-
},
|
|
51187
|
-
children: [
|
|
51188
|
-
subagent.frontmatter.model && /* @__PURE__ */ jsxs(
|
|
51189
|
-
"div",
|
|
51190
|
-
{
|
|
51191
|
-
style: {
|
|
51192
|
-
display: "flex",
|
|
51193
|
-
alignItems: "center",
|
|
51194
|
-
gap: "4px",
|
|
51195
|
-
fontSize: theme2.fontSizes[0],
|
|
51196
|
-
padding: "3px 8px",
|
|
51197
|
-
background: `${modelColor}20`,
|
|
51198
|
-
border: `1px solid ${modelColor}40`,
|
|
51199
|
-
borderRadius: theme2.radii[1],
|
|
51200
|
-
color: modelColor
|
|
51201
|
-
},
|
|
51202
|
-
children: [
|
|
51203
|
-
/* @__PURE__ */ jsx(Zap, { size: 11 }),
|
|
51204
|
-
/* @__PURE__ */ jsx("span", { children: subagent.frontmatter.model })
|
|
51205
|
-
]
|
|
51206
|
-
}
|
|
51207
|
-
),
|
|
51208
|
-
toolsArray && /* @__PURE__ */ jsxs(
|
|
51209
|
-
"div",
|
|
51210
|
-
{
|
|
51211
|
-
style: {
|
|
51212
|
-
display: "flex",
|
|
51213
|
-
alignItems: "center",
|
|
51214
|
-
gap: "4px",
|
|
51215
|
-
fontSize: theme2.fontSizes[0],
|
|
51216
|
-
padding: "3px 8px",
|
|
51217
|
-
background: theme2.colors.background,
|
|
51218
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
51219
|
-
borderRadius: theme2.radii[1],
|
|
51220
|
-
color: theme2.colors.textSecondary
|
|
51221
|
-
},
|
|
51222
|
-
children: [
|
|
51223
|
-
/* @__PURE__ */ jsx(Wrench, { size: 11 }),
|
|
51224
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
51225
|
-
toolsArray.length,
|
|
51226
|
-
" ",
|
|
51227
|
-
toolsArray.length === 1 ? "tool" : "tools"
|
|
51228
|
-
] })
|
|
51229
|
-
]
|
|
51230
|
-
}
|
|
51231
|
-
),
|
|
51232
|
-
subagent.frontmatter.permissionMode && subagent.frontmatter.permissionMode !== "default" && /* @__PURE__ */ jsx(
|
|
51233
|
-
"div",
|
|
51234
|
-
{
|
|
51235
|
-
style: {
|
|
51236
|
-
fontSize: theme2.fontSizes[0],
|
|
51237
|
-
padding: "3px 8px",
|
|
51238
|
-
background: theme2.colors.background,
|
|
51239
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
51240
|
-
borderRadius: theme2.radii[1],
|
|
51241
|
-
color: theme2.colors.textSecondary
|
|
51242
|
-
},
|
|
51243
|
-
children: subagent.frontmatter.permissionMode
|
|
51244
|
-
}
|
|
51245
|
-
)
|
|
51246
|
-
]
|
|
51247
|
-
}
|
|
51248
|
-
)
|
|
51249
|
-
]
|
|
51250
|
-
}
|
|
51251
|
-
);
|
|
51252
|
-
};
|
|
51253
|
-
const AgentsListPanel = ({
|
|
51254
|
-
context,
|
|
51255
|
-
events
|
|
51256
|
-
}) => {
|
|
51257
|
-
const { theme: theme2 } = useTheme();
|
|
51258
|
-
const panelRef = useRef(null);
|
|
51259
|
-
const [selectedItemId, setSelectedItemId] = useState(null);
|
|
51260
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
51261
|
-
const [agentFilter, setAgentFilter] = useState("all");
|
|
51262
|
-
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
51263
|
-
const {
|
|
51264
|
-
agents,
|
|
51265
|
-
isLoading: agentsLoading,
|
|
51266
|
-
error: agentsError
|
|
51267
|
-
} = useAgentsData({ context });
|
|
51268
|
-
const {
|
|
51269
|
-
subagents,
|
|
51270
|
-
isLoading: subagentsLoading,
|
|
51271
|
-
error: subagentsError
|
|
51272
|
-
} = useSubagentsData({ context });
|
|
51273
|
-
const isLoading = agentsLoading || subagentsLoading;
|
|
51274
|
-
const error = agentsError || subagentsError;
|
|
51275
|
-
gt("agents-list", events, () => {
|
|
51276
|
-
var _a;
|
|
51277
|
-
return (_a = panelRef.current) == null ? void 0 : _a.focus();
|
|
51278
|
-
});
|
|
51279
|
-
const allItems = useMemo(() => {
|
|
51280
|
-
const items = [];
|
|
51281
|
-
agents.forEach((agent) => {
|
|
51282
|
-
items.push({ type: "agent", data: agent });
|
|
51283
|
-
});
|
|
51284
|
-
subagents.forEach((subagent) => {
|
|
51285
|
-
items.push({ type: "subagent", data: subagent });
|
|
51286
|
-
});
|
|
51287
|
-
return items;
|
|
51288
|
-
}, [agents, subagents]);
|
|
51289
|
-
const filteredItems = useMemo(() => {
|
|
51290
|
-
let filtered = allItems;
|
|
51291
|
-
if (agentFilter === "documentation") {
|
|
51292
|
-
filtered = filtered.filter((item) => item.type === "agent");
|
|
51293
|
-
} else if (agentFilter === "subagents") {
|
|
51294
|
-
filtered = filtered.filter((item) => item.type === "subagent");
|
|
51295
|
-
}
|
|
51296
|
-
if (searchQuery.trim()) {
|
|
51297
|
-
const query = searchQuery.toLowerCase().trim();
|
|
51298
|
-
filtered = filtered.filter((item) => {
|
|
51299
|
-
if (item.type === "agent") {
|
|
51300
|
-
const agent = item.data;
|
|
51301
|
-
if (agent.name.toLowerCase().includes(query)) return true;
|
|
51302
|
-
if (agent.path.toLowerCase().includes(query)) return true;
|
|
51303
|
-
if (agent.content.toLowerCase().includes(query)) return true;
|
|
51304
|
-
return false;
|
|
51305
|
-
} else {
|
|
51306
|
-
const subagent = item.data;
|
|
51307
|
-
if (subagent.name.toLowerCase().includes(query)) return true;
|
|
51308
|
-
if (subagent.path.toLowerCase().includes(query)) return true;
|
|
51309
|
-
if (subagent.frontmatter.description.toLowerCase().includes(query)) return true;
|
|
51310
|
-
if (subagent.prompt.toLowerCase().includes(query)) return true;
|
|
51311
|
-
return false;
|
|
51312
|
-
}
|
|
51313
|
-
});
|
|
51314
|
-
}
|
|
51315
|
-
return filtered;
|
|
51316
|
-
}, [allItems, searchQuery, agentFilter]);
|
|
51317
|
-
const handleItemClick = (item) => {
|
|
51318
|
-
const itemId = item.type === "agent" ? item.data.id : item.data.id;
|
|
51319
|
-
setSelectedItemId(itemId);
|
|
51320
|
-
if (events) {
|
|
51321
|
-
events.emit({
|
|
51322
|
-
type: item.type === "agent" ? "agent:selected" : "subagent:selected",
|
|
51323
|
-
source: "agents-list-panel",
|
|
51324
|
-
timestamp: Date.now(),
|
|
51325
|
-
payload: {
|
|
51326
|
-
id: itemId,
|
|
51327
|
-
type: item.type,
|
|
51328
|
-
data: item.data
|
|
51329
|
-
}
|
|
51330
|
-
});
|
|
51331
|
-
}
|
|
51332
|
-
};
|
|
51333
|
-
const handleRefresh = async () => {
|
|
51334
|
-
setIsRefreshing(true);
|
|
51335
|
-
try {
|
|
51336
|
-
if (events) {
|
|
51337
|
-
events.emit({
|
|
51338
|
-
type: "agents:refresh",
|
|
51339
|
-
source: "agents-list-panel",
|
|
51340
|
-
timestamp: Date.now(),
|
|
51341
|
-
payload: {}
|
|
51342
|
-
});
|
|
51343
|
-
}
|
|
51344
|
-
await new Promise((resolve) => setTimeout(resolve, 600));
|
|
51345
|
-
} finally {
|
|
51346
|
-
setIsRefreshing(false);
|
|
51347
|
-
}
|
|
51348
|
-
};
|
|
51349
|
-
const agentsCount = agents.length;
|
|
51350
|
-
const subagentsCount = subagents.length;
|
|
51351
|
-
return /* @__PURE__ */ jsxs(
|
|
51352
|
-
"div",
|
|
51353
|
-
{
|
|
51354
|
-
ref: panelRef,
|
|
51355
|
-
tabIndex: -1,
|
|
51356
|
-
style: {
|
|
51357
|
-
padding: "clamp(12px, 3vw, 20px)",
|
|
51358
|
-
fontFamily: theme2.fonts.body,
|
|
51359
|
-
height: "100%",
|
|
51360
|
-
boxSizing: "border-box",
|
|
51361
|
-
display: "flex",
|
|
51362
|
-
flexDirection: "column",
|
|
51363
|
-
gap: "16px",
|
|
51364
|
-
overflow: "hidden",
|
|
51365
|
-
backgroundColor: theme2.colors.background,
|
|
51366
|
-
color: theme2.colors.text,
|
|
51367
|
-
outline: "none"
|
|
51368
|
-
},
|
|
51369
|
-
children: [
|
|
51370
|
-
/* @__PURE__ */ jsxs(
|
|
51371
|
-
"div",
|
|
51372
|
-
{
|
|
51373
|
-
style: {
|
|
51374
|
-
flexShrink: 0,
|
|
51375
|
-
display: "flex",
|
|
51376
|
-
alignItems: "center",
|
|
51377
|
-
justifyContent: "space-between",
|
|
51378
|
-
gap: "12px",
|
|
51379
|
-
flexWrap: "wrap"
|
|
51380
|
-
},
|
|
51381
|
-
children: [
|
|
51382
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
51383
|
-
/* @__PURE__ */ jsx(
|
|
51384
|
-
"h2",
|
|
51385
|
-
{
|
|
51386
|
-
style: {
|
|
51387
|
-
margin: 0,
|
|
51388
|
-
fontSize: theme2.fontSizes[4],
|
|
51389
|
-
color: theme2.colors.text
|
|
51390
|
-
},
|
|
51391
|
-
children: /* @__PURE__ */ jsx(
|
|
51392
|
-
"a",
|
|
51393
|
-
{
|
|
51394
|
-
href: "https://agents.md/",
|
|
51395
|
-
target: "_blank",
|
|
51396
|
-
rel: "noopener noreferrer",
|
|
51397
|
-
style: {
|
|
51398
|
-
color: "inherit",
|
|
51399
|
-
textDecoration: "none"
|
|
51400
|
-
},
|
|
51401
|
-
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
51402
|
-
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
51403
|
-
children: "Agents"
|
|
51404
|
-
}
|
|
51405
|
-
)
|
|
51406
|
-
}
|
|
51407
|
-
),
|
|
51408
|
-
!isLoading && /* @__PURE__ */ jsxs(
|
|
51409
|
-
"span",
|
|
51410
|
-
{
|
|
51411
|
-
style: {
|
|
51412
|
-
fontSize: theme2.fontSizes[1],
|
|
51413
|
-
color: theme2.colors.textSecondary,
|
|
51414
|
-
background: theme2.colors.backgroundSecondary,
|
|
51415
|
-
padding: "4px 10px",
|
|
51416
|
-
borderRadius: theme2.radii[1]
|
|
51417
|
-
},
|
|
51418
|
-
children: [
|
|
51419
|
-
filteredItems.length,
|
|
51420
|
-
" ",
|
|
51421
|
-
filteredItems.length === 1 ? "item" : "items"
|
|
51422
|
-
]
|
|
51423
|
-
}
|
|
51424
|
-
)
|
|
51425
|
-
] }),
|
|
51426
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px", flex: "1 1 200px", maxWidth: "400px" }, children: [
|
|
51427
|
-
/* @__PURE__ */ jsxs(
|
|
51428
|
-
"div",
|
|
51429
|
-
{
|
|
51430
|
-
style: {
|
|
51431
|
-
position: "relative",
|
|
51432
|
-
flex: 1,
|
|
51433
|
-
minWidth: "150px"
|
|
51434
|
-
},
|
|
51435
|
-
children: [
|
|
51436
|
-
/* @__PURE__ */ jsx(
|
|
51437
|
-
Search,
|
|
51438
|
-
{
|
|
51439
|
-
size: 16,
|
|
51440
|
-
color: theme2.colors.textSecondary,
|
|
51441
|
-
style: {
|
|
51442
|
-
position: "absolute",
|
|
51443
|
-
left: "10px",
|
|
51444
|
-
top: "50%",
|
|
51445
|
-
transform: "translateY(-50%)",
|
|
51446
|
-
pointerEvents: "none"
|
|
51447
|
-
}
|
|
51448
|
-
}
|
|
51449
|
-
),
|
|
51450
|
-
/* @__PURE__ */ jsx(
|
|
51451
|
-
"input",
|
|
51452
|
-
{
|
|
51453
|
-
type: "text",
|
|
51454
|
-
placeholder: "Search agents...",
|
|
51455
|
-
value: searchQuery,
|
|
51456
|
-
onChange: (e) => setSearchQuery(e.target.value),
|
|
51457
|
-
style: {
|
|
51458
|
-
width: "100%",
|
|
51459
|
-
padding: "8px 32px 8px 32px",
|
|
51460
|
-
fontSize: theme2.fontSizes[1],
|
|
51461
|
-
fontFamily: theme2.fonts.body,
|
|
51462
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
51463
|
-
borderRadius: theme2.radii[2],
|
|
51464
|
-
background: theme2.colors.backgroundSecondary,
|
|
51465
|
-
color: theme2.colors.text,
|
|
51466
|
-
outline: "none",
|
|
51467
|
-
boxSizing: "border-box"
|
|
51468
|
-
}
|
|
51469
|
-
}
|
|
51470
|
-
),
|
|
51471
|
-
searchQuery && /* @__PURE__ */ jsx(
|
|
51472
|
-
"button",
|
|
51473
|
-
{
|
|
51474
|
-
onClick: () => setSearchQuery(""),
|
|
51475
|
-
style: {
|
|
51476
|
-
position: "absolute",
|
|
51477
|
-
right: "6px",
|
|
51478
|
-
top: "50%",
|
|
51479
|
-
transform: "translateY(-50%)",
|
|
51480
|
-
background: "transparent",
|
|
51481
|
-
border: "none",
|
|
51482
|
-
padding: "4px",
|
|
51483
|
-
cursor: "pointer",
|
|
51484
|
-
display: "flex",
|
|
51485
|
-
alignItems: "center",
|
|
51486
|
-
justifyContent: "center",
|
|
51487
|
-
color: theme2.colors.textSecondary
|
|
51488
|
-
},
|
|
51489
|
-
"aria-label": "Clear search",
|
|
51490
|
-
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
51491
|
-
}
|
|
51492
|
-
)
|
|
51493
|
-
]
|
|
51494
|
-
}
|
|
51495
|
-
),
|
|
51496
|
-
/* @__PURE__ */ jsx(
|
|
51497
|
-
"button",
|
|
51498
|
-
{
|
|
51499
|
-
onClick: handleRefresh,
|
|
51500
|
-
disabled: isRefreshing || isLoading,
|
|
51501
|
-
style: {
|
|
51502
|
-
background: theme2.colors.backgroundSecondary,
|
|
51503
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
51504
|
-
borderRadius: theme2.radii[1],
|
|
51505
|
-
padding: "8px",
|
|
51506
|
-
cursor: isRefreshing ? "wait" : "pointer",
|
|
51507
|
-
display: "flex",
|
|
51508
|
-
alignItems: "center",
|
|
51509
|
-
justifyContent: "center",
|
|
51510
|
-
transition: "all 0.2s ease"
|
|
51511
|
-
},
|
|
51512
|
-
title: "Refresh agents",
|
|
51513
|
-
children: /* @__PURE__ */ jsx(
|
|
51514
|
-
RefreshCw,
|
|
51515
|
-
{
|
|
51516
|
-
size: 16,
|
|
51517
|
-
color: theme2.colors.textSecondary,
|
|
51518
|
-
style: {
|
|
51519
|
-
animation: isRefreshing ? "spin 1s linear infinite" : "none"
|
|
51520
|
-
}
|
|
51521
|
-
}
|
|
51522
|
-
)
|
|
51523
|
-
}
|
|
51524
|
-
)
|
|
51525
|
-
] })
|
|
51526
|
-
]
|
|
51527
|
-
}
|
|
51528
|
-
),
|
|
51529
|
-
/* @__PURE__ */ jsxs(
|
|
51530
|
-
"div",
|
|
51531
|
-
{
|
|
51532
|
-
style: {
|
|
51533
|
-
flexShrink: 0,
|
|
51534
|
-
display: "flex",
|
|
51535
|
-
gap: "8px"
|
|
51536
|
-
},
|
|
51537
|
-
children: [
|
|
51538
|
-
/* @__PURE__ */ jsxs(
|
|
51539
|
-
"button",
|
|
51540
|
-
{
|
|
51541
|
-
onClick: () => setAgentFilter("all"),
|
|
51542
|
-
style: {
|
|
51543
|
-
padding: "8px 16px",
|
|
51544
|
-
fontSize: theme2.fontSizes[1],
|
|
51545
|
-
fontFamily: theme2.fonts.body,
|
|
51546
|
-
border: `1px solid ${agentFilter === "all" ? theme2.colors.primary : theme2.colors.border}`,
|
|
51547
|
-
borderRadius: theme2.radii[1],
|
|
51548
|
-
background: agentFilter === "all" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
|
|
51549
|
-
color: agentFilter === "all" ? theme2.colors.primary : theme2.colors.text,
|
|
51550
|
-
cursor: "pointer",
|
|
51551
|
-
display: "flex",
|
|
51552
|
-
alignItems: "center",
|
|
51553
|
-
gap: "6px",
|
|
51554
|
-
fontWeight: agentFilter === "all" ? 600 : 400,
|
|
51555
|
-
transition: "all 0.2s ease"
|
|
51556
|
-
},
|
|
51557
|
-
children: [
|
|
51558
|
-
"All (",
|
|
51559
|
-
agentsCount + subagentsCount,
|
|
51560
|
-
")"
|
|
51561
|
-
]
|
|
51562
|
-
}
|
|
51563
|
-
),
|
|
51564
|
-
/* @__PURE__ */ jsxs(
|
|
51565
|
-
"button",
|
|
51566
|
-
{
|
|
51567
|
-
onClick: () => setAgentFilter("documentation"),
|
|
51568
|
-
style: {
|
|
51569
|
-
padding: "8px 16px",
|
|
51570
|
-
fontSize: theme2.fontSizes[1],
|
|
51571
|
-
fontFamily: theme2.fonts.body,
|
|
51572
|
-
border: `1px solid ${agentFilter === "documentation" ? theme2.colors.primary : theme2.colors.border}`,
|
|
51573
|
-
borderRadius: theme2.radii[1],
|
|
51574
|
-
background: agentFilter === "documentation" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
|
|
51575
|
-
color: agentFilter === "documentation" ? theme2.colors.primary : theme2.colors.text,
|
|
51576
|
-
cursor: "pointer",
|
|
51577
|
-
display: "flex",
|
|
51578
|
-
alignItems: "center",
|
|
51579
|
-
gap: "6px",
|
|
51580
|
-
fontWeight: agentFilter === "documentation" ? 600 : 400,
|
|
51581
|
-
transition: "all 0.2s ease"
|
|
51582
|
-
},
|
|
51583
|
-
children: [
|
|
51584
|
-
/* @__PURE__ */ jsx(BookOpen, { size: 14 }),
|
|
51585
|
-
"Docs (",
|
|
51586
|
-
agentsCount,
|
|
51587
|
-
")"
|
|
51588
|
-
]
|
|
51589
|
-
}
|
|
51590
|
-
),
|
|
51591
|
-
/* @__PURE__ */ jsxs(
|
|
51592
|
-
"button",
|
|
51593
|
-
{
|
|
51594
|
-
onClick: () => setAgentFilter("subagents"),
|
|
51595
|
-
style: {
|
|
51596
|
-
padding: "8px 16px",
|
|
51597
|
-
fontSize: theme2.fontSizes[1],
|
|
51598
|
-
fontFamily: theme2.fonts.body,
|
|
51599
|
-
border: `1px solid ${agentFilter === "subagents" ? theme2.colors.primary : theme2.colors.border}`,
|
|
51600
|
-
borderRadius: theme2.radii[1],
|
|
51601
|
-
background: agentFilter === "subagents" ? `${theme2.colors.primary}15` : theme2.colors.backgroundSecondary,
|
|
51602
|
-
color: agentFilter === "subagents" ? theme2.colors.primary : theme2.colors.text,
|
|
51603
|
-
cursor: "pointer",
|
|
51604
|
-
display: "flex",
|
|
51605
|
-
alignItems: "center",
|
|
51606
|
-
gap: "6px",
|
|
51607
|
-
fontWeight: agentFilter === "subagents" ? 600 : 400,
|
|
51608
|
-
transition: "all 0.2s ease"
|
|
51609
|
-
},
|
|
51610
|
-
children: [
|
|
51611
|
-
/* @__PURE__ */ jsx(Bot, { size: 14 }),
|
|
51612
|
-
"Subagents (",
|
|
51613
|
-
subagentsCount,
|
|
51614
|
-
")"
|
|
51615
|
-
]
|
|
51616
|
-
}
|
|
51617
|
-
)
|
|
51618
|
-
]
|
|
51619
|
-
}
|
|
51620
|
-
),
|
|
51621
|
-
error && /* @__PURE__ */ jsxs(
|
|
51622
|
-
"div",
|
|
51623
|
-
{
|
|
51624
|
-
style: {
|
|
51625
|
-
flexShrink: 0,
|
|
51626
|
-
padding: "12px",
|
|
51627
|
-
background: `${theme2.colors.error}20`,
|
|
51628
|
-
border: `1px solid ${theme2.colors.error}`,
|
|
51629
|
-
borderRadius: theme2.radii[2],
|
|
51630
|
-
display: "flex",
|
|
51631
|
-
alignItems: "center",
|
|
51632
|
-
gap: "8px",
|
|
51633
|
-
color: theme2.colors.error,
|
|
51634
|
-
fontSize: theme2.fontSizes[1]
|
|
51635
|
-
},
|
|
51636
|
-
children: [
|
|
51637
|
-
/* @__PURE__ */ jsx(CircleAlert, { size: 16 }),
|
|
51638
|
-
/* @__PURE__ */ jsx("span", { children: error })
|
|
51639
|
-
]
|
|
51640
|
-
}
|
|
51641
|
-
),
|
|
51642
|
-
/* @__PURE__ */ jsx(
|
|
51643
|
-
"div",
|
|
51644
|
-
{
|
|
51645
|
-
style: {
|
|
51646
|
-
flex: 1,
|
|
51647
|
-
overflowY: "auto",
|
|
51648
|
-
minHeight: 0
|
|
51649
|
-
},
|
|
51650
|
-
children: isLoading ? /* @__PURE__ */ jsx(
|
|
51651
|
-
"div",
|
|
51652
|
-
{
|
|
51653
|
-
style: {
|
|
51654
|
-
height: "100%",
|
|
51655
|
-
display: "flex",
|
|
51656
|
-
alignItems: "center",
|
|
51657
|
-
justifyContent: "center",
|
|
51658
|
-
color: theme2.colors.textSecondary,
|
|
51659
|
-
fontSize: theme2.fontSizes[2]
|
|
51660
|
-
},
|
|
51661
|
-
children: "Loading agents..."
|
|
51662
|
-
}
|
|
51663
|
-
) : filteredItems.length === 0 ? /* @__PURE__ */ jsxs(
|
|
51664
|
-
"div",
|
|
51665
|
-
{
|
|
51666
|
-
style: {
|
|
51667
|
-
height: "100%",
|
|
51668
|
-
display: "flex",
|
|
51669
|
-
flexDirection: "column",
|
|
51670
|
-
alignItems: "center",
|
|
51671
|
-
justifyContent: "center",
|
|
51672
|
-
gap: "16px",
|
|
51673
|
-
color: theme2.colors.textSecondary,
|
|
51674
|
-
padding: "24px"
|
|
51675
|
-
},
|
|
51676
|
-
children: [
|
|
51677
|
-
/* @__PURE__ */ jsx(FileCode, { size: 48, color: theme2.colors.border }),
|
|
51678
|
-
/* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
51679
|
-
/* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: theme2.fontSizes[2] }, children: searchQuery ? "No agents match your search" : "No agents found" }),
|
|
51680
|
-
/* @__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" })
|
|
51681
|
-
] })
|
|
51682
|
-
]
|
|
51683
|
-
}
|
|
51684
|
-
) : /* @__PURE__ */ jsx(
|
|
51685
|
-
"div",
|
|
51686
|
-
{
|
|
51687
|
-
style: {
|
|
51688
|
-
display: "grid",
|
|
51689
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))",
|
|
51690
|
-
gap: "16px",
|
|
51691
|
-
padding: "4px"
|
|
51692
|
-
},
|
|
51693
|
-
children: filteredItems.map((item) => {
|
|
51694
|
-
if (item.type === "agent") {
|
|
51695
|
-
return /* @__PURE__ */ jsx(
|
|
51696
|
-
AgentCard,
|
|
51697
|
-
{
|
|
51698
|
-
agent: item.data,
|
|
51699
|
-
onClick: () => handleItemClick(item),
|
|
51700
|
-
isSelected: selectedItemId === item.data.id
|
|
51701
|
-
},
|
|
51702
|
-
item.data.id
|
|
51703
|
-
);
|
|
51704
|
-
} else {
|
|
51705
|
-
return /* @__PURE__ */ jsx(
|
|
51706
|
-
SubagentCard,
|
|
51707
|
-
{
|
|
51708
|
-
subagent: item.data,
|
|
51709
|
-
onClick: () => handleItemClick(item),
|
|
51710
|
-
isSelected: selectedItemId === item.data.id
|
|
51711
|
-
},
|
|
51712
|
-
item.data.id
|
|
51713
|
-
);
|
|
51714
|
-
}
|
|
51715
|
-
})
|
|
51716
|
-
}
|
|
51717
|
-
)
|
|
51718
|
-
}
|
|
51719
|
-
),
|
|
51720
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
51721
|
-
@keyframes spin {
|
|
51722
|
-
to { transform: rotate(360deg); }
|
|
51723
|
-
}
|
|
51724
|
-
` })
|
|
51725
|
-
]
|
|
51726
|
-
}
|
|
51727
|
-
);
|
|
51728
|
-
};
|
|
51729
50420
|
const AgentDetailPanel = ({
|
|
51730
50421
|
context,
|
|
51731
50422
|
events
|
|
@@ -52213,12 +50904,420 @@ const AgentDetailPanel = ({
|
|
|
52213
50904
|
}
|
|
52214
50905
|
return null;
|
|
52215
50906
|
};
|
|
50907
|
+
const getSourceBadge$1 = (source2) => {
|
|
50908
|
+
switch (source2) {
|
|
50909
|
+
case "project-root":
|
|
50910
|
+
return {
|
|
50911
|
+
label: "Root",
|
|
50912
|
+
icon: /* @__PURE__ */ jsx(FileText, { size: 12 }),
|
|
50913
|
+
color: "#10b981",
|
|
50914
|
+
bgColor: "#10b98120"
|
|
50915
|
+
};
|
|
50916
|
+
case "project-nested":
|
|
50917
|
+
return {
|
|
50918
|
+
label: "Nested",
|
|
50919
|
+
icon: /* @__PURE__ */ jsx(FolderTree, { size: 12 }),
|
|
50920
|
+
color: "#3b82f6",
|
|
50921
|
+
bgColor: "#3b82f620"
|
|
50922
|
+
};
|
|
50923
|
+
case "global-universal":
|
|
50924
|
+
return {
|
|
50925
|
+
label: "Global",
|
|
50926
|
+
icon: /* @__PURE__ */ jsx(Folder, { size: 12 }),
|
|
50927
|
+
color: "#8b5cf6",
|
|
50928
|
+
bgColor: "#8b5cf620"
|
|
50929
|
+
};
|
|
50930
|
+
}
|
|
50931
|
+
};
|
|
50932
|
+
const AgentCard = ({ agent, onClick, isSelected }) => {
|
|
50933
|
+
var _a;
|
|
50934
|
+
const { theme: theme2 } = useTheme();
|
|
50935
|
+
const sourceBadge = getSourceBadge$1(agent.source);
|
|
50936
|
+
const [pathCopied, setPathCopied] = React2__default.useState(false);
|
|
50937
|
+
const preview = ((_a = agent.content.split("\n").find((line) => line.trim() && !line.startsWith("#"))) == null ? void 0 : _a.substring(0, 150)) || "No description available";
|
|
50938
|
+
const handleCopyPath = async (e) => {
|
|
50939
|
+
e.stopPropagation();
|
|
50940
|
+
try {
|
|
50941
|
+
await navigator.clipboard.writeText(agent.path);
|
|
50942
|
+
setPathCopied(true);
|
|
50943
|
+
setTimeout(() => setPathCopied(false), 2e3);
|
|
50944
|
+
} catch (err) {
|
|
50945
|
+
console.error("Failed to copy path:", err);
|
|
50946
|
+
}
|
|
50947
|
+
};
|
|
50948
|
+
return /* @__PURE__ */ jsxs(
|
|
50949
|
+
"div",
|
|
50950
|
+
{
|
|
50951
|
+
onClick: () => onClick(agent),
|
|
50952
|
+
style: {
|
|
50953
|
+
padding: "16px",
|
|
50954
|
+
background: isSelected ? `${theme2.colors.primary}10` : theme2.colors.backgroundSecondary,
|
|
50955
|
+
border: `1px solid ${isSelected ? theme2.colors.primary : theme2.colors.border}`,
|
|
50956
|
+
borderRadius: theme2.radii[2],
|
|
50957
|
+
cursor: "pointer",
|
|
50958
|
+
transition: "all 0.2s ease",
|
|
50959
|
+
display: "flex",
|
|
50960
|
+
flexDirection: "column",
|
|
50961
|
+
gap: "12px"
|
|
50962
|
+
},
|
|
50963
|
+
onMouseEnter: (e) => {
|
|
50964
|
+
if (!isSelected) {
|
|
50965
|
+
e.currentTarget.style.borderColor = theme2.colors.textSecondary;
|
|
50966
|
+
}
|
|
50967
|
+
},
|
|
50968
|
+
onMouseLeave: (e) => {
|
|
50969
|
+
if (!isSelected) {
|
|
50970
|
+
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
50971
|
+
}
|
|
50972
|
+
},
|
|
50973
|
+
children: [
|
|
50974
|
+
/* @__PURE__ */ jsxs(
|
|
50975
|
+
"div",
|
|
50976
|
+
{
|
|
50977
|
+
style: {
|
|
50978
|
+
display: "flex",
|
|
50979
|
+
alignItems: "flex-start",
|
|
50980
|
+
justifyContent: "space-between",
|
|
50981
|
+
gap: "8px"
|
|
50982
|
+
},
|
|
50983
|
+
children: [
|
|
50984
|
+
/* @__PURE__ */ jsx(
|
|
50985
|
+
"h3",
|
|
50986
|
+
{
|
|
50987
|
+
style: {
|
|
50988
|
+
margin: 0,
|
|
50989
|
+
fontSize: theme2.fontSizes[2],
|
|
50990
|
+
color: theme2.colors.text,
|
|
50991
|
+
fontWeight: 600,
|
|
50992
|
+
flex: 1
|
|
50993
|
+
},
|
|
50994
|
+
children: agent.name
|
|
50995
|
+
}
|
|
50996
|
+
),
|
|
50997
|
+
/* @__PURE__ */ jsxs(
|
|
50998
|
+
"div",
|
|
50999
|
+
{
|
|
51000
|
+
style: {
|
|
51001
|
+
display: "flex",
|
|
51002
|
+
alignItems: "center",
|
|
51003
|
+
gap: "4px",
|
|
51004
|
+
padding: "4px 8px",
|
|
51005
|
+
fontSize: theme2.fontSizes[0],
|
|
51006
|
+
color: sourceBadge.color,
|
|
51007
|
+
background: sourceBadge.bgColor,
|
|
51008
|
+
border: `1px solid ${sourceBadge.color}40`,
|
|
51009
|
+
borderRadius: theme2.radii[1],
|
|
51010
|
+
flexShrink: 0
|
|
51011
|
+
},
|
|
51012
|
+
children: [
|
|
51013
|
+
sourceBadge.icon,
|
|
51014
|
+
/* @__PURE__ */ jsx("span", { children: sourceBadge.label })
|
|
51015
|
+
]
|
|
51016
|
+
}
|
|
51017
|
+
)
|
|
51018
|
+
]
|
|
51019
|
+
}
|
|
51020
|
+
),
|
|
51021
|
+
/* @__PURE__ */ jsx(
|
|
51022
|
+
"div",
|
|
51023
|
+
{
|
|
51024
|
+
onClick: handleCopyPath,
|
|
51025
|
+
style: {
|
|
51026
|
+
fontSize: theme2.fontSizes[0],
|
|
51027
|
+
color: pathCopied ? theme2.colors.success : theme2.colors.textMuted,
|
|
51028
|
+
fontFamily: theme2.fonts.monospace,
|
|
51029
|
+
background: pathCopied ? `${theme2.colors.success}15` : theme2.colors.background,
|
|
51030
|
+
padding: "4px 8px",
|
|
51031
|
+
borderRadius: theme2.radii[1],
|
|
51032
|
+
overflow: "hidden",
|
|
51033
|
+
textOverflow: "ellipsis",
|
|
51034
|
+
whiteSpace: "nowrap",
|
|
51035
|
+
cursor: "pointer",
|
|
51036
|
+
transition: "all 0.2s ease",
|
|
51037
|
+
border: `1px solid ${pathCopied ? theme2.colors.success : "transparent"}`
|
|
51038
|
+
},
|
|
51039
|
+
title: pathCopied ? "Copied!" : `Click to copy: ${agent.path}`,
|
|
51040
|
+
onMouseEnter: (e) => {
|
|
51041
|
+
if (!pathCopied) {
|
|
51042
|
+
e.currentTarget.style.background = theme2.colors.backgroundTertiary || theme2.colors.border;
|
|
51043
|
+
}
|
|
51044
|
+
},
|
|
51045
|
+
onMouseLeave: (e) => {
|
|
51046
|
+
if (!pathCopied) {
|
|
51047
|
+
e.currentTarget.style.background = theme2.colors.background;
|
|
51048
|
+
}
|
|
51049
|
+
},
|
|
51050
|
+
children: pathCopied ? "Copied!" : agent.path
|
|
51051
|
+
}
|
|
51052
|
+
),
|
|
51053
|
+
/* @__PURE__ */ jsx(
|
|
51054
|
+
"div",
|
|
51055
|
+
{
|
|
51056
|
+
style: {
|
|
51057
|
+
fontSize: theme2.fontSizes[1],
|
|
51058
|
+
color: theme2.colors.textSecondary,
|
|
51059
|
+
lineHeight: 1.5,
|
|
51060
|
+
overflow: "hidden",
|
|
51061
|
+
textOverflow: "ellipsis",
|
|
51062
|
+
display: "-webkit-box",
|
|
51063
|
+
WebkitLineClamp: 3,
|
|
51064
|
+
WebkitBoxOrient: "vertical"
|
|
51065
|
+
},
|
|
51066
|
+
children: preview
|
|
51067
|
+
}
|
|
51068
|
+
),
|
|
51069
|
+
agent.sections && Object.keys(agent.sections).length > 0 && /* @__PURE__ */ jsx(
|
|
51070
|
+
"div",
|
|
51071
|
+
{
|
|
51072
|
+
style: {
|
|
51073
|
+
display: "flex",
|
|
51074
|
+
flexWrap: "wrap",
|
|
51075
|
+
gap: "6px",
|
|
51076
|
+
marginTop: "4px"
|
|
51077
|
+
},
|
|
51078
|
+
children: Object.keys(agent.sections).map((section) => /* @__PURE__ */ jsx(
|
|
51079
|
+
"span",
|
|
51080
|
+
{
|
|
51081
|
+
style: {
|
|
51082
|
+
fontSize: theme2.fontSizes[0],
|
|
51083
|
+
padding: "2px 8px",
|
|
51084
|
+
background: theme2.colors.background,
|
|
51085
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
51086
|
+
borderRadius: theme2.radii[1],
|
|
51087
|
+
color: theme2.colors.textSecondary,
|
|
51088
|
+
textTransform: "capitalize"
|
|
51089
|
+
},
|
|
51090
|
+
children: section
|
|
51091
|
+
},
|
|
51092
|
+
section
|
|
51093
|
+
))
|
|
51094
|
+
}
|
|
51095
|
+
)
|
|
51096
|
+
]
|
|
51097
|
+
}
|
|
51098
|
+
);
|
|
51099
|
+
};
|
|
51100
|
+
const getSourceBadge = (source2) => {
|
|
51101
|
+
switch (source2) {
|
|
51102
|
+
case "project-claude":
|
|
51103
|
+
return {
|
|
51104
|
+
label: "Project",
|
|
51105
|
+
icon: /* @__PURE__ */ jsx(Folder, { size: 12 }),
|
|
51106
|
+
color: "#06b6d4",
|
|
51107
|
+
bgColor: "#06b6d420"
|
|
51108
|
+
};
|
|
51109
|
+
case "global-claude":
|
|
51110
|
+
return {
|
|
51111
|
+
label: "Global",
|
|
51112
|
+
icon: /* @__PURE__ */ jsx(Globe, { size: 12 }),
|
|
51113
|
+
color: "#8b5cf6",
|
|
51114
|
+
bgColor: "#8b5cf620"
|
|
51115
|
+
};
|
|
51116
|
+
}
|
|
51117
|
+
};
|
|
51118
|
+
const getModelColor = (model) => {
|
|
51119
|
+
switch (model) {
|
|
51120
|
+
case "opus":
|
|
51121
|
+
return "#f59e0b";
|
|
51122
|
+
case "sonnet":
|
|
51123
|
+
return "#10b981";
|
|
51124
|
+
case "haiku":
|
|
51125
|
+
return "#3b82f6";
|
|
51126
|
+
case "inherit":
|
|
51127
|
+
return "#6b7280";
|
|
51128
|
+
default:
|
|
51129
|
+
return "#10b981";
|
|
51130
|
+
}
|
|
51131
|
+
};
|
|
51132
|
+
const SubagentCard = ({ subagent, onClick, isSelected }) => {
|
|
51133
|
+
const { theme: theme2 } = useTheme();
|
|
51134
|
+
const sourceBadge = getSourceBadge(subagent.source);
|
|
51135
|
+
const modelColor = getModelColor(subagent.frontmatter.model);
|
|
51136
|
+
const hasTools = subagent.frontmatter.tools;
|
|
51137
|
+
const toolsArray = hasTools ? hasTools.split(",").map((t) => t.trim()) : null;
|
|
51138
|
+
return /* @__PURE__ */ jsxs(
|
|
51139
|
+
"div",
|
|
51140
|
+
{
|
|
51141
|
+
onClick: () => onClick(subagent),
|
|
51142
|
+
style: {
|
|
51143
|
+
padding: "16px",
|
|
51144
|
+
background: isSelected ? `${theme2.colors.primary}10` : theme2.colors.backgroundSecondary,
|
|
51145
|
+
border: `1px solid ${isSelected ? theme2.colors.primary : theme2.colors.border}`,
|
|
51146
|
+
borderRadius: theme2.radii[2],
|
|
51147
|
+
cursor: "pointer",
|
|
51148
|
+
transition: "all 0.2s ease",
|
|
51149
|
+
display: "flex",
|
|
51150
|
+
flexDirection: "column",
|
|
51151
|
+
gap: "12px"
|
|
51152
|
+
},
|
|
51153
|
+
onMouseEnter: (e) => {
|
|
51154
|
+
if (!isSelected) {
|
|
51155
|
+
e.currentTarget.style.borderColor = theme2.colors.textSecondary;
|
|
51156
|
+
}
|
|
51157
|
+
},
|
|
51158
|
+
onMouseLeave: (e) => {
|
|
51159
|
+
if (!isSelected) {
|
|
51160
|
+
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
51161
|
+
}
|
|
51162
|
+
},
|
|
51163
|
+
children: [
|
|
51164
|
+
/* @__PURE__ */ jsxs(
|
|
51165
|
+
"div",
|
|
51166
|
+
{
|
|
51167
|
+
style: {
|
|
51168
|
+
display: "flex",
|
|
51169
|
+
alignItems: "flex-start",
|
|
51170
|
+
justifyContent: "space-between",
|
|
51171
|
+
gap: "8px"
|
|
51172
|
+
},
|
|
51173
|
+
children: [
|
|
51174
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flex: 1 }, children: [
|
|
51175
|
+
/* @__PURE__ */ jsx(Bot, { size: 18, color: theme2.colors.primary }),
|
|
51176
|
+
/* @__PURE__ */ jsx(
|
|
51177
|
+
"h3",
|
|
51178
|
+
{
|
|
51179
|
+
style: {
|
|
51180
|
+
margin: 0,
|
|
51181
|
+
fontSize: theme2.fontSizes[2],
|
|
51182
|
+
color: theme2.colors.text,
|
|
51183
|
+
fontWeight: 600
|
|
51184
|
+
},
|
|
51185
|
+
children: subagent.name
|
|
51186
|
+
}
|
|
51187
|
+
)
|
|
51188
|
+
] }),
|
|
51189
|
+
/* @__PURE__ */ jsxs(
|
|
51190
|
+
"div",
|
|
51191
|
+
{
|
|
51192
|
+
style: {
|
|
51193
|
+
display: "flex",
|
|
51194
|
+
alignItems: "center",
|
|
51195
|
+
gap: "4px",
|
|
51196
|
+
padding: "4px 8px",
|
|
51197
|
+
fontSize: theme2.fontSizes[0],
|
|
51198
|
+
color: sourceBadge.color,
|
|
51199
|
+
background: sourceBadge.bgColor,
|
|
51200
|
+
border: `1px solid ${sourceBadge.color}40`,
|
|
51201
|
+
borderRadius: theme2.radii[1],
|
|
51202
|
+
flexShrink: 0
|
|
51203
|
+
},
|
|
51204
|
+
children: [
|
|
51205
|
+
sourceBadge.icon,
|
|
51206
|
+
/* @__PURE__ */ jsx("span", { children: sourceBadge.label })
|
|
51207
|
+
]
|
|
51208
|
+
}
|
|
51209
|
+
)
|
|
51210
|
+
]
|
|
51211
|
+
}
|
|
51212
|
+
),
|
|
51213
|
+
/* @__PURE__ */ jsx(
|
|
51214
|
+
"div",
|
|
51215
|
+
{
|
|
51216
|
+
style: {
|
|
51217
|
+
fontSize: theme2.fontSizes[1],
|
|
51218
|
+
color: theme2.colors.textSecondary,
|
|
51219
|
+
lineHeight: 1.5
|
|
51220
|
+
},
|
|
51221
|
+
children: subagent.frontmatter.description
|
|
51222
|
+
}
|
|
51223
|
+
),
|
|
51224
|
+
/* @__PURE__ */ jsx(
|
|
51225
|
+
"div",
|
|
51226
|
+
{
|
|
51227
|
+
style: {
|
|
51228
|
+
fontSize: theme2.fontSizes[0],
|
|
51229
|
+
color: theme2.colors.textSecondary,
|
|
51230
|
+
fontFamily: theme2.fonts.monospace,
|
|
51231
|
+
wordBreak: "break-all",
|
|
51232
|
+
opacity: 0.7
|
|
51233
|
+
},
|
|
51234
|
+
children: subagent.path
|
|
51235
|
+
}
|
|
51236
|
+
),
|
|
51237
|
+
/* @__PURE__ */ jsxs(
|
|
51238
|
+
"div",
|
|
51239
|
+
{
|
|
51240
|
+
style: {
|
|
51241
|
+
display: "flex",
|
|
51242
|
+
flexWrap: "wrap",
|
|
51243
|
+
gap: "6px",
|
|
51244
|
+
marginTop: "4px"
|
|
51245
|
+
},
|
|
51246
|
+
children: [
|
|
51247
|
+
subagent.frontmatter.model && /* @__PURE__ */ jsxs(
|
|
51248
|
+
"div",
|
|
51249
|
+
{
|
|
51250
|
+
style: {
|
|
51251
|
+
display: "flex",
|
|
51252
|
+
alignItems: "center",
|
|
51253
|
+
gap: "4px",
|
|
51254
|
+
fontSize: theme2.fontSizes[0],
|
|
51255
|
+
padding: "3px 8px",
|
|
51256
|
+
background: `${modelColor}20`,
|
|
51257
|
+
border: `1px solid ${modelColor}40`,
|
|
51258
|
+
borderRadius: theme2.radii[1],
|
|
51259
|
+
color: modelColor
|
|
51260
|
+
},
|
|
51261
|
+
children: [
|
|
51262
|
+
/* @__PURE__ */ jsx(Zap, { size: 11 }),
|
|
51263
|
+
/* @__PURE__ */ jsx("span", { children: subagent.frontmatter.model })
|
|
51264
|
+
]
|
|
51265
|
+
}
|
|
51266
|
+
),
|
|
51267
|
+
toolsArray && /* @__PURE__ */ jsxs(
|
|
51268
|
+
"div",
|
|
51269
|
+
{
|
|
51270
|
+
style: {
|
|
51271
|
+
display: "flex",
|
|
51272
|
+
alignItems: "center",
|
|
51273
|
+
gap: "4px",
|
|
51274
|
+
fontSize: theme2.fontSizes[0],
|
|
51275
|
+
padding: "3px 8px",
|
|
51276
|
+
background: theme2.colors.background,
|
|
51277
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
51278
|
+
borderRadius: theme2.radii[1],
|
|
51279
|
+
color: theme2.colors.textSecondary
|
|
51280
|
+
},
|
|
51281
|
+
children: [
|
|
51282
|
+
/* @__PURE__ */ jsx(Wrench, { size: 11 }),
|
|
51283
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
51284
|
+
toolsArray.length,
|
|
51285
|
+
" ",
|
|
51286
|
+
toolsArray.length === 1 ? "tool" : "tools"
|
|
51287
|
+
] })
|
|
51288
|
+
]
|
|
51289
|
+
}
|
|
51290
|
+
),
|
|
51291
|
+
subagent.frontmatter.permissionMode && subagent.frontmatter.permissionMode !== "default" && /* @__PURE__ */ jsx(
|
|
51292
|
+
"div",
|
|
51293
|
+
{
|
|
51294
|
+
style: {
|
|
51295
|
+
fontSize: theme2.fontSizes[0],
|
|
51296
|
+
padding: "3px 8px",
|
|
51297
|
+
background: theme2.colors.background,
|
|
51298
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
51299
|
+
borderRadius: theme2.radii[1],
|
|
51300
|
+
color: theme2.colors.textSecondary
|
|
51301
|
+
},
|
|
51302
|
+
children: subagent.frontmatter.permissionMode
|
|
51303
|
+
}
|
|
51304
|
+
)
|
|
51305
|
+
]
|
|
51306
|
+
}
|
|
51307
|
+
)
|
|
51308
|
+
]
|
|
51309
|
+
}
|
|
51310
|
+
);
|
|
51311
|
+
};
|
|
52216
51312
|
const AgenticResourcesPanel = ({
|
|
52217
51313
|
context,
|
|
52218
51314
|
events
|
|
52219
51315
|
}) => {
|
|
51316
|
+
var _a;
|
|
52220
51317
|
const { theme: theme2 } = useTheme();
|
|
52221
51318
|
const panelRef = useRef(null);
|
|
51319
|
+
const hasLoadedAgentsRef = useRef(false);
|
|
51320
|
+
const hasLoadedSkillsRef = useRef(false);
|
|
52222
51321
|
const [mode, setMode] = useState("agents");
|
|
52223
51322
|
const [selectedItemId, setSelectedItemId] = useState(null);
|
|
52224
51323
|
const [searchQuery, setSearchQuery] = useState("");
|
|
@@ -52241,11 +51340,19 @@ const AgenticResourcesPanel = ({
|
|
|
52241
51340
|
error: skillsError,
|
|
52242
51341
|
refreshSkills
|
|
52243
51342
|
} = useSkillsData({ context });
|
|
52244
|
-
|
|
51343
|
+
if (!agentsLoading && !subagentsLoading && !hasLoadedAgentsRef.current) {
|
|
51344
|
+
hasLoadedAgentsRef.current = true;
|
|
51345
|
+
}
|
|
51346
|
+
if (!skillsLoading && !hasLoadedSkillsRef.current) {
|
|
51347
|
+
hasLoadedSkillsRef.current = true;
|
|
51348
|
+
}
|
|
51349
|
+
const showAgentsLoading = (agentsLoading || subagentsLoading) && !hasLoadedAgentsRef.current;
|
|
51350
|
+
const showSkillsLoading = skillsLoading && !hasLoadedSkillsRef.current;
|
|
51351
|
+
const isLoading = mode === "agents" ? showAgentsLoading : showSkillsLoading;
|
|
52245
51352
|
const error = mode === "agents" ? agentsError || subagentsError : skillsError;
|
|
52246
51353
|
gt("agentic-resources", events, () => {
|
|
52247
|
-
var
|
|
52248
|
-
return (
|
|
51354
|
+
var _a2;
|
|
51355
|
+
return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
|
|
52249
51356
|
});
|
|
52250
51357
|
useEffect(() => {
|
|
52251
51358
|
if (mode !== "skills") return;
|
|
@@ -52299,9 +51406,9 @@ const AgenticResourcesPanel = ({
|
|
|
52299
51406
|
return filtered;
|
|
52300
51407
|
}, [allItems, searchQuery, agentFilter]);
|
|
52301
51408
|
const hasRepository = useMemo(() => {
|
|
52302
|
-
|
|
52303
|
-
return !!(
|
|
52304
|
-
}, [context]);
|
|
51409
|
+
var _a2;
|
|
51410
|
+
return !!((_a2 = context.fileTree) == null ? void 0 : _a2.data);
|
|
51411
|
+
}, [(_a = context.fileTree) == null ? void 0 : _a.data]);
|
|
52305
51412
|
const filteredSkills = useMemo(() => {
|
|
52306
51413
|
let filtered = skills;
|
|
52307
51414
|
if (skillFilter === "project") {
|
|
@@ -52326,9 +51433,9 @@ const AgenticResourcesPanel = ({
|
|
|
52326
51433
|
if (searchQuery.trim()) {
|
|
52327
51434
|
const query = searchQuery.toLowerCase().trim();
|
|
52328
51435
|
filtered = filtered.filter((skill) => {
|
|
52329
|
-
var
|
|
51436
|
+
var _a2, _b;
|
|
52330
51437
|
if (skill.name.toLowerCase().includes(query)) return true;
|
|
52331
|
-
if ((
|
|
51438
|
+
if ((_a2 = skill.description) == null ? void 0 : _a2.toLowerCase().includes(query)) return true;
|
|
52332
51439
|
if ((_b = skill.capabilities) == null ? void 0 : _b.some((cap2) => cap2.toLowerCase().includes(query))) return true;
|
|
52333
51440
|
if (skill.path.toLowerCase().includes(query)) return true;
|
|
52334
51441
|
return false;
|
|
@@ -52870,31 +51977,6 @@ const AgenticResourcesPanel = ({
|
|
|
52870
51977
|
);
|
|
52871
51978
|
};
|
|
52872
51979
|
const panels = [
|
|
52873
|
-
{
|
|
52874
|
-
metadata: {
|
|
52875
|
-
id: "industry-theme.skills-list",
|
|
52876
|
-
name: "Skills List",
|
|
52877
|
-
icon: "⚡",
|
|
52878
|
-
version: "0.1.0",
|
|
52879
|
-
author: "Principal ADE",
|
|
52880
|
-
description: "Display and manage Agent Skills from SKILL.md files",
|
|
52881
|
-
slices: ["fileTree", "globalSkills"]
|
|
52882
|
-
// Data slices this panel depends on
|
|
52883
|
-
},
|
|
52884
|
-
component: SkillsListPanel,
|
|
52885
|
-
// Optional: Called when this specific panel is mounted
|
|
52886
|
-
onMount: async (context) => {
|
|
52887
|
-
var _a;
|
|
52888
|
-
console.log(
|
|
52889
|
-
"Skills List Panel mounted",
|
|
52890
|
-
(_a = context.currentScope.repository) == null ? void 0 : _a.path
|
|
52891
|
-
);
|
|
52892
|
-
},
|
|
52893
|
-
// Optional: Called when this specific panel is unmounted
|
|
52894
|
-
onUnmount: async (_context) => {
|
|
52895
|
-
console.log("Skills List Panel unmounting");
|
|
52896
|
-
}
|
|
52897
|
-
},
|
|
52898
51980
|
{
|
|
52899
51981
|
metadata: {
|
|
52900
51982
|
id: "industry-theme.skills-browse",
|
|
@@ -52970,31 +52052,6 @@ const panels = [
|
|
|
52970
52052
|
console.log("Skill Detail Panel unmounting");
|
|
52971
52053
|
}
|
|
52972
52054
|
},
|
|
52973
|
-
{
|
|
52974
|
-
metadata: {
|
|
52975
|
-
id: "industry-theme.agents-list",
|
|
52976
|
-
name: "Agents List",
|
|
52977
|
-
icon: "🤖",
|
|
52978
|
-
version: "0.1.0",
|
|
52979
|
-
author: "Principal ADE",
|
|
52980
|
-
description: "Display AGENTS.md documentation and Claude Code subagents",
|
|
52981
|
-
slices: ["fileTree", "globalAgents", "globalSubagents"]
|
|
52982
|
-
// Data slices this panel depends on
|
|
52983
|
-
},
|
|
52984
|
-
component: AgentsListPanel,
|
|
52985
|
-
// Optional: Called when this specific panel is mounted
|
|
52986
|
-
onMount: async (context) => {
|
|
52987
|
-
var _a;
|
|
52988
|
-
console.log(
|
|
52989
|
-
"Agents List Panel mounted",
|
|
52990
|
-
(_a = context.currentScope.repository) == null ? void 0 : _a.path
|
|
52991
|
-
);
|
|
52992
|
-
},
|
|
52993
|
-
// Optional: Called when this specific panel is unmounted
|
|
52994
|
-
onUnmount: async (_context) => {
|
|
52995
|
-
console.log("Agents List Panel unmounting");
|
|
52996
|
-
}
|
|
52997
|
-
},
|
|
52998
52055
|
{
|
|
52999
52056
|
metadata: {
|
|
53000
52057
|
id: "industry-theme.agent-detail",
|