opencode-gitlab-dap 1.15.0 → 1.15.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 +22 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4192,14 +4192,28 @@ async function upsertPage(instanceUrl, token, scope, id, slug, content) {
|
|
|
4192
4192
|
function isMarkdownFile(path) {
|
|
4193
4193
|
return path === "SKILL.md" || path.endsWith(".md") || path.endsWith(".markdown");
|
|
4194
4194
|
}
|
|
4195
|
+
function isAgentsGitignored(dir) {
|
|
4196
|
+
try {
|
|
4197
|
+
(0, import_child_process.execSync)("git check-ignore -q .agents", { cwd: dir, stdio: "pipe" });
|
|
4198
|
+
return true;
|
|
4199
|
+
} catch {
|
|
4200
|
+
return false;
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4195
4203
|
function ensureGitignore(dir) {
|
|
4204
|
+
if (isAgentsGitignored(dir)) return;
|
|
4196
4205
|
const gitignorePath = (0, import_path2.join)(dir, ".gitignore");
|
|
4197
4206
|
if ((0, import_fs2.existsSync)(gitignorePath)) {
|
|
4198
4207
|
const content = (0, import_fs2.readFileSync)(gitignorePath, "utf-8");
|
|
4199
|
-
|
|
4200
|
-
|
|
4208
|
+
(0, import_fs2.writeFileSync)(
|
|
4209
|
+
gitignorePath,
|
|
4210
|
+
content.trimEnd() + "\n\n# Agent skills cache (managed by opencode-gitlab-dap)\n.agents/\n"
|
|
4211
|
+
);
|
|
4201
4212
|
} else {
|
|
4202
|
-
(0, import_fs2.writeFileSync)(
|
|
4213
|
+
(0, import_fs2.writeFileSync)(
|
|
4214
|
+
gitignorePath,
|
|
4215
|
+
"# Agent skills cache (managed by opencode-gitlab-dap)\n.agents/\n"
|
|
4216
|
+
);
|
|
4203
4217
|
}
|
|
4204
4218
|
}
|
|
4205
4219
|
function searchSkillsSh(query) {
|
|
@@ -4265,7 +4279,10 @@ function downloadSkillFromSkillsSh(identifier) {
|
|
|
4265
4279
|
if ((0, import_fs2.statSync)(full).isDirectory()) {
|
|
4266
4280
|
walkStack.push({ dir: full, prefix: rel });
|
|
4267
4281
|
} else if (entry !== "SKILL.md") {
|
|
4268
|
-
|
|
4282
|
+
try {
|
|
4283
|
+
files.push({ path: rel, content: (0, import_fs2.readFileSync)(full, "utf-8") });
|
|
4284
|
+
} catch {
|
|
4285
|
+
}
|
|
4269
4286
|
}
|
|
4270
4287
|
}
|
|
4271
4288
|
}
|
|
@@ -4567,7 +4584,7 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
|
|
|
4567
4584
|
args.project_id,
|
|
4568
4585
|
`skill:${downloaded.name}`,
|
|
4569
4586
|
`Scripts for skill "${downloaded.name}" (installed from skills.sh:${args.name})`,
|
|
4570
|
-
scriptFiles.map((f) => ({ file_path: f.path, content: f.content })),
|
|
4587
|
+
scriptFiles.map((f) => ({ file_path: f.path, content: f.content || "\n" })),
|
|
4571
4588
|
"private"
|
|
4572
4589
|
);
|
|
4573
4590
|
snippetId = snippet.id;
|