@industry-theme/agent-panels 0.2.12 → 0.2.14

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.
@@ -2616,10 +2616,16 @@ const analyzeSkillStructure = (fileTree, skillPath) => {
2616
2616
  assetFiles
2617
2617
  };
2618
2618
  };
2619
- const hasFrontmatterYAML = (content2) => {
2619
+ const validateFrontmatter = (content2) => {
2620
2620
  const trimmedContent = content2.trim();
2621
2621
  if (!trimmedContent.startsWith("---")) {
2622
- return false;
2622
+ return {
2623
+ isValid: true,
2624
+ // Still valid, just has warnings
2625
+ hasStructure: false,
2626
+ missingFields: [],
2627
+ errorMessage: "Missing YAML frontmatter (must start with ---)"
2628
+ };
2623
2629
  }
2624
2630
  const lines = trimmedContent.split("\n");
2625
2631
  let frontmatterEnd = -1;
@@ -2629,7 +2635,38 @@ const hasFrontmatterYAML = (content2) => {
2629
2635
  break;
2630
2636
  }
2631
2637
  }
2632
- return frontmatterEnd > 0;
2638
+ if (frontmatterEnd <= 0) {
2639
+ return {
2640
+ isValid: true,
2641
+ // Still valid, just has warnings
2642
+ hasStructure: false,
2643
+ missingFields: [],
2644
+ errorMessage: "Missing closing --- delimiter for frontmatter"
2645
+ };
2646
+ }
2647
+ const frontmatterLines = lines.slice(1, frontmatterEnd);
2648
+ const frontmatterText = frontmatterLines.join("\n");
2649
+ const missingFields = [];
2650
+ const hasName = /^name:\s*.+/m.test(frontmatterText);
2651
+ const hasDescription = /^description:\s*.+/m.test(frontmatterText);
2652
+ if (!hasName) {
2653
+ missingFields.push("name");
2654
+ }
2655
+ if (!hasDescription) {
2656
+ missingFields.push("description");
2657
+ }
2658
+ let errorMessage;
2659
+ if (missingFields.length > 0) {
2660
+ const fieldList = missingFields.map((f) => `'${f}'`).join(", ");
2661
+ errorMessage = `Missing required field${missingFields.length > 1 ? "s" : ""}: ${fieldList}`;
2662
+ }
2663
+ return {
2664
+ isValid: true,
2665
+ // Always valid - we show warnings but don't block rendering
2666
+ hasStructure: true,
2667
+ missingFields,
2668
+ errorMessage
2669
+ };
2633
2670
  };
2634
2671
  const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, isBrowserMode = false) => {
2635
2672
  const pathParts = path2.split("/");
@@ -2670,7 +2707,7 @@ const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, i
2670
2707
  console.debug("[useSkillsData] No metadata file for skill:", skillDirName);
2671
2708
  }
2672
2709
  }
2673
- const hasFrontmatter = hasFrontmatterYAML(content2);
2710
+ const frontmatterValidation = validateFrontmatter(content2);
2674
2711
  return {
2675
2712
  id: path2,
2676
2713
  name: skillDirName.replace(/-/g, " ").replace(/_/g, " "),
@@ -2683,7 +2720,7 @@ const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, i
2683
2720
  source: source2,
2684
2721
  priority,
2685
2722
  metadata,
2686
- hasFrontmatter
2723
+ frontmatterValidation
2687
2724
  };
2688
2725
  };
2689
2726
  const useSkillsData = ({
@@ -2934,7 +2971,7 @@ Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).t
2934
2971
  ]
2935
2972
  }
2936
2973
  ),
2937
- !skill.hasFrontmatter && /* @__PURE__ */ jsxs(
2974
+ !skill.frontmatterValidation.isValid && /* @__PURE__ */ jsxs(
2938
2975
  "div",
2939
2976
  {
2940
2977
  style: {
@@ -2951,10 +2988,10 @@ Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).t
2951
2988
  fontWeight: 500,
2952
2989
  width: "fit-content"
2953
2990
  },
2954
- title: "This skill is missing YAML frontmatter metadata",
2991
+ title: skill.frontmatterValidation.errorMessage || "Invalid frontmatter",
2955
2992
  children: [
2956
2993
  /* @__PURE__ */ jsx(TriangleAlert, { size: 10 }),
2957
- /* @__PURE__ */ jsx("span", { children: "No Frontmatter" })
2994
+ /* @__PURE__ */ jsx("span", { children: skill.frontmatterValidation.hasStructure ? skill.frontmatterValidation.missingFields.length > 0 ? `Missing: ${skill.frontmatterValidation.missingFields.join(", ")}` : "Invalid Frontmatter" : "No Frontmatter" })
2958
2995
  ]
2959
2996
  }
2960
2997
  )
@@ -3538,6 +3575,188 @@ const SkillsListPanel = ({
3538
3575
  }
3539
3576
  );
3540
3577
  };
3578
+ var MarkdownSourceType$1;
3579
+ ((MarkdownSourceType2) => {
3580
+ MarkdownSourceType2["WORKSPACE_FILE"] = "workspace_file";
3581
+ MarkdownSourceType2["REMOTE_FILE"] = "remote_file";
3582
+ MarkdownSourceType2["GITHUB_FILE"] = "github_file";
3583
+ MarkdownSourceType2["DRAFT"] = "draft";
3584
+ MarkdownSourceType2["GITHUB_ISSUE"] = "github_issue";
3585
+ MarkdownSourceType2["GITHUB_PULL_REQUEST"] = "github_pull_request";
3586
+ MarkdownSourceType2["GITHUB_GIST"] = "github_gist";
3587
+ })(MarkdownSourceType$1 || (MarkdownSourceType$1 = {}));
3588
+ class SkillParseError extends Error {
3589
+ constructor(message, cause) {
3590
+ super(message);
3591
+ __publicField(this, "cause");
3592
+ this.cause = cause;
3593
+ this.name = "SkillParseError";
3594
+ }
3595
+ }
3596
+ function extractFrontmatter(content2) {
3597
+ const trimmed = content2.trim();
3598
+ if (!trimmed.startsWith("---")) {
3599
+ throw new SkillParseError("SKILL.md must start with YAML frontmatter (---)");
3600
+ }
3601
+ const afterFirstDelimiter = trimmed.slice(3);
3602
+ const closingIndex = afterFirstDelimiter.indexOf(`
3603
+ ---`);
3604
+ if (closingIndex === -1) {
3605
+ throw new SkillParseError("SKILL.md frontmatter is not properly closed with ---");
3606
+ }
3607
+ const frontmatter = afterFirstDelimiter.slice(0, closingIndex).trim();
3608
+ const body = afterFirstDelimiter.slice(closingIndex + 4).trim();
3609
+ return { frontmatter, body };
3610
+ }
3611
+ function parseYamlFrontmatter(yaml2) {
3612
+ const result = {};
3613
+ const lines = yaml2.split(`
3614
+ `);
3615
+ let currentObject = null;
3616
+ let currentList = null;
3617
+ for (let i = 0; i < lines.length; i++) {
3618
+ const line = lines[i];
3619
+ const trimmed = line.trim();
3620
+ if (!trimmed || trimmed.startsWith("#")) {
3621
+ continue;
3622
+ }
3623
+ const lineIndent = line.search(/\S/);
3624
+ if (trimmed.startsWith("- ")) {
3625
+ const value = trimmed.slice(2).trim();
3626
+ if (currentList) {
3627
+ currentList.push(value);
3628
+ }
3629
+ continue;
3630
+ }
3631
+ const colonIndex = line.indexOf(":");
3632
+ if (colonIndex > 0) {
3633
+ const key = line.slice(0, colonIndex).trim();
3634
+ const value = line.slice(colonIndex + 1).trim();
3635
+ if (lineIndent === 0) {
3636
+ currentList = null;
3637
+ currentObject = null;
3638
+ if (!value) {
3639
+ if (i + 1 < lines.length) {
3640
+ const nextLine = lines[i + 1];
3641
+ const nextTrimmed = nextLine.trim();
3642
+ if (nextTrimmed.startsWith("- ")) {
3643
+ currentList = [];
3644
+ result[key] = currentList;
3645
+ } else if (nextLine.search(/\S/) > 0 && nextLine.includes(":")) {
3646
+ currentObject = {};
3647
+ result[key] = currentObject;
3648
+ }
3649
+ }
3650
+ } else {
3651
+ const cleanValue = value.replace(/^["']|["']$/g, "");
3652
+ result[key] = cleanValue;
3653
+ }
3654
+ } else if (lineIndent > 0 && currentObject) {
3655
+ const cleanValue = value.replace(/^["']|["']$/g, "");
3656
+ currentObject[key] = cleanValue;
3657
+ }
3658
+ }
3659
+ }
3660
+ return result;
3661
+ }
3662
+ function parseSkillMetadataGraceful(metadata) {
3663
+ const warnings = [];
3664
+ const partialMetadata = {};
3665
+ if (!metadata.name || typeof metadata.name !== "string" || !metadata.name.trim()) {
3666
+ warnings.push({
3667
+ field: "name",
3668
+ message: 'Required field "name" is missing or empty'
3669
+ });
3670
+ } else {
3671
+ partialMetadata.name = metadata.name;
3672
+ }
3673
+ if (!metadata.description || typeof metadata.description !== "string" || !metadata.description.trim()) {
3674
+ warnings.push({
3675
+ field: "description",
3676
+ message: 'Required field "description" is missing or empty'
3677
+ });
3678
+ } else {
3679
+ partialMetadata.description = metadata.description;
3680
+ }
3681
+ if (metadata.license !== void 0) {
3682
+ if (typeof metadata.license !== "string") {
3683
+ warnings.push({
3684
+ field: "license",
3685
+ message: 'Field "license" must be a string'
3686
+ });
3687
+ } else {
3688
+ partialMetadata.license = metadata.license;
3689
+ }
3690
+ }
3691
+ if (metadata.compatibility !== void 0) {
3692
+ if (typeof metadata.compatibility !== "string") {
3693
+ warnings.push({
3694
+ field: "compatibility",
3695
+ message: 'Field "compatibility" must be a string'
3696
+ });
3697
+ } else {
3698
+ partialMetadata.compatibility = metadata.compatibility;
3699
+ }
3700
+ }
3701
+ if (metadata["allowed-tools"] !== void 0) {
3702
+ if (typeof metadata["allowed-tools"] === "string") {
3703
+ const toolsString = metadata["allowed-tools"];
3704
+ partialMetadata["allowed-tools"] = toolsString.trim() ? toolsString.trim().split(/\s+/) : [];
3705
+ } else {
3706
+ warnings.push({
3707
+ field: "allowed-tools",
3708
+ message: 'Field "allowed-tools" must be a space-delimited string'
3709
+ });
3710
+ }
3711
+ }
3712
+ if (metadata.metadata !== void 0) {
3713
+ if (typeof metadata.metadata !== "object" || Array.isArray(metadata.metadata)) {
3714
+ warnings.push({
3715
+ field: "metadata",
3716
+ message: 'Field "metadata" must be an object'
3717
+ });
3718
+ } else {
3719
+ partialMetadata.metadata = metadata.metadata;
3720
+ }
3721
+ }
3722
+ return { metadata: partialMetadata, warnings };
3723
+ }
3724
+ function parseSkillMarkdownGraceful(content2) {
3725
+ try {
3726
+ const { frontmatter, body } = extractFrontmatter(content2);
3727
+ let rawMetadata;
3728
+ try {
3729
+ rawMetadata = parseYamlFrontmatter(frontmatter);
3730
+ } catch (error) {
3731
+ return {
3732
+ metadata: {},
3733
+ body,
3734
+ raw: content2,
3735
+ warnings: [{
3736
+ field: "frontmatter",
3737
+ message: `Failed to parse YAML frontmatter: ${error instanceof Error ? error.message : String(error)}`
3738
+ }]
3739
+ };
3740
+ }
3741
+ const { metadata, warnings } = parseSkillMetadataGraceful(rawMetadata);
3742
+ return {
3743
+ metadata,
3744
+ body,
3745
+ raw: content2,
3746
+ warnings
3747
+ };
3748
+ } catch (error) {
3749
+ return {
3750
+ metadata: {},
3751
+ body: content2,
3752
+ raw: content2,
3753
+ warnings: [{
3754
+ field: "structure",
3755
+ message: error instanceof Error ? error.message : "Failed to parse SKILL.md structure"
3756
+ }]
3757
+ };
3758
+ }
3759
+ }
3541
3760
  const VOID = -1;
3542
3761
  const PRIMITIVE = 0;
3543
3762
  const ARRAY = 1;
@@ -43068,152 +43287,6 @@ function transformImageUrl(src, repositoryInfo) {
43068
43287
  const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${fullPath}`;
43069
43288
  return rawUrl;
43070
43289
  }
43071
- class SkillParseError extends Error {
43072
- constructor(message, cause) {
43073
- super(message);
43074
- __publicField(this, "cause");
43075
- this.cause = cause;
43076
- this.name = "SkillParseError";
43077
- }
43078
- }
43079
- class SkillValidationError extends Error {
43080
- constructor(message, field) {
43081
- super(message);
43082
- __publicField(this, "field");
43083
- this.field = field;
43084
- this.name = "SkillValidationError";
43085
- }
43086
- }
43087
- function extractFrontmatter(content2) {
43088
- const trimmed = content2.trim();
43089
- if (!trimmed.startsWith("---")) {
43090
- throw new SkillParseError("SKILL.md must start with YAML frontmatter (---)");
43091
- }
43092
- const afterFirstDelimiter = trimmed.slice(3);
43093
- const closingIndex = afterFirstDelimiter.indexOf(`
43094
- ---`);
43095
- if (closingIndex === -1) {
43096
- throw new SkillParseError("SKILL.md frontmatter is not properly closed with ---");
43097
- }
43098
- const frontmatter = afterFirstDelimiter.slice(0, closingIndex).trim();
43099
- const body = afterFirstDelimiter.slice(closingIndex + 4).trim();
43100
- return { frontmatter, body };
43101
- }
43102
- function parseYamlFrontmatter(yaml2) {
43103
- const result = {};
43104
- const lines = yaml2.split(`
43105
- `);
43106
- let currentObject = null;
43107
- let currentList = null;
43108
- for (let i = 0; i < lines.length; i++) {
43109
- const line = lines[i];
43110
- const trimmed = line.trim();
43111
- if (!trimmed || trimmed.startsWith("#")) {
43112
- continue;
43113
- }
43114
- const lineIndent = line.search(/\S/);
43115
- if (trimmed.startsWith("- ")) {
43116
- const value = trimmed.slice(2).trim();
43117
- if (currentList) {
43118
- currentList.push(value);
43119
- }
43120
- continue;
43121
- }
43122
- const colonIndex = line.indexOf(":");
43123
- if (colonIndex > 0) {
43124
- const key = line.slice(0, colonIndex).trim();
43125
- const value = line.slice(colonIndex + 1).trim();
43126
- if (lineIndent === 0) {
43127
- currentList = null;
43128
- currentObject = null;
43129
- if (!value) {
43130
- if (i + 1 < lines.length) {
43131
- const nextLine = lines[i + 1];
43132
- const nextTrimmed = nextLine.trim();
43133
- if (nextTrimmed.startsWith("- ")) {
43134
- currentList = [];
43135
- result[key] = currentList;
43136
- } else if (nextLine.search(/\S/) > 0 && nextLine.includes(":")) {
43137
- currentObject = {};
43138
- result[key] = currentObject;
43139
- }
43140
- }
43141
- } else {
43142
- const cleanValue = value.replace(/^["']|["']$/g, "");
43143
- result[key] = cleanValue;
43144
- }
43145
- } else if (lineIndent > 0 && currentObject) {
43146
- const cleanValue = value.replace(/^["']|["']$/g, "");
43147
- currentObject[key] = cleanValue;
43148
- }
43149
- }
43150
- }
43151
- return result;
43152
- }
43153
- function validateSkillMetadata(metadata) {
43154
- if (!metadata.name || typeof metadata.name !== "string" || !metadata.name.trim()) {
43155
- throw new SkillValidationError('Required field "name" is missing or empty', "name");
43156
- }
43157
- if (!metadata.description || typeof metadata.description !== "string" || !metadata.description.trim()) {
43158
- throw new SkillValidationError('Required field "description" is missing or empty', "description");
43159
- }
43160
- if (metadata.license !== void 0 && typeof metadata.license !== "string") {
43161
- throw new SkillValidationError('Field "license" must be a string', "license");
43162
- }
43163
- if (metadata.compatibility !== void 0 && typeof metadata.compatibility !== "string") {
43164
- throw new SkillValidationError('Field "compatibility" must be a string', "compatibility");
43165
- }
43166
- if (metadata["allowed-tools"] !== void 0) {
43167
- if (typeof metadata["allowed-tools"] === "string") {
43168
- const toolsString = metadata["allowed-tools"];
43169
- metadata["allowed-tools"] = toolsString.trim() ? toolsString.trim().split(/\s+/) : [];
43170
- } else {
43171
- throw new SkillValidationError('Field "allowed-tools" must be a space-delimited string', "allowed-tools");
43172
- }
43173
- }
43174
- if (metadata.metadata !== void 0 && (typeof metadata.metadata !== "object" || Array.isArray(metadata.metadata))) {
43175
- throw new SkillValidationError('Field "metadata" must be an object', "metadata");
43176
- }
43177
- const skillMetadata = {
43178
- name: metadata.name,
43179
- description: metadata.description
43180
- };
43181
- if (metadata.license !== void 0) {
43182
- skillMetadata.license = metadata.license;
43183
- }
43184
- if (metadata.compatibility !== void 0) {
43185
- skillMetadata.compatibility = metadata.compatibility;
43186
- }
43187
- if (metadata["allowed-tools"] !== void 0) {
43188
- skillMetadata["allowed-tools"] = metadata["allowed-tools"];
43189
- }
43190
- if (metadata.metadata !== void 0) {
43191
- skillMetadata.metadata = metadata.metadata;
43192
- }
43193
- return skillMetadata;
43194
- }
43195
- function parseSkillMarkdown(content2) {
43196
- try {
43197
- const { frontmatter, body } = extractFrontmatter(content2);
43198
- let rawMetadata;
43199
- try {
43200
- rawMetadata = parseYamlFrontmatter(frontmatter);
43201
- } catch (error) {
43202
- throw new SkillParseError("Failed to parse YAML frontmatter", error);
43203
- }
43204
- const metadata = validateSkillMetadata(rawMetadata);
43205
- return {
43206
- metadata,
43207
- body,
43208
- raw: content2
43209
- };
43210
- } catch (error) {
43211
- if (error instanceof SkillParseError || error instanceof SkillValidationError) {
43212
- throw error;
43213
- }
43214
- throw new SkillParseError("Failed to parse SKILL.md", error);
43215
- }
43216
- }
43217
43290
  var parseMarkdownChunks2 = parseMarkdownChunks;
43218
43291
  var useIndustryHtmlModal = () => {
43219
43292
  const [htmlModalOpen, setHtmlModalOpen] = useState(false);
@@ -47650,18 +47723,15 @@ var DocumentView = ({
47650
47723
  editable
47651
47724
  })));
47652
47725
  };
47653
- var formatRelativeTime = (dateString) => {
47726
+ const formatRelativeTime = (dateString) => {
47654
47727
  try {
47655
47728
  const date = new Date(dateString);
47656
47729
  const now = /* @__PURE__ */ new Date();
47657
47730
  const diffMs = now.getTime() - date.getTime();
47658
47731
  const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
47659
- if (diffDays === 0)
47660
- return "Today";
47661
- if (diffDays === 1)
47662
- return "Yesterday";
47663
- if (diffDays < 7)
47664
- return `${diffDays} days ago`;
47732
+ if (diffDays === 0) return "Today";
47733
+ if (diffDays === 1) return "Yesterday";
47734
+ if (diffDays < 7) return `${diffDays} days ago`;
47665
47735
  if (diffDays < 30) {
47666
47736
  const weeks = Math.floor(diffDays / 7);
47667
47737
  return `${weeks} ${weeks === 1 ? "week" : "weeks"} ago`;
@@ -47676,267 +47746,475 @@ var formatRelativeTime = (dateString) => {
47676
47746
  return dateString;
47677
47747
  }
47678
47748
  };
47679
- var SkillMetadataSection = ({
47749
+ const SkillMetadataSection = ({
47680
47750
  metadata,
47681
- theme: theme2
47751
+ theme: theme2,
47752
+ structure
47682
47753
  }) => {
47683
- var _a, _b;
47684
- return /* @__PURE__ */ React2__default.createElement("div", {
47685
- style: {
47686
- borderBottom: `2px solid ${theme2.colors.border}`,
47687
- paddingBottom: theme2.space[3],
47688
- marginBottom: theme2.space[2]
47689
- }
47690
- }, /* @__PURE__ */ React2__default.createElement("div", {
47691
- style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: theme2.space[2] }
47692
- }, /* @__PURE__ */ React2__default.createElement("h1", {
47693
- style: {
47694
- fontSize: theme2.fontSizes[6],
47695
- fontWeight: 700,
47696
- margin: 0,
47697
- color: theme2.colors.text
47698
- }
47699
- }, metadata.name), (((_a = metadata.metadata) == null ? void 0 : _a["last-updated"]) || metadata.license) && /* @__PURE__ */ React2__default.createElement("div", {
47700
- style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: theme2.space[1], marginLeft: theme2.space[3], marginTop: theme2.space[1] }
47701
- }, ((_b = metadata.metadata) == null ? void 0 : _b["last-updated"]) && /* @__PURE__ */ React2__default.createElement("span", {
47702
- style: {
47703
- fontSize: theme2.fontSizes[0],
47704
- color: theme2.colors.textSecondary,
47705
- fontFamily: theme2.fonts.monospace,
47706
- fontWeight: 500,
47707
- whiteSpace: "nowrap"
47708
- }
47709
- }, formatRelativeTime(metadata.metadata["last-updated"])), metadata.license && /* @__PURE__ */ React2__default.createElement("span", {
47710
- style: {
47711
- fontSize: theme2.fontSizes[1],
47712
- color: theme2.colors.textSecondary,
47713
- fontFamily: theme2.fonts.monospace,
47714
- fontWeight: 500,
47715
- whiteSpace: "nowrap"
47716
- }
47717
- }, metadata.license))), /* @__PURE__ */ React2__default.createElement("p", {
47718
- style: {
47719
- fontSize: theme2.fontSizes[3],
47720
- color: theme2.colors.textSecondary,
47721
- margin: 0,
47722
- lineHeight: 1.5
47723
- }
47724
- }, metadata.description));
47754
+ var _a, _b, _c, _d, _e2;
47755
+ const [expandedSections, setExpandedSections] = React2__default.useState({
47756
+ scripts: false,
47757
+ references: false,
47758
+ assets: false
47759
+ });
47760
+ const toggleSection = (section) => {
47761
+ setExpandedSections((prev) => ({
47762
+ ...prev,
47763
+ [section]: !prev[section]
47764
+ }));
47765
+ };
47766
+ return /* @__PURE__ */ jsxs("div", { style: {
47767
+ borderBottom: `2px solid ${theme2.colors.border}`,
47768
+ paddingBottom: theme2.space[3],
47769
+ marginBottom: theme2.space[2]
47770
+ }, children: [
47771
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: theme2.space[2] }, children: [
47772
+ /* @__PURE__ */ jsx(
47773
+ "h1",
47774
+ {
47775
+ style: {
47776
+ fontSize: theme2.fontSizes[6],
47777
+ fontWeight: 700,
47778
+ margin: 0,
47779
+ color: metadata.name ? theme2.colors.text : theme2.colors.textSecondary,
47780
+ fontFamily: theme2.fonts.heading
47781
+ },
47782
+ children: metadata.name || "(Unnamed Skill)"
47783
+ }
47784
+ ),
47785
+ (((_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: [
47786
+ ((_b = metadata.metadata) == null ? void 0 : _b["last-updated"]) && /* @__PURE__ */ jsx(
47787
+ "span",
47788
+ {
47789
+ style: {
47790
+ fontSize: theme2.fontSizes[0],
47791
+ color: theme2.colors.textSecondary,
47792
+ fontFamily: theme2.fonts.monospace,
47793
+ fontWeight: 500,
47794
+ whiteSpace: "nowrap"
47795
+ },
47796
+ children: formatRelativeTime(metadata.metadata["last-updated"])
47797
+ }
47798
+ ),
47799
+ metadata.license && /* @__PURE__ */ jsx(
47800
+ "span",
47801
+ {
47802
+ style: {
47803
+ fontSize: theme2.fontSizes[1],
47804
+ color: theme2.colors.textSecondary,
47805
+ fontFamily: theme2.fonts.monospace,
47806
+ fontWeight: 500,
47807
+ whiteSpace: "nowrap"
47808
+ },
47809
+ children: metadata.license
47810
+ }
47811
+ )
47812
+ ] })
47813
+ ] }),
47814
+ metadata.description ? /* @__PURE__ */ jsx(
47815
+ "p",
47816
+ {
47817
+ style: {
47818
+ fontSize: theme2.fontSizes[3],
47819
+ color: theme2.colors.textSecondary,
47820
+ margin: 0,
47821
+ lineHeight: 1.5,
47822
+ fontFamily: theme2.fonts.body
47823
+ },
47824
+ children: metadata.description
47825
+ }
47826
+ ) : /* @__PURE__ */ jsx(
47827
+ "p",
47828
+ {
47829
+ style: {
47830
+ fontSize: theme2.fontSizes[3],
47831
+ color: theme2.colors.textSecondary,
47832
+ margin: 0,
47833
+ lineHeight: 1.5,
47834
+ fontFamily: theme2.fonts.body,
47835
+ fontStyle: "italic"
47836
+ },
47837
+ children: "(No description provided)"
47838
+ }
47839
+ ),
47840
+ structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) && /* @__PURE__ */ jsxs("div", { style: {
47841
+ marginTop: theme2.space[3]
47842
+ }, children: [
47843
+ /* @__PURE__ */ jsxs("div", { style: {
47844
+ display: "flex",
47845
+ gap: theme2.space[2],
47846
+ flexWrap: "wrap"
47847
+ }, children: [
47848
+ structure.hasScripts && /* @__PURE__ */ jsxs(
47849
+ "button",
47850
+ {
47851
+ onClick: () => toggleSection("scripts"),
47852
+ style: {
47853
+ padding: "0.25rem 0.75rem",
47854
+ borderRadius: "12px",
47855
+ backgroundColor: theme2.colors.primary,
47856
+ color: theme2.colors.background,
47857
+ fontSize: theme2.fontSizes[0],
47858
+ fontFamily: theme2.fonts.body,
47859
+ fontWeight: 500,
47860
+ display: "flex",
47861
+ alignItems: "center",
47862
+ gap: "0.5rem",
47863
+ border: "none",
47864
+ cursor: "pointer",
47865
+ transition: "opacity 0.2s"
47866
+ },
47867
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
47868
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
47869
+ children: [
47870
+ /* @__PURE__ */ jsx(Code, { size: 14 }),
47871
+ /* @__PURE__ */ jsxs("span", { children: [
47872
+ "Scripts (",
47873
+ ((_c = structure.scriptFiles) == null ? void 0 : _c.length) || 0,
47874
+ ")"
47875
+ ] }),
47876
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.scripts ? "▼" : "▶" })
47877
+ ]
47878
+ }
47879
+ ),
47880
+ structure.hasReferences && /* @__PURE__ */ jsxs(
47881
+ "button",
47882
+ {
47883
+ onClick: () => toggleSection("references"),
47884
+ style: {
47885
+ padding: "0.25rem 0.75rem",
47886
+ borderRadius: "12px",
47887
+ backgroundColor: theme2.colors.secondary,
47888
+ color: theme2.colors.background,
47889
+ fontSize: theme2.fontSizes[0],
47890
+ fontFamily: theme2.fonts.body,
47891
+ fontWeight: 500,
47892
+ display: "flex",
47893
+ alignItems: "center",
47894
+ gap: "0.5rem",
47895
+ border: "none",
47896
+ cursor: "pointer",
47897
+ transition: "opacity 0.2s"
47898
+ },
47899
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
47900
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
47901
+ children: [
47902
+ /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
47903
+ /* @__PURE__ */ jsxs("span", { children: [
47904
+ "References (",
47905
+ ((_d = structure.referenceFiles) == null ? void 0 : _d.length) || 0,
47906
+ ")"
47907
+ ] }),
47908
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.references ? "▼" : "▶" })
47909
+ ]
47910
+ }
47911
+ ),
47912
+ structure.hasAssets && /* @__PURE__ */ jsxs(
47913
+ "button",
47914
+ {
47915
+ onClick: () => toggleSection("assets"),
47916
+ style: {
47917
+ padding: "0.25rem 0.75rem",
47918
+ borderRadius: "12px",
47919
+ backgroundColor: theme2.colors.accent,
47920
+ color: theme2.colors.background,
47921
+ fontSize: theme2.fontSizes[0],
47922
+ fontFamily: theme2.fonts.body,
47923
+ fontWeight: 500,
47924
+ display: "flex",
47925
+ alignItems: "center",
47926
+ gap: "0.5rem",
47927
+ border: "none",
47928
+ cursor: "pointer",
47929
+ transition: "opacity 0.2s"
47930
+ },
47931
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
47932
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
47933
+ children: [
47934
+ /* @__PURE__ */ jsx(Package, { size: 14 }),
47935
+ /* @__PURE__ */ jsxs("span", { children: [
47936
+ "Assets (",
47937
+ ((_e2 = structure.assetFiles) == null ? void 0 : _e2.length) || 0,
47938
+ ")"
47939
+ ] }),
47940
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.assets ? "▼" : "▶" })
47941
+ ]
47942
+ }
47943
+ )
47944
+ ] }),
47945
+ expandedSections.scripts && structure.scriptFiles && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
47946
+ marginTop: theme2.space[2],
47947
+ padding: theme2.space[2],
47948
+ backgroundColor: `${theme2.colors.primary}15`,
47949
+ borderRadius: "8px",
47950
+ borderLeft: `3px solid ${theme2.colors.primary}`
47951
+ }, children: [
47952
+ /* @__PURE__ */ jsx("div", { style: {
47953
+ fontSize: theme2.fontSizes[0],
47954
+ fontWeight: 600,
47955
+ color: theme2.colors.text,
47956
+ marginBottom: theme2.space[1],
47957
+ fontFamily: theme2.fonts.heading
47958
+ }, children: "Script Files" }),
47959
+ /* @__PURE__ */ jsx("ul", { style: {
47960
+ margin: 0,
47961
+ paddingLeft: theme2.space[3],
47962
+ listStyle: "none"
47963
+ }, children: structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
47964
+ fontSize: theme2.fontSizes[1],
47965
+ color: theme2.colors.text,
47966
+ fontFamily: theme2.fonts.monospace,
47967
+ padding: "2px 0"
47968
+ }, children: [
47969
+ "• ",
47970
+ file
47971
+ ] }, idx)) })
47972
+ ] }),
47973
+ expandedSections.references && structure.referenceFiles && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
47974
+ marginTop: theme2.space[2],
47975
+ padding: theme2.space[2],
47976
+ backgroundColor: `${theme2.colors.secondary}15`,
47977
+ borderRadius: "8px",
47978
+ borderLeft: `3px solid ${theme2.colors.secondary}`
47979
+ }, children: [
47980
+ /* @__PURE__ */ jsx("div", { style: {
47981
+ fontSize: theme2.fontSizes[0],
47982
+ fontWeight: 600,
47983
+ color: theme2.colors.text,
47984
+ marginBottom: theme2.space[1],
47985
+ fontFamily: theme2.fonts.heading
47986
+ }, children: "Reference Files" }),
47987
+ /* @__PURE__ */ jsx("ul", { style: {
47988
+ margin: 0,
47989
+ paddingLeft: theme2.space[3],
47990
+ listStyle: "none"
47991
+ }, children: structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
47992
+ fontSize: theme2.fontSizes[1],
47993
+ color: theme2.colors.text,
47994
+ fontFamily: theme2.fonts.monospace,
47995
+ padding: "2px 0"
47996
+ }, children: [
47997
+ "• ",
47998
+ file
47999
+ ] }, idx)) })
48000
+ ] }),
48001
+ expandedSections.assets && structure.assetFiles && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48002
+ marginTop: theme2.space[2],
48003
+ padding: theme2.space[2],
48004
+ backgroundColor: `${theme2.colors.accent}15`,
48005
+ borderRadius: "8px",
48006
+ borderLeft: `3px solid ${theme2.colors.accent}`
48007
+ }, children: [
48008
+ /* @__PURE__ */ jsx("div", { style: {
48009
+ fontSize: theme2.fontSizes[0],
48010
+ fontWeight: 600,
48011
+ color: theme2.colors.text,
48012
+ marginBottom: theme2.space[1],
48013
+ fontFamily: theme2.fonts.heading
48014
+ }, children: "Asset Files" }),
48015
+ /* @__PURE__ */ jsx("ul", { style: {
48016
+ margin: 0,
48017
+ paddingLeft: theme2.space[3],
48018
+ listStyle: "none"
48019
+ }, children: structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48020
+ fontSize: theme2.fontSizes[1],
48021
+ color: theme2.colors.text,
48022
+ fontFamily: theme2.fonts.monospace,
48023
+ padding: "2px 0"
48024
+ }, children: [
48025
+ "• ",
48026
+ file
48027
+ ] }, idx)) })
48028
+ ] })
48029
+ ] })
48030
+ ] });
47725
48031
  };
47726
- var SkillMarkdown = ({
48032
+ const SkillMarkdown = ({
47727
48033
  content: content2,
47728
48034
  theme: theme2,
47729
48035
  className = "",
47730
48036
  onParsed,
47731
- onError,
47732
- showRawOnError = false
48037
+ onWarnings,
48038
+ showRawOnError = false,
48039
+ containerWidth,
48040
+ structure
47733
48041
  }) => {
47734
48042
  const [parsed, setParsed] = React2__default.useState(null);
47735
- const [error, setError] = React2__default.useState(null);
47736
48043
  React2__default.useEffect(() => {
47737
- try {
47738
- const skill = parseSkillMarkdown(content2);
47739
- setParsed(skill);
47740
- setError(null);
47741
- onParsed == null ? void 0 : onParsed(skill);
47742
- } catch (err) {
47743
- const error2 = err instanceof Error ? err : new Error(String(err));
47744
- setError(error2);
47745
- setParsed(null);
47746
- onError == null ? void 0 : onError(error2);
48044
+ const skill = parseSkillMarkdownGraceful(content2);
48045
+ setParsed(skill);
48046
+ onParsed == null ? void 0 : onParsed(skill);
48047
+ if (skill.warnings.length > 0) {
48048
+ onWarnings == null ? void 0 : onWarnings(skill.warnings);
47747
48049
  }
47748
- }, [content2, onParsed, onError]);
48050
+ }, [content2, onParsed, onWarnings]);
47749
48051
  if (!theme2 || !theme2.space) {
47750
- return /* @__PURE__ */ React2__default.createElement("div", {
47751
- className,
47752
- style: { width: "100%", height: "100%" }
47753
- }, /* @__PURE__ */ React2__default.createElement("div", {
47754
- style: { padding: "2rem", textAlign: "center", color: "#856404" }
47755
- }, "Error: Theme not available. Wrap component in ThemeProvider."));
48052
+ 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." }) });
47756
48053
  }
47757
- if (error) {
47758
- if (showRawOnError) {
47759
- return /* @__PURE__ */ React2__default.createElement("div", {
48054
+ if (!parsed) {
48055
+ return /* @__PURE__ */ jsx(
48056
+ "div",
48057
+ {
47760
48058
  className,
47761
48059
  style: {
48060
+ display: "flex",
48061
+ alignItems: "center",
48062
+ justifyContent: "center",
47762
48063
  width: "100%",
47763
48064
  height: "100%",
47764
- overflow: "auto",
48065
+ padding: theme2.space[4],
48066
+ color: theme2.colors.textSecondary,
48067
+ fontStyle: "italic",
47765
48068
  background: theme2.colors.background
47766
- }
47767
- }, /* @__PURE__ */ React2__default.createElement("div", {
47768
- style: { padding: theme2.space[3] }
47769
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47770
- content: content2,
47771
- theme: theme2,
47772
- slideIdPrefix: "skill-fallback",
47773
- slideIndex: 0,
47774
- isVisible: true
47775
- })));
47776
- }
47777
- return /* @__PURE__ */ React2__default.createElement("div", {
47778
- className,
47779
- style: {
47780
- display: "flex",
47781
- flexDirection: "column",
47782
- alignItems: "center",
47783
- justifyContent: "center",
47784
- width: "100%",
47785
- height: "100%",
47786
- padding: theme2.space[4],
47787
- background: theme2.colors.background,
47788
- overflow: "auto"
47789
- }
47790
- }, /* @__PURE__ */ React2__default.createElement("div", {
47791
- style: {
47792
- background: "#fff3cd",
47793
- border: "1px solid #ffc107",
47794
- borderRadius: "8px",
47795
- padding: theme2.space[4],
47796
- maxWidth: "600px"
47797
- }
47798
- }, /* @__PURE__ */ React2__default.createElement("h2", {
47799
- style: { color: "#856404", marginTop: 0 }
47800
- }, "Failed to parse SKILL.md"), /* @__PURE__ */ React2__default.createElement("p", {
47801
- style: {
47802
- fontWeight: 600,
47803
- color: "#856404",
47804
- fontSize: theme2.fontSizes[0],
47805
- textTransform: "uppercase",
47806
- letterSpacing: "0.5px"
47807
- }
47808
- }, error instanceof SkillParseError && "Parse Error", error instanceof SkillValidationError && "Validation Error", !(error instanceof SkillParseError) && !(error instanceof SkillValidationError) && "Error"), /* @__PURE__ */ React2__default.createElement("p", {
47809
- style: { color: "#856404", margin: `${theme2.space[3]} 0` }
47810
- }, error.message), error instanceof SkillValidationError && error.field && /* @__PURE__ */ React2__default.createElement("p", {
47811
- style: {
47812
- fontFamily: theme2.fonts.monospace,
47813
- color: "#856404",
47814
- fontSize: theme2.fontSizes[0]
48069
+ },
48070
+ children: "Loading..."
47815
48071
  }
47816
- }, "Field: ", error.field)));
48072
+ );
47817
48073
  }
47818
- if (!parsed) {
47819
- return /* @__PURE__ */ React2__default.createElement("div", {
48074
+ return /* @__PURE__ */ jsxs(
48075
+ "div",
48076
+ {
47820
48077
  className,
47821
48078
  style: {
47822
- display: "flex",
47823
- alignItems: "center",
47824
- justifyContent: "center",
47825
48079
  width: "100%",
47826
48080
  height: "100%",
47827
- padding: theme2.space[4],
47828
- color: theme2.colors.textSecondary,
47829
- fontStyle: "italic",
48081
+ display: "flex",
48082
+ flexDirection: "column",
47830
48083
  background: theme2.colors.background
47831
- }
47832
- }, "Loading...");
47833
- }
47834
- return /* @__PURE__ */ React2__default.createElement("div", {
47835
- className,
47836
- style: {
47837
- width: "100%",
47838
- height: "100%",
47839
- display: "flex",
47840
- flexDirection: "column",
47841
- background: theme2.colors.background
47842
- }
47843
- }, /* @__PURE__ */ React2__default.createElement("div", {
47844
- style: { padding: theme2.space[3], paddingBottom: 0 }
47845
- }, /* @__PURE__ */ React2__default.createElement(SkillMetadataSection, {
47846
- metadata: parsed.metadata,
47847
- theme: theme2
47848
- })), /* @__PURE__ */ React2__default.createElement("div", {
47849
- style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }
47850
- }, /* @__PURE__ */ React2__default.createElement("div", {
47851
- style: { display: "flex", gap: theme2.space[4], alignItems: "flex-start" }
47852
- }, /* @__PURE__ */ React2__default.createElement("div", {
47853
- style: { flex: 1, minWidth: 0 }
47854
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47855
- content: parsed.body,
47856
- theme: theme2,
47857
- slideIdPrefix: "skill-body",
47858
- slideIndex: 0,
47859
- isVisible: true
47860
- })), (parsed.metadata.compatibility || parsed.metadata["allowed-tools"] || parsed.metadata.metadata) && /* @__PURE__ */ React2__default.createElement("div", {
47861
- style: {
47862
- width: "300px",
47863
- flexShrink: 0,
47864
- padding: theme2.space[3],
47865
- background: theme2.colors.background,
47866
- position: "sticky",
47867
- top: theme2.space[3]
47868
- }
47869
- }, parsed.metadata.compatibility && /* @__PURE__ */ React2__default.createElement("div", {
47870
- style: { marginBottom: theme2.space[3] }
47871
- }, /* @__PURE__ */ React2__default.createElement("div", {
47872
- style: {
47873
- fontFamily: theme2.fonts.heading,
47874
- fontWeight: 600,
47875
- fontSize: theme2.fontSizes[0],
47876
- textTransform: "uppercase",
47877
- letterSpacing: "0.5px",
47878
- color: theme2.colors.textSecondary,
47879
- marginBottom: theme2.space[1]
47880
- }
47881
- }, "Compatibility"), /* @__PURE__ */ React2__default.createElement("div", {
47882
- style: { fontSize: theme2.fontSizes[1], color: theme2.colors.text, fontFamily: theme2.fonts.body }
47883
- }, parsed.metadata.compatibility)), parsed.metadata["allowed-tools"] && parsed.metadata["allowed-tools"].length > 0 && /* @__PURE__ */ React2__default.createElement("div", {
47884
- style: { marginBottom: theme2.space[3] }
47885
- }, /* @__PURE__ */ React2__default.createElement("div", {
47886
- style: {
47887
- fontFamily: theme2.fonts.heading,
47888
- fontWeight: 600,
47889
- fontSize: theme2.fontSizes[0],
47890
- textTransform: "uppercase",
47891
- letterSpacing: "0.5px",
47892
- color: theme2.colors.textSecondary,
47893
- marginBottom: theme2.space[1]
47894
- }
47895
- }, "Allowed Tools"), /* @__PURE__ */ React2__default.createElement("div", {
47896
- style: { display: "flex", flexWrap: "wrap", gap: theme2.space[1] }
47897
- }, parsed.metadata["allowed-tools"].map((tool, index2) => /* @__PURE__ */ React2__default.createElement("span", {
47898
- key: index2,
47899
- style: {
47900
- display: "inline-block",
47901
- paddingTop: theme2.space[2],
47902
- paddingBottom: theme2.space[2],
47903
- paddingLeft: theme2.space[3],
47904
- paddingRight: theme2.space[3],
47905
- background: theme2.colors.primary,
47906
- color: theme2.colors.background,
47907
- borderRadius: "4px",
47908
- fontSize: theme2.fontSizes[0],
47909
- fontWeight: 500,
47910
- fontFamily: theme2.fonts.monospace
47911
- }
47912
- }, tool)))), parsed.metadata.metadata && Object.keys(parsed.metadata.metadata).length > 0 && /* @__PURE__ */ React2__default.createElement("div", null, /* @__PURE__ */ React2__default.createElement("div", {
47913
- style: {
47914
- fontFamily: theme2.fonts.heading,
47915
- fontWeight: 600,
47916
- fontSize: theme2.fontSizes[0],
47917
- textTransform: "uppercase",
47918
- letterSpacing: "0.5px",
47919
- color: theme2.colors.textSecondary,
47920
- marginBottom: theme2.space[1]
47921
- }
47922
- }, "Metadata"), /* @__PURE__ */ React2__default.createElement("div", {
47923
- style: { display: "flex", flexDirection: "column", gap: theme2.space[1] }
47924
- }, Object.entries(parsed.metadata.metadata).filter(([key]) => key !== "last-updated").map(([key, value]) => /* @__PURE__ */ React2__default.createElement("div", {
47925
- key
47926
- }, /* @__PURE__ */ React2__default.createElement("div", {
47927
- style: {
47928
- fontSize: theme2.fontSizes[0],
47929
- fontWeight: 600,
47930
- color: theme2.colors.textSecondary,
47931
- fontFamily: theme2.fonts.body
47932
- }
47933
- }, key, ":"), /* @__PURE__ */ React2__default.createElement("div", {
47934
- style: {
47935
- fontSize: theme2.fontSizes[1],
47936
- color: theme2.colors.text,
47937
- fontFamily: theme2.fonts.monospace
48084
+ },
48085
+ children: [
48086
+ /* @__PURE__ */ jsx("div", { style: { padding: theme2.space[3], paddingBottom: 0 }, children: /* @__PURE__ */ jsx(SkillMetadataSection, { metadata: parsed.metadata, theme: theme2, structure }) }),
48087
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: theme2.space[4], alignItems: "flex-start" }, children: [
48088
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(
48089
+ IndustryMarkdownSlide,
48090
+ {
48091
+ content: parsed.body,
48092
+ theme: theme2,
48093
+ slideIdPrefix: "skill-body",
48094
+ slideIndex: 0,
48095
+ isVisible: true,
48096
+ containerWidth
48097
+ }
48098
+ ) }),
48099
+ (parsed.metadata.compatibility || parsed.metadata["allowed-tools"] || parsed.metadata.metadata) && /* @__PURE__ */ jsxs(
48100
+ "div",
48101
+ {
48102
+ style: {
48103
+ width: "300px",
48104
+ flexShrink: 0,
48105
+ padding: theme2.space[3],
48106
+ background: theme2.colors.background,
48107
+ position: "sticky",
48108
+ top: theme2.space[3]
48109
+ },
48110
+ children: [
48111
+ parsed.metadata.compatibility && /* @__PURE__ */ jsxs("div", { style: { marginBottom: theme2.space[3] }, children: [
48112
+ /* @__PURE__ */ jsx(
48113
+ "div",
48114
+ {
48115
+ style: {
48116
+ fontFamily: theme2.fonts.heading,
48117
+ fontWeight: 600,
48118
+ fontSize: theme2.fontSizes[0],
48119
+ textTransform: "uppercase",
48120
+ letterSpacing: "0.5px",
48121
+ color: theme2.colors.textSecondary,
48122
+ marginBottom: theme2.space[1]
48123
+ },
48124
+ children: "Compatibility"
48125
+ }
48126
+ ),
48127
+ /* @__PURE__ */ jsx("div", { style: { fontSize: theme2.fontSizes[1], color: theme2.colors.text, fontFamily: theme2.fonts.body }, children: parsed.metadata.compatibility })
48128
+ ] }),
48129
+ parsed.metadata["allowed-tools"] && parsed.metadata["allowed-tools"].length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: theme2.space[3] }, children: [
48130
+ /* @__PURE__ */ jsx(
48131
+ "div",
48132
+ {
48133
+ style: {
48134
+ fontFamily: theme2.fonts.heading,
48135
+ fontWeight: 600,
48136
+ fontSize: theme2.fontSizes[0],
48137
+ textTransform: "uppercase",
48138
+ letterSpacing: "0.5px",
48139
+ color: theme2.colors.textSecondary,
48140
+ marginBottom: theme2.space[1]
48141
+ },
48142
+ children: "Allowed Tools"
48143
+ }
48144
+ ),
48145
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: theme2.space[1] }, children: parsed.metadata["allowed-tools"].map((tool, index2) => /* @__PURE__ */ jsx(
48146
+ "span",
48147
+ {
48148
+ style: {
48149
+ display: "inline-block",
48150
+ paddingTop: theme2.space[2],
48151
+ paddingBottom: theme2.space[2],
48152
+ paddingLeft: theme2.space[3],
48153
+ paddingRight: theme2.space[3],
48154
+ background: theme2.colors.primary,
48155
+ color: theme2.colors.background,
48156
+ borderRadius: "4px",
48157
+ fontSize: theme2.fontSizes[0],
48158
+ fontWeight: 500,
48159
+ fontFamily: theme2.fonts.monospace
48160
+ },
48161
+ children: tool
48162
+ },
48163
+ index2
48164
+ )) })
48165
+ ] }),
48166
+ parsed.metadata.metadata && Object.keys(parsed.metadata.metadata).length > 0 && /* @__PURE__ */ jsxs("div", { children: [
48167
+ /* @__PURE__ */ jsx(
48168
+ "div",
48169
+ {
48170
+ style: {
48171
+ fontFamily: theme2.fonts.heading,
48172
+ fontWeight: 600,
48173
+ fontSize: theme2.fontSizes[0],
48174
+ textTransform: "uppercase",
48175
+ letterSpacing: "0.5px",
48176
+ color: theme2.colors.textSecondary,
48177
+ marginBottom: theme2.space[1]
48178
+ },
48179
+ children: "Metadata"
48180
+ }
48181
+ ),
48182
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: theme2.space[1] }, children: Object.entries(parsed.metadata.metadata).filter(([key]) => key !== "last-updated").map(([key, value]) => /* @__PURE__ */ jsxs("div", { children: [
48183
+ /* @__PURE__ */ jsxs(
48184
+ "div",
48185
+ {
48186
+ style: {
48187
+ fontSize: theme2.fontSizes[0],
48188
+ fontWeight: 600,
48189
+ color: theme2.colors.textSecondary,
48190
+ fontFamily: theme2.fonts.body
48191
+ },
48192
+ children: [
48193
+ key,
48194
+ ":"
48195
+ ]
48196
+ }
48197
+ ),
48198
+ /* @__PURE__ */ jsx(
48199
+ "div",
48200
+ {
48201
+ style: {
48202
+ fontSize: theme2.fontSizes[1],
48203
+ color: theme2.colors.text,
48204
+ fontFamily: theme2.fonts.monospace
48205
+ },
48206
+ children: value
48207
+ }
48208
+ )
48209
+ ] }, key)) })
48210
+ ] })
48211
+ ]
48212
+ }
48213
+ )
48214
+ ] }) })
48215
+ ]
47938
48216
  }
47939
- }, value)))))))));
48217
+ );
47940
48218
  };
47941
48219
  const SkillDetailPanel = ({
47942
48220
  context,
@@ -47944,7 +48222,6 @@ const SkillDetailPanel = ({
47944
48222
  actions,
47945
48223
  selectedSkillId: selectedSkillIdProp
47946
48224
  }) => {
47947
- var _a, _b, _c, _d, _e2, _f;
47948
48225
  const { theme: theme2 } = useTheme();
47949
48226
  const { skills, isLoading, error } = useSkillsData({ context });
47950
48227
  const [selectedSkillIdState, setSelectedSkillIdState] = useState(null);
@@ -47955,8 +48232,8 @@ const SkillDetailPanel = ({
47955
48232
  "skill-detail",
47956
48233
  events,
47957
48234
  () => {
47958
- var _a2;
47959
- return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
48235
+ var _a;
48236
+ return (_a = panelRef.current) == null ? void 0 : _a.focus();
47960
48237
  }
47961
48238
  );
47962
48239
  useEffect(() => {
@@ -48055,12 +48332,14 @@ const SkillDetailPanel = ({
48055
48332
  );
48056
48333
  }
48057
48334
  const handleParsed = (parsedSkill) => {
48058
- console.log("Skill parsed:", parsedSkill.metadata.name);
48335
+ console.log("Skill parsed:", parsedSkill.metadata.name || "(unnamed)");
48336
+ if (parsedSkill.warnings.length > 0) {
48337
+ console.warn("Skill has warnings:", parsedSkill.warnings);
48338
+ }
48059
48339
  };
48060
- const handleError = (error2) => {
48061
- console.error("Error parsing skill:", error2);
48340
+ const handleWarnings = (warnings) => {
48341
+ console.warn("Skill validation warnings:", warnings);
48062
48342
  };
48063
- const hasStructure = skill.hasScripts || skill.hasReferences || skill.hasAssets;
48064
48343
  return /* @__PURE__ */ jsx(
48065
48344
  "div",
48066
48345
  {
@@ -48073,170 +48352,23 @@ const SkillDetailPanel = ({
48073
48352
  flexDirection: "column",
48074
48353
  outline: "none"
48075
48354
  },
48076
- children: skill.content ? /* @__PURE__ */ jsxs(Fragment, { children: [
48077
- hasStructure && /* @__PURE__ */ jsxs(
48078
- "div",
48079
- {
48080
- style: {
48081
- padding: "1rem",
48082
- borderBottom: `1px solid ${theme2.colors.border}`,
48083
- display: "flex",
48084
- gap: "0.5rem",
48085
- flexWrap: "wrap",
48086
- backgroundColor: theme2.colors.backgroundSecondary
48087
- },
48088
- children: [
48089
- /* @__PURE__ */ jsx(
48090
- "div",
48091
- {
48092
- style: {
48093
- fontSize: theme2.fontSizes[1],
48094
- color: theme2.colors.textSecondary,
48095
- fontFamily: theme2.fonts.body,
48096
- marginRight: "0.5rem",
48097
- display: "flex",
48098
- alignItems: "center"
48099
- },
48100
- children: "Available:"
48101
- }
48102
- ),
48103
- skill.hasScripts && /* @__PURE__ */ jsxs(
48104
- "div",
48105
- {
48106
- style: {
48107
- padding: "0.25rem 0.75rem",
48108
- borderRadius: "12px",
48109
- backgroundColor: theme2.colors.primary,
48110
- color: theme2.colors.background,
48111
- fontSize: theme2.fontSizes[0],
48112
- fontFamily: theme2.fonts.body,
48113
- fontWeight: 500,
48114
- display: "flex",
48115
- alignItems: "center",
48116
- gap: "0.5rem"
48117
- },
48118
- title: (_a = skill.scriptFiles) == null ? void 0 : _a.join(", "),
48119
- children: [
48120
- /* @__PURE__ */ jsx(Code, { size: 14 }),
48121
- /* @__PURE__ */ jsxs("span", { children: [
48122
- "Scripts (",
48123
- ((_b = skill.scriptFiles) == null ? void 0 : _b.length) || 0,
48124
- ")"
48125
- ] })
48126
- ]
48127
- }
48128
- ),
48129
- skill.hasReferences && /* @__PURE__ */ jsxs(
48130
- "div",
48131
- {
48132
- style: {
48133
- padding: "0.25rem 0.75rem",
48134
- borderRadius: "12px",
48135
- backgroundColor: theme2.colors.secondary,
48136
- color: theme2.colors.background,
48137
- fontSize: theme2.fontSizes[0],
48138
- fontFamily: theme2.fonts.body,
48139
- fontWeight: 500,
48140
- display: "flex",
48141
- alignItems: "center",
48142
- gap: "0.5rem"
48143
- },
48144
- title: (_c = skill.referenceFiles) == null ? void 0 : _c.join(", "),
48145
- children: [
48146
- /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
48147
- /* @__PURE__ */ jsxs("span", { children: [
48148
- "References (",
48149
- ((_d = skill.referenceFiles) == null ? void 0 : _d.length) || 0,
48150
- ")"
48151
- ] })
48152
- ]
48153
- }
48154
- ),
48155
- skill.hasAssets && /* @__PURE__ */ jsxs(
48156
- "div",
48157
- {
48158
- style: {
48159
- padding: "0.25rem 0.75rem",
48160
- borderRadius: "12px",
48161
- backgroundColor: theme2.colors.accent,
48162
- color: theme2.colors.background,
48163
- fontSize: theme2.fontSizes[0],
48164
- fontFamily: theme2.fonts.body,
48165
- fontWeight: 500,
48166
- display: "flex",
48167
- alignItems: "center",
48168
- gap: "0.5rem"
48169
- },
48170
- title: (_e2 = skill.assetFiles) == null ? void 0 : _e2.join(", "),
48171
- children: [
48172
- /* @__PURE__ */ jsx(Package, { size: 14 }),
48173
- /* @__PURE__ */ jsxs("span", { children: [
48174
- "Assets (",
48175
- ((_f = skill.assetFiles) == null ? void 0 : _f.length) || 0,
48176
- ")"
48177
- ] })
48178
- ]
48179
- }
48180
- )
48181
- ]
48182
- }
48183
- ),
48184
- !skill.hasFrontmatter && /* @__PURE__ */ jsxs(
48185
- "div",
48186
- {
48187
- style: {
48188
- padding: "1rem",
48189
- borderBottom: `1px solid ${theme2.colors.border}`,
48190
- display: "flex",
48191
- alignItems: "center",
48192
- gap: "0.75rem",
48193
- backgroundColor: "#f59e0b15",
48194
- // warning amber background
48195
- borderLeft: "4px solid #f59e0b"
48196
- },
48197
- children: [
48198
- /* @__PURE__ */ jsx(TriangleAlert, { size: 20, color: "#f59e0b" }),
48199
- /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
48200
- /* @__PURE__ */ jsx(
48201
- "div",
48202
- {
48203
- style: {
48204
- fontSize: theme2.fontSizes[1],
48205
- color: "#f59e0b",
48206
- fontFamily: theme2.fonts.body,
48207
- fontWeight: theme2.fontWeights.semibold,
48208
- marginBottom: "0.25rem"
48209
- },
48210
- children: "Missing YAML Frontmatter"
48211
- }
48212
- ),
48213
- /* @__PURE__ */ jsx(
48214
- "div",
48215
- {
48216
- style: {
48217
- fontSize: theme2.fontSizes[0],
48218
- color: theme2.colors.textSecondary,
48219
- fontFamily: theme2.fonts.body,
48220
- lineHeight: "1.5"
48221
- },
48222
- children: "This skill is missing YAML frontmatter metadata. Skills should have frontmatter (like backlog tasks) to properly define metadata such as name, description, and capabilities."
48223
- }
48224
- )
48225
- ] })
48226
- ]
48227
- }
48228
- ),
48229
- /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(
48230
- SkillMarkdown,
48231
- {
48232
- content: skill.content,
48233
- theme: theme2,
48234
- onParsed: handleParsed,
48235
- onError: handleError,
48236
- showRawOnError: true
48355
+ children: skill.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(
48356
+ SkillMarkdown,
48357
+ {
48358
+ content: skill.content,
48359
+ theme: theme2,
48360
+ onParsed: handleParsed,
48361
+ onWarnings: handleWarnings,
48362
+ structure: {
48363
+ hasScripts: skill.hasScripts,
48364
+ hasReferences: skill.hasReferences,
48365
+ hasAssets: skill.hasAssets,
48366
+ scriptFiles: skill.scriptFiles,
48367
+ referenceFiles: skill.referenceFiles,
48368
+ assetFiles: skill.assetFiles
48237
48369
  }
48238
- ) })
48239
- ] }) : /* @__PURE__ */ jsx(
48370
+ }
48371
+ ) }) }) : /* @__PURE__ */ jsx(
48240
48372
  "div",
48241
48373
  {
48242
48374
  style: {