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.js
CHANGED
|
@@ -4033,14 +4033,28 @@ async function upsertPage(instanceUrl, token, scope, id, slug, content) {
|
|
|
4033
4033
|
function isMarkdownFile(path) {
|
|
4034
4034
|
return path === "SKILL.md" || path.endsWith(".md") || path.endsWith(".markdown");
|
|
4035
4035
|
}
|
|
4036
|
+
function isAgentsGitignored(dir) {
|
|
4037
|
+
try {
|
|
4038
|
+
execSync("git check-ignore -q .agents", { cwd: dir, stdio: "pipe" });
|
|
4039
|
+
return true;
|
|
4040
|
+
} catch {
|
|
4041
|
+
return false;
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4036
4044
|
function ensureGitignore(dir) {
|
|
4045
|
+
if (isAgentsGitignored(dir)) return;
|
|
4037
4046
|
const gitignorePath = join2(dir, ".gitignore");
|
|
4038
4047
|
if (existsSync(gitignorePath)) {
|
|
4039
4048
|
const content = readFileSync2(gitignorePath, "utf-8");
|
|
4040
|
-
|
|
4041
|
-
|
|
4049
|
+
writeFileSync(
|
|
4050
|
+
gitignorePath,
|
|
4051
|
+
content.trimEnd() + "\n\n# Agent skills cache (managed by opencode-gitlab-dap)\n.agents/\n"
|
|
4052
|
+
);
|
|
4042
4053
|
} else {
|
|
4043
|
-
writeFileSync(
|
|
4054
|
+
writeFileSync(
|
|
4055
|
+
gitignorePath,
|
|
4056
|
+
"# Agent skills cache (managed by opencode-gitlab-dap)\n.agents/\n"
|
|
4057
|
+
);
|
|
4044
4058
|
}
|
|
4045
4059
|
}
|
|
4046
4060
|
function searchSkillsSh(query) {
|
|
@@ -4106,7 +4120,10 @@ function downloadSkillFromSkillsSh(identifier) {
|
|
|
4106
4120
|
if (statSync(full).isDirectory()) {
|
|
4107
4121
|
walkStack.push({ dir: full, prefix: rel });
|
|
4108
4122
|
} else if (entry !== "SKILL.md") {
|
|
4109
|
-
|
|
4123
|
+
try {
|
|
4124
|
+
files.push({ path: rel, content: readFileSync2(full, "utf-8") });
|
|
4125
|
+
} catch {
|
|
4126
|
+
}
|
|
4110
4127
|
}
|
|
4111
4128
|
}
|
|
4112
4129
|
}
|
|
@@ -4408,7 +4425,7 @@ Install: \`gitlab_skill_install(name="${r.identifier}", source="skills.sh")\``
|
|
|
4408
4425
|
args.project_id,
|
|
4409
4426
|
`skill:${downloaded.name}`,
|
|
4410
4427
|
`Scripts for skill "${downloaded.name}" (installed from skills.sh:${args.name})`,
|
|
4411
|
-
scriptFiles.map((f) => ({ file_path: f.path, content: f.content })),
|
|
4428
|
+
scriptFiles.map((f) => ({ file_path: f.path, content: f.content || "\n" })),
|
|
4412
4429
|
"private"
|
|
4413
4430
|
);
|
|
4414
4431
|
snippetId = snippet.id;
|