opencode-gitlab-dap 1.15.5 → 1.15.6
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 +21 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4136,8 +4136,9 @@ function makeSkillTools(ctx) {
|
|
|
4136
4136
|
`${prefix}/${args.name}/SKILL`
|
|
4137
4137
|
);
|
|
4138
4138
|
const pages = await listWikiPages(auth.instanceUrl, auth.token, scope, id);
|
|
4139
|
-
const
|
|
4140
|
-
const
|
|
4139
|
+
const skillPrefix = `${prefix}/${args.name}/`;
|
|
4140
|
+
const skillSlug = `${prefix}/${args.name}/SKILL`;
|
|
4141
|
+
const refs = pages.filter((p) => p.slug.startsWith(skillPrefix) && p.slug !== skillSlug).map((p) => p.slug.slice(skillPrefix.length));
|
|
4141
4142
|
const isDraft = prefix === DRAFTS_PREFIX;
|
|
4142
4143
|
let result = isDraft ? `[DRAFT SKILL]
|
|
4143
4144
|
|
|
@@ -4247,16 +4248,21 @@ Run \`gitlab_skill_setup(name="${args.name}")\` to extract them to .agents/skill
|
|
|
4247
4248
|
}
|
|
4248
4249
|
}),
|
|
4249
4250
|
gitlab_skill_discover: tool6({
|
|
4250
|
-
description: "Search for skills in the
|
|
4251
|
+
description: "Search for skills in the skills.sh public registry and optionally a group wiki.\nUse gitlab_skill_install to install a discovered skill into your project.\nIMPORTANT: project_id is only needed when searching a group wiki. For skills.sh only, it is optional.",
|
|
4251
4252
|
args: {
|
|
4252
|
-
project_id: z6.string().describe(PROJECT_ID_DESC2),
|
|
4253
4253
|
query: z6.string().describe("Search query (matches skill name and description)"),
|
|
4254
|
+
project_id: z6.string().optional().describe(PROJECT_ID_DESC2 + " Only needed for group wiki search."),
|
|
4254
4255
|
group_id: z6.string().optional().describe("Group path to search for shared skills (optional)")
|
|
4255
4256
|
},
|
|
4256
4257
|
execute: async (args) => {
|
|
4257
|
-
|
|
4258
|
+
let auth = null;
|
|
4259
|
+
if (args.project_id) {
|
|
4260
|
+
auth = authAndValidate(args.project_id);
|
|
4261
|
+
} else if (args.group_id) {
|
|
4262
|
+
return "Error: project_id is required when searching a group wiki.";
|
|
4263
|
+
}
|
|
4258
4264
|
const sections = [];
|
|
4259
|
-
if (args.group_id) {
|
|
4265
|
+
if (args.group_id && auth) {
|
|
4260
4266
|
try {
|
|
4261
4267
|
const entries = await readIndex(
|
|
4262
4268
|
auth.instanceUrl,
|
|
@@ -4334,7 +4340,7 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
|
|
|
4334
4340
|
const mdFiles = downloaded.files.filter((f) => isMarkdownFile(f.path));
|
|
4335
4341
|
const scriptFiles = downloaded.files.filter((f) => !isMarkdownFile(f.path));
|
|
4336
4342
|
for (const file of mdFiles) {
|
|
4337
|
-
const slug = `${targetPrefix}/${downloaded.name}
|
|
4343
|
+
const slug = `${targetPrefix}/${downloaded.name}/${file.path.replace(/\.[^.]+$/, "")}`;
|
|
4338
4344
|
await upsertPage(
|
|
4339
4345
|
auth.instanceUrl,
|
|
4340
4346
|
auth.token,
|
|
@@ -4473,15 +4479,15 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
|
|
|
4473
4479
|
const pages = await listWikiPages(auth.instanceUrl, auth.token, scope, id, true);
|
|
4474
4480
|
let refCount = 0;
|
|
4475
4481
|
for (const prefix of [SKILLS_PREFIX, DRAFTS_PREFIX]) {
|
|
4476
|
-
const
|
|
4477
|
-
const
|
|
4478
|
-
(p) => p.slug.startsWith(
|
|
4482
|
+
const skillPagePrefix = `${prefix}/${args.name}/`;
|
|
4483
|
+
const extraPages = pages.filter(
|
|
4484
|
+
(p) => p.slug.startsWith(skillPagePrefix) && p.slug !== `${prefix}/${args.name}/SKILL` && p.content
|
|
4479
4485
|
);
|
|
4480
|
-
for (const
|
|
4481
|
-
const
|
|
4482
|
-
const
|
|
4483
|
-
mkdirSync(
|
|
4484
|
-
writeFileSync(
|
|
4486
|
+
for (const page of extraPages) {
|
|
4487
|
+
const relPath = page.slug.slice(skillPagePrefix.length);
|
|
4488
|
+
const filePath = join2(targetDir, `${relPath}.md`);
|
|
4489
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
4490
|
+
writeFileSync(filePath, page.content);
|
|
4485
4491
|
refCount++;
|
|
4486
4492
|
}
|
|
4487
4493
|
}
|