opencode-gitlab-dap 1.15.5 → 1.15.7
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 +25 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2232,7 +2232,10 @@ function makeSystemTransformHook(flowAgents, getAuthCache) {
|
|
|
2232
2232
|
}
|
|
2233
2233
|
if (getAuthCache()) {
|
|
2234
2234
|
output.system.push(
|
|
2235
|
-
`## Project
|
|
2235
|
+
`## GitLab Project Context
|
|
2236
|
+
CRITICAL: Any tool that requires a project_id MUST use the FULL project path from git remote. Run \`run_git_command("remote", ["-v"])\` FIRST and extract the path (e.g., "git@gitlab.com:my-group/my-project.git" \u2192 "my-group/my-project"). NEVER guess or infer the project path from the repository name alone.
|
|
2237
|
+
|
|
2238
|
+
## Project Knowledge
|
|
2236
2239
|
Project memory tools are available (gitlab_memory_load, gitlab_memory_record, gitlab_memory_recall). Say "bootstrap project memory" to initialize or refresh project knowledge.`
|
|
2237
2240
|
);
|
|
2238
2241
|
}
|
|
@@ -4136,8 +4139,9 @@ function makeSkillTools(ctx) {
|
|
|
4136
4139
|
`${prefix}/${args.name}/SKILL`
|
|
4137
4140
|
);
|
|
4138
4141
|
const pages = await listWikiPages(auth.instanceUrl, auth.token, scope, id);
|
|
4139
|
-
const
|
|
4140
|
-
const
|
|
4142
|
+
const skillPrefix = `${prefix}/${args.name}/`;
|
|
4143
|
+
const skillSlug = `${prefix}/${args.name}/SKILL`;
|
|
4144
|
+
const refs = pages.filter((p) => p.slug.startsWith(skillPrefix) && p.slug !== skillSlug).map((p) => p.slug.slice(skillPrefix.length));
|
|
4141
4145
|
const isDraft = prefix === DRAFTS_PREFIX;
|
|
4142
4146
|
let result = isDraft ? `[DRAFT SKILL]
|
|
4143
4147
|
|
|
@@ -4247,16 +4251,21 @@ Run \`gitlab_skill_setup(name="${args.name}")\` to extract them to .agents/skill
|
|
|
4247
4251
|
}
|
|
4248
4252
|
}),
|
|
4249
4253
|
gitlab_skill_discover: tool6({
|
|
4250
|
-
description: "Search for skills in the
|
|
4254
|
+
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
4255
|
args: {
|
|
4252
|
-
project_id: z6.string().describe(PROJECT_ID_DESC2),
|
|
4253
4256
|
query: z6.string().describe("Search query (matches skill name and description)"),
|
|
4257
|
+
project_id: z6.string().optional().describe(PROJECT_ID_DESC2 + " Only needed for group wiki search."),
|
|
4254
4258
|
group_id: z6.string().optional().describe("Group path to search for shared skills (optional)")
|
|
4255
4259
|
},
|
|
4256
4260
|
execute: async (args) => {
|
|
4257
|
-
|
|
4261
|
+
let auth = null;
|
|
4262
|
+
if (args.project_id) {
|
|
4263
|
+
auth = authAndValidate(args.project_id);
|
|
4264
|
+
} else if (args.group_id) {
|
|
4265
|
+
return "Error: project_id is required when searching a group wiki.";
|
|
4266
|
+
}
|
|
4258
4267
|
const sections = [];
|
|
4259
|
-
if (args.group_id) {
|
|
4268
|
+
if (args.group_id && auth) {
|
|
4260
4269
|
try {
|
|
4261
4270
|
const entries = await readIndex(
|
|
4262
4271
|
auth.instanceUrl,
|
|
@@ -4334,7 +4343,7 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
|
|
|
4334
4343
|
const mdFiles = downloaded.files.filter((f) => isMarkdownFile(f.path));
|
|
4335
4344
|
const scriptFiles = downloaded.files.filter((f) => !isMarkdownFile(f.path));
|
|
4336
4345
|
for (const file of mdFiles) {
|
|
4337
|
-
const slug = `${targetPrefix}/${downloaded.name}
|
|
4346
|
+
const slug = `${targetPrefix}/${downloaded.name}/${file.path.replace(/\.[^.]+$/, "")}`;
|
|
4338
4347
|
await upsertPage(
|
|
4339
4348
|
auth.instanceUrl,
|
|
4340
4349
|
auth.token,
|
|
@@ -4473,15 +4482,15 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
|
|
|
4473
4482
|
const pages = await listWikiPages(auth.instanceUrl, auth.token, scope, id, true);
|
|
4474
4483
|
let refCount = 0;
|
|
4475
4484
|
for (const prefix of [SKILLS_PREFIX, DRAFTS_PREFIX]) {
|
|
4476
|
-
const
|
|
4477
|
-
const
|
|
4478
|
-
(p) => p.slug.startsWith(
|
|
4485
|
+
const skillPagePrefix = `${prefix}/${args.name}/`;
|
|
4486
|
+
const extraPages = pages.filter(
|
|
4487
|
+
(p) => p.slug.startsWith(skillPagePrefix) && p.slug !== `${prefix}/${args.name}/SKILL` && p.content
|
|
4479
4488
|
);
|
|
4480
|
-
for (const
|
|
4481
|
-
const
|
|
4482
|
-
const
|
|
4483
|
-
mkdirSync(
|
|
4484
|
-
writeFileSync(
|
|
4489
|
+
for (const page of extraPages) {
|
|
4490
|
+
const relPath = page.slug.slice(skillPagePrefix.length);
|
|
4491
|
+
const filePath = join2(targetDir, `${relPath}.md`);
|
|
4492
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
4493
|
+
writeFileSync(filePath, page.content);
|
|
4485
4494
|
refCount++;
|
|
4486
4495
|
}
|
|
4487
4496
|
}
|