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.cjs CHANGED
@@ -4062,8 +4062,32 @@ async function rebuildIndex(instanceUrl, token, scope, id, prefix, indexSlug) {
4062
4062
  dirty = true;
4063
4063
  }
4064
4064
  }
4065
+ const staleDescriptions = currentEntries.filter(
4066
+ (e) => actual.has(e.name) && (e.description.startsWith("(auto-indexed") || e.description.startsWith("(no description"))
4067
+ );
4068
+ if (staleDescriptions.length > 0) dirty = true;
4065
4069
  if (!dirty && added.length === 0) return currentEntries;
4066
- const kept = currentEntries.filter((e) => actual.has(e.name));
4070
+ const kept = [];
4071
+ for (const e of currentEntries) {
4072
+ if (!actual.has(e.name)) continue;
4073
+ if (e.description.startsWith("(auto-indexed") || e.description.startsWith("(no description")) {
4074
+ let description = "";
4075
+ try {
4076
+ const page = await getWikiPage(instanceUrl, token, scope, id, `${prefix}/${e.name}/SKILL`);
4077
+ const content = page.content ?? "";
4078
+ const fmMatch = content.match(/^---\s*\n[\s\S]*?description:\s*(.+)\n[\s\S]*?---/);
4079
+ if (fmMatch) {
4080
+ description = fmMatch[1].trim();
4081
+ } else {
4082
+ description = content.replace(/^---[\s\S]*?---\s*\n/, "").replace(/^#[^\n]*\n+/, "").split("\n\n")[0].replace(/\n/g, " ").trim().slice(0, 200);
4083
+ }
4084
+ } catch {
4085
+ }
4086
+ kept.push({ ...e, description: description || e.description });
4087
+ } else {
4088
+ kept.push(e);
4089
+ }
4090
+ }
4067
4091
  for (const name of added) {
4068
4092
  let description = "";
4069
4093
  try {