@industry-theme/agent-panels 0.2.20 → 0.2.21

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.
@@ -2201,7 +2201,7 @@ const createLucideIcon = (iconName, iconNode) => {
2201
2201
  * This source code is licensed under the ISC license.
2202
2202
  * See the LICENSE file in the root directory of this source tree.
2203
2203
  */
2204
- const __iconNode$o = [
2204
+ const __iconNode$t = [
2205
2205
  ["path", { d: "M12 7v14", key: "1akyts" }],
2206
2206
  [
2207
2207
  "path",
@@ -2211,14 +2211,14 @@ const __iconNode$o = [
2211
2211
  }
2212
2212
  ]
2213
2213
  ];
2214
- const BookOpen = createLucideIcon("book-open", __iconNode$o);
2214
+ const BookOpen = createLucideIcon("book-open", __iconNode$t);
2215
2215
  /**
2216
2216
  * @license lucide-react v0.552.0 - ISC
2217
2217
  *
2218
2218
  * This source code is licensed under the ISC license.
2219
2219
  * See the LICENSE file in the root directory of this source tree.
2220
2220
  */
2221
- const __iconNode$n = [
2221
+ const __iconNode$s = [
2222
2222
  ["path", { d: "M12 8V4H8", key: "hb8ula" }],
2223
2223
  ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
2224
2224
  ["path", { d: "M2 14h2", key: "vft8re" }],
@@ -2226,76 +2226,100 @@ const __iconNode$n = [
2226
2226
  ["path", { d: "M15 13v2", key: "1xurst" }],
2227
2227
  ["path", { d: "M9 13v2", key: "rq6x2g" }]
2228
2228
  ];
2229
- const Bot = createLucideIcon("bot", __iconNode$n);
2229
+ const Bot = createLucideIcon("bot", __iconNode$s);
2230
2230
  /**
2231
2231
  * @license lucide-react v0.552.0 - ISC
2232
2232
  *
2233
2233
  * This source code is licensed under the ISC license.
2234
2234
  * See the LICENSE file in the root directory of this source tree.
2235
2235
  */
2236
- const __iconNode$m = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
2237
- const Check = createLucideIcon("check", __iconNode$m);
2236
+ const __iconNode$r = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
2237
+ const Check = createLucideIcon("check", __iconNode$r);
2238
2238
  /**
2239
2239
  * @license lucide-react v0.552.0 - ISC
2240
2240
  *
2241
2241
  * This source code is licensed under the ISC license.
2242
2242
  * See the LICENSE file in the root directory of this source tree.
2243
2243
  */
2244
- const __iconNode$l = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
2245
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$l);
2244
+ const __iconNode$q = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
2245
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$q);
2246
2246
  /**
2247
2247
  * @license lucide-react v0.552.0 - ISC
2248
2248
  *
2249
2249
  * This source code is licensed under the ISC license.
2250
2250
  * See the LICENSE file in the root directory of this source tree.
2251
2251
  */
2252
- const __iconNode$k = [
2252
+ const __iconNode$p = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
2253
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$p);
2254
+ /**
2255
+ * @license lucide-react v0.552.0 - ISC
2256
+ *
2257
+ * This source code is licensed under the ISC license.
2258
+ * See the LICENSE file in the root directory of this source tree.
2259
+ */
2260
+ const __iconNode$o = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
2261
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$o);
2262
+ /**
2263
+ * @license lucide-react v0.552.0 - ISC
2264
+ *
2265
+ * This source code is licensed under the ISC license.
2266
+ * See the LICENSE file in the root directory of this source tree.
2267
+ */
2268
+ const __iconNode$n = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
2269
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$n);
2270
+ /**
2271
+ * @license lucide-react v0.552.0 - ISC
2272
+ *
2273
+ * This source code is licensed under the ISC license.
2274
+ * See the LICENSE file in the root directory of this source tree.
2275
+ */
2276
+ const __iconNode$m = [
2253
2277
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
2254
2278
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
2255
2279
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
2256
2280
  ];
2257
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$k);
2281
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$m);
2258
2282
  /**
2259
2283
  * @license lucide-react v0.552.0 - ISC
2260
2284
  *
2261
2285
  * This source code is licensed under the ISC license.
2262
2286
  * See the LICENSE file in the root directory of this source tree.
2263
2287
  */
2264
- const __iconNode$j = [
2288
+ const __iconNode$l = [
2265
2289
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
2266
2290
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
2267
2291
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
2268
2292
  ];
2269
- const CodeXml = createLucideIcon("code-xml", __iconNode$j);
2293
+ const CodeXml = createLucideIcon("code-xml", __iconNode$l);
2270
2294
  /**
2271
2295
  * @license lucide-react v0.552.0 - ISC
2272
2296
  *
2273
2297
  * This source code is licensed under the ISC license.
2274
2298
  * See the LICENSE file in the root directory of this source tree.
2275
2299
  */
2276
- const __iconNode$i = [
2300
+ const __iconNode$k = [
2277
2301
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
2278
2302
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
2279
2303
  ];
2280
- const Code = createLucideIcon("code", __iconNode$i);
2304
+ const Code = createLucideIcon("code", __iconNode$k);
2281
2305
  /**
2282
2306
  * @license lucide-react v0.552.0 - ISC
2283
2307
  *
2284
2308
  * This source code is licensed under the ISC license.
2285
2309
  * See the LICENSE file in the root directory of this source tree.
2286
2310
  */
2287
- const __iconNode$h = [
2311
+ const __iconNode$j = [
2288
2312
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
2289
2313
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
2290
2314
  ];
2291
- const Copy = createLucideIcon("copy", __iconNode$h);
2315
+ const Copy = createLucideIcon("copy", __iconNode$j);
2292
2316
  /**
2293
2317
  * @license lucide-react v0.552.0 - ISC
2294
2318
  *
2295
2319
  * This source code is licensed under the ISC license.
2296
2320
  * See the LICENSE file in the root directory of this source tree.
2297
2321
  */
2298
- const __iconNode$g = [
2322
+ const __iconNode$i = [
2299
2323
  ["path", { d: "m15 15 6 6", key: "1s409w" }],
2300
2324
  ["path", { d: "m15 9 6-6", key: "ko1vev" }],
2301
2325
  ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
@@ -2305,14 +2329,26 @@ const __iconNode$g = [
2305
2329
  ["path", { d: "M3 8V3h5", key: "1ln10m" }],
2306
2330
  ["path", { d: "M9 9 3 3", key: "v551iv" }]
2307
2331
  ];
2308
- const Expand = createLucideIcon("expand", __iconNode$g);
2332
+ const Expand = createLucideIcon("expand", __iconNode$i);
2309
2333
  /**
2310
2334
  * @license lucide-react v0.552.0 - ISC
2311
2335
  *
2312
2336
  * This source code is licensed under the ISC license.
2313
2337
  * See the LICENSE file in the root directory of this source tree.
2314
2338
  */
2315
- const __iconNode$f = [
2339
+ const __iconNode$h = [
2340
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
2341
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
2342
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
2343
+ ];
2344
+ const ExternalLink = createLucideIcon("external-link", __iconNode$h);
2345
+ /**
2346
+ * @license lucide-react v0.552.0 - ISC
2347
+ *
2348
+ * This source code is licensed under the ISC license.
2349
+ * See the LICENSE file in the root directory of this source tree.
2350
+ */
2351
+ const __iconNode$g = [
2316
2352
  [
2317
2353
  "path",
2318
2354
  {
@@ -2324,7 +2360,31 @@ const __iconNode$f = [
2324
2360
  ["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
2325
2361
  ["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }]
2326
2362
  ];
2327
- const FileCode = createLucideIcon("file-code", __iconNode$f);
2363
+ const FileCode = createLucideIcon("file-code", __iconNode$g);
2364
+ /**
2365
+ * @license lucide-react v0.552.0 - ISC
2366
+ *
2367
+ * This source code is licensed under the ISC license.
2368
+ * See the LICENSE file in the root directory of this source tree.
2369
+ */
2370
+ const __iconNode$f = [
2371
+ [
2372
+ "path",
2373
+ {
2374
+ d: "M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",
2375
+ key: "o6klzx"
2376
+ }
2377
+ ],
2378
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
2379
+ [
2380
+ "path",
2381
+ {
2382
+ d: "M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",
2383
+ key: "zhnas1"
2384
+ }
2385
+ ]
2386
+ ];
2387
+ const FilePen = createLucideIcon("file-pen", __iconNode$f);
2328
2388
  /**
2329
2389
  * @license lucide-react v0.552.0 - ISC
2330
2390
  *
@@ -48050,6 +48110,7 @@ const SkillSidebar = ({
48050
48110
  skill
48051
48111
  }) => {
48052
48112
  const [activeTab, setActiveTab] = React2__default.useState("toc");
48113
+ const [isCollapsed, setIsCollapsed] = React2__default.useState(false);
48053
48114
  const hasMetadata = metadata.compatibility || metadata["allowed-tools"] && metadata["allowed-tools"].length > 0 || metadata.metadata && Object.keys(metadata.metadata).length > 0 || (skill == null ? void 0 : skill.installedLocations) && skill.installedLocations.length > 1;
48054
48115
  React2__default.useEffect(() => {
48055
48116
  if (headers.length === 0 && hasMetadata) {
@@ -48064,14 +48125,53 @@ const SkillSidebar = ({
48064
48125
  {
48065
48126
  className,
48066
48127
  style: {
48067
- width: "250px",
48128
+ width: isCollapsed ? "0px" : "250px",
48068
48129
  flexShrink: 0,
48069
48130
  display: "flex",
48070
48131
  flexDirection: "column",
48071
- borderRight: `1px solid ${theme2.colors.border}`
48132
+ borderRight: isCollapsed ? "none" : `1px solid ${theme2.colors.border}`,
48133
+ position: "relative",
48134
+ transition: "width 0.3s ease",
48135
+ overflow: "visible"
48072
48136
  },
48073
48137
  children: [
48074
- /* @__PURE__ */ jsxs(
48138
+ /* @__PURE__ */ jsx(
48139
+ "button",
48140
+ {
48141
+ onClick: () => setIsCollapsed(!isCollapsed),
48142
+ style: {
48143
+ position: "absolute",
48144
+ right: "-20px",
48145
+ top: "16px",
48146
+ width: "20px",
48147
+ height: "60px",
48148
+ padding: 0,
48149
+ backgroundColor: theme2.colors.backgroundSecondary,
48150
+ border: `1px solid ${theme2.colors.border}`,
48151
+ borderLeft: "none",
48152
+ borderTopRightRadius: "8px",
48153
+ borderBottomRightRadius: "8px",
48154
+ cursor: "pointer",
48155
+ display: "flex",
48156
+ alignItems: "center",
48157
+ justifyContent: "center",
48158
+ color: theme2.colors.textSecondary,
48159
+ transition: "all 0.2s",
48160
+ zIndex: 10
48161
+ },
48162
+ onMouseEnter: (e) => {
48163
+ e.currentTarget.style.backgroundColor = theme2.colors.primary;
48164
+ e.currentTarget.style.color = theme2.colors.background;
48165
+ },
48166
+ onMouseLeave: (e) => {
48167
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
48168
+ e.currentTarget.style.color = theme2.colors.textSecondary;
48169
+ },
48170
+ title: isCollapsed ? "Expand sidebar" : "Collapse sidebar",
48171
+ children: isCollapsed ? /* @__PURE__ */ jsx(ChevronRight, { size: 14 }) : /* @__PURE__ */ jsx(ChevronLeft, { size: 14 })
48172
+ }
48173
+ ),
48174
+ !isCollapsed && /* @__PURE__ */ jsxs(
48075
48175
  "div",
48076
48176
  {
48077
48177
  style: {
@@ -48143,7 +48243,7 @@ const SkillSidebar = ({
48143
48243
  ]
48144
48244
  }
48145
48245
  ),
48146
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
48246
+ !isCollapsed && /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
48147
48247
  activeTab === "toc" && headers.length > 0 && /* @__PURE__ */ jsx(
48148
48248
  TableOfContents,
48149
48249
  {
@@ -48388,11 +48488,117 @@ const formatRelativeTime = (dateString) => {
48388
48488
  return dateString;
48389
48489
  }
48390
48490
  };
48491
+ const SearchBar = ({ theme: theme2, searchQuery, onSearchChange, currentMatch, totalMatches, onPrevious, onNext, onClose }) => {
48492
+ const inputRef = React2__default.useRef(null);
48493
+ React2__default.useEffect(() => {
48494
+ var _a;
48495
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
48496
+ }, []);
48497
+ return /* @__PURE__ */ jsxs("div", { style: {
48498
+ display: "flex",
48499
+ alignItems: "center",
48500
+ gap: theme2.space[2],
48501
+ padding: theme2.space[2],
48502
+ backgroundColor: theme2.colors.backgroundSecondary,
48503
+ borderBottom: `1px solid ${theme2.colors.border}`
48504
+ }, children: [
48505
+ /* @__PURE__ */ jsx(Search, { size: 16, color: theme2.colors.textSecondary }),
48506
+ /* @__PURE__ */ jsx(
48507
+ "input",
48508
+ {
48509
+ ref: inputRef,
48510
+ type: "text",
48511
+ placeholder: "Find in skill...",
48512
+ value: searchQuery,
48513
+ onChange: (e) => onSearchChange(e.target.value),
48514
+ style: {
48515
+ flex: 1,
48516
+ padding: "0.375rem 0.75rem",
48517
+ fontSize: theme2.fontSizes[2],
48518
+ fontFamily: theme2.fonts.body,
48519
+ color: theme2.colors.text,
48520
+ backgroundColor: theme2.colors.background,
48521
+ border: `1px solid ${theme2.colors.border}`,
48522
+ borderRadius: "6px",
48523
+ outline: "none"
48524
+ },
48525
+ onFocus: (e) => e.currentTarget.style.borderColor = theme2.colors.primary,
48526
+ onBlur: (e) => e.currentTarget.style.borderColor = theme2.colors.border
48527
+ }
48528
+ ),
48529
+ totalMatches > 0 && /* @__PURE__ */ jsxs("span", { style: {
48530
+ fontSize: theme2.fontSizes[1],
48531
+ color: theme2.colors.textSecondary,
48532
+ fontFamily: theme2.fonts.monospace,
48533
+ whiteSpace: "nowrap"
48534
+ }, children: [
48535
+ currentMatch + 1,
48536
+ " / ",
48537
+ totalMatches
48538
+ ] }),
48539
+ /* @__PURE__ */ jsx(
48540
+ "button",
48541
+ {
48542
+ onClick: onPrevious,
48543
+ disabled: totalMatches === 0,
48544
+ style: {
48545
+ padding: "0.375rem",
48546
+ backgroundColor: "transparent",
48547
+ border: `1px solid ${theme2.colors.border}`,
48548
+ borderRadius: "4px",
48549
+ cursor: totalMatches === 0 ? "not-allowed" : "pointer",
48550
+ display: "flex",
48551
+ alignItems: "center",
48552
+ opacity: totalMatches === 0 ? 0.5 : 1
48553
+ },
48554
+ title: "Previous match",
48555
+ children: /* @__PURE__ */ jsx(ChevronUp, { size: 16, color: theme2.colors.text })
48556
+ }
48557
+ ),
48558
+ /* @__PURE__ */ jsx(
48559
+ "button",
48560
+ {
48561
+ onClick: onNext,
48562
+ disabled: totalMatches === 0,
48563
+ style: {
48564
+ padding: "0.375rem",
48565
+ backgroundColor: "transparent",
48566
+ border: `1px solid ${theme2.colors.border}`,
48567
+ borderRadius: "4px",
48568
+ cursor: totalMatches === 0 ? "not-allowed" : "pointer",
48569
+ display: "flex",
48570
+ alignItems: "center",
48571
+ opacity: totalMatches === 0 ? 0.5 : 1
48572
+ },
48573
+ title: "Next match",
48574
+ children: /* @__PURE__ */ jsx(ChevronDown, { size: 16, color: theme2.colors.text })
48575
+ }
48576
+ ),
48577
+ /* @__PURE__ */ jsx(
48578
+ "button",
48579
+ {
48580
+ onClick: onClose,
48581
+ style: {
48582
+ padding: "0.375rem",
48583
+ backgroundColor: "transparent",
48584
+ border: `1px solid ${theme2.colors.border}`,
48585
+ borderRadius: "4px",
48586
+ cursor: "pointer",
48587
+ display: "flex",
48588
+ alignItems: "center"
48589
+ },
48590
+ title: "Close search",
48591
+ children: /* @__PURE__ */ jsx(X, { size: 16, color: theme2.colors.text })
48592
+ }
48593
+ )
48594
+ ] });
48595
+ };
48391
48596
  const SkillMetadataSection = ({
48392
48597
  metadata,
48393
48598
  theme: theme2,
48394
48599
  structure,
48395
- skill
48600
+ skill,
48601
+ actions
48396
48602
  }) => {
48397
48603
  var _a, _b, _c, _d, _e2;
48398
48604
  const [expandedSections, setExpandedSections] = React2__default.useState({
@@ -48480,112 +48686,202 @@ const SkillMetadataSection = ({
48480
48686
  children: "(No description provided)"
48481
48687
  }
48482
48688
  ),
48483
- structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) && /* @__PURE__ */ jsxs("div", { style: {
48689
+ structure && (structure.hasScripts || structure.hasReferences || structure.hasAssets) || actions && (skill == null ? void 0 : skill.path) ? /* @__PURE__ */ jsxs("div", { style: {
48484
48690
  marginTop: theme2.space[3]
48485
48691
  }, children: [
48486
48692
  /* @__PURE__ */ jsxs("div", { style: {
48487
48693
  display: "flex",
48488
48694
  gap: theme2.space[2],
48489
- flexWrap: "wrap"
48695
+ flexWrap: "wrap",
48696
+ justifyContent: "space-between",
48697
+ alignItems: "center"
48490
48698
  }, children: [
48491
- structure.hasScripts && /* @__PURE__ */ jsxs(
48492
- "button",
48493
- {
48494
- onClick: () => toggleSection("scripts"),
48495
- style: {
48496
- padding: "0.25rem 0.75rem",
48497
- borderRadius: "12px",
48498
- backgroundColor: theme2.colors.primary,
48499
- color: theme2.colors.background,
48500
- fontSize: theme2.fontSizes[0],
48501
- fontFamily: theme2.fonts.body,
48502
- fontWeight: 500,
48503
- display: "flex",
48504
- alignItems: "center",
48505
- gap: "0.5rem",
48506
- border: "none",
48507
- cursor: "pointer",
48508
- transition: "opacity 0.2s"
48509
- },
48510
- onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48511
- onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48512
- children: [
48513
- /* @__PURE__ */ jsx(Code, { size: 14 }),
48514
- /* @__PURE__ */ jsxs("span", { children: [
48515
- "Scripts (",
48516
- ((_c = structure.scriptFiles) == null ? void 0 : _c.length) || 0,
48517
- ")"
48518
- ] }),
48519
- /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.scripts ? "▼" : "▶" })
48520
- ]
48521
- }
48522
- ),
48523
- structure.hasReferences && /* @__PURE__ */ jsxs(
48524
- "button",
48525
- {
48526
- onClick: () => toggleSection("references"),
48527
- style: {
48528
- padding: "0.25rem 0.75rem",
48529
- borderRadius: "12px",
48530
- backgroundColor: theme2.colors.secondary,
48531
- color: theme2.colors.background,
48532
- fontSize: theme2.fontSizes[0],
48533
- fontFamily: theme2.fonts.body,
48534
- fontWeight: 500,
48535
- display: "flex",
48536
- alignItems: "center",
48537
- gap: "0.5rem",
48538
- border: "none",
48539
- cursor: "pointer",
48540
- transition: "opacity 0.2s"
48541
- },
48542
- onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48543
- onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48544
- children: [
48545
- /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
48546
- /* @__PURE__ */ jsxs("span", { children: [
48547
- "References (",
48548
- ((_d = structure.referenceFiles) == null ? void 0 : _d.length) || 0,
48549
- ")"
48550
- ] }),
48551
- /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.references ? "▼" : "▶" })
48552
- ]
48553
- }
48554
- ),
48555
- structure.hasAssets && /* @__PURE__ */ jsxs(
48556
- "button",
48557
- {
48558
- onClick: () => toggleSection("assets"),
48559
- style: {
48560
- padding: "0.25rem 0.75rem",
48561
- borderRadius: "12px",
48562
- backgroundColor: theme2.colors.accent,
48563
- color: theme2.colors.background,
48564
- fontSize: theme2.fontSizes[0],
48565
- fontFamily: theme2.fonts.body,
48566
- fontWeight: 500,
48567
- display: "flex",
48568
- alignItems: "center",
48569
- gap: "0.5rem",
48570
- border: "none",
48571
- cursor: "pointer",
48572
- transition: "opacity 0.2s"
48573
- },
48574
- onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48575
- onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48576
- children: [
48577
- /* @__PURE__ */ jsx(Package, { size: 14 }),
48578
- /* @__PURE__ */ jsxs("span", { children: [
48579
- "Assets (",
48580
- ((_e2 = structure.assetFiles) == null ? void 0 : _e2.length) || 0,
48581
- ")"
48582
- ] }),
48583
- /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.assets ? "▼" : "▶" })
48584
- ]
48585
- }
48586
- )
48699
+ /* @__PURE__ */ jsxs("div", { style: {
48700
+ display: "flex",
48701
+ gap: theme2.space[2],
48702
+ flexWrap: "wrap"
48703
+ }, children: [
48704
+ (structure == null ? void 0 : structure.hasScripts) && /* @__PURE__ */ jsxs(
48705
+ "button",
48706
+ {
48707
+ onClick: () => toggleSection("scripts"),
48708
+ style: {
48709
+ padding: "0.25rem 0.75rem",
48710
+ borderRadius: "12px",
48711
+ backgroundColor: theme2.colors.primary,
48712
+ color: theme2.colors.background,
48713
+ fontSize: theme2.fontSizes[0],
48714
+ fontFamily: theme2.fonts.body,
48715
+ fontWeight: 500,
48716
+ display: "flex",
48717
+ alignItems: "center",
48718
+ gap: "0.5rem",
48719
+ border: "none",
48720
+ cursor: "pointer",
48721
+ transition: "opacity 0.2s"
48722
+ },
48723
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48724
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48725
+ children: [
48726
+ /* @__PURE__ */ jsx(Code, { size: 14 }),
48727
+ /* @__PURE__ */ jsxs("span", { children: [
48728
+ "Scripts (",
48729
+ ((_c = structure.scriptFiles) == null ? void 0 : _c.length) || 0,
48730
+ ")"
48731
+ ] }),
48732
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.scripts ? "▼" : "▶" })
48733
+ ]
48734
+ }
48735
+ ),
48736
+ (structure == null ? void 0 : structure.hasReferences) && /* @__PURE__ */ jsxs(
48737
+ "button",
48738
+ {
48739
+ onClick: () => toggleSection("references"),
48740
+ style: {
48741
+ padding: "0.25rem 0.75rem",
48742
+ borderRadius: "12px",
48743
+ backgroundColor: theme2.colors.secondary,
48744
+ color: theme2.colors.background,
48745
+ fontSize: theme2.fontSizes[0],
48746
+ fontFamily: theme2.fonts.body,
48747
+ fontWeight: 500,
48748
+ display: "flex",
48749
+ alignItems: "center",
48750
+ gap: "0.5rem",
48751
+ border: "none",
48752
+ cursor: "pointer",
48753
+ transition: "opacity 0.2s"
48754
+ },
48755
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48756
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48757
+ children: [
48758
+ /* @__PURE__ */ jsx(BookOpen, { size: 14 }),
48759
+ /* @__PURE__ */ jsxs("span", { children: [
48760
+ "References (",
48761
+ ((_d = structure.referenceFiles) == null ? void 0 : _d.length) || 0,
48762
+ ")"
48763
+ ] }),
48764
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.references ? "▼" : "▶" })
48765
+ ]
48766
+ }
48767
+ ),
48768
+ (structure == null ? void 0 : structure.hasAssets) && /* @__PURE__ */ jsxs(
48769
+ "button",
48770
+ {
48771
+ onClick: () => toggleSection("assets"),
48772
+ style: {
48773
+ padding: "0.25rem 0.75rem",
48774
+ borderRadius: "12px",
48775
+ backgroundColor: theme2.colors.accent,
48776
+ color: theme2.colors.background,
48777
+ fontSize: theme2.fontSizes[0],
48778
+ fontFamily: theme2.fonts.body,
48779
+ fontWeight: 500,
48780
+ display: "flex",
48781
+ alignItems: "center",
48782
+ gap: "0.5rem",
48783
+ border: "none",
48784
+ cursor: "pointer",
48785
+ transition: "opacity 0.2s"
48786
+ },
48787
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.8",
48788
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
48789
+ children: [
48790
+ /* @__PURE__ */ jsx(Package, { size: 14 }),
48791
+ /* @__PURE__ */ jsxs("span", { children: [
48792
+ "Assets (",
48793
+ ((_e2 = structure.assetFiles) == null ? void 0 : _e2.length) || 0,
48794
+ ")"
48795
+ ] }),
48796
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: expandedSections.assets ? "▼" : "▶" })
48797
+ ]
48798
+ }
48799
+ )
48800
+ ] }),
48801
+ actions && (skill == null ? void 0 : skill.path) && /* @__PURE__ */ jsxs("div", { style: {
48802
+ display: "flex",
48803
+ gap: theme2.space[2]
48804
+ }, children: [
48805
+ /* @__PURE__ */ jsxs(
48806
+ "button",
48807
+ {
48808
+ onClick: () => {
48809
+ var _a2;
48810
+ if (skill == null ? void 0 : skill.path) {
48811
+ (_a2 = actions == null ? void 0 : actions.openFile) == null ? void 0 : _a2.call(actions, skill.path);
48812
+ }
48813
+ },
48814
+ style: {
48815
+ display: "flex",
48816
+ alignItems: "center",
48817
+ gap: theme2.space[1],
48818
+ padding: `${theme2.space[1]} ${theme2.space[2]}`,
48819
+ backgroundColor: theme2.colors.backgroundSecondary,
48820
+ border: `1px solid ${theme2.colors.border}`,
48821
+ borderRadius: "6px",
48822
+ color: theme2.colors.text,
48823
+ fontSize: theme2.fontSizes[1],
48824
+ fontFamily: theme2.fonts.body,
48825
+ cursor: "pointer",
48826
+ transition: "all 0.2s"
48827
+ },
48828
+ onMouseEnter: (e) => {
48829
+ e.currentTarget.style.backgroundColor = theme2.colors.primary;
48830
+ e.currentTarget.style.color = theme2.colors.background;
48831
+ e.currentTarget.style.borderColor = theme2.colors.primary;
48832
+ },
48833
+ onMouseLeave: (e) => {
48834
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
48835
+ e.currentTarget.style.color = theme2.colors.text;
48836
+ e.currentTarget.style.borderColor = theme2.colors.border;
48837
+ },
48838
+ title: "Open in file editor",
48839
+ children: [
48840
+ /* @__PURE__ */ jsx(FilePen, { size: 14 }),
48841
+ /* @__PURE__ */ jsx("span", { children: "Edit" })
48842
+ ]
48843
+ }
48844
+ ),
48845
+ /* @__PURE__ */ jsxs(
48846
+ "button",
48847
+ {
48848
+ onClick: () => {
48849
+ console.log("Open in MDX editor:", skill.path);
48850
+ },
48851
+ style: {
48852
+ display: "flex",
48853
+ alignItems: "center",
48854
+ gap: theme2.space[1],
48855
+ padding: `${theme2.space[1]} ${theme2.space[2]}`,
48856
+ backgroundColor: theme2.colors.backgroundSecondary,
48857
+ border: `1px solid ${theme2.colors.border}`,
48858
+ borderRadius: "6px",
48859
+ color: theme2.colors.text,
48860
+ fontSize: theme2.fontSizes[1],
48861
+ fontFamily: theme2.fonts.body,
48862
+ cursor: "pointer",
48863
+ transition: "all 0.2s"
48864
+ },
48865
+ onMouseEnter: (e) => {
48866
+ e.currentTarget.style.backgroundColor = theme2.colors.secondary;
48867
+ e.currentTarget.style.color = theme2.colors.background;
48868
+ e.currentTarget.style.borderColor = theme2.colors.secondary;
48869
+ },
48870
+ onMouseLeave: (e) => {
48871
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
48872
+ e.currentTarget.style.color = theme2.colors.text;
48873
+ e.currentTarget.style.borderColor = theme2.colors.border;
48874
+ },
48875
+ title: "Open in MDX editor",
48876
+ children: [
48877
+ /* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
48878
+ /* @__PURE__ */ jsx("span", { children: "MDX Editor" })
48879
+ ]
48880
+ }
48881
+ )
48882
+ ] })
48587
48883
  ] }),
48588
- expandedSections.scripts && structure.scriptFiles && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48884
+ expandedSections.scripts && (structure == null ? void 0 : structure.scriptFiles) && structure.scriptFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48589
48885
  marginTop: theme2.space[2],
48590
48886
  padding: theme2.space[2],
48591
48887
  backgroundColor: `${theme2.colors.primary}15`,
@@ -48603,7 +48899,7 @@ const SkillMetadataSection = ({
48603
48899
  margin: 0,
48604
48900
  paddingLeft: theme2.space[3],
48605
48901
  listStyle: "none"
48606
- }, children: structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48902
+ }, children: structure == null ? void 0 : structure.scriptFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48607
48903
  fontSize: theme2.fontSizes[1],
48608
48904
  color: theme2.colors.text,
48609
48905
  fontFamily: theme2.fonts.monospace,
@@ -48613,7 +48909,7 @@ const SkillMetadataSection = ({
48613
48909
  file
48614
48910
  ] }, idx)) })
48615
48911
  ] }),
48616
- expandedSections.references && structure.referenceFiles && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48912
+ expandedSections.references && (structure == null ? void 0 : structure.referenceFiles) && structure.referenceFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48617
48913
  marginTop: theme2.space[2],
48618
48914
  padding: theme2.space[2],
48619
48915
  backgroundColor: `${theme2.colors.secondary}15`,
@@ -48631,7 +48927,7 @@ const SkillMetadataSection = ({
48631
48927
  margin: 0,
48632
48928
  paddingLeft: theme2.space[3],
48633
48929
  listStyle: "none"
48634
- }, children: structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48930
+ }, children: structure == null ? void 0 : structure.referenceFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48635
48931
  fontSize: theme2.fontSizes[1],
48636
48932
  color: theme2.colors.text,
48637
48933
  fontFamily: theme2.fonts.monospace,
@@ -48641,7 +48937,7 @@ const SkillMetadataSection = ({
48641
48937
  file
48642
48938
  ] }, idx)) })
48643
48939
  ] }),
48644
- expandedSections.assets && structure.assetFiles && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48940
+ expandedSections.assets && (structure == null ? void 0 : structure.assetFiles) && structure.assetFiles.length > 0 && /* @__PURE__ */ jsxs("div", { style: {
48645
48941
  marginTop: theme2.space[2],
48646
48942
  padding: theme2.space[2],
48647
48943
  backgroundColor: `${theme2.colors.accent}15`,
@@ -48659,7 +48955,7 @@ const SkillMetadataSection = ({
48659
48955
  margin: 0,
48660
48956
  paddingLeft: theme2.space[3],
48661
48957
  listStyle: "none"
48662
- }, children: structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48958
+ }, children: structure == null ? void 0 : structure.assetFiles.map((file, idx) => /* @__PURE__ */ jsxs("li", { style: {
48663
48959
  fontSize: theme2.fontSizes[1],
48664
48960
  color: theme2.colors.text,
48665
48961
  fontFamily: theme2.fonts.monospace,
@@ -48669,7 +48965,7 @@ const SkillMetadataSection = ({
48669
48965
  file
48670
48966
  ] }, idx)) })
48671
48967
  ] })
48672
- ] })
48968
+ ] }) : null
48673
48969
  ] });
48674
48970
  };
48675
48971
  const SkillMarkdown = ({
@@ -48681,10 +48977,16 @@ const SkillMarkdown = ({
48681
48977
  showRawOnError = false,
48682
48978
  containerWidth,
48683
48979
  structure,
48684
- skill
48980
+ skill,
48981
+ actions
48685
48982
  }) => {
48686
48983
  const [parsed, setParsed] = React2__default.useState(null);
48687
48984
  const [headers, setHeaders] = React2__default.useState([]);
48985
+ const [showSearch, setShowSearch] = React2__default.useState(false);
48986
+ const [searchQuery, setSearchQuery] = React2__default.useState("");
48987
+ const [currentMatch, setCurrentMatch] = React2__default.useState(0);
48988
+ const [totalMatches, setTotalMatches] = React2__default.useState(0);
48989
+ const contentRef = React2__default.useRef(null);
48688
48990
  React2__default.useEffect(() => {
48689
48991
  const skill2 = parseSkillMarkdownGraceful(content2);
48690
48992
  setParsed(skill2);
@@ -48695,6 +48997,133 @@ const SkillMarkdown = ({
48695
48997
  const extractedHeaders = extractHeaders(skill2.body);
48696
48998
  setHeaders(extractedHeaders);
48697
48999
  }, [content2, onParsed, onWarnings]);
49000
+ const scrollToMatch = React2__default.useCallback((matches, index2, theme22) => {
49001
+ matches.forEach((m) => {
49002
+ m.style.backgroundColor = "#ffeb3b";
49003
+ m.style.outline = "none";
49004
+ m.style.boxShadow = "none";
49005
+ });
49006
+ if (matches[index2]) {
49007
+ matches[index2].style.backgroundColor = "#ff9800";
49008
+ matches[index2].style.outline = `2px solid ${theme22.colors.primary}`;
49009
+ matches[index2].style.boxShadow = "0 0 8px rgba(255, 152, 0, 0.6)";
49010
+ matches[index2].scrollIntoView({ behavior: "smooth", block: "center" });
49011
+ }
49012
+ }, []);
49013
+ const handleNext = React2__default.useCallback(() => {
49014
+ var _a;
49015
+ if (totalMatches === 0) return;
49016
+ const newIndex = (currentMatch + 1) % totalMatches;
49017
+ setCurrentMatch(newIndex);
49018
+ const matches = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
49019
+ if (matches) {
49020
+ scrollToMatch(Array.from(matches), newIndex, theme2);
49021
+ }
49022
+ }, [totalMatches, currentMatch, theme2, scrollToMatch]);
49023
+ const handlePrevious = React2__default.useCallback(() => {
49024
+ var _a;
49025
+ if (totalMatches === 0) return;
49026
+ const newIndex = currentMatch === 0 ? totalMatches - 1 : currentMatch - 1;
49027
+ setCurrentMatch(newIndex);
49028
+ const matches = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
49029
+ if (matches) {
49030
+ scrollToMatch(Array.from(matches), newIndex, theme2);
49031
+ }
49032
+ }, [totalMatches, currentMatch, theme2, scrollToMatch]);
49033
+ React2__default.useEffect(() => {
49034
+ const handleKeyDown = (e) => {
49035
+ if ((e.metaKey || e.ctrlKey) && e.key === "f") {
49036
+ e.preventDefault();
49037
+ setShowSearch(true);
49038
+ }
49039
+ if (e.key === "Escape" && showSearch) {
49040
+ setShowSearch(false);
49041
+ setSearchQuery("");
49042
+ }
49043
+ if (e.key === "Enter" && showSearch && totalMatches > 0) {
49044
+ e.preventDefault();
49045
+ handleNext();
49046
+ }
49047
+ };
49048
+ window.addEventListener("keydown", handleKeyDown);
49049
+ return () => window.removeEventListener("keydown", handleKeyDown);
49050
+ }, [showSearch, totalMatches, handleNext]);
49051
+ React2__default.useEffect(() => {
49052
+ var _a;
49053
+ if (!searchQuery || !contentRef.current) {
49054
+ const highlights = (_a = contentRef.current) == null ? void 0 : _a.querySelectorAll(".search-highlight");
49055
+ highlights == null ? void 0 : highlights.forEach((el) => {
49056
+ const parent = el.parentNode;
49057
+ if (parent) {
49058
+ parent.replaceChild(document.createTextNode(el.textContent || ""), el);
49059
+ parent.normalize();
49060
+ }
49061
+ });
49062
+ setTotalMatches(0);
49063
+ setCurrentMatch(0);
49064
+ return;
49065
+ }
49066
+ const container = contentRef.current;
49067
+ const walker = document.createTreeWalker(
49068
+ container,
49069
+ NodeFilter.SHOW_TEXT,
49070
+ null
49071
+ );
49072
+ const textNodes = [];
49073
+ let node2;
49074
+ while (node2 = walker.nextNode()) {
49075
+ textNodes.push(node2);
49076
+ }
49077
+ const oldHighlights = container.querySelectorAll(".search-highlight");
49078
+ oldHighlights.forEach((el) => {
49079
+ const parent = el.parentNode;
49080
+ if (parent) {
49081
+ parent.replaceChild(document.createTextNode(el.textContent || ""), el);
49082
+ parent.normalize();
49083
+ }
49084
+ });
49085
+ const matches = [];
49086
+ const regex2 = new RegExp(searchQuery.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi");
49087
+ textNodes.forEach((textNode) => {
49088
+ var _a2;
49089
+ const text2 = textNode.textContent || "";
49090
+ const matches_in_text = [...text2.matchAll(regex2)];
49091
+ if (matches_in_text.length > 0) {
49092
+ const fragment2 = document.createDocumentFragment();
49093
+ let lastIndex = 0;
49094
+ matches_in_text.forEach((match) => {
49095
+ const matchIndex = match.index;
49096
+ if (matchIndex > lastIndex) {
49097
+ fragment2.appendChild(document.createTextNode(text2.slice(lastIndex, matchIndex)));
49098
+ }
49099
+ const mark2 = document.createElement("mark");
49100
+ mark2.className = "search-highlight";
49101
+ mark2.style.backgroundColor = "#ffeb3b";
49102
+ mark2.style.color = "#000000";
49103
+ mark2.style.fontWeight = "500";
49104
+ mark2.textContent = match[0];
49105
+ fragment2.appendChild(mark2);
49106
+ matches.push(mark2);
49107
+ lastIndex = matchIndex + match[0].length;
49108
+ });
49109
+ if (lastIndex < text2.length) {
49110
+ fragment2.appendChild(document.createTextNode(text2.slice(lastIndex)));
49111
+ }
49112
+ (_a2 = textNode.parentNode) == null ? void 0 : _a2.replaceChild(fragment2, textNode);
49113
+ }
49114
+ });
49115
+ setTotalMatches(matches.length);
49116
+ if (matches.length > 0) {
49117
+ setCurrentMatch(0);
49118
+ scrollToMatch(matches, 0, theme2);
49119
+ }
49120
+ }, [searchQuery, parsed, theme2, scrollToMatch]);
49121
+ const handleCloseSearch = () => {
49122
+ setShowSearch(false);
49123
+ setSearchQuery("");
49124
+ setCurrentMatch(0);
49125
+ setTotalMatches(0);
49126
+ };
48698
49127
  if (!theme2 || !theme2.space) {
48699
49128
  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." }) });
48700
49129
  }
@@ -48730,7 +49159,20 @@ const SkillMarkdown = ({
48730
49159
  background: theme2.colors.background
48731
49160
  },
48732
49161
  children: [
48733
- /* @__PURE__ */ jsx("div", { style: { padding: theme2.space[3], paddingBottom: 0 }, children: /* @__PURE__ */ jsx(SkillMetadataSection, { metadata: parsed.metadata, theme: theme2, structure, skill }) }),
49162
+ showSearch && /* @__PURE__ */ jsx(
49163
+ SearchBar,
49164
+ {
49165
+ theme: theme2,
49166
+ searchQuery,
49167
+ onSearchChange: setSearchQuery,
49168
+ currentMatch,
49169
+ totalMatches,
49170
+ onPrevious: handlePrevious,
49171
+ onNext: handleNext,
49172
+ onClose: handleCloseSearch
49173
+ }
49174
+ ),
49175
+ /* @__PURE__ */ jsx("div", { style: { padding: theme2.space[3], paddingBottom: 0 }, children: /* @__PURE__ */ jsx(SkillMetadataSection, { metadata: parsed.metadata, theme: theme2, structure, skill, actions }) }),
48734
49176
  /* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
48735
49177
  /* @__PURE__ */ jsx(
48736
49178
  SkillSidebar,
@@ -48741,7 +49183,7 @@ const SkillMarkdown = ({
48741
49183
  skill
48742
49184
  }
48743
49185
  ),
48744
- /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsx(
49186
+ /* @__PURE__ */ jsx("div", { ref: contentRef, style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }, children: /* @__PURE__ */ jsx(
48745
49187
  IndustryMarkdownSlide,
48746
49188
  {
48747
49189
  content: parsed.body,
@@ -48913,7 +49355,8 @@ const SkillDetailPanel = ({
48913
49355
  referenceFiles: skill.referenceFiles,
48914
49356
  assetFiles: skill.assetFiles
48915
49357
  },
48916
- skill
49358
+ skill,
49359
+ actions
48917
49360
  }
48918
49361
  ) }) }) : /* @__PURE__ */ jsx(
48919
49362
  "div",