skilluse 0.3.0 → 0.3.1

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.js +82 -50
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -66540,16 +66540,18 @@ function isRateLimited(response) {
66540
66540
  }
66541
66541
  function getGitHubErrorMessage(response) {
66542
66542
  if (response.status === 401) {
66543
- return "This repository requires authentication. Run 'skilluse login' to access private repos.";
66543
+ return "Authentication required: This appears to be a private repository.";
66544
66544
  }
66545
66545
  if (response.status === 403) {
66546
66546
  if (isRateLimited(response)) {
66547
- return "Rate limit exceeded. Run 'skilluse login' for higher rate limits (5000 req/hr vs 60 req/hr).";
66547
+ const resetTime = response.headers.get("X-RateLimit-Reset");
66548
+ const resetInfo = resetTime ? ` (resets at ${new Date(Number(resetTime) * 1000).toLocaleTimeString()})` : "";
66549
+ return `Rate limit exceeded${resetInfo}. Login for higher limits (5000/hr vs 60/hr).`;
66548
66550
  }
66549
- return "This repository requires authentication. Run 'skilluse login' to access private repos.";
66551
+ return "Authentication required: Access denied to this repository.";
66550
66552
  }
66551
66553
  if (response.status === 404) {
66552
- return "Repository not found or requires authentication.";
66554
+ return "Repository not found. Check the owner/repo name or it may be private.";
66553
66555
  }
66554
66556
  return `GitHub API error: ${response.status}`;
66555
66557
  }
@@ -66569,6 +66571,12 @@ async function discoverSkillPaths(owner, repo, branch, token) {
66569
66571
  };
66570
66572
  }
66571
66573
  if (response.status === 404) {
66574
+ if (!token) {
66575
+ return {
66576
+ authRequired: true,
66577
+ message: `Repository ${owner}/${repo} not found. If this is a private repo, run 'skilluse login' first.`
66578
+ };
66579
+ }
66572
66580
  throw new Error(`Repository ${owner}/${repo} not found or branch '${branch}' doesn't exist`);
66573
66581
  }
66574
66582
  const error46 = await response.text();
@@ -68372,17 +68380,20 @@ var options6 = exports_external.object({
68372
68380
  function RepoAdd({ args: [repoArg], options: opts }) {
68373
68381
  const { exit } = use_app_default();
68374
68382
  const [state, setState] = import_react36.useState({ phase: "checking" });
68383
+ import_react36.useEffect(() => {
68384
+ if (state.phase === "invalid_repo" || state.phase === "already_exists" || state.phase === "auth_required" || state.phase === "error" || state.phase === "success") {
68385
+ exit();
68386
+ }
68387
+ }, [state.phase, exit]);
68375
68388
  import_react36.useEffect(() => {
68376
68389
  async function checkAndAdd() {
68377
68390
  if (!repoArg.match(/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/)) {
68378
68391
  setState({ phase: "invalid_repo" });
68379
- exit();
68380
68392
  return;
68381
68393
  }
68382
68394
  const config2 = getConfig();
68383
68395
  if (config2.repos.find((r) => r.repo === repoArg)) {
68384
68396
  setState({ phase: "already_exists", repo: repoArg });
68385
- exit();
68386
68397
  return;
68387
68398
  }
68388
68399
  if (opts.path !== undefined) {
@@ -68403,7 +68414,6 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68403
68414
  paths: paths2.length > 0 ? paths2 : ["(all paths)"],
68404
68415
  isDefault
68405
68416
  });
68406
- exit();
68407
68417
  return;
68408
68418
  }
68409
68419
  setState({ phase: "discovering", repo: repoArg });
@@ -68414,7 +68424,6 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68414
68424
  const result = await discoverSkillPaths(owner, repo, opts.branch, token);
68415
68425
  if ("authRequired" in result) {
68416
68426
  setState({ phase: "auth_required", message: result.message });
68417
- exit();
68418
68427
  return;
68419
68428
  }
68420
68429
  if (result.totalSkills === 0) {
@@ -68429,11 +68438,10 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68429
68438
  } catch (error46) {
68430
68439
  const message = error46 instanceof Error ? error46.message : "Unknown error";
68431
68440
  setState({ phase: "error", message });
68432
- exit();
68433
68441
  }
68434
68442
  }
68435
68443
  checkAndAdd();
68436
- }, [repoArg, opts.path, opts.branch, opts.default, exit]);
68444
+ }, [repoArg, opts.path, opts.branch, opts.default]);
68437
68445
  const handlePathsSelected = (selectedPaths) => {
68438
68446
  const config2 = getConfig();
68439
68447
  addRepo({
@@ -68451,7 +68459,6 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68451
68459
  paths: selectedPaths.length > 0 ? selectedPaths : ["(all paths)"],
68452
68460
  isDefault
68453
68461
  });
68454
- exit();
68455
68462
  };
68456
68463
  const handleNoSkillsOption = (option) => {
68457
68464
  const config2 = getConfig();
@@ -68459,7 +68466,7 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68459
68466
  case "manual":
68460
68467
  setState({ phase: "input_path", repo: repoArg, currentPath: "" });
68461
68468
  break;
68462
- case "add_all":
68469
+ case "add_all": {
68463
68470
  addRepo({
68464
68471
  repo: repoArg,
68465
68472
  branch: opts.branch,
@@ -68475,8 +68482,8 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68475
68482
  paths: ["(all paths)"],
68476
68483
  isDefault
68477
68484
  });
68478
- exit();
68479
68485
  break;
68486
+ }
68480
68487
  case "cancel":
68481
68488
  exit();
68482
68489
  break;
@@ -68503,7 +68510,6 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68503
68510
  paths: paths2.length > 0 ? paths2 : ["(all paths)"],
68504
68511
  isDefault
68505
68512
  });
68506
- exit();
68507
68513
  return;
68508
68514
  }
68509
68515
  if (key.backspace || key.delete) {
@@ -68532,11 +68538,45 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68532
68538
  case "auth_required":
68533
68539
  return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68534
68540
  flexDirection: "column",
68535
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
68536
- type: "error",
68537
- children: state.message
68538
- }, undefined, false, undefined, this)
68539
- }, undefined, false, undefined, this);
68541
+ children: [
68542
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
68543
+ type: "error",
68544
+ children: state.message
68545
+ }, undefined, false, undefined, this),
68546
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68547
+ marginTop: 1,
68548
+ flexDirection: "column",
68549
+ children: [
68550
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68551
+ dimColor: true,
68552
+ children: "To access private repositories:"
68553
+ }, undefined, false, undefined, this),
68554
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68555
+ dimColor: true,
68556
+ children: " 1. Run: skilluse login"
68557
+ }, undefined, false, undefined, this),
68558
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68559
+ dimColor: true,
68560
+ children: [
68561
+ " 2. Then retry: skilluse repo add ",
68562
+ repoArg
68563
+ ]
68564
+ }, undefined, true, undefined, this)
68565
+ ]
68566
+ }, undefined, true, undefined, this),
68567
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68568
+ marginTop: 1,
68569
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68570
+ dimColor: true,
68571
+ children: [
68572
+ "Or add without verification: skilluse repo add ",
68573
+ repoArg,
68574
+ " --path skills/"
68575
+ ]
68576
+ }, undefined, true, undefined, this)
68577
+ }, undefined, false, undefined, this)
68578
+ ]
68579
+ }, undefined, true, undefined, this);
68540
68580
  case "invalid_repo":
68541
68581
  return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68542
68582
  flexDirection: "column",
@@ -69170,40 +69210,32 @@ function RepoList(_props) {
69170
69210
  }, undefined, false, undefined, this),
69171
69211
  state.repos.map((repo) => {
69172
69212
  const isDefault = repo.repo === state.defaultRepo;
69213
+ const pathsDisplay = repo.paths.length > 0 ? repo.paths.join(", ") : "(all)";
69173
69214
  return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69174
- flexDirection: "column",
69175
- marginBottom: 1,
69176
69215
  children: [
69177
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69216
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69217
+ color: isDefault ? "green" : undefined,
69218
+ children: isDefault ? "● " : "○ "
69219
+ }, undefined, false, undefined, this),
69220
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69221
+ color: isDefault ? "cyan" : undefined,
69222
+ bold: isDefault,
69223
+ children: repo.repo
69224
+ }, undefined, false, undefined, this),
69225
+ isDefault && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69226
+ dimColor: true,
69227
+ children: " (default)"
69228
+ }, undefined, false, undefined, this),
69229
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69230
+ dimColor: true,
69178
69231
  children: [
69179
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69180
- color: isDefault ? "green" : undefined,
69181
- children: isDefault ? "● " : "○ "
69182
- }, undefined, false, undefined, this),
69183
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69184
- color: isDefault ? "cyan" : undefined,
69185
- bold: isDefault,
69186
- children: repo.repo
69187
- }, undefined, false, undefined, this),
69188
- isDefault && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69189
- dimColor: true,
69190
- children: " (default)"
69191
- }, undefined, false, undefined, this)
69232
+ " ",
69233
+ "[",
69234
+ repo.branch,
69235
+ "] ",
69236
+ pathsDisplay
69192
69237
  ]
69193
- }, undefined, true, undefined, this),
69194
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69195
- marginLeft: 2,
69196
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69197
- dimColor: true,
69198
- children: [
69199
- "Branch: ",
69200
- repo.branch,
69201
- " | Paths:",
69202
- " ",
69203
- repo.paths.length > 0 ? repo.paths.join(", ") : "(all)"
69204
- ]
69205
- }, undefined, true, undefined, this)
69206
- }, undefined, false, undefined, this)
69238
+ }, undefined, true, undefined, this)
69207
69239
  ]
69208
69240
  }, repo.repo, true, undefined, this);
69209
69241
  })
@@ -70413,7 +70445,7 @@ function Upgrade({ args: [skillName] }) {
70413
70445
  // package.json
70414
70446
  var package_default = {
70415
70447
  name: "skilluse",
70416
- version: "0.3.0",
70448
+ version: "0.3.1",
70417
70449
  description: "CLI tool for managing and installing AI Coding Agent Skills",
70418
70450
  main: "dist/cli.js",
70419
70451
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilluse",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "CLI tool for managing and installing AI Coding Agent Skills",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {