opencode-gitlab-dap 1.14.1 → 1.14.2

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/index.js CHANGED
@@ -3893,8 +3893,32 @@ async function rebuildIndex(instanceUrl, token, scope, id, prefix, indexSlug) {
3893
3893
  dirty = true;
3894
3894
  }
3895
3895
  }
3896
+ const staleDescriptions = currentEntries.filter(
3897
+ (e) => actual.has(e.name) && (e.description.startsWith("(auto-indexed") || e.description.startsWith("(no description"))
3898
+ );
3899
+ if (staleDescriptions.length > 0) dirty = true;
3896
3900
  if (!dirty && added.length === 0) return currentEntries;
3897
- const kept = currentEntries.filter((e) => actual.has(e.name));
3901
+ const kept = [];
3902
+ for (const e of currentEntries) {
3903
+ if (!actual.has(e.name)) continue;
3904
+ if (e.description.startsWith("(auto-indexed") || e.description.startsWith("(no description")) {
3905
+ let description = "";
3906
+ try {
3907
+ const page = await getWikiPage(instanceUrl, token, scope, id, `${prefix}/${e.name}/SKILL`);
3908
+ const content = page.content ?? "";
3909
+ const fmMatch = content.match(/^---\s*\n[\s\S]*?description:\s*(.+)\n[\s\S]*?---/);
3910
+ if (fmMatch) {
3911
+ description = fmMatch[1].trim();
3912
+ } else {
3913
+ description = content.replace(/^---[\s\S]*?---\s*\n/, "").replace(/^#[^\n]*\n+/, "").split("\n\n")[0].replace(/\n/g, " ").trim().slice(0, 200);
3914
+ }
3915
+ } catch {
3916
+ }
3917
+ kept.push({ ...e, description: description || e.description });
3918
+ } else {
3919
+ kept.push(e);
3920
+ }
3921
+ }
3898
3922
  for (const name of added) {
3899
3923
  let description = "";
3900
3924
  try {