@industry-theme/agent-panels 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panels/SkillDetailPanel.d.ts.map +1 -1
- package/dist/panels/skills/components/SkillCard.d.ts.map +1 -1
- package/dist/panels/skills/hooks/useSkillsData.d.ts +7 -1
- package/dist/panels/skills/hooks/useSkillsData.d.ts.map +1 -1
- package/dist/panels.bundle.js +65 -24
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/SkillDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQpD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SkillDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/SkillDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQpD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAyT5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillCard.d.ts","sourceRoot":"","sources":["../../../../src/panels/skills/components/SkillCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAEjE,UAAU,cAAc;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAkDD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"SkillCard.d.ts","sourceRoot":"","sources":["../../../../src/panels/skills/components/SkillCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAEjE,UAAU,cAAc;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAkDD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA+S9C,CAAC"}
|
|
@@ -11,6 +11,12 @@ export interface SkillMetadata {
|
|
|
11
11
|
sha?: string;
|
|
12
12
|
files?: string[];
|
|
13
13
|
}
|
|
14
|
+
export interface FrontmatterValidation {
|
|
15
|
+
isValid: boolean;
|
|
16
|
+
hasStructure: boolean;
|
|
17
|
+
missingFields: string[];
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
}
|
|
14
20
|
export interface Skill {
|
|
15
21
|
id: string;
|
|
16
22
|
name: string;
|
|
@@ -28,7 +34,7 @@ export interface Skill {
|
|
|
28
34
|
source: SkillSource;
|
|
29
35
|
priority: 1 | 2 | 3 | 4 | 5;
|
|
30
36
|
metadata?: SkillMetadata;
|
|
31
|
-
|
|
37
|
+
frontmatterValidation: FrontmatterValidation;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Global skills data provided by the host application
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSkillsData.d.ts","sourceRoot":"","sources":["../../../../src/panels/skills/hooks/useSkillsData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,MAAM,WAAW,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,eAAe,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE5B,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzB,
|
|
1
|
+
{"version":3,"file":"useSkillsData.d.ts","sourceRoot":"","sources":["../../../../src/panels/skills/hooks/useSkillsData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,MAAM,WAAW,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,eAAe,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE5B,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzB,qBAAqB,EAAE,qBAAqB,CAAC;CAC9C;AAKD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,UAAU,mBAAmB;IAC3B,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,UAAU,mBAAmB;IAC3B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAiQD;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,cAE3B,mBAAmB,KAAG,mBAiHxB,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -2616,10 +2616,15 @@ const analyzeSkillStructure = (fileTree, skillPath) => {
|
|
|
2616
2616
|
assetFiles
|
|
2617
2617
|
};
|
|
2618
2618
|
};
|
|
2619
|
-
const
|
|
2619
|
+
const validateFrontmatter = (content2) => {
|
|
2620
2620
|
const trimmedContent = content2.trim();
|
|
2621
2621
|
if (!trimmedContent.startsWith("---")) {
|
|
2622
|
-
return
|
|
2622
|
+
return {
|
|
2623
|
+
isValid: false,
|
|
2624
|
+
hasStructure: false,
|
|
2625
|
+
missingFields: [],
|
|
2626
|
+
errorMessage: "Missing YAML frontmatter (must start with ---)"
|
|
2627
|
+
};
|
|
2623
2628
|
}
|
|
2624
2629
|
const lines = trimmedContent.split("\n");
|
|
2625
2630
|
let frontmatterEnd = -1;
|
|
@@ -2629,7 +2634,36 @@ const hasFrontmatterYAML = (content2) => {
|
|
|
2629
2634
|
break;
|
|
2630
2635
|
}
|
|
2631
2636
|
}
|
|
2632
|
-
|
|
2637
|
+
if (frontmatterEnd <= 0) {
|
|
2638
|
+
return {
|
|
2639
|
+
isValid: false,
|
|
2640
|
+
hasStructure: false,
|
|
2641
|
+
missingFields: [],
|
|
2642
|
+
errorMessage: "Missing closing --- delimiter for frontmatter"
|
|
2643
|
+
};
|
|
2644
|
+
}
|
|
2645
|
+
const frontmatterLines = lines.slice(1, frontmatterEnd);
|
|
2646
|
+
const frontmatterText = frontmatterLines.join("\n");
|
|
2647
|
+
const missingFields = [];
|
|
2648
|
+
const hasName = /^name:\s*.+/m.test(frontmatterText);
|
|
2649
|
+
const hasDescription = /^description:\s*.+/m.test(frontmatterText);
|
|
2650
|
+
if (!hasName) {
|
|
2651
|
+
missingFields.push("name");
|
|
2652
|
+
}
|
|
2653
|
+
if (!hasDescription) {
|
|
2654
|
+
missingFields.push("description");
|
|
2655
|
+
}
|
|
2656
|
+
let errorMessage;
|
|
2657
|
+
if (missingFields.length > 0) {
|
|
2658
|
+
const fieldList = missingFields.map((f) => `'${f}'`).join(", ");
|
|
2659
|
+
errorMessage = `Missing required field${missingFields.length > 1 ? "s" : ""}: ${fieldList}`;
|
|
2660
|
+
}
|
|
2661
|
+
return {
|
|
2662
|
+
isValid: missingFields.length === 0,
|
|
2663
|
+
hasStructure: true,
|
|
2664
|
+
missingFields,
|
|
2665
|
+
errorMessage
|
|
2666
|
+
};
|
|
2633
2667
|
};
|
|
2634
2668
|
const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, isBrowserMode = false) => {
|
|
2635
2669
|
const pathParts = path2.split("/");
|
|
@@ -2670,7 +2704,7 @@ const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, i
|
|
|
2670
2704
|
console.debug("[useSkillsData] No metadata file for skill:", skillDirName);
|
|
2671
2705
|
}
|
|
2672
2706
|
}
|
|
2673
|
-
const
|
|
2707
|
+
const frontmatterValidation = validateFrontmatter(content2);
|
|
2674
2708
|
return {
|
|
2675
2709
|
id: path2,
|
|
2676
2710
|
name: skillDirName.replace(/-/g, " ").replace(/_/g, " "),
|
|
@@ -2683,7 +2717,7 @@ const parseSkillContent = async (content2, path2, fileTree, fileSystemAdapter, i
|
|
|
2683
2717
|
source: source2,
|
|
2684
2718
|
priority,
|
|
2685
2719
|
metadata,
|
|
2686
|
-
|
|
2720
|
+
frontmatterValidation
|
|
2687
2721
|
};
|
|
2688
2722
|
};
|
|
2689
2723
|
const useSkillsData = ({
|
|
@@ -2934,7 +2968,7 @@ Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).t
|
|
|
2934
2968
|
]
|
|
2935
2969
|
}
|
|
2936
2970
|
),
|
|
2937
|
-
!skill.
|
|
2971
|
+
!skill.frontmatterValidation.isValid && /* @__PURE__ */ jsxs(
|
|
2938
2972
|
"div",
|
|
2939
2973
|
{
|
|
2940
2974
|
style: {
|
|
@@ -2951,10 +2985,10 @@ Installed: ${skill.metadata.installedAt ? new Date(skill.metadata.installedAt).t
|
|
|
2951
2985
|
fontWeight: 500,
|
|
2952
2986
|
width: "fit-content"
|
|
2953
2987
|
},
|
|
2954
|
-
title:
|
|
2988
|
+
title: skill.frontmatterValidation.errorMessage || "Invalid frontmatter",
|
|
2955
2989
|
children: [
|
|
2956
2990
|
/* @__PURE__ */ jsx(TriangleAlert, { size: 10 }),
|
|
2957
|
-
/* @__PURE__ */ jsx("span", { children: "No Frontmatter" })
|
|
2991
|
+
/* @__PURE__ */ jsx("span", { children: skill.frontmatterValidation.hasStructure ? skill.frontmatterValidation.missingFields.length > 0 ? `Missing: ${skill.frontmatterValidation.missingFields.join(", ")}` : "Invalid Frontmatter" : "No Frontmatter" })
|
|
2958
2992
|
]
|
|
2959
2993
|
}
|
|
2960
2994
|
)
|
|
@@ -47973,24 +48007,13 @@ const SkillDetailPanel = ({
|
|
|
47973
48007
|
return unsubscribe;
|
|
47974
48008
|
}, [events, selectedSkillIdProp]);
|
|
47975
48009
|
useEffect(() => {
|
|
47976
|
-
console.log("[SkillDetailPanel] Effect:", {
|
|
47977
|
-
selectedSkillId,
|
|
47978
|
-
selectedSkillIdProp,
|
|
47979
|
-
skillsCount: skills.length,
|
|
47980
|
-
isLoading,
|
|
47981
|
-
skills: skills.map((s2) => ({ id: s2.id, name: s2.name }))
|
|
47982
|
-
});
|
|
47983
48010
|
if (selectedSkillId && skills.length > 0) {
|
|
47984
48011
|
const foundSkill = skills.find((s2) => s2.id === selectedSkillId);
|
|
47985
|
-
console.log("[SkillDetailPanel] Found skill:", foundSkill == null ? void 0 : foundSkill.name, "for ID:", selectedSkillId);
|
|
47986
48012
|
setSkill(foundSkill || null);
|
|
47987
48013
|
} else if (!selectedSkillId) {
|
|
47988
|
-
console.log("[SkillDetailPanel] No selectedSkillId");
|
|
47989
48014
|
setSkill(null);
|
|
47990
|
-
} else {
|
|
47991
|
-
console.log("[SkillDetailPanel] Skills not loaded yet, selectedSkillId:", selectedSkillId);
|
|
47992
48015
|
}
|
|
47993
|
-
}, [selectedSkillId, skills
|
|
48016
|
+
}, [selectedSkillId, skills]);
|
|
47994
48017
|
if (error) {
|
|
47995
48018
|
return /* @__PURE__ */ jsx(
|
|
47996
48019
|
"div",
|
|
@@ -48192,7 +48215,7 @@ const SkillDetailPanel = ({
|
|
|
48192
48215
|
]
|
|
48193
48216
|
}
|
|
48194
48217
|
),
|
|
48195
|
-
!skill.
|
|
48218
|
+
!skill.frontmatterValidation.isValid && /* @__PURE__ */ jsxs(
|
|
48196
48219
|
"div",
|
|
48197
48220
|
{
|
|
48198
48221
|
style: {
|
|
@@ -48218,10 +48241,10 @@ const SkillDetailPanel = ({
|
|
|
48218
48241
|
fontWeight: theme2.fontWeights.semibold,
|
|
48219
48242
|
marginBottom: "0.25rem"
|
|
48220
48243
|
},
|
|
48221
|
-
children: "
|
|
48244
|
+
children: "Invalid Skill Frontmatter"
|
|
48222
48245
|
}
|
|
48223
48246
|
),
|
|
48224
|
-
/* @__PURE__ */
|
|
48247
|
+
/* @__PURE__ */ jsxs(
|
|
48225
48248
|
"div",
|
|
48226
48249
|
{
|
|
48227
48250
|
style: {
|
|
@@ -48230,7 +48253,25 @@ const SkillDetailPanel = ({
|
|
|
48230
48253
|
fontFamily: theme2.fonts.body,
|
|
48231
48254
|
lineHeight: "1.5"
|
|
48232
48255
|
},
|
|
48233
|
-
children:
|
|
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
|
+
]
|
|
48234
48275
|
}
|
|
48235
48276
|
)
|
|
48236
48277
|
] })
|