skilluse 0.4.0 → 0.5.0

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 +1617 -998
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -50725,9 +50725,8 @@ var import_react23 = __toESM(require_react(), 1);
50725
50725
  var import_react24 = __toESM(require_react(), 1);
50726
50726
  // node_modules/ink/build/hooks/use-is-screen-reader-enabled.js
50727
50727
  var import_react25 = __toESM(require_react(), 1);
50728
- // src/commands/info.tsx
50729
- import { readFile } from "node:fs/promises";
50730
- import { join as join2 } from "node:path";
50728
+ // src/commands/index.tsx
50729
+ import { existsSync as existsSync2 } from "node:fs";
50731
50730
  var import_react31 = __toESM(require_react(), 1);
50732
50731
 
50733
50732
  // node_modules/zod/v4/classic/external.js
@@ -66538,6 +66537,20 @@ function isAuthRequired(response) {
66538
66537
  function isRateLimited(response) {
66539
66538
  return response.headers.get("X-RateLimit-Remaining") === "0";
66540
66539
  }
66540
+ async function isPublicRepo(owner, repo, token) {
66541
+ try {
66542
+ const response = await fetch(`https://api.github.com/repos/${owner}/${repo}`, {
66543
+ headers: buildGitHubHeaders(token)
66544
+ });
66545
+ if (!response.ok) {
66546
+ return false;
66547
+ }
66548
+ const data = await response.json();
66549
+ return !data.private;
66550
+ } catch {
66551
+ return false;
66552
+ }
66553
+ }
66541
66554
  function getGitHubErrorMessage(response) {
66542
66555
  if (response.status === 401) {
66543
66556
  return "Authentication required: This appears to be a private repository.";
@@ -66611,12 +66624,276 @@ function extractParentPaths(skillMdPaths) {
66611
66624
  const result = Array.from(parentCounts.entries()).map(([path6, skillCount]) => ({ path: path6, skillCount })).sort((a, b) => b.skillCount - a.skillCount);
66612
66625
  return result;
66613
66626
  }
66614
- // src/commands/info.tsx
66627
+ // src/commands/index.tsx
66615
66628
  var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
66629
+ var options = exports_external.object({});
66630
+ function Index(_props) {
66631
+ const { exit } = use_app_default();
66632
+ const [state, setState] = import_react31.useState({ phase: "checking" });
66633
+ const [outputItems, setOutputItems] = import_react31.useState([]);
66634
+ import_react31.useEffect(() => {
66635
+ async function checkStatus() {
66636
+ const config2 = getConfig();
66637
+ const currentAgent = getCurrentAgent();
66638
+ const agentInfo = getAgent(currentAgent);
66639
+ const agentName = agentInfo?.name || currentAgent;
66640
+ const cwd2 = process.cwd();
66641
+ const skills = config2.installed.filter((skill) => {
66642
+ if (skill.agent !== currentAgent && skill.agent) {
66643
+ return false;
66644
+ }
66645
+ if (skill.scope === "local" && !skill.installedPath.startsWith(cwd2)) {
66646
+ return false;
66647
+ }
66648
+ if (!existsSync2(skill.installedPath)) {
66649
+ return false;
66650
+ }
66651
+ return true;
66652
+ });
66653
+ const credentials = await getCredentials();
66654
+ if (!credentials) {
66655
+ setState({
66656
+ phase: "success",
66657
+ isLoggedIn: false,
66658
+ currentAgent,
66659
+ agentName,
66660
+ repos: config2.repos,
66661
+ defaultRepo: config2.defaultRepo,
66662
+ skills
66663
+ });
66664
+ return;
66665
+ }
66666
+ try {
66667
+ const response = await fetch("https://api.github.com/user", {
66668
+ headers: buildGitHubHeaders(credentials.token)
66669
+ });
66670
+ if (!response.ok) {
66671
+ setState({
66672
+ phase: "success",
66673
+ isLoggedIn: false,
66674
+ currentAgent,
66675
+ agentName,
66676
+ repos: config2.repos,
66677
+ defaultRepo: config2.defaultRepo,
66678
+ skills
66679
+ });
66680
+ return;
66681
+ }
66682
+ const userData = await response.json();
66683
+ setState({
66684
+ phase: "success",
66685
+ isLoggedIn: true,
66686
+ username: userData.login,
66687
+ currentAgent,
66688
+ agentName,
66689
+ repos: config2.repos,
66690
+ defaultRepo: config2.defaultRepo,
66691
+ skills
66692
+ });
66693
+ } catch (err) {
66694
+ setState({
66695
+ phase: "error",
66696
+ message: err instanceof Error ? err.message : "Failed to fetch status"
66697
+ });
66698
+ }
66699
+ }
66700
+ checkStatus();
66701
+ }, []);
66702
+ import_react31.useEffect(() => {
66703
+ const isFinalState = state.phase === "success" || state.phase === "error";
66704
+ if (isFinalState && outputItems.length === 0) {
66705
+ setOutputItems([{ id: "output" }]);
66706
+ }
66707
+ }, [state.phase, outputItems.length]);
66708
+ import_react31.useEffect(() => {
66709
+ if (outputItems.length > 0) {
66710
+ process.nextTick(() => exit());
66711
+ }
66712
+ }, [outputItems.length, exit]);
66713
+ const renderContent = () => {
66714
+ if (state.phase === "error") {
66715
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusMessage, {
66716
+ type: "error",
66717
+ children: state.message
66718
+ }, undefined, false, undefined, this);
66719
+ }
66720
+ if (state.phase === "success") {
66721
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66722
+ flexDirection: "column",
66723
+ children: [
66724
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66725
+ bold: true,
66726
+ children: "Authentication"
66727
+ }, undefined, false, undefined, this),
66728
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66729
+ marginLeft: 2,
66730
+ marginBottom: 1,
66731
+ children: state.isLoggedIn ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66732
+ children: [
66733
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66734
+ color: "green",
66735
+ children: "✓"
66736
+ }, undefined, false, undefined, this),
66737
+ " Logged in as",
66738
+ " ",
66739
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66740
+ color: "green",
66741
+ children: [
66742
+ "@",
66743
+ state.username
66744
+ ]
66745
+ }, undefined, true, undefined, this)
66746
+ ]
66747
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66748
+ children: [
66749
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66750
+ dimColor: true,
66751
+ children: "○"
66752
+ }, undefined, false, undefined, this),
66753
+ " ",
66754
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66755
+ dimColor: true,
66756
+ children: "Not logged in (run 'skilluse login')"
66757
+ }, undefined, false, undefined, this)
66758
+ ]
66759
+ }, undefined, true, undefined, this)
66760
+ }, undefined, false, undefined, this),
66761
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66762
+ bold: true,
66763
+ children: "Agent"
66764
+ }, undefined, false, undefined, this),
66765
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66766
+ marginLeft: 2,
66767
+ marginBottom: 1,
66768
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66769
+ children: [
66770
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66771
+ color: "cyan",
66772
+ children: "●"
66773
+ }, undefined, false, undefined, this),
66774
+ " ",
66775
+ state.agentName,
66776
+ " ",
66777
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66778
+ dimColor: true,
66779
+ children: [
66780
+ "(",
66781
+ state.currentAgent,
66782
+ ")"
66783
+ ]
66784
+ }, undefined, true, undefined, this)
66785
+ ]
66786
+ }, undefined, true, undefined, this)
66787
+ }, undefined, false, undefined, this),
66788
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66789
+ bold: true,
66790
+ children: [
66791
+ "Repos (",
66792
+ state.repos.length,
66793
+ ")"
66794
+ ]
66795
+ }, undefined, true, undefined, this),
66796
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66797
+ flexDirection: "column",
66798
+ marginLeft: 2,
66799
+ marginBottom: 1,
66800
+ children: state.repos.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66801
+ dimColor: true,
66802
+ children: "(no repositories configured)"
66803
+ }, undefined, false, undefined, this) : state.repos.map((repo) => {
66804
+ const isDefault = repo.repo === state.defaultRepo;
66805
+ const pathDisplay = repo.paths.length > 0 ? repo.paths.join(", ") : "(all)";
66806
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66807
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66808
+ children: [
66809
+ isDefault ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66810
+ color: "cyan",
66811
+ children: "●"
66812
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66813
+ dimColor: true,
66814
+ children: "○"
66815
+ }, undefined, false, undefined, this),
66816
+ " ",
66817
+ repo.repo,
66818
+ " ",
66819
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66820
+ dimColor: true,
66821
+ children: [
66822
+ "[",
66823
+ repo.branch,
66824
+ "] ",
66825
+ pathDisplay
66826
+ ]
66827
+ }, undefined, true, undefined, this),
66828
+ isDefault && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66829
+ color: "cyan",
66830
+ children: " (default)"
66831
+ }, undefined, false, undefined, this)
66832
+ ]
66833
+ }, undefined, true, undefined, this)
66834
+ }, repo.repo, false, undefined, this);
66835
+ })
66836
+ }, undefined, false, undefined, this),
66837
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66838
+ bold: true,
66839
+ children: [
66840
+ "Installed Skills (",
66841
+ state.skills.length,
66842
+ ")"
66843
+ ]
66844
+ }, undefined, true, undefined, this),
66845
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66846
+ flexDirection: "column",
66847
+ marginLeft: 2,
66848
+ children: state.skills.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66849
+ dimColor: true,
66850
+ children: "(no skills installed)"
66851
+ }, undefined, false, undefined, this) : state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66852
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66853
+ children: [
66854
+ skill.name,
66855
+ " ",
66856
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66857
+ dimColor: true,
66858
+ children: [
66859
+ "from ",
66860
+ skill.repo
66861
+ ]
66862
+ }, undefined, true, undefined, this)
66863
+ ]
66864
+ }, undefined, true, undefined, this)
66865
+ }, skill.name, false, undefined, this))
66866
+ }, undefined, false, undefined, this)
66867
+ ]
66868
+ }, undefined, true, undefined, this);
66869
+ }
66870
+ return null;
66871
+ };
66872
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
66873
+ children: [
66874
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Spinner2, {
66875
+ text: "Loading..."
66876
+ }, undefined, false, undefined, this),
66877
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Static, {
66878
+ items: outputItems,
66879
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66880
+ flexDirection: "column",
66881
+ children: renderContent()
66882
+ }, item.id, false, undefined, this)
66883
+ }, undefined, false, undefined, this)
66884
+ ]
66885
+ }, undefined, true, undefined, this);
66886
+ }
66887
+
66888
+ // src/commands/info.tsx
66889
+ import { readFile } from "node:fs/promises";
66890
+ import { join as join2 } from "node:path";
66891
+ var import_react32 = __toESM(require_react(), 1);
66892
+ var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
66616
66893
  var args = exports_external.tuple([
66617
66894
  exports_external.string().describe("Skill name to show info for")
66618
66895
  ]);
66619
- var options = exports_external.object({});
66896
+ var options2 = exports_external.object({});
66620
66897
  function parseFrontmatter(content) {
66621
66898
  const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
66622
66899
  if (!frontmatterMatch)
@@ -66721,8 +66998,9 @@ async function getRemoteSkillInfo(token, skillName, repos) {
66721
66998
  }
66722
66999
  function Info({ args: [skillName] }) {
66723
67000
  const { exit } = use_app_default();
66724
- const [state, setState] = import_react31.useState({ phase: "checking" });
66725
- import_react31.useEffect(() => {
67001
+ const [state, setState] = import_react32.useState({ phase: "checking" });
67002
+ const [outputItems, setOutputItems] = import_react32.useState([]);
67003
+ import_react32.useEffect(() => {
66726
67004
  async function loadInfo() {
66727
67005
  setState({ phase: "loading" });
66728
67006
  const config2 = getConfig();
@@ -66731,7 +67009,6 @@ function Info({ args: [skillName] }) {
66731
67009
  const info = await getLocalSkillInfo(installedSkill);
66732
67010
  if (info) {
66733
67011
  setState({ phase: "success", info });
66734
- exit();
66735
67012
  return;
66736
67013
  }
66737
67014
  }
@@ -66740,7 +67017,6 @@ function Info({ args: [skillName] }) {
66740
67017
  const remoteResult = await getRemoteSkillInfo(token, skillName, config2.repos);
66741
67018
  if (remoteResult && "authRequired" in remoteResult) {
66742
67019
  setState({ phase: "auth_required", message: remoteResult.message });
66743
- exit();
66744
67020
  return;
66745
67021
  }
66746
67022
  if (remoteResult) {
@@ -66748,205 +67024,224 @@ function Info({ args: [skillName] }) {
66748
67024
  } else {
66749
67025
  setState({ phase: "not_found", skillName });
66750
67026
  }
66751
- exit();
66752
67027
  }
66753
67028
  loadInfo().catch((err) => {
66754
67029
  setState({
66755
67030
  phase: "error",
66756
67031
  message: err instanceof Error ? err.message : "Failed to load skill info"
66757
67032
  });
66758
- exit();
66759
67033
  });
66760
- }, [skillName, exit]);
66761
- switch (state.phase) {
66762
- case "checking":
66763
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Spinner2, {
66764
- text: "Initializing..."
66765
- }, undefined, false, undefined, this);
66766
- case "auth_required":
66767
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66768
- flexDirection: "column",
66769
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusMessage, {
66770
- type: "error",
66771
- children: state.message
66772
- }, undefined, false, undefined, this)
66773
- }, undefined, false, undefined, this);
66774
- case "loading":
66775
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Spinner2, {
66776
- text: `Loading info for "${skillName}"...`
66777
- }, undefined, false, undefined, this);
66778
- case "not_found":
66779
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66780
- flexDirection: "column",
66781
- children: [
66782
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusMessage, {
67034
+ }, [skillName]);
67035
+ import_react32.useEffect(() => {
67036
+ const isFinalState = state.phase === "success" || state.phase === "not_found" || state.phase === "auth_required" || state.phase === "error";
67037
+ if (isFinalState && outputItems.length === 0) {
67038
+ setOutputItems([{ id: "output" }]);
67039
+ }
67040
+ }, [state.phase, outputItems.length]);
67041
+ import_react32.useEffect(() => {
67042
+ if (outputItems.length > 0) {
67043
+ process.nextTick(() => exit());
67044
+ }
67045
+ }, [outputItems.length, exit]);
67046
+ const renderContent = () => {
67047
+ switch (state.phase) {
67048
+ case "auth_required":
67049
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67050
+ flexDirection: "column",
67051
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
66783
67052
  type: "error",
66784
- children: [
66785
- 'Skill "',
66786
- state.skillName,
66787
- '" not found'
66788
- ]
66789
- }, undefined, true, undefined, this),
66790
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66791
- marginTop: 1,
66792
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66793
- dimColor: true,
67053
+ children: state.message
67054
+ }, undefined, false, undefined, this)
67055
+ }, undefined, false, undefined, this);
67056
+ case "not_found":
67057
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67058
+ flexDirection: "column",
67059
+ children: [
67060
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
67061
+ type: "error",
66794
67062
  children: [
66795
- "Try 'skilluse search ",
67063
+ 'Skill "',
66796
67064
  state.skillName,
66797
- "' to find available skills."
67065
+ '" not found'
66798
67066
  ]
66799
- }, undefined, true, undefined, this)
66800
- }, undefined, false, undefined, this)
66801
- ]
66802
- }, undefined, true, undefined, this);
66803
- case "success": {
66804
- const { info } = state;
66805
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66806
- flexDirection: "column",
66807
- children: [
66808
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66809
- marginBottom: 1,
66810
- children: [
66811
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66812
- color: "cyan",
66813
- bold: true,
66814
- children: info.name
66815
- }, undefined, false, undefined, this),
66816
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
67067
+ }, undefined, true, undefined, this),
67068
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67069
+ marginTop: 1,
67070
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67071
+ dimColor: true,
66817
67072
  children: [
66818
- " v",
66819
- info.version
67073
+ "Try 'skilluse search ",
67074
+ state.skillName,
67075
+ "' to find available skills."
66820
67076
  ]
66821
- }, undefined, true, undefined, this),
66822
- info.installed && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66823
- color: "green",
66824
- children: " (installed)"
66825
- }, undefined, false, undefined, this)
66826
- ]
66827
- }, undefined, true, undefined, this),
66828
- info.description && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66829
- marginBottom: 1,
66830
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66831
- children: info.description
67077
+ }, undefined, true, undefined, this)
66832
67078
  }, undefined, false, undefined, this)
66833
- }, undefined, false, undefined, this),
66834
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66835
- flexDirection: "column",
66836
- marginLeft: 2,
66837
- children: [
66838
- info.type && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66839
- children: [
66840
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66841
- dimColor: true,
66842
- children: "Type: "
66843
- }, undefined, false, undefined, this),
66844
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66845
- children: info.type
66846
- }, undefined, false, undefined, this)
66847
- ]
66848
- }, undefined, true, undefined, this),
66849
- info.author && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66850
- children: [
66851
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66852
- dimColor: true,
66853
- children: "Author: "
66854
- }, undefined, false, undefined, this),
66855
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66856
- children: info.author
66857
- }, undefined, false, undefined, this)
66858
- ]
66859
- }, undefined, true, undefined, this),
66860
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66861
- children: [
66862
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66863
- dimColor: true,
66864
- children: "Source: "
66865
- }, undefined, false, undefined, this),
66866
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66867
- children: [
66868
- info.repo,
66869
- "/",
66870
- info.repoPath
66871
- ]
66872
- }, undefined, true, undefined, this)
66873
- ]
66874
- }, undefined, true, undefined, this),
66875
- info.tags && info.tags.length > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66876
- children: [
66877
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66878
- dimColor: true,
66879
- children: "Tags: "
66880
- }, undefined, false, undefined, this),
66881
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66882
- children: info.tags.join(", ")
66883
- }, undefined, false, undefined, this)
66884
- ]
66885
- }, undefined, true, undefined, this),
66886
- info.installed && info.scope && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66887
- children: [
66888
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66889
- dimColor: true,
66890
- children: "Scope: "
66891
- }, undefined, false, undefined, this),
66892
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66893
- children: info.scope
66894
- }, undefined, false, undefined, this)
66895
- ]
66896
- }, undefined, true, undefined, this),
66897
- info.installed && info.installedPath && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66898
- children: [
66899
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66900
- dimColor: true,
66901
- children: "Location: "
66902
- }, undefined, false, undefined, this),
66903
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66904
- children: info.installedPath
66905
- }, undefined, false, undefined, this)
66906
- ]
66907
- }, undefined, true, undefined, this),
66908
- info.installed && info.commitSha && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
67079
+ ]
67080
+ }, undefined, true, undefined, this);
67081
+ case "success": {
67082
+ const { info } = state;
67083
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67084
+ flexDirection: "column",
67085
+ children: [
67086
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67087
+ marginBottom: 1,
67088
+ children: [
67089
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67090
+ color: "cyan",
67091
+ bold: true,
67092
+ children: info.name
67093
+ }, undefined, false, undefined, this),
67094
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67095
+ children: [
67096
+ " v",
67097
+ info.version
67098
+ ]
67099
+ }, undefined, true, undefined, this),
67100
+ info.installed && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67101
+ color: "green",
67102
+ children: " (installed)"
67103
+ }, undefined, false, undefined, this)
67104
+ ]
67105
+ }, undefined, true, undefined, this),
67106
+ info.description && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67107
+ marginBottom: 1,
67108
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67109
+ children: info.description
67110
+ }, undefined, false, undefined, this)
67111
+ }, undefined, false, undefined, this),
67112
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67113
+ flexDirection: "column",
67114
+ marginLeft: 2,
67115
+ children: [
67116
+ info.type && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67117
+ children: [
67118
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67119
+ dimColor: true,
67120
+ children: "Type: "
67121
+ }, undefined, false, undefined, this),
67122
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67123
+ children: info.type
67124
+ }, undefined, false, undefined, this)
67125
+ ]
67126
+ }, undefined, true, undefined, this),
67127
+ info.author && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67128
+ children: [
67129
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67130
+ dimColor: true,
67131
+ children: "Author: "
67132
+ }, undefined, false, undefined, this),
67133
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67134
+ children: info.author
67135
+ }, undefined, false, undefined, this)
67136
+ ]
67137
+ }, undefined, true, undefined, this),
67138
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67139
+ children: [
67140
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67141
+ dimColor: true,
67142
+ children: "Source: "
67143
+ }, undefined, false, undefined, this),
67144
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67145
+ children: [
67146
+ info.repo,
67147
+ "/",
67148
+ info.repoPath
67149
+ ]
67150
+ }, undefined, true, undefined, this)
67151
+ ]
67152
+ }, undefined, true, undefined, this),
67153
+ info.tags && info.tags.length > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67154
+ children: [
67155
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67156
+ dimColor: true,
67157
+ children: "Tags: "
67158
+ }, undefined, false, undefined, this),
67159
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67160
+ children: info.tags.join(", ")
67161
+ }, undefined, false, undefined, this)
67162
+ ]
67163
+ }, undefined, true, undefined, this),
67164
+ info.installed && info.scope && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67165
+ children: [
67166
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67167
+ dimColor: true,
67168
+ children: "Scope: "
67169
+ }, undefined, false, undefined, this),
67170
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67171
+ children: info.scope
67172
+ }, undefined, false, undefined, this)
67173
+ ]
67174
+ }, undefined, true, undefined, this),
67175
+ info.installed && info.installedPath && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67176
+ children: [
67177
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67178
+ dimColor: true,
67179
+ children: "Location: "
67180
+ }, undefined, false, undefined, this),
67181
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67182
+ children: info.installedPath
67183
+ }, undefined, false, undefined, this)
67184
+ ]
67185
+ }, undefined, true, undefined, this),
67186
+ info.installed && info.commitSha && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67187
+ children: [
67188
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67189
+ dimColor: true,
67190
+ children: "Commit: "
67191
+ }, undefined, false, undefined, this),
67192
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67193
+ children: info.commitSha.substring(0, 7)
67194
+ }, undefined, false, undefined, this)
67195
+ ]
67196
+ }, undefined, true, undefined, this)
67197
+ ]
67198
+ }, undefined, true, undefined, this),
67199
+ !info.installed && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67200
+ marginTop: 1,
67201
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67202
+ dimColor: true,
66909
67203
  children: [
66910
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66911
- dimColor: true,
66912
- children: "Commit: "
66913
- }, undefined, false, undefined, this),
66914
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66915
- children: info.commitSha.substring(0, 7)
66916
- }, undefined, false, undefined, this)
67204
+ "Run 'skilluse install ",
67205
+ info.name,
67206
+ "' to install this skill."
66917
67207
  ]
66918
67208
  }, undefined, true, undefined, this)
66919
- ]
66920
- }, undefined, true, undefined, this),
66921
- !info.installed && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
66922
- marginTop: 1,
66923
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
66924
- dimColor: true,
66925
- children: [
66926
- "Run 'skilluse install ",
66927
- info.name,
66928
- "' to install this skill."
66929
- ]
66930
- }, undefined, true, undefined, this)
66931
- }, undefined, false, undefined, this)
66932
- ]
66933
- }, undefined, true, undefined, this);
67209
+ }, undefined, false, undefined, this)
67210
+ ]
67211
+ }, undefined, true, undefined, this);
67212
+ }
67213
+ case "error":
67214
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
67215
+ type: "error",
67216
+ children: state.message
67217
+ }, undefined, false, undefined, this);
67218
+ default:
67219
+ return null;
66934
67220
  }
66935
- case "error":
66936
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StatusMessage, {
66937
- type: "error",
66938
- children: state.message
66939
- }, undefined, false, undefined, this);
66940
- }
67221
+ };
67222
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
67223
+ children: [
67224
+ (state.phase === "checking" || state.phase === "loading") && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Spinner2, {
67225
+ text: state.phase === "loading" ? `Loading info for "${skillName}"...` : "Initializing..."
67226
+ }, undefined, false, undefined, this),
67227
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Static, {
67228
+ items: outputItems,
67229
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67230
+ flexDirection: "column",
67231
+ children: renderContent()
67232
+ }, item.id, false, undefined, this)
67233
+ }, undefined, false, undefined, this)
67234
+ ]
67235
+ }, undefined, true, undefined, this);
66941
67236
  }
66942
67237
 
66943
67238
  // src/commands/install.tsx
66944
67239
  import { mkdir, writeFile } from "node:fs/promises";
66945
67240
  import { basename, join as join3 } from "node:path";
66946
- var import_react32 = __toESM(require_react(), 1);
66947
- var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
67241
+ var import_react33 = __toESM(require_react(), 1);
67242
+ var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
66948
67243
  var args2 = exports_external.tuple([exports_external.string().describe("Skill name to install")]);
66949
- var options2 = exports_external.object({
67244
+ var options3 = exports_external.object({
66950
67245
  global: exports_external.boolean().default(false).describe("Install globally to agent's global skills path"),
66951
67246
  agent: exports_external.string().optional().describe("Override current agent (e.g., cursor, claude)")
66952
67247
  });
@@ -66956,8 +67251,125 @@ var FINAL_PHASES = [
66956
67251
  "auth_required",
66957
67252
  "no_repos",
66958
67253
  "not_found",
66959
- "conflict"
67254
+ "conflict",
67255
+ "cancelled"
66960
67256
  ];
67257
+ function SecurityWarningPrompt({
67258
+ skill,
67259
+ onConfirm,
67260
+ onCancel
67261
+ }) {
67262
+ use_input_default((input, key) => {
67263
+ if (input.toLowerCase() === "y" || key.return) {
67264
+ onConfirm();
67265
+ } else if (input.toLowerCase() === "n" || key.escape) {
67266
+ onCancel();
67267
+ }
67268
+ });
67269
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67270
+ flexDirection: "column",
67271
+ borderStyle: "round",
67272
+ paddingX: 1,
67273
+ children: [
67274
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67275
+ marginBottom: 1,
67276
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67277
+ color: "yellow",
67278
+ bold: true,
67279
+ children: "Security Warning"
67280
+ }, undefined, false, undefined, this)
67281
+ }, undefined, false, undefined, this),
67282
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67283
+ flexDirection: "column",
67284
+ marginBottom: 1,
67285
+ children: [
67286
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67287
+ children: [
67288
+ "You are about to install",
67289
+ " ",
67290
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67291
+ color: "cyan",
67292
+ bold: true,
67293
+ children: skill.name
67294
+ }, undefined, false, undefined, this),
67295
+ " ",
67296
+ "from a ",
67297
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67298
+ color: "yellow",
67299
+ children: "public repository"
67300
+ }, undefined, false, undefined, this),
67301
+ ":"
67302
+ ]
67303
+ }, undefined, true, undefined, this),
67304
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67305
+ marginLeft: 2,
67306
+ marginTop: 1,
67307
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67308
+ dimColor: true,
67309
+ children: skill.repo
67310
+ }, undefined, false, undefined, this)
67311
+ }, undefined, false, undefined, this)
67312
+ ]
67313
+ }, undefined, true, undefined, this),
67314
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67315
+ flexDirection: "column",
67316
+ marginBottom: 1,
67317
+ children: [
67318
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67319
+ children: "Skills can execute arbitrary code. Please review the skill content"
67320
+ }, undefined, false, undefined, this),
67321
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67322
+ children: [
67323
+ "at",
67324
+ " ",
67325
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67326
+ color: "blue",
67327
+ underline: true,
67328
+ children: [
67329
+ "https://github.com/",
67330
+ skill.repo
67331
+ ]
67332
+ }, undefined, true, undefined, this),
67333
+ " ",
67334
+ "before proceeding."
67335
+ ]
67336
+ }, undefined, true, undefined, this)
67337
+ ]
67338
+ }, undefined, true, undefined, this),
67339
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67340
+ marginBottom: 1,
67341
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67342
+ dimColor: true,
67343
+ children: "Consider installing from your own private repo for better security."
67344
+ }, undefined, false, undefined, this)
67345
+ }, undefined, false, undefined, this),
67346
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67347
+ children: [
67348
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67349
+ dimColor: true,
67350
+ children: "Press "
67351
+ }, undefined, false, undefined, this),
67352
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67353
+ color: "green",
67354
+ children: "Y"
67355
+ }, undefined, false, undefined, this),
67356
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67357
+ dimColor: true,
67358
+ children: " to continue, "
67359
+ }, undefined, false, undefined, this),
67360
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67361
+ color: "red",
67362
+ children: "N"
67363
+ }, undefined, false, undefined, this),
67364
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67365
+ dimColor: true,
67366
+ children: " to cancel"
67367
+ }, undefined, false, undefined, this)
67368
+ ]
67369
+ }, undefined, true, undefined, this)
67370
+ ]
67371
+ }, undefined, true, undefined, this);
67372
+ }
66961
67373
  function parseFrontmatter2(content) {
66962
67374
  const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
66963
67375
  if (!frontmatterMatch) {
@@ -67164,9 +67576,9 @@ async function fetchGitHubSkill(token, owner, repo, path6, branch = "main") {
67164
67576
  }
67165
67577
  function Install({ args: [skillName], options: opts }) {
67166
67578
  const { exit } = use_app_default();
67167
- const [state, setState] = import_react32.useState({ phase: "checking" });
67168
- const [outputItems, setOutputItems] = import_react32.useState([]);
67169
- import_react32.useEffect(() => {
67579
+ const [state, setState] = import_react33.useState({ phase: "checking" });
67580
+ const [outputItems, setOutputItems] = import_react33.useState([]);
67581
+ import_react33.useEffect(() => {
67170
67582
  async function install() {
67171
67583
  const agentId = opts.agent || getCurrentAgent();
67172
67584
  const agent = getAgent(agentId);
@@ -67197,6 +67609,19 @@ function Install({ args: [skillName], options: opts }) {
67197
67609
  return;
67198
67610
  }
67199
67611
  const { skill: skill2, commitSha: commitSha2 } = result;
67612
+ const isPublic2 = await isPublicRepo(source.owner, source.repo, token);
67613
+ if (isPublic2) {
67614
+ setState({
67615
+ phase: "warning",
67616
+ skill: skill2,
67617
+ commitSha: commitSha2,
67618
+ scope,
67619
+ agentId,
67620
+ branch: source.branch,
67621
+ source
67622
+ });
67623
+ return;
67624
+ }
67200
67625
  const baseDir2 = getSkillsPath(agentId, scope);
67201
67626
  const installPath2 = join3(baseDir2, skill2.name);
67202
67627
  const steps2 = [
@@ -67268,8 +67693,8 @@ function Install({ args: [skillName], options: opts }) {
67268
67693
  return;
67269
67694
  }
67270
67695
  const allRepos = config2.repos;
67271
- for (const repo of allRepos) {
67272
- setState({ phase: "searching", repo: repo.repo });
67696
+ for (const repo2 of allRepos) {
67697
+ setState({ phase: "searching", repo: repo2.repo });
67273
67698
  }
67274
67699
  const findResult = await findSkill(token, allRepos, source.name);
67275
67700
  if ("authRequired" in findResult) {
@@ -67293,6 +67718,22 @@ function Install({ args: [skillName], options: opts }) {
67293
67718
  return;
67294
67719
  }
67295
67720
  const { skill, commitSha } = results[0];
67721
+ const repoConfig = config2.repos.find((r) => r.repo === skill.repo);
67722
+ const branch = repoConfig?.branch || "main";
67723
+ const [owner, repo] = skill.repo.split("/");
67724
+ const isPublic = await isPublicRepo(owner, repo, token);
67725
+ if (isPublic) {
67726
+ setState({
67727
+ phase: "warning",
67728
+ skill,
67729
+ commitSha,
67730
+ scope,
67731
+ agentId,
67732
+ branch,
67733
+ source
67734
+ });
67735
+ return;
67736
+ }
67296
67737
  const baseDir = getSkillsPath(agentId, scope);
67297
67738
  const installPath = join3(baseDir, skill.name);
67298
67739
  const steps = [
@@ -67312,8 +67753,6 @@ function Install({ args: [skillName], options: opts }) {
67312
67753
  progress: 25
67313
67754
  });
67314
67755
  try {
67315
- const repoConfig = config2.repos.find((r) => r.repo === skill.repo);
67316
- const branch = repoConfig?.branch || "main";
67317
67756
  const downloadResult = await downloadSkillFiles(token, skill.repo, skill.path, branch, installPath, (downloaded, total) => {
67318
67757
  const downloadProgress = 25 + downloaded / total * 50;
67319
67758
  setState((prev) => {
@@ -67378,44 +67817,134 @@ function Install({ args: [skillName], options: opts }) {
67378
67817
  });
67379
67818
  });
67380
67819
  }, [skillName, opts.global, opts.agent]);
67381
- import_react32.useEffect(() => {
67820
+ const performInstall = import_react33.useCallback(async () => {
67821
+ if (state.phase !== "warning")
67822
+ return;
67823
+ const { skill, commitSha, scope, agentId, branch, source } = state;
67824
+ const agent = getAgent(agentId);
67825
+ if (!agent) {
67826
+ setState({ phase: "error", message: `Unknown agent: ${agentId}` });
67827
+ return;
67828
+ }
67829
+ const credentials = await getCredentials();
67830
+ const token = credentials?.token;
67831
+ const baseDir = getSkillsPath(agentId, scope);
67832
+ const installPath = join3(baseDir, skill.name);
67833
+ const steps = [
67834
+ { label: "Fetching skill metadata", status: "done" },
67835
+ { label: "Downloading files", status: "in_progress" },
67836
+ {
67837
+ label: `Installing to ${agent.localPath}/${skill.name}`,
67838
+ status: "pending"
67839
+ },
67840
+ { label: "Verifying installation", status: "pending" }
67841
+ ];
67842
+ setState({
67843
+ phase: "installing",
67844
+ skill,
67845
+ scope,
67846
+ steps,
67847
+ progress: 25
67848
+ });
67849
+ try {
67850
+ const skillPath = source.type === "github" ? source.path || "" : skill.path;
67851
+ const repoName = source.type === "github" ? `${source.owner}/${source.repo}` : skill.repo;
67852
+ const downloadResult = await downloadSkillFiles(token, repoName, skillPath, branch, installPath, (downloaded, total) => {
67853
+ const downloadProgress = 25 + downloaded / total * 50;
67854
+ setState((prev) => {
67855
+ if (prev.phase !== "installing")
67856
+ return prev;
67857
+ return { ...prev, progress: Math.round(downloadProgress) };
67858
+ });
67859
+ });
67860
+ if (downloadResult && "authRequired" in downloadResult) {
67861
+ setState({ phase: "auth_required", message: downloadResult.message });
67862
+ return;
67863
+ }
67864
+ steps[1].status = "done";
67865
+ steps[2].status = "in_progress";
67866
+ setState((prev) => {
67867
+ if (prev.phase !== "installing")
67868
+ return prev;
67869
+ return { ...prev, steps: [...steps], progress: 85 };
67870
+ });
67871
+ const installedSkill = {
67872
+ name: skill.name,
67873
+ repo: skill.repo,
67874
+ repoPath: skill.path,
67875
+ commitSha,
67876
+ version: skill.version || "1.0.0",
67877
+ type: skill.type || "skill",
67878
+ installedPath: installPath,
67879
+ scope,
67880
+ agent: agentId
67881
+ };
67882
+ addInstalledSkill(installedSkill);
67883
+ steps[2].status = "done";
67884
+ steps[3].status = "done";
67885
+ setState({
67886
+ phase: "success",
67887
+ skill,
67888
+ installedPath: installPath
67889
+ });
67890
+ } catch (err) {
67891
+ setState({
67892
+ phase: "error",
67893
+ message: err instanceof Error ? err.message : "Installation failed"
67894
+ });
67895
+ }
67896
+ }, [state]);
67897
+ function handleConfirm() {
67898
+ performInstall();
67899
+ }
67900
+ function handleCancel() {
67901
+ setState({ phase: "cancelled" });
67902
+ }
67903
+ import_react33.useEffect(() => {
67382
67904
  if (FINAL_PHASES.includes(state.phase) && outputItems.length === 0) {
67383
67905
  setOutputItems([{ id: "output" }]);
67384
67906
  }
67385
67907
  }, [state.phase, outputItems.length]);
67386
- import_react32.useEffect(() => {
67908
+ import_react33.useEffect(() => {
67387
67909
  if (outputItems.length > 0) {
67388
67910
  process.nextTick(() => exit());
67389
67911
  }
67390
67912
  }, [outputItems.length, exit]);
67391
67913
  if (state.phase === "checking") {
67392
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Spinner2, {
67914
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner2, {
67393
67915
  text: "Initializing..."
67394
67916
  }, undefined, false, undefined, this);
67395
67917
  }
67396
67918
  if (state.phase === "searching") {
67397
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Spinner2, {
67919
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner2, {
67398
67920
  text: `Searching ${state.repo}...`
67399
67921
  }, undefined, false, undefined, this);
67400
67922
  }
67923
+ if (state.phase === "warning") {
67924
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(SecurityWarningPrompt, {
67925
+ skill: state.skill,
67926
+ onConfirm: handleConfirm,
67927
+ onCancel: handleCancel
67928
+ }, undefined, false, undefined, this);
67929
+ }
67401
67930
  if (state.phase === "installing") {
67402
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67931
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67403
67932
  flexDirection: "column",
67404
67933
  borderStyle: "round",
67405
67934
  paddingX: 1,
67406
67935
  children: [
67407
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67936
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67408
67937
  marginBottom: 1,
67409
67938
  children: [
67410
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67939
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67411
67940
  bold: true,
67412
67941
  children: "Installing: "
67413
67942
  }, undefined, false, undefined, this),
67414
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67943
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67415
67944
  color: "cyan",
67416
67945
  children: state.skill.name
67417
67946
  }, undefined, false, undefined, this),
67418
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67947
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67419
67948
  dimColor: true,
67420
67949
  children: [
67421
67950
  " (",
@@ -67425,29 +67954,29 @@ function Install({ args: [skillName], options: opts }) {
67425
67954
  }, undefined, true, undefined, this)
67426
67955
  ]
67427
67956
  }, undefined, true, undefined, this),
67428
- state.steps.map((step) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67957
+ state.steps.map((step) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67429
67958
  children: [
67430
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67959
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67431
67960
  children: [
67432
- step.status === "done" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67961
+ step.status === "done" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67433
67962
  color: "green",
67434
67963
  children: "✔"
67435
67964
  }, undefined, false, undefined, this),
67436
- step.status === "in_progress" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67965
+ step.status === "in_progress" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67437
67966
  color: "yellow",
67438
67967
  children: "◐"
67439
67968
  }, undefined, false, undefined, this),
67440
- step.status === "pending" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67969
+ step.status === "pending" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67441
67970
  dimColor: true,
67442
67971
  children: "○"
67443
67972
  }, undefined, false, undefined, this),
67444
- step.status === "error" && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67973
+ step.status === "error" && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67445
67974
  color: "red",
67446
67975
  children: "✖"
67447
67976
  }, undefined, false, undefined, this)
67448
67977
  ]
67449
67978
  }, undefined, true, undefined, this),
67450
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
67979
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67451
67980
  children: [
67452
67981
  " ",
67453
67982
  step.label
@@ -67455,9 +67984,9 @@ function Install({ args: [skillName], options: opts }) {
67455
67984
  }, undefined, true, undefined, this)
67456
67985
  ]
67457
67986
  }, step.label, true, undefined, this)),
67458
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
67987
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67459
67988
  marginTop: 1,
67460
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ProgressBar, {
67989
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ProgressBar, {
67461
67990
  percent: state.progress,
67462
67991
  width: 30
67463
67992
  }, undefined, false, undefined, this)
@@ -67468,27 +67997,27 @@ function Install({ args: [skillName], options: opts }) {
67468
67997
  const renderFinalContent = () => {
67469
67998
  switch (state.phase) {
67470
67999
  case "auth_required":
67471
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
68000
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67472
68001
  type: "error",
67473
68002
  children: state.message
67474
68003
  }, undefined, false, undefined, this);
67475
68004
  case "no_repos":
67476
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
68005
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
67477
68006
  children: [
67478
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
68007
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67479
68008
  type: "warning",
67480
68009
  children: "No repositories configured"
67481
68010
  }, undefined, false, undefined, this),
67482
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68011
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67483
68012
  dimColor: true,
67484
68013
  children: "Run 'skilluse repo add owner/repo' to add a skill repository."
67485
68014
  }, undefined, false, undefined, this)
67486
68015
  ]
67487
68016
  }, undefined, true, undefined, this);
67488
68017
  case "not_found":
67489
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
68018
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
67490
68019
  children: [
67491
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
68020
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67492
68021
  type: "error",
67493
68022
  children: [
67494
68023
  'Skill "',
@@ -67496,9 +68025,9 @@ function Install({ args: [skillName], options: opts }) {
67496
68025
  '" not found'
67497
68026
  ]
67498
68027
  }, undefined, true, undefined, this),
67499
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68028
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67500
68029
  marginTop: 1,
67501
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68030
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67502
68031
  dimColor: true,
67503
68032
  children: [
67504
68033
  "Try 'skilluse search ",
@@ -67510,9 +68039,9 @@ function Install({ args: [skillName], options: opts }) {
67510
68039
  ]
67511
68040
  }, undefined, true, undefined, this);
67512
68041
  case "conflict":
67513
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
68042
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
67514
68043
  children: [
67515
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
68044
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67516
68045
  type: "warning",
67517
68046
  children: [
67518
68047
  'Skill "',
@@ -67520,11 +68049,11 @@ function Install({ args: [skillName], options: opts }) {
67520
68049
  '" found in multiple repos:'
67521
68050
  ]
67522
68051
  }, undefined, true, undefined, this),
67523
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68052
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67524
68053
  flexDirection: "column",
67525
68054
  marginTop: 1,
67526
68055
  marginLeft: 2,
67527
- children: state.sources.map((source) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68056
+ children: state.sources.map((source) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67528
68057
  children: [
67529
68058
  source.repo,
67530
68059
  "/",
@@ -67532,9 +68061,9 @@ function Install({ args: [skillName], options: opts }) {
67532
68061
  ]
67533
68062
  }, `${source.repo}/${source.path}`, true, undefined, this))
67534
68063
  }, undefined, false, undefined, this),
67535
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68064
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67536
68065
  marginTop: 1,
67537
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68066
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67538
68067
  dimColor: true,
67539
68068
  children: "Use: skilluse install repo/skill-name to specify"
67540
68069
  }, undefined, false, undefined, this)
@@ -67542,9 +68071,9 @@ function Install({ args: [skillName], options: opts }) {
67542
68071
  ]
67543
68072
  }, undefined, true, undefined, this);
67544
68073
  case "success":
67545
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
68074
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
67546
68075
  children: [
67547
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
68076
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67548
68077
  type: "success",
67549
68078
  children: [
67550
68079
  'Installed "',
@@ -67553,10 +68082,10 @@ function Install({ args: [skillName], options: opts }) {
67553
68082
  state.skill.version
67554
68083
  ]
67555
68084
  }, undefined, true, undefined, this),
67556
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68085
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67557
68086
  marginTop: 1,
67558
68087
  marginLeft: 2,
67559
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
68088
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67560
68089
  dimColor: true,
67561
68090
  children: [
67562
68091
  "Location: ",
@@ -67566,8 +68095,13 @@ function Install({ args: [skillName], options: opts }) {
67566
68095
  }, undefined, false, undefined, this)
67567
68096
  ]
67568
68097
  }, undefined, true, undefined, this);
68098
+ case "cancelled":
68099
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
68100
+ type: "warning",
68101
+ children: "Installation cancelled"
68102
+ }, undefined, false, undefined, this);
67569
68103
  case "error":
67570
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(StatusMessage, {
68104
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67571
68105
  type: "error",
67572
68106
  children: state.message
67573
68107
  }, undefined, false, undefined, this);
@@ -67575,9 +68109,9 @@ function Install({ args: [skillName], options: opts }) {
67575
68109
  return null;
67576
68110
  }
67577
68111
  };
67578
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Static, {
68112
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Static, {
67579
68113
  items: outputItems,
67580
- children: (item) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
68114
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67581
68115
  flexDirection: "column",
67582
68116
  children: renderFinalContent()
67583
68117
  }, item.id, false, undefined, this)
@@ -67585,11 +68119,11 @@ function Install({ args: [skillName], options: opts }) {
67585
68119
  }
67586
68120
 
67587
68121
  // src/commands/list.tsx
67588
- var import_react33 = __toESM(require_react(), 1);
67589
- var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
67590
- var options3 = exports_external.object({
67591
- outdated: exports_external.boolean().default(false).describe("Show only outdated skills"),
67592
- all: exports_external.boolean().default(false).describe("Show skills for all agents")
68122
+ import { existsSync as existsSync3 } from "node:fs";
68123
+ var import_react34 = __toESM(require_react(), 1);
68124
+ var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
68125
+ var options4 = exports_external.object({
68126
+ outdated: exports_external.boolean().default(false).describe("Show only outdated skills")
67593
68127
  });
67594
68128
  function parseFrontmatter3(content) {
67595
68129
  const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
@@ -67654,20 +68188,31 @@ async function checkForUpdate(token, skill, repoConfig) {
67654
68188
  }
67655
68189
  function List({ options: opts }) {
67656
68190
  const { exit } = use_app_default();
67657
- const [state, setState] = import_react33.useState({ phase: "checking" });
67658
- const [outputItems, setOutputItems] = import_react33.useState([]);
67659
- import_react33.useEffect(() => {
68191
+ const [state, setState] = import_react34.useState({ phase: "checking" });
68192
+ const [outputItems, setOutputItems] = import_react34.useState([]);
68193
+ import_react34.useEffect(() => {
67660
68194
  async function loadSkills() {
67661
68195
  const config2 = getConfig();
67662
68196
  const currentAgent = getCurrentAgent();
67663
- const skills = opts.all ? config2.installed : config2.installed.filter((s) => s.agent === currentAgent || !s.agent);
68197
+ const cwd2 = process.cwd();
68198
+ const skills = config2.installed.filter((skill) => {
68199
+ if (skill.agent !== currentAgent && skill.agent) {
68200
+ return false;
68201
+ }
68202
+ if (skill.scope === "local" && !skill.installedPath.startsWith(cwd2)) {
68203
+ return false;
68204
+ }
68205
+ if (!existsSync3(skill.installedPath)) {
68206
+ return false;
68207
+ }
68208
+ return true;
68209
+ });
67664
68210
  if (!opts.outdated) {
67665
68211
  setState({
67666
68212
  phase: "success",
67667
68213
  skills,
67668
68214
  showingOutdated: false,
67669
- currentAgent,
67670
- showingAll: opts.all
68215
+ currentAgent
67671
68216
  });
67672
68217
  return;
67673
68218
  }
@@ -67700,32 +68245,31 @@ function List({ options: opts }) {
67700
68245
  phase: "success",
67701
68246
  skills: skillsWithUpdates,
67702
68247
  showingOutdated: true,
67703
- currentAgent,
67704
- showingAll: opts.all
68248
+ currentAgent
67705
68249
  });
67706
68250
  }
67707
68251
  loadSkills();
67708
- }, [opts.outdated, opts.all]);
67709
- import_react33.useEffect(() => {
68252
+ }, [opts.outdated]);
68253
+ import_react34.useEffect(() => {
67710
68254
  const isFinalState = state.phase === "success" || state.phase === "error" || state.phase === "auth_required";
67711
68255
  if (isFinalState && outputItems.length === 0) {
67712
68256
  setOutputItems([{ id: "output" }]);
67713
68257
  }
67714
68258
  }, [state.phase, outputItems.length]);
67715
- import_react33.useEffect(() => {
68259
+ import_react34.useEffect(() => {
67716
68260
  if (outputItems.length > 0) {
67717
68261
  process.nextTick(() => exit());
67718
68262
  }
67719
68263
  }, [outputItems.length, exit]);
67720
68264
  const renderContent = () => {
67721
68265
  if (state.phase === "auth_required") {
67722
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
68266
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(StatusMessage, {
67723
68267
  type: "error",
67724
68268
  children: state.message
67725
68269
  }, undefined, false, undefined, this);
67726
68270
  }
67727
68271
  if (state.phase === "error") {
67728
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
68272
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(StatusMessage, {
67729
68273
  type: "error",
67730
68274
  children: state.message
67731
68275
  }, undefined, false, undefined, this);
@@ -67735,20 +68279,20 @@ function List({ options: opts }) {
67735
68279
  const agentName = agentInfo?.name || state.currentAgent;
67736
68280
  if (state.skills.length === 0) {
67737
68281
  if (state.showingOutdated) {
67738
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
68282
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(StatusMessage, {
67739
68283
  type: "success",
67740
68284
  children: "All skills are up to date"
67741
68285
  }, undefined, false, undefined, this);
67742
68286
  }
67743
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
68287
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67744
68288
  children: [
67745
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68289
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67746
68290
  children: [
67747
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68291
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67748
68292
  bold: true,
67749
68293
  children: "Installed Skills"
67750
68294
  }, undefined, false, undefined, this),
67751
- !state.showingAll && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68295
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67752
68296
  dimColor: true,
67753
68297
  children: [
67754
68298
  " (",
@@ -67758,39 +68302,33 @@ function List({ options: opts }) {
67758
68302
  }, undefined, true, undefined, this)
67759
68303
  ]
67760
68304
  }, undefined, true, undefined, this),
67761
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68305
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67762
68306
  marginTop: 1,
67763
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68307
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67764
68308
  dimColor: true,
67765
68309
  children: "(no skills installed)"
67766
68310
  }, undefined, false, undefined, this)
67767
68311
  }, undefined, false, undefined, this),
67768
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68312
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67769
68313
  marginTop: 1,
67770
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68314
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67771
68315
  dimColor: true,
67772
68316
  children: "Run 'skilluse install skill-name' to install one."
67773
68317
  }, undefined, false, undefined, this)
67774
- }, undefined, false, undefined, this),
67775
- !state.showingAll && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67776
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67777
- dimColor: true,
67778
- children: "Run 'skilluse list --all' to see skills for all agents."
67779
- }, undefined, false, undefined, this)
67780
68318
  }, undefined, false, undefined, this)
67781
68319
  ]
67782
68320
  }, undefined, true, undefined, this);
67783
68321
  }
67784
68322
  if (state.showingOutdated) {
67785
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
68323
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67786
68324
  children: [
67787
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68325
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67788
68326
  children: [
67789
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68327
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67790
68328
  bold: true,
67791
68329
  children: "Outdated Skills"
67792
68330
  }, undefined, false, undefined, this),
67793
- !state.showingAll && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68331
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67794
68332
  dimColor: true,
67795
68333
  children: [
67796
68334
  " (",
@@ -67800,47 +68338,39 @@ function List({ options: opts }) {
67800
68338
  }, undefined, true, undefined, this)
67801
68339
  ]
67802
68340
  }, undefined, true, undefined, this),
67803
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68341
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67804
68342
  children: " "
67805
68343
  }, undefined, false, undefined, this),
67806
- state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68344
+ state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67807
68345
  flexDirection: "column",
67808
68346
  marginBottom: 1,
67809
68347
  children: [
67810
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68348
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67811
68349
  children: [
67812
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68350
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67813
68351
  color: "yellow",
67814
68352
  bold: true,
67815
68353
  children: skill.name
67816
68354
  }, undefined, false, undefined, this),
67817
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68355
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67818
68356
  dimColor: true,
67819
68357
  children: [
67820
68358
  " v",
67821
68359
  skill.version
67822
68360
  ]
67823
68361
  }, undefined, true, undefined, this),
67824
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68362
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67825
68363
  color: "green",
67826
68364
  children: [
67827
68365
  " → v",
67828
68366
  skill.latestVersion
67829
68367
  ]
67830
- }, undefined, true, undefined, this),
67831
- state.showingAll && skill.agent && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67832
- dimColor: true,
67833
- children: [
67834
- " [",
67835
- skill.agent,
67836
- "]"
67837
- ]
67838
68368
  }, undefined, true, undefined, this)
67839
68369
  ]
67840
68370
  }, undefined, true, undefined, this),
67841
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68371
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67842
68372
  marginLeft: 2,
67843
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68373
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67844
68374
  dimColor: true,
67845
68375
  children: [
67846
68376
  "From: ",
@@ -67852,9 +68382,9 @@ function List({ options: opts }) {
67852
68382
  }, undefined, false, undefined, this)
67853
68383
  ]
67854
68384
  }, skill.name, true, undefined, this)),
67855
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68385
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67856
68386
  marginTop: 1,
67857
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68387
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67858
68388
  dimColor: true,
67859
68389
  children: "Run 'skilluse upgrade' to update all, or 'skilluse upgrade skill-name' for one."
67860
68390
  }, undefined, false, undefined, this)
@@ -67862,15 +68392,15 @@ function List({ options: opts }) {
67862
68392
  ]
67863
68393
  }, undefined, true, undefined, this);
67864
68394
  }
67865
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
68395
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67866
68396
  children: [
67867
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68397
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67868
68398
  children: [
67869
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68399
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67870
68400
  bold: true,
67871
68401
  children: "Installed Skills"
67872
68402
  }, undefined, false, undefined, this),
67873
- !state.showingAll && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68403
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67874
68404
  dimColor: true,
67875
68405
  children: [
67876
68406
  " (",
@@ -67880,48 +68410,40 @@ function List({ options: opts }) {
67880
68410
  }, undefined, true, undefined, this)
67881
68411
  ]
67882
68412
  }, undefined, true, undefined, this),
67883
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68413
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67884
68414
  children: " "
67885
68415
  }, undefined, false, undefined, this),
67886
- state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68416
+ state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67887
68417
  flexDirection: "column",
67888
68418
  marginBottom: 1,
67889
68419
  children: [
67890
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68420
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67891
68421
  children: [
67892
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68422
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67893
68423
  color: "cyan",
67894
68424
  bold: true,
67895
68425
  children: skill.name
67896
68426
  }, undefined, false, undefined, this),
67897
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68427
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67898
68428
  dimColor: true,
67899
68429
  children: [
67900
68430
  " v",
67901
68431
  skill.version
67902
68432
  ]
67903
68433
  }, undefined, true, undefined, this),
67904
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68434
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67905
68435
  dimColor: true,
67906
68436
  children: [
67907
68437
  " (",
67908
68438
  skill.scope,
67909
68439
  ")"
67910
68440
  ]
67911
- }, undefined, true, undefined, this),
67912
- state.showingAll && skill.agent && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67913
- dimColor: true,
67914
- children: [
67915
- " [",
67916
- skill.agent,
67917
- "]"
67918
- ]
67919
68441
  }, undefined, true, undefined, this)
67920
68442
  ]
67921
68443
  }, undefined, true, undefined, this),
67922
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68444
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67923
68445
  marginLeft: 2,
67924
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
68446
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
67925
68447
  dimColor: true,
67926
68448
  children: [
67927
68449
  "From: ",
@@ -67932,27 +68454,20 @@ function List({ options: opts }) {
67932
68454
  }, undefined, true, undefined, this)
67933
68455
  }, undefined, false, undefined, this)
67934
68456
  ]
67935
- }, skill.name, true, undefined, this)),
67936
- !state.showingAll && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67937
- marginTop: 1,
67938
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
67939
- dimColor: true,
67940
- children: "Run 'skilluse list --all' to see skills for all agents."
67941
- }, undefined, false, undefined, this)
67942
- }, undefined, false, undefined, this)
68457
+ }, skill.name, true, undefined, this))
67943
68458
  ]
67944
68459
  }, undefined, true, undefined, this);
67945
68460
  }
67946
68461
  return null;
67947
68462
  };
67948
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
68463
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
67949
68464
  children: [
67950
- (state.phase === "checking" || state.phase === "checking_updates") && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner2, {
68465
+ (state.phase === "checking" || state.phase === "checking_updates") && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Spinner2, {
67951
68466
  text: state.phase === "checking_updates" ? `Checking for updates (${state.current}/${state.total})...` : "Loading..."
67952
68467
  }, undefined, false, undefined, this),
67953
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Static, {
68468
+ /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Static, {
67954
68469
  items: outputItems,
67955
- children: (item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68470
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
67956
68471
  flexDirection: "column",
67957
68472
  children: renderContent()
67958
68473
  }, item.id, false, undefined, this)
@@ -67962,14 +68477,14 @@ function List({ options: opts }) {
67962
68477
  }
67963
68478
 
67964
68479
  // src/commands/login.tsx
67965
- var import_react34 = __toESM(require_react(), 1);
67966
- var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
68480
+ var import_react35 = __toESM(require_react(), 1);
68481
+ var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
67967
68482
  var GITHUB_CLIENT_ID = process.env.SKILLUSE_GITHUB_CLIENT_ID || "Iv23liOOBSjdH2IRT6W2";
67968
- var options4 = exports_external.object({});
68483
+ var options5 = exports_external.object({});
67969
68484
  function Login(_props) {
67970
68485
  const { exit } = use_app_default();
67971
- const [state, setState] = import_react34.useState({ phase: "requesting_code" });
67972
- import_react34.useEffect(() => {
68486
+ const [state, setState] = import_react35.useState({ phase: "requesting_code" });
68487
+ import_react35.useEffect(() => {
67973
68488
  async function runLogin() {
67974
68489
  let deviceCode;
67975
68490
  try {
@@ -68065,70 +68580,70 @@ function Login(_props) {
68065
68580
  }, [exit]);
68066
68581
  switch (state.phase) {
68067
68582
  case "requesting_code":
68068
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Spinner2, {
68583
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Spinner2, {
68069
68584
  text: "Starting authentication..."
68070
68585
  }, undefined, false, undefined, this);
68071
68586
  case "waiting_for_auth":
68072
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68587
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68073
68588
  flexDirection: "column",
68074
68589
  children: [
68075
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68590
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68076
68591
  marginBottom: 1,
68077
68592
  children: [
68078
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68593
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68079
68594
  children: "Open "
68080
68595
  }, undefined, false, undefined, this),
68081
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68596
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68082
68597
  color: "cyan",
68083
68598
  bold: true,
68084
68599
  children: state.verificationUri
68085
68600
  }, undefined, false, undefined, this),
68086
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68601
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68087
68602
  children: " and enter code:"
68088
68603
  }, undefined, false, undefined, this)
68089
68604
  ]
68090
68605
  }, undefined, true, undefined, this),
68091
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68606
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68092
68607
  marginBottom: 1,
68093
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68608
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68094
68609
  color: "yellow",
68095
68610
  bold: true,
68096
68611
  children: state.userCode
68097
68612
  }, undefined, false, undefined, this)
68098
68613
  }, undefined, false, undefined, this),
68099
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Spinner2, {
68614
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Spinner2, {
68100
68615
  text: "Waiting for authentication..."
68101
68616
  }, undefined, false, undefined, this)
68102
68617
  ]
68103
68618
  }, undefined, true, undefined, this);
68104
68619
  case "fetching_installations":
68105
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Spinner2, {
68620
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Spinner2, {
68106
68621
  text: "Fetching GitHub App installations..."
68107
68622
  }, undefined, false, undefined, this);
68108
68623
  case "no_installation":
68109
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68624
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68110
68625
  flexDirection: "column",
68111
68626
  children: [
68112
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(StatusMessage, {
68627
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StatusMessage, {
68113
68628
  type: "warning",
68114
68629
  children: "You need to install Skilluse CLI on your GitHub account"
68115
68630
  }, undefined, false, undefined, this),
68116
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68631
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68117
68632
  marginTop: 1,
68118
68633
  children: [
68119
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68634
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68120
68635
  children: "Open: "
68121
68636
  }, undefined, false, undefined, this),
68122
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68637
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68123
68638
  color: "cyan",
68124
68639
  bold: true,
68125
68640
  children: state.installUrl
68126
68641
  }, undefined, false, undefined, this)
68127
68642
  ]
68128
68643
  }, undefined, true, undefined, this),
68129
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68644
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68130
68645
  marginTop: 1,
68131
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68646
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68132
68647
  dimColor: true,
68133
68648
  children: "Then run 'skilluse login' again."
68134
68649
  }, undefined, false, undefined, this)
@@ -68136,21 +68651,21 @@ function Login(_props) {
68136
68651
  ]
68137
68652
  }, undefined, true, undefined, this);
68138
68653
  case "success":
68139
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68654
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68140
68655
  flexDirection: "column",
68141
68656
  children: [
68142
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(StatusMessage, {
68657
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StatusMessage, {
68143
68658
  type: "success",
68144
68659
  children: [
68145
68660
  "Logged in as ",
68146
68661
  state.username
68147
68662
  ]
68148
68663
  }, undefined, true, undefined, this),
68149
- state.installations.length > 0 && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
68664
+ state.installations.length > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68150
68665
  marginTop: 1,
68151
68666
  flexDirection: "column",
68152
68667
  children: [
68153
- /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68668
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68154
68669
  dimColor: true,
68155
68670
  children: [
68156
68671
  state.installations.length,
@@ -68159,7 +68674,7 @@ function Login(_props) {
68159
68674
  " found:"
68160
68675
  ]
68161
68676
  }, undefined, true, undefined, this),
68162
- state.installations.map((inst) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
68677
+ state.installations.map((inst) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
68163
68678
  dimColor: true,
68164
68679
  children: [
68165
68680
  "• ",
@@ -68174,7 +68689,7 @@ function Login(_props) {
68174
68689
  ]
68175
68690
  }, undefined, true, undefined, this);
68176
68691
  case "error":
68177
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(StatusMessage, {
68692
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StatusMessage, {
68178
68693
  type: "error",
68179
68694
  children: state.message
68180
68695
  }, undefined, false, undefined, this);
@@ -68182,14 +68697,14 @@ function Login(_props) {
68182
68697
  }
68183
68698
 
68184
68699
  // src/commands/logout.tsx
68185
- var import_react35 = __toESM(require_react(), 1);
68186
- var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
68187
- var options5 = exports_external.object({});
68700
+ var import_react36 = __toESM(require_react(), 1);
68701
+ var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
68702
+ var options6 = exports_external.object({});
68188
68703
  function Logout(_props) {
68189
68704
  const { exit } = use_app_default();
68190
- const [state, setState] = import_react35.useState({ phase: "checking" });
68191
- const [outputItems, setOutputItems] = import_react35.useState([]);
68192
- import_react35.useEffect(() => {
68705
+ const [state, setState] = import_react36.useState({ phase: "checking" });
68706
+ const [outputItems, setOutputItems] = import_react36.useState([]);
68707
+ import_react36.useEffect(() => {
68193
68708
  async function runLogout() {
68194
68709
  const existing = await getCredentials();
68195
68710
  if (!existing) {
@@ -68209,12 +68724,12 @@ function Logout(_props) {
68209
68724
  }
68210
68725
  runLogout();
68211
68726
  }, []);
68212
- import_react35.useEffect(() => {
68727
+ import_react36.useEffect(() => {
68213
68728
  if (state.phase !== "checking" && outputItems.length === 0) {
68214
68729
  setOutputItems([{ id: "output" }]);
68215
68730
  }
68216
68731
  }, [state.phase, outputItems.length]);
68217
- import_react35.useEffect(() => {
68732
+ import_react36.useEffect(() => {
68218
68733
  if (outputItems.length > 0) {
68219
68734
  process.nextTick(() => exit());
68220
68735
  }
@@ -68222,17 +68737,17 @@ function Logout(_props) {
68222
68737
  const renderContent = () => {
68223
68738
  switch (state.phase) {
68224
68739
  case "not_logged_in":
68225
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StatusMessage, {
68740
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
68226
68741
  type: "warning",
68227
68742
  children: "Not logged in"
68228
68743
  }, undefined, false, undefined, this);
68229
68744
  case "success":
68230
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StatusMessage, {
68745
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
68231
68746
  type: "success",
68232
68747
  children: "Logged out successfully"
68233
68748
  }, undefined, false, undefined, this);
68234
68749
  case "error":
68235
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StatusMessage, {
68750
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
68236
68751
  type: "error",
68237
68752
  children: state.message
68238
68753
  }, undefined, false, undefined, this);
@@ -68240,14 +68755,14 @@ function Logout(_props) {
68240
68755
  return null;
68241
68756
  }
68242
68757
  };
68243
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
68758
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
68244
68759
  children: [
68245
- state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Spinner2, {
68760
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Spinner2, {
68246
68761
  text: "Logging out..."
68247
68762
  }, undefined, false, undefined, this),
68248
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Static, {
68763
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Static, {
68249
68764
  items: outputItems,
68250
- children: (item) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
68765
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68251
68766
  flexDirection: "column",
68252
68767
  children: renderContent()
68253
68768
  }, item.id, false, undefined, this)
@@ -68257,25 +68772,25 @@ function Logout(_props) {
68257
68772
  }
68258
68773
 
68259
68774
  // src/commands/repo/add.tsx
68260
- var import_react36 = __toESM(require_react(), 1);
68261
- var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
68775
+ var import_react37 = __toESM(require_react(), 1);
68776
+ var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
68262
68777
  var args3 = exports_external.tuple([
68263
68778
  exports_external.string().describe("Repository in owner/repo format")
68264
68779
  ]);
68265
- var options6 = exports_external.object({
68780
+ var options7 = exports_external.object({
68266
68781
  path: exports_external.string().optional().describe("Skill path within the repo (e.g., skills/)"),
68267
68782
  branch: exports_external.string().default("main").describe("Branch to use"),
68268
68783
  default: exports_external.boolean().default(false).describe("Set as default repo")
68269
68784
  });
68270
68785
  function RepoAdd({ args: [repoArg], options: opts }) {
68271
68786
  const { exit } = use_app_default();
68272
- const [state, setState] = import_react36.useState({ phase: "checking" });
68273
- import_react36.useEffect(() => {
68787
+ const [state, setState] = import_react37.useState({ phase: "checking" });
68788
+ import_react37.useEffect(() => {
68274
68789
  if (state.phase === "invalid_repo" || state.phase === "already_exists" || state.phase === "auth_required" || state.phase === "error" || state.phase === "success") {
68275
68790
  exit();
68276
68791
  }
68277
68792
  }, [state.phase, exit]);
68278
- import_react36.useEffect(() => {
68793
+ import_react37.useEffect(() => {
68279
68794
  async function checkAndAdd() {
68280
68795
  if (!repoArg.match(/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/)) {
68281
68796
  setState({ phase: "invalid_repo" });
@@ -68422,30 +68937,30 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68422
68937
  }, { isActive: state.phase === "input_path" });
68423
68938
  switch (state.phase) {
68424
68939
  case "checking":
68425
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Spinner2, {
68940
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Spinner2, {
68426
68941
  text: "Checking..."
68427
68942
  }, undefined, false, undefined, this);
68428
68943
  case "auth_required":
68429
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68944
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68430
68945
  flexDirection: "column",
68431
68946
  children: [
68432
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
68947
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68433
68948
  type: "error",
68434
68949
  children: state.message
68435
68950
  }, undefined, false, undefined, this),
68436
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68951
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68437
68952
  marginTop: 1,
68438
68953
  flexDirection: "column",
68439
68954
  children: [
68440
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68955
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68441
68956
  dimColor: true,
68442
68957
  children: "To access private repositories:"
68443
68958
  }, undefined, false, undefined, this),
68444
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68959
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68445
68960
  dimColor: true,
68446
68961
  children: " 1. Run: skilluse login"
68447
68962
  }, undefined, false, undefined, this),
68448
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68963
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68449
68964
  dimColor: true,
68450
68965
  children: [
68451
68966
  " 2. Then retry: skilluse repo add ",
@@ -68454,9 +68969,9 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68454
68969
  }, undefined, true, undefined, this)
68455
68970
  ]
68456
68971
  }, undefined, true, undefined, this),
68457
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68972
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68458
68973
  marginTop: 1,
68459
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68974
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68460
68975
  dimColor: true,
68461
68976
  children: [
68462
68977
  "Or add without verification: skilluse repo add ",
@@ -68468,24 +68983,24 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68468
68983
  ]
68469
68984
  }, undefined, true, undefined, this);
68470
68985
  case "invalid_repo":
68471
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
68986
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68472
68987
  flexDirection: "column",
68473
68988
  children: [
68474
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
68989
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68475
68990
  type: "error",
68476
68991
  children: "Invalid repository format"
68477
68992
  }, undefined, false, undefined, this),
68478
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
68993
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68479
68994
  dimColor: true,
68480
68995
  children: "Use the format: owner/repo"
68481
68996
  }, undefined, false, undefined, this)
68482
68997
  ]
68483
68998
  }, undefined, true, undefined, this);
68484
68999
  case "already_exists":
68485
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69000
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68486
69001
  flexDirection: "column",
68487
69002
  children: [
68488
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
69003
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68489
69004
  type: "warning",
68490
69005
  children: [
68491
69006
  "Repository ",
@@ -68493,7 +69008,7 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68493
69008
  " is already configured"
68494
69009
  ]
68495
69010
  }, undefined, true, undefined, this),
68496
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69011
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68497
69012
  dimColor: true,
68498
69013
  children: [
68499
69014
  "Use 'skilluse repo edit ",
@@ -68504,7 +69019,7 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68504
69019
  ]
68505
69020
  }, undefined, true, undefined, this);
68506
69021
  case "discovering":
68507
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Spinner2, {
69022
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Spinner2, {
68508
69023
  text: `Scanning ${state.repo} for skills...`
68509
69024
  }, undefined, false, undefined, this);
68510
69025
  case "select_paths": {
@@ -68513,13 +69028,13 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68513
69028
  value: sp.path,
68514
69029
  hint: `${sp.skillCount} skill${sp.skillCount !== 1 ? "s" : ""}`
68515
69030
  }));
68516
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69031
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68517
69032
  flexDirection: "column",
68518
69033
  children: [
68519
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69034
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68520
69035
  children: [
68521
69036
  "Found ",
68522
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69037
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68523
69038
  color: "green",
68524
69039
  children: state.discovery.totalSkills
68525
69040
  }, undefined, false, undefined, this),
@@ -68527,25 +69042,25 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68527
69042
  state.discovery.totalSkills !== 1 ? "s" : "",
68528
69043
  " in",
68529
69044
  " ",
68530
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69045
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68531
69046
  color: "cyan",
68532
69047
  children: state.repo
68533
69048
  }, undefined, false, undefined, this)
68534
69049
  ]
68535
69050
  }, undefined, true, undefined, this),
68536
- state.discovery.truncated && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69051
+ state.discovery.truncated && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68537
69052
  color: "yellow",
68538
69053
  children: "Warning: Repository is large, some files may not be shown"
68539
69054
  }, undefined, false, undefined, this),
68540
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69055
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68541
69056
  marginTop: 1,
68542
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69057
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68543
69058
  children: "Select skill paths to include:"
68544
69059
  }, undefined, false, undefined, this)
68545
69060
  }, undefined, false, undefined, this),
68546
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69061
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68547
69062
  marginTop: 1,
68548
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(MultiSelect, {
69063
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(MultiSelect, {
68549
69064
  items,
68550
69065
  onSubmit: handlePathsSelected,
68551
69066
  onCancel: () => exit(),
@@ -68556,25 +69071,25 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68556
69071
  }, undefined, true, undefined, this);
68557
69072
  }
68558
69073
  case "no_skills_found":
68559
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69074
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68560
69075
  flexDirection: "column",
68561
69076
  children: [
68562
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
69077
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68563
69078
  type: "warning",
68564
69079
  children: [
68565
69080
  "No SKILL.md files found in ",
68566
69081
  state.repo
68567
69082
  ]
68568
69083
  }, undefined, true, undefined, this),
68569
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69084
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68570
69085
  marginTop: 1,
68571
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69086
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68572
69087
  children: "What would you like to do?"
68573
69088
  }, undefined, false, undefined, this)
68574
69089
  }, undefined, false, undefined, this),
68575
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69090
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68576
69091
  marginTop: 1,
68577
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Select, {
69092
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Select, {
68578
69093
  items: [
68579
69094
  { label: "Enter path manually", value: "manual" },
68580
69095
  { label: "Add repo anyway (all paths)", value: "add_all" },
@@ -68586,37 +69101,37 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68586
69101
  ]
68587
69102
  }, undefined, true, undefined, this);
68588
69103
  case "input_path":
68589
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69104
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68590
69105
  flexDirection: "column",
68591
69106
  children: [
68592
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69107
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68593
69108
  children: [
68594
69109
  "Adding repository: ",
68595
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69110
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68596
69111
  color: "cyan",
68597
69112
  children: state.repo
68598
69113
  }, undefined, false, undefined, this)
68599
69114
  ]
68600
69115
  }, undefined, true, undefined, this),
68601
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69116
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68602
69117
  marginTop: 1,
68603
69118
  children: [
68604
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69119
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68605
69120
  children: "Skill path (leave empty for all): "
68606
69121
  }, undefined, false, undefined, this),
68607
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69122
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68608
69123
  color: "green",
68609
69124
  children: state.currentPath
68610
69125
  }, undefined, false, undefined, this),
68611
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69126
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68612
69127
  color: "gray",
68613
69128
  children: "|"
68614
69129
  }, undefined, false, undefined, this)
68615
69130
  ]
68616
69131
  }, undefined, true, undefined, this),
68617
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69132
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68618
69133
  marginTop: 1,
68619
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69134
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68620
69135
  dimColor: true,
68621
69136
  children: "Press Enter to confirm, Esc to cancel"
68622
69137
  }, undefined, false, undefined, this)
@@ -68624,35 +69139,35 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68624
69139
  ]
68625
69140
  }, undefined, true, undefined, this);
68626
69141
  case "saving":
68627
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Spinner2, {
69142
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Spinner2, {
68628
69143
  text: `Adding ${state.repo}...`
68629
69144
  }, undefined, false, undefined, this);
68630
69145
  case "success":
68631
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
69146
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68632
69147
  flexDirection: "column",
68633
69148
  children: [
68634
- /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
69149
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68635
69150
  type: "success",
68636
69151
  children: [
68637
69152
  "Added ",
68638
69153
  state.repo
68639
69154
  ]
68640
69155
  }, undefined, true, undefined, this),
68641
- state.paths.map((path6) => /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69156
+ state.paths.map((path6) => /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68642
69157
  dimColor: true,
68643
69158
  children: [
68644
69159
  "Path: ",
68645
69160
  path6
68646
69161
  ]
68647
69162
  }, path6, true, undefined, this)),
68648
- state.isDefault && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
69163
+ state.isDefault && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68649
69164
  dimColor: true,
68650
69165
  children: "Set as default repository"
68651
69166
  }, undefined, false, undefined, this)
68652
69167
  ]
68653
69168
  }, undefined, true, undefined, this);
68654
69169
  case "error":
68655
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(StatusMessage, {
69170
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68656
69171
  type: "error",
68657
69172
  children: state.message
68658
69173
  }, undefined, false, undefined, this);
@@ -68660,25 +69175,26 @@ function RepoAdd({ args: [repoArg], options: opts }) {
68660
69175
  }
68661
69176
 
68662
69177
  // src/commands/repo/edit.tsx
68663
- var import_react37 = __toESM(require_react(), 1);
68664
- var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
69178
+ var import_react38 = __toESM(require_react(), 1);
69179
+ var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
68665
69180
  var args4 = exports_external.tuple([
68666
69181
  exports_external.string().describe("Repository in owner/repo format")
68667
69182
  ]);
68668
- var options7 = exports_external.object({
69183
+ var options8 = exports_external.object({
68669
69184
  path: exports_external.string().optional().describe("New skill path within the repo"),
68670
69185
  branch: exports_external.string().optional().describe("New branch to use")
68671
69186
  });
68672
69187
  function RepoEdit({ args: [repoArg], options: opts }) {
68673
69188
  const { exit } = use_app_default();
68674
- const [state, setState] = import_react37.useState({ phase: "checking" });
68675
- import_react37.useEffect(() => {
69189
+ const [state, setState] = import_react38.useState({ phase: "checking" });
69190
+ const [outputItems, setOutputItems] = import_react38.useState([]);
69191
+ const [cancelled, setCancelled] = import_react38.useState(false);
69192
+ import_react38.useEffect(() => {
68676
69193
  function checkAndEdit() {
68677
69194
  const config2 = getConfig();
68678
69195
  const existingConfig = config2.repos.find((r) => r.repo === repoArg);
68679
69196
  if (!existingConfig) {
68680
69197
  setState({ phase: "not_found", repo: repoArg });
68681
- exit();
68682
69198
  return;
68683
69199
  }
68684
69200
  if (opts.path !== undefined || opts.branch !== undefined) {
@@ -68693,7 +69209,6 @@ function RepoEdit({ args: [repoArg], options: opts }) {
68693
69209
  repo: repoArg,
68694
69210
  path: updatedConfig.paths.length > 0 ? updatedConfig.paths.join(", ") : "(all paths)"
68695
69211
  });
68696
- exit();
68697
69212
  return;
68698
69213
  }
68699
69214
  setState({
@@ -68704,7 +69219,7 @@ function RepoEdit({ args: [repoArg], options: opts }) {
68704
69219
  });
68705
69220
  }
68706
69221
  checkAndEdit();
68707
- }, [repoArg, opts.path, opts.branch, exit]);
69222
+ }, [repoArg, opts.path, opts.branch]);
68708
69223
  use_input_default((input, key) => {
68709
69224
  if (state.phase !== "input_path")
68710
69225
  return;
@@ -68720,7 +69235,6 @@ function RepoEdit({ args: [repoArg], options: opts }) {
68720
69235
  repo: state.repo,
68721
69236
  path: state.currentPath || "(all paths)"
68722
69237
  });
68723
- exit();
68724
69238
  return;
68725
69239
  }
68726
69240
  if (key.backspace || key.delete) {
@@ -68731,7 +69245,7 @@ function RepoEdit({ args: [repoArg], options: opts }) {
68731
69245
  return;
68732
69246
  }
68733
69247
  if (key.escape) {
68734
- exit();
69248
+ setCancelled(true);
68735
69249
  return;
68736
69250
  }
68737
69251
  if (input && !key.ctrl && !key.meta) {
@@ -68741,115 +69255,145 @@ function RepoEdit({ args: [repoArg], options: opts }) {
68741
69255
  });
68742
69256
  }
68743
69257
  }, { isActive: state.phase === "input_path" });
68744
- switch (state.phase) {
68745
- case "checking":
68746
- return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Spinner2, {
68747
- text: "Checking..."
69258
+ import_react38.useEffect(() => {
69259
+ const isFinalState = state.phase === "not_found" || state.phase === "success" || state.phase === "error" || cancelled;
69260
+ if (isFinalState && outputItems.length === 0) {
69261
+ setOutputItems([{ id: "output" }]);
69262
+ }
69263
+ }, [state.phase, outputItems.length, cancelled]);
69264
+ import_react38.useEffect(() => {
69265
+ if (outputItems.length > 0) {
69266
+ process.nextTick(() => exit());
69267
+ }
69268
+ }, [outputItems.length, exit]);
69269
+ const renderContent = () => {
69270
+ if (cancelled) {
69271
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69272
+ dimColor: true,
69273
+ children: "Edit cancelled"
68748
69274
  }, undefined, false, undefined, this);
68749
- case "not_found":
68750
- return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68751
- flexDirection: "column",
68752
- children: [
68753
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68754
- type: "error",
68755
- children: [
68756
- "Repository ",
68757
- state.repo,
68758
- " not found in config"
68759
- ]
68760
- }, undefined, true, undefined, this),
68761
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68762
- dimColor: true,
68763
- children: [
68764
- "Run 'skilluse repo add ",
68765
- state.repo,
68766
- "' to add it first."
68767
- ]
68768
- }, undefined, true, undefined, this)
68769
- ]
68770
- }, undefined, true, undefined, this);
68771
- case "input_path":
68772
- return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
69275
+ }
69276
+ switch (state.phase) {
69277
+ case "not_found":
69278
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69279
+ flexDirection: "column",
69280
+ children: [
69281
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(StatusMessage, {
69282
+ type: "error",
69283
+ children: [
69284
+ "Repository ",
69285
+ state.repo,
69286
+ " not found in config"
69287
+ ]
69288
+ }, undefined, true, undefined, this),
69289
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69290
+ dimColor: true,
69291
+ children: [
69292
+ "Run 'skilluse repo add ",
69293
+ state.repo,
69294
+ "' to add it first."
69295
+ ]
69296
+ }, undefined, true, undefined, this)
69297
+ ]
69298
+ }, undefined, true, undefined, this);
69299
+ case "success":
69300
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69301
+ flexDirection: "column",
69302
+ children: [
69303
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(StatusMessage, {
69304
+ type: "success",
69305
+ children: [
69306
+ "Updated ",
69307
+ state.repo
69308
+ ]
69309
+ }, undefined, true, undefined, this),
69310
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69311
+ dimColor: true,
69312
+ children: [
69313
+ "Path: ",
69314
+ state.path
69315
+ ]
69316
+ }, undefined, true, undefined, this)
69317
+ ]
69318
+ }, undefined, true, undefined, this);
69319
+ case "error":
69320
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(StatusMessage, {
69321
+ type: "error",
69322
+ children: state.message
69323
+ }, undefined, false, undefined, this);
69324
+ default:
69325
+ return null;
69326
+ }
69327
+ };
69328
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
69329
+ children: [
69330
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Spinner2, {
69331
+ text: "Checking..."
69332
+ }, undefined, false, undefined, this),
69333
+ state.phase === "input_path" && !cancelled && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68773
69334
  flexDirection: "column",
68774
69335
  children: [
68775
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
69336
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68776
69337
  children: [
68777
69338
  "Editing repository: ",
68778
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
69339
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68779
69340
  color: "cyan",
68780
69341
  children: state.repo
68781
69342
  }, undefined, false, undefined, this)
68782
69343
  ]
68783
69344
  }, undefined, true, undefined, this),
68784
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
69345
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68785
69346
  dimColor: true,
68786
69347
  children: [
68787
69348
  "Current: ",
68788
69349
  state.existingConfig.paths.join(", ") || "(all paths)"
68789
69350
  ]
68790
69351
  }, undefined, true, undefined, this),
68791
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
69352
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68792
69353
  marginTop: 1,
68793
69354
  children: [
68794
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
69355
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68795
69356
  children: "New path (leave empty for all): "
68796
69357
  }, undefined, false, undefined, this),
68797
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
69358
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68798
69359
  color: "green",
68799
69360
  children: state.currentPath
68800
69361
  }, undefined, false, undefined, this),
68801
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
69362
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68802
69363
  color: "gray",
68803
69364
  children: "█"
68804
69365
  }, undefined, false, undefined, this)
68805
69366
  ]
68806
69367
  }, undefined, true, undefined, this),
68807
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
69368
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
68808
69369
  marginTop: 1,
68809
- children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
69370
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
68810
69371
  dimColor: true,
68811
69372
  children: "Press Enter to confirm, Esc to cancel"
68812
69373
  }, undefined, false, undefined, this)
68813
69374
  }, undefined, false, undefined, this)
68814
69375
  ]
68815
- }, undefined, true, undefined, this);
68816
- case "success":
68817
- return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
68818
- flexDirection: "column",
68819
- children: [
68820
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68821
- type: "success",
68822
- children: [
68823
- "Updated ",
68824
- state.repo
68825
- ]
68826
- }, undefined, true, undefined, this),
68827
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
68828
- dimColor: true,
68829
- children: [
68830
- "Path: ",
68831
- state.path
68832
- ]
68833
- }, undefined, true, undefined, this)
68834
- ]
68835
- }, undefined, true, undefined, this);
68836
- case "error":
68837
- return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
68838
- type: "error",
68839
- children: state.message
68840
- }, undefined, false, undefined, this);
68841
- }
69376
+ }, undefined, true, undefined, this),
69377
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Static, {
69378
+ items: outputItems,
69379
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69380
+ flexDirection: "column",
69381
+ children: renderContent()
69382
+ }, item.id, false, undefined, this)
69383
+ }, undefined, false, undefined, this)
69384
+ ]
69385
+ }, undefined, true, undefined, this);
68842
69386
  }
68843
69387
 
68844
69388
  // src/commands/repo/index.tsx
68845
- var import_react38 = __toESM(require_react(), 1);
68846
- var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
68847
- var options8 = exports_external.object({});
69389
+ var import_react39 = __toESM(require_react(), 1);
69390
+ var jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
69391
+ var options9 = exports_external.object({});
68848
69392
  function Repo(_props) {
68849
69393
  const { exit } = use_app_default();
68850
- const [state, setState] = import_react38.useState({ phase: "checking" });
68851
- const [outputItems, setOutputItems] = import_react38.useState([]);
68852
- import_react38.useEffect(() => {
69394
+ const [state, setState] = import_react39.useState({ phase: "checking" });
69395
+ const [outputItems, setOutputItems] = import_react39.useState([]);
69396
+ import_react39.useEffect(() => {
68853
69397
  async function checkRepo() {
68854
69398
  const credentials = await getCredentials();
68855
69399
  if (!credentials) {
@@ -68865,25 +69409,25 @@ function Repo(_props) {
68865
69409
  }
68866
69410
  checkRepo();
68867
69411
  }, []);
68868
- import_react38.useEffect(() => {
69412
+ import_react39.useEffect(() => {
68869
69413
  if (state.phase !== "checking" && outputItems.length === 0) {
68870
69414
  setOutputItems([{ id: "output" }]);
68871
69415
  }
68872
69416
  }, [state.phase, outputItems.length]);
68873
- import_react38.useEffect(() => {
69417
+ import_react39.useEffect(() => {
68874
69418
  if (outputItems.length > 0) {
68875
69419
  process.nextTick(() => exit());
68876
69420
  }
68877
69421
  }, [outputItems.length, exit]);
68878
69422
  const renderContent = () => {
68879
69423
  if (state.phase === "not_logged_in") {
68880
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
69424
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
68881
69425
  children: [
68882
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(StatusMessage, {
69426
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(StatusMessage, {
68883
69427
  type: "error",
68884
69428
  children: "Not authenticated"
68885
69429
  }, undefined, false, undefined, this),
68886
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69430
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68887
69431
  dimColor: true,
68888
69432
  children: "Run 'skilluse login' to authenticate with GitHub"
68889
69433
  }, undefined, false, undefined, this)
@@ -68891,44 +69435,44 @@ function Repo(_props) {
68891
69435
  }, undefined, true, undefined, this);
68892
69436
  }
68893
69437
  if (state.phase === "error") {
68894
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(StatusMessage, {
69438
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(StatusMessage, {
68895
69439
  type: "error",
68896
69440
  children: state.message
68897
69441
  }, undefined, false, undefined, this);
68898
69442
  }
68899
69443
  if (state.phase === "success") {
68900
69444
  if (!state.defaultRepo) {
68901
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
69445
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
68902
69446
  children: [
68903
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69447
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68904
69448
  bold: true,
68905
69449
  children: "Current Repository"
68906
69450
  }, undefined, false, undefined, this),
68907
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69451
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68908
69452
  marginTop: 1,
68909
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69453
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68910
69454
  dimColor: true,
68911
69455
  children: "(no default repo set)"
68912
69456
  }, undefined, false, undefined, this)
68913
69457
  }, undefined, false, undefined, this),
68914
- state.repos.length === 0 ? /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69458
+ state.repos.length === 0 ? /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68915
69459
  marginTop: 1,
68916
69460
  flexDirection: "column",
68917
69461
  children: [
68918
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69462
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68919
69463
  dimColor: true,
68920
69464
  children: "No repositories configured."
68921
69465
  }, undefined, false, undefined, this),
68922
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69466
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68923
69467
  dimColor: true,
68924
69468
  children: "Run 'skilluse repo add owner/repo' to add one."
68925
69469
  }, undefined, false, undefined, this)
68926
69470
  ]
68927
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69471
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68928
69472
  marginTop: 1,
68929
69473
  flexDirection: "column",
68930
69474
  children: [
68931
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69475
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68932
69476
  dimColor: true,
68933
69477
  children: [
68934
69478
  state.repos.length,
@@ -68938,7 +69482,7 @@ function Repo(_props) {
68938
69482
  "configured."
68939
69483
  ]
68940
69484
  }, undefined, true, undefined, this),
68941
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69485
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68942
69486
  dimColor: true,
68943
69487
  children: "Run 'skilluse repo use owner/repo' to set a default."
68944
69488
  }, undefined, false, undefined, this)
@@ -68948,48 +69492,48 @@ function Repo(_props) {
68948
69492
  }, undefined, true, undefined, this);
68949
69493
  }
68950
69494
  const defaultRepoConfig = state.repos.find((r) => r.repo === state.defaultRepo);
68951
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
69495
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
68952
69496
  children: [
68953
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69497
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68954
69498
  bold: true,
68955
69499
  children: "Current Repository"
68956
69500
  }, undefined, false, undefined, this),
68957
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69501
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68958
69502
  marginTop: 1,
68959
69503
  flexDirection: "column",
68960
69504
  children: [
68961
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69505
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68962
69506
  children: [
68963
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69507
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68964
69508
  color: "cyan",
68965
69509
  children: state.defaultRepo
68966
69510
  }, undefined, false, undefined, this),
68967
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69511
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68968
69512
  dimColor: true,
68969
69513
  children: " (default)"
68970
69514
  }, undefined, false, undefined, this)
68971
69515
  ]
68972
69516
  }, undefined, true, undefined, this),
68973
- defaultRepoConfig && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
69517
+ defaultRepoConfig && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
68974
69518
  children: [
68975
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69519
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68976
69520
  children: [
68977
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69521
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68978
69522
  dimColor: true,
68979
69523
  children: "Branch: "
68980
69524
  }, undefined, false, undefined, this),
68981
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69525
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68982
69526
  children: defaultRepoConfig.branch
68983
69527
  }, undefined, false, undefined, this)
68984
69528
  ]
68985
69529
  }, undefined, true, undefined, this),
68986
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69530
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
68987
69531
  children: [
68988
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69532
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68989
69533
  dimColor: true,
68990
69534
  children: "Paths: "
68991
69535
  }, undefined, false, undefined, this),
68992
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69536
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
68993
69537
  children: defaultRepoConfig.paths.length > 0 ? defaultRepoConfig.paths.join(", ") : "(all)"
68994
69538
  }, undefined, false, undefined, this)
68995
69539
  ]
@@ -68998,9 +69542,9 @@ function Repo(_props) {
68998
69542
  }, undefined, true, undefined, this)
68999
69543
  ]
69000
69544
  }, undefined, true, undefined, this),
69001
- state.repos.length > 1 && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69545
+ state.repos.length > 1 && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69002
69546
  marginTop: 1,
69003
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
69547
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69004
69548
  dimColor: true,
69005
69549
  children: [
69006
69550
  "Run 'skilluse repo list' to see all ",
@@ -69015,14 +69559,14 @@ function Repo(_props) {
69015
69559
  }
69016
69560
  return null;
69017
69561
  };
69018
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
69562
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69019
69563
  children: [
69020
- state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Spinner2, {
69564
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Spinner2, {
69021
69565
  text: "Loading..."
69022
69566
  }, undefined, false, undefined, this),
69023
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Static, {
69567
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Static, {
69024
69568
  items: outputItems,
69025
- children: (item) => /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
69569
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69026
69570
  flexDirection: "column",
69027
69571
  children: renderContent()
69028
69572
  }, item.id, false, undefined, this)
@@ -69032,14 +69576,14 @@ function Repo(_props) {
69032
69576
  }
69033
69577
 
69034
69578
  // src/commands/repo/list.tsx
69035
- var import_react39 = __toESM(require_react(), 1);
69036
- var jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
69037
- var options9 = exports_external.object({});
69579
+ var import_react40 = __toESM(require_react(), 1);
69580
+ var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
69581
+ var options10 = exports_external.object({});
69038
69582
  function RepoList(_props) {
69039
69583
  const { exit } = use_app_default();
69040
- const [state, setState] = import_react39.useState({ phase: "checking" });
69041
- const [outputItems, setOutputItems] = import_react39.useState([]);
69042
- import_react39.useEffect(() => {
69584
+ const [state, setState] = import_react40.useState({ phase: "checking" });
69585
+ const [outputItems, setOutputItems] = import_react40.useState([]);
69586
+ import_react40.useEffect(() => {
69043
69587
  const config2 = getConfig();
69044
69588
  setState({
69045
69589
  phase: "success",
@@ -69047,40 +69591,40 @@ function RepoList(_props) {
69047
69591
  repos: config2.repos
69048
69592
  });
69049
69593
  }, []);
69050
- import_react39.useEffect(() => {
69594
+ import_react40.useEffect(() => {
69051
69595
  if (state.phase !== "checking" && outputItems.length === 0) {
69052
69596
  setOutputItems([{ id: "output" }]);
69053
69597
  }
69054
69598
  }, [state.phase, outputItems.length]);
69055
- import_react39.useEffect(() => {
69599
+ import_react40.useEffect(() => {
69056
69600
  if (outputItems.length > 0) {
69057
69601
  process.nextTick(() => exit());
69058
69602
  }
69059
69603
  }, [outputItems.length, exit]);
69060
69604
  const renderContent = () => {
69061
69605
  if (state.phase === "error") {
69062
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(StatusMessage, {
69606
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(StatusMessage, {
69063
69607
  type: "error",
69064
69608
  children: state.message
69065
69609
  }, undefined, false, undefined, this);
69066
69610
  }
69067
69611
  if (state.phase === "success" && state.repos.length === 0) {
69068
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69612
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
69069
69613
  children: [
69070
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69614
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69071
69615
  bold: true,
69072
69616
  children: "Configured Repositories"
69073
69617
  }, undefined, false, undefined, this),
69074
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69618
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69075
69619
  marginTop: 1,
69076
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69620
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69077
69621
  dimColor: true,
69078
69622
  children: "(no repositories configured)"
69079
69623
  }, undefined, false, undefined, this)
69080
69624
  }, undefined, false, undefined, this),
69081
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69625
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69082
69626
  marginTop: 1,
69083
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69627
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69084
69628
  dimColor: true,
69085
69629
  children: "Run 'skilluse repo add owner/repo' to add one."
69086
69630
  }, undefined, false, undefined, this)
@@ -69089,34 +69633,34 @@ function RepoList(_props) {
69089
69633
  }, undefined, true, undefined, this);
69090
69634
  }
69091
69635
  if (state.phase === "success") {
69092
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69636
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
69093
69637
  children: [
69094
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69638
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69095
69639
  bold: true,
69096
69640
  children: "Configured Repositories"
69097
69641
  }, undefined, false, undefined, this),
69098
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69642
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69099
69643
  children: " "
69100
69644
  }, undefined, false, undefined, this),
69101
69645
  state.repos.map((repo) => {
69102
69646
  const isDefault = repo.repo === state.defaultRepo;
69103
69647
  const pathsDisplay = repo.paths.length > 0 ? repo.paths.join(", ") : "(all)";
69104
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69648
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69105
69649
  children: [
69106
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69650
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69107
69651
  color: isDefault ? "green" : undefined,
69108
69652
  children: isDefault ? "● " : "○ "
69109
69653
  }, undefined, false, undefined, this),
69110
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69654
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69111
69655
  color: isDefault ? "cyan" : undefined,
69112
69656
  bold: isDefault,
69113
69657
  children: repo.repo
69114
69658
  }, undefined, false, undefined, this),
69115
- isDefault && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69659
+ isDefault && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69116
69660
  dimColor: true,
69117
69661
  children: " (default)"
69118
69662
  }, undefined, false, undefined, this),
69119
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
69663
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69120
69664
  dimColor: true,
69121
69665
  children: [
69122
69666
  " ",
@@ -69134,14 +69678,14 @@ function RepoList(_props) {
69134
69678
  }
69135
69679
  return null;
69136
69680
  };
69137
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
69681
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
69138
69682
  children: [
69139
- state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Spinner2, {
69683
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Spinner2, {
69140
69684
  text: "Loading..."
69141
69685
  }, undefined, false, undefined, this),
69142
- /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Static, {
69686
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Static, {
69143
69687
  items: outputItems,
69144
- children: (item) => /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
69688
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69145
69689
  flexDirection: "column",
69146
69690
  children: renderContent()
69147
69691
  }, item.id, false, undefined, this)
@@ -69151,129 +69695,150 @@ function RepoList(_props) {
69151
69695
  }
69152
69696
 
69153
69697
  // src/commands/repo/remove.tsx
69154
- var import_react40 = __toESM(require_react(), 1);
69155
- var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
69698
+ var import_react41 = __toESM(require_react(), 1);
69699
+ var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
69156
69700
  var args5 = exports_external.tuple([
69157
69701
  exports_external.string().describe("Repository in owner/repo format")
69158
69702
  ]);
69159
- var options10 = exports_external.object({
69703
+ var options11 = exports_external.object({
69160
69704
  force: exports_external.boolean().default(false).describe("Skip confirmation prompt")
69161
69705
  });
69162
69706
  function RepoRemove({ args: [repoArg], options: opts }) {
69163
69707
  const { exit } = use_app_default();
69164
- const [state, setState] = import_react40.useState({ phase: "checking" });
69165
- import_react40.useEffect(() => {
69708
+ const [state, setState] = import_react41.useState({ phase: "checking" });
69709
+ const [outputItems, setOutputItems] = import_react41.useState([]);
69710
+ import_react41.useEffect(() => {
69166
69711
  function checkAndRemove() {
69167
69712
  const config2 = getConfig();
69168
69713
  if (!config2.repos.find((r) => r.repo === repoArg)) {
69169
69714
  setState({ phase: "not_found", repo: repoArg });
69170
- exit();
69171
69715
  return;
69172
69716
  }
69173
69717
  if (opts.force) {
69174
69718
  removeRepo(repoArg);
69175
69719
  setState({ phase: "success", repo: repoArg });
69176
- exit();
69177
69720
  return;
69178
69721
  }
69179
69722
  setState({ phase: "confirm", repo: repoArg });
69180
69723
  }
69181
69724
  checkAndRemove();
69182
- }, [repoArg, opts.force, exit]);
69725
+ }, [repoArg, opts.force]);
69183
69726
  use_input_default((input, key) => {
69184
69727
  if (state.phase !== "confirm")
69185
69728
  return;
69186
69729
  if (input.toLowerCase() === "y" || key.return) {
69187
69730
  removeRepo(state.repo);
69188
69731
  setState({ phase: "success", repo: state.repo });
69189
- exit();
69190
69732
  return;
69191
69733
  }
69192
69734
  if (input.toLowerCase() === "n" || key.escape) {
69193
69735
  setState({ phase: "cancelled" });
69194
- exit();
69195
69736
  return;
69196
69737
  }
69197
- }, { isActive: state.phase === "confirm" });
69198
- switch (state.phase) {
69199
- case "checking":
69200
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Spinner2, {
69738
+ }, { isActive: state.phase === "confirm" });
69739
+ import_react41.useEffect(() => {
69740
+ const isFinalState = state.phase === "not_found" || state.phase === "success" || state.phase === "cancelled" || state.phase === "error";
69741
+ if (isFinalState && outputItems.length === 0) {
69742
+ setOutputItems([{ id: "output" }]);
69743
+ }
69744
+ }, [state.phase, outputItems.length]);
69745
+ import_react41.useEffect(() => {
69746
+ if (outputItems.length > 0) {
69747
+ process.nextTick(() => exit());
69748
+ }
69749
+ }, [outputItems.length, exit]);
69750
+ const renderContent = () => {
69751
+ switch (state.phase) {
69752
+ case "not_found":
69753
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69754
+ flexDirection: "column",
69755
+ children: [
69756
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
69757
+ type: "error",
69758
+ children: [
69759
+ "Repository '",
69760
+ state.repo,
69761
+ "' not found in config"
69762
+ ]
69763
+ }, undefined, true, undefined, this),
69764
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69765
+ dimColor: true,
69766
+ children: "Run 'skilluse repo list' to see configured repos"
69767
+ }, undefined, false, undefined, this)
69768
+ ]
69769
+ }, undefined, true, undefined, this);
69770
+ case "success":
69771
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
69772
+ type: "success",
69773
+ children: [
69774
+ "Removed ",
69775
+ state.repo
69776
+ ]
69777
+ }, undefined, true, undefined, this);
69778
+ case "cancelled":
69779
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69780
+ dimColor: true,
69781
+ children: "Removal cancelled"
69782
+ }, undefined, false, undefined, this);
69783
+ case "error":
69784
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
69785
+ type: "error",
69786
+ children: state.message
69787
+ }, undefined, false, undefined, this);
69788
+ default:
69789
+ return null;
69790
+ }
69791
+ };
69792
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(jsx_dev_runtime18.Fragment, {
69793
+ children: [
69794
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Spinner2, {
69201
69795
  text: "Checking..."
69202
- }, undefined, false, undefined, this);
69203
- case "not_found":
69204
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69205
- flexDirection: "column",
69206
- children: [
69207
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(StatusMessage, {
69208
- type: "error",
69209
- children: [
69210
- "Repository '",
69211
- state.repo,
69212
- "' not found in config"
69213
- ]
69214
- }, undefined, true, undefined, this),
69215
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69216
- dimColor: true,
69217
- children: "Run 'skilluse repo list' to see configured repos"
69218
- }, undefined, false, undefined, this)
69219
- ]
69220
- }, undefined, true, undefined, this);
69221
- case "confirm":
69222
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69796
+ }, undefined, false, undefined, this),
69797
+ state.phase === "confirm" && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69223
69798
  flexDirection: "column",
69224
69799
  children: [
69225
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69800
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69226
69801
  children: [
69227
69802
  "Remove repository ",
69228
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69803
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69229
69804
  color: "cyan",
69230
69805
  children: state.repo
69231
69806
  }, undefined, false, undefined, this),
69232
69807
  "?"
69233
69808
  ]
69234
69809
  }, undefined, true, undefined, this),
69235
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
69810
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69236
69811
  marginTop: 1,
69237
- children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69812
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69238
69813
  dimColor: true,
69239
69814
  children: "Press Y to confirm, N to cancel"
69240
69815
  }, undefined, false, undefined, this)
69241
69816
  }, undefined, false, undefined, this)
69242
69817
  ]
69243
- }, undefined, true, undefined, this);
69244
- case "success":
69245
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(StatusMessage, {
69246
- type: "success",
69247
- children: [
69248
- "Removed ",
69249
- state.repo
69250
- ]
69251
- }, undefined, true, undefined, this);
69252
- case "cancelled":
69253
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
69254
- dimColor: true,
69255
- children: "Removal cancelled"
69256
- }, undefined, false, undefined, this);
69257
- case "error":
69258
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(StatusMessage, {
69259
- type: "error",
69260
- children: state.message
69261
- }, undefined, false, undefined, this);
69262
- }
69818
+ }, undefined, true, undefined, this),
69819
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Static, {
69820
+ items: outputItems,
69821
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69822
+ flexDirection: "column",
69823
+ children: renderContent()
69824
+ }, item.id, false, undefined, this)
69825
+ }, undefined, false, undefined, this)
69826
+ ]
69827
+ }, undefined, true, undefined, this);
69263
69828
  }
69264
69829
 
69265
69830
  // src/commands/repo/use.tsx
69266
- var import_react41 = __toESM(require_react(), 1);
69267
- var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
69831
+ var import_react42 = __toESM(require_react(), 1);
69832
+ var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
69268
69833
  var args6 = exports_external.tuple([
69269
69834
  exports_external.string().describe("Repository in owner/repo format")
69270
69835
  ]);
69271
- var options11 = exports_external.object({});
69836
+ var options12 = exports_external.object({});
69272
69837
  function RepoUse({ args: [repoArg], options: _opts }) {
69273
69838
  const { exit } = use_app_default();
69274
- const [state, setState] = import_react41.useState({ phase: "checking" });
69275
- const [outputItems, setOutputItems] = import_react41.useState([]);
69276
- import_react41.useEffect(() => {
69839
+ const [state, setState] = import_react42.useState({ phase: "checking" });
69840
+ const [outputItems, setOutputItems] = import_react42.useState([]);
69841
+ import_react42.useEffect(() => {
69277
69842
  const config2 = getConfig();
69278
69843
  if (!config2.repos.find((r) => r.repo === repoArg)) {
69279
69844
  setState({ phase: "not_found", repo: repoArg });
@@ -69286,12 +69851,12 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69286
69851
  setDefaultRepo(repoArg);
69287
69852
  setState({ phase: "success", repo: repoArg });
69288
69853
  }, [repoArg]);
69289
- import_react41.useEffect(() => {
69854
+ import_react42.useEffect(() => {
69290
69855
  if (state.phase !== "checking" && outputItems.length === 0) {
69291
69856
  setOutputItems([{ id: "output" }]);
69292
69857
  }
69293
69858
  }, [state.phase, outputItems.length]);
69294
- import_react41.useEffect(() => {
69859
+ import_react42.useEffect(() => {
69295
69860
  if (outputItems.length > 0) {
69296
69861
  process.nextTick(() => exit());
69297
69862
  }
@@ -69299,9 +69864,9 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69299
69864
  const renderContent = () => {
69300
69865
  switch (state.phase) {
69301
69866
  case "not_found":
69302
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(jsx_dev_runtime18.Fragment, {
69867
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
69303
69868
  children: [
69304
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
69869
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
69305
69870
  type: "error",
69306
69871
  children: [
69307
69872
  "Repository ",
@@ -69309,7 +69874,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69309
69874
  " not found in config"
69310
69875
  ]
69311
69876
  }, undefined, true, undefined, this),
69312
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
69877
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
69313
69878
  dimColor: true,
69314
69879
  children: [
69315
69880
  "Run 'skilluse repo add ",
@@ -69320,7 +69885,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69320
69885
  ]
69321
69886
  }, undefined, true, undefined, this);
69322
69887
  case "already_default":
69323
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
69888
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
69324
69889
  type: "success",
69325
69890
  children: [
69326
69891
  state.repo,
@@ -69328,7 +69893,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69328
69893
  ]
69329
69894
  }, undefined, true, undefined, this);
69330
69895
  case "success":
69331
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
69896
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
69332
69897
  type: "success",
69333
69898
  children: [
69334
69899
  "Default repo set to ",
@@ -69336,7 +69901,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69336
69901
  ]
69337
69902
  }, undefined, true, undefined, this);
69338
69903
  case "error":
69339
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
69904
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
69340
69905
  type: "error",
69341
69906
  children: state.message
69342
69907
  }, undefined, false, undefined, this);
@@ -69344,14 +69909,14 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69344
69909
  return null;
69345
69910
  }
69346
69911
  };
69347
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(jsx_dev_runtime18.Fragment, {
69912
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
69348
69913
  children: [
69349
- state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Spinner2, {
69914
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Spinner2, {
69350
69915
  text: "Setting default..."
69351
69916
  }, undefined, false, undefined, this),
69352
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Static, {
69917
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Static, {
69353
69918
  items: outputItems,
69354
- children: (item) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
69919
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
69355
69920
  flexDirection: "column",
69356
69921
  children: renderContent()
69357
69922
  }, item.id, false, undefined, this)
@@ -69361,17 +69926,17 @@ function RepoUse({ args: [repoArg], options: _opts }) {
69361
69926
  }
69362
69927
 
69363
69928
  // src/commands/agent/index.tsx
69364
- var import_react42 = __toESM(require_react(), 1);
69365
- var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
69929
+ var import_react43 = __toESM(require_react(), 1);
69930
+ var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
69366
69931
  var args7 = exports_external.tuple([
69367
69932
  exports_external.string().optional().describe("Agent ID to switch to")
69368
69933
  ]);
69369
- var options12 = exports_external.object({});
69934
+ var options13 = exports_external.object({});
69370
69935
  function Agent({ args: [agentIdArg] }) {
69371
69936
  const { exit } = use_app_default();
69372
- const [state, setState] = import_react42.useState({ phase: "loading" });
69373
- const [outputItems, setOutputItems] = import_react42.useState([]);
69374
- import_react42.useEffect(() => {
69937
+ const [state, setState] = import_react43.useState({ phase: "loading" });
69938
+ const [outputItems, setOutputItems] = import_react43.useState([]);
69939
+ import_react43.useEffect(() => {
69375
69940
  if (agentIdArg) {
69376
69941
  const agent = getAgent(agentIdArg);
69377
69942
  if (!agent) {
@@ -69399,12 +69964,12 @@ function Agent({ args: [agentIdArg] }) {
69399
69964
  setState({ phase: "selecting", currentAgent, agents });
69400
69965
  }
69401
69966
  }, [agentIdArg]);
69402
- import_react42.useEffect(() => {
69967
+ import_react43.useEffect(() => {
69403
69968
  if (state.phase !== "loading" && state.phase !== "selecting" && outputItems.length === 0) {
69404
69969
  setOutputItems([{ id: "output" }]);
69405
69970
  }
69406
69971
  }, [state.phase, outputItems.length]);
69407
- import_react42.useEffect(() => {
69972
+ import_react43.useEffect(() => {
69408
69973
  if (outputItems.length > 0) {
69409
69974
  process.nextTick(() => exit());
69410
69975
  }
@@ -69436,17 +70001,17 @@ function Agent({ args: [agentIdArg] }) {
69436
70001
  label: agent.id === state.currentAgent ? `${agent.name} (current)` : agent.name,
69437
70002
  value: agent.id
69438
70003
  }));
69439
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
70004
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69440
70005
  flexDirection: "column",
69441
70006
  children: [
69442
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
70007
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69443
70008
  marginBottom: 1,
69444
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
70009
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69445
70010
  bold: true,
69446
70011
  children: "Select an agent:"
69447
70012
  }, undefined, false, undefined, this)
69448
70013
  }, undefined, false, undefined, this),
69449
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Select, {
70014
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Select, {
69450
70015
  items,
69451
70016
  onSelect: handleSelect
69452
70017
  }, undefined, false, undefined, this)
@@ -69454,23 +70019,23 @@ function Agent({ args: [agentIdArg] }) {
69454
70019
  }, undefined, true, undefined, this);
69455
70020
  }
69456
70021
  case "not_found":
69457
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
70022
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
69458
70023
  children: [
69459
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
70024
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
69460
70025
  type: "error",
69461
70026
  children: [
69462
70027
  "Unknown agent: ",
69463
70028
  state.agentId
69464
70029
  ]
69465
70030
  }, undefined, true, undefined, this),
69466
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
70031
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69467
70032
  dimColor: true,
69468
70033
  children: "Run 'skilluse agent' to see available agents."
69469
70034
  }, undefined, false, undefined, this)
69470
70035
  ]
69471
70036
  }, undefined, true, undefined, this);
69472
70037
  case "already_current":
69473
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
70038
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
69474
70039
  type: "success",
69475
70040
  children: [
69476
70041
  state.agentName,
@@ -69478,18 +70043,18 @@ function Agent({ args: [agentIdArg] }) {
69478
70043
  ]
69479
70044
  }, undefined, true, undefined, this);
69480
70045
  case "switched":
69481
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
70046
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
69482
70047
  children: [
69483
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
70048
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
69484
70049
  type: "success",
69485
70050
  children: [
69486
70051
  "Switched to ",
69487
70052
  state.agentName
69488
70053
  ]
69489
70054
  }, undefined, true, undefined, this),
69490
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
70055
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69491
70056
  marginTop: 1,
69492
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
70057
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69493
70058
  dimColor: true,
69494
70059
  children: [
69495
70060
  "Skills will now be installed to ",
@@ -69505,16 +70070,16 @@ function Agent({ args: [agentIdArg] }) {
69505
70070
  }
69506
70071
  };
69507
70072
  if (state.phase === "loading") {
69508
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Spinner2, {
70073
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Spinner2, {
69509
70074
  text: "Loading..."
69510
70075
  }, undefined, false, undefined, this);
69511
70076
  }
69512
70077
  if (state.phase === "selecting") {
69513
70078
  return renderContent();
69514
70079
  }
69515
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Static, {
70080
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Static, {
69516
70081
  items: outputItems,
69517
- children: (item) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
70082
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69518
70083
  flexDirection: "column",
69519
70084
  children: renderContent()
69520
70085
  }, item.id, false, undefined, this)
@@ -69522,10 +70087,10 @@ function Agent({ args: [agentIdArg] }) {
69522
70087
  }
69523
70088
 
69524
70089
  // src/commands/search.tsx
69525
- var import_react43 = __toESM(require_react(), 1);
69526
- var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
70090
+ var import_react44 = __toESM(require_react(), 1);
70091
+ var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
69527
70092
  var args8 = exports_external.tuple([exports_external.string().describe("Search keyword")]);
69528
- var options13 = exports_external.object({
70093
+ var options14 = exports_external.object({
69529
70094
  all: exports_external.boolean().default(false).describe("Search in all configured repos (not just default)")
69530
70095
  });
69531
70096
  function parseFrontmatter4(content) {
@@ -69615,8 +70180,9 @@ function filterSkills(skills, keyword) {
69615
70180
  }
69616
70181
  function Search({ args: [keyword], options: opts }) {
69617
70182
  const { exit } = use_app_default();
69618
- const [state, setState] = import_react43.useState({ phase: "checking" });
69619
- import_react43.useEffect(() => {
70183
+ const [state, setState] = import_react44.useState({ phase: "checking" });
70184
+ const [outputItems, setOutputItems] = import_react44.useState([]);
70185
+ import_react44.useEffect(() => {
69620
70186
  async function search() {
69621
70187
  const config2 = getConfig();
69622
70188
  let reposToSearch = [];
@@ -69632,7 +70198,6 @@ function Search({ args: [keyword], options: opts }) {
69632
70198
  }
69633
70199
  if (reposToSearch.length === 0) {
69634
70200
  setState({ phase: "no_repos" });
69635
- exit();
69636
70201
  return;
69637
70202
  }
69638
70203
  const credentials = await getCredentials();
@@ -69643,173 +70208,191 @@ function Search({ args: [keyword], options: opts }) {
69643
70208
  const result = await fetchSkillsFromRepo(token, repoConfig);
69644
70209
  if ("authRequired" in result) {
69645
70210
  setState({ phase: "auth_required", message: result.message });
69646
- exit();
69647
70211
  return;
69648
70212
  }
69649
70213
  allSkills.push(...result);
69650
70214
  }
69651
70215
  const matchingSkills = filterSkills(allSkills, keyword);
69652
70216
  setState({ phase: "success", skills: matchingSkills, keyword });
69653
- exit();
69654
70217
  }
69655
70218
  search().catch((err) => {
69656
70219
  setState({
69657
70220
  phase: "error",
69658
70221
  message: err instanceof Error ? err.message : "Search failed"
69659
70222
  });
69660
- exit();
69661
70223
  });
69662
- }, [keyword, opts.all, exit]);
69663
- switch (state.phase) {
69664
- case "checking":
69665
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Spinner2, {
69666
- text: "Initializing..."
69667
- }, undefined, false, undefined, this);
69668
- case "auth_required":
69669
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69670
- flexDirection: "column",
69671
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
69672
- type: "error",
69673
- children: state.message
69674
- }, undefined, false, undefined, this)
69675
- }, undefined, false, undefined, this);
69676
- case "no_repos":
69677
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69678
- flexDirection: "column",
69679
- children: [
69680
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
69681
- type: "warning",
69682
- children: "No repositories configured"
69683
- }, undefined, false, undefined, this),
69684
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69685
- dimColor: true,
69686
- children: "Run 'skilluse repo add owner/repo' to add a skill repository."
70224
+ }, [keyword, opts.all]);
70225
+ import_react44.useEffect(() => {
70226
+ const isFinalState = state.phase === "no_repos" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
70227
+ if (isFinalState && outputItems.length === 0) {
70228
+ setOutputItems([{ id: "output" }]);
70229
+ }
70230
+ }, [state.phase, outputItems.length]);
70231
+ import_react44.useEffect(() => {
70232
+ if (outputItems.length > 0) {
70233
+ process.nextTick(() => exit());
70234
+ }
70235
+ }, [outputItems.length, exit]);
70236
+ const renderContent = () => {
70237
+ switch (state.phase) {
70238
+ case "auth_required":
70239
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70240
+ flexDirection: "column",
70241
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
70242
+ type: "error",
70243
+ children: state.message
69687
70244
  }, undefined, false, undefined, this)
69688
- ]
69689
- }, undefined, true, undefined, this);
69690
- case "searching":
69691
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Spinner2, {
69692
- text: `Searching ${state.repo}...`
69693
- }, undefined, false, undefined, this);
69694
- case "success":
69695
- if (state.skills.length === 0) {
69696
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
70245
+ }, undefined, false, undefined, this);
70246
+ case "no_repos":
70247
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69697
70248
  flexDirection: "column",
69698
70249
  children: [
69699
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69700
- marginBottom: 1,
69701
- children: [
69702
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69703
- children: 'Search results for "'
69704
- }, undefined, false, undefined, this),
69705
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69706
- color: "cyan",
69707
- children: state.keyword
69708
- }, undefined, false, undefined, this),
69709
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69710
- children: '"'
69711
- }, undefined, false, undefined, this)
69712
- ]
69713
- }, undefined, true, undefined, this),
69714
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
70250
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
69715
70251
  type: "warning",
69716
- children: "No skills found"
70252
+ children: "No repositories configured"
69717
70253
  }, undefined, false, undefined, this),
69718
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69719
- marginTop: 1,
69720
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69721
- dimColor: true,
69722
- children: "Try a different search term or check your configured repos with 'skilluse repo list'."
69723
- }, undefined, false, undefined, this)
70254
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70255
+ dimColor: true,
70256
+ children: "Run 'skilluse repo add owner/repo' to add a skill repository."
69724
70257
  }, undefined, false, undefined, this)
69725
70258
  ]
69726
70259
  }, undefined, true, undefined, this);
69727
- }
69728
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69729
- flexDirection: "column",
69730
- children: [
69731
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69732
- marginBottom: 1,
69733
- children: [
69734
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69735
- children: 'Search results for "'
69736
- }, undefined, false, undefined, this),
69737
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69738
- color: "cyan",
69739
- children: state.keyword
69740
- }, undefined, false, undefined, this),
69741
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69742
- children: '"'
69743
- }, undefined, false, undefined, this)
69744
- ]
69745
- }, undefined, true, undefined, this),
69746
- state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
70260
+ case "success":
70261
+ if (state.skills.length === 0) {
70262
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69747
70263
  flexDirection: "column",
69748
- marginBottom: 1,
69749
70264
  children: [
69750
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
70265
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70266
+ marginBottom: 1,
69751
70267
  children: [
69752
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
70268
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70269
+ children: 'Search results for "'
70270
+ }, undefined, false, undefined, this),
70271
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69753
70272
  color: "cyan",
69754
- bold: true,
69755
- children: skill.name
70273
+ children: state.keyword
69756
70274
  }, undefined, false, undefined, this),
69757
- skill.version && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69758
- dimColor: true,
69759
- children: [
69760
- " v",
69761
- skill.version
69762
- ]
69763
- }, undefined, true, undefined, this)
70275
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70276
+ children: '"'
70277
+ }, undefined, false, undefined, this)
69764
70278
  ]
69765
70279
  }, undefined, true, undefined, this),
69766
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69767
- marginLeft: 2,
69768
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69769
- children: skill.description
69770
- }, undefined, false, undefined, this)
70280
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
70281
+ type: "warning",
70282
+ children: "No skills found"
69771
70283
  }, undefined, false, undefined, this),
69772
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69773
- marginLeft: 2,
69774
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
70284
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70285
+ marginTop: 1,
70286
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69775
70287
  dimColor: true,
69776
- children: [
69777
- skill.repo,
69778
- skill.type && ` • ${skill.type}`
69779
- ]
69780
- }, undefined, true, undefined, this)
70288
+ children: "Try a different search term or check your configured repos with 'skilluse repo list'."
70289
+ }, undefined, false, undefined, this)
69781
70290
  }, undefined, false, undefined, this)
69782
70291
  ]
69783
- }, `${skill.repo}/${skill.path}`, true, undefined, this)),
69784
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
69785
- marginTop: 1,
69786
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
69787
- dimColor: true,
70292
+ }, undefined, true, undefined, this);
70293
+ }
70294
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70295
+ flexDirection: "column",
70296
+ children: [
70297
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70298
+ marginBottom: 1,
69788
70299
  children: [
69789
- state.skills.length,
69790
- " skill",
69791
- state.skills.length !== 1 ? "s" : "",
69792
- " ",
69793
- "found"
70300
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70301
+ children: 'Search results for "'
70302
+ }, undefined, false, undefined, this),
70303
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70304
+ color: "cyan",
70305
+ children: state.keyword
70306
+ }, undefined, false, undefined, this),
70307
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70308
+ children: '"'
70309
+ }, undefined, false, undefined, this)
70310
+ ]
70311
+ }, undefined, true, undefined, this),
70312
+ state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70313
+ flexDirection: "column",
70314
+ marginBottom: 1,
70315
+ children: [
70316
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70317
+ children: [
70318
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70319
+ color: "cyan",
70320
+ bold: true,
70321
+ children: skill.name
70322
+ }, undefined, false, undefined, this),
70323
+ skill.version && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70324
+ dimColor: true,
70325
+ children: [
70326
+ " v",
70327
+ skill.version
70328
+ ]
70329
+ }, undefined, true, undefined, this)
70330
+ ]
70331
+ }, undefined, true, undefined, this),
70332
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70333
+ marginLeft: 2,
70334
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70335
+ children: skill.description
70336
+ }, undefined, false, undefined, this)
70337
+ }, undefined, false, undefined, this),
70338
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70339
+ marginLeft: 2,
70340
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70341
+ dimColor: true,
70342
+ children: [
70343
+ skill.repo,
70344
+ skill.type && ` • ${skill.type}`
70345
+ ]
70346
+ }, undefined, true, undefined, this)
70347
+ }, undefined, false, undefined, this)
69794
70348
  ]
69795
- }, undefined, true, undefined, this)
69796
- }, undefined, false, undefined, this)
69797
- ]
69798
- }, undefined, true, undefined, this);
69799
- case "error":
69800
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
69801
- type: "error",
69802
- children: state.message
69803
- }, undefined, false, undefined, this);
69804
- }
70349
+ }, `${skill.repo}/${skill.path}`, true, undefined, this)),
70350
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70351
+ marginTop: 1,
70352
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70353
+ dimColor: true,
70354
+ children: [
70355
+ state.skills.length,
70356
+ " skill",
70357
+ state.skills.length !== 1 ? "s" : "",
70358
+ " ",
70359
+ "found"
70360
+ ]
70361
+ }, undefined, true, undefined, this)
70362
+ }, undefined, false, undefined, this)
70363
+ ]
70364
+ }, undefined, true, undefined, this);
70365
+ case "error":
70366
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
70367
+ type: "error",
70368
+ children: state.message
70369
+ }, undefined, false, undefined, this);
70370
+ default:
70371
+ return null;
70372
+ }
70373
+ };
70374
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
70375
+ children: [
70376
+ (state.phase === "checking" || state.phase === "searching") && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Spinner2, {
70377
+ text: state.phase === "searching" ? `Searching ${state.repo}...` : "Initializing..."
70378
+ }, undefined, false, undefined, this),
70379
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Static, {
70380
+ items: outputItems,
70381
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70382
+ flexDirection: "column",
70383
+ children: renderContent()
70384
+ }, item.id, false, undefined, this)
70385
+ }, undefined, false, undefined, this)
70386
+ ]
70387
+ }, undefined, true, undefined, this);
69805
70388
  }
69806
70389
 
69807
70390
  // src/commands/uninstall.tsx
69808
70391
  import { rm } from "node:fs/promises";
69809
- var import_react44 = __toESM(require_react(), 1);
69810
- var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
70392
+ var import_react45 = __toESM(require_react(), 1);
70393
+ var jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
69811
70394
  var args9 = exports_external.tuple([exports_external.string().describe("Skill name to uninstall")]);
69812
- var options14 = exports_external.object({
70395
+ var options15 = exports_external.object({
69813
70396
  force: exports_external.boolean().default(false).describe("Skip confirmation prompt")
69814
70397
  });
69815
70398
  function ConfirmPrompt({
@@ -69824,20 +70407,20 @@ function ConfirmPrompt({
69824
70407
  onCancel();
69825
70408
  }
69826
70409
  });
69827
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70410
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
69828
70411
  flexDirection: "column",
69829
70412
  children: [
69830
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70413
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
69831
70414
  children: [
69832
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70415
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69833
70416
  children: "Uninstall "
69834
70417
  }, undefined, false, undefined, this),
69835
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70418
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69836
70419
  color: "cyan",
69837
70420
  bold: true,
69838
70421
  children: skill.name
69839
70422
  }, undefined, false, undefined, this),
69840
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70423
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69841
70424
  children: [
69842
70425
  " v",
69843
70426
  skill.version,
@@ -69846,9 +70429,9 @@ function ConfirmPrompt({
69846
70429
  }, undefined, true, undefined, this)
69847
70430
  ]
69848
70431
  }, undefined, true, undefined, this),
69849
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70432
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
69850
70433
  marginLeft: 2,
69851
- children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70434
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69852
70435
  dimColor: true,
69853
70436
  children: [
69854
70437
  "Location: ",
@@ -69856,26 +70439,26 @@ function ConfirmPrompt({
69856
70439
  ]
69857
70440
  }, undefined, true, undefined, this)
69858
70441
  }, undefined, false, undefined, this),
69859
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
70442
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
69860
70443
  marginTop: 1,
69861
70444
  children: [
69862
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70445
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69863
70446
  dimColor: true,
69864
70447
  children: "Press "
69865
70448
  }, undefined, false, undefined, this),
69866
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70449
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69867
70450
  color: "green",
69868
70451
  children: "Y"
69869
70452
  }, undefined, false, undefined, this),
69870
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70453
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69871
70454
  dimColor: true,
69872
70455
  children: " to confirm, "
69873
70456
  }, undefined, false, undefined, this),
69874
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70457
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69875
70458
  color: "red",
69876
70459
  children: "N"
69877
70460
  }, undefined, false, undefined, this),
69878
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
70461
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
69879
70462
  dimColor: true,
69880
70463
  children: " to cancel"
69881
70464
  }, undefined, false, undefined, this)
@@ -69886,8 +70469,9 @@ function ConfirmPrompt({
69886
70469
  }
69887
70470
  function Uninstall({ args: [skillName], options: opts }) {
69888
70471
  const { exit } = use_app_default();
69889
- const [state, setState] = import_react44.useState({ phase: "checking" });
69890
- const performUninstall = import_react44.useCallback(async (skill) => {
70472
+ const [state, setState] = import_react45.useState({ phase: "checking" });
70473
+ const [outputItems, setOutputItems] = import_react45.useState([]);
70474
+ const performUninstall = import_react45.useCallback(async (skill) => {
69891
70475
  setState({ phase: "uninstalling", skill });
69892
70476
  try {
69893
70477
  await rm(skill.installedPath, { recursive: true, force: true });
@@ -69899,9 +70483,8 @@ function Uninstall({ args: [skillName], options: opts }) {
69899
70483
  message: err instanceof Error ? err.message : "Uninstall failed"
69900
70484
  });
69901
70485
  }
69902
- exit();
69903
- }, [exit]);
69904
- import_react44.useEffect(() => {
70486
+ }, []);
70487
+ import_react45.useEffect(() => {
69905
70488
  const config2 = getConfig();
69906
70489
  const currentAgentId = getCurrentAgent();
69907
70490
  const agentInfo = getAgent(currentAgentId);
@@ -69909,7 +70492,6 @@ function Uninstall({ args: [skillName], options: opts }) {
69909
70492
  const skill = config2.installed.find((s) => s.name.toLowerCase() === skillName.toLowerCase() && (s.agent === currentAgentId || !s.agent));
69910
70493
  if (!skill) {
69911
70494
  setState({ phase: "not_found", skillName, agentName });
69912
- exit();
69913
70495
  return;
69914
70496
  }
69915
70497
  if (opts.force) {
@@ -69917,7 +70499,18 @@ function Uninstall({ args: [skillName], options: opts }) {
69917
70499
  } else {
69918
70500
  setState({ phase: "confirming", skill });
69919
70501
  }
69920
- }, [skillName, opts.force, exit, performUninstall]);
70502
+ }, [skillName, opts.force, performUninstall]);
70503
+ import_react45.useEffect(() => {
70504
+ const isFinalState = state.phase === "not_found" || state.phase === "success" || state.phase === "cancelled" || state.phase === "error";
70505
+ if (isFinalState && outputItems.length === 0) {
70506
+ setOutputItems([{ id: "output" }]);
70507
+ }
70508
+ }, [state.phase, outputItems.length]);
70509
+ import_react45.useEffect(() => {
70510
+ if (outputItems.length > 0) {
70511
+ process.nextTick(() => exit());
70512
+ }
70513
+ }, [outputItems.length, exit]);
69921
70514
  function handleConfirm() {
69922
70515
  if (state.phase === "confirming") {
69923
70516
  performUninstall(state.skill);
@@ -69925,82 +70518,87 @@ function Uninstall({ args: [skillName], options: opts }) {
69925
70518
  }
69926
70519
  function handleCancel() {
69927
70520
  setState({ phase: "cancelled" });
69928
- exit();
69929
70521
  }
69930
- switch (state.phase) {
69931
- case "checking":
69932
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Spinner2, {
69933
- text: "Loading..."
69934
- }, undefined, false, undefined, this);
69935
- case "not_found":
69936
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69937
- flexDirection: "column",
69938
- children: [
69939
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
69940
- type: "error",
69941
- children: [
69942
- 'Skill "',
69943
- state.skillName,
69944
- '" is not installed for ',
69945
- state.agentName
69946
- ]
69947
- }, undefined, true, undefined, this),
69948
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69949
- marginTop: 1,
69950
- children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69951
- dimColor: true,
69952
- children: "Run 'skilluse list' to see installed skills."
69953
- }, undefined, false, undefined, this)
69954
- }, undefined, false, undefined, this),
69955
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
69956
- children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
69957
- dimColor: true,
69958
- children: "Run 'skilluse list --all' to see skills for all agents."
70522
+ const renderContent = () => {
70523
+ switch (state.phase) {
70524
+ case "not_found":
70525
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70526
+ flexDirection: "column",
70527
+ children: [
70528
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70529
+ type: "error",
70530
+ children: [
70531
+ 'Skill "',
70532
+ state.skillName,
70533
+ '" is not installed for ',
70534
+ state.agentName
70535
+ ]
70536
+ }, undefined, true, undefined, this),
70537
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70538
+ marginTop: 1,
70539
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70540
+ dimColor: true,
70541
+ children: "Run 'skilluse list' to see installed skills."
70542
+ }, undefined, false, undefined, this)
69959
70543
  }, undefined, false, undefined, this)
69960
- }, undefined, false, undefined, this)
69961
- ]
69962
- }, undefined, true, undefined, this);
69963
- case "confirming":
69964
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ConfirmPrompt, {
70544
+ ]
70545
+ }, undefined, true, undefined, this);
70546
+ case "success":
70547
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70548
+ type: "success",
70549
+ children: [
70550
+ 'Uninstalled "',
70551
+ state.skill.name,
70552
+ '"'
70553
+ ]
70554
+ }, undefined, true, undefined, this);
70555
+ case "cancelled":
70556
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70557
+ type: "warning",
70558
+ children: "Uninstall cancelled"
70559
+ }, undefined, false, undefined, this);
70560
+ case "error":
70561
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70562
+ type: "error",
70563
+ children: state.message
70564
+ }, undefined, false, undefined, this);
70565
+ default:
70566
+ return null;
70567
+ }
70568
+ };
70569
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(jsx_dev_runtime22.Fragment, {
70570
+ children: [
70571
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Spinner2, {
70572
+ text: "Loading..."
70573
+ }, undefined, false, undefined, this),
70574
+ state.phase === "confirming" && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ConfirmPrompt, {
69965
70575
  skill: state.skill,
69966
70576
  onConfirm: handleConfirm,
69967
70577
  onCancel: handleCancel
69968
- }, undefined, false, undefined, this);
69969
- case "uninstalling":
69970
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Spinner2, {
70578
+ }, undefined, false, undefined, this),
70579
+ state.phase === "uninstalling" && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Spinner2, {
69971
70580
  text: `Uninstalling ${state.skill.name}...`
69972
- }, undefined, false, undefined, this);
69973
- case "success":
69974
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
69975
- type: "success",
69976
- children: [
69977
- 'Uninstalled "',
69978
- state.skill.name,
69979
- '"'
69980
- ]
69981
- }, undefined, true, undefined, this);
69982
- case "cancelled":
69983
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
69984
- type: "warning",
69985
- children: "Uninstall cancelled"
69986
- }, undefined, false, undefined, this);
69987
- case "error":
69988
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
69989
- type: "error",
69990
- children: state.message
69991
- }, undefined, false, undefined, this);
69992
- }
70581
+ }, undefined, false, undefined, this),
70582
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Static, {
70583
+ items: outputItems,
70584
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70585
+ flexDirection: "column",
70586
+ children: renderContent()
70587
+ }, item.id, false, undefined, this)
70588
+ }, undefined, false, undefined, this)
70589
+ ]
70590
+ }, undefined, true, undefined, this);
69993
70591
  }
69994
70592
 
69995
70593
  // src/commands/upgrade.tsx
69996
70594
  import { mkdir as mkdir2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
69997
70595
  import { join as join4 } from "node:path";
69998
- var import_react45 = __toESM(require_react(), 1);
69999
- var jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
70596
+ var import_react46 = __toESM(require_react(), 1);
70597
+ var jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
70000
70598
  var args10 = exports_external.tuple([
70001
70599
  exports_external.string().optional().describe("Skill name to upgrade (optional, upgrades all if omitted)")
70002
70600
  ]);
70003
- var options15 = exports_external.object({});
70601
+ var options16 = exports_external.object({});
70004
70602
  function parseFrontmatter5(content) {
70005
70603
  const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
70006
70604
  if (!frontmatterMatch)
@@ -70109,8 +70707,9 @@ async function downloadSkillFiles2(token, repo, skillPath, branch, targetDir) {
70109
70707
  }
70110
70708
  function Upgrade({ args: [skillName] }) {
70111
70709
  const { exit } = use_app_default();
70112
- const [state, setState] = import_react45.useState({ phase: "checking" });
70113
- import_react45.useEffect(() => {
70710
+ const [state, setState] = import_react46.useState({ phase: "checking" });
70711
+ const [outputItems, setOutputItems] = import_react46.useState([]);
70712
+ import_react46.useEffect(() => {
70114
70713
  async function upgrade() {
70115
70714
  const config2 = getConfig();
70116
70715
  let skillsToCheck = [];
@@ -70118,7 +70717,6 @@ function Upgrade({ args: [skillName] }) {
70118
70717
  const skill = config2.installed.find((s) => s.name.toLowerCase() === skillName.toLowerCase());
70119
70718
  if (!skill) {
70120
70719
  setState({ phase: "not_found", skillName });
70121
- exit();
70122
70720
  return;
70123
70721
  }
70124
70722
  skillsToCheck = [skill];
@@ -70127,7 +70725,6 @@ function Upgrade({ args: [skillName] }) {
70127
70725
  }
70128
70726
  if (skillsToCheck.length === 0) {
70129
70727
  setState({ phase: "no_updates" });
70130
- exit();
70131
70728
  return;
70132
70729
  }
70133
70730
  const credentials = await getCredentials();
@@ -70146,7 +70743,6 @@ function Upgrade({ args: [skillName] }) {
70146
70743
  const result = await checkForUpdate2(token, skill, repoConfig);
70147
70744
  if (result && "authRequired" in result) {
70148
70745
  setState({ phase: "auth_required", message: result.message });
70149
- exit();
70150
70746
  return;
70151
70747
  }
70152
70748
  if (result) {
@@ -70155,7 +70751,6 @@ function Upgrade({ args: [skillName] }) {
70155
70751
  }
70156
70752
  if (upgrades.length === 0) {
70157
70753
  setState({ phase: "no_updates" });
70158
- exit();
70159
70754
  return;
70160
70755
  }
70161
70756
  const upgraded = [];
@@ -70177,7 +70772,6 @@ function Upgrade({ args: [skillName] }) {
70177
70772
  phase: "auth_required",
70178
70773
  message: downloadResult.message
70179
70774
  });
70180
- exit();
70181
70775
  return;
70182
70776
  }
70183
70777
  const updatedSkill = {
@@ -70194,95 +70788,135 @@ function Upgrade({ args: [skillName] }) {
70194
70788
  } else {
70195
70789
  setState({ phase: "error", message: "All upgrades failed" });
70196
70790
  }
70197
- exit();
70198
70791
  }
70199
70792
  upgrade().catch((err) => {
70200
70793
  setState({
70201
70794
  phase: "error",
70202
70795
  message: err instanceof Error ? err.message : "Upgrade failed"
70203
70796
  });
70204
- exit();
70205
70797
  });
70206
- }, [skillName, exit]);
70207
- switch (state.phase) {
70208
- case "checking":
70209
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Spinner2, {
70210
- text: "Initializing..."
70211
- }, undefined, false, undefined, this);
70212
- case "auth_required":
70213
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70214
- flexDirection: "column",
70215
- children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70216
- type: "error",
70217
- children: state.message
70218
- }, undefined, false, undefined, this)
70219
- }, undefined, false, undefined, this);
70220
- case "not_found":
70221
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70222
- flexDirection: "column",
70223
- children: [
70224
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70798
+ }, [skillName]);
70799
+ import_react46.useEffect(() => {
70800
+ const isFinalState = state.phase === "not_found" || state.phase === "no_updates" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
70801
+ if (isFinalState && outputItems.length === 0) {
70802
+ setOutputItems([{ id: "output" }]);
70803
+ }
70804
+ }, [state.phase, outputItems.length]);
70805
+ import_react46.useEffect(() => {
70806
+ if (outputItems.length > 0) {
70807
+ process.nextTick(() => exit());
70808
+ }
70809
+ }, [outputItems.length, exit]);
70810
+ const renderContent = () => {
70811
+ switch (state.phase) {
70812
+ case "auth_required":
70813
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70814
+ flexDirection: "column",
70815
+ children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
70225
70816
  type: "error",
70226
- children: [
70227
- 'Skill "',
70228
- state.skillName,
70229
- '" is not installed'
70230
- ]
70231
- }, undefined, true, undefined, this),
70232
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70233
- marginTop: 1,
70234
- children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70235
- dimColor: true,
70236
- children: "Run 'skilluse list' to see installed skills."
70237
- }, undefined, false, undefined, this)
70817
+ children: state.message
70238
70818
  }, undefined, false, undefined, this)
70239
- ]
70240
- }, undefined, true, undefined, this);
70241
- case "checking_updates":
70242
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Spinner2, {
70819
+ }, undefined, false, undefined, this);
70820
+ case "not_found":
70821
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70822
+ flexDirection: "column",
70823
+ children: [
70824
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
70825
+ type: "error",
70826
+ children: [
70827
+ 'Skill "',
70828
+ state.skillName,
70829
+ '" is not installed'
70830
+ ]
70831
+ }, undefined, true, undefined, this),
70832
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70833
+ marginTop: 1,
70834
+ children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70835
+ dimColor: true,
70836
+ children: "Run 'skilluse list' to see installed skills."
70837
+ }, undefined, false, undefined, this)
70838
+ }, undefined, false, undefined, this)
70839
+ ]
70840
+ }, undefined, true, undefined, this);
70841
+ case "no_updates":
70842
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
70843
+ type: "success",
70844
+ children: "All skills are up to date"
70845
+ }, undefined, false, undefined, this);
70846
+ case "success":
70847
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70848
+ flexDirection: "column",
70849
+ children: [
70850
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
70851
+ type: "success",
70852
+ children: [
70853
+ "Upgraded ",
70854
+ state.upgraded.length,
70855
+ " skill(s)"
70856
+ ]
70857
+ }, undefined, true, undefined, this),
70858
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70859
+ flexDirection: "column",
70860
+ marginLeft: 2,
70861
+ children: state.upgraded.map((name) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70862
+ dimColor: true,
70863
+ children: name
70864
+ }, name, false, undefined, this))
70865
+ }, undefined, false, undefined, this)
70866
+ ]
70867
+ }, undefined, true, undefined, this);
70868
+ case "error":
70869
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
70870
+ type: "error",
70871
+ children: state.message
70872
+ }, undefined, false, undefined, this);
70873
+ default:
70874
+ return null;
70875
+ }
70876
+ };
70877
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(jsx_dev_runtime23.Fragment, {
70878
+ children: [
70879
+ state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Spinner2, {
70880
+ text: "Initializing..."
70881
+ }, undefined, false, undefined, this),
70882
+ state.phase === "checking_updates" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Spinner2, {
70243
70883
  text: `Checking for updates (${state.current}/${state.total})...`
70244
- }, undefined, false, undefined, this);
70245
- case "no_updates":
70246
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70247
- type: "success",
70248
- children: "All skills are up to date"
70249
- }, undefined, false, undefined, this);
70250
- case "upgrading":
70251
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70884
+ }, undefined, false, undefined, this),
70885
+ state.phase === "upgrading" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70252
70886
  flexDirection: "column",
70253
70887
  children: [
70254
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70888
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70255
70889
  marginBottom: 1,
70256
- children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70890
+ children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70257
70891
  bold: true,
70258
70892
  children: "Upgrading skills..."
70259
70893
  }, undefined, false, undefined, this)
70260
70894
  }, undefined, false, undefined, this),
70261
- state.upgrades.map((upgrade, i) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70895
+ state.upgrades.map((upgrade, i) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70262
70896
  children: [
70263
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70897
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70264
70898
  children: [
70265
- i < state.current && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70899
+ i < state.current && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70266
70900
  color: "green",
70267
70901
  children: "✔"
70268
70902
  }, undefined, false, undefined, this),
70269
- i === state.current && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70903
+ i === state.current && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70270
70904
  color: "yellow",
70271
70905
  children: "◐"
70272
70906
  }, undefined, false, undefined, this),
70273
- i > state.current && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70907
+ i > state.current && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70274
70908
  dimColor: true,
70275
70909
  children: "○"
70276
70910
  }, undefined, false, undefined, this)
70277
70911
  ]
70278
70912
  }, undefined, true, undefined, this),
70279
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70913
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70280
70914
  children: [
70281
70915
  " ",
70282
70916
  upgrade.skill.name
70283
70917
  ]
70284
70918
  }, undefined, true, undefined, this),
70285
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70919
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
70286
70920
  dimColor: true,
70287
70921
  children: [
70288
70922
  " ",
@@ -70294,48 +70928,29 @@ function Upgrade({ args: [skillName] }) {
70294
70928
  }, undefined, true, undefined, this)
70295
70929
  ]
70296
70930
  }, upgrade.skill.name, true, undefined, this)),
70297
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70931
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70298
70932
  marginTop: 1,
70299
- children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ProgressBar, {
70933
+ children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(ProgressBar, {
70300
70934
  percent: state.progress,
70301
70935
  width: 30
70302
70936
  }, undefined, false, undefined, this)
70303
70937
  }, undefined, false, undefined, this)
70304
70938
  ]
70305
- }, undefined, true, undefined, this);
70306
- case "success":
70307
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70308
- flexDirection: "column",
70309
- children: [
70310
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70311
- type: "success",
70312
- children: [
70313
- "Upgraded ",
70314
- state.upgraded.length,
70315
- " skill(s)"
70316
- ]
70317
- }, undefined, true, undefined, this),
70318
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
70319
- flexDirection: "column",
70320
- marginLeft: 2,
70321
- children: state.upgraded.map((name) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
70322
- dimColor: true,
70323
- children: name
70324
- }, name, false, undefined, this))
70325
- }, undefined, false, undefined, this)
70326
- ]
70327
- }, undefined, true, undefined, this);
70328
- case "error":
70329
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
70330
- type: "error",
70331
- children: state.message
70332
- }, undefined, false, undefined, this);
70333
- }
70939
+ }, undefined, true, undefined, this),
70940
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Static, {
70941
+ items: outputItems,
70942
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
70943
+ flexDirection: "column",
70944
+ children: renderContent()
70945
+ }, item.id, false, undefined, this)
70946
+ }, undefined, false, undefined, this)
70947
+ ]
70948
+ }, undefined, true, undefined, this);
70334
70949
  }
70335
70950
  // package.json
70336
70951
  var package_default = {
70337
70952
  name: "skilluse",
70338
- version: "0.4.0",
70953
+ version: "0.5.0",
70339
70954
  description: "CLI tool for managing and installing AI Coding Agent Skills",
70340
70955
  main: "dist/cli.js",
70341
70956
  bin: {
@@ -70405,7 +71020,7 @@ var package_default = {
70405
71020
  };
70406
71021
 
70407
71022
  // src/cli.tsx
70408
- var jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
71023
+ var jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
70409
71024
  var VERSION = process.env.VERSION || package_default.version;
70410
71025
  var BUILD_TIME = process.env.BUILD_TIME || new Date().toISOString();
70411
71026
  var program2 = new Command;
@@ -70414,108 +71029,112 @@ program2.name("skilluse").description("CLI tool for managing and installing AI C
70414
71029
  console.log(`Built: ${BUILD_TIME}`);
70415
71030
  process.exit(0);
70416
71031
  });
70417
- program2.command("login").description("Authenticate with GitHub").option("-f, --force", "Force re-authentication").action((opts) => {
70418
- const options16 = options4.parse(opts);
70419
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Login, {
70420
- options: options16
71032
+ program2.command("login").description("Authenticate with GitHub").action(() => {
71033
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Login, {
71034
+ options: {}
70421
71035
  }, undefined, false, undefined, this));
70422
71036
  });
70423
71037
  program2.command("logout").description("Clear stored credentials").action(() => {
70424
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Logout, {
71038
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Logout, {
70425
71039
  options: {}
70426
71040
  }, undefined, false, undefined, this));
70427
71041
  });
70428
- program2.command("list").description("List installed skills").option("-o, --outdated", "Show only outdated skills").option("-a, --all", "Show skills for all agents").action((opts) => {
70429
- const options16 = options3.parse(opts);
70430
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(List, {
70431
- options: options16
71042
+ program2.command("list").description("List installed skills").option("-o, --outdated", "Show only outdated skills").action((opts) => {
71043
+ const options17 = options4.parse(opts);
71044
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(List, {
71045
+ options: options17
70432
71046
  }, undefined, false, undefined, this));
70433
71047
  });
70434
71048
  program2.command("search <keyword>").description("Search for skills").option("-a, --all", "Search in all configured repos").action((keyword, opts) => {
70435
71049
  const args11 = args8.parse([keyword]);
70436
- const options16 = options13.parse(opts);
70437
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Search, {
71050
+ const options17 = options14.parse(opts);
71051
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Search, {
70438
71052
  args: args11,
70439
- options: options16
71053
+ options: options17
70440
71054
  }, undefined, false, undefined, this));
70441
71055
  });
70442
71056
  program2.command("install <skill-name>").description("Install a skill").option("-g, --global", "Install globally to agent's global skills path").option("-a, --agent <agent>", "Override current agent (e.g., cursor, claude)").action((skillName, opts) => {
70443
71057
  const args11 = args2.parse([skillName]);
70444
- const options16 = options2.parse(opts);
70445
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Install, {
71058
+ const options17 = options3.parse(opts);
71059
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Install, {
70446
71060
  args: args11,
70447
- options: options16
71061
+ options: options17
70448
71062
  }, undefined, false, undefined, this));
70449
71063
  });
70450
71064
  program2.command("uninstall <skill-name>").description("Uninstall a skill").option("-f, --force", "Skip confirmation").action((skillName, opts) => {
70451
71065
  const args11 = args9.parse([skillName]);
70452
- const options16 = options14.parse(opts);
70453
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Uninstall, {
71066
+ const options17 = options15.parse(opts);
71067
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Uninstall, {
70454
71068
  args: args11,
70455
- options: options16
71069
+ options: options17
70456
71070
  }, undefined, false, undefined, this));
70457
71071
  });
70458
71072
  program2.command("upgrade [skill-name]").description("Upgrade skill(s) to latest version").action((skillName) => {
70459
71073
  const args11 = args10.parse([skillName]);
70460
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Upgrade, {
71074
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Upgrade, {
70461
71075
  args: args11,
70462
71076
  options: {}
70463
71077
  }, undefined, false, undefined, this));
70464
71078
  });
70465
71079
  program2.command("info <skill-name>").description("Show skill details").action((skillName) => {
70466
71080
  const args11 = args.parse([skillName]);
70467
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Info, {
71081
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Info, {
70468
71082
  args: args11,
70469
71083
  options: {}
70470
71084
  }, undefined, false, undefined, this));
70471
71085
  });
70472
71086
  var repoCmd = program2.command("repo").description("Manage skill repositories");
70473
71087
  repoCmd.command("list").description("List configured repositories").action(() => {
70474
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(RepoList, {
71088
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(RepoList, {
70475
71089
  options: {}
70476
71090
  }, undefined, false, undefined, this));
70477
71091
  });
70478
71092
  repoCmd.command("add <url>").description("Add a skill repository").option("-p, --path <path>", "Skill path within the repo").option("-b, --branch <branch>", "Branch to use").option("-d, --default", "Set as default repository").action((url2, opts) => {
70479
71093
  const args11 = args3.parse([url2]);
70480
- const options16 = options6.parse(opts);
70481
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(RepoAdd, {
71094
+ const options17 = options7.parse(opts);
71095
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(RepoAdd, {
70482
71096
  args: args11,
70483
- options: options16
71097
+ options: options17
70484
71098
  }, undefined, false, undefined, this));
70485
71099
  });
70486
71100
  repoCmd.command("remove <name>").description("Remove a repository").option("-f, --force", "Skip confirmation").action((name, opts) => {
70487
71101
  const args11 = args5.parse([name]);
70488
- const options16 = options10.parse(opts);
70489
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(RepoRemove, {
71102
+ const options17 = options11.parse(opts);
71103
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(RepoRemove, {
70490
71104
  args: args11,
70491
- options: options16
71105
+ options: options17
70492
71106
  }, undefined, false, undefined, this));
70493
71107
  });
70494
71108
  repoCmd.command("edit <name>").description("Edit repository settings").option("-p, --path <path>", "New skill path").option("-b, --branch <branch>", "New branch").action((name, opts) => {
70495
71109
  const args11 = args4.parse([name]);
70496
- const options16 = options7.parse(opts);
70497
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(RepoEdit, {
71110
+ const options17 = options8.parse(opts);
71111
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(RepoEdit, {
70498
71112
  args: args11,
70499
- options: options16
71113
+ options: options17
70500
71114
  }, undefined, false, undefined, this));
70501
71115
  });
70502
71116
  repoCmd.command("use <name>").description("Set default repository").action((name, _opts) => {
70503
71117
  const args11 = args6.parse([name]);
70504
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(RepoUse, {
71118
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(RepoUse, {
70505
71119
  args: args11,
70506
71120
  options: {}
70507
71121
  }, undefined, false, undefined, this));
70508
71122
  });
70509
71123
  repoCmd.action(() => {
70510
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Repo, {
71124
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Repo, {
70511
71125
  options: {}
70512
71126
  }, undefined, false, undefined, this));
70513
71127
  });
70514
71128
  program2.command("agent [agent-id]").description("Switch agent or select interactively").action((agentId) => {
70515
71129
  const args11 = args7.parse([agentId]);
70516
- render_default(/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Agent, {
71130
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Agent, {
70517
71131
  args: args11,
70518
71132
  options: {}
70519
71133
  }, undefined, false, undefined, this));
70520
71134
  });
71135
+ program2.action(() => {
71136
+ render_default(/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Index, {
71137
+ options: {}
71138
+ }, undefined, false, undefined, this));
71139
+ });
70521
71140
  program2.parse();