skilluse 0.4.1 → 0.6.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.
- package/dist/cli.js +1909 -1004
- 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/
|
|
50729
|
-
import {
|
|
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/
|
|
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
|
|
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] =
|
|
66725
|
-
|
|
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
|
|
66761
|
-
|
|
66762
|
-
|
|
66763
|
-
|
|
66764
|
-
|
|
66765
|
-
|
|
66766
|
-
|
|
66767
|
-
|
|
66768
|
-
|
|
66769
|
-
|
|
66770
|
-
|
|
66771
|
-
|
|
66772
|
-
|
|
66773
|
-
|
|
66774
|
-
|
|
66775
|
-
|
|
66776
|
-
|
|
66777
|
-
|
|
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
|
-
|
|
66786
|
-
|
|
66787
|
-
|
|
66788
|
-
|
|
66789
|
-
|
|
66790
|
-
|
|
66791
|
-
|
|
66792
|
-
|
|
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
|
-
|
|
67063
|
+
'Skill "',
|
|
66796
67064
|
state.skillName,
|
|
66797
|
-
"
|
|
67065
|
+
'" not found'
|
|
66798
67066
|
]
|
|
66799
|
-
}, undefined, true, undefined, this)
|
|
66800
|
-
|
|
66801
|
-
|
|
66802
|
-
|
|
66803
|
-
|
|
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
|
-
"
|
|
66819
|
-
|
|
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
|
-
|
|
66834
|
-
|
|
66835
|
-
|
|
66836
|
-
|
|
66837
|
-
|
|
66838
|
-
|
|
66839
|
-
|
|
66840
|
-
|
|
66841
|
-
|
|
66842
|
-
|
|
66843
|
-
|
|
66844
|
-
|
|
66845
|
-
|
|
66846
|
-
|
|
66847
|
-
|
|
66848
|
-
|
|
66849
|
-
|
|
66850
|
-
|
|
66851
|
-
|
|
66852
|
-
|
|
66853
|
-
|
|
66854
|
-
|
|
66855
|
-
|
|
66856
|
-
|
|
66857
|
-
|
|
66858
|
-
|
|
66859
|
-
|
|
66860
|
-
|
|
66861
|
-
|
|
66862
|
-
|
|
66863
|
-
|
|
66864
|
-
|
|
66865
|
-
|
|
66866
|
-
|
|
66867
|
-
|
|
66868
|
-
|
|
66869
|
-
|
|
66870
|
-
|
|
66871
|
-
|
|
66872
|
-
|
|
66873
|
-
|
|
66874
|
-
|
|
66875
|
-
|
|
66876
|
-
|
|
66877
|
-
|
|
66878
|
-
|
|
66879
|
-
|
|
66880
|
-
|
|
66881
|
-
|
|
66882
|
-
|
|
66883
|
-
|
|
66884
|
-
|
|
66885
|
-
|
|
66886
|
-
|
|
66887
|
-
|
|
66888
|
-
|
|
66889
|
-
|
|
66890
|
-
|
|
66891
|
-
|
|
66892
|
-
|
|
66893
|
-
|
|
66894
|
-
|
|
66895
|
-
|
|
66896
|
-
|
|
66897
|
-
|
|
66898
|
-
|
|
66899
|
-
|
|
66900
|
-
|
|
66901
|
-
|
|
66902
|
-
|
|
66903
|
-
|
|
66904
|
-
|
|
66905
|
-
|
|
66906
|
-
|
|
66907
|
-
|
|
66908
|
-
|
|
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
|
-
|
|
66911
|
-
|
|
66912
|
-
|
|
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
|
-
|
|
66921
|
-
|
|
66922
|
-
|
|
66923
|
-
|
|
66924
|
-
|
|
66925
|
-
|
|
66926
|
-
|
|
66927
|
-
|
|
66928
|
-
|
|
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
|
-
|
|
66936
|
-
|
|
66937
|
-
|
|
66938
|
-
|
|
66939
|
-
|
|
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
|
|
66947
|
-
var
|
|
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
|
|
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] =
|
|
67168
|
-
const [outputItems, setOutputItems] =
|
|
67169
|
-
|
|
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
|
|
67272
|
-
setState({ phase: "searching", 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
|
-
|
|
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
|
-
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
67936
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
67408
67937
|
marginBottom: 1,
|
|
67409
67938
|
children: [
|
|
67410
|
-
/* @__PURE__ */
|
|
67939
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
67411
67940
|
bold: true,
|
|
67412
67941
|
children: "Installing: "
|
|
67413
67942
|
}, undefined, false, undefined, this),
|
|
67414
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
67957
|
+
state.steps.map((step) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
67429
67958
|
children: [
|
|
67430
|
-
/* @__PURE__ */
|
|
67959
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
67431
67960
|
children: [
|
|
67432
|
-
step.status === "done" && /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
67987
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
67459
67988
|
marginTop: 1,
|
|
67460
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
68005
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
67477
68006
|
children: [
|
|
67478
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
68018
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
67490
68019
|
children: [
|
|
67491
|
-
/* @__PURE__ */
|
|
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__ */
|
|
68028
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
67500
68029
|
marginTop: 1,
|
|
67501
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68042
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
67514
68043
|
children: [
|
|
67515
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
68064
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
67536
68065
|
marginTop: 1,
|
|
67537
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68074
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
67546
68075
|
children: [
|
|
67547
|
-
/* @__PURE__ */
|
|
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__ */
|
|
68085
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
67557
68086
|
marginTop: 1,
|
|
67558
68087
|
marginLeft: 2,
|
|
67559
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
68112
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Static, {
|
|
67579
68113
|
items: outputItems,
|
|
67580
|
-
children: (item) => /* @__PURE__ */
|
|
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
|
-
|
|
67589
|
-
var
|
|
67590
|
-
var
|
|
67591
|
-
|
|
67592
|
-
|
|
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] =
|
|
67658
|
-
const [outputItems, setOutputItems] =
|
|
67659
|
-
|
|
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
|
|
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
|
|
67709
|
-
|
|
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
|
-
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
68287
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
|
|
67744
68288
|
children: [
|
|
67745
|
-
/* @__PURE__ */
|
|
68289
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67746
68290
|
children: [
|
|
67747
|
-
/* @__PURE__ */
|
|
68291
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
67748
68292
|
bold: true,
|
|
67749
68293
|
children: "Installed Skills"
|
|
67750
68294
|
}, undefined, false, undefined, this),
|
|
67751
|
-
|
|
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__ */
|
|
68305
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67762
68306
|
marginTop: 1,
|
|
67763
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68312
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67769
68313
|
marginTop: 1,
|
|
67770
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68323
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
|
|
67786
68324
|
children: [
|
|
67787
|
-
/* @__PURE__ */
|
|
68325
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67788
68326
|
children: [
|
|
67789
|
-
/* @__PURE__ */
|
|
68327
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
67790
68328
|
bold: true,
|
|
67791
68329
|
children: "Outdated Skills"
|
|
67792
68330
|
}, undefined, false, undefined, this),
|
|
67793
|
-
|
|
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__ */
|
|
68341
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
67804
68342
|
children: " "
|
|
67805
68343
|
}, undefined, false, undefined, this),
|
|
67806
|
-
state.skills.map((skill) => /* @__PURE__ */
|
|
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__ */
|
|
68348
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67811
68349
|
children: [
|
|
67812
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
68371
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67842
68372
|
marginLeft: 2,
|
|
67843
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68385
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67856
68386
|
marginTop: 1,
|
|
67857
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68395
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
|
|
67866
68396
|
children: [
|
|
67867
|
-
/* @__PURE__ */
|
|
68397
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67868
68398
|
children: [
|
|
67869
|
-
/* @__PURE__ */
|
|
68399
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
67870
68400
|
bold: true,
|
|
67871
68401
|
children: "Installed Skills"
|
|
67872
68402
|
}, undefined, false, undefined, this),
|
|
67873
|
-
|
|
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__ */
|
|
68413
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
67884
68414
|
children: " "
|
|
67885
68415
|
}, undefined, false, undefined, this),
|
|
67886
|
-
state.skills.map((skill) => /* @__PURE__ */
|
|
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__ */
|
|
68420
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67891
68421
|
children: [
|
|
67892
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
68444
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
67923
68445
|
marginLeft: 2,
|
|
67924
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68463
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(jsx_dev_runtime11.Fragment, {
|
|
67949
68464
|
children: [
|
|
67950
|
-
(state.phase === "checking" || state.phase === "checking_updates") && /* @__PURE__ */
|
|
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__ */
|
|
68468
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Static, {
|
|
67954
68469
|
items: outputItems,
|
|
67955
|
-
children: (item) => /* @__PURE__ */
|
|
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
|
|
67966
|
-
var
|
|
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
|
|
68483
|
+
var options5 = exports_external.object({});
|
|
67969
68484
|
function Login(_props) {
|
|
67970
68485
|
const { exit } = use_app_default();
|
|
67971
|
-
const [state, setState] =
|
|
67972
|
-
|
|
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__ */
|
|
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__ */
|
|
68587
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68073
68588
|
flexDirection: "column",
|
|
68074
68589
|
children: [
|
|
68075
|
-
/* @__PURE__ */
|
|
68590
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68076
68591
|
marginBottom: 1,
|
|
68077
68592
|
children: [
|
|
68078
|
-
/* @__PURE__ */
|
|
68593
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68079
68594
|
children: "Open "
|
|
68080
68595
|
}, undefined, false, undefined, this),
|
|
68081
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
68606
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68092
68607
|
marginBottom: 1,
|
|
68093
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
68624
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68110
68625
|
flexDirection: "column",
|
|
68111
68626
|
children: [
|
|
68112
|
-
/* @__PURE__ */
|
|
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__ */
|
|
68631
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68117
68632
|
marginTop: 1,
|
|
68118
68633
|
children: [
|
|
68119
|
-
/* @__PURE__ */
|
|
68634
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68120
68635
|
children: "Open: "
|
|
68121
68636
|
}, undefined, false, undefined, this),
|
|
68122
|
-
/* @__PURE__ */
|
|
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__ */
|
|
68644
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68130
68645
|
marginTop: 1,
|
|
68131
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68654
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68140
68655
|
flexDirection: "column",
|
|
68141
68656
|
children: [
|
|
68142
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
68186
|
-
var
|
|
68187
|
-
var
|
|
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] =
|
|
68191
|
-
const [outputItems, setOutputItems] =
|
|
68192
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
68758
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
|
|
68244
68759
|
children: [
|
|
68245
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
68760
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Spinner2, {
|
|
68246
68761
|
text: "Logging out..."
|
|
68247
68762
|
}, undefined, false, undefined, this),
|
|
68248
|
-
/* @__PURE__ */
|
|
68763
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Static, {
|
|
68249
68764
|
items: outputItems,
|
|
68250
|
-
children: (item) => /* @__PURE__ */
|
|
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
|
|
68261
|
-
var
|
|
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
|
|
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] =
|
|
68273
|
-
|
|
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
|
-
|
|
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__ */
|
|
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__ */
|
|
68944
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68430
68945
|
flexDirection: "column",
|
|
68431
68946
|
children: [
|
|
68432
|
-
/* @__PURE__ */
|
|
68947
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
|
|
68433
68948
|
type: "error",
|
|
68434
68949
|
children: state.message
|
|
68435
68950
|
}, undefined, false, undefined, this),
|
|
68436
|
-
/* @__PURE__ */
|
|
68951
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68437
68952
|
marginTop: 1,
|
|
68438
68953
|
flexDirection: "column",
|
|
68439
68954
|
children: [
|
|
68440
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
68972
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68458
68973
|
marginTop: 1,
|
|
68459
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
68986
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68472
68987
|
flexDirection: "column",
|
|
68473
68988
|
children: [
|
|
68474
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
69000
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68486
69001
|
flexDirection: "column",
|
|
68487
69002
|
children: [
|
|
68488
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
69031
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68517
69032
|
flexDirection: "column",
|
|
68518
69033
|
children: [
|
|
68519
|
-
/* @__PURE__ */
|
|
69034
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
68520
69035
|
children: [
|
|
68521
69036
|
"Found ",
|
|
68522
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
69055
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68541
69056
|
marginTop: 1,
|
|
68542
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
69061
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68547
69062
|
marginTop: 1,
|
|
68548
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
69074
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68560
69075
|
flexDirection: "column",
|
|
68561
69076
|
children: [
|
|
68562
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69084
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68570
69085
|
marginTop: 1,
|
|
68571
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
69090
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68576
69091
|
marginTop: 1,
|
|
68577
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
69104
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68590
69105
|
flexDirection: "column",
|
|
68591
69106
|
children: [
|
|
68592
|
-
/* @__PURE__ */
|
|
69107
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
68593
69108
|
children: [
|
|
68594
69109
|
"Adding repository: ",
|
|
68595
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69116
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68602
69117
|
marginTop: 1,
|
|
68603
69118
|
children: [
|
|
68604
|
-
/* @__PURE__ */
|
|
69119
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
68605
69120
|
children: "Skill path (leave empty for all): "
|
|
68606
69121
|
}, undefined, false, undefined, this),
|
|
68607
|
-
/* @__PURE__ */
|
|
69122
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
68608
69123
|
color: "green",
|
|
68609
69124
|
children: state.currentPath
|
|
68610
69125
|
}, undefined, false, undefined, this),
|
|
68611
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69132
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68618
69133
|
marginTop: 1,
|
|
68619
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
69146
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68632
69147
|
flexDirection: "column",
|
|
68633
69148
|
children: [
|
|
68634
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
68664
|
-
var
|
|
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
|
|
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] =
|
|
68675
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
68745
|
-
|
|
68746
|
-
|
|
68747
|
-
|
|
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
|
-
|
|
68750
|
-
|
|
68751
|
-
|
|
68752
|
-
|
|
68753
|
-
|
|
68754
|
-
|
|
68755
|
-
|
|
68756
|
-
|
|
68757
|
-
|
|
68758
|
-
|
|
68759
|
-
|
|
68760
|
-
|
|
68761
|
-
|
|
68762
|
-
|
|
68763
|
-
|
|
68764
|
-
|
|
68765
|
-
|
|
68766
|
-
|
|
68767
|
-
|
|
68768
|
-
|
|
68769
|
-
|
|
68770
|
-
|
|
68771
|
-
|
|
68772
|
-
|
|
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__ */
|
|
69336
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68776
69337
|
children: [
|
|
68777
69338
|
"Editing repository: ",
|
|
68778
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
69352
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68792
69353
|
marginTop: 1,
|
|
68793
69354
|
children: [
|
|
68794
|
-
/* @__PURE__ */
|
|
69355
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68795
69356
|
children: "New path (leave empty for all): "
|
|
68796
69357
|
}, undefined, false, undefined, this),
|
|
68797
|
-
/* @__PURE__ */
|
|
69358
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68798
69359
|
color: "green",
|
|
68799
69360
|
children: state.currentPath
|
|
68800
69361
|
}, undefined, false, undefined, this),
|
|
68801
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69368
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68808
69369
|
marginTop: 1,
|
|
68809
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
68817
|
-
|
|
68818
|
-
|
|
68819
|
-
|
|
68820
|
-
|
|
68821
|
-
|
|
68822
|
-
|
|
68823
|
-
|
|
68824
|
-
|
|
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
|
|
68846
|
-
var
|
|
68847
|
-
var
|
|
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] =
|
|
68851
|
-
const [outputItems, setOutputItems] =
|
|
68852
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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__ */
|
|
69424
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
|
|
68881
69425
|
children: [
|
|
68882
|
-
/* @__PURE__ */
|
|
69426
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(StatusMessage, {
|
|
68883
69427
|
type: "error",
|
|
68884
69428
|
children: "Not authenticated"
|
|
68885
69429
|
}, undefined, false, undefined, this),
|
|
68886
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
69445
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
|
|
68902
69446
|
children: [
|
|
68903
|
-
/* @__PURE__ */
|
|
69447
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68904
69448
|
bold: true,
|
|
68905
69449
|
children: "Current Repository"
|
|
68906
69450
|
}, undefined, false, undefined, this),
|
|
68907
|
-
/* @__PURE__ */
|
|
69451
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68908
69452
|
marginTop: 1,
|
|
68909
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
69495
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
|
|
68952
69496
|
children: [
|
|
68953
|
-
/* @__PURE__ */
|
|
69497
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68954
69498
|
bold: true,
|
|
68955
69499
|
children: "Current Repository"
|
|
68956
69500
|
}, undefined, false, undefined, this),
|
|
68957
|
-
/* @__PURE__ */
|
|
69501
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68958
69502
|
marginTop: 1,
|
|
68959
69503
|
flexDirection: "column",
|
|
68960
69504
|
children: [
|
|
68961
|
-
/* @__PURE__ */
|
|
69505
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68962
69506
|
children: [
|
|
68963
|
-
/* @__PURE__ */
|
|
69507
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68964
69508
|
color: "cyan",
|
|
68965
69509
|
children: state.defaultRepo
|
|
68966
69510
|
}, undefined, false, undefined, this),
|
|
68967
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69517
|
+
defaultRepoConfig && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
|
|
68974
69518
|
children: [
|
|
68975
|
-
/* @__PURE__ */
|
|
69519
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68976
69520
|
children: [
|
|
68977
|
-
/* @__PURE__ */
|
|
69521
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68978
69522
|
dimColor: true,
|
|
68979
69523
|
children: "Branch: "
|
|
68980
69524
|
}, undefined, false, undefined, this),
|
|
68981
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69530
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68987
69531
|
children: [
|
|
68988
|
-
/* @__PURE__ */
|
|
69532
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68989
69533
|
dimColor: true,
|
|
68990
69534
|
children: "Paths: "
|
|
68991
69535
|
}, undefined, false, undefined, this),
|
|
68992
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69545
|
+
state.repos.length > 1 && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
69002
69546
|
marginTop: 1,
|
|
69003
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
69562
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(jsx_dev_runtime16.Fragment, {
|
|
69019
69563
|
children: [
|
|
69020
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
69564
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Spinner2, {
|
|
69021
69565
|
text: "Loading..."
|
|
69022
69566
|
}, undefined, false, undefined, this),
|
|
69023
|
-
/* @__PURE__ */
|
|
69567
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Static, {
|
|
69024
69568
|
items: outputItems,
|
|
69025
|
-
children: (item) => /* @__PURE__ */
|
|
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
|
|
69036
|
-
var
|
|
69037
|
-
var
|
|
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] =
|
|
69041
|
-
const [outputItems, setOutputItems] =
|
|
69042
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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__ */
|
|
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__ */
|
|
69612
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
69069
69613
|
children: [
|
|
69070
|
-
/* @__PURE__ */
|
|
69614
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69071
69615
|
bold: true,
|
|
69072
69616
|
children: "Configured Repositories"
|
|
69073
69617
|
}, undefined, false, undefined, this),
|
|
69074
|
-
/* @__PURE__ */
|
|
69618
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69075
69619
|
marginTop: 1,
|
|
69076
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
69625
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69082
69626
|
marginTop: 1,
|
|
69083
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
69636
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
69093
69637
|
children: [
|
|
69094
|
-
/* @__PURE__ */
|
|
69638
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69095
69639
|
bold: true,
|
|
69096
69640
|
children: "Configured Repositories"
|
|
69097
69641
|
}, undefined, false, undefined, this),
|
|
69098
|
-
/* @__PURE__ */
|
|
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__ */
|
|
69648
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69105
69649
|
children: [
|
|
69106
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
69659
|
+
isDefault && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69116
69660
|
dimColor: true,
|
|
69117
69661
|
children: " (default)"
|
|
69118
69662
|
}, undefined, false, undefined, this),
|
|
69119
|
-
/* @__PURE__ */
|
|
69663
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69120
69664
|
dimColor: true,
|
|
69121
69665
|
children: [
|
|
69122
69666
|
" ",
|
|
@@ -69134,14 +69678,294 @@ function RepoList(_props) {
|
|
|
69134
69678
|
}
|
|
69135
69679
|
return null;
|
|
69136
69680
|
};
|
|
69137
|
-
return /* @__PURE__ */
|
|
69681
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
69138
69682
|
children: [
|
|
69139
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
69683
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Spinner2, {
|
|
69140
69684
|
text: "Loading..."
|
|
69141
69685
|
}, undefined, false, undefined, this),
|
|
69142
|
-
/* @__PURE__ */
|
|
69686
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Static, {
|
|
69143
69687
|
items: outputItems,
|
|
69144
|
-
children: (item) => /* @__PURE__ */
|
|
69688
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69689
|
+
flexDirection: "column",
|
|
69690
|
+
children: renderContent()
|
|
69691
|
+
}, item.id, false, undefined, this)
|
|
69692
|
+
}, undefined, false, undefined, this)
|
|
69693
|
+
]
|
|
69694
|
+
}, undefined, true, undefined, this);
|
|
69695
|
+
}
|
|
69696
|
+
|
|
69697
|
+
// src/commands/repo/skills.tsx
|
|
69698
|
+
var import_react41 = __toESM(require_react(), 1);
|
|
69699
|
+
var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69700
|
+
var options11 = exports_external.object({});
|
|
69701
|
+
function parseFrontmatter4(content) {
|
|
69702
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
69703
|
+
if (!frontmatterMatch) {
|
|
69704
|
+
return {};
|
|
69705
|
+
}
|
|
69706
|
+
const yaml = frontmatterMatch[1];
|
|
69707
|
+
const result = {};
|
|
69708
|
+
for (const line of yaml.split(`
|
|
69709
|
+
`)) {
|
|
69710
|
+
const colonIndex = line.indexOf(":");
|
|
69711
|
+
if (colonIndex === -1)
|
|
69712
|
+
continue;
|
|
69713
|
+
const key = line.substring(0, colonIndex).trim();
|
|
69714
|
+
let value = line.substring(colonIndex + 1).trim();
|
|
69715
|
+
if (typeof value === "string" && value.startsWith("[") && value.endsWith("]")) {
|
|
69716
|
+
value = value.slice(1, -1).split(",").map((s) => s.trim());
|
|
69717
|
+
}
|
|
69718
|
+
if (key) {
|
|
69719
|
+
result[key] = value;
|
|
69720
|
+
}
|
|
69721
|
+
}
|
|
69722
|
+
return result;
|
|
69723
|
+
}
|
|
69724
|
+
async function fetchSkillsFromRepo(token, repoConfig, installedSkillNames) {
|
|
69725
|
+
const { repo, branch, paths: paths2 } = repoConfig;
|
|
69726
|
+
const skills = [];
|
|
69727
|
+
const searchPaths = paths2.length > 0 ? paths2 : [""];
|
|
69728
|
+
for (const basePath of searchPaths) {
|
|
69729
|
+
try {
|
|
69730
|
+
const apiPath = basePath ? `https://api.github.com/repos/${repo}/contents/${basePath}?ref=${branch}` : `https://api.github.com/repos/${repo}/contents?ref=${branch}`;
|
|
69731
|
+
const response = await fetch(apiPath, {
|
|
69732
|
+
headers: buildGitHubHeaders(token)
|
|
69733
|
+
});
|
|
69734
|
+
if (!response.ok) {
|
|
69735
|
+
if (isAuthRequired(response)) {
|
|
69736
|
+
return {
|
|
69737
|
+
authRequired: true,
|
|
69738
|
+
message: getGitHubErrorMessage(response)
|
|
69739
|
+
};
|
|
69740
|
+
}
|
|
69741
|
+
continue;
|
|
69742
|
+
}
|
|
69743
|
+
const contents = await response.json();
|
|
69744
|
+
const dirs = contents.filter((item) => item.type === "dir");
|
|
69745
|
+
for (const dir of dirs) {
|
|
69746
|
+
const skillMdUrl = `https://api.github.com/repos/${repo}/contents/${dir.path}/SKILL.md?ref=${branch}`;
|
|
69747
|
+
const skillResponse = await fetch(skillMdUrl, {
|
|
69748
|
+
headers: buildGitHubRawHeaders(token)
|
|
69749
|
+
});
|
|
69750
|
+
if (skillResponse.ok) {
|
|
69751
|
+
const content = await skillResponse.text();
|
|
69752
|
+
const frontmatter = parseFrontmatter4(content);
|
|
69753
|
+
if (frontmatter.name) {
|
|
69754
|
+
const skillName = String(frontmatter.name);
|
|
69755
|
+
skills.push({
|
|
69756
|
+
name: skillName,
|
|
69757
|
+
description: String(frontmatter.description || ""),
|
|
69758
|
+
type: frontmatter.type ? String(frontmatter.type) : undefined,
|
|
69759
|
+
version: frontmatter.version ? String(frontmatter.version) : undefined,
|
|
69760
|
+
repo,
|
|
69761
|
+
path: dir.path,
|
|
69762
|
+
installed: installedSkillNames.has(skillName)
|
|
69763
|
+
});
|
|
69764
|
+
}
|
|
69765
|
+
}
|
|
69766
|
+
}
|
|
69767
|
+
} catch {}
|
|
69768
|
+
}
|
|
69769
|
+
skills.sort((a, b) => {
|
|
69770
|
+
if (a.installed !== b.installed) {
|
|
69771
|
+
return a.installed ? -1 : 1;
|
|
69772
|
+
}
|
|
69773
|
+
return a.name.localeCompare(b.name);
|
|
69774
|
+
});
|
|
69775
|
+
return skills;
|
|
69776
|
+
}
|
|
69777
|
+
function RepoSkills(_props) {
|
|
69778
|
+
const { exit } = use_app_default();
|
|
69779
|
+
const [state, setState] = import_react41.useState({ phase: "checking" });
|
|
69780
|
+
const [outputItems, setOutputItems] = import_react41.useState([]);
|
|
69781
|
+
import_react41.useEffect(() => {
|
|
69782
|
+
async function loadSkills() {
|
|
69783
|
+
const config2 = getConfig();
|
|
69784
|
+
const currentAgent = getCurrentAgent();
|
|
69785
|
+
let repoConfig;
|
|
69786
|
+
if (config2.defaultRepo) {
|
|
69787
|
+
repoConfig = config2.repos.find((r) => r.repo === config2.defaultRepo);
|
|
69788
|
+
} else if (config2.repos.length > 0) {
|
|
69789
|
+
repoConfig = config2.repos[0];
|
|
69790
|
+
}
|
|
69791
|
+
if (!repoConfig) {
|
|
69792
|
+
setState({ phase: "no_repos" });
|
|
69793
|
+
return;
|
|
69794
|
+
}
|
|
69795
|
+
setState({ phase: "fetching", repo: repoConfig.repo });
|
|
69796
|
+
const installedSkillNames = new Set(config2.installed.filter((s) => s.agent === currentAgent || !s.agent).map((s) => s.name));
|
|
69797
|
+
const credentials = await getCredentials();
|
|
69798
|
+
const token = credentials?.token;
|
|
69799
|
+
const result = await fetchSkillsFromRepo(token, repoConfig, installedSkillNames);
|
|
69800
|
+
if ("authRequired" in result) {
|
|
69801
|
+
setState({ phase: "auth_required", message: result.message });
|
|
69802
|
+
return;
|
|
69803
|
+
}
|
|
69804
|
+
setState({
|
|
69805
|
+
phase: "success",
|
|
69806
|
+
skills: result,
|
|
69807
|
+
repoName: repoConfig.repo
|
|
69808
|
+
});
|
|
69809
|
+
}
|
|
69810
|
+
loadSkills().catch((err) => {
|
|
69811
|
+
setState({
|
|
69812
|
+
phase: "error",
|
|
69813
|
+
message: err instanceof Error ? err.message : "Failed to load skills"
|
|
69814
|
+
});
|
|
69815
|
+
});
|
|
69816
|
+
}, []);
|
|
69817
|
+
import_react41.useEffect(() => {
|
|
69818
|
+
const isFinalState = state.phase === "no_repos" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
|
|
69819
|
+
if (isFinalState && outputItems.length === 0) {
|
|
69820
|
+
setOutputItems([{ id: "output" }]);
|
|
69821
|
+
}
|
|
69822
|
+
}, [state.phase, outputItems.length]);
|
|
69823
|
+
import_react41.useEffect(() => {
|
|
69824
|
+
if (outputItems.length > 0) {
|
|
69825
|
+
process.nextTick(() => exit());
|
|
69826
|
+
}
|
|
69827
|
+
}, [outputItems.length, exit]);
|
|
69828
|
+
const renderContent = () => {
|
|
69829
|
+
switch (state.phase) {
|
|
69830
|
+
case "auth_required":
|
|
69831
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69832
|
+
type: "error",
|
|
69833
|
+
children: state.message
|
|
69834
|
+
}, undefined, false, undefined, this);
|
|
69835
|
+
case "no_repos":
|
|
69836
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69837
|
+
flexDirection: "column",
|
|
69838
|
+
children: [
|
|
69839
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69840
|
+
type: "warning",
|
|
69841
|
+
children: "No repositories configured"
|
|
69842
|
+
}, undefined, false, undefined, this),
|
|
69843
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69844
|
+
dimColor: true,
|
|
69845
|
+
children: "Run 'skilluse repo add owner/repo' to add a skill repository."
|
|
69846
|
+
}, undefined, false, undefined, this)
|
|
69847
|
+
]
|
|
69848
|
+
}, undefined, true, undefined, this);
|
|
69849
|
+
case "success": {
|
|
69850
|
+
const installedCount = state.skills.filter((s) => s.installed).length;
|
|
69851
|
+
if (state.skills.length === 0) {
|
|
69852
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69853
|
+
flexDirection: "column",
|
|
69854
|
+
children: [
|
|
69855
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69856
|
+
marginBottom: 1,
|
|
69857
|
+
children: [
|
|
69858
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69859
|
+
bold: true,
|
|
69860
|
+
children: "Skills in "
|
|
69861
|
+
}, undefined, false, undefined, this),
|
|
69862
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69863
|
+
color: "cyan",
|
|
69864
|
+
children: state.repoName
|
|
69865
|
+
}, undefined, false, undefined, this)
|
|
69866
|
+
]
|
|
69867
|
+
}, undefined, true, undefined, this),
|
|
69868
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69869
|
+
type: "warning",
|
|
69870
|
+
children: "No skills found"
|
|
69871
|
+
}, undefined, false, undefined, this)
|
|
69872
|
+
]
|
|
69873
|
+
}, undefined, true, undefined, this);
|
|
69874
|
+
}
|
|
69875
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69876
|
+
flexDirection: "column",
|
|
69877
|
+
children: [
|
|
69878
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69879
|
+
marginBottom: 1,
|
|
69880
|
+
children: [
|
|
69881
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69882
|
+
bold: true,
|
|
69883
|
+
children: "Skills in "
|
|
69884
|
+
}, undefined, false, undefined, this),
|
|
69885
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69886
|
+
color: "cyan",
|
|
69887
|
+
children: state.repoName
|
|
69888
|
+
}, undefined, false, undefined, this),
|
|
69889
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69890
|
+
dimColor: true,
|
|
69891
|
+
children: [
|
|
69892
|
+
" ",
|
|
69893
|
+
"(",
|
|
69894
|
+
installedCount,
|
|
69895
|
+
"/",
|
|
69896
|
+
state.skills.length,
|
|
69897
|
+
" installed)"
|
|
69898
|
+
]
|
|
69899
|
+
}, undefined, true, undefined, this)
|
|
69900
|
+
]
|
|
69901
|
+
}, undefined, true, undefined, this),
|
|
69902
|
+
state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69903
|
+
flexDirection: "column",
|
|
69904
|
+
marginBottom: 1,
|
|
69905
|
+
children: [
|
|
69906
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69907
|
+
children: [
|
|
69908
|
+
skill.installed ? /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69909
|
+
color: "green",
|
|
69910
|
+
children: "● "
|
|
69911
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69912
|
+
dimColor: true,
|
|
69913
|
+
children: "○ "
|
|
69914
|
+
}, undefined, false, undefined, this),
|
|
69915
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69916
|
+
color: skill.installed ? "green" : "cyan",
|
|
69917
|
+
bold: true,
|
|
69918
|
+
children: skill.name
|
|
69919
|
+
}, undefined, false, undefined, this),
|
|
69920
|
+
skill.version && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69921
|
+
dimColor: true,
|
|
69922
|
+
children: [
|
|
69923
|
+
" v",
|
|
69924
|
+
skill.version
|
|
69925
|
+
]
|
|
69926
|
+
}, undefined, true, undefined, this),
|
|
69927
|
+
skill.installed && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69928
|
+
dimColor: true,
|
|
69929
|
+
children: " (installed)"
|
|
69930
|
+
}, undefined, false, undefined, this)
|
|
69931
|
+
]
|
|
69932
|
+
}, undefined, true, undefined, this),
|
|
69933
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69934
|
+
marginLeft: 2,
|
|
69935
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69936
|
+
dimColor: true,
|
|
69937
|
+
children: skill.description
|
|
69938
|
+
}, undefined, false, undefined, this)
|
|
69939
|
+
}, undefined, false, undefined, this)
|
|
69940
|
+
]
|
|
69941
|
+
}, `${skill.repo}/${skill.path}`, true, undefined, this)),
|
|
69942
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69943
|
+
marginTop: 1,
|
|
69944
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69945
|
+
dimColor: true,
|
|
69946
|
+
children: "Run 'skilluse install skill-name' to install a skill."
|
|
69947
|
+
}, undefined, false, undefined, this)
|
|
69948
|
+
}, undefined, false, undefined, this)
|
|
69949
|
+
]
|
|
69950
|
+
}, undefined, true, undefined, this);
|
|
69951
|
+
}
|
|
69952
|
+
case "error":
|
|
69953
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69954
|
+
type: "error",
|
|
69955
|
+
children: state.message
|
|
69956
|
+
}, undefined, false, undefined, this);
|
|
69957
|
+
default:
|
|
69958
|
+
return null;
|
|
69959
|
+
}
|
|
69960
|
+
};
|
|
69961
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(jsx_dev_runtime18.Fragment, {
|
|
69962
|
+
children: [
|
|
69963
|
+
(state.phase === "checking" || state.phase === "fetching") && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Spinner2, {
|
|
69964
|
+
text: state.phase === "fetching" ? `Fetching skills from ${state.repo}...` : "Loading..."
|
|
69965
|
+
}, undefined, false, undefined, this),
|
|
69966
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Static, {
|
|
69967
|
+
items: outputItems,
|
|
69968
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69145
69969
|
flexDirection: "column",
|
|
69146
69970
|
children: renderContent()
|
|
69147
69971
|
}, item.id, false, undefined, this)
|
|
@@ -69151,129 +69975,150 @@ function RepoList(_props) {
|
|
|
69151
69975
|
}
|
|
69152
69976
|
|
|
69153
69977
|
// src/commands/repo/remove.tsx
|
|
69154
|
-
var
|
|
69155
|
-
var
|
|
69978
|
+
var import_react42 = __toESM(require_react(), 1);
|
|
69979
|
+
var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69156
69980
|
var args5 = exports_external.tuple([
|
|
69157
69981
|
exports_external.string().describe("Repository in owner/repo format")
|
|
69158
69982
|
]);
|
|
69159
|
-
var
|
|
69983
|
+
var options12 = exports_external.object({
|
|
69160
69984
|
force: exports_external.boolean().default(false).describe("Skip confirmation prompt")
|
|
69161
69985
|
});
|
|
69162
69986
|
function RepoRemove({ args: [repoArg], options: opts }) {
|
|
69163
69987
|
const { exit } = use_app_default();
|
|
69164
|
-
const [state, setState] =
|
|
69165
|
-
|
|
69988
|
+
const [state, setState] = import_react42.useState({ phase: "checking" });
|
|
69989
|
+
const [outputItems, setOutputItems] = import_react42.useState([]);
|
|
69990
|
+
import_react42.useEffect(() => {
|
|
69166
69991
|
function checkAndRemove() {
|
|
69167
69992
|
const config2 = getConfig();
|
|
69168
69993
|
if (!config2.repos.find((r) => r.repo === repoArg)) {
|
|
69169
69994
|
setState({ phase: "not_found", repo: repoArg });
|
|
69170
|
-
exit();
|
|
69171
69995
|
return;
|
|
69172
69996
|
}
|
|
69173
69997
|
if (opts.force) {
|
|
69174
69998
|
removeRepo(repoArg);
|
|
69175
69999
|
setState({ phase: "success", repo: repoArg });
|
|
69176
|
-
exit();
|
|
69177
70000
|
return;
|
|
69178
70001
|
}
|
|
69179
70002
|
setState({ phase: "confirm", repo: repoArg });
|
|
69180
70003
|
}
|
|
69181
70004
|
checkAndRemove();
|
|
69182
|
-
}, [repoArg, opts.force
|
|
70005
|
+
}, [repoArg, opts.force]);
|
|
69183
70006
|
use_input_default((input, key) => {
|
|
69184
70007
|
if (state.phase !== "confirm")
|
|
69185
70008
|
return;
|
|
69186
70009
|
if (input.toLowerCase() === "y" || key.return) {
|
|
69187
70010
|
removeRepo(state.repo);
|
|
69188
70011
|
setState({ phase: "success", repo: state.repo });
|
|
69189
|
-
exit();
|
|
69190
70012
|
return;
|
|
69191
70013
|
}
|
|
69192
|
-
if (input.toLowerCase() === "n" || key.escape) {
|
|
69193
|
-
setState({ phase: "cancelled" });
|
|
69194
|
-
|
|
69195
|
-
|
|
70014
|
+
if (input.toLowerCase() === "n" || key.escape) {
|
|
70015
|
+
setState({ phase: "cancelled" });
|
|
70016
|
+
return;
|
|
70017
|
+
}
|
|
70018
|
+
}, { isActive: state.phase === "confirm" });
|
|
70019
|
+
import_react42.useEffect(() => {
|
|
70020
|
+
const isFinalState = state.phase === "not_found" || state.phase === "success" || state.phase === "cancelled" || state.phase === "error";
|
|
70021
|
+
if (isFinalState && outputItems.length === 0) {
|
|
70022
|
+
setOutputItems([{ id: "output" }]);
|
|
70023
|
+
}
|
|
70024
|
+
}, [state.phase, outputItems.length]);
|
|
70025
|
+
import_react42.useEffect(() => {
|
|
70026
|
+
if (outputItems.length > 0) {
|
|
70027
|
+
process.nextTick(() => exit());
|
|
70028
|
+
}
|
|
70029
|
+
}, [outputItems.length, exit]);
|
|
70030
|
+
const renderContent = () => {
|
|
70031
|
+
switch (state.phase) {
|
|
70032
|
+
case "not_found":
|
|
70033
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
70034
|
+
flexDirection: "column",
|
|
70035
|
+
children: [
|
|
70036
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
|
|
70037
|
+
type: "error",
|
|
70038
|
+
children: [
|
|
70039
|
+
"Repository '",
|
|
70040
|
+
state.repo,
|
|
70041
|
+
"' not found in config"
|
|
70042
|
+
]
|
|
70043
|
+
}, undefined, true, undefined, this),
|
|
70044
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
70045
|
+
dimColor: true,
|
|
70046
|
+
children: "Run 'skilluse repo list' to see configured repos"
|
|
70047
|
+
}, undefined, false, undefined, this)
|
|
70048
|
+
]
|
|
70049
|
+
}, undefined, true, undefined, this);
|
|
70050
|
+
case "success":
|
|
70051
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
|
|
70052
|
+
type: "success",
|
|
70053
|
+
children: [
|
|
70054
|
+
"Removed ",
|
|
70055
|
+
state.repo
|
|
70056
|
+
]
|
|
70057
|
+
}, undefined, true, undefined, this);
|
|
70058
|
+
case "cancelled":
|
|
70059
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
70060
|
+
dimColor: true,
|
|
70061
|
+
children: "Removal cancelled"
|
|
70062
|
+
}, undefined, false, undefined, this);
|
|
70063
|
+
case "error":
|
|
70064
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
|
|
70065
|
+
type: "error",
|
|
70066
|
+
children: state.message
|
|
70067
|
+
}, undefined, false, undefined, this);
|
|
70068
|
+
default:
|
|
70069
|
+
return null;
|
|
69196
70070
|
}
|
|
69197
|
-
}
|
|
69198
|
-
|
|
69199
|
-
|
|
69200
|
-
|
|
70071
|
+
};
|
|
70072
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
|
|
70073
|
+
children: [
|
|
70074
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Spinner2, {
|
|
69201
70075
|
text: "Checking..."
|
|
69202
|
-
}, undefined, false, undefined, this)
|
|
69203
|
-
|
|
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, {
|
|
70076
|
+
}, undefined, false, undefined, this),
|
|
70077
|
+
state.phase === "confirm" && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69223
70078
|
flexDirection: "column",
|
|
69224
70079
|
children: [
|
|
69225
|
-
/* @__PURE__ */
|
|
70080
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69226
70081
|
children: [
|
|
69227
70082
|
"Remove repository ",
|
|
69228
|
-
/* @__PURE__ */
|
|
70083
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69229
70084
|
color: "cyan",
|
|
69230
70085
|
children: state.repo
|
|
69231
70086
|
}, undefined, false, undefined, this),
|
|
69232
70087
|
"?"
|
|
69233
70088
|
]
|
|
69234
70089
|
}, undefined, true, undefined, this),
|
|
69235
|
-
/* @__PURE__ */
|
|
70090
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69236
70091
|
marginTop: 1,
|
|
69237
|
-
children: /* @__PURE__ */
|
|
70092
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69238
70093
|
dimColor: true,
|
|
69239
70094
|
children: "Press Y to confirm, N to cancel"
|
|
69240
70095
|
}, undefined, false, undefined, this)
|
|
69241
70096
|
}, undefined, false, undefined, this)
|
|
69242
70097
|
]
|
|
69243
|
-
}, undefined, true, undefined, this)
|
|
69244
|
-
|
|
69245
|
-
|
|
69246
|
-
|
|
69247
|
-
|
|
69248
|
-
|
|
69249
|
-
|
|
69250
|
-
|
|
69251
|
-
|
|
69252
|
-
|
|
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
|
-
}
|
|
70098
|
+
}, undefined, true, undefined, this),
|
|
70099
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Static, {
|
|
70100
|
+
items: outputItems,
|
|
70101
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
70102
|
+
flexDirection: "column",
|
|
70103
|
+
children: renderContent()
|
|
70104
|
+
}, item.id, false, undefined, this)
|
|
70105
|
+
}, undefined, false, undefined, this)
|
|
70106
|
+
]
|
|
70107
|
+
}, undefined, true, undefined, this);
|
|
69263
70108
|
}
|
|
69264
70109
|
|
|
69265
70110
|
// src/commands/repo/use.tsx
|
|
69266
|
-
var
|
|
69267
|
-
var
|
|
70111
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
70112
|
+
var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69268
70113
|
var args6 = exports_external.tuple([
|
|
69269
70114
|
exports_external.string().describe("Repository in owner/repo format")
|
|
69270
70115
|
]);
|
|
69271
|
-
var
|
|
70116
|
+
var options13 = exports_external.object({});
|
|
69272
70117
|
function RepoUse({ args: [repoArg], options: _opts }) {
|
|
69273
70118
|
const { exit } = use_app_default();
|
|
69274
|
-
const [state, setState] =
|
|
69275
|
-
const [outputItems, setOutputItems] =
|
|
69276
|
-
|
|
70119
|
+
const [state, setState] = import_react43.useState({ phase: "checking" });
|
|
70120
|
+
const [outputItems, setOutputItems] = import_react43.useState([]);
|
|
70121
|
+
import_react43.useEffect(() => {
|
|
69277
70122
|
const config2 = getConfig();
|
|
69278
70123
|
if (!config2.repos.find((r) => r.repo === repoArg)) {
|
|
69279
70124
|
setState({ phase: "not_found", repo: repoArg });
|
|
@@ -69286,12 +70131,12 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69286
70131
|
setDefaultRepo(repoArg);
|
|
69287
70132
|
setState({ phase: "success", repo: repoArg });
|
|
69288
70133
|
}, [repoArg]);
|
|
69289
|
-
|
|
70134
|
+
import_react43.useEffect(() => {
|
|
69290
70135
|
if (state.phase !== "checking" && outputItems.length === 0) {
|
|
69291
70136
|
setOutputItems([{ id: "output" }]);
|
|
69292
70137
|
}
|
|
69293
70138
|
}, [state.phase, outputItems.length]);
|
|
69294
|
-
|
|
70139
|
+
import_react43.useEffect(() => {
|
|
69295
70140
|
if (outputItems.length > 0) {
|
|
69296
70141
|
process.nextTick(() => exit());
|
|
69297
70142
|
}
|
|
@@ -69299,9 +70144,9 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69299
70144
|
const renderContent = () => {
|
|
69300
70145
|
switch (state.phase) {
|
|
69301
70146
|
case "not_found":
|
|
69302
|
-
return /* @__PURE__ */
|
|
70147
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
|
69303
70148
|
children: [
|
|
69304
|
-
/* @__PURE__ */
|
|
70149
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69305
70150
|
type: "error",
|
|
69306
70151
|
children: [
|
|
69307
70152
|
"Repository ",
|
|
@@ -69309,7 +70154,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69309
70154
|
" not found in config"
|
|
69310
70155
|
]
|
|
69311
70156
|
}, undefined, true, undefined, this),
|
|
69312
|
-
/* @__PURE__ */
|
|
70157
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69313
70158
|
dimColor: true,
|
|
69314
70159
|
children: [
|
|
69315
70160
|
"Run 'skilluse repo add ",
|
|
@@ -69320,7 +70165,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69320
70165
|
]
|
|
69321
70166
|
}, undefined, true, undefined, this);
|
|
69322
70167
|
case "already_default":
|
|
69323
|
-
return /* @__PURE__ */
|
|
70168
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69324
70169
|
type: "success",
|
|
69325
70170
|
children: [
|
|
69326
70171
|
state.repo,
|
|
@@ -69328,7 +70173,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69328
70173
|
]
|
|
69329
70174
|
}, undefined, true, undefined, this);
|
|
69330
70175
|
case "success":
|
|
69331
|
-
return /* @__PURE__ */
|
|
70176
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69332
70177
|
type: "success",
|
|
69333
70178
|
children: [
|
|
69334
70179
|
"Default repo set to ",
|
|
@@ -69336,7 +70181,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69336
70181
|
]
|
|
69337
70182
|
}, undefined, true, undefined, this);
|
|
69338
70183
|
case "error":
|
|
69339
|
-
return /* @__PURE__ */
|
|
70184
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69340
70185
|
type: "error",
|
|
69341
70186
|
children: state.message
|
|
69342
70187
|
}, undefined, false, undefined, this);
|
|
@@ -69344,14 +70189,14 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69344
70189
|
return null;
|
|
69345
70190
|
}
|
|
69346
70191
|
};
|
|
69347
|
-
return /* @__PURE__ */
|
|
70192
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
|
69348
70193
|
children: [
|
|
69349
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
70194
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Spinner2, {
|
|
69350
70195
|
text: "Setting default..."
|
|
69351
70196
|
}, undefined, false, undefined, this),
|
|
69352
|
-
/* @__PURE__ */
|
|
70197
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Static, {
|
|
69353
70198
|
items: outputItems,
|
|
69354
|
-
children: (item) => /* @__PURE__ */
|
|
70199
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
69355
70200
|
flexDirection: "column",
|
|
69356
70201
|
children: renderContent()
|
|
69357
70202
|
}, item.id, false, undefined, this)
|
|
@@ -69361,17 +70206,17 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69361
70206
|
}
|
|
69362
70207
|
|
|
69363
70208
|
// src/commands/agent/index.tsx
|
|
69364
|
-
var
|
|
69365
|
-
var
|
|
70209
|
+
var import_react44 = __toESM(require_react(), 1);
|
|
70210
|
+
var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69366
70211
|
var args7 = exports_external.tuple([
|
|
69367
70212
|
exports_external.string().optional().describe("Agent ID to switch to")
|
|
69368
70213
|
]);
|
|
69369
|
-
var
|
|
70214
|
+
var options14 = exports_external.object({});
|
|
69370
70215
|
function Agent({ args: [agentIdArg] }) {
|
|
69371
70216
|
const { exit } = use_app_default();
|
|
69372
|
-
const [state, setState] =
|
|
69373
|
-
const [outputItems, setOutputItems] =
|
|
69374
|
-
|
|
70217
|
+
const [state, setState] = import_react44.useState({ phase: "loading" });
|
|
70218
|
+
const [outputItems, setOutputItems] = import_react44.useState([]);
|
|
70219
|
+
import_react44.useEffect(() => {
|
|
69375
70220
|
if (agentIdArg) {
|
|
69376
70221
|
const agent = getAgent(agentIdArg);
|
|
69377
70222
|
if (!agent) {
|
|
@@ -69399,12 +70244,12 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
69399
70244
|
setState({ phase: "selecting", currentAgent, agents });
|
|
69400
70245
|
}
|
|
69401
70246
|
}, [agentIdArg]);
|
|
69402
|
-
|
|
70247
|
+
import_react44.useEffect(() => {
|
|
69403
70248
|
if (state.phase !== "loading" && state.phase !== "selecting" && outputItems.length === 0) {
|
|
69404
70249
|
setOutputItems([{ id: "output" }]);
|
|
69405
70250
|
}
|
|
69406
70251
|
}, [state.phase, outputItems.length]);
|
|
69407
|
-
|
|
70252
|
+
import_react44.useEffect(() => {
|
|
69408
70253
|
if (outputItems.length > 0) {
|
|
69409
70254
|
process.nextTick(() => exit());
|
|
69410
70255
|
}
|
|
@@ -69436,17 +70281,17 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
69436
70281
|
label: agent.id === state.currentAgent ? `${agent.name} (current)` : agent.name,
|
|
69437
70282
|
value: agent.id
|
|
69438
70283
|
}));
|
|
69439
|
-
return /* @__PURE__ */
|
|
70284
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
69440
70285
|
flexDirection: "column",
|
|
69441
70286
|
children: [
|
|
69442
|
-
/* @__PURE__ */
|
|
70287
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
69443
70288
|
marginBottom: 1,
|
|
69444
|
-
children: /* @__PURE__ */
|
|
70289
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69445
70290
|
bold: true,
|
|
69446
70291
|
children: "Select an agent:"
|
|
69447
70292
|
}, undefined, false, undefined, this)
|
|
69448
70293
|
}, undefined, false, undefined, this),
|
|
69449
|
-
/* @__PURE__ */
|
|
70294
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Select, {
|
|
69450
70295
|
items,
|
|
69451
70296
|
onSelect: handleSelect
|
|
69452
70297
|
}, undefined, false, undefined, this)
|
|
@@ -69454,23 +70299,23 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
69454
70299
|
}, undefined, true, undefined, this);
|
|
69455
70300
|
}
|
|
69456
70301
|
case "not_found":
|
|
69457
|
-
return /* @__PURE__ */
|
|
70302
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
|
|
69458
70303
|
children: [
|
|
69459
|
-
/* @__PURE__ */
|
|
70304
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
|
|
69460
70305
|
type: "error",
|
|
69461
70306
|
children: [
|
|
69462
70307
|
"Unknown agent: ",
|
|
69463
70308
|
state.agentId
|
|
69464
70309
|
]
|
|
69465
70310
|
}, undefined, true, undefined, this),
|
|
69466
|
-
/* @__PURE__ */
|
|
70311
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69467
70312
|
dimColor: true,
|
|
69468
70313
|
children: "Run 'skilluse agent' to see available agents."
|
|
69469
70314
|
}, undefined, false, undefined, this)
|
|
69470
70315
|
]
|
|
69471
70316
|
}, undefined, true, undefined, this);
|
|
69472
70317
|
case "already_current":
|
|
69473
|
-
return /* @__PURE__ */
|
|
70318
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
|
|
69474
70319
|
type: "success",
|
|
69475
70320
|
children: [
|
|
69476
70321
|
state.agentName,
|
|
@@ -69478,18 +70323,18 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
69478
70323
|
]
|
|
69479
70324
|
}, undefined, true, undefined, this);
|
|
69480
70325
|
case "switched":
|
|
69481
|
-
return /* @__PURE__ */
|
|
70326
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
|
|
69482
70327
|
children: [
|
|
69483
|
-
/* @__PURE__ */
|
|
70328
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
|
|
69484
70329
|
type: "success",
|
|
69485
70330
|
children: [
|
|
69486
70331
|
"Switched to ",
|
|
69487
70332
|
state.agentName
|
|
69488
70333
|
]
|
|
69489
70334
|
}, undefined, true, undefined, this),
|
|
69490
|
-
/* @__PURE__ */
|
|
70335
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
69491
70336
|
marginTop: 1,
|
|
69492
|
-
children: /* @__PURE__ */
|
|
70337
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69493
70338
|
dimColor: true,
|
|
69494
70339
|
children: [
|
|
69495
70340
|
"Skills will now be installed to ",
|
|
@@ -69505,16 +70350,16 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
69505
70350
|
}
|
|
69506
70351
|
};
|
|
69507
70352
|
if (state.phase === "loading") {
|
|
69508
|
-
return /* @__PURE__ */
|
|
70353
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Spinner2, {
|
|
69509
70354
|
text: "Loading..."
|
|
69510
70355
|
}, undefined, false, undefined, this);
|
|
69511
70356
|
}
|
|
69512
70357
|
if (state.phase === "selecting") {
|
|
69513
70358
|
return renderContent();
|
|
69514
70359
|
}
|
|
69515
|
-
return /* @__PURE__ */
|
|
70360
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Static, {
|
|
69516
70361
|
items: outputItems,
|
|
69517
|
-
children: (item) => /* @__PURE__ */
|
|
70362
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
69518
70363
|
flexDirection: "column",
|
|
69519
70364
|
children: renderContent()
|
|
69520
70365
|
}, item.id, false, undefined, this)
|
|
@@ -69522,13 +70367,13 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
69522
70367
|
}
|
|
69523
70368
|
|
|
69524
70369
|
// src/commands/search.tsx
|
|
69525
|
-
var
|
|
69526
|
-
var
|
|
70370
|
+
var import_react45 = __toESM(require_react(), 1);
|
|
70371
|
+
var jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69527
70372
|
var args8 = exports_external.tuple([exports_external.string().describe("Search keyword")]);
|
|
69528
|
-
var
|
|
70373
|
+
var options15 = exports_external.object({
|
|
69529
70374
|
all: exports_external.boolean().default(false).describe("Search in all configured repos (not just default)")
|
|
69530
70375
|
});
|
|
69531
|
-
function
|
|
70376
|
+
function parseFrontmatter5(content) {
|
|
69532
70377
|
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
69533
70378
|
if (!frontmatterMatch) {
|
|
69534
70379
|
return {};
|
|
@@ -69552,7 +70397,7 @@ function parseFrontmatter4(content) {
|
|
|
69552
70397
|
}
|
|
69553
70398
|
return result;
|
|
69554
70399
|
}
|
|
69555
|
-
async function
|
|
70400
|
+
async function fetchSkillsFromRepo2(token, repoConfig) {
|
|
69556
70401
|
const { repo, branch, paths: paths2 } = repoConfig;
|
|
69557
70402
|
const skills = [];
|
|
69558
70403
|
const searchPaths = paths2.length > 0 ? paths2 : [""];
|
|
@@ -69580,7 +70425,7 @@ async function fetchSkillsFromRepo(token, repoConfig) {
|
|
|
69580
70425
|
});
|
|
69581
70426
|
if (skillResponse.ok) {
|
|
69582
70427
|
const content = await skillResponse.text();
|
|
69583
|
-
const frontmatter =
|
|
70428
|
+
const frontmatter = parseFrontmatter5(content);
|
|
69584
70429
|
if (frontmatter.name) {
|
|
69585
70430
|
skills.push({
|
|
69586
70431
|
name: String(frontmatter.name),
|
|
@@ -69615,8 +70460,9 @@ function filterSkills(skills, keyword) {
|
|
|
69615
70460
|
}
|
|
69616
70461
|
function Search({ args: [keyword], options: opts }) {
|
|
69617
70462
|
const { exit } = use_app_default();
|
|
69618
|
-
const [state, setState] =
|
|
69619
|
-
|
|
70463
|
+
const [state, setState] = import_react45.useState({ phase: "checking" });
|
|
70464
|
+
const [outputItems, setOutputItems] = import_react45.useState([]);
|
|
70465
|
+
import_react45.useEffect(() => {
|
|
69620
70466
|
async function search() {
|
|
69621
70467
|
const config2 = getConfig();
|
|
69622
70468
|
let reposToSearch = [];
|
|
@@ -69632,7 +70478,6 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
69632
70478
|
}
|
|
69633
70479
|
if (reposToSearch.length === 0) {
|
|
69634
70480
|
setState({ phase: "no_repos" });
|
|
69635
|
-
exit();
|
|
69636
70481
|
return;
|
|
69637
70482
|
}
|
|
69638
70483
|
const credentials = await getCredentials();
|
|
@@ -69640,176 +70485,194 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
69640
70485
|
const allSkills = [];
|
|
69641
70486
|
for (const repoConfig of reposToSearch) {
|
|
69642
70487
|
setState({ phase: "searching", repo: repoConfig.repo });
|
|
69643
|
-
const result = await
|
|
70488
|
+
const result = await fetchSkillsFromRepo2(token, repoConfig);
|
|
69644
70489
|
if ("authRequired" in result) {
|
|
69645
70490
|
setState({ phase: "auth_required", message: result.message });
|
|
69646
|
-
exit();
|
|
69647
70491
|
return;
|
|
69648
70492
|
}
|
|
69649
70493
|
allSkills.push(...result);
|
|
69650
70494
|
}
|
|
69651
70495
|
const matchingSkills = filterSkills(allSkills, keyword);
|
|
69652
70496
|
setState({ phase: "success", skills: matchingSkills, keyword });
|
|
69653
|
-
exit();
|
|
69654
70497
|
}
|
|
69655
70498
|
search().catch((err) => {
|
|
69656
70499
|
setState({
|
|
69657
70500
|
phase: "error",
|
|
69658
70501
|
message: err instanceof Error ? err.message : "Search failed"
|
|
69659
70502
|
});
|
|
69660
|
-
exit();
|
|
69661
70503
|
});
|
|
69662
|
-
}, [keyword, opts.all
|
|
69663
|
-
|
|
69664
|
-
|
|
69665
|
-
|
|
69666
|
-
|
|
69667
|
-
|
|
69668
|
-
|
|
69669
|
-
|
|
69670
|
-
|
|
69671
|
-
|
|
69672
|
-
|
|
69673
|
-
|
|
69674
|
-
|
|
69675
|
-
|
|
69676
|
-
|
|
69677
|
-
|
|
69678
|
-
|
|
69679
|
-
|
|
69680
|
-
|
|
69681
|
-
|
|
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."
|
|
70504
|
+
}, [keyword, opts.all]);
|
|
70505
|
+
import_react45.useEffect(() => {
|
|
70506
|
+
const isFinalState = state.phase === "no_repos" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
|
|
70507
|
+
if (isFinalState && outputItems.length === 0) {
|
|
70508
|
+
setOutputItems([{ id: "output" }]);
|
|
70509
|
+
}
|
|
70510
|
+
}, [state.phase, outputItems.length]);
|
|
70511
|
+
import_react45.useEffect(() => {
|
|
70512
|
+
if (outputItems.length > 0) {
|
|
70513
|
+
process.nextTick(() => exit());
|
|
70514
|
+
}
|
|
70515
|
+
}, [outputItems.length, exit]);
|
|
70516
|
+
const renderContent = () => {
|
|
70517
|
+
switch (state.phase) {
|
|
70518
|
+
case "auth_required":
|
|
70519
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70520
|
+
flexDirection: "column",
|
|
70521
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
70522
|
+
type: "error",
|
|
70523
|
+
children: state.message
|
|
69687
70524
|
}, undefined, false, undefined, this)
|
|
69688
|
-
|
|
69689
|
-
|
|
69690
|
-
|
|
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, {
|
|
70525
|
+
}, undefined, false, undefined, this);
|
|
70526
|
+
case "no_repos":
|
|
70527
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
69697
70528
|
flexDirection: "column",
|
|
69698
70529
|
children: [
|
|
69699
|
-
/* @__PURE__ */
|
|
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, {
|
|
70530
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
69715
70531
|
type: "warning",
|
|
69716
|
-
children: "No
|
|
70532
|
+
children: "No repositories configured"
|
|
69717
70533
|
}, undefined, false, undefined, this),
|
|
69718
|
-
/* @__PURE__ */
|
|
69719
|
-
|
|
69720
|
-
children:
|
|
69721
|
-
dimColor: true,
|
|
69722
|
-
children: "Try a different search term or check your configured repos with 'skilluse repo list'."
|
|
69723
|
-
}, undefined, false, undefined, this)
|
|
70534
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70535
|
+
dimColor: true,
|
|
70536
|
+
children: "Run 'skilluse repo add owner/repo' to add a skill repository."
|
|
69724
70537
|
}, undefined, false, undefined, this)
|
|
69725
70538
|
]
|
|
69726
70539
|
}, undefined, true, undefined, this);
|
|
69727
|
-
|
|
69728
|
-
|
|
69729
|
-
|
|
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, {
|
|
70540
|
+
case "success":
|
|
70541
|
+
if (state.skills.length === 0) {
|
|
70542
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
69747
70543
|
flexDirection: "column",
|
|
69748
|
-
marginBottom: 1,
|
|
69749
70544
|
children: [
|
|
69750
|
-
/* @__PURE__ */
|
|
70545
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70546
|
+
marginBottom: 1,
|
|
69751
70547
|
children: [
|
|
69752
|
-
/* @__PURE__ */
|
|
70548
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70549
|
+
children: 'Search results for "'
|
|
70550
|
+
}, undefined, false, undefined, this),
|
|
70551
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
69753
70552
|
color: "cyan",
|
|
69754
|
-
|
|
69755
|
-
children: skill.name
|
|
70553
|
+
children: state.keyword
|
|
69756
70554
|
}, undefined, false, undefined, this),
|
|
69757
|
-
|
|
69758
|
-
|
|
69759
|
-
|
|
69760
|
-
" v",
|
|
69761
|
-
skill.version
|
|
69762
|
-
]
|
|
69763
|
-
}, undefined, true, undefined, this)
|
|
70555
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70556
|
+
children: '"'
|
|
70557
|
+
}, undefined, false, undefined, this)
|
|
69764
70558
|
]
|
|
69765
70559
|
}, undefined, true, undefined, this),
|
|
69766
|
-
/* @__PURE__ */
|
|
69767
|
-
|
|
69768
|
-
children:
|
|
69769
|
-
children: skill.description
|
|
69770
|
-
}, undefined, false, undefined, this)
|
|
70560
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
70561
|
+
type: "warning",
|
|
70562
|
+
children: "No skills found"
|
|
69771
70563
|
}, undefined, false, undefined, this),
|
|
69772
|
-
/* @__PURE__ */
|
|
69773
|
-
|
|
69774
|
-
children: /* @__PURE__ */
|
|
70564
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70565
|
+
marginTop: 1,
|
|
70566
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
69775
70567
|
dimColor: true,
|
|
69776
|
-
children:
|
|
69777
|
-
|
|
69778
|
-
skill.type && ` • ${skill.type}`
|
|
69779
|
-
]
|
|
69780
|
-
}, undefined, true, undefined, this)
|
|
70568
|
+
children: "Try a different search term or check your configured repos with 'skilluse repo list'."
|
|
70569
|
+
}, undefined, false, undefined, this)
|
|
69781
70570
|
}, undefined, false, undefined, this)
|
|
69782
70571
|
]
|
|
69783
|
-
},
|
|
69784
|
-
|
|
69785
|
-
|
|
69786
|
-
|
|
69787
|
-
|
|
70572
|
+
}, undefined, true, undefined, this);
|
|
70573
|
+
}
|
|
70574
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70575
|
+
flexDirection: "column",
|
|
70576
|
+
children: [
|
|
70577
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70578
|
+
marginBottom: 1,
|
|
69788
70579
|
children: [
|
|
69789
|
-
|
|
69790
|
-
|
|
69791
|
-
|
|
69792
|
-
|
|
69793
|
-
|
|
70580
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70581
|
+
children: 'Search results for "'
|
|
70582
|
+
}, undefined, false, undefined, this),
|
|
70583
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70584
|
+
color: "cyan",
|
|
70585
|
+
children: state.keyword
|
|
70586
|
+
}, undefined, false, undefined, this),
|
|
70587
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70588
|
+
children: '"'
|
|
70589
|
+
}, undefined, false, undefined, this)
|
|
70590
|
+
]
|
|
70591
|
+
}, undefined, true, undefined, this),
|
|
70592
|
+
state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70593
|
+
flexDirection: "column",
|
|
70594
|
+
marginBottom: 1,
|
|
70595
|
+
children: [
|
|
70596
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70597
|
+
children: [
|
|
70598
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70599
|
+
color: "cyan",
|
|
70600
|
+
bold: true,
|
|
70601
|
+
children: skill.name
|
|
70602
|
+
}, undefined, false, undefined, this),
|
|
70603
|
+
skill.version && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70604
|
+
dimColor: true,
|
|
70605
|
+
children: [
|
|
70606
|
+
" v",
|
|
70607
|
+
skill.version
|
|
70608
|
+
]
|
|
70609
|
+
}, undefined, true, undefined, this)
|
|
70610
|
+
]
|
|
70611
|
+
}, undefined, true, undefined, this),
|
|
70612
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70613
|
+
marginLeft: 2,
|
|
70614
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70615
|
+
children: skill.description
|
|
70616
|
+
}, undefined, false, undefined, this)
|
|
70617
|
+
}, undefined, false, undefined, this),
|
|
70618
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70619
|
+
marginLeft: 2,
|
|
70620
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70621
|
+
dimColor: true,
|
|
70622
|
+
children: [
|
|
70623
|
+
skill.repo,
|
|
70624
|
+
skill.type && ` • ${skill.type}`
|
|
70625
|
+
]
|
|
70626
|
+
}, undefined, true, undefined, this)
|
|
70627
|
+
}, undefined, false, undefined, this)
|
|
69794
70628
|
]
|
|
69795
|
-
},
|
|
69796
|
-
|
|
69797
|
-
|
|
69798
|
-
|
|
69799
|
-
|
|
69800
|
-
|
|
69801
|
-
|
|
69802
|
-
|
|
69803
|
-
|
|
69804
|
-
|
|
70629
|
+
}, `${skill.repo}/${skill.path}`, true, undefined, this)),
|
|
70630
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70631
|
+
marginTop: 1,
|
|
70632
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70633
|
+
dimColor: true,
|
|
70634
|
+
children: [
|
|
70635
|
+
state.skills.length,
|
|
70636
|
+
" skill",
|
|
70637
|
+
state.skills.length !== 1 ? "s" : "",
|
|
70638
|
+
" ",
|
|
70639
|
+
"found"
|
|
70640
|
+
]
|
|
70641
|
+
}, undefined, true, undefined, this)
|
|
70642
|
+
}, undefined, false, undefined, this)
|
|
70643
|
+
]
|
|
70644
|
+
}, undefined, true, undefined, this);
|
|
70645
|
+
case "error":
|
|
70646
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
70647
|
+
type: "error",
|
|
70648
|
+
children: state.message
|
|
70649
|
+
}, undefined, false, undefined, this);
|
|
70650
|
+
default:
|
|
70651
|
+
return null;
|
|
70652
|
+
}
|
|
70653
|
+
};
|
|
70654
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(jsx_dev_runtime22.Fragment, {
|
|
70655
|
+
children: [
|
|
70656
|
+
(state.phase === "checking" || state.phase === "searching") && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Spinner2, {
|
|
70657
|
+
text: state.phase === "searching" ? `Searching ${state.repo}...` : "Initializing..."
|
|
70658
|
+
}, undefined, false, undefined, this),
|
|
70659
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Static, {
|
|
70660
|
+
items: outputItems,
|
|
70661
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70662
|
+
flexDirection: "column",
|
|
70663
|
+
children: renderContent()
|
|
70664
|
+
}, item.id, false, undefined, this)
|
|
70665
|
+
}, undefined, false, undefined, this)
|
|
70666
|
+
]
|
|
70667
|
+
}, undefined, true, undefined, this);
|
|
69805
70668
|
}
|
|
69806
70669
|
|
|
69807
70670
|
// src/commands/uninstall.tsx
|
|
69808
70671
|
import { rm } from "node:fs/promises";
|
|
69809
|
-
var
|
|
69810
|
-
var
|
|
70672
|
+
var import_react46 = __toESM(require_react(), 1);
|
|
70673
|
+
var jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69811
70674
|
var args9 = exports_external.tuple([exports_external.string().describe("Skill name to uninstall")]);
|
|
69812
|
-
var
|
|
70675
|
+
var options16 = exports_external.object({
|
|
69813
70676
|
force: exports_external.boolean().default(false).describe("Skip confirmation prompt")
|
|
69814
70677
|
});
|
|
69815
70678
|
function ConfirmPrompt({
|
|
@@ -69824,20 +70687,20 @@ function ConfirmPrompt({
|
|
|
69824
70687
|
onCancel();
|
|
69825
70688
|
}
|
|
69826
70689
|
});
|
|
69827
|
-
return /* @__PURE__ */
|
|
70690
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
69828
70691
|
flexDirection: "column",
|
|
69829
70692
|
children: [
|
|
69830
|
-
/* @__PURE__ */
|
|
70693
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
69831
70694
|
children: [
|
|
69832
|
-
/* @__PURE__ */
|
|
70695
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69833
70696
|
children: "Uninstall "
|
|
69834
70697
|
}, undefined, false, undefined, this),
|
|
69835
|
-
/* @__PURE__ */
|
|
70698
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69836
70699
|
color: "cyan",
|
|
69837
70700
|
bold: true,
|
|
69838
70701
|
children: skill.name
|
|
69839
70702
|
}, undefined, false, undefined, this),
|
|
69840
|
-
/* @__PURE__ */
|
|
70703
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69841
70704
|
children: [
|
|
69842
70705
|
" v",
|
|
69843
70706
|
skill.version,
|
|
@@ -69846,9 +70709,9 @@ function ConfirmPrompt({
|
|
|
69846
70709
|
}, undefined, true, undefined, this)
|
|
69847
70710
|
]
|
|
69848
70711
|
}, undefined, true, undefined, this),
|
|
69849
|
-
/* @__PURE__ */
|
|
70712
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
69850
70713
|
marginLeft: 2,
|
|
69851
|
-
children: /* @__PURE__ */
|
|
70714
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69852
70715
|
dimColor: true,
|
|
69853
70716
|
children: [
|
|
69854
70717
|
"Location: ",
|
|
@@ -69856,26 +70719,26 @@ function ConfirmPrompt({
|
|
|
69856
70719
|
]
|
|
69857
70720
|
}, undefined, true, undefined, this)
|
|
69858
70721
|
}, undefined, false, undefined, this),
|
|
69859
|
-
/* @__PURE__ */
|
|
70722
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
69860
70723
|
marginTop: 1,
|
|
69861
70724
|
children: [
|
|
69862
|
-
/* @__PURE__ */
|
|
70725
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69863
70726
|
dimColor: true,
|
|
69864
70727
|
children: "Press "
|
|
69865
70728
|
}, undefined, false, undefined, this),
|
|
69866
|
-
/* @__PURE__ */
|
|
70729
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69867
70730
|
color: "green",
|
|
69868
70731
|
children: "Y"
|
|
69869
70732
|
}, undefined, false, undefined, this),
|
|
69870
|
-
/* @__PURE__ */
|
|
70733
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69871
70734
|
dimColor: true,
|
|
69872
70735
|
children: " to confirm, "
|
|
69873
70736
|
}, undefined, false, undefined, this),
|
|
69874
|
-
/* @__PURE__ */
|
|
70737
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69875
70738
|
color: "red",
|
|
69876
70739
|
children: "N"
|
|
69877
70740
|
}, undefined, false, undefined, this),
|
|
69878
|
-
/* @__PURE__ */
|
|
70741
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
69879
70742
|
dimColor: true,
|
|
69880
70743
|
children: " to cancel"
|
|
69881
70744
|
}, undefined, false, undefined, this)
|
|
@@ -69886,8 +70749,9 @@ function ConfirmPrompt({
|
|
|
69886
70749
|
}
|
|
69887
70750
|
function Uninstall({ args: [skillName], options: opts }) {
|
|
69888
70751
|
const { exit } = use_app_default();
|
|
69889
|
-
const [state, setState] =
|
|
69890
|
-
const
|
|
70752
|
+
const [state, setState] = import_react46.useState({ phase: "checking" });
|
|
70753
|
+
const [outputItems, setOutputItems] = import_react46.useState([]);
|
|
70754
|
+
const performUninstall = import_react46.useCallback(async (skill) => {
|
|
69891
70755
|
setState({ phase: "uninstalling", skill });
|
|
69892
70756
|
try {
|
|
69893
70757
|
await rm(skill.installedPath, { recursive: true, force: true });
|
|
@@ -69899,9 +70763,8 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
69899
70763
|
message: err instanceof Error ? err.message : "Uninstall failed"
|
|
69900
70764
|
});
|
|
69901
70765
|
}
|
|
69902
|
-
|
|
69903
|
-
|
|
69904
|
-
import_react44.useEffect(() => {
|
|
70766
|
+
}, []);
|
|
70767
|
+
import_react46.useEffect(() => {
|
|
69905
70768
|
const config2 = getConfig();
|
|
69906
70769
|
const currentAgentId = getCurrentAgent();
|
|
69907
70770
|
const agentInfo = getAgent(currentAgentId);
|
|
@@ -69909,7 +70772,6 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
69909
70772
|
const skill = config2.installed.find((s) => s.name.toLowerCase() === skillName.toLowerCase() && (s.agent === currentAgentId || !s.agent));
|
|
69910
70773
|
if (!skill) {
|
|
69911
70774
|
setState({ phase: "not_found", skillName, agentName });
|
|
69912
|
-
exit();
|
|
69913
70775
|
return;
|
|
69914
70776
|
}
|
|
69915
70777
|
if (opts.force) {
|
|
@@ -69917,7 +70779,18 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
69917
70779
|
} else {
|
|
69918
70780
|
setState({ phase: "confirming", skill });
|
|
69919
70781
|
}
|
|
69920
|
-
}, [skillName, opts.force,
|
|
70782
|
+
}, [skillName, opts.force, performUninstall]);
|
|
70783
|
+
import_react46.useEffect(() => {
|
|
70784
|
+
const isFinalState = state.phase === "not_found" || state.phase === "success" || state.phase === "cancelled" || state.phase === "error";
|
|
70785
|
+
if (isFinalState && outputItems.length === 0) {
|
|
70786
|
+
setOutputItems([{ id: "output" }]);
|
|
70787
|
+
}
|
|
70788
|
+
}, [state.phase, outputItems.length]);
|
|
70789
|
+
import_react46.useEffect(() => {
|
|
70790
|
+
if (outputItems.length > 0) {
|
|
70791
|
+
process.nextTick(() => exit());
|
|
70792
|
+
}
|
|
70793
|
+
}, [outputItems.length, exit]);
|
|
69921
70794
|
function handleConfirm() {
|
|
69922
70795
|
if (state.phase === "confirming") {
|
|
69923
70796
|
performUninstall(state.skill);
|
|
@@ -69925,83 +70798,88 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
69925
70798
|
}
|
|
69926
70799
|
function handleCancel() {
|
|
69927
70800
|
setState({ phase: "cancelled" });
|
|
69928
|
-
exit();
|
|
69929
70801
|
}
|
|
69930
|
-
|
|
69931
|
-
|
|
69932
|
-
|
|
69933
|
-
|
|
69934
|
-
|
|
69935
|
-
|
|
69936
|
-
|
|
69937
|
-
|
|
69938
|
-
|
|
69939
|
-
|
|
69940
|
-
|
|
69941
|
-
|
|
69942
|
-
|
|
69943
|
-
|
|
69944
|
-
|
|
69945
|
-
|
|
69946
|
-
|
|
69947
|
-
|
|
69948
|
-
|
|
69949
|
-
|
|
69950
|
-
|
|
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."
|
|
70802
|
+
const renderContent = () => {
|
|
70803
|
+
switch (state.phase) {
|
|
70804
|
+
case "not_found":
|
|
70805
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70806
|
+
flexDirection: "column",
|
|
70807
|
+
children: [
|
|
70808
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70809
|
+
type: "error",
|
|
70810
|
+
children: [
|
|
70811
|
+
'Skill "',
|
|
70812
|
+
state.skillName,
|
|
70813
|
+
'" is not installed for ',
|
|
70814
|
+
state.agentName
|
|
70815
|
+
]
|
|
70816
|
+
}, undefined, true, undefined, this),
|
|
70817
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70818
|
+
marginTop: 1,
|
|
70819
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70820
|
+
dimColor: true,
|
|
70821
|
+
children: "Run 'skilluse list' to see installed skills."
|
|
70822
|
+
}, undefined, false, undefined, this)
|
|
69959
70823
|
}, undefined, false, undefined, this)
|
|
69960
|
-
|
|
69961
|
-
|
|
69962
|
-
|
|
69963
|
-
|
|
69964
|
-
|
|
70824
|
+
]
|
|
70825
|
+
}, undefined, true, undefined, this);
|
|
70826
|
+
case "success":
|
|
70827
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70828
|
+
type: "success",
|
|
70829
|
+
children: [
|
|
70830
|
+
'Uninstalled "',
|
|
70831
|
+
state.skill.name,
|
|
70832
|
+
'"'
|
|
70833
|
+
]
|
|
70834
|
+
}, undefined, true, undefined, this);
|
|
70835
|
+
case "cancelled":
|
|
70836
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70837
|
+
type: "warning",
|
|
70838
|
+
children: "Uninstall cancelled"
|
|
70839
|
+
}, undefined, false, undefined, this);
|
|
70840
|
+
case "error":
|
|
70841
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70842
|
+
type: "error",
|
|
70843
|
+
children: state.message
|
|
70844
|
+
}, undefined, false, undefined, this);
|
|
70845
|
+
default:
|
|
70846
|
+
return null;
|
|
70847
|
+
}
|
|
70848
|
+
};
|
|
70849
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(jsx_dev_runtime23.Fragment, {
|
|
70850
|
+
children: [
|
|
70851
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Spinner2, {
|
|
70852
|
+
text: "Loading..."
|
|
70853
|
+
}, undefined, false, undefined, this),
|
|
70854
|
+
state.phase === "confirming" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(ConfirmPrompt, {
|
|
69965
70855
|
skill: state.skill,
|
|
69966
70856
|
onConfirm: handleConfirm,
|
|
69967
70857
|
onCancel: handleCancel
|
|
69968
|
-
}, undefined, false, undefined, this)
|
|
69969
|
-
|
|
69970
|
-
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Spinner2, {
|
|
70858
|
+
}, undefined, false, undefined, this),
|
|
70859
|
+
state.phase === "uninstalling" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Spinner2, {
|
|
69971
70860
|
text: `Uninstalling ${state.skill.name}...`
|
|
69972
|
-
}, undefined, false, undefined, this)
|
|
69973
|
-
|
|
69974
|
-
|
|
69975
|
-
|
|
69976
|
-
|
|
69977
|
-
|
|
69978
|
-
|
|
69979
|
-
|
|
69980
|
-
|
|
69981
|
-
|
|
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
|
-
}
|
|
70861
|
+
}, undefined, false, undefined, this),
|
|
70862
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Static, {
|
|
70863
|
+
items: outputItems,
|
|
70864
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70865
|
+
flexDirection: "column",
|
|
70866
|
+
children: renderContent()
|
|
70867
|
+
}, item.id, false, undefined, this)
|
|
70868
|
+
}, undefined, false, undefined, this)
|
|
70869
|
+
]
|
|
70870
|
+
}, undefined, true, undefined, this);
|
|
69993
70871
|
}
|
|
69994
70872
|
|
|
69995
70873
|
// src/commands/upgrade.tsx
|
|
69996
70874
|
import { mkdir as mkdir2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
|
|
69997
70875
|
import { join as join4 } from "node:path";
|
|
69998
|
-
var
|
|
69999
|
-
var
|
|
70876
|
+
var import_react47 = __toESM(require_react(), 1);
|
|
70877
|
+
var jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70000
70878
|
var args10 = exports_external.tuple([
|
|
70001
70879
|
exports_external.string().optional().describe("Skill name to upgrade (optional, upgrades all if omitted)")
|
|
70002
70880
|
]);
|
|
70003
|
-
var
|
|
70004
|
-
function
|
|
70881
|
+
var options17 = exports_external.object({});
|
|
70882
|
+
function parseFrontmatter6(content) {
|
|
70005
70883
|
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
70006
70884
|
if (!frontmatterMatch)
|
|
70007
70885
|
return {};
|
|
@@ -70047,7 +70925,7 @@ async function checkForUpdate2(token, skill, repoConfig) {
|
|
|
70047
70925
|
let latestVersion = skill.version;
|
|
70048
70926
|
if (skillResponse.ok) {
|
|
70049
70927
|
const content = await skillResponse.text();
|
|
70050
|
-
const frontmatter =
|
|
70928
|
+
const frontmatter = parseFrontmatter6(content);
|
|
70051
70929
|
if (frontmatter.version) {
|
|
70052
70930
|
latestVersion = String(frontmatter.version);
|
|
70053
70931
|
}
|
|
@@ -70109,8 +70987,9 @@ async function downloadSkillFiles2(token, repo, skillPath, branch, targetDir) {
|
|
|
70109
70987
|
}
|
|
70110
70988
|
function Upgrade({ args: [skillName] }) {
|
|
70111
70989
|
const { exit } = use_app_default();
|
|
70112
|
-
const [state, setState] =
|
|
70113
|
-
|
|
70990
|
+
const [state, setState] = import_react47.useState({ phase: "checking" });
|
|
70991
|
+
const [outputItems, setOutputItems] = import_react47.useState([]);
|
|
70992
|
+
import_react47.useEffect(() => {
|
|
70114
70993
|
async function upgrade() {
|
|
70115
70994
|
const config2 = getConfig();
|
|
70116
70995
|
let skillsToCheck = [];
|
|
@@ -70118,7 +70997,6 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70118
70997
|
const skill = config2.installed.find((s) => s.name.toLowerCase() === skillName.toLowerCase());
|
|
70119
70998
|
if (!skill) {
|
|
70120
70999
|
setState({ phase: "not_found", skillName });
|
|
70121
|
-
exit();
|
|
70122
71000
|
return;
|
|
70123
71001
|
}
|
|
70124
71002
|
skillsToCheck = [skill];
|
|
@@ -70127,7 +71005,6 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70127
71005
|
}
|
|
70128
71006
|
if (skillsToCheck.length === 0) {
|
|
70129
71007
|
setState({ phase: "no_updates" });
|
|
70130
|
-
exit();
|
|
70131
71008
|
return;
|
|
70132
71009
|
}
|
|
70133
71010
|
const credentials = await getCredentials();
|
|
@@ -70146,7 +71023,6 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70146
71023
|
const result = await checkForUpdate2(token, skill, repoConfig);
|
|
70147
71024
|
if (result && "authRequired" in result) {
|
|
70148
71025
|
setState({ phase: "auth_required", message: result.message });
|
|
70149
|
-
exit();
|
|
70150
71026
|
return;
|
|
70151
71027
|
}
|
|
70152
71028
|
if (result) {
|
|
@@ -70155,7 +71031,6 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70155
71031
|
}
|
|
70156
71032
|
if (upgrades.length === 0) {
|
|
70157
71033
|
setState({ phase: "no_updates" });
|
|
70158
|
-
exit();
|
|
70159
71034
|
return;
|
|
70160
71035
|
}
|
|
70161
71036
|
const upgraded = [];
|
|
@@ -70177,7 +71052,6 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70177
71052
|
phase: "auth_required",
|
|
70178
71053
|
message: downloadResult.message
|
|
70179
71054
|
});
|
|
70180
|
-
exit();
|
|
70181
71055
|
return;
|
|
70182
71056
|
}
|
|
70183
71057
|
const updatedSkill = {
|
|
@@ -70194,95 +71068,135 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70194
71068
|
} else {
|
|
70195
71069
|
setState({ phase: "error", message: "All upgrades failed" });
|
|
70196
71070
|
}
|
|
70197
|
-
exit();
|
|
70198
71071
|
}
|
|
70199
71072
|
upgrade().catch((err) => {
|
|
70200
71073
|
setState({
|
|
70201
71074
|
phase: "error",
|
|
70202
71075
|
message: err instanceof Error ? err.message : "Upgrade failed"
|
|
70203
71076
|
});
|
|
70204
|
-
exit();
|
|
70205
71077
|
});
|
|
70206
|
-
}, [skillName
|
|
70207
|
-
|
|
70208
|
-
|
|
70209
|
-
|
|
70210
|
-
|
|
70211
|
-
|
|
70212
|
-
|
|
70213
|
-
|
|
70214
|
-
|
|
70215
|
-
|
|
70216
|
-
|
|
70217
|
-
|
|
70218
|
-
|
|
70219
|
-
|
|
70220
|
-
|
|
70221
|
-
|
|
70222
|
-
|
|
70223
|
-
|
|
70224
|
-
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
71078
|
+
}, [skillName]);
|
|
71079
|
+
import_react47.useEffect(() => {
|
|
71080
|
+
const isFinalState = state.phase === "not_found" || state.phase === "no_updates" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
|
|
71081
|
+
if (isFinalState && outputItems.length === 0) {
|
|
71082
|
+
setOutputItems([{ id: "output" }]);
|
|
71083
|
+
}
|
|
71084
|
+
}, [state.phase, outputItems.length]);
|
|
71085
|
+
import_react47.useEffect(() => {
|
|
71086
|
+
if (outputItems.length > 0) {
|
|
71087
|
+
process.nextTick(() => exit());
|
|
71088
|
+
}
|
|
71089
|
+
}, [outputItems.length, exit]);
|
|
71090
|
+
const renderContent = () => {
|
|
71091
|
+
switch (state.phase) {
|
|
71092
|
+
case "auth_required":
|
|
71093
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
71094
|
+
flexDirection: "column",
|
|
71095
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
70225
71096
|
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)
|
|
71097
|
+
children: state.message
|
|
70238
71098
|
}, undefined, false, undefined, this)
|
|
70239
|
-
|
|
70240
|
-
|
|
70241
|
-
|
|
70242
|
-
|
|
71099
|
+
}, undefined, false, undefined, this);
|
|
71100
|
+
case "not_found":
|
|
71101
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
71102
|
+
flexDirection: "column",
|
|
71103
|
+
children: [
|
|
71104
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
71105
|
+
type: "error",
|
|
71106
|
+
children: [
|
|
71107
|
+
'Skill "',
|
|
71108
|
+
state.skillName,
|
|
71109
|
+
'" is not installed'
|
|
71110
|
+
]
|
|
71111
|
+
}, undefined, true, undefined, this),
|
|
71112
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
71113
|
+
marginTop: 1,
|
|
71114
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
71115
|
+
dimColor: true,
|
|
71116
|
+
children: "Run 'skilluse list' to see installed skills."
|
|
71117
|
+
}, undefined, false, undefined, this)
|
|
71118
|
+
}, undefined, false, undefined, this)
|
|
71119
|
+
]
|
|
71120
|
+
}, undefined, true, undefined, this);
|
|
71121
|
+
case "no_updates":
|
|
71122
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
71123
|
+
type: "success",
|
|
71124
|
+
children: "All skills are up to date"
|
|
71125
|
+
}, undefined, false, undefined, this);
|
|
71126
|
+
case "success":
|
|
71127
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
71128
|
+
flexDirection: "column",
|
|
71129
|
+
children: [
|
|
71130
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
71131
|
+
type: "success",
|
|
71132
|
+
children: [
|
|
71133
|
+
"Upgraded ",
|
|
71134
|
+
state.upgraded.length,
|
|
71135
|
+
" skill(s)"
|
|
71136
|
+
]
|
|
71137
|
+
}, undefined, true, undefined, this),
|
|
71138
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
71139
|
+
flexDirection: "column",
|
|
71140
|
+
marginLeft: 2,
|
|
71141
|
+
children: state.upgraded.map((name) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
71142
|
+
dimColor: true,
|
|
71143
|
+
children: name
|
|
71144
|
+
}, name, false, undefined, this))
|
|
71145
|
+
}, undefined, false, undefined, this)
|
|
71146
|
+
]
|
|
71147
|
+
}, undefined, true, undefined, this);
|
|
71148
|
+
case "error":
|
|
71149
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
71150
|
+
type: "error",
|
|
71151
|
+
children: state.message
|
|
71152
|
+
}, undefined, false, undefined, this);
|
|
71153
|
+
default:
|
|
71154
|
+
return null;
|
|
71155
|
+
}
|
|
71156
|
+
};
|
|
71157
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
|
|
71158
|
+
children: [
|
|
71159
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Spinner2, {
|
|
71160
|
+
text: "Initializing..."
|
|
71161
|
+
}, undefined, false, undefined, this),
|
|
71162
|
+
state.phase === "checking_updates" && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Spinner2, {
|
|
70243
71163
|
text: `Checking for updates (${state.current}/${state.total})...`
|
|
70244
|
-
}, undefined, false, undefined, this)
|
|
70245
|
-
|
|
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, {
|
|
71164
|
+
}, undefined, false, undefined, this),
|
|
71165
|
+
state.phase === "upgrading" && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70252
71166
|
flexDirection: "column",
|
|
70253
71167
|
children: [
|
|
70254
|
-
/* @__PURE__ */
|
|
71168
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70255
71169
|
marginBottom: 1,
|
|
70256
|
-
children: /* @__PURE__ */
|
|
71170
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70257
71171
|
bold: true,
|
|
70258
71172
|
children: "Upgrading skills..."
|
|
70259
71173
|
}, undefined, false, undefined, this)
|
|
70260
71174
|
}, undefined, false, undefined, this),
|
|
70261
|
-
state.upgrades.map((upgrade, i) => /* @__PURE__ */
|
|
71175
|
+
state.upgrades.map((upgrade, i) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70262
71176
|
children: [
|
|
70263
|
-
/* @__PURE__ */
|
|
71177
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70264
71178
|
children: [
|
|
70265
|
-
i < state.current && /* @__PURE__ */
|
|
71179
|
+
i < state.current && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70266
71180
|
color: "green",
|
|
70267
71181
|
children: "✔"
|
|
70268
71182
|
}, undefined, false, undefined, this),
|
|
70269
|
-
i === state.current && /* @__PURE__ */
|
|
71183
|
+
i === state.current && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70270
71184
|
color: "yellow",
|
|
70271
71185
|
children: "◐"
|
|
70272
71186
|
}, undefined, false, undefined, this),
|
|
70273
|
-
i > state.current && /* @__PURE__ */
|
|
71187
|
+
i > state.current && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70274
71188
|
dimColor: true,
|
|
70275
71189
|
children: "○"
|
|
70276
71190
|
}, undefined, false, undefined, this)
|
|
70277
71191
|
]
|
|
70278
71192
|
}, undefined, true, undefined, this),
|
|
70279
|
-
/* @__PURE__ */
|
|
71193
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70280
71194
|
children: [
|
|
70281
71195
|
" ",
|
|
70282
71196
|
upgrade.skill.name
|
|
70283
71197
|
]
|
|
70284
71198
|
}, undefined, true, undefined, this),
|
|
70285
|
-
/* @__PURE__ */
|
|
71199
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70286
71200
|
dimColor: true,
|
|
70287
71201
|
children: [
|
|
70288
71202
|
" ",
|
|
@@ -70294,48 +71208,29 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70294
71208
|
}, undefined, true, undefined, this)
|
|
70295
71209
|
]
|
|
70296
71210
|
}, upgrade.skill.name, true, undefined, this)),
|
|
70297
|
-
/* @__PURE__ */
|
|
71211
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70298
71212
|
marginTop: 1,
|
|
70299
|
-
children: /* @__PURE__ */
|
|
71213
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(ProgressBar, {
|
|
70300
71214
|
percent: state.progress,
|
|
70301
71215
|
width: 30
|
|
70302
71216
|
}, undefined, false, undefined, this)
|
|
70303
71217
|
}, undefined, false, undefined, this)
|
|
70304
71218
|
]
|
|
70305
|
-
}, undefined, true, undefined, this)
|
|
70306
|
-
|
|
70307
|
-
|
|
70308
|
-
|
|
70309
|
-
|
|
70310
|
-
|
|
70311
|
-
|
|
70312
|
-
|
|
70313
|
-
|
|
70314
|
-
|
|
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
|
-
}
|
|
71219
|
+
}, undefined, true, undefined, this),
|
|
71220
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Static, {
|
|
71221
|
+
items: outputItems,
|
|
71222
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
71223
|
+
flexDirection: "column",
|
|
71224
|
+
children: renderContent()
|
|
71225
|
+
}, item.id, false, undefined, this)
|
|
71226
|
+
}, undefined, false, undefined, this)
|
|
71227
|
+
]
|
|
71228
|
+
}, undefined, true, undefined, this);
|
|
70334
71229
|
}
|
|
70335
71230
|
// package.json
|
|
70336
71231
|
var package_default = {
|
|
70337
71232
|
name: "skilluse",
|
|
70338
|
-
version: "0.
|
|
71233
|
+
version: "0.6.0",
|
|
70339
71234
|
description: "CLI tool for managing and installing AI Coding Agent Skills",
|
|
70340
71235
|
main: "dist/cli.js",
|
|
70341
71236
|
bin: {
|
|
@@ -70405,7 +71300,7 @@ var package_default = {
|
|
|
70405
71300
|
};
|
|
70406
71301
|
|
|
70407
71302
|
// src/cli.tsx
|
|
70408
|
-
var
|
|
71303
|
+
var jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70409
71304
|
var VERSION = process.env.VERSION || package_default.version;
|
|
70410
71305
|
var BUILD_TIME = process.env.BUILD_TIME || new Date().toISOString();
|
|
70411
71306
|
var program2 = new Command;
|
|
@@ -70415,106 +71310,116 @@ program2.name("skilluse").description("CLI tool for managing and installing AI C
|
|
|
70415
71310
|
process.exit(0);
|
|
70416
71311
|
});
|
|
70417
71312
|
program2.command("login").description("Authenticate with GitHub").action(() => {
|
|
70418
|
-
render_default(/* @__PURE__ */
|
|
71313
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Login, {
|
|
70419
71314
|
options: {}
|
|
70420
71315
|
}, undefined, false, undefined, this));
|
|
70421
71316
|
});
|
|
70422
71317
|
program2.command("logout").description("Clear stored credentials").action(() => {
|
|
70423
|
-
render_default(/* @__PURE__ */
|
|
71318
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Logout, {
|
|
70424
71319
|
options: {}
|
|
70425
71320
|
}, undefined, false, undefined, this));
|
|
70426
71321
|
});
|
|
70427
|
-
program2.command("list").description("List installed skills").option("-o, --outdated", "Show only outdated skills").
|
|
70428
|
-
const
|
|
70429
|
-
render_default(/* @__PURE__ */
|
|
70430
|
-
options:
|
|
71322
|
+
program2.command("list").description("List installed skills").option("-o, --outdated", "Show only outdated skills").action((opts) => {
|
|
71323
|
+
const options18 = options4.parse(opts);
|
|
71324
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(List, {
|
|
71325
|
+
options: options18
|
|
70431
71326
|
}, undefined, false, undefined, this));
|
|
70432
71327
|
});
|
|
70433
71328
|
program2.command("search <keyword>").description("Search for skills").option("-a, --all", "Search in all configured repos").action((keyword, opts) => {
|
|
70434
71329
|
const args11 = args8.parse([keyword]);
|
|
70435
|
-
const
|
|
70436
|
-
render_default(/* @__PURE__ */
|
|
71330
|
+
const options18 = options15.parse(opts);
|
|
71331
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Search, {
|
|
70437
71332
|
args: args11,
|
|
70438
|
-
options:
|
|
71333
|
+
options: options18
|
|
70439
71334
|
}, undefined, false, undefined, this));
|
|
70440
71335
|
});
|
|
70441
71336
|
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) => {
|
|
70442
71337
|
const args11 = args2.parse([skillName]);
|
|
70443
|
-
const
|
|
70444
|
-
render_default(/* @__PURE__ */
|
|
71338
|
+
const options18 = options3.parse(opts);
|
|
71339
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Install, {
|
|
70445
71340
|
args: args11,
|
|
70446
|
-
options:
|
|
71341
|
+
options: options18
|
|
70447
71342
|
}, undefined, false, undefined, this));
|
|
70448
71343
|
});
|
|
70449
71344
|
program2.command("uninstall <skill-name>").description("Uninstall a skill").option("-f, --force", "Skip confirmation").action((skillName, opts) => {
|
|
70450
71345
|
const args11 = args9.parse([skillName]);
|
|
70451
|
-
const
|
|
70452
|
-
render_default(/* @__PURE__ */
|
|
71346
|
+
const options18 = options16.parse(opts);
|
|
71347
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Uninstall, {
|
|
70453
71348
|
args: args11,
|
|
70454
|
-
options:
|
|
71349
|
+
options: options18
|
|
70455
71350
|
}, undefined, false, undefined, this));
|
|
70456
71351
|
});
|
|
70457
71352
|
program2.command("upgrade [skill-name]").description("Upgrade skill(s) to latest version").action((skillName) => {
|
|
70458
71353
|
const args11 = args10.parse([skillName]);
|
|
70459
|
-
render_default(/* @__PURE__ */
|
|
71354
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Upgrade, {
|
|
70460
71355
|
args: args11,
|
|
70461
71356
|
options: {}
|
|
70462
71357
|
}, undefined, false, undefined, this));
|
|
70463
71358
|
});
|
|
70464
71359
|
program2.command("info <skill-name>").description("Show skill details").action((skillName) => {
|
|
70465
71360
|
const args11 = args.parse([skillName]);
|
|
70466
|
-
render_default(/* @__PURE__ */
|
|
71361
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Info, {
|
|
70467
71362
|
args: args11,
|
|
70468
71363
|
options: {}
|
|
70469
71364
|
}, undefined, false, undefined, this));
|
|
70470
71365
|
});
|
|
70471
71366
|
var repoCmd = program2.command("repo").description("Manage skill repositories");
|
|
70472
71367
|
repoCmd.command("list").description("List configured repositories").action(() => {
|
|
70473
|
-
render_default(/* @__PURE__ */
|
|
71368
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoList, {
|
|
71369
|
+
options: {}
|
|
71370
|
+
}, undefined, false, undefined, this));
|
|
71371
|
+
});
|
|
71372
|
+
repoCmd.command("skills").description("List all skills in current repository").action(() => {
|
|
71373
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoSkills, {
|
|
70474
71374
|
options: {}
|
|
70475
71375
|
}, undefined, false, undefined, this));
|
|
70476
71376
|
});
|
|
70477
71377
|
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) => {
|
|
70478
71378
|
const args11 = args3.parse([url2]);
|
|
70479
|
-
const
|
|
70480
|
-
render_default(/* @__PURE__ */
|
|
71379
|
+
const options18 = options7.parse(opts);
|
|
71380
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoAdd, {
|
|
70481
71381
|
args: args11,
|
|
70482
|
-
options:
|
|
71382
|
+
options: options18
|
|
70483
71383
|
}, undefined, false, undefined, this));
|
|
70484
71384
|
});
|
|
70485
71385
|
repoCmd.command("remove <name>").description("Remove a repository").option("-f, --force", "Skip confirmation").action((name, opts) => {
|
|
70486
71386
|
const args11 = args5.parse([name]);
|
|
70487
|
-
const
|
|
70488
|
-
render_default(/* @__PURE__ */
|
|
71387
|
+
const options18 = options12.parse(opts);
|
|
71388
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoRemove, {
|
|
70489
71389
|
args: args11,
|
|
70490
|
-
options:
|
|
71390
|
+
options: options18
|
|
70491
71391
|
}, undefined, false, undefined, this));
|
|
70492
71392
|
});
|
|
70493
71393
|
repoCmd.command("edit <name>").description("Edit repository settings").option("-p, --path <path>", "New skill path").option("-b, --branch <branch>", "New branch").action((name, opts) => {
|
|
70494
71394
|
const args11 = args4.parse([name]);
|
|
70495
|
-
const
|
|
70496
|
-
render_default(/* @__PURE__ */
|
|
71395
|
+
const options18 = options8.parse(opts);
|
|
71396
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoEdit, {
|
|
70497
71397
|
args: args11,
|
|
70498
|
-
options:
|
|
71398
|
+
options: options18
|
|
70499
71399
|
}, undefined, false, undefined, this));
|
|
70500
71400
|
});
|
|
70501
71401
|
repoCmd.command("use <name>").description("Set default repository").action((name, _opts) => {
|
|
70502
71402
|
const args11 = args6.parse([name]);
|
|
70503
|
-
render_default(/* @__PURE__ */
|
|
71403
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoUse, {
|
|
70504
71404
|
args: args11,
|
|
70505
71405
|
options: {}
|
|
70506
71406
|
}, undefined, false, undefined, this));
|
|
70507
71407
|
});
|
|
70508
71408
|
repoCmd.action(() => {
|
|
70509
|
-
render_default(/* @__PURE__ */
|
|
71409
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Repo, {
|
|
70510
71410
|
options: {}
|
|
70511
71411
|
}, undefined, false, undefined, this));
|
|
70512
71412
|
});
|
|
70513
71413
|
program2.command("agent [agent-id]").description("Switch agent or select interactively").action((agentId) => {
|
|
70514
71414
|
const args11 = args7.parse([agentId]);
|
|
70515
|
-
render_default(/* @__PURE__ */
|
|
71415
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Agent, {
|
|
70516
71416
|
args: args11,
|
|
70517
71417
|
options: {}
|
|
70518
71418
|
}, undefined, false, undefined, this));
|
|
70519
71419
|
});
|
|
71420
|
+
program2.action(() => {
|
|
71421
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Index, {
|
|
71422
|
+
options: {}
|
|
71423
|
+
}, undefined, false, undefined, this));
|
|
71424
|
+
});
|
|
70520
71425
|
program2.parse();
|