@industry-theme/agent-panels 0.2.13 → 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.
- package/dist/panels/SkillDetailPanel.d.ts.map +1 -1
- package/dist/panels/skills/components/SkillMarkdown.d.ts +49 -0
- package/dist/panels/skills/components/SkillMarkdown.d.ts.map +1 -0
- package/dist/panels/skills/hooks/useSkillsData.d.ts.map +1 -1
- package/dist/panels.bundle.js +659 -579
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +3 -2
package/dist/panels.bundle.js
CHANGED
|
@@ -2620,7 +2620,8 @@ const validateFrontmatter = (content2) => {
|
|
|
2620
2620
|
const trimmedContent = content2.trim();
|
|
2621
2621
|
if (!trimmedContent.startsWith("---")) {
|
|
2622
2622
|
return {
|
|
2623
|
-
isValid:
|
|
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:
|
|
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:
|
|
2664
|
+
isValid: true,
|
|
2665
|
+
// Always valid - we show warnings but don't block rendering
|
|
2663
2666
|
hasStructure: true,
|
|
2664
2667
|
missingFields,
|
|
2665
2668
|
errorMessage
|
|
@@ -3572,6 +3575,188 @@ const SkillsListPanel = ({
|
|
|
3572
3575
|
}
|
|
3573
3576
|
);
|
|
3574
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
|
+
}
|
|
3575
3760
|
const VOID = -1;
|
|
3576
3761
|
const PRIMITIVE = 0;
|
|
3577
3762
|
const ARRAY = 1;
|
|
@@ -43102,152 +43287,6 @@ function transformImageUrl(src, repositoryInfo) {
|
|
|
43102
43287
|
const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${fullPath}`;
|
|
43103
43288
|
return rawUrl;
|
|
43104
43289
|
}
|
|
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
43290
|
var parseMarkdownChunks2 = parseMarkdownChunks;
|
|
43252
43291
|
var useIndustryHtmlModal = () => {
|
|
43253
43292
|
const [htmlModalOpen, setHtmlModalOpen] = useState(false);
|
|
@@ -47684,18 +47723,15 @@ var DocumentView = ({
|
|
|
47684
47723
|
editable
|
|
47685
47724
|
})));
|
|
47686
47725
|
};
|
|
47687
|
-
|
|
47726
|
+
const formatRelativeTime = (dateString) => {
|
|
47688
47727
|
try {
|
|
47689
47728
|
const date = new Date(dateString);
|
|
47690
47729
|
const now = /* @__PURE__ */ new Date();
|
|
47691
47730
|
const diffMs = now.getTime() - date.getTime();
|
|
47692
47731
|
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
47693
|
-
if (diffDays === 0)
|
|
47694
|
-
|
|
47695
|
-
if (diffDays
|
|
47696
|
-
return "Yesterday";
|
|
47697
|
-
if (diffDays < 7)
|
|
47698
|
-
return `${diffDays} days ago`;
|
|
47732
|
+
if (diffDays === 0) return "Today";
|
|
47733
|
+
if (diffDays === 1) return "Yesterday";
|
|
47734
|
+
if (diffDays < 7) return `${diffDays} days ago`;
|
|
47699
47735
|
if (diffDays < 30) {
|
|
47700
47736
|
const weeks = Math.floor(diffDays / 7);
|
|
47701
47737
|
return `${weeks} ${weeks === 1 ? "week" : "weeks"} ago`;
|
|
@@ -47710,267 +47746,475 @@ var formatRelativeTime = (dateString) => {
|
|
|
47710
47746
|
return dateString;
|
|
47711
47747
|
}
|
|
47712
47748
|
};
|
|
47713
|
-
|
|
47749
|
+
const SkillMetadataSection = ({
|
|
47714
47750
|
metadata,
|
|
47715
|
-
theme: theme2
|
|
47751
|
+
theme: theme2,
|
|
47752
|
+
structure
|
|
47716
47753
|
}) => {
|
|
47717
|
-
var _a, _b;
|
|
47718
|
-
|
|
47719
|
-
|
|
47720
|
-
|
|
47721
|
-
|
|
47722
|
-
|
|
47723
|
-
|
|
47724
|
-
|
|
47725
|
-
|
|
47726
|
-
|
|
47727
|
-
|
|
47728
|
-
|
|
47729
|
-
|
|
47730
|
-
|
|
47731
|
-
|
|
47732
|
-
|
|
47733
|
-
},
|
|
47734
|
-
style: { display: "flex",
|
|
47735
|
-
|
|
47736
|
-
|
|
47737
|
-
|
|
47738
|
-
|
|
47739
|
-
|
|
47740
|
-
|
|
47741
|
-
|
|
47742
|
-
|
|
47743
|
-
|
|
47744
|
-
|
|
47745
|
-
|
|
47746
|
-
|
|
47747
|
-
|
|
47748
|
-
|
|
47749
|
-
|
|
47750
|
-
|
|
47751
|
-
|
|
47752
|
-
|
|
47753
|
-
|
|
47754
|
-
|
|
47755
|
-
|
|
47756
|
-
|
|
47757
|
-
|
|
47758
|
-
|
|
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
|
+
] });
|
|
47759
48031
|
};
|
|
47760
|
-
|
|
48032
|
+
const SkillMarkdown = ({
|
|
47761
48033
|
content: content2,
|
|
47762
48034
|
theme: theme2,
|
|
47763
48035
|
className = "",
|
|
47764
48036
|
onParsed,
|
|
47765
|
-
|
|
47766
|
-
showRawOnError = false
|
|
48037
|
+
onWarnings,
|
|
48038
|
+
showRawOnError = false,
|
|
48039
|
+
containerWidth,
|
|
48040
|
+
structure
|
|
47767
48041
|
}) => {
|
|
47768
48042
|
const [parsed, setParsed] = React2__default.useState(null);
|
|
47769
|
-
const [error, setError] = React2__default.useState(null);
|
|
47770
48043
|
React2__default.useEffect(() => {
|
|
47771
|
-
|
|
47772
|
-
|
|
47773
|
-
|
|
47774
|
-
|
|
47775
|
-
|
|
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);
|
|
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);
|
|
47781
48049
|
}
|
|
47782
|
-
}, [content2, onParsed,
|
|
48050
|
+
}, [content2, onParsed, onWarnings]);
|
|
47783
48051
|
if (!theme2 || !theme2.space) {
|
|
47784
|
-
return /* @__PURE__ */
|
|
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."));
|
|
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." }) });
|
|
47790
48053
|
}
|
|
47791
|
-
if (
|
|
47792
|
-
|
|
47793
|
-
|
|
48054
|
+
if (!parsed) {
|
|
48055
|
+
return /* @__PURE__ */ jsx(
|
|
48056
|
+
"div",
|
|
48057
|
+
{
|
|
47794
48058
|
className,
|
|
47795
48059
|
style: {
|
|
48060
|
+
display: "flex",
|
|
48061
|
+
alignItems: "center",
|
|
48062
|
+
justifyContent: "center",
|
|
47796
48063
|
width: "100%",
|
|
47797
48064
|
height: "100%",
|
|
47798
|
-
|
|
48065
|
+
padding: theme2.space[4],
|
|
48066
|
+
color: theme2.colors.textSecondary,
|
|
48067
|
+
fontStyle: "italic",
|
|
47799
48068
|
background: theme2.colors.background
|
|
47800
|
-
}
|
|
47801
|
-
|
|
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]
|
|
48069
|
+
},
|
|
48070
|
+
children: "Loading..."
|
|
47849
48071
|
}
|
|
47850
|
-
|
|
48072
|
+
);
|
|
47851
48073
|
}
|
|
47852
|
-
|
|
47853
|
-
|
|
48074
|
+
return /* @__PURE__ */ jsxs(
|
|
48075
|
+
"div",
|
|
48076
|
+
{
|
|
47854
48077
|
className,
|
|
47855
48078
|
style: {
|
|
47856
|
-
display: "flex",
|
|
47857
|
-
alignItems: "center",
|
|
47858
|
-
justifyContent: "center",
|
|
47859
48079
|
width: "100%",
|
|
47860
48080
|
height: "100%",
|
|
47861
|
-
|
|
47862
|
-
|
|
47863
|
-
fontStyle: "italic",
|
|
48081
|
+
display: "flex",
|
|
48082
|
+
flexDirection: "column",
|
|
47864
48083
|
background: theme2.colors.background
|
|
47865
|
-
}
|
|
47866
|
-
|
|
47867
|
-
|
|
47868
|
-
|
|
47869
|
-
|
|
47870
|
-
|
|
47871
|
-
|
|
47872
|
-
|
|
47873
|
-
|
|
47874
|
-
|
|
47875
|
-
|
|
47876
|
-
|
|
47877
|
-
|
|
47878
|
-
|
|
47879
|
-
|
|
47880
|
-
|
|
47881
|
-
|
|
47882
|
-
|
|
47883
|
-
|
|
47884
|
-
|
|
47885
|
-
|
|
47886
|
-
|
|
47887
|
-
|
|
47888
|
-
|
|
47889
|
-
|
|
47890
|
-
|
|
47891
|
-
|
|
47892
|
-
|
|
47893
|
-
|
|
47894
|
-
|
|
47895
|
-
|
|
47896
|
-
|
|
47897
|
-
|
|
47898
|
-
|
|
47899
|
-
|
|
47900
|
-
|
|
47901
|
-
|
|
47902
|
-
|
|
47903
|
-
|
|
47904
|
-
|
|
47905
|
-
|
|
47906
|
-
|
|
47907
|
-
|
|
47908
|
-
|
|
47909
|
-
|
|
47910
|
-
|
|
47911
|
-
|
|
47912
|
-
|
|
47913
|
-
|
|
47914
|
-
|
|
47915
|
-
|
|
47916
|
-
|
|
47917
|
-
|
|
47918
|
-
|
|
47919
|
-
|
|
47920
|
-
|
|
47921
|
-
|
|
47922
|
-
|
|
47923
|
-
|
|
47924
|
-
|
|
47925
|
-
|
|
47926
|
-
|
|
47927
|
-
|
|
47928
|
-
|
|
47929
|
-
|
|
47930
|
-
|
|
47931
|
-
|
|
47932
|
-
|
|
47933
|
-
|
|
47934
|
-
|
|
47935
|
-
|
|
47936
|
-
|
|
47937
|
-
|
|
47938
|
-
|
|
47939
|
-
|
|
47940
|
-
|
|
47941
|
-
|
|
47942
|
-
|
|
47943
|
-
|
|
47944
|
-
|
|
47945
|
-
|
|
47946
|
-
|
|
47947
|
-
|
|
47948
|
-
|
|
47949
|
-
|
|
47950
|
-
|
|
47951
|
-
|
|
47952
|
-
|
|
47953
|
-
|
|
47954
|
-
|
|
47955
|
-
|
|
47956
|
-
|
|
47957
|
-
|
|
47958
|
-
|
|
47959
|
-
|
|
47960
|
-
|
|
47961
|
-
|
|
47962
|
-
|
|
47963
|
-
|
|
47964
|
-
|
|
47965
|
-
|
|
47966
|
-
|
|
47967
|
-
|
|
47968
|
-
|
|
47969
|
-
|
|
47970
|
-
|
|
47971
|
-
|
|
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
|
+
]
|
|
47972
48216
|
}
|
|
47973
|
-
|
|
48217
|
+
);
|
|
47974
48218
|
};
|
|
47975
48219
|
const SkillDetailPanel = ({
|
|
47976
48220
|
context,
|
|
@@ -47978,7 +48222,6 @@ const SkillDetailPanel = ({
|
|
|
47978
48222
|
actions,
|
|
47979
48223
|
selectedSkillId: selectedSkillIdProp
|
|
47980
48224
|
}) => {
|
|
47981
|
-
var _a, _b, _c, _d, _e2, _f;
|
|
47982
48225
|
const { theme: theme2 } = useTheme();
|
|
47983
48226
|
const { skills, isLoading, error } = useSkillsData({ context });
|
|
47984
48227
|
const [selectedSkillIdState, setSelectedSkillIdState] = useState(null);
|
|
@@ -47989,8 +48232,8 @@ const SkillDetailPanel = ({
|
|
|
47989
48232
|
"skill-detail",
|
|
47990
48233
|
events,
|
|
47991
48234
|
() => {
|
|
47992
|
-
var
|
|
47993
|
-
return (
|
|
48235
|
+
var _a;
|
|
48236
|
+
return (_a = panelRef.current) == null ? void 0 : _a.focus();
|
|
47994
48237
|
}
|
|
47995
48238
|
);
|
|
47996
48239
|
useEffect(() => {
|
|
@@ -48089,12 +48332,14 @@ const SkillDetailPanel = ({
|
|
|
48089
48332
|
);
|
|
48090
48333
|
}
|
|
48091
48334
|
const handleParsed = (parsedSkill) => {
|
|
48092
|
-
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
|
+
}
|
|
48093
48339
|
};
|
|
48094
|
-
const
|
|
48095
|
-
console.
|
|
48340
|
+
const handleWarnings = (warnings) => {
|
|
48341
|
+
console.warn("Skill validation warnings:", warnings);
|
|
48096
48342
|
};
|
|
48097
|
-
const hasStructure = skill.hasScripts || skill.hasReferences || skill.hasAssets;
|
|
48098
48343
|
return /* @__PURE__ */ jsx(
|
|
48099
48344
|
"div",
|
|
48100
48345
|
{
|
|
@@ -48107,188 +48352,23 @@ const SkillDetailPanel = ({
|
|
|
48107
48352
|
flexDirection: "column",
|
|
48108
48353
|
outline: "none"
|
|
48109
48354
|
},
|
|
48110
|
-
children: skill.content ? /* @__PURE__ */
|
|
48111
|
-
|
|
48112
|
-
|
|
48113
|
-
|
|
48114
|
-
|
|
48115
|
-
|
|
48116
|
-
|
|
48117
|
-
|
|
48118
|
-
|
|
48119
|
-
|
|
48120
|
-
|
|
48121
|
-
|
|
48122
|
-
|
|
48123
|
-
|
|
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
|
|
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
|
|
48289
48369
|
}
|
|
48290
|
-
|
|
48291
|
-
|
|
48370
|
+
}
|
|
48371
|
+
) }) }) : /* @__PURE__ */ jsx(
|
|
48292
48372
|
"div",
|
|
48293
48373
|
{
|
|
48294
48374
|
style: {
|