ali-skills 0.1.6 → 0.1.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.
@@ -2,7 +2,7 @@ import { i as __toESM } from "./rolldown-runtime.mjs";
2
2
  import { l as pD, u as require_picocolors } from "./libs/@clack/core.mjs";
3
3
  import { a as Y, n as M, s as fe } from "./libs/@clack/prompts.mjs";
4
4
  import { i as SKILLS_API_BASE_URL, n as findPluginPackageRoots, t as validatePluginPackage } from "./plugin-manifest-validate.mjs";
5
- import { A as getDisplaySource, D as redactCliSnippet, F as resolveSourceInput, I as toInternalHttpsCloneUrl, P as parseSource, _ as trackPluginCommand, b as PLUGINS_SUBDIR, d as saveSelectedAgents, k as embedInternalGitCredentials, o as getLastSelectedAgents, v as trackPluginInstall, w as cloneRepo, y as AGENTS_DIR } from "./skill-lock.mjs";
5
+ import { A as getDisplaySource, D as redactCliSnippet, M as parseSource, N as resolveSourceInput, P as toInternalHttpsCloneUrl, _ as trackPluginCommand, b as PLUGINS_SUBDIR, d as saveSelectedAgents, k as embedInternalGitCredentials, o as getLastSelectedAgents, v as trackPluginInstall, w as cloneRepo, y as AGENTS_DIR } from "./skill-lock.mjs";
6
6
  import "./libs/@kwsites/file-exists.mjs";
7
7
  import "./libs/@kwsites/promise-deferred.mjs";
8
8
  import "./libs/simple-git.mjs";
@@ -55,25 +55,6 @@ function getOwnerRepo(parsed) {
55
55
  } catch {}
56
56
  return null;
57
57
  }
58
- function parseOwnerRepo(ownerRepo) {
59
- const match = ownerRepo.match(/^([^/]+)\/([^/]+)$/);
60
- if (match) return {
61
- owner: match[1],
62
- repo: match[2]
63
- };
64
- return null;
65
- }
66
- async function isRepoPrivate(owner, repo) {
67
- try {
68
- const source = encodeURIComponent(`${owner}/${repo}`);
69
- const res = await fetch(`${SKILLS_API_BASE_URL}/github/repository?source=${source}`);
70
- if (!res.ok) return null;
71
- const data = await res.json();
72
- return data.success && typeof data.data?.private === "boolean" ? data.data.private : null;
73
- } catch {
74
- return null;
75
- }
76
- }
77
58
  function sanitizeSubpath(subpath) {
78
59
  const segments = subpath.replace(/\\/g, "/").split("/");
79
60
  for (const segment of segments) if (segment === "..") throw new Error(`Unsafe subpath: "${subpath}" contains path traversal segments. Subpaths must not contain ".." components.`);
@@ -691,4 +672,4 @@ function sanitizeSourceUrl(url) {
691
672
  }
692
673
  return url;
693
674
  }
694
- export { getDisplaySource as A, cleanupTempDir as C, redactCliSnippet as D, listRemoteBranches as E, resolveSourceInput as F, toInternalHttpsCloneUrl as I, isRepoPrivate as M, parseOwnerRepo as N, redactSensitiveText as O, parseSource as P, GitCloneError as S, getGitHeadHash as T, trackPluginCommand as _, getAllLockedSkills as a, PLUGINS_SUBDIR as b, isPromptDismissed as c, saveSelectedAgents as d, fetchAuditData as f, track as g, setVersion as h, fetchAliInternalSkillVersion as i, getOwnerRepo as j, embedInternalGitCredentials as k, removeSkillFromLock as l, getPendingTelemetryCount as m, dismissPrompt as n, getLastSelectedAgents as o, flushTelemetry as p, fetchAliInternalCommitHash as r, getSkillFromLock as s, addSkillToLock as t, sanitizeSourceUrl as u, trackPluginInstall as v, cloneRepo as w, SKILLS_SUBDIR as x, AGENTS_DIR$1 as y };
675
+ export { getDisplaySource as A, cleanupTempDir as C, redactCliSnippet as D, listRemoteBranches as E, parseSource as M, resolveSourceInput as N, redactSensitiveText as O, toInternalHttpsCloneUrl as P, GitCloneError as S, getGitHeadHash as T, trackPluginCommand as _, getAllLockedSkills as a, PLUGINS_SUBDIR as b, isPromptDismissed as c, saveSelectedAgents as d, fetchAuditData as f, track as g, setVersion as h, fetchAliInternalSkillVersion as i, getOwnerRepo as j, embedInternalGitCredentials as k, removeSkillFromLock as l, getPendingTelemetryCount as m, dismissPrompt as n, getLastSelectedAgents as o, flushTelemetry as p, fetchAliInternalCommitHash as r, getSkillFromLock as s, addSkillToLock as t, sanitizeSourceUrl as u, trackPluginInstall as v, cloneRepo as w, SKILLS_SUBDIR as x, AGENTS_DIR$1 as y };
@@ -3,7 +3,7 @@ import { i as __toESM, n as __exportAll, r as __require } from "./_chunks/rolldo
3
3
  import { l as pD, u as require_picocolors } from "./_chunks/libs/@clack/core.mjs";
4
4
  import { a as Y, c as ge, d as ye, i as Se, l as ve, n as M, o as be, r as Me, s as fe, t as Ie, u as xe } from "./_chunks/libs/@clack/prompts.mjs";
5
5
  import { i as SKILLS_API_BASE_URL, r as GITLAB_ACCOUNT } from "./_chunks/plugin-manifest-validate.mjs";
6
- import { A as getDisplaySource, C as cleanupTempDir, E as listRemoteBranches, F as resolveSourceInput, I as toInternalHttpsCloneUrl, M as isRepoPrivate, N as parseOwnerRepo, O as redactSensitiveText, P as parseSource, S as GitCloneError, T as getGitHeadHash, a as getAllLockedSkills, c as isPromptDismissed, d as saveSelectedAgents, f as fetchAuditData, g as track, h as setVersion, i as fetchAliInternalSkillVersion, j as getOwnerRepo, l as removeSkillFromLock, m as getPendingTelemetryCount, n as dismissPrompt, o as getLastSelectedAgents, p as flushTelemetry, r as fetchAliInternalCommitHash, s as getSkillFromLock, t as addSkillToLock, u as sanitizeSourceUrl, w as cloneRepo, x as SKILLS_SUBDIR, y as AGENTS_DIR$1 } from "./_chunks/skill-lock.mjs";
6
+ import { A as getDisplaySource, C as cleanupTempDir, E as listRemoteBranches, M as parseSource, N as resolveSourceInput, O as redactSensitiveText, P as toInternalHttpsCloneUrl, S as GitCloneError, T as getGitHeadHash, a as getAllLockedSkills, c as isPromptDismissed, d as saveSelectedAgents, f as fetchAuditData, g as track, h as setVersion, i as fetchAliInternalSkillVersion, j as getOwnerRepo, l as removeSkillFromLock, m as getPendingTelemetryCount, n as dismissPrompt, o as getLastSelectedAgents, p as flushTelemetry, r as fetchAliInternalCommitHash, s as getSkillFromLock, t as addSkillToLock, u as sanitizeSourceUrl, w as cloneRepo, x as SKILLS_SUBDIR, y as AGENTS_DIR$1 } from "./_chunks/skill-lock.mjs";
7
7
  import "./_chunks/libs/@kwsites/file-exists.mjs";
8
8
  import "./_chunks/libs/@kwsites/promise-deferred.mjs";
9
9
  import "./_chunks/libs/simple-git.mjs";
@@ -1386,7 +1386,7 @@ var WellKnownProvider = class {
1386
1386
  }
1387
1387
  };
1388
1388
  const wellKnownProvider = new WellKnownProvider();
1389
- var version$1 = "2.1.7";
1389
+ var version$1 = "2.1.8";
1390
1390
  async function checkGithubVersions$1(requests, debugLog = () => {}) {
1391
1391
  const results = [];
1392
1392
  for (let offset = 0; offset < requests.length; offset += 100) results.push(...await checkGithubVersionBatch(requests.slice(offset, offset + 100), debugLog));
@@ -1559,14 +1559,12 @@ async function checkSkillUpdates(entries, dependencies) {
1559
1559
  return entries.map((entry) => results.get(entry.name));
1560
1560
  }
1561
1561
  const isCancelled$1 = (value) => typeof value === "symbol";
1562
- async function isSourcePrivate(source) {
1563
- const ownerRepo = parseOwnerRepo(source);
1564
- if (!ownerRepo) return false;
1565
- return isRepoPrivate(ownerRepo.owner, ownerRepo.repo);
1566
- }
1567
1562
  function initTelemetry(version) {
1568
1563
  setVersion(version);
1569
1564
  }
1565
+ function reportInstallTelemetry(data) {
1566
+ track(data);
1567
+ }
1570
1568
  function riskLabel(risk) {
1571
1569
  switch (risk) {
1572
1570
  case "critical": return import_picocolors.default.red(import_picocolors.default.bold("Critical Risk"));
@@ -1955,7 +1953,7 @@ async function handleWellKnownSkills(source, url, options, spinner) {
1955
1953
  skillFiles[skill.installName] = skill.sourceUrl;
1956
1954
  if (skill.description) skillDescriptions[skill.installName] = skill.description;
1957
1955
  }
1958
- if (await isSourcePrivate(sourceIdentifier) !== true) track({
1956
+ reportInstallTelemetry({
1959
1957
  event: "install",
1960
1958
  source: sourceIdentifier,
1961
1959
  skills: selectedSkills.map((s) => s.installName).join(","),
@@ -2467,36 +2465,19 @@ async function runAdd(args, options = {}) {
2467
2465
  }
2468
2466
  }
2469
2467
  }
2470
- if (normalizedSource && trackableSkillNames.length > 0) {
2471
- const ownerRepo = parseOwnerRepo(normalizedSource);
2472
- if (ownerRepo) {
2473
- if (await isRepoPrivate(ownerRepo.owner, ownerRepo.repo) === false) track({
2474
- event: "install",
2475
- source: normalizedSource,
2476
- skills: trackableSkillNames.join(","),
2477
- agents: targetAgents.join(","),
2478
- ...installGlobally && { global: "1" },
2479
- skillFiles: JSON.stringify(skillFiles),
2480
- sourceType: effectiveSourceType,
2481
- skillMdLastCommitAuthors: JSON.stringify(skillMdLastCommitAuthors),
2482
- skillMdLatestVersions: JSON.stringify(skillMdLatestVersions),
2483
- skillMdConfigAuthors: JSON.stringify(skillMdAuthors),
2484
- descriptions: JSON.stringify(skillDescriptions)
2485
- });
2486
- } else track({
2487
- event: "install",
2488
- source: normalizedSource,
2489
- skills: trackableSkillNames.join(","),
2490
- agents: targetAgents.join(","),
2491
- ...installGlobally && { global: "1" },
2492
- skillFiles: JSON.stringify(skillFiles),
2493
- sourceType: effectiveSourceType,
2494
- skillMdLastCommitAuthors: JSON.stringify(skillMdLastCommitAuthors),
2495
- skillMdLatestVersions: JSON.stringify(skillMdLatestVersions),
2496
- skillMdConfigAuthors: JSON.stringify(skillMdAuthors),
2497
- descriptions: JSON.stringify(skillDescriptions)
2498
- });
2499
- }
2468
+ if (normalizedSource && trackableSkillNames.length > 0) reportInstallTelemetry({
2469
+ event: "install",
2470
+ source: normalizedSource,
2471
+ skills: trackableSkillNames.join(","),
2472
+ agents: targetAgents.join(","),
2473
+ ...installGlobally && { global: "1" },
2474
+ skillFiles: JSON.stringify(skillFiles),
2475
+ sourceType: effectiveSourceType,
2476
+ skillMdLastCommitAuthors: JSON.stringify(skillMdLastCommitAuthors),
2477
+ skillMdLatestVersions: JSON.stringify(skillMdLatestVersions),
2478
+ skillMdConfigAuthors: JSON.stringify(skillMdAuthors),
2479
+ descriptions: JSON.stringify(skillDescriptions)
2480
+ });
2500
2481
  const githubCommitHashes = /* @__PURE__ */ new Map();
2501
2482
  if (successful.length > 0 && effectiveSourceType === "github" && tempDir) try {
2502
2483
  const successfulSkillNames = new Set(successful.map((result) => result.skill));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ali/cli-skills",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
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.6",
3
+ "version": "0.1.7",
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.7"
35
+ "@ali/cli-skills": "^2.1.8"
36
36
  },
37
37
  "bundleDependencies": [
38
38
  "@ali/cli-skills"