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 CHANGED
@@ -4295,8 +4295,9 @@ function makeSkillTools(ctx) {
4295
4295
  `${prefix}/${args.name}/SKILL`
4296
4296
  );
4297
4297
  const pages = await listWikiPages(auth.instanceUrl, auth.token, scope, id);
4298
- const refPrefix = `${prefix}/${args.name}/references/`;
4299
- const refs = pages.filter((p) => p.slug.startsWith(refPrefix)).map((p) => p.slug.slice(refPrefix.length));
4298
+ const skillPrefix = `${prefix}/${args.name}/`;
4299
+ const skillSlug = `${prefix}/${args.name}/SKILL`;
4300
+ const refs = pages.filter((p) => p.slug.startsWith(skillPrefix) && p.slug !== skillSlug).map((p) => p.slug.slice(skillPrefix.length));
4300
4301
  const isDraft = prefix === DRAFTS_PREFIX;
4301
4302
  let result = isDraft ? `[DRAFT SKILL]
4302
4303
 
@@ -4406,16 +4407,21 @@ Run \`gitlab_skill_setup(name="${args.name}")\` to extract them to .agents/skill
4406
4407
  }
4407
4408
  }),
4408
4409
  gitlab_skill_discover: (0, import_plugin6.tool)({
4409
- description: "Search for skills in the group wiki and the skills.sh public registry.\nGroup wiki skills are searched first, then skills.sh for community skills.\nUse gitlab_skill_install to install a discovered skill into your project.",
4410
+ 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.",
4410
4411
  args: {
4411
- project_id: z6.string().describe(PROJECT_ID_DESC2),
4412
4412
  query: z6.string().describe("Search query (matches skill name and description)"),
4413
+ project_id: z6.string().optional().describe(PROJECT_ID_DESC2 + " Only needed for group wiki search."),
4413
4414
  group_id: z6.string().optional().describe("Group path to search for shared skills (optional)")
4414
4415
  },
4415
4416
  execute: async (args) => {
4416
- const auth = authAndValidate(args.project_id);
4417
+ let auth = null;
4418
+ if (args.project_id) {
4419
+ auth = authAndValidate(args.project_id);
4420
+ } else if (args.group_id) {
4421
+ return "Error: project_id is required when searching a group wiki.";
4422
+ }
4417
4423
  const sections = [];
4418
- if (args.group_id) {
4424
+ if (args.group_id && auth) {
4419
4425
  try {
4420
4426
  const entries = await readIndex(
4421
4427
  auth.instanceUrl,
@@ -4493,7 +4499,7 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
4493
4499
  const mdFiles = downloaded.files.filter((f) => isMarkdownFile(f.path));
4494
4500
  const scriptFiles = downloaded.files.filter((f) => !isMarkdownFile(f.path));
4495
4501
  for (const file of mdFiles) {
4496
- const slug = `${targetPrefix}/${downloaded.name}/references/${file.path.replace(/\.[^.]+$/, "")}`;
4502
+ const slug = `${targetPrefix}/${downloaded.name}/${file.path.replace(/\.[^.]+$/, "")}`;
4497
4503
  await upsertPage(
4498
4504
  auth.instanceUrl,
4499
4505
  auth.token,
@@ -4632,15 +4638,15 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
4632
4638
  const pages = await listWikiPages(auth.instanceUrl, auth.token, scope, id, true);
4633
4639
  let refCount = 0;
4634
4640
  for (const prefix of [SKILLS_PREFIX, DRAFTS_PREFIX]) {
4635
- const refPrefix = `${prefix}/${args.name}/references/`;
4636
- const refPages = pages.filter(
4637
- (p) => p.slug.startsWith(refPrefix) && p.content
4641
+ const skillPagePrefix = `${prefix}/${args.name}/`;
4642
+ const extraPages = pages.filter(
4643
+ (p) => p.slug.startsWith(skillPagePrefix) && p.slug !== `${prefix}/${args.name}/SKILL` && p.content
4638
4644
  );
4639
- for (const ref of refPages) {
4640
- const refName = ref.slug.slice(refPrefix.length);
4641
- const refDir = (0, import_path2.join)(targetDir, "references");
4642
- (0, import_fs2.mkdirSync)(refDir, { recursive: true });
4643
- (0, import_fs2.writeFileSync)((0, import_path2.join)(refDir, `${refName}.md`), ref.content);
4645
+ for (const page of extraPages) {
4646
+ const relPath = page.slug.slice(skillPagePrefix.length);
4647
+ const filePath = (0, import_path2.join)(targetDir, `${relPath}.md`);
4648
+ (0, import_fs2.mkdirSync)((0, import_path2.dirname)(filePath), { recursive: true });
4649
+ (0, import_fs2.writeFileSync)(filePath, page.content);
4644
4650
  refCount++;
4645
4651
  }
4646
4652
  }