opencode-gitlab-dap 1.14.0 → 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 +38 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4062,12 +4062,48 @@ 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 =
|
|
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) {
|
|
4092
|
+
let description = "";
|
|
4093
|
+
try {
|
|
4094
|
+
const page = await getWikiPage(instanceUrl, token, scope, id, `${prefix}/${name}/SKILL`);
|
|
4095
|
+
const content = page.content ?? "";
|
|
4096
|
+
const fmMatch = content.match(/^---\s*\n[\s\S]*?description:\s*(.+)\n[\s\S]*?---/);
|
|
4097
|
+
if (fmMatch) {
|
|
4098
|
+
description = fmMatch[1].trim();
|
|
4099
|
+
} else {
|
|
4100
|
+
description = content.replace(/^---[\s\S]*?---\s*\n/, "").replace(/^#[^\n]*\n+/, "").split("\n\n")[0].replace(/\n/g, " ").trim().slice(0, 200);
|
|
4101
|
+
}
|
|
4102
|
+
} catch {
|
|
4103
|
+
}
|
|
4068
4104
|
kept.push({
|
|
4069
4105
|
name,
|
|
4070
|
-
description: "(
|
|
4106
|
+
description: description || "(no description \u2014 update with gitlab_skill_save)",
|
|
4071
4107
|
draft: prefix === DRAFTS_PREFIX
|
|
4072
4108
|
});
|
|
4073
4109
|
}
|