add-skill 1.0.18 → 1.0.19
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.js +23 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,6 +7,16 @@ import chalk from "chalk";
|
|
|
7
7
|
|
|
8
8
|
// src/source-parser.ts
|
|
9
9
|
import { isAbsolute, resolve } from "path";
|
|
10
|
+
function getOwnerRepo(parsed) {
|
|
11
|
+
if (parsed.type === "local") {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const match = parsed.url.match(/(?:github|gitlab)\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
15
|
+
if (match) {
|
|
16
|
+
return `${match[1]}/${match[2]}`;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
10
20
|
function isLocalPath(input) {
|
|
11
21
|
return isAbsolute(input) || input.startsWith("./") || input.startsWith("../") || input === "." || input === ".." || // Windows absolute paths like C:\ or D:\
|
|
12
22
|
/^[a-zA-Z]:[/\\]/.test(input);
|
|
@@ -509,7 +519,7 @@ function track(data) {
|
|
|
509
519
|
// package.json
|
|
510
520
|
var package_default = {
|
|
511
521
|
name: "add-skill",
|
|
512
|
-
version: "1.0.
|
|
522
|
+
version: "1.0.19",
|
|
513
523
|
description: "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
|
|
514
524
|
type: "module",
|
|
515
525
|
bin: {
|
|
@@ -827,18 +837,21 @@ async function main(source, options) {
|
|
|
827
837
|
} else if (tempDir && skill.path.startsWith(tempDir + "/")) {
|
|
828
838
|
relativePath = skill.path.slice(tempDir.length + 1) + "/SKILL.md";
|
|
829
839
|
} else {
|
|
830
|
-
|
|
840
|
+
continue;
|
|
831
841
|
}
|
|
832
842
|
skillFiles[skill.name] = relativePath;
|
|
833
843
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
844
|
+
const normalizedSource = getOwnerRepo(parsed);
|
|
845
|
+
if (normalizedSource) {
|
|
846
|
+
track({
|
|
847
|
+
event: "install",
|
|
848
|
+
source: normalizedSource,
|
|
849
|
+
skills: selectedSkills.map((s) => s.name).join(","),
|
|
850
|
+
agents: targetAgents.join(","),
|
|
851
|
+
...installGlobally && { global: "1" },
|
|
852
|
+
skillFiles: JSON.stringify(skillFiles)
|
|
853
|
+
});
|
|
854
|
+
}
|
|
842
855
|
if (successful.length > 0) {
|
|
843
856
|
const bySkill = /* @__PURE__ */ new Map();
|
|
844
857
|
for (const r of successful) {
|