ali-skills 0.1.1 → 0.1.3

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.
@@ -55,6 +55,7 @@ const pluginAgents = {
55
55
  "claude-code": {
56
56
  agent: "claude-code",
57
57
  manifestDir: ".claude-plugin",
58
+ marketplaceManifestDir: ".claude-plugin",
58
59
  strategy: "native-cli",
59
60
  bin: "claude"
60
61
  },
@@ -62,6 +63,7 @@ const pluginAgents = {
62
63
  agent: "codex",
63
64
  manifestDir: ".codex-plugin",
64
65
  manifestFallback: ".claude-plugin",
66
+ marketplaceManifestDir: join(".agents", "plugins"),
65
67
  strategy: "native-cli",
66
68
  bin: "codex"
67
69
  },
@@ -416,7 +418,7 @@ function getMarketplaceCacheRoot(home, agent) {
416
418
  }
417
419
  function writeMarketplaceCache(agent, payload, home) {
418
420
  const root = getMarketplaceCacheRoot(home, agent);
419
- const manifestDir = join(root, ".claude-plugin");
421
+ const manifestDir = join(root, getPluginAgentConfig(agent)?.marketplaceManifestDir ?? ".claude-plugin");
420
422
  mkdirSync(manifestDir, { recursive: true });
421
423
  writeFileSync(join(manifestDir, "marketplace.json"), `${JSON.stringify(payload, null, 2)}\n`);
422
424
  return root;
@@ -686,15 +688,15 @@ async function runPluginAdd(source, options = {}) {
686
688
  }
687
689
  for (const agent of targetAgents) {
688
690
  if (getPluginAgentConfig(agent)?.strategy !== "native-cli") continue;
689
- progress?.start(`正在同步 ${agentLabel(agent)} marketplace…`);
691
+ progress?.start(`正在为本机 ${agentLabel(agent)} 注册 ali-skills marketplace…`);
690
692
  const prep = await prepareNativeMarketplace(agent, {
691
693
  home: options.home,
692
694
  run: options.run
693
695
  });
694
696
  if (!prep.ok) {
695
- progress?.stop(`${agentLabel(agent)} marketplace 同步失败`);
696
- console.warn(`⚠️ ${agent} marketplace 同步失败:${redactCliSnippet(prep.error ?? "")}`);
697
- } else progress?.stop(`${agentLabel(agent)} marketplace 已同步`);
697
+ progress?.stop(`本机 ${agentLabel(agent)} 注册 ali-skills marketplace 失败`);
698
+ console.warn(`⚠️ 本机 ${agentLabel(agent)} 注册 ali-skills marketplace 失败:${redactCliSnippet(prep.error ?? "")}`);
699
+ } else progress?.stop(`已为本机 ${agentLabel(agent)} 注册/更新 ali-skills marketplace`);
698
700
  }
699
701
  progress?.start("正在安装 plugin…");
700
702
  const res = installPlugin({
@@ -6,10 +6,17 @@ import { dirname, isAbsolute, join, normalize, resolve, sep } from "path";
6
6
  import { homedir, tmpdir } from "os";
7
7
  import { createHash } from "crypto";
8
8
  import { mkdir, mkdtemp, readFile, rm, writeFile } from "fs/promises";
9
+ function stripGitSuffix(value) {
10
+ return value.replace(/\.git$/i, "");
11
+ }
9
12
  function resolveSourceInput(source, options = {}) {
10
13
  let resolved = source.replace(/\bgitlab\.alibaba-inc\.com\b/g, "code.alibaba-inc.com");
11
14
  if (!options.github) {
12
- if (resolved.match(/^([^/]+)\/([^/]+)$/) && !resolved.includes(":") && !resolved.startsWith(".") && !resolved.startsWith("/")) resolved = `https://${GITLAB_ACCOUNT.user}:${GITLAB_ACCOUNT.token}@code.alibaba-inc.com/${resolved}.git`;
15
+ const shorthandMatch = resolved.match(/^([^/]+)\/([^/]+)$/);
16
+ if (shorthandMatch && !resolved.includes(":") && !resolved.startsWith(".") && !resolved.startsWith("/")) {
17
+ const [, owner, repo] = shorthandMatch;
18
+ resolved = `https://${GITLAB_ACCOUNT.user}:${GITLAB_ACCOUNT.token}@code.alibaba-inc.com/${owner}/${stripGitSuffix(repo)}.git`;
19
+ }
13
20
  }
14
21
  if (/^https?:\/\/code\.alibaba-inc\.com\//.test(resolved) && !resolved.includes("@")) resolved = resolved.replace(/^(https?):\/\/code\.alibaba-inc\.com\//, `$1://${GITLAB_ACCOUNT.user}:${GITLAB_ACCOUNT.token}@code.alibaba-inc.com/`);
15
22
  return resolved;
@@ -36,14 +43,14 @@ function getOwnerRepo(parsed) {
36
43
  const sshMatch = parsed.url.match(/^git@[^:]+:(.+)$/);
37
44
  if (sshMatch) {
38
45
  let path = sshMatch[1];
39
- path = path.replace(/\.git$/, "");
46
+ path = stripGitSuffix(path);
40
47
  if (path.includes("/")) return path;
41
48
  return null;
42
49
  }
43
50
  if (!parsed.url.startsWith("http://") && !parsed.url.startsWith("https://")) return null;
44
51
  try {
45
52
  let path = new URL(parsed.url).pathname.slice(1);
46
- path = path.replace(/\.git$/, "");
53
+ path = stripGitSuffix(path);
47
54
  if (path.includes("/")) return path;
48
55
  } catch {}
49
56
  return null;
@@ -165,7 +172,7 @@ function parseSource(input) {
165
172
  const [, owner, repo, skillFilter] = atSkillMatch;
166
173
  return {
167
174
  type: "github",
168
- url: `https://github.com/${owner}/${repo}.git`,
175
+ url: `https://github.com/${owner}/${stripGitSuffix(repo)}.git`,
169
176
  skillFilter
170
177
  };
171
178
  }
@@ -174,7 +181,7 @@ function parseSource(input) {
174
181
  const [, owner, repo, subpath] = shorthandMatch;
175
182
  return {
176
183
  type: "github",
177
- url: `https://github.com/${owner}/${repo}.git`,
184
+ url: `https://github.com/${owner}/${stripGitSuffix(repo)}.git`,
178
185
  subpath: subpath ? sanitizeSubpath(subpath) : subpath
179
186
  };
180
187
  }
@@ -1394,7 +1394,7 @@ var WellKnownProvider = class {
1394
1394
  }
1395
1395
  };
1396
1396
  const wellKnownProvider = new WellKnownProvider();
1397
- var version$1 = "2.1.1";
1397
+ var version$1 = "2.1.3";
1398
1398
  const isCancelled$1 = (value) => typeof value === "symbol";
1399
1399
  async function isSourcePrivate(source) {
1400
1400
  const ownerRepo = parseOwnerRepo(source);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ali/cli-skills",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "The open agent skills ecosystem",
5
5
  "type": "module",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ali-skills",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "The open agent skills ecosystem",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,7 +32,7 @@
32
32
  "author": "",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@ali/cli-skills": "^2.1.1"
35
+ "@ali/cli-skills": "^2.1.3"
36
36
  },
37
37
  "bundleDependencies": [
38
38
  "@ali/cli-skills"