@industry-theme/agent-panels 0.2.13 → 0.2.15

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.
@@ -2620,7 +2620,8 @@ const validateFrontmatter = (content2) => {
2620
2620
  const trimmedContent = content2.trim();
2621
2621
  if (!trimmedContent.startsWith("---")) {
2622
2622
  return {
2623
- isValid: false,
2623
+ isValid: true,
2624
+ // Still valid, just has warnings
2624
2625
  hasStructure: false,
2625
2626
  missingFields: [],
2626
2627
  errorMessage: "Missing YAML frontmatter (must start with ---)"
@@ -2636,7 +2637,8 @@ const validateFrontmatter = (content2) => {
2636
2637
  }
2637
2638
  if (frontmatterEnd <= 0) {
2638
2639
  return {
2639
- isValid: false,
2640
+ isValid: true,
2641
+ // Still valid, just has warnings
2640
2642
  hasStructure: false,
2641
2643
  missingFields: [],
2642
2644
  errorMessage: "Missing closing --- delimiter for frontmatter"
@@ -2659,7 +2661,8 @@ const validateFrontmatter = (content2) => {
2659
2661
  errorMessage = `Missing required field${missingFields.length > 1 ? "s" : ""}: ${fieldList}`;
2660
2662
  }
2661
2663
  return {
2662
- isValid: missingFields.length === 0,
2664
+ isValid: true,
2665
+ // Always valid - we show warnings but don't block rendering
2663
2666
  hasStructure: true,
2664
2667
  missingFields,
2665
2668
  errorMessage
@@ -2720,6 +2723,76 @@ const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, i
2720
2723
  frontmatterValidation
2721
2724
  };
2722
2725
  };
2726
+ const getDeduplicationKey = (skill) => {
2727
+ var _a, _b, _c;
2728
+ 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)) {
2729
+ return `github:${skill.metadata.owner}/${skill.metadata.repo}/${skill.metadata.skillPath}`;
2730
+ }
2731
+ const normalizedName = skill.name.toLowerCase().replace(/\s+/g, "-");
2732
+ return `name:${normalizedName}`;
2733
+ };
2734
+ const comparePriority = (skill1, skill2) => {
2735
+ var _a, _b;
2736
+ if (skill1.priority !== skill2.priority) {
2737
+ return skill1.priority < skill2.priority;
2738
+ }
2739
+ const time1 = ((_a = skill1.metadata) == null ? void 0 : _a.installedAt) ? new Date(skill1.metadata.installedAt).getTime() : 0;
2740
+ const time2 = ((_b = skill2.metadata) == null ? void 0 : _b.installedAt) ? new Date(skill2.metadata.installedAt).getTime() : 0;
2741
+ return time1 > time2;
2742
+ };
2743
+ const skillToInstallation = (skill) => ({
2744
+ path: skill.path,
2745
+ source: skill.source,
2746
+ priority: skill.priority,
2747
+ skillFolderPath: skill.skillFolderPath,
2748
+ metadata: skill.metadata
2749
+ });
2750
+ const deduplicateSkills = (skills, isBrowserMode = false) => {
2751
+ if (isBrowserMode) {
2752
+ console.log("[useSkillsData] Browser mode detected, skipping deduplication");
2753
+ return skills;
2754
+ }
2755
+ if (skills.length === 0) {
2756
+ return skills;
2757
+ }
2758
+ const skillGroups = /* @__PURE__ */ new Map();
2759
+ for (const skill of skills) {
2760
+ const key = getDeduplicationKey(skill);
2761
+ const group = skillGroups.get(key) || [];
2762
+ group.push(skill);
2763
+ skillGroups.set(key, group);
2764
+ }
2765
+ console.log("[useSkillsData] Deduplication found", skillGroups.size, "unique skills from", skills.length, "total");
2766
+ const deduplicatedSkills = [];
2767
+ for (const [key, group] of skillGroups.entries()) {
2768
+ if (group.length === 1) {
2769
+ deduplicatedSkills.push({
2770
+ ...group[0],
2771
+ installedLocations: [skillToInstallation(group[0])]
2772
+ });
2773
+ continue;
2774
+ }
2775
+ const sortedByPriority = [...group].sort(
2776
+ (a, b) => comparePriority(a, b) ? -1 : 1
2777
+ );
2778
+ const primary = sortedByPriority[0];
2779
+ const installations = group.map(skillToInstallation);
2780
+ installations.sort((a, b) => a.priority - b.priority);
2781
+ console.log(
2782
+ "[useSkillsData] Deduplicated skill:",
2783
+ primary.name,
2784
+ "from",
2785
+ group.length,
2786
+ "installations. Primary:",
2787
+ primary.source
2788
+ );
2789
+ deduplicatedSkills.push({
2790
+ ...primary,
2791
+ installedLocations: installations
2792
+ });
2793
+ }
2794
+ return deduplicatedSkills;
2795
+ };
2723
2796
  const useSkillsData = ({
2724
2797
  context
2725
2798
  }) => {
@@ -2747,8 +2820,9 @@ const useSkillsData = ({
2747
2820
  setError(null);
2748
2821
  try {
2749
2822
  let localSkills = [];
2823
+ let isBrowserMode = false;
2750
2824
  if (fileTree && (fileSystem == null ? void 0 : fileSystem.readFile) && repoPath) {
2751
- const isBrowserMode = !repoPath.startsWith("/");
2825
+ isBrowserMode = !repoPath.startsWith("/");
2752
2826
  console.log("[useSkillsData] fileTree:", fileTree);
2753
2827
  console.log("[useSkillsData] typeof fileTree:", typeof fileTree);
2754
2828
  console.log("[useSkillsData] fileTree keys:", Object.keys(fileTree));
@@ -2771,8 +2845,10 @@ const useSkillsData = ({
2771
2845
  }
2772
2846
  console.log("[useSkillsData] Global skills:", globalSkills);
2773
2847
  const allSkills = [...localSkills, ...globalSkills];
2774
- console.log("[useSkillsData] Total skills:", allSkills.length);
2775
- setSkills(allSkills);
2848
+ console.log("[useSkillsData] Total skills before deduplication:", allSkills.length);
2849
+ const deduplicatedSkills = deduplicateSkills(allSkills, isBrowserMode);
2850
+ console.log("[useSkillsData] Total skills after deduplication:", deduplicatedSkills.length);
2851
+ setSkills(deduplicatedSkills);
2776
2852
  lastLoadedSha.current = fileTreeSha;
2777
2853
  lastGlobalSkillsCount.current = globalSkillsCount;
2778
2854
  } catch (err) {
@@ -2798,7 +2874,7 @@ const useSkillsData = ({
2798
2874
  refreshSkills
2799
2875
  };
2800
2876
  };
2801
- const getSourceConfig = (source2) => {
2877
+ const getSourceConfig$1 = (source2) => {
2802
2878
  switch (source2) {
2803
2879
  case "global-universal":
2804
2880
  return {
@@ -2847,6 +2923,20 @@ const getSourceConfig = (source2) => {
2847
2923
  };
2848
2924
  }
2849
2925
  };
2926
+ const abbreviateSourceName = (source2) => {
2927
+ switch (source2) {
2928
+ case "project-universal":
2929
+ return "Project";
2930
+ case "global-universal":
2931
+ return "Global";
2932
+ case "project-claude":
2933
+ return "Project (Claude)";
2934
+ case "global-claude":
2935
+ return "Global (Claude)";
2936
+ case "project-other":
2937
+ return "Project";
2938
+ }
2939
+ };
2850
2940
  const SkillCard = ({
2851
2941
  skill,
2852
2942
  onClick,
@@ -2854,7 +2944,7 @@ const SkillCard = ({
2854
2944
  }) => {
2855
2945
  var _a, _b, _c, _d, _e2, _f, _g, _h;
2856
2946
  const { theme: theme2 } = useTheme();
2857
- const sourceConfig = getSourceConfig(skill.source);
2947
+ const sourceConfig = getSourceConfig$1(skill.source);
2858
2948
  const [pathCopied, setPathCopied] = React2__default.useState(false);
2859
2949
  const handleCopyPath = async (e) => {
2860
2950
  e.stopPropagation();
@@ -2991,7 +3081,39 @@ Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).t
2991
3081
  /* @__PURE__ */ jsx("span", { children: skill.frontmatterValidation.hasStructure ? skill.frontmatterValidation.missingFields.length > 0 ? `Missing: ${skill.frontmatterValidation.missingFields.join(", ")}` : "Invalid Frontmatter" : "No Frontmatter" })
2992
3082
  ]
2993
3083
  }
2994
- )
3084
+ ),
3085
+ skill.installedLocations && skill.installedLocations.length > 1 && (() => {
3086
+ const otherLocations = skill.installedLocations.filter((loc) => loc.path !== skill.path).map((loc) => abbreviateSourceName(loc.source));
3087
+ const uniqueLocations = Array.from(new Set(otherLocations));
3088
+ const locationText = uniqueLocations.join(", ");
3089
+ return /* @__PURE__ */ jsxs(
3090
+ "div",
3091
+ {
3092
+ style: {
3093
+ display: "inline-flex",
3094
+ alignItems: "center",
3095
+ gap: "4px",
3096
+ padding: "2px 6px",
3097
+ borderRadius: theme2.radii[1],
3098
+ backgroundColor: `${theme2.colors.accent}15`,
3099
+ border: `1px solid ${theme2.colors.accent}30`,
3100
+ fontSize: theme2.fontSizes[0],
3101
+ color: theme2.colors.accent,
3102
+ fontWeight: 500,
3103
+ width: "fit-content"
3104
+ },
3105
+ title: `Also installed in:
3106
+ ${skill.installedLocations.filter((loc) => loc.path !== skill.path).map((loc) => `${abbreviateSourceName(loc.source)}: ${loc.path}`).join("\n")}`,
3107
+ children: [
3108
+ /* @__PURE__ */ jsx(Package, { size: 10 }),
3109
+ /* @__PURE__ */ jsxs("span", { children: [
3110
+ "Also in: ",
3111
+ locationText
3112
+ ] })
3113
+ ]
3114
+ }
3115
+ );
3116
+ })()
2995
3117
  ] })
2996
3118
  ] }),
2997
3119
  (skill.hasScripts || skill.hasReferences || skill.hasAssets) && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap", flexShrink: 0 }, children: [
@@ -3216,6 +3338,15 @@ const SkillsListPanel = ({
3216
3338
  };
3217
3339
  const handleRefresh = async () => {
3218
3340
  setIsRefreshing(true);
3341
+ if (events) {
3342
+ events.emit({
3343
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3344
+ type: "skills:refresh",
3345
+ source: "skills-list-panel",
3346
+ timestamp: Date.now(),
3347
+ payload: {}
3348
+ });
3349
+ }
3219
3350
  try {
3220
3351
  await refreshSkills();
3221
3352
  } finally {
@@ -3572,6 +3703,188 @@ const SkillsListPanel = ({
3572
3703
  }
3573
3704
  );
3574
3705
  };
3706
+ var MarkdownSourceType$1;
3707
+ ((MarkdownSourceType2) => {
3708
+ MarkdownSourceType2["WORKSPACE_FILE"] = "workspace_file";
3709
+ MarkdownSourceType2["REMOTE_FILE"] = "remote_file";
3710
+ MarkdownSourceType2["GITHUB_FILE"] = "github_file";
3711
+ MarkdownSourceType2["DRAFT"] = "draft";
3712
+ MarkdownSourceType2["GITHUB_ISSUE"] = "github_issue";
3713
+ MarkdownSourceType2["GITHUB_PULL_REQUEST"] = "github_pull_request";
3714
+ MarkdownSourceType2["GITHUB_GIST"] = "github_gist";
3715
+ })(MarkdownSourceType$1 || (MarkdownSourceType$1 = {}));
3716
+ class SkillParseError extends Error {
3717
+ constructor(message, cause) {
3718
+ super(message);
3719
+ __publicField(this, "cause");
3720
+ this.cause = cause;
3721
+ this.name = "SkillParseError";
3722
+ }
3723
+ }
3724
+ function extractFrontmatter(content2) {
3725
+ const trimmed = content2.trim();
3726
+ if (!trimmed.startsWith("---")) {
3727
+ throw new SkillParseError("SKILL.md must start with YAML frontmatter (---)");
3728
+ }
3729
+ const afterFirstDelimiter = trimmed.slice(3);
3730
+ const closingIndex = afterFirstDelimiter.indexOf(`
3731
+ ---`);
3732
+ if (closingIndex === -1) {
3733
+ throw new SkillParseError("SKILL.md frontmatter is not properly closed with ---");
3734
+ }
3735
+ const frontmatter = afterFirstDelimiter.slice(0, closingIndex).trim();
3736
+ const body = afterFirstDelimiter.slice(closingIndex + 4).trim();
3737
+ return { frontmatter, body };
3738
+ }
3739
+ function parseYamlFrontmatter(yaml2) {
3740
+ const result = {};
3741
+ const lines = yaml2.split(`
3742
+ `);
3743
+ let currentObject = null;
3744
+ let currentList = null;
3745
+ for (let i = 0; i < lines.length; i++) {
3746
+ const line = lines[i];
3747
+ const trimmed = line.trim();
3748
+ if (!trimmed || trimmed.startsWith("#")) {
3749
+ continue;
3750
+ }
3751
+ const lineIndent = line.search(/\S/);
3752
+ if (trimmed.startsWith("- ")) {
3753
+ const value = trimmed.slice(2).trim();
3754
+ if (currentList) {
3755
+ currentList.push(value);
3756
+ }
3757
+ continue;
3758
+ }
3759
+ const colonIndex = line.indexOf(":");
3760
+ if (colonIndex > 0) {
3761
+ const key = line.slice(0, colonIndex).trim();
3762
+ const value = line.slice(colonIndex + 1).trim();
3763
+ if (lineIndent === 0) {
3764
+ currentList = null;
3765
+ currentObject = null;
3766
+ if (!value) {
3767
+ if (i + 1 < lines.length) {
3768
+ const nextLine = lines[i + 1];
3769
+ const nextTrimmed = nextLine.trim();
3770
+ if (nextTrimmed.startsWith("- ")) {
3771
+ currentList = [];
3772
+ result[key] = currentList;
3773
+ } else if (nextLine.search(/\S/) > 0 && nextLine.includes(":")) {
3774
+ currentObject = {};
3775
+ result[key] = currentObject;
3776
+ }
3777
+ }
3778
+ } else {
3779
+ const cleanValue = value.replace(/^["']|["']$/g, "");
3780
+ result[key] = cleanValue;
3781
+ }
3782
+ } else if (lineIndent > 0 && currentObject) {
3783
+ const cleanValue = value.replace(/^["']|["']$/g, "");
3784
+ currentObject[key] = cleanValue;
3785
+ }
3786
+ }
3787
+ }
3788
+ return result;
3789
+ }
3790
+ function parseSkillMetadataGraceful(metadata) {
3791
+ const warnings = [];
3792
+ const partialMetadata = {};
3793
+ if (!metadata.name || typeof metadata.name !== "string" || !metadata.name.trim()) {
3794
+ warnings.push({
3795
+ field: "name",
3796
+ message: 'Required field "name" is missing or empty'
3797
+ });
3798
+ } else {
3799
+ partialMetadata.name = metadata.name;
3800
+ }
3801
+ if (!metadata.description || typeof metadata.description !== "string" || !metadata.description.trim()) {
3802
+ warnings.push({
3803
+ field: "description",
3804
+ message: 'Required field "description" is missing or empty'
3805
+ });
3806
+ } else {
3807
+ partialMetadata.description = metadata.description;
3808
+ }
3809
+ if (metadata.license !== void 0) {
3810
+ if (typeof metadata.license !== "string") {
3811
+ warnings.push({
3812
+ field: "license",
3813
+ message: 'Field "license" must be a string'
3814
+ });
3815
+ } else {
3816
+ partialMetadata.license = metadata.license;
3817
+ }
3818
+ }
3819
+ if (metadata.compatibility !== void 0) {
3820
+ if (typeof metadata.compatibility !== "string") {
3821
+ warnings.push({
3822
+ field: "compatibility",
3823
+ message: 'Field "compatibility" must be a string'
3824
+ });
3825
+ } else {
3826
+ partialMetadata.compatibility = metadata.compatibility;
3827
+ }
3828
+ }
3829
+ if (metadata["allowed-tools"] !== void 0) {
3830
+ if (typeof metadata["allowed-tools"] === "string") {
3831
+ const toolsString = metadata["allowed-tools"];
3832
+ partialMetadata["allowed-tools"] = toolsString.trim() ? toolsString.trim().split(/\s+/) : [];
3833
+ } else {
3834
+ warnings.push({
3835
+ field: "allowed-tools",
3836
+ message: 'Field "allowed-tools" must be a space-delimited string'
3837
+ });
3838
+ }
3839
+ }
3840
+ if (metadata.metadata !== void 0) {
3841
+ if (typeof metadata.metadata !== "object" || Array.isArray(metadata.metadata)) {
3842
+ warnings.push({
3843
+ field: "metadata",
3844
+ message: 'Field "metadata" must be an object'
3845
+ });
3846
+ } else {
3847
+ partialMetadata.metadata = metadata.metadata;
3848
+ }
3849
+ }
3850
+ return { metadata: partialMetadata, warnings };
3851
+ }
3852
+ function parseSkillMarkdownGraceful(content2) {
3853
+ try {
3854
+ const { frontmatter, body } = extractFrontmatter(content2);
3855
+ let rawMetadata;
3856
+ try {
3857
+ rawMetadata = parseYamlFrontmatter(frontmatter);
3858
+ } catch (error) {
3859
+ return {
3860
+ metadata: {},
3861
+ body,
3862
+ raw: content2,
3863
+ warnings: [{
3864
+ field: "frontmatter",
3865
+ message: `Failed to parse YAML frontmatter: ${error instanceof Error ? error.message : String(error)}`
3866
+ }]
3867
+ };
3868
+ }
3869
+ const { metadata, warnings } = parseSkillMetadataGraceful(rawMetadata);
3870
+ return {
3871
+ metadata,
3872
+ body,
3873
+ raw: content2,
3874
+ warnings
3875
+ };
3876
+ } catch (error) {
3877
+ return {
3878
+ metadata: {},
3879
+ body: content2,
3880
+ raw: content2,
3881
+ warnings: [{
3882
+ field: "structure",
3883
+ message: error instanceof Error ? error.message : "Failed to parse SKILL.md structure"
3884
+ }]
3885
+ };
3886
+ }
3887
+ }
3575
3888
  const VOID = -1;
3576
3889
  const PRIMITIVE = 0;
3577
3890
  const ARRAY = 1;
@@ -43102,152 +43415,6 @@ function transformImageUrl(src, repositoryInfo) {
43102
43415
  const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${fullPath}`;
43103
43416
  return rawUrl;
43104
43417
  }
43105
- class SkillParseError extends Error {
43106
- constructor(message, cause) {
43107
- super(message);
43108
- __publicField(this, "cause");
43109
- this.cause = cause;
43110
- this.name = "SkillParseError";
43111
- }
43112
- }
43113
- class SkillValidationError extends Error {
43114
- constructor(message, field) {
43115
- super(message);
43116
- __publicField(this, "field");
43117
- this.field = field;
43118
- this.name = "SkillValidationError";
43119
- }
43120
- }
43121
- function extractFrontmatter(content2) {
43122
- const trimmed = content2.trim();
43123
- if (!trimmed.startsWith("---")) {
43124
- throw new SkillParseError("SKILL.md must start with YAML frontmatter (---)");
43125
- }
43126
- const afterFirstDelimiter = trimmed.slice(3);
43127
- const closingIndex = afterFirstDelimiter.indexOf(`
43128
- ---`);
43129
- if (closingIndex === -1) {
43130
- throw new SkillParseError("SKILL.md frontmatter is not properly closed with ---");
43131
- }
43132
- const frontmatter = afterFirstDelimiter.slice(0, closingIndex).trim();
43133
- const body = afterFirstDelimiter.slice(closingIndex + 4).trim();
43134
- return { frontmatter, body };
43135
- }
43136
- function parseYamlFrontmatter(yaml2) {
43137
- const result = {};
43138
- const lines = yaml2.split(`
43139
- `);
43140
- let currentObject = null;
43141
- let currentList = null;
43142
- for (let i = 0; i < lines.length; i++) {
43143
- const line = lines[i];
43144
- const trimmed = line.trim();
43145
- if (!trimmed || trimmed.startsWith("#")) {
43146
- continue;
43147
- }
43148
- const lineIndent = line.search(/\S/);
43149
- if (trimmed.startsWith("- ")) {
43150
- const value = trimmed.slice(2).trim();
43151
- if (currentList) {
43152
- currentList.push(value);
43153
- }
43154
- continue;
43155
- }
43156
- const colonIndex = line.indexOf(":");
43157
- if (colonIndex > 0) {
43158
- const key = line.slice(0, colonIndex).trim();
43159
- const value = line.slice(colonIndex + 1).trim();
43160
- if (lineIndent === 0) {
43161
- currentList = null;
43162
- currentObject = null;
43163
- if (!value) {
43164
- if (i + 1 < lines.length) {
43165
- const nextLine = lines[i + 1];
43166
- const nextTrimmed = nextLine.trim();
43167
- if (nextTrimmed.startsWith("- ")) {
43168
- currentList = [];
43169
- result[key] = currentList;
43170
- } else if (nextLine.search(/\S/) > 0 && nextLine.includes(":")) {
43171
- currentObject = {};
43172
- result[key] = currentObject;
43173
- }
43174
- }
43175
- } else {
43176
- const cleanValue = value.replace(/^["']|["']$/g, "");
43177
- result[key] = cleanValue;
43178
- }
43179
- } else if (lineIndent > 0 && currentObject) {
43180
- const cleanValue = value.replace(/^["']|["']$/g, "");
43181
- currentObject[key] = cleanValue;
43182
- }
43183
- }
43184
- }
43185
- return result;
43186
- }
43187
- function validateSkillMetadata(metadata) {
43188
- if (!metadata.name || typeof metadata.name !== "string" || !metadata.name.trim()) {
43189
- throw new SkillValidationError('Required field "name" is missing or empty', "name");
43190
- }
43191
- if (!metadata.description || typeof metadata.description !== "string" || !metadata.description.trim()) {
43192
- throw new SkillValidationError('Required field "description" is missing or empty', "description");
43193
- }
43194
- if (metadata.license !== void 0 && typeof metadata.license !== "string") {
43195
- throw new SkillValidationError('Field "license" must be a string', "license");
43196
- }
43197
- if (metadata.compatibility !== void 0 && typeof metadata.compatibility !== "string") {
43198
- throw new SkillValidationError('Field "compatibility" must be a string', "compatibility");
43199
- }
43200
- if (metadata["allowed-tools"] !== void 0) {
43201
- if (typeof metadata["allowed-tools"] === "string") {
43202
- const toolsString = metadata["allowed-tools"];
43203
- metadata["allowed-tools"] = toolsString.trim() ? toolsString.trim().split(/\s+/) : [];
43204
- } else {
43205
- throw new SkillValidationError('Field "allowed-tools" must be a space-delimited string', "allowed-tools");
43206
- }
43207
- }
43208
- if (metadata.metadata !== void 0 && (typeof metadata.metadata !== "object" || Array.isArray(metadata.metadata))) {
43209
- throw new SkillValidationError('Field "metadata" must be an object', "metadata");
43210
- }
43211
- const skillMetadata = {
43212
- name: metadata.name,
43213
- description: metadata.description
43214
- };
43215
- if (metadata.license !== void 0) {
43216
- skillMetadata.license = metadata.license;
43217
- }
43218
- if (metadata.compatibility !== void 0) {
43219
- skillMetadata.compatibility = metadata.compatibility;
43220
- }
43221
- if (metadata["allowed-tools"] !== void 0) {
43222
- skillMetadata["allowed-tools"] = metadata["allowed-tools"];
43223
- }
43224
- if (metadata.metadata !== void 0) {
43225
- skillMetadata.metadata = metadata.metadata;
43226
- }
43227
- return skillMetadata;
43228
- }
43229
- function parseSkillMarkdown(content2) {
43230
- try {
43231
- const { frontmatter, body } = extractFrontmatter(content2);
43232
- let rawMetadata;
43233
- try {
43234
- rawMetadata = parseYamlFrontmatter(frontmatter);
43235
- } catch (error) {
43236
- throw new SkillParseError("Failed to parse YAML frontmatter", error);
43237
- }
43238
- const metadata = validateSkillMetadata(rawMetadata);
43239
- return {
43240
- metadata,
43241
- body,
43242
- raw: content2
43243
- };
43244
- } catch (error) {
43245
- if (error instanceof SkillParseError || error instanceof SkillValidationError) {
43246
- throw error;
43247
- }
43248
- throw new SkillParseError("Failed to parse SKILL.md", error);
43249
- }
43250
- }
43251
43418
  var parseMarkdownChunks2 = parseMarkdownChunks;
43252
43419
  var useIndustryHtmlModal = () => {
43253
43420
  const [htmlModalOpen, setHtmlModalOpen] = useState(false);
@@ -47684,18 +47851,334 @@ var DocumentView = ({
47684
47851
  editable
47685
47852
  })));
47686
47853
  };
47687
- var formatRelativeTime = (dateString) => {
47854
+ function extractHeaders(markdown2) {
47855
+ const headerRegex = /^(#{1,6})\s+(.+)$/gm;
47856
+ const headers = [];
47857
+ let match;
47858
+ while ((match = headerRegex.exec(markdown2)) !== null) {
47859
+ const level = match[1].length;
47860
+ const text2 = match[2].trim();
47861
+ const id = text2.toLowerCase().replace(/\s+/g, "-").replace(/[^\w-]/g, "");
47862
+ headers.push({ level, text: text2, id });
47863
+ }
47864
+ return headers;
47865
+ }
47866
+ const TableOfContents = ({
47867
+ headers,
47868
+ theme: theme2,
47869
+ className = "",
47870
+ onHeaderClick
47871
+ }) => {
47872
+ const [activeId, setActiveId] = React2__default.useState(null);
47873
+ const handleClick = (header) => {
47874
+ setActiveId(header.id);
47875
+ onHeaderClick == null ? void 0 : onHeaderClick(header);
47876
+ const element2 = document.getElementById(header.id);
47877
+ if (element2) {
47878
+ element2.scrollIntoView({ behavior: "smooth", block: "start" });
47879
+ }
47880
+ };
47881
+ if (headers.length === 0) {
47882
+ return null;
47883
+ }
47884
+ return /* @__PURE__ */ jsx(
47885
+ "nav",
47886
+ {
47887
+ className,
47888
+ style: {
47889
+ flex: 1,
47890
+ overflowY: "auto",
47891
+ minHeight: 0,
47892
+ padding: theme2.space[3]
47893
+ },
47894
+ children: /* @__PURE__ */ jsx(
47895
+ "ul",
47896
+ {
47897
+ style: {
47898
+ listStyle: "none",
47899
+ margin: 0,
47900
+ padding: 0
47901
+ },
47902
+ children: headers.map((header, index2) => {
47903
+ const isActive = activeId === header.id;
47904
+ const indentLevel = Math.max(0, header.level - 1);
47905
+ return /* @__PURE__ */ jsx(
47906
+ "li",
47907
+ {
47908
+ style: {
47909
+ marginBottom: theme2.space[1],
47910
+ marginLeft: `${indentLevel * 20}px`
47911
+ },
47912
+ children: /* @__PURE__ */ jsx(
47913
+ "button",
47914
+ {
47915
+ onClick: () => handleClick(header),
47916
+ style: {
47917
+ display: "block",
47918
+ width: "100%",
47919
+ textAlign: "left",
47920
+ background: "none",
47921
+ border: "none",
47922
+ padding: `${theme2.space[1]} ${theme2.space[2]}`,
47923
+ fontSize: header.level === 1 ? theme2.fontSizes[2] : header.level === 2 ? theme2.fontSizes[1] : theme2.fontSizes[0],
47924
+ fontFamily: theme2.fonts.body,
47925
+ color: isActive ? theme2.colors.primary : theme2.colors.text,
47926
+ cursor: "pointer",
47927
+ borderRadius: "4px",
47928
+ transition: "all 0.2s",
47929
+ fontWeight: isActive ? 600 : header.level === 1 ? 600 : header.level === 2 ? 500 : 400,
47930
+ backgroundColor: isActive ? `${theme2.colors.primary}15` : "transparent",
47931
+ borderLeft: isActive ? `2px solid ${theme2.colors.primary}` : "2px solid transparent",
47932
+ opacity: header.level > 3 ? 0.8 : 1
47933
+ },
47934
+ onMouseEnter: (e) => {
47935
+ if (!isActive) {
47936
+ e.currentTarget.style.backgroundColor = `${theme2.colors.border}50`;
47937
+ }
47938
+ },
47939
+ onMouseLeave: (e) => {
47940
+ if (!isActive) {
47941
+ e.currentTarget.style.backgroundColor = "transparent";
47942
+ }
47943
+ },
47944
+ children: header.text
47945
+ }
47946
+ )
47947
+ },
47948
+ `${header.id}-${index2}`
47949
+ );
47950
+ })
47951
+ }
47952
+ )
47953
+ }
47954
+ );
47955
+ };
47956
+ const SkillSidebar = ({
47957
+ headers,
47958
+ metadata,
47959
+ theme: theme2,
47960
+ className = "",
47961
+ onHeaderClick
47962
+ }) => {
47963
+ const [activeTab, setActiveTab] = React2__default.useState("toc");
47964
+ const hasMetadata = metadata.compatibility || metadata["allowed-tools"] && metadata["allowed-tools"].length > 0 || metadata.metadata && Object.keys(metadata.metadata).length > 0;
47965
+ React2__default.useEffect(() => {
47966
+ if (headers.length === 0 && hasMetadata) {
47967
+ setActiveTab("metadata");
47968
+ }
47969
+ }, [headers.length, hasMetadata]);
47970
+ if (headers.length === 0 && !hasMetadata) {
47971
+ return null;
47972
+ }
47973
+ return /* @__PURE__ */ jsxs(
47974
+ "div",
47975
+ {
47976
+ className,
47977
+ style: {
47978
+ width: "250px",
47979
+ flexShrink: 0,
47980
+ display: "flex",
47981
+ flexDirection: "column",
47982
+ borderRight: `1px solid ${theme2.colors.border}`
47983
+ },
47984
+ children: [
47985
+ /* @__PURE__ */ jsxs(
47986
+ "div",
47987
+ {
47988
+ style: {
47989
+ display: "flex",
47990
+ borderBottom: `1px solid ${theme2.colors.border}`,
47991
+ backgroundColor: theme2.colors.background
47992
+ },
47993
+ children: [
47994
+ headers.length > 0 && /* @__PURE__ */ jsx(
47995
+ "button",
47996
+ {
47997
+ onClick: () => setActiveTab("toc"),
47998
+ style: {
47999
+ flex: 1,
48000
+ padding: theme2.space[2],
48001
+ background: activeTab === "toc" ? theme2.colors.background : "transparent",
48002
+ border: "none",
48003
+ borderBottom: activeTab === "toc" ? `2px solid ${theme2.colors.primary}` : "2px solid transparent",
48004
+ color: activeTab === "toc" ? theme2.colors.primary : theme2.colors.textSecondary,
48005
+ fontFamily: theme2.fonts.heading,
48006
+ fontSize: theme2.fontSizes[1],
48007
+ fontWeight: activeTab === "toc" ? 600 : 500,
48008
+ cursor: "pointer",
48009
+ transition: "all 0.2s"
48010
+ },
48011
+ onMouseEnter: (e) => {
48012
+ if (activeTab !== "toc") {
48013
+ e.currentTarget.style.color = theme2.colors.text;
48014
+ }
48015
+ },
48016
+ onMouseLeave: (e) => {
48017
+ if (activeTab !== "toc") {
48018
+ e.currentTarget.style.color = theme2.colors.textSecondary;
48019
+ }
48020
+ },
48021
+ children: "Contents"
48022
+ }
48023
+ ),
48024
+ hasMetadata && /* @__PURE__ */ jsx(
48025
+ "button",
48026
+ {
48027
+ onClick: () => setActiveTab("metadata"),
48028
+ style: {
48029
+ flex: 1,
48030
+ padding: theme2.space[2],
48031
+ background: activeTab === "metadata" ? theme2.colors.background : "transparent",
48032
+ border: "none",
48033
+ borderBottom: activeTab === "metadata" ? `2px solid ${theme2.colors.primary}` : "2px solid transparent",
48034
+ color: activeTab === "metadata" ? theme2.colors.primary : theme2.colors.textSecondary,
48035
+ fontFamily: theme2.fonts.heading,
48036
+ fontSize: theme2.fontSizes[1],
48037
+ fontWeight: activeTab === "metadata" ? 600 : 500,
48038
+ cursor: "pointer",
48039
+ transition: "all 0.2s"
48040
+ },
48041
+ onMouseEnter: (e) => {
48042
+ if (activeTab !== "metadata") {
48043
+ e.currentTarget.style.color = theme2.colors.text;
48044
+ }
48045
+ },
48046
+ onMouseLeave: (e) => {
48047
+ if (activeTab !== "metadata") {
48048
+ e.currentTarget.style.color = theme2.colors.textSecondary;
48049
+ }
48050
+ },
48051
+ children: "Metadata"
48052
+ }
48053
+ )
48054
+ ]
48055
+ }
48056
+ ),
48057
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
48058
+ activeTab === "toc" && headers.length > 0 && /* @__PURE__ */ jsx(
48059
+ TableOfContents,
48060
+ {
48061
+ headers,
48062
+ theme: theme2,
48063
+ onHeaderClick
48064
+ }
48065
+ ),
48066
+ activeTab === "metadata" && hasMetadata && /* @__PURE__ */ jsxs("div", { style: { padding: theme2.space[3] }, children: [
48067
+ metadata.compatibility && /* @__PURE__ */ jsxs("div", { style: { marginBottom: theme2.space[3] }, children: [
48068
+ /* @__PURE__ */ jsx(
48069
+ "div",
48070
+ {
48071
+ style: {
48072
+ fontFamily: theme2.fonts.heading,
48073
+ fontWeight: 600,
48074
+ fontSize: theme2.fontSizes[0],
48075
+ textTransform: "uppercase",
48076
+ letterSpacing: "0.5px",
48077
+ color: theme2.colors.textSecondary,
48078
+ marginBottom: theme2.space[1]
48079
+ },
48080
+ children: "Compatibility"
48081
+ }
48082
+ ),
48083
+ /* @__PURE__ */ jsx("div", { style: { fontSize: theme2.fontSizes[1], color: theme2.colors.text, fontFamily: theme2.fonts.body }, children: metadata.compatibility })
48084
+ ] }),
48085
+ metadata["allowed-tools"] && metadata["allowed-tools"].length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: theme2.space[3] }, children: [
48086
+ /* @__PURE__ */ jsx(
48087
+ "div",
48088
+ {
48089
+ style: {
48090
+ fontFamily: theme2.fonts.heading,
48091
+ fontWeight: 600,
48092
+ fontSize: theme2.fontSizes[0],
48093
+ textTransform: "uppercase",
48094
+ letterSpacing: "0.5px",
48095
+ color: theme2.colors.textSecondary,
48096
+ marginBottom: theme2.space[1]
48097
+ },
48098
+ children: "Allowed Tools"
48099
+ }
48100
+ ),
48101
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: theme2.space[1] }, children: metadata["allowed-tools"].map((tool, index2) => /* @__PURE__ */ jsx(
48102
+ "span",
48103
+ {
48104
+ style: {
48105
+ display: "inline-block",
48106
+ paddingTop: theme2.space[2],
48107
+ paddingBottom: theme2.space[2],
48108
+ paddingLeft: theme2.space[3],
48109
+ paddingRight: theme2.space[3],
48110
+ background: theme2.colors.primary,
48111
+ color: theme2.colors.background,
48112
+ borderRadius: "4px",
48113
+ fontSize: theme2.fontSizes[0],
48114
+ fontWeight: 500,
48115
+ fontFamily: theme2.fonts.monospace
48116
+ },
48117
+ children: tool
48118
+ },
48119
+ index2
48120
+ )) })
48121
+ ] }),
48122
+ metadata.metadata && Object.keys(metadata.metadata).length > 0 && /* @__PURE__ */ jsxs("div", { children: [
48123
+ /* @__PURE__ */ jsx(
48124
+ "div",
48125
+ {
48126
+ style: {
48127
+ fontFamily: theme2.fonts.heading,
48128
+ fontWeight: 600,
48129
+ fontSize: theme2.fontSizes[0],
48130
+ textTransform: "uppercase",
48131
+ letterSpacing: "0.5px",
48132
+ color: theme2.colors.textSecondary,
48133
+ marginBottom: theme2.space[1]
48134
+ },
48135
+ children: "Metadata"
48136
+ }
48137
+ ),
48138
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: theme2.space[1] }, children: Object.entries(metadata.metadata).filter(([key]) => key !== "last-updated").map(([key, value]) => /* @__PURE__ */ jsxs("div", { children: [
48139
+ /* @__PURE__ */ jsxs(
48140
+ "div",
48141
+ {
48142
+ style: {
48143
+ fontSize: theme2.fontSizes[0],
48144
+ fontWeight: 600,
48145
+ color: theme2.colors.textSecondary,
48146
+ fontFamily: theme2.fonts.body
48147
+ },
48148
+ children: [
48149
+ key,
48150
+ ":"
48151
+ ]
48152
+ }
48153
+ ),
48154
+ /* @__PURE__ */ jsx(
48155
+ "div",
48156
+ {
48157
+ style: {
48158
+ fontSize: theme2.fontSizes[1],
48159
+ color: theme2.colors.text,
48160
+ fontFamily: theme2.fonts.monospace
48161
+ },
48162
+ children: value
48163
+ }
48164
+ )
48165
+ ] }, key)) })
48166
+ ] })
48167
+ ] })
48168
+ ] })
48169
+ ]
48170
+ }
48171
+ );
48172
+ };
48173
+ const formatRelativeTime = (dateString) => {
47688
48174
  try {
47689
48175
  const date = new Date(dateString);
47690
48176
  const now = /* @__PURE__ */ new Date();
47691
48177
  const diffMs = now.getTime() - date.getTime();
47692
48178
  const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
47693
- if (diffDays === 0)
47694
- return "Today";
47695
- if (diffDays === 1)
47696
- return "Yesterday";
47697
- if (diffDays < 7)
47698
- return `${diffDays} days ago`;
48179
+ if (diffDays === 0) return "Today";
48180
+ if (diffDays === 1) return "Yesterday";
48181
+ if (diffDays < 7) return `${diffDays} days ago`;
47699
48182
  if (diffDays < 30) {
47700
48183
  const weeks = Math.floor(diffDays / 7);
47701
48184
  return `${weeks} ${weeks === 1 ? "week" : "weeks"} ago`;
@@ -47710,267 +48193,526 @@ var formatRelativeTime = (dateString) => {
47710
48193
  return dateString;
47711
48194
  }
47712
48195
  };
47713
- var SkillMetadataSection = ({
48196
+ const getSourceConfig = (source2) => {
48197
+ switch (source2) {
48198
+ case "global-universal":
48199
+ return {
48200
+ label: "Global",
48201
+ icon: Globe,
48202
+ color: "#7c3aed",
48203
+ // purple
48204
+ bgColor: "#7c3aed15",
48205
+ borderColor: "#7c3aed30"
48206
+ };
48207
+ case "global-claude":
48208
+ return {
48209
+ label: "Global Claude",
48210
+ icon: Globe,
48211
+ color: "#0891b2",
48212
+ // cyan
48213
+ bgColor: "#0891b215",
48214
+ borderColor: "#0891b230"
48215
+ };
48216
+ case "project-universal":
48217
+ return {
48218
+ label: "Project",
48219
+ icon: Folder,
48220
+ color: "#16a34a",
48221
+ // green
48222
+ bgColor: "#16a34a15",
48223
+ borderColor: "#16a34a30"
48224
+ };
48225
+ case "project-claude":
48226
+ return {
48227
+ label: "Project Claude",
48228
+ icon: Folder,
48229
+ color: "#0284c7",
48230
+ // blue
48231
+ bgColor: "#0284c715",
48232
+ borderColor: "#0284c730"
48233
+ };
48234
+ case "project-other":
48235
+ return {
48236
+ label: "Project",
48237
+ icon: Folder,
48238
+ color: "#64748b",
48239
+ // slate
48240
+ bgColor: "#64748b15",
48241
+ borderColor: "#64748b30"
48242
+ };
48243
+ }
48244
+ };
48245
+ const SkillMetadataSection = ({
47714
48246
  metadata,
47715
- theme: theme2
48247
+ theme: theme2,
48248
+ structure,
48249
+ skill
47716
48250
  }) => {
47717
- var _a, _b;
47718
- return /* @__PURE__ */ React2__default.createElement("div", {
47719
- style: {
47720
- borderBottom: `2px solid ${theme2.colors.border}`,
47721
- paddingBottom: theme2.space[3],
47722
- marginBottom: theme2.space[2]
47723
- }
47724
- }, /* @__PURE__ */ React2__default.createElement("div", {
47725
- style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: theme2.space[2] }
47726
- }, /* @__PURE__ */ React2__default.createElement("h1", {
47727
- style: {
47728
- fontSize: theme2.fontSizes[6],
47729
- fontWeight: 700,
47730
- margin: 0,
47731
- color: theme2.colors.text
47732
- }
47733
- }, metadata.name), (((_a = metadata.metadata) == null ? void 0 : _a["last-updated"]) || metadata.license) && /* @__PURE__ */ React2__default.createElement("div", {
47734
- style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: theme2.space[1], marginLeft: theme2.space[3], marginTop: theme2.space[1] }
47735
- }, ((_b = metadata.metadata) == null ? void 0 : _b["last-updated"]) && /* @__PURE__ */ React2__default.createElement("span", {
47736
- style: {
47737
- fontSize: theme2.fontSizes[0],
47738
- color: theme2.colors.textSecondary,
47739
- fontFamily: theme2.fonts.monospace,
47740
- fontWeight: 500,
47741
- whiteSpace: "nowrap"
47742
- }
47743
- }, formatRelativeTime(metadata.metadata["last-updated"])), metadata.license && /* @__PURE__ */ React2__default.createElement("span", {
47744
- style: {
47745
- fontSize: theme2.fontSizes[1],
47746
- color: theme2.colors.textSecondary,
47747
- fontFamily: theme2.fonts.monospace,
47748
- fontWeight: 500,
47749
- whiteSpace: "nowrap"
47750
- }
47751
- }, metadata.license))), /* @__PURE__ */ React2__default.createElement("p", {
47752
- style: {
47753
- fontSize: theme2.fontSizes[3],
47754
- color: theme2.colors.textSecondary,
47755
- margin: 0,
47756
- lineHeight: 1.5
47757
- }
47758
- }, metadata.description));
48251
+ var _a, _b, _c, _d, _e2;
48252
+ const [expandedSections, setExpandedSections] = React2__default.useState({
48253
+ scripts: false,
48254
+ references: false,
48255
+ assets: false
48256
+ });
48257
+ const toggleSection = (section) => {
48258
+ setExpandedSections((prev) => ({
48259
+ ...prev,
48260
+ [section]: !prev[section]
48261
+ }));
48262
+ };
48263
+ return /* @__PURE__ */ jsxs("div", { style: {
48264
+ borderBottom: `2px solid ${theme2.colors.border}`,
48265
+ paddingBottom: theme2.space[3],
48266
+ marginBottom: theme2.space[2]
48267
+ }, children: [
48268
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: theme2.space[2] }, children: [
48269
+ /* @__PURE__ */ jsx(
48270
+ "h1",
48271
+ {
48272
+ style: {
48273
+ fontSize: theme2.fontSizes[6],
48274
+ fontWeight: 700,
48275
+ margin: 0,
48276
+ color: metadata.name ? theme2.colors.text : theme2.colors.textSecondary,
48277
+ fontFamily: theme2.fonts.heading
48278
+ },
48279
+ children: metadata.name || "(Unnamed Skill)"
48280
+ }
48281
+ ),
48282
+ (((_a = metadata.metadata) == null ? void 0 : _a["last-updated"]) || metadata.license) && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: theme2.space[1], marginLeft: theme2.space[3], marginTop: theme2.space[1] }, children: [
48283
+ ((_b = metadata.metadata) == null ? void 0 : _b["last-updated"]) && /* @__PURE__ */ jsx(
48284
+ "span",
48285
+ {
48286
+ style: {
48287
+ fontSize: theme2.fontSizes[0],
48288
+ color: theme2.colors.textSecondary,
48289
+ fontFamily: theme2.fonts.monospace,
48290
+ fontWeight: 500,
48291
+ whiteSpace: "nowrap"
48292
+ },
48293
+ children: formatRelativeTime(metadata.metadata["last-updated"])
48294
+ }
48295
+ ),
48296
+ metadata.license && /* @__PURE__ */ jsx(
48297
+ "span",
48298
+ {
48299
+ style: {
48300
+ fontSize: theme2.fontSizes[1],
48301
+ color: theme2.colors.textSecondary,
48302
+ fontFamily: theme2.fonts.monospace,
48303
+ fontWeight: 500,
48304
+ whiteSpace: "nowrap"
48305
+ },
48306
+ children: metadata.license
48307
+ }
48308
+ )
48309
+ ] })
48310
+ ] }),
48311
+ metadata.description ? /* @__PURE__ */ jsx(
48312
+ "p",
48313
+ {
48314
+ style: {
48315
+ fontSize: theme2.fontSizes[3],
48316
+ color: theme2.colors.textSecondary,
48317
+ margin: 0,
48318
+ lineHeight: 1.5,
48319
+ fontFamily: theme2.fonts.body
48320
+ },
48321
+ children: metadata.description
48322
+ }
48323
+ ) : /* @__PURE__ */ jsx(
48324
+ "p",
48325
+ {
48326
+ style: {
48327
+ fontSize: theme2.fontSizes[3],
48328
+ color: theme2.colors.textSecondary,
48329
+ margin: 0,
48330
+ lineHeight: 1.5,
48331
+ fontFamily: theme2.fonts.body,
48332
+ fontStyle: "italic"
48333
+ },
48334
+ children: "(No description provided)"
48335
+ }
48336
+ ),
48337
+ structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) && /* @__PURE__ */ jsxs("div", { style: {
48338
+ marginTop: theme2.space[3]
48339
+ }, children: [
48340
+ /* @__PURE__ */ jsxs("div", { style: {
48341
+ display: "flex",
48342
+ gap: theme2.space[2],
48343
+ flexWrap: "wrap"
48344
+ }, children: [
48345
+ structure.hasScripts && /* @__PURE__ */ jsxs(
48346
+ "button",
48347
+ {
48348
+ onClick: () => toggleSection("scripts"),
48349
+ style: {
48350
+ padding: "0.25rem 0.75rem",
48351
+ borderRadius: "12px",
48352
+ backgroundColor: theme2.colors.primary,
48353
+ color: theme2.colors.background,
48354
+ fontSize: theme2.fontSizes[0],
48355
+ fontFamily: theme2.fonts.body,
48356
+ fontWeight: 500,
48357
+ display: "flex",
48358
+ alignItems: "center",
48359
+ gap: "0.5rem",
48360
+ border: "none",
48361
+ cursor: "pointer",
48362
+ transition: "opacity 0.2s"
48363
+ },
48364
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48365
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48366
+ children: [
48367
+ /* @__PURE__ */ jsx(Code, { size: 14 }),
48368
+ /* @__PURE__ */ jsxs("span", { children: [
48369
+ "Scripts (",
48370
+ ((_c = structure.scriptFiles) == null ? void 0 : _c.length) || 0,
48371
+ ")"
48372
+ ] }),
48373
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.scripts ? "▼" : "▶" })
48374
+ ]
48375
+ }
48376
+ ),
48377
+ structure.hasReferences && /* @__PURE__ */ jsxs(
48378
+ "button",
48379
+ {
48380
+ onClick: () => toggleSection("references"),
48381
+ style: {
48382
+ padding: "0.25rem 0.75rem",
48383
+ borderRadius: "12px",
48384
+ backgroundColor: theme2.colors.secondary,
48385
+ color: theme2.colors.background,
48386
+ fontSize: theme2.fontSizes[0],
48387
+ fontFamily: theme2.fonts.body,
48388
+ fontWeight: 500,
48389
+ display: "flex",
48390
+ alignItems: "center",
48391
+ gap: "0.5rem",
48392
+ border: "none",
48393
+ cursor: "pointer",
48394
+ transition: "opacity 0.2s"
48395
+ },
48396
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48397
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48398
+ children: [
48399
+ /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
48400
+ /* @__PURE__ */ jsxs("span", { children: [
48401
+ "References (",
48402
+ ((_d = structure.referenceFiles) == null ? void 0 : _d.length) || 0,
48403
+ ")"
48404
+ ] }),
48405
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.references ? "▼" : "▶" })
48406
+ ]
48407
+ }
48408
+ ),
48409
+ structure.hasAssets && /* @__PURE__ */ jsxs(
48410
+ "button",
48411
+ {
48412
+ onClick: () => toggleSection("assets"),
48413
+ style: {
48414
+ padding: "0.25rem 0.75rem",
48415
+ borderRadius: "12px",
48416
+ backgroundColor: theme2.colors.accent,
48417
+ color: theme2.colors.background,
48418
+ fontSize: theme2.fontSizes[0],
48419
+ fontFamily: theme2.fonts.body,
48420
+ fontWeight: 500,
48421
+ display: "flex",
48422
+ alignItems: "center",
48423
+ gap: "0.5rem",
48424
+ border: "none",
48425
+ cursor: "pointer",
48426
+ transition: "opacity 0.2s"
48427
+ },
48428
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48429
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48430
+ children: [
48431
+ /* @__PURE__ */ jsx(Package, { size: 14 }),
48432
+ /* @__PURE__ */ jsxs("span", { children: [
48433
+ "Assets (",
48434
+ ((_e2 = structure.assetFiles) == null ? void 0 : _e2.length) || 0,
48435
+ ")"
48436
+ ] }),
48437
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.assets ? "▼" : "▶" })
48438
+ ]
48439
+ }
48440
+ )
48441
+ ] }),
48442
+ expandedSections.scripts && structure.scriptFiles && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48443
+ marginTop: theme2.space[2],
48444
+ padding: theme2.space[2],
48445
+ backgroundColor: `${theme2.colors.primary}15`,
48446
+ borderRadius: "8px",
48447
+ borderLeft: `3px solid ${theme2.colors.primary}`
48448
+ }, children: [
48449
+ /* @__PURE__ */ jsx("div", { style: {
48450
+ fontSize: theme2.fontSizes[0],
48451
+ fontWeight: 600,
48452
+ color: theme2.colors.text,
48453
+ marginBottom: theme2.space[1],
48454
+ fontFamily: theme2.fonts.heading
48455
+ }, children: "Script Files" }),
48456
+ /* @__PURE__ */ jsx("ul", { style: {
48457
+ margin: 0,
48458
+ paddingLeft: theme2.space[3],
48459
+ listStyle: "none"
48460
+ }, children: structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48461
+ fontSize: theme2.fontSizes[1],
48462
+ color: theme2.colors.text,
48463
+ fontFamily: theme2.fonts.monospace,
48464
+ padding: "2px 0"
48465
+ }, children: [
48466
+ "• ",
48467
+ file
48468
+ ] }, idx)) })
48469
+ ] }),
48470
+ expandedSections.references && structure.referenceFiles && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48471
+ marginTop: theme2.space[2],
48472
+ padding: theme2.space[2],
48473
+ backgroundColor: `${theme2.colors.secondary}15`,
48474
+ borderRadius: "8px",
48475
+ borderLeft: `3px solid ${theme2.colors.secondary}`
48476
+ }, children: [
48477
+ /* @__PURE__ */ jsx("div", { style: {
48478
+ fontSize: theme2.fontSizes[0],
48479
+ fontWeight: 600,
48480
+ color: theme2.colors.text,
48481
+ marginBottom: theme2.space[1],
48482
+ fontFamily: theme2.fonts.heading
48483
+ }, children: "Reference Files" }),
48484
+ /* @__PURE__ */ jsx("ul", { style: {
48485
+ margin: 0,
48486
+ paddingLeft: theme2.space[3],
48487
+ listStyle: "none"
48488
+ }, children: structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48489
+ fontSize: theme2.fontSizes[1],
48490
+ color: theme2.colors.text,
48491
+ fontFamily: theme2.fonts.monospace,
48492
+ padding: "2px 0"
48493
+ }, children: [
48494
+ "• ",
48495
+ file
48496
+ ] }, idx)) })
48497
+ ] }),
48498
+ expandedSections.assets && structure.assetFiles && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48499
+ marginTop: theme2.space[2],
48500
+ padding: theme2.space[2],
48501
+ backgroundColor: `${theme2.colors.accent}15`,
48502
+ borderRadius: "8px",
48503
+ borderLeft: `3px solid ${theme2.colors.accent}`
48504
+ }, children: [
48505
+ /* @__PURE__ */ jsx("div", { style: {
48506
+ fontSize: theme2.fontSizes[0],
48507
+ fontWeight: 600,
48508
+ color: theme2.colors.text,
48509
+ marginBottom: theme2.space[1],
48510
+ fontFamily: theme2.fonts.heading
48511
+ }, children: "Asset Files" }),
48512
+ /* @__PURE__ */ jsx("ul", { style: {
48513
+ margin: 0,
48514
+ paddingLeft: theme2.space[3],
48515
+ listStyle: "none"
48516
+ }, children: structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48517
+ fontSize: theme2.fontSizes[1],
48518
+ color: theme2.colors.text,
48519
+ fontFamily: theme2.fonts.monospace,
48520
+ padding: "2px 0"
48521
+ }, children: [
48522
+ "• ",
48523
+ file
48524
+ ] }, idx)) })
48525
+ ] })
48526
+ ] }),
48527
+ (skill == null ? void 0 : skill.installedLocations) && skill.installedLocations.length > 1 && /* @__PURE__ */ jsxs("div", { style: {
48528
+ marginTop: theme2.space[3],
48529
+ paddingTop: theme2.space[3],
48530
+ borderTop: `1px solid ${theme2.colors.border}`
48531
+ }, children: [
48532
+ /* @__PURE__ */ jsxs("div", { style: {
48533
+ fontSize: theme2.fontSizes[1],
48534
+ fontWeight: 600,
48535
+ color: theme2.colors.text,
48536
+ marginBottom: theme2.space[2],
48537
+ fontFamily: theme2.fonts.heading
48538
+ }, children: [
48539
+ "Installed Locations (",
48540
+ skill.installedLocations.length,
48541
+ ")"
48542
+ ] }),
48543
+ /* @__PURE__ */ jsx("div", { style: {
48544
+ display: "flex",
48545
+ flexDirection: "column",
48546
+ gap: theme2.space[2]
48547
+ }, children: skill.installedLocations.map((location2, idx) => {
48548
+ var _a2, _b2, _c2;
48549
+ const isPrimary = location2.path === skill.path;
48550
+ const sourceConfig = getSourceConfig(location2.source);
48551
+ return /* @__PURE__ */ jsxs(
48552
+ "div",
48553
+ {
48554
+ style: {
48555
+ padding: theme2.space[2],
48556
+ backgroundColor: isPrimary ? `${theme2.colors.primary}08` : theme2.colors.backgroundSecondary,
48557
+ borderRadius: "6px",
48558
+ border: `1px solid ${isPrimary ? theme2.colors.primary + "40" : theme2.colors.border}`,
48559
+ display: "flex",
48560
+ flexDirection: "column",
48561
+ gap: theme2.space[1]
48562
+ },
48563
+ children: [
48564
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: theme2.space[2] }, children: [
48565
+ /* @__PURE__ */ jsxs(
48566
+ "div",
48567
+ {
48568
+ style: {
48569
+ display: "inline-flex",
48570
+ alignItems: "center",
48571
+ gap: "4px",
48572
+ padding: "2px 6px",
48573
+ borderRadius: theme2.radii[1],
48574
+ backgroundColor: sourceConfig.bgColor,
48575
+ border: `1px solid ${sourceConfig.borderColor}`,
48576
+ fontSize: theme2.fontSizes[0],
48577
+ color: sourceConfig.color,
48578
+ fontWeight: 500
48579
+ },
48580
+ children: [
48581
+ /* @__PURE__ */ jsx(sourceConfig.icon, { size: 10 }),
48582
+ /* @__PURE__ */ jsx("span", { children: sourceConfig.label })
48583
+ ]
48584
+ }
48585
+ ),
48586
+ isPrimary && /* @__PURE__ */ jsx("span", { style: {
48587
+ fontSize: theme2.fontSizes[0],
48588
+ color: theme2.colors.primary,
48589
+ fontWeight: 600,
48590
+ fontFamily: theme2.fonts.body
48591
+ }, children: "(Active)" })
48592
+ ] }),
48593
+ /* @__PURE__ */ jsx("div", { style: {
48594
+ fontSize: theme2.fontSizes[0],
48595
+ color: theme2.colors.textSecondary,
48596
+ fontFamily: theme2.fonts.monospace,
48597
+ overflow: "hidden",
48598
+ textOverflow: "ellipsis",
48599
+ whiteSpace: "nowrap"
48600
+ }, children: location2.path }),
48601
+ ((_a2 = location2.metadata) == null ? void 0 : _a2.installedAt) && /* @__PURE__ */ jsxs("div", { style: {
48602
+ fontSize: theme2.fontSizes[0],
48603
+ color: theme2.colors.textMuted,
48604
+ fontFamily: theme2.fonts.body
48605
+ }, children: [
48606
+ "Installed: ",
48607
+ formatRelativeTime(location2.metadata.installedAt)
48608
+ ] }),
48609
+ ((_b2 = location2.metadata) == null ? void 0 : _b2.sha) && ((_c2 = skill.metadata) == null ? void 0 : _c2.sha) && location2.metadata.sha !== skill.metadata.sha && /* @__PURE__ */ jsxs("div", { style: {
48610
+ fontSize: theme2.fontSizes[0],
48611
+ color: "#f59e0b",
48612
+ // warning color
48613
+ fontFamily: theme2.fonts.monospace,
48614
+ display: "flex",
48615
+ alignItems: "center",
48616
+ gap: "4px"
48617
+ }, children: [
48618
+ /* @__PURE__ */ jsx(TriangleAlert, { size: 10 }),
48619
+ /* @__PURE__ */ jsxs("span", { children: [
48620
+ "Different version (SHA: ",
48621
+ location2.metadata.sha.substring(0, 7),
48622
+ ")"
48623
+ ] })
48624
+ ] })
48625
+ ]
48626
+ },
48627
+ idx
48628
+ );
48629
+ }) })
48630
+ ] })
48631
+ ] });
47759
48632
  };
47760
- var SkillMarkdown = ({
48633
+ const SkillMarkdown = ({
47761
48634
  content: content2,
47762
48635
  theme: theme2,
47763
48636
  className = "",
47764
48637
  onParsed,
47765
- onError,
47766
- showRawOnError = false
48638
+ onWarnings,
48639
+ showRawOnError = false,
48640
+ containerWidth,
48641
+ structure,
48642
+ skill
47767
48643
  }) => {
47768
48644
  const [parsed, setParsed] = React2__default.useState(null);
47769
- const [error, setError] = React2__default.useState(null);
48645
+ const [headers, setHeaders] = React2__default.useState([]);
47770
48646
  React2__default.useEffect(() => {
47771
- try {
47772
- const skill = parseSkillMarkdown(content2);
47773
- setParsed(skill);
47774
- setError(null);
47775
- onParsed == null ? void 0 : onParsed(skill);
47776
- } catch (err) {
47777
- const error2 = err instanceof Error ? err : new Error(String(err));
47778
- setError(error2);
47779
- setParsed(null);
47780
- onError == null ? void 0 : onError(error2);
47781
- }
47782
- }, [content2, onParsed, onError]);
48647
+ const skill2 = parseSkillMarkdownGraceful(content2);
48648
+ setParsed(skill2);
48649
+ onParsed == null ? void 0 : onParsed(skill2);
48650
+ if (skill2.warnings.length > 0) {
48651
+ onWarnings == null ? void 0 : onWarnings(skill2.warnings);
48652
+ }
48653
+ const extractedHeaders = extractHeaders(skill2.body);
48654
+ setHeaders(extractedHeaders);
48655
+ }, [content2, onParsed, onWarnings]);
47783
48656
  if (!theme2 || !theme2.space) {
47784
- return /* @__PURE__ */ React2__default.createElement("div", {
47785
- className,
47786
- style: { width: "100%", height: "100%" }
47787
- }, /* @__PURE__ */ React2__default.createElement("div", {
47788
- style: { padding: "2rem", textAlign: "center", color: "#856404" }
47789
- }, "Error: Theme not available. Wrap component in ThemeProvider."));
48657
+ return /* @__PURE__ */ jsx("div", { className, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { padding: "2rem", textAlign: "center", color: "#856404" }, children: "Error: Theme not available. Wrap component in ThemeProvider." }) });
47790
48658
  }
47791
- if (error) {
47792
- if (showRawOnError) {
47793
- return /* @__PURE__ */ React2__default.createElement("div", {
48659
+ if (!parsed) {
48660
+ return /* @__PURE__ */ jsx(
48661
+ "div",
48662
+ {
47794
48663
  className,
47795
48664
  style: {
48665
+ display: "flex",
48666
+ alignItems: "center",
48667
+ justifyContent: "center",
47796
48668
  width: "100%",
47797
48669
  height: "100%",
47798
- overflow: "auto",
48670
+ padding: theme2.space[4],
48671
+ color: theme2.colors.textSecondary,
48672
+ fontStyle: "italic",
47799
48673
  background: theme2.colors.background
47800
- }
47801
- }, /* @__PURE__ */ React2__default.createElement("div", {
47802
- style: { padding: theme2.space[3] }
47803
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47804
- content: content2,
47805
- theme: theme2,
47806
- slideIdPrefix: "skill-fallback",
47807
- slideIndex: 0,
47808
- isVisible: true
47809
- })));
47810
- }
47811
- return /* @__PURE__ */ React2__default.createElement("div", {
47812
- className,
47813
- style: {
47814
- display: "flex",
47815
- flexDirection: "column",
47816
- alignItems: "center",
47817
- justifyContent: "center",
47818
- width: "100%",
47819
- height: "100%",
47820
- padding: theme2.space[4],
47821
- background: theme2.colors.background,
47822
- overflow: "auto"
47823
- }
47824
- }, /* @__PURE__ */ React2__default.createElement("div", {
47825
- style: {
47826
- background: "#fff3cd",
47827
- border: "1px solid #ffc107",
47828
- borderRadius: "8px",
47829
- padding: theme2.space[4],
47830
- maxWidth: "600px"
47831
- }
47832
- }, /* @__PURE__ */ React2__default.createElement("h2", {
47833
- style: { color: "#856404", marginTop: 0 }
47834
- }, "Failed to parse SKILL.md"), /* @__PURE__ */ React2__default.createElement("p", {
47835
- style: {
47836
- fontWeight: 600,
47837
- color: "#856404",
47838
- fontSize: theme2.fontSizes[0],
47839
- textTransform: "uppercase",
47840
- letterSpacing: "0.5px"
47841
- }
47842
- }, error instanceof SkillParseError && "Parse Error", error instanceof SkillValidationError && "Validation Error", !(error instanceof SkillParseError) && !(error instanceof SkillValidationError) && "Error"), /* @__PURE__ */ React2__default.createElement("p", {
47843
- style: { color: "#856404", margin: `${theme2.space[3]} 0` }
47844
- }, error.message), error instanceof SkillValidationError && error.field && /* @__PURE__ */ React2__default.createElement("p", {
47845
- style: {
47846
- fontFamily: theme2.fonts.monospace,
47847
- color: "#856404",
47848
- fontSize: theme2.fontSizes[0]
48674
+ },
48675
+ children: "Loading..."
47849
48676
  }
47850
- }, "Field: ", error.field)));
48677
+ );
47851
48678
  }
47852
- if (!parsed) {
47853
- return /* @__PURE__ */ React2__default.createElement("div", {
48679
+ return /* @__PURE__ */ jsxs(
48680
+ "div",
48681
+ {
47854
48682
  className,
47855
48683
  style: {
47856
- display: "flex",
47857
- alignItems: "center",
47858
- justifyContent: "center",
47859
48684
  width: "100%",
47860
48685
  height: "100%",
47861
- padding: theme2.space[4],
47862
- color: theme2.colors.textSecondary,
47863
- fontStyle: "italic",
48686
+ display: "flex",
48687
+ flexDirection: "column",
47864
48688
  background: theme2.colors.background
47865
- }
47866
- }, "Loading...");
47867
- }
47868
- return /* @__PURE__ */ React2__default.createElement("div", {
47869
- className,
47870
- style: {
47871
- width: "100%",
47872
- height: "100%",
47873
- display: "flex",
47874
- flexDirection: "column",
47875
- background: theme2.colors.background
47876
- }
47877
- }, /* @__PURE__ */ React2__default.createElement("div", {
47878
- style: { padding: theme2.space[3], paddingBottom: 0 }
47879
- }, /* @__PURE__ */ React2__default.createElement(SkillMetadataSection, {
47880
- metadata: parsed.metadata,
47881
- theme: theme2
47882
- })), /* @__PURE__ */ React2__default.createElement("div", {
47883
- style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }
47884
- }, /* @__PURE__ */ React2__default.createElement("div", {
47885
- style: { display: "flex", gap: theme2.space[4], alignItems: "flex-start" }
47886
- }, /* @__PURE__ */ React2__default.createElement("div", {
47887
- style: { flex: 1, minWidth: 0 }
47888
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47889
- content: parsed.body,
47890
- theme: theme2,
47891
- slideIdPrefix: "skill-body",
47892
- slideIndex: 0,
47893
- isVisible: true
47894
- })), (parsed.metadata.compatibility || parsed.metadata["allowed-tools"] || parsed.metadata.metadata) && /* @__PURE__ */ React2__default.createElement("div", {
47895
- style: {
47896
- width: "300px",
47897
- flexShrink: 0,
47898
- padding: theme2.space[3],
47899
- background: theme2.colors.background,
47900
- position: "sticky",
47901
- top: theme2.space[3]
47902
- }
47903
- }, parsed.metadata.compatibility && /* @__PURE__ */ React2__default.createElement("div", {
47904
- style: { marginBottom: theme2.space[3] }
47905
- }, /* @__PURE__ */ React2__default.createElement("div", {
47906
- style: {
47907
- fontFamily: theme2.fonts.heading,
47908
- fontWeight: 600,
47909
- fontSize: theme2.fontSizes[0],
47910
- textTransform: "uppercase",
47911
- letterSpacing: "0.5px",
47912
- color: theme2.colors.textSecondary,
47913
- marginBottom: theme2.space[1]
47914
- }
47915
- }, "Compatibility"), /* @__PURE__ */ React2__default.createElement("div", {
47916
- style: { fontSize: theme2.fontSizes[1], color: theme2.colors.text, fontFamily: theme2.fonts.body }
47917
- }, parsed.metadata.compatibility)), parsed.metadata["allowed-tools"] && parsed.metadata["allowed-tools"].length > 0 && /* @__PURE__ */ React2__default.createElement("div", {
47918
- style: { marginBottom: theme2.space[3] }
47919
- }, /* @__PURE__ */ React2__default.createElement("div", {
47920
- style: {
47921
- fontFamily: theme2.fonts.heading,
47922
- fontWeight: 600,
47923
- fontSize: theme2.fontSizes[0],
47924
- textTransform: "uppercase",
47925
- letterSpacing: "0.5px",
47926
- color: theme2.colors.textSecondary,
47927
- marginBottom: theme2.space[1]
47928
- }
47929
- }, "Allowed Tools"), /* @__PURE__ */ React2__default.createElement("div", {
47930
- style: { display: "flex", flexWrap: "wrap", gap: theme2.space[1] }
47931
- }, parsed.metadata["allowed-tools"].map((tool, index2) => /* @__PURE__ */ React2__default.createElement("span", {
47932
- key: index2,
47933
- style: {
47934
- display: "inline-block",
47935
- paddingTop: theme2.space[2],
47936
- paddingBottom: theme2.space[2],
47937
- paddingLeft: theme2.space[3],
47938
- paddingRight: theme2.space[3],
47939
- background: theme2.colors.primary,
47940
- color: theme2.colors.background,
47941
- borderRadius: "4px",
47942
- fontSize: theme2.fontSizes[0],
47943
- fontWeight: 500,
47944
- fontFamily: theme2.fonts.monospace
47945
- }
47946
- }, tool)))), parsed.metadata.metadata && Object.keys(parsed.metadata.metadata).length > 0 && /* @__PURE__ */ React2__default.createElement("div", null, /* @__PURE__ */ React2__default.createElement("div", {
47947
- style: {
47948
- fontFamily: theme2.fonts.heading,
47949
- fontWeight: 600,
47950
- fontSize: theme2.fontSizes[0],
47951
- textTransform: "uppercase",
47952
- letterSpacing: "0.5px",
47953
- color: theme2.colors.textSecondary,
47954
- marginBottom: theme2.space[1]
47955
- }
47956
- }, "Metadata"), /* @__PURE__ */ React2__default.createElement("div", {
47957
- style: { display: "flex", flexDirection: "column", gap: theme2.space[1] }
47958
- }, Object.entries(parsed.metadata.metadata).filter(([key]) => key !== "last-updated").map(([key, value]) => /* @__PURE__ */ React2__default.createElement("div", {
47959
- key
47960
- }, /* @__PURE__ */ React2__default.createElement("div", {
47961
- style: {
47962
- fontSize: theme2.fontSizes[0],
47963
- fontWeight: 600,
47964
- color: theme2.colors.textSecondary,
47965
- fontFamily: theme2.fonts.body
47966
- }
47967
- }, key, ":"), /* @__PURE__ */ React2__default.createElement("div", {
47968
- style: {
47969
- fontSize: theme2.fontSizes[1],
47970
- color: theme2.colors.text,
47971
- fontFamily: theme2.fonts.monospace
48689
+ },
48690
+ children: [
48691
+ /* @__PURE__ */ jsx("div", { style: { padding: theme2.space[3], paddingBottom: 0 }, children: /* @__PURE__ */ jsx(SkillMetadataSection, { metadata: parsed.metadata, theme: theme2, structure, skill }) }),
48692
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
48693
+ /* @__PURE__ */ jsx(
48694
+ SkillSidebar,
48695
+ {
48696
+ headers,
48697
+ metadata: parsed.metadata,
48698
+ theme: theme2
48699
+ }
48700
+ ),
48701
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsx(
48702
+ IndustryMarkdownSlide,
48703
+ {
48704
+ content: parsed.body,
48705
+ theme: theme2,
48706
+ slideIdPrefix: "skill-body",
48707
+ slideIndex: 0,
48708
+ isVisible: true,
48709
+ containerWidth
48710
+ }
48711
+ ) })
48712
+ ] })
48713
+ ]
47972
48714
  }
47973
- }, value)))))))));
48715
+ );
47974
48716
  };
47975
48717
  const SkillDetailPanel = ({
47976
48718
  context,
@@ -47978,7 +48720,6 @@ const SkillDetailPanel = ({
47978
48720
  actions,
47979
48721
  selectedSkillId: selectedSkillIdProp
47980
48722
  }) => {
47981
- var _a, _b, _c, _d, _e2, _f;
47982
48723
  const { theme: theme2 } = useTheme();
47983
48724
  const { skills, isLoading, error } = useSkillsData({ context });
47984
48725
  const [selectedSkillIdState, setSelectedSkillIdState] = useState(null);
@@ -47989,8 +48730,8 @@ const SkillDetailPanel = ({
47989
48730
  "skill-detail",
47990
48731
  events,
47991
48732
  () => {
47992
- var _a2;
47993
- return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
48733
+ var _a;
48734
+ return (_a = panelRef.current) == null ? void 0 : _a.focus();
47994
48735
  }
47995
48736
  );
47996
48737
  useEffect(() => {
@@ -48089,12 +48830,14 @@ const SkillDetailPanel = ({
48089
48830
  );
48090
48831
  }
48091
48832
  const handleParsed = (parsedSkill) => {
48092
- console.log("Skill parsed:", parsedSkill.metadata.name);
48833
+ console.log("Skill parsed:", parsedSkill.metadata.name || "(unnamed)");
48834
+ if (parsedSkill.warnings.length > 0) {
48835
+ console.warn("Skill has warnings:", parsedSkill.warnings);
48836
+ }
48093
48837
  };
48094
- const handleError = (error2) => {
48095
- console.error("Error parsing skill:", error2);
48838
+ const handleWarnings = (warnings) => {
48839
+ console.warn("Skill validation warnings:", warnings);
48096
48840
  };
48097
- const hasStructure = skill.hasScripts || skill.hasReferences || skill.hasAssets;
48098
48841
  return /* @__PURE__ */ jsx(
48099
48842
  "div",
48100
48843
  {
@@ -48107,188 +48850,24 @@ const SkillDetailPanel = ({
48107
48850
  flexDirection: "column",
48108
48851
  outline: "none"
48109
48852
  },
48110
- children: skill.content ? /* @__PURE__ */ jsxs(Fragment, { children: [
48111
- hasStructure && /* @__PURE__ */ jsxs(
48112
- "div",
48113
- {
48114
- style: {
48115
- padding: "1rem",
48116
- borderBottom: `1px solid ${theme2.colors.border}`,
48117
- display: "flex",
48118
- gap: "0.5rem",
48119
- flexWrap: "wrap",
48120
- backgroundColor: theme2.colors.backgroundSecondary
48121
- },
48122
- children: [
48123
- /* @__PURE__ */ jsx(
48124
- "div",
48125
- {
48126
- style: {
48127
- fontSize: theme2.fontSizes[1],
48128
- color: theme2.colors.textSecondary,
48129
- fontFamily: theme2.fonts.body,
48130
- marginRight: "0.5rem",
48131
- display: "flex",
48132
- alignItems: "center"
48133
- },
48134
- children: "Available:"
48135
- }
48136
- ),
48137
- skill.hasScripts && /* @__PURE__ */ jsxs(
48138
- "div",
48139
- {
48140
- style: {
48141
- padding: "0.25rem 0.75rem",
48142
- borderRadius: "12px",
48143
- backgroundColor: theme2.colors.primary,
48144
- color: theme2.colors.background,
48145
- fontSize: theme2.fontSizes[0],
48146
- fontFamily: theme2.fonts.body,
48147
- fontWeight: 500,
48148
- display: "flex",
48149
- alignItems: "center",
48150
- gap: "0.5rem"
48151
- },
48152
- title: (_a = skill.scriptFiles) == null ? void 0 : _a.join(", "),
48153
- children: [
48154
- /* @__PURE__ */ jsx(Code, { size: 14 }),
48155
- /* @__PURE__ */ jsxs("span", { children: [
48156
- "Scripts (",
48157
- ((_b = skill.scriptFiles) == null ? void 0 : _b.length) || 0,
48158
- ")"
48159
- ] })
48160
- ]
48161
- }
48162
- ),
48163
- skill.hasReferences && /* @__PURE__ */ jsxs(
48164
- "div",
48165
- {
48166
- style: {
48167
- padding: "0.25rem 0.75rem",
48168
- borderRadius: "12px",
48169
- backgroundColor: theme2.colors.secondary,
48170
- color: theme2.colors.background,
48171
- fontSize: theme2.fontSizes[0],
48172
- fontFamily: theme2.fonts.body,
48173
- fontWeight: 500,
48174
- display: "flex",
48175
- alignItems: "center",
48176
- gap: "0.5rem"
48177
- },
48178
- title: (_c = skill.referenceFiles) == null ? void 0 : _c.join(", "),
48179
- children: [
48180
- /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
48181
- /* @__PURE__ */ jsxs("span", { children: [
48182
- "References (",
48183
- ((_d = skill.referenceFiles) == null ? void 0 : _d.length) || 0,
48184
- ")"
48185
- ] })
48186
- ]
48187
- }
48188
- ),
48189
- skill.hasAssets && /* @__PURE__ */ jsxs(
48190
- "div",
48191
- {
48192
- style: {
48193
- padding: "0.25rem 0.75rem",
48194
- borderRadius: "12px",
48195
- backgroundColor: theme2.colors.accent,
48196
- color: theme2.colors.background,
48197
- fontSize: theme2.fontSizes[0],
48198
- fontFamily: theme2.fonts.body,
48199
- fontWeight: 500,
48200
- display: "flex",
48201
- alignItems: "center",
48202
- gap: "0.5rem"
48203
- },
48204
- title: (_e2 = skill.assetFiles) == null ? void 0 : _e2.join(", "),
48205
- children: [
48206
- /* @__PURE__ */ jsx(Package, { size: 14 }),
48207
- /* @__PURE__ */ jsxs("span", { children: [
48208
- "Assets (",
48209
- ((_f = skill.assetFiles) == null ? void 0 : _f.length) || 0,
48210
- ")"
48211
- ] })
48212
- ]
48213
- }
48214
- )
48215
- ]
48216
- }
48217
- ),
48218
- !skill.frontmatterValidation.isValid && /* @__PURE__ */ jsxs(
48219
- "div",
48220
- {
48221
- style: {
48222
- padding: "1rem",
48223
- borderBottom: `1px solid ${theme2.colors.border}`,
48224
- display: "flex",
48225
- alignItems: "center",
48226
- gap: "0.75rem",
48227
- backgroundColor: "#f59e0b15",
48228
- // warning amber background
48229
- borderLeft: "4px solid #f59e0b"
48230
- },
48231
- children: [
48232
- /* @__PURE__ */ jsx(TriangleAlert, { size: 20, color: "#f59e0b" }),
48233
- /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
48234
- /* @__PURE__ */ jsx(
48235
- "div",
48236
- {
48237
- style: {
48238
- fontSize: theme2.fontSizes[1],
48239
- color: "#f59e0b",
48240
- fontFamily: theme2.fonts.body,
48241
- fontWeight: theme2.fontWeights.semibold,
48242
- marginBottom: "0.25rem"
48243
- },
48244
- children: "Invalid Skill Frontmatter"
48245
- }
48246
- ),
48247
- /* @__PURE__ */ jsxs(
48248
- "div",
48249
- {
48250
- style: {
48251
- fontSize: theme2.fontSizes[0],
48252
- color: theme2.colors.textSecondary,
48253
- fontFamily: theme2.fonts.body,
48254
- lineHeight: "1.5"
48255
- },
48256
- children: [
48257
- skill.frontmatterValidation.errorMessage || "This skill has invalid frontmatter metadata.",
48258
- skill.frontmatterValidation.missingFields.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginTop: "0.5rem" }, children: [
48259
- "Required fields: ",
48260
- /* @__PURE__ */ jsx("code", { style: {
48261
- padding: "2px 4px",
48262
- backgroundColor: "#f59e0b20",
48263
- borderRadius: "3px",
48264
- fontSize: theme2.fontSizes[0]
48265
- }, children: "name" }),
48266
- ", ",
48267
- /* @__PURE__ */ jsx("code", { style: {
48268
- padding: "2px 4px",
48269
- backgroundColor: "#f59e0b20",
48270
- borderRadius: "3px",
48271
- fontSize: theme2.fontSizes[0]
48272
- }, children: "description" })
48273
- ] })
48274
- ]
48275
- }
48276
- )
48277
- ] })
48278
- ]
48279
- }
48280
- ),
48281
- /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(
48282
- SkillMarkdown,
48283
- {
48284
- content: skill.content,
48285
- theme: theme2,
48286
- onParsed: handleParsed,
48287
- onError: handleError,
48288
- showRawOnError: true
48289
- }
48290
- ) })
48291
- ] }) : /* @__PURE__ */ jsx(
48853
+ children: skill.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(
48854
+ SkillMarkdown,
48855
+ {
48856
+ content: skill.content,
48857
+ theme: theme2,
48858
+ onParsed: handleParsed,
48859
+ onWarnings: handleWarnings,
48860
+ structure: {
48861
+ hasScripts: skill.hasScripts,
48862
+ hasReferences: skill.hasReferences,
48863
+ hasAssets: skill.hasAssets,
48864
+ scriptFiles: skill.scriptFiles,
48865
+ referenceFiles: skill.referenceFiles,
48866
+ assetFiles: skill.assetFiles
48867
+ },
48868
+ skill
48869
+ }
48870
+ ) }) }) : /* @__PURE__ */ jsx(
48292
48871
  "div",
48293
48872
  {
48294
48873
  style: {