wittyhub 0.0.2 → 0.0.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +21 -23
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -2260,8 +2260,21 @@ async function listInstalledSkills(options = {}) {
2260
2260
  } catch {}
2261
2261
  return Array.from(skillsMap.values());
2262
2262
  }
2263
- const TELEMETRY_URL = "https://add-skill.vercel.sh/t";
2264
- const AUDIT_URL = "https://add-skill.vercel.sh/audit";
2263
+ const CLI_CONFIG_PATH = join(homedir(), ".config", "wittyhub", "cli.yaml");
2264
+ function loadCliConfig() {
2265
+ if (!existsSync(CLI_CONFIG_PATH)) return {};
2266
+ try {
2267
+ const parsed = parse(readFileSync(CLI_CONFIG_PATH, "utf-8"));
2268
+ if (!parsed || typeof parsed !== "object") return {};
2269
+ return parsed;
2270
+ } catch {
2271
+ return {};
2272
+ }
2273
+ }
2274
+ const DEFAULT_TELEMETRY_URL = "http://localhost:8080/api/v1/skills/telemetry";
2275
+ const cliConfig = loadCliConfig();
2276
+ const TELEMETRY_URL = typeof cliConfig.telemetry_url === "string" && cliConfig.telemetry_url.trim() ? cliConfig.telemetry_url.trim() : DEFAULT_TELEMETRY_URL;
2277
+ typeof cliConfig.audit_url === "string" && cliConfig.audit_url.trim() && cliConfig.audit_url.trim();
2265
2278
  let cliVersion = null;
2266
2279
  let detectedAgentName = null;
2267
2280
  function setDetectedAgent(agentName) {
@@ -2276,23 +2289,6 @@ function isEnabled() {
2276
2289
  function setVersion(version) {
2277
2290
  cliVersion = version;
2278
2291
  }
2279
- async function fetchAuditData(source, skillSlugs, timeoutMs = 3e3) {
2280
- if (skillSlugs.length === 0) return null;
2281
- try {
2282
- const params = new URLSearchParams({
2283
- source,
2284
- skills: skillSlugs.join(",")
2285
- });
2286
- const controller = new AbortController();
2287
- const timeout = setTimeout(() => controller.abort(), timeoutMs);
2288
- const response = await fetch(`${AUDIT_URL}?${params.toString()}`, { signal: controller.signal });
2289
- clearTimeout(timeout);
2290
- if (!response.ok) return null;
2291
- return await response.json();
2292
- } catch {
2293
- return null;
2294
- }
2295
- }
2296
2292
  const pendingTelemetry = [];
2297
2293
  function track(data) {
2298
2294
  if (!isEnabled()) return;
@@ -3164,7 +3160,7 @@ async function tryBlobInstall(ownerRepo, options = {}) {
3164
3160
  tree
3165
3161
  };
3166
3162
  }
3167
- var version$1 = "0.0.2";
3163
+ var version$1 = "0.0.3";
3168
3164
  const isCancelled$1 = (value) => typeof value === "symbol";
3169
3165
  async function isSourcePrivate(source) {
3170
3166
  const ownerRepo = parseOwnerRepo(source);
@@ -3896,7 +3892,7 @@ async function runAdd(args, options = {}) {
3896
3892
  selectedSkills = selected;
3897
3893
  }
3898
3894
  const ownerRepoForAudit = getOwnerRepo(parsed);
3899
- const auditPromise = ownerRepoForAudit ? fetchAuditData(ownerRepoForAudit, selectedSkills.map((s) => getSkillDisplayName(s))) : Promise.resolve(null);
3895
+ const auditPromise = Promise.resolve(null);
3900
3896
  let targetAgents;
3901
3897
  const validAgents = Object.keys(agents);
3902
3898
  if (options.agent?.includes("*")) {
@@ -4171,7 +4167,8 @@ async function runAdd(args, options = {}) {
4171
4167
  skills: selectedSkills.map((s) => s.name).join(","),
4172
4168
  agents: targetAgents.join(","),
4173
4169
  ...installGlobally && { global: "1" },
4174
- skillFiles: JSON.stringify(skillFiles)
4170
+ skillFiles: JSON.stringify(skillFiles),
4171
+ sourceType: parsed.type
4175
4172
  });
4176
4173
  } else track({
4177
4174
  event: "install",
@@ -4179,7 +4176,8 @@ async function runAdd(args, options = {}) {
4179
4176
  skills: selectedSkills.map((s) => s.name).join(","),
4180
4177
  agents: targetAgents.join(","),
4181
4178
  ...installGlobally && { global: "1" },
4182
- skillFiles: JSON.stringify(skillFiles)
4179
+ skillFiles: JSON.stringify(skillFiles),
4180
+ sourceType: parsed.type
4183
4181
  });
4184
4182
  if (successful.length > 0 && installGlobally && normalizedSource) {
4185
4183
  const successfulSkillNames = new Set(successful.map((r) => r.skill));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wittyhub",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "The open agent skills ecosystem",
5
5
  "type": "module",
6
6
  "bin": {