skilluse 0.5.0 → 0.7.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 +560 -245
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -64717,7 +64717,8 @@ var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
|
|
|
64717
64717
|
var statusConfig = {
|
|
64718
64718
|
success: { icon: figures_default.tick, color: "green" },
|
|
64719
64719
|
error: { icon: figures_default.cross, color: "red" },
|
|
64720
|
-
warning: { icon: figures_default.warning, color: "yellow" }
|
|
64720
|
+
warning: { icon: figures_default.warning, color: "yellow" },
|
|
64721
|
+
info: { icon: figures_default.info, color: "blue" }
|
|
64721
64722
|
};
|
|
64722
64723
|
function StatusMessage({ type, children }) {
|
|
64723
64724
|
const { icon, color } = statusConfig[type];
|
|
@@ -66511,6 +66512,19 @@ function getSkillsPath(agentId, scope) {
|
|
|
66511
66512
|
return join(process.cwd(), agent.localPath);
|
|
66512
66513
|
}
|
|
66513
66514
|
// src/services/github.ts
|
|
66515
|
+
function parseGitHubRepo(input) {
|
|
66516
|
+
const shortPattern = /^([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+)$/;
|
|
66517
|
+
const urlPattern = /^https:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+)\/?$/;
|
|
66518
|
+
let match = input.match(shortPattern);
|
|
66519
|
+
if (match) {
|
|
66520
|
+
return { owner: match[1], repo: match[2] };
|
|
66521
|
+
}
|
|
66522
|
+
match = input.match(urlPattern);
|
|
66523
|
+
if (match) {
|
|
66524
|
+
return { owner: match[1], repo: match[2] };
|
|
66525
|
+
}
|
|
66526
|
+
return null;
|
|
66527
|
+
}
|
|
66514
66528
|
function buildGitHubHeaders(token) {
|
|
66515
66529
|
const headers = {
|
|
66516
66530
|
Accept: "application/vnd.github+json",
|
|
@@ -68775,7 +68789,7 @@ function Logout(_props) {
|
|
|
68775
68789
|
var import_react37 = __toESM(require_react(), 1);
|
|
68776
68790
|
var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68777
68791
|
var args3 = exports_external.tuple([
|
|
68778
|
-
exports_external.string().describe("Repository
|
|
68792
|
+
exports_external.string().describe("Repository (owner/repo or https://github.com/owner/repo)")
|
|
68779
68793
|
]);
|
|
68780
68794
|
var options7 = exports_external.object({
|
|
68781
68795
|
path: exports_external.string().optional().describe("Skill path within the repo (e.g., skills/)"),
|
|
@@ -68785,6 +68799,8 @@ var options7 = exports_external.object({
|
|
|
68785
68799
|
function RepoAdd({ args: [repoArg], options: opts }) {
|
|
68786
68800
|
const { exit } = use_app_default();
|
|
68787
68801
|
const [state, setState] = import_react37.useState({ phase: "checking" });
|
|
68802
|
+
const parsed = import_react37.useMemo(() => parseGitHubRepo(repoArg), [repoArg]);
|
|
68803
|
+
const repoIdentifier = parsed ? `${parsed.owner}/${parsed.repo}` : null;
|
|
68788
68804
|
import_react37.useEffect(() => {
|
|
68789
68805
|
if (state.phase === "invalid_repo" || state.phase === "already_exists" || state.phase === "auth_required" || state.phase === "error" || state.phase === "success") {
|
|
68790
68806
|
exit();
|
|
@@ -68792,51 +68808,50 @@ function RepoAdd({ args: [repoArg], options: opts }) {
|
|
|
68792
68808
|
}, [state.phase, exit]);
|
|
68793
68809
|
import_react37.useEffect(() => {
|
|
68794
68810
|
async function checkAndAdd() {
|
|
68795
|
-
if (!
|
|
68811
|
+
if (!parsed || !repoIdentifier) {
|
|
68796
68812
|
setState({ phase: "invalid_repo" });
|
|
68797
68813
|
return;
|
|
68798
68814
|
}
|
|
68799
68815
|
const config2 = getConfig();
|
|
68800
|
-
if (config2.repos.find((r) => r.repo ===
|
|
68801
|
-
setState({ phase: "already_exists", repo:
|
|
68816
|
+
if (config2.repos.find((r) => r.repo === repoIdentifier)) {
|
|
68817
|
+
setState({ phase: "already_exists", repo: repoIdentifier });
|
|
68802
68818
|
return;
|
|
68803
68819
|
}
|
|
68804
68820
|
if (opts.path !== undefined) {
|
|
68805
|
-
setState({ phase: "saving", repo:
|
|
68821
|
+
setState({ phase: "saving", repo: repoIdentifier });
|
|
68806
68822
|
const paths2 = opts.path ? [opts.path] : [];
|
|
68807
68823
|
addRepo({
|
|
68808
|
-
repo:
|
|
68824
|
+
repo: repoIdentifier,
|
|
68809
68825
|
branch: opts.branch,
|
|
68810
68826
|
paths: paths2
|
|
68811
68827
|
});
|
|
68812
68828
|
const isDefault = opts.default || config2.repos.length === 0;
|
|
68813
68829
|
if (isDefault) {
|
|
68814
|
-
setDefaultRepo(
|
|
68830
|
+
setDefaultRepo(repoIdentifier);
|
|
68815
68831
|
}
|
|
68816
68832
|
setState({
|
|
68817
68833
|
phase: "success",
|
|
68818
|
-
repo:
|
|
68834
|
+
repo: repoIdentifier,
|
|
68819
68835
|
paths: paths2.length > 0 ? paths2 : ["(all paths)"],
|
|
68820
68836
|
isDefault
|
|
68821
68837
|
});
|
|
68822
68838
|
return;
|
|
68823
68839
|
}
|
|
68824
|
-
setState({ phase: "discovering", repo:
|
|
68840
|
+
setState({ phase: "discovering", repo: repoIdentifier });
|
|
68825
68841
|
try {
|
|
68826
68842
|
const credentials = await getCredentials();
|
|
68827
68843
|
const token = credentials?.token;
|
|
68828
|
-
const
|
|
68829
|
-
const result = await discoverSkillPaths(owner, repo, opts.branch, token);
|
|
68844
|
+
const result = await discoverSkillPaths(parsed.owner, parsed.repo, opts.branch, token);
|
|
68830
68845
|
if ("authRequired" in result) {
|
|
68831
68846
|
setState({ phase: "auth_required", message: result.message });
|
|
68832
68847
|
return;
|
|
68833
68848
|
}
|
|
68834
68849
|
if (result.totalSkills === 0) {
|
|
68835
|
-
setState({ phase: "no_skills_found", repo:
|
|
68850
|
+
setState({ phase: "no_skills_found", repo: repoIdentifier });
|
|
68836
68851
|
} else {
|
|
68837
68852
|
setState({
|
|
68838
68853
|
phase: "select_paths",
|
|
68839
|
-
repo:
|
|
68854
|
+
repo: repoIdentifier,
|
|
68840
68855
|
discovery: result
|
|
68841
68856
|
});
|
|
68842
68857
|
}
|
|
@@ -68846,44 +68861,48 @@ function RepoAdd({ args: [repoArg], options: opts }) {
|
|
|
68846
68861
|
}
|
|
68847
68862
|
}
|
|
68848
68863
|
checkAndAdd();
|
|
68849
|
-
}, [
|
|
68864
|
+
}, [parsed, repoIdentifier, opts.path, opts.branch, opts.default]);
|
|
68850
68865
|
const handlePathsSelected = (selectedPaths) => {
|
|
68866
|
+
if (!repoIdentifier)
|
|
68867
|
+
return;
|
|
68851
68868
|
const config2 = getConfig();
|
|
68852
68869
|
addRepo({
|
|
68853
|
-
repo:
|
|
68870
|
+
repo: repoIdentifier,
|
|
68854
68871
|
branch: opts.branch,
|
|
68855
68872
|
paths: selectedPaths
|
|
68856
68873
|
});
|
|
68857
68874
|
const isDefault = opts.default || config2.repos.length === 0;
|
|
68858
68875
|
if (isDefault) {
|
|
68859
|
-
setDefaultRepo(
|
|
68876
|
+
setDefaultRepo(repoIdentifier);
|
|
68860
68877
|
}
|
|
68861
68878
|
setState({
|
|
68862
68879
|
phase: "success",
|
|
68863
|
-
repo:
|
|
68880
|
+
repo: repoIdentifier,
|
|
68864
68881
|
paths: selectedPaths.length > 0 ? selectedPaths : ["(all paths)"],
|
|
68865
68882
|
isDefault
|
|
68866
68883
|
});
|
|
68867
68884
|
};
|
|
68868
68885
|
const handleNoSkillsOption = (option) => {
|
|
68886
|
+
if (!repoIdentifier)
|
|
68887
|
+
return;
|
|
68869
68888
|
const config2 = getConfig();
|
|
68870
68889
|
switch (option.value) {
|
|
68871
68890
|
case "manual":
|
|
68872
|
-
setState({ phase: "input_path", repo:
|
|
68891
|
+
setState({ phase: "input_path", repo: repoIdentifier, currentPath: "" });
|
|
68873
68892
|
break;
|
|
68874
68893
|
case "add_all": {
|
|
68875
68894
|
addRepo({
|
|
68876
|
-
repo:
|
|
68895
|
+
repo: repoIdentifier,
|
|
68877
68896
|
branch: opts.branch,
|
|
68878
68897
|
paths: []
|
|
68879
68898
|
});
|
|
68880
68899
|
const isDefault = opts.default || config2.repos.length === 0;
|
|
68881
68900
|
if (isDefault) {
|
|
68882
|
-
setDefaultRepo(
|
|
68901
|
+
setDefaultRepo(repoIdentifier);
|
|
68883
68902
|
}
|
|
68884
68903
|
setState({
|
|
68885
68904
|
phase: "success",
|
|
68886
|
-
repo:
|
|
68905
|
+
repo: repoIdentifier,
|
|
68887
68906
|
paths: ["(all paths)"],
|
|
68888
68907
|
isDefault
|
|
68889
68908
|
});
|
|
@@ -68895,23 +68914,23 @@ function RepoAdd({ args: [repoArg], options: opts }) {
|
|
|
68895
68914
|
}
|
|
68896
68915
|
};
|
|
68897
68916
|
use_input_default((input, key) => {
|
|
68898
|
-
if (state.phase !== "input_path")
|
|
68917
|
+
if (state.phase !== "input_path" || !repoIdentifier)
|
|
68899
68918
|
return;
|
|
68900
68919
|
if (key.return) {
|
|
68901
68920
|
const config2 = getConfig();
|
|
68902
68921
|
const paths2 = state.currentPath ? [state.currentPath] : [];
|
|
68903
68922
|
addRepo({
|
|
68904
|
-
repo:
|
|
68923
|
+
repo: repoIdentifier,
|
|
68905
68924
|
branch: opts.branch,
|
|
68906
68925
|
paths: paths2
|
|
68907
68926
|
});
|
|
68908
68927
|
const isDefault = opts.default || config2.repos.length === 0;
|
|
68909
68928
|
if (isDefault) {
|
|
68910
|
-
setDefaultRepo(
|
|
68929
|
+
setDefaultRepo(repoIdentifier);
|
|
68911
68930
|
}
|
|
68912
68931
|
setState({
|
|
68913
68932
|
phase: "success",
|
|
68914
|
-
repo:
|
|
68933
|
+
repo: repoIdentifier,
|
|
68915
68934
|
paths: paths2.length > 0 ? paths2 : ["(all paths)"],
|
|
68916
68935
|
isDefault
|
|
68917
68936
|
});
|
|
@@ -68992,7 +69011,15 @@ function RepoAdd({ args: [repoArg], options: opts }) {
|
|
|
68992
69011
|
}, undefined, false, undefined, this),
|
|
68993
69012
|
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
68994
69013
|
dimColor: true,
|
|
68995
|
-
children: "
|
|
69014
|
+
children: "Accepted formats:"
|
|
69015
|
+
}, undefined, false, undefined, this),
|
|
69016
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
69017
|
+
dimColor: true,
|
|
69018
|
+
children: " - owner/repo"
|
|
69019
|
+
}, undefined, false, undefined, this),
|
|
69020
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
69021
|
+
dimColor: true,
|
|
69022
|
+
children: " - https://github.com/owner/repo"
|
|
68996
69023
|
}, undefined, false, undefined, this)
|
|
68997
69024
|
]
|
|
68998
69025
|
}, undefined, true, undefined, this);
|
|
@@ -69001,19 +69028,22 @@ function RepoAdd({ args: [repoArg], options: opts }) {
|
|
|
69001
69028
|
flexDirection: "column",
|
|
69002
69029
|
children: [
|
|
69003
69030
|
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(StatusMessage, {
|
|
69004
|
-
type: "
|
|
69031
|
+
type: "info",
|
|
69005
69032
|
children: [
|
|
69006
69033
|
"Repository ",
|
|
69007
69034
|
state.repo,
|
|
69008
69035
|
" is already configured"
|
|
69009
69036
|
]
|
|
69010
69037
|
}, undefined, true, undefined, this),
|
|
69038
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
69039
|
+
dimColor: true,
|
|
69040
|
+
children: "To set it as default skills registry:"
|
|
69041
|
+
}, undefined, false, undefined, this),
|
|
69011
69042
|
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
69012
69043
|
dimColor: true,
|
|
69013
69044
|
children: [
|
|
69014
|
-
"
|
|
69015
|
-
state.repo
|
|
69016
|
-
"' to modify it."
|
|
69045
|
+
" skilluse repo use ",
|
|
69046
|
+
state.repo
|
|
69017
69047
|
]
|
|
69018
69048
|
}, undefined, true, undefined, this)
|
|
69019
69049
|
]
|
|
@@ -69694,20 +69724,300 @@ function RepoList(_props) {
|
|
|
69694
69724
|
}, undefined, true, undefined, this);
|
|
69695
69725
|
}
|
|
69696
69726
|
|
|
69697
|
-
// src/commands/repo/
|
|
69727
|
+
// src/commands/repo/skills.tsx
|
|
69698
69728
|
var import_react41 = __toESM(require_react(), 1);
|
|
69699
69729
|
var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69730
|
+
var options11 = exports_external.object({});
|
|
69731
|
+
function parseFrontmatter4(content) {
|
|
69732
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
69733
|
+
if (!frontmatterMatch) {
|
|
69734
|
+
return {};
|
|
69735
|
+
}
|
|
69736
|
+
const yaml = frontmatterMatch[1];
|
|
69737
|
+
const result = {};
|
|
69738
|
+
for (const line of yaml.split(`
|
|
69739
|
+
`)) {
|
|
69740
|
+
const colonIndex = line.indexOf(":");
|
|
69741
|
+
if (colonIndex === -1)
|
|
69742
|
+
continue;
|
|
69743
|
+
const key = line.substring(0, colonIndex).trim();
|
|
69744
|
+
let value = line.substring(colonIndex + 1).trim();
|
|
69745
|
+
if (typeof value === "string" && value.startsWith("[") && value.endsWith("]")) {
|
|
69746
|
+
value = value.slice(1, -1).split(",").map((s) => s.trim());
|
|
69747
|
+
}
|
|
69748
|
+
if (key) {
|
|
69749
|
+
result[key] = value;
|
|
69750
|
+
}
|
|
69751
|
+
}
|
|
69752
|
+
return result;
|
|
69753
|
+
}
|
|
69754
|
+
async function fetchSkillsFromRepo(token, repoConfig, installedSkillNames) {
|
|
69755
|
+
const { repo, branch, paths: paths2 } = repoConfig;
|
|
69756
|
+
const skills = [];
|
|
69757
|
+
const searchPaths = paths2.length > 0 ? paths2 : [""];
|
|
69758
|
+
for (const basePath of searchPaths) {
|
|
69759
|
+
try {
|
|
69760
|
+
const apiPath = basePath ? `https://api.github.com/repos/${repo}/contents/${basePath}?ref=${branch}` : `https://api.github.com/repos/${repo}/contents?ref=${branch}`;
|
|
69761
|
+
const response = await fetch(apiPath, {
|
|
69762
|
+
headers: buildGitHubHeaders(token)
|
|
69763
|
+
});
|
|
69764
|
+
if (!response.ok) {
|
|
69765
|
+
if (isAuthRequired(response)) {
|
|
69766
|
+
return {
|
|
69767
|
+
authRequired: true,
|
|
69768
|
+
message: getGitHubErrorMessage(response)
|
|
69769
|
+
};
|
|
69770
|
+
}
|
|
69771
|
+
continue;
|
|
69772
|
+
}
|
|
69773
|
+
const contents = await response.json();
|
|
69774
|
+
const dirs = contents.filter((item) => item.type === "dir");
|
|
69775
|
+
for (const dir of dirs) {
|
|
69776
|
+
const skillMdUrl = `https://api.github.com/repos/${repo}/contents/${dir.path}/SKILL.md?ref=${branch}`;
|
|
69777
|
+
const skillResponse = await fetch(skillMdUrl, {
|
|
69778
|
+
headers: buildGitHubRawHeaders(token)
|
|
69779
|
+
});
|
|
69780
|
+
if (skillResponse.ok) {
|
|
69781
|
+
const content = await skillResponse.text();
|
|
69782
|
+
const frontmatter = parseFrontmatter4(content);
|
|
69783
|
+
if (frontmatter.name) {
|
|
69784
|
+
const skillName = String(frontmatter.name);
|
|
69785
|
+
skills.push({
|
|
69786
|
+
name: skillName,
|
|
69787
|
+
description: String(frontmatter.description || ""),
|
|
69788
|
+
type: frontmatter.type ? String(frontmatter.type) : undefined,
|
|
69789
|
+
version: frontmatter.version ? String(frontmatter.version) : undefined,
|
|
69790
|
+
repo,
|
|
69791
|
+
path: dir.path,
|
|
69792
|
+
installed: installedSkillNames.has(skillName)
|
|
69793
|
+
});
|
|
69794
|
+
}
|
|
69795
|
+
}
|
|
69796
|
+
}
|
|
69797
|
+
} catch {}
|
|
69798
|
+
}
|
|
69799
|
+
skills.sort((a, b) => {
|
|
69800
|
+
if (a.installed !== b.installed) {
|
|
69801
|
+
return a.installed ? -1 : 1;
|
|
69802
|
+
}
|
|
69803
|
+
return a.name.localeCompare(b.name);
|
|
69804
|
+
});
|
|
69805
|
+
return skills;
|
|
69806
|
+
}
|
|
69807
|
+
function RepoSkills(_props) {
|
|
69808
|
+
const { exit } = use_app_default();
|
|
69809
|
+
const [state, setState] = import_react41.useState({ phase: "checking" });
|
|
69810
|
+
const [outputItems, setOutputItems] = import_react41.useState([]);
|
|
69811
|
+
import_react41.useEffect(() => {
|
|
69812
|
+
async function loadSkills() {
|
|
69813
|
+
const config2 = getConfig();
|
|
69814
|
+
const currentAgent = getCurrentAgent();
|
|
69815
|
+
let repoConfig;
|
|
69816
|
+
if (config2.defaultRepo) {
|
|
69817
|
+
repoConfig = config2.repos.find((r) => r.repo === config2.defaultRepo);
|
|
69818
|
+
} else if (config2.repos.length > 0) {
|
|
69819
|
+
repoConfig = config2.repos[0];
|
|
69820
|
+
}
|
|
69821
|
+
if (!repoConfig) {
|
|
69822
|
+
setState({ phase: "no_repos" });
|
|
69823
|
+
return;
|
|
69824
|
+
}
|
|
69825
|
+
setState({ phase: "fetching", repo: repoConfig.repo });
|
|
69826
|
+
const installedSkillNames = new Set(config2.installed.filter((s) => s.agent === currentAgent || !s.agent).map((s) => s.name));
|
|
69827
|
+
const credentials = await getCredentials();
|
|
69828
|
+
const token = credentials?.token;
|
|
69829
|
+
const result = await fetchSkillsFromRepo(token, repoConfig, installedSkillNames);
|
|
69830
|
+
if ("authRequired" in result) {
|
|
69831
|
+
setState({ phase: "auth_required", message: result.message });
|
|
69832
|
+
return;
|
|
69833
|
+
}
|
|
69834
|
+
setState({
|
|
69835
|
+
phase: "success",
|
|
69836
|
+
skills: result,
|
|
69837
|
+
repoName: repoConfig.repo
|
|
69838
|
+
});
|
|
69839
|
+
}
|
|
69840
|
+
loadSkills().catch((err) => {
|
|
69841
|
+
setState({
|
|
69842
|
+
phase: "error",
|
|
69843
|
+
message: err instanceof Error ? err.message : "Failed to load skills"
|
|
69844
|
+
});
|
|
69845
|
+
});
|
|
69846
|
+
}, []);
|
|
69847
|
+
import_react41.useEffect(() => {
|
|
69848
|
+
const isFinalState = state.phase === "no_repos" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
|
|
69849
|
+
if (isFinalState && outputItems.length === 0) {
|
|
69850
|
+
setOutputItems([{ id: "output" }]);
|
|
69851
|
+
}
|
|
69852
|
+
}, [state.phase, outputItems.length]);
|
|
69853
|
+
import_react41.useEffect(() => {
|
|
69854
|
+
if (outputItems.length > 0) {
|
|
69855
|
+
process.nextTick(() => exit());
|
|
69856
|
+
}
|
|
69857
|
+
}, [outputItems.length, exit]);
|
|
69858
|
+
const renderContent = () => {
|
|
69859
|
+
switch (state.phase) {
|
|
69860
|
+
case "auth_required":
|
|
69861
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69862
|
+
type: "error",
|
|
69863
|
+
children: state.message
|
|
69864
|
+
}, undefined, false, undefined, this);
|
|
69865
|
+
case "no_repos":
|
|
69866
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69867
|
+
flexDirection: "column",
|
|
69868
|
+
children: [
|
|
69869
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69870
|
+
type: "warning",
|
|
69871
|
+
children: "No repositories configured"
|
|
69872
|
+
}, undefined, false, undefined, this),
|
|
69873
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69874
|
+
dimColor: true,
|
|
69875
|
+
children: "Run 'skilluse repo add owner/repo' to add a skill repository."
|
|
69876
|
+
}, undefined, false, undefined, this)
|
|
69877
|
+
]
|
|
69878
|
+
}, undefined, true, undefined, this);
|
|
69879
|
+
case "success": {
|
|
69880
|
+
const installedCount = state.skills.filter((s) => s.installed).length;
|
|
69881
|
+
if (state.skills.length === 0) {
|
|
69882
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69883
|
+
flexDirection: "column",
|
|
69884
|
+
children: [
|
|
69885
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69886
|
+
marginBottom: 1,
|
|
69887
|
+
children: [
|
|
69888
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69889
|
+
bold: true,
|
|
69890
|
+
children: "Skills in "
|
|
69891
|
+
}, undefined, false, undefined, this),
|
|
69892
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69893
|
+
color: "cyan",
|
|
69894
|
+
children: state.repoName
|
|
69895
|
+
}, undefined, false, undefined, this)
|
|
69896
|
+
]
|
|
69897
|
+
}, undefined, true, undefined, this),
|
|
69898
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69899
|
+
type: "warning",
|
|
69900
|
+
children: "No skills found"
|
|
69901
|
+
}, undefined, false, undefined, this)
|
|
69902
|
+
]
|
|
69903
|
+
}, undefined, true, undefined, this);
|
|
69904
|
+
}
|
|
69905
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69906
|
+
flexDirection: "column",
|
|
69907
|
+
children: [
|
|
69908
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69909
|
+
marginBottom: 1,
|
|
69910
|
+
children: [
|
|
69911
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69912
|
+
bold: true,
|
|
69913
|
+
children: "Skills in "
|
|
69914
|
+
}, undefined, false, undefined, this),
|
|
69915
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69916
|
+
color: "cyan",
|
|
69917
|
+
children: state.repoName
|
|
69918
|
+
}, undefined, false, undefined, this),
|
|
69919
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69920
|
+
dimColor: true,
|
|
69921
|
+
children: [
|
|
69922
|
+
" ",
|
|
69923
|
+
"(",
|
|
69924
|
+
installedCount,
|
|
69925
|
+
"/",
|
|
69926
|
+
state.skills.length,
|
|
69927
|
+
" installed)"
|
|
69928
|
+
]
|
|
69929
|
+
}, undefined, true, undefined, this)
|
|
69930
|
+
]
|
|
69931
|
+
}, undefined, true, undefined, this),
|
|
69932
|
+
state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69933
|
+
flexDirection: "column",
|
|
69934
|
+
marginBottom: 1,
|
|
69935
|
+
children: [
|
|
69936
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69937
|
+
children: [
|
|
69938
|
+
skill.installed ? /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69939
|
+
color: "green",
|
|
69940
|
+
children: "● "
|
|
69941
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69942
|
+
dimColor: true,
|
|
69943
|
+
children: "○ "
|
|
69944
|
+
}, undefined, false, undefined, this),
|
|
69945
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69946
|
+
color: skill.installed ? "green" : "cyan",
|
|
69947
|
+
bold: true,
|
|
69948
|
+
children: skill.name
|
|
69949
|
+
}, undefined, false, undefined, this),
|
|
69950
|
+
skill.version && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69951
|
+
dimColor: true,
|
|
69952
|
+
children: [
|
|
69953
|
+
" v",
|
|
69954
|
+
skill.version
|
|
69955
|
+
]
|
|
69956
|
+
}, undefined, true, undefined, this),
|
|
69957
|
+
skill.installed && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69958
|
+
dimColor: true,
|
|
69959
|
+
children: " (installed)"
|
|
69960
|
+
}, undefined, false, undefined, this)
|
|
69961
|
+
]
|
|
69962
|
+
}, undefined, true, undefined, this),
|
|
69963
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69964
|
+
marginLeft: 2,
|
|
69965
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69966
|
+
dimColor: true,
|
|
69967
|
+
children: skill.description
|
|
69968
|
+
}, undefined, false, undefined, this)
|
|
69969
|
+
}, undefined, false, undefined, this)
|
|
69970
|
+
]
|
|
69971
|
+
}, `${skill.repo}/${skill.path}`, true, undefined, this)),
|
|
69972
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69973
|
+
marginTop: 1,
|
|
69974
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69975
|
+
dimColor: true,
|
|
69976
|
+
children: "Run 'skilluse install skill-name' to install a skill."
|
|
69977
|
+
}, undefined, false, undefined, this)
|
|
69978
|
+
}, undefined, false, undefined, this)
|
|
69979
|
+
]
|
|
69980
|
+
}, undefined, true, undefined, this);
|
|
69981
|
+
}
|
|
69982
|
+
case "error":
|
|
69983
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(StatusMessage, {
|
|
69984
|
+
type: "error",
|
|
69985
|
+
children: state.message
|
|
69986
|
+
}, undefined, false, undefined, this);
|
|
69987
|
+
default:
|
|
69988
|
+
return null;
|
|
69989
|
+
}
|
|
69990
|
+
};
|
|
69991
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(jsx_dev_runtime18.Fragment, {
|
|
69992
|
+
children: [
|
|
69993
|
+
(state.phase === "checking" || state.phase === "fetching") && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Spinner2, {
|
|
69994
|
+
text: state.phase === "fetching" ? `Fetching skills from ${state.repo}...` : "Loading..."
|
|
69995
|
+
}, undefined, false, undefined, this),
|
|
69996
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Static, {
|
|
69997
|
+
items: outputItems,
|
|
69998
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69999
|
+
flexDirection: "column",
|
|
70000
|
+
children: renderContent()
|
|
70001
|
+
}, item.id, false, undefined, this)
|
|
70002
|
+
}, undefined, false, undefined, this)
|
|
70003
|
+
]
|
|
70004
|
+
}, undefined, true, undefined, this);
|
|
70005
|
+
}
|
|
70006
|
+
|
|
70007
|
+
// src/commands/repo/remove.tsx
|
|
70008
|
+
var import_react42 = __toESM(require_react(), 1);
|
|
70009
|
+
var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69700
70010
|
var args5 = exports_external.tuple([
|
|
69701
70011
|
exports_external.string().describe("Repository in owner/repo format")
|
|
69702
70012
|
]);
|
|
69703
|
-
var
|
|
70013
|
+
var options12 = exports_external.object({
|
|
69704
70014
|
force: exports_external.boolean().default(false).describe("Skip confirmation prompt")
|
|
69705
70015
|
});
|
|
69706
70016
|
function RepoRemove({ args: [repoArg], options: opts }) {
|
|
69707
70017
|
const { exit } = use_app_default();
|
|
69708
|
-
const [state, setState] =
|
|
69709
|
-
const [outputItems, setOutputItems] =
|
|
69710
|
-
|
|
70018
|
+
const [state, setState] = import_react42.useState({ phase: "checking" });
|
|
70019
|
+
const [outputItems, setOutputItems] = import_react42.useState([]);
|
|
70020
|
+
import_react42.useEffect(() => {
|
|
69711
70021
|
function checkAndRemove() {
|
|
69712
70022
|
const config2 = getConfig();
|
|
69713
70023
|
if (!config2.repos.find((r) => r.repo === repoArg)) {
|
|
@@ -69736,13 +70046,13 @@ function RepoRemove({ args: [repoArg], options: opts }) {
|
|
|
69736
70046
|
return;
|
|
69737
70047
|
}
|
|
69738
70048
|
}, { isActive: state.phase === "confirm" });
|
|
69739
|
-
|
|
70049
|
+
import_react42.useEffect(() => {
|
|
69740
70050
|
const isFinalState = state.phase === "not_found" || state.phase === "success" || state.phase === "cancelled" || state.phase === "error";
|
|
69741
70051
|
if (isFinalState && outputItems.length === 0) {
|
|
69742
70052
|
setOutputItems([{ id: "output" }]);
|
|
69743
70053
|
}
|
|
69744
70054
|
}, [state.phase, outputItems.length]);
|
|
69745
|
-
|
|
70055
|
+
import_react42.useEffect(() => {
|
|
69746
70056
|
if (outputItems.length > 0) {
|
|
69747
70057
|
process.nextTick(() => exit());
|
|
69748
70058
|
}
|
|
@@ -69750,10 +70060,10 @@ function RepoRemove({ args: [repoArg], options: opts }) {
|
|
|
69750
70060
|
const renderContent = () => {
|
|
69751
70061
|
switch (state.phase) {
|
|
69752
70062
|
case "not_found":
|
|
69753
|
-
return /* @__PURE__ */
|
|
70063
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69754
70064
|
flexDirection: "column",
|
|
69755
70065
|
children: [
|
|
69756
|
-
/* @__PURE__ */
|
|
70066
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
|
|
69757
70067
|
type: "error",
|
|
69758
70068
|
children: [
|
|
69759
70069
|
"Repository '",
|
|
@@ -69761,14 +70071,14 @@ function RepoRemove({ args: [repoArg], options: opts }) {
|
|
|
69761
70071
|
"' not found in config"
|
|
69762
70072
|
]
|
|
69763
70073
|
}, undefined, true, undefined, this),
|
|
69764
|
-
/* @__PURE__ */
|
|
70074
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69765
70075
|
dimColor: true,
|
|
69766
70076
|
children: "Run 'skilluse repo list' to see configured repos"
|
|
69767
70077
|
}, undefined, false, undefined, this)
|
|
69768
70078
|
]
|
|
69769
70079
|
}, undefined, true, undefined, this);
|
|
69770
70080
|
case "success":
|
|
69771
|
-
return /* @__PURE__ */
|
|
70081
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
|
|
69772
70082
|
type: "success",
|
|
69773
70083
|
children: [
|
|
69774
70084
|
"Removed ",
|
|
@@ -69776,12 +70086,12 @@ function RepoRemove({ args: [repoArg], options: opts }) {
|
|
|
69776
70086
|
]
|
|
69777
70087
|
}, undefined, true, undefined, this);
|
|
69778
70088
|
case "cancelled":
|
|
69779
|
-
return /* @__PURE__ */
|
|
70089
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69780
70090
|
dimColor: true,
|
|
69781
70091
|
children: "Removal cancelled"
|
|
69782
70092
|
}, undefined, false, undefined, this);
|
|
69783
70093
|
case "error":
|
|
69784
|
-
return /* @__PURE__ */
|
|
70094
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StatusMessage, {
|
|
69785
70095
|
type: "error",
|
|
69786
70096
|
children: state.message
|
|
69787
70097
|
}, undefined, false, undefined, this);
|
|
@@ -69789,36 +70099,36 @@ function RepoRemove({ args: [repoArg], options: opts }) {
|
|
|
69789
70099
|
return null;
|
|
69790
70100
|
}
|
|
69791
70101
|
};
|
|
69792
|
-
return /* @__PURE__ */
|
|
70102
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
|
|
69793
70103
|
children: [
|
|
69794
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
70104
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Spinner2, {
|
|
69795
70105
|
text: "Checking..."
|
|
69796
70106
|
}, undefined, false, undefined, this),
|
|
69797
|
-
state.phase === "confirm" && /* @__PURE__ */
|
|
70107
|
+
state.phase === "confirm" && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69798
70108
|
flexDirection: "column",
|
|
69799
70109
|
children: [
|
|
69800
|
-
/* @__PURE__ */
|
|
70110
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69801
70111
|
children: [
|
|
69802
70112
|
"Remove repository ",
|
|
69803
|
-
/* @__PURE__ */
|
|
70113
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69804
70114
|
color: "cyan",
|
|
69805
70115
|
children: state.repo
|
|
69806
70116
|
}, undefined, false, undefined, this),
|
|
69807
70117
|
"?"
|
|
69808
70118
|
]
|
|
69809
70119
|
}, undefined, true, undefined, this),
|
|
69810
|
-
/* @__PURE__ */
|
|
70120
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69811
70121
|
marginTop: 1,
|
|
69812
|
-
children: /* @__PURE__ */
|
|
70122
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69813
70123
|
dimColor: true,
|
|
69814
70124
|
children: "Press Y to confirm, N to cancel"
|
|
69815
70125
|
}, undefined, false, undefined, this)
|
|
69816
70126
|
}, undefined, false, undefined, this)
|
|
69817
70127
|
]
|
|
69818
70128
|
}, undefined, true, undefined, this),
|
|
69819
|
-
/* @__PURE__ */
|
|
70129
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Static, {
|
|
69820
70130
|
items: outputItems,
|
|
69821
|
-
children: (item) => /* @__PURE__ */
|
|
70131
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69822
70132
|
flexDirection: "column",
|
|
69823
70133
|
children: renderContent()
|
|
69824
70134
|
}, item.id, false, undefined, this)
|
|
@@ -69828,17 +70138,17 @@ function RepoRemove({ args: [repoArg], options: opts }) {
|
|
|
69828
70138
|
}
|
|
69829
70139
|
|
|
69830
70140
|
// src/commands/repo/use.tsx
|
|
69831
|
-
var
|
|
69832
|
-
var
|
|
70141
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
70142
|
+
var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69833
70143
|
var args6 = exports_external.tuple([
|
|
69834
70144
|
exports_external.string().describe("Repository in owner/repo format")
|
|
69835
70145
|
]);
|
|
69836
|
-
var
|
|
70146
|
+
var options13 = exports_external.object({});
|
|
69837
70147
|
function RepoUse({ args: [repoArg], options: _opts }) {
|
|
69838
70148
|
const { exit } = use_app_default();
|
|
69839
|
-
const [state, setState] =
|
|
69840
|
-
const [outputItems, setOutputItems] =
|
|
69841
|
-
|
|
70149
|
+
const [state, setState] = import_react43.useState({ phase: "checking" });
|
|
70150
|
+
const [outputItems, setOutputItems] = import_react43.useState([]);
|
|
70151
|
+
import_react43.useEffect(() => {
|
|
69842
70152
|
const config2 = getConfig();
|
|
69843
70153
|
if (!config2.repos.find((r) => r.repo === repoArg)) {
|
|
69844
70154
|
setState({ phase: "not_found", repo: repoArg });
|
|
@@ -69851,12 +70161,12 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69851
70161
|
setDefaultRepo(repoArg);
|
|
69852
70162
|
setState({ phase: "success", repo: repoArg });
|
|
69853
70163
|
}, [repoArg]);
|
|
69854
|
-
|
|
70164
|
+
import_react43.useEffect(() => {
|
|
69855
70165
|
if (state.phase !== "checking" && outputItems.length === 0) {
|
|
69856
70166
|
setOutputItems([{ id: "output" }]);
|
|
69857
70167
|
}
|
|
69858
70168
|
}, [state.phase, outputItems.length]);
|
|
69859
|
-
|
|
70169
|
+
import_react43.useEffect(() => {
|
|
69860
70170
|
if (outputItems.length > 0) {
|
|
69861
70171
|
process.nextTick(() => exit());
|
|
69862
70172
|
}
|
|
@@ -69864,9 +70174,9 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69864
70174
|
const renderContent = () => {
|
|
69865
70175
|
switch (state.phase) {
|
|
69866
70176
|
case "not_found":
|
|
69867
|
-
return /* @__PURE__ */
|
|
70177
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
|
69868
70178
|
children: [
|
|
69869
|
-
/* @__PURE__ */
|
|
70179
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69870
70180
|
type: "error",
|
|
69871
70181
|
children: [
|
|
69872
70182
|
"Repository ",
|
|
@@ -69874,7 +70184,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69874
70184
|
" not found in config"
|
|
69875
70185
|
]
|
|
69876
70186
|
}, undefined, true, undefined, this),
|
|
69877
|
-
/* @__PURE__ */
|
|
70187
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69878
70188
|
dimColor: true,
|
|
69879
70189
|
children: [
|
|
69880
70190
|
"Run 'skilluse repo add ",
|
|
@@ -69885,7 +70195,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69885
70195
|
]
|
|
69886
70196
|
}, undefined, true, undefined, this);
|
|
69887
70197
|
case "already_default":
|
|
69888
|
-
return /* @__PURE__ */
|
|
70198
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69889
70199
|
type: "success",
|
|
69890
70200
|
children: [
|
|
69891
70201
|
state.repo,
|
|
@@ -69893,7 +70203,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69893
70203
|
]
|
|
69894
70204
|
}, undefined, true, undefined, this);
|
|
69895
70205
|
case "success":
|
|
69896
|
-
return /* @__PURE__ */
|
|
70206
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69897
70207
|
type: "success",
|
|
69898
70208
|
children: [
|
|
69899
70209
|
"Default repo set to ",
|
|
@@ -69901,7 +70211,7 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69901
70211
|
]
|
|
69902
70212
|
}, undefined, true, undefined, this);
|
|
69903
70213
|
case "error":
|
|
69904
|
-
return /* @__PURE__ */
|
|
70214
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusMessage, {
|
|
69905
70215
|
type: "error",
|
|
69906
70216
|
children: state.message
|
|
69907
70217
|
}, undefined, false, undefined, this);
|
|
@@ -69909,14 +70219,14 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69909
70219
|
return null;
|
|
69910
70220
|
}
|
|
69911
70221
|
};
|
|
69912
|
-
return /* @__PURE__ */
|
|
70222
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
|
69913
70223
|
children: [
|
|
69914
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
70224
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Spinner2, {
|
|
69915
70225
|
text: "Setting default..."
|
|
69916
70226
|
}, undefined, false, undefined, this),
|
|
69917
|
-
/* @__PURE__ */
|
|
70227
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Static, {
|
|
69918
70228
|
items: outputItems,
|
|
69919
|
-
children: (item) => /* @__PURE__ */
|
|
70229
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
69920
70230
|
flexDirection: "column",
|
|
69921
70231
|
children: renderContent()
|
|
69922
70232
|
}, item.id, false, undefined, this)
|
|
@@ -69926,17 +70236,17 @@ function RepoUse({ args: [repoArg], options: _opts }) {
|
|
|
69926
70236
|
}
|
|
69927
70237
|
|
|
69928
70238
|
// src/commands/agent/index.tsx
|
|
69929
|
-
var
|
|
69930
|
-
var
|
|
70239
|
+
var import_react44 = __toESM(require_react(), 1);
|
|
70240
|
+
var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69931
70241
|
var args7 = exports_external.tuple([
|
|
69932
70242
|
exports_external.string().optional().describe("Agent ID to switch to")
|
|
69933
70243
|
]);
|
|
69934
|
-
var
|
|
70244
|
+
var options14 = exports_external.object({});
|
|
69935
70245
|
function Agent({ args: [agentIdArg] }) {
|
|
69936
70246
|
const { exit } = use_app_default();
|
|
69937
|
-
const [state, setState] =
|
|
69938
|
-
const [outputItems, setOutputItems] =
|
|
69939
|
-
|
|
70247
|
+
const [state, setState] = import_react44.useState({ phase: "loading" });
|
|
70248
|
+
const [outputItems, setOutputItems] = import_react44.useState([]);
|
|
70249
|
+
import_react44.useEffect(() => {
|
|
69940
70250
|
if (agentIdArg) {
|
|
69941
70251
|
const agent = getAgent(agentIdArg);
|
|
69942
70252
|
if (!agent) {
|
|
@@ -69964,12 +70274,12 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
69964
70274
|
setState({ phase: "selecting", currentAgent, agents });
|
|
69965
70275
|
}
|
|
69966
70276
|
}, [agentIdArg]);
|
|
69967
|
-
|
|
70277
|
+
import_react44.useEffect(() => {
|
|
69968
70278
|
if (state.phase !== "loading" && state.phase !== "selecting" && outputItems.length === 0) {
|
|
69969
70279
|
setOutputItems([{ id: "output" }]);
|
|
69970
70280
|
}
|
|
69971
70281
|
}, [state.phase, outputItems.length]);
|
|
69972
|
-
|
|
70282
|
+
import_react44.useEffect(() => {
|
|
69973
70283
|
if (outputItems.length > 0) {
|
|
69974
70284
|
process.nextTick(() => exit());
|
|
69975
70285
|
}
|
|
@@ -70001,17 +70311,17 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
70001
70311
|
label: agent.id === state.currentAgent ? `${agent.name} (current)` : agent.name,
|
|
70002
70312
|
value: agent.id
|
|
70003
70313
|
}));
|
|
70004
|
-
return /* @__PURE__ */
|
|
70314
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
70005
70315
|
flexDirection: "column",
|
|
70006
70316
|
children: [
|
|
70007
|
-
/* @__PURE__ */
|
|
70317
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
70008
70318
|
marginBottom: 1,
|
|
70009
|
-
children: /* @__PURE__ */
|
|
70319
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
70010
70320
|
bold: true,
|
|
70011
70321
|
children: "Select an agent:"
|
|
70012
70322
|
}, undefined, false, undefined, this)
|
|
70013
70323
|
}, undefined, false, undefined, this),
|
|
70014
|
-
/* @__PURE__ */
|
|
70324
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Select, {
|
|
70015
70325
|
items,
|
|
70016
70326
|
onSelect: handleSelect
|
|
70017
70327
|
}, undefined, false, undefined, this)
|
|
@@ -70019,23 +70329,23 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
70019
70329
|
}, undefined, true, undefined, this);
|
|
70020
70330
|
}
|
|
70021
70331
|
case "not_found":
|
|
70022
|
-
return /* @__PURE__ */
|
|
70332
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
|
|
70023
70333
|
children: [
|
|
70024
|
-
/* @__PURE__ */
|
|
70334
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
|
|
70025
70335
|
type: "error",
|
|
70026
70336
|
children: [
|
|
70027
70337
|
"Unknown agent: ",
|
|
70028
70338
|
state.agentId
|
|
70029
70339
|
]
|
|
70030
70340
|
}, undefined, true, undefined, this),
|
|
70031
|
-
/* @__PURE__ */
|
|
70341
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
70032
70342
|
dimColor: true,
|
|
70033
70343
|
children: "Run 'skilluse agent' to see available agents."
|
|
70034
70344
|
}, undefined, false, undefined, this)
|
|
70035
70345
|
]
|
|
70036
70346
|
}, undefined, true, undefined, this);
|
|
70037
70347
|
case "already_current":
|
|
70038
|
-
return /* @__PURE__ */
|
|
70348
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
|
|
70039
70349
|
type: "success",
|
|
70040
70350
|
children: [
|
|
70041
70351
|
state.agentName,
|
|
@@ -70043,18 +70353,18 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
70043
70353
|
]
|
|
70044
70354
|
}, undefined, true, undefined, this);
|
|
70045
70355
|
case "switched":
|
|
70046
|
-
return /* @__PURE__ */
|
|
70356
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
|
|
70047
70357
|
children: [
|
|
70048
|
-
/* @__PURE__ */
|
|
70358
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusMessage, {
|
|
70049
70359
|
type: "success",
|
|
70050
70360
|
children: [
|
|
70051
70361
|
"Switched to ",
|
|
70052
70362
|
state.agentName
|
|
70053
70363
|
]
|
|
70054
70364
|
}, undefined, true, undefined, this),
|
|
70055
|
-
/* @__PURE__ */
|
|
70365
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
70056
70366
|
marginTop: 1,
|
|
70057
|
-
children: /* @__PURE__ */
|
|
70367
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
70058
70368
|
dimColor: true,
|
|
70059
70369
|
children: [
|
|
70060
70370
|
"Skills will now be installed to ",
|
|
@@ -70070,16 +70380,16 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
70070
70380
|
}
|
|
70071
70381
|
};
|
|
70072
70382
|
if (state.phase === "loading") {
|
|
70073
|
-
return /* @__PURE__ */
|
|
70383
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Spinner2, {
|
|
70074
70384
|
text: "Loading..."
|
|
70075
70385
|
}, undefined, false, undefined, this);
|
|
70076
70386
|
}
|
|
70077
70387
|
if (state.phase === "selecting") {
|
|
70078
70388
|
return renderContent();
|
|
70079
70389
|
}
|
|
70080
|
-
return /* @__PURE__ */
|
|
70390
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Static, {
|
|
70081
70391
|
items: outputItems,
|
|
70082
|
-
children: (item) => /* @__PURE__ */
|
|
70392
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
70083
70393
|
flexDirection: "column",
|
|
70084
70394
|
children: renderContent()
|
|
70085
70395
|
}, item.id, false, undefined, this)
|
|
@@ -70087,13 +70397,13 @@ function Agent({ args: [agentIdArg] }) {
|
|
|
70087
70397
|
}
|
|
70088
70398
|
|
|
70089
70399
|
// src/commands/search.tsx
|
|
70090
|
-
var
|
|
70091
|
-
var
|
|
70400
|
+
var import_react45 = __toESM(require_react(), 1);
|
|
70401
|
+
var jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70092
70402
|
var args8 = exports_external.tuple([exports_external.string().describe("Search keyword")]);
|
|
70093
|
-
var
|
|
70403
|
+
var options15 = exports_external.object({
|
|
70094
70404
|
all: exports_external.boolean().default(false).describe("Search in all configured repos (not just default)")
|
|
70095
70405
|
});
|
|
70096
|
-
function
|
|
70406
|
+
function parseFrontmatter5(content) {
|
|
70097
70407
|
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
70098
70408
|
if (!frontmatterMatch) {
|
|
70099
70409
|
return {};
|
|
@@ -70117,7 +70427,7 @@ function parseFrontmatter4(content) {
|
|
|
70117
70427
|
}
|
|
70118
70428
|
return result;
|
|
70119
70429
|
}
|
|
70120
|
-
async function
|
|
70430
|
+
async function fetchSkillsFromRepo2(token, repoConfig) {
|
|
70121
70431
|
const { repo, branch, paths: paths2 } = repoConfig;
|
|
70122
70432
|
const skills = [];
|
|
70123
70433
|
const searchPaths = paths2.length > 0 ? paths2 : [""];
|
|
@@ -70145,7 +70455,7 @@ async function fetchSkillsFromRepo(token, repoConfig) {
|
|
|
70145
70455
|
});
|
|
70146
70456
|
if (skillResponse.ok) {
|
|
70147
70457
|
const content = await skillResponse.text();
|
|
70148
|
-
const frontmatter =
|
|
70458
|
+
const frontmatter = parseFrontmatter5(content);
|
|
70149
70459
|
if (frontmatter.name) {
|
|
70150
70460
|
skills.push({
|
|
70151
70461
|
name: String(frontmatter.name),
|
|
@@ -70180,9 +70490,9 @@ function filterSkills(skills, keyword) {
|
|
|
70180
70490
|
}
|
|
70181
70491
|
function Search({ args: [keyword], options: opts }) {
|
|
70182
70492
|
const { exit } = use_app_default();
|
|
70183
|
-
const [state, setState] =
|
|
70184
|
-
const [outputItems, setOutputItems] =
|
|
70185
|
-
|
|
70493
|
+
const [state, setState] = import_react45.useState({ phase: "checking" });
|
|
70494
|
+
const [outputItems, setOutputItems] = import_react45.useState([]);
|
|
70495
|
+
import_react45.useEffect(() => {
|
|
70186
70496
|
async function search() {
|
|
70187
70497
|
const config2 = getConfig();
|
|
70188
70498
|
let reposToSearch = [];
|
|
@@ -70205,7 +70515,7 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70205
70515
|
const allSkills = [];
|
|
70206
70516
|
for (const repoConfig of reposToSearch) {
|
|
70207
70517
|
setState({ phase: "searching", repo: repoConfig.repo });
|
|
70208
|
-
const result = await
|
|
70518
|
+
const result = await fetchSkillsFromRepo2(token, repoConfig);
|
|
70209
70519
|
if ("authRequired" in result) {
|
|
70210
70520
|
setState({ phase: "auth_required", message: result.message });
|
|
70211
70521
|
return;
|
|
@@ -70222,13 +70532,13 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70222
70532
|
});
|
|
70223
70533
|
});
|
|
70224
70534
|
}, [keyword, opts.all]);
|
|
70225
|
-
|
|
70535
|
+
import_react45.useEffect(() => {
|
|
70226
70536
|
const isFinalState = state.phase === "no_repos" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
|
|
70227
70537
|
if (isFinalState && outputItems.length === 0) {
|
|
70228
70538
|
setOutputItems([{ id: "output" }]);
|
|
70229
70539
|
}
|
|
70230
70540
|
}, [state.phase, outputItems.length]);
|
|
70231
|
-
|
|
70541
|
+
import_react45.useEffect(() => {
|
|
70232
70542
|
if (outputItems.length > 0) {
|
|
70233
70543
|
process.nextTick(() => exit());
|
|
70234
70544
|
}
|
|
@@ -70236,22 +70546,22 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70236
70546
|
const renderContent = () => {
|
|
70237
70547
|
switch (state.phase) {
|
|
70238
70548
|
case "auth_required":
|
|
70239
|
-
return /* @__PURE__ */
|
|
70549
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70240
70550
|
flexDirection: "column",
|
|
70241
|
-
children: /* @__PURE__ */
|
|
70551
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
70242
70552
|
type: "error",
|
|
70243
70553
|
children: state.message
|
|
70244
70554
|
}, undefined, false, undefined, this)
|
|
70245
70555
|
}, undefined, false, undefined, this);
|
|
70246
70556
|
case "no_repos":
|
|
70247
|
-
return /* @__PURE__ */
|
|
70557
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70248
70558
|
flexDirection: "column",
|
|
70249
70559
|
children: [
|
|
70250
|
-
/* @__PURE__ */
|
|
70560
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
70251
70561
|
type: "warning",
|
|
70252
70562
|
children: "No repositories configured"
|
|
70253
70563
|
}, undefined, false, undefined, this),
|
|
70254
|
-
/* @__PURE__ */
|
|
70564
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70255
70565
|
dimColor: true,
|
|
70256
70566
|
children: "Run 'skilluse repo add owner/repo' to add a skill repository."
|
|
70257
70567
|
}, undefined, false, undefined, this)
|
|
@@ -70259,31 +70569,31 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70259
70569
|
}, undefined, true, undefined, this);
|
|
70260
70570
|
case "success":
|
|
70261
70571
|
if (state.skills.length === 0) {
|
|
70262
|
-
return /* @__PURE__ */
|
|
70572
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70263
70573
|
flexDirection: "column",
|
|
70264
70574
|
children: [
|
|
70265
|
-
/* @__PURE__ */
|
|
70575
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70266
70576
|
marginBottom: 1,
|
|
70267
70577
|
children: [
|
|
70268
|
-
/* @__PURE__ */
|
|
70578
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70269
70579
|
children: 'Search results for "'
|
|
70270
70580
|
}, undefined, false, undefined, this),
|
|
70271
|
-
/* @__PURE__ */
|
|
70581
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70272
70582
|
color: "cyan",
|
|
70273
70583
|
children: state.keyword
|
|
70274
70584
|
}, undefined, false, undefined, this),
|
|
70275
|
-
/* @__PURE__ */
|
|
70585
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70276
70586
|
children: '"'
|
|
70277
70587
|
}, undefined, false, undefined, this)
|
|
70278
70588
|
]
|
|
70279
70589
|
}, undefined, true, undefined, this),
|
|
70280
|
-
/* @__PURE__ */
|
|
70590
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
70281
70591
|
type: "warning",
|
|
70282
70592
|
children: "No skills found"
|
|
70283
70593
|
}, undefined, false, undefined, this),
|
|
70284
|
-
/* @__PURE__ */
|
|
70594
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70285
70595
|
marginTop: 1,
|
|
70286
|
-
children: /* @__PURE__ */
|
|
70596
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70287
70597
|
dimColor: true,
|
|
70288
70598
|
children: "Try a different search term or check your configured repos with 'skilluse repo list'."
|
|
70289
70599
|
}, undefined, false, undefined, this)
|
|
@@ -70291,36 +70601,36 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70291
70601
|
]
|
|
70292
70602
|
}, undefined, true, undefined, this);
|
|
70293
70603
|
}
|
|
70294
|
-
return /* @__PURE__ */
|
|
70604
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70295
70605
|
flexDirection: "column",
|
|
70296
70606
|
children: [
|
|
70297
|
-
/* @__PURE__ */
|
|
70607
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70298
70608
|
marginBottom: 1,
|
|
70299
70609
|
children: [
|
|
70300
|
-
/* @__PURE__ */
|
|
70610
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70301
70611
|
children: 'Search results for "'
|
|
70302
70612
|
}, undefined, false, undefined, this),
|
|
70303
|
-
/* @__PURE__ */
|
|
70613
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70304
70614
|
color: "cyan",
|
|
70305
70615
|
children: state.keyword
|
|
70306
70616
|
}, undefined, false, undefined, this),
|
|
70307
|
-
/* @__PURE__ */
|
|
70617
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70308
70618
|
children: '"'
|
|
70309
70619
|
}, undefined, false, undefined, this)
|
|
70310
70620
|
]
|
|
70311
70621
|
}, undefined, true, undefined, this),
|
|
70312
|
-
state.skills.map((skill) => /* @__PURE__ */
|
|
70622
|
+
state.skills.map((skill) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70313
70623
|
flexDirection: "column",
|
|
70314
70624
|
marginBottom: 1,
|
|
70315
70625
|
children: [
|
|
70316
|
-
/* @__PURE__ */
|
|
70626
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70317
70627
|
children: [
|
|
70318
|
-
/* @__PURE__ */
|
|
70628
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70319
70629
|
color: "cyan",
|
|
70320
70630
|
bold: true,
|
|
70321
70631
|
children: skill.name
|
|
70322
70632
|
}, undefined, false, undefined, this),
|
|
70323
|
-
skill.version && /* @__PURE__ */
|
|
70633
|
+
skill.version && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70324
70634
|
dimColor: true,
|
|
70325
70635
|
children: [
|
|
70326
70636
|
" v",
|
|
@@ -70329,15 +70639,15 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70329
70639
|
}, undefined, true, undefined, this)
|
|
70330
70640
|
]
|
|
70331
70641
|
}, undefined, true, undefined, this),
|
|
70332
|
-
/* @__PURE__ */
|
|
70642
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70333
70643
|
marginLeft: 2,
|
|
70334
|
-
children: /* @__PURE__ */
|
|
70644
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70335
70645
|
children: skill.description
|
|
70336
70646
|
}, undefined, false, undefined, this)
|
|
70337
70647
|
}, undefined, false, undefined, this),
|
|
70338
|
-
/* @__PURE__ */
|
|
70648
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70339
70649
|
marginLeft: 2,
|
|
70340
|
-
children: /* @__PURE__ */
|
|
70650
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70341
70651
|
dimColor: true,
|
|
70342
70652
|
children: [
|
|
70343
70653
|
skill.repo,
|
|
@@ -70347,9 +70657,9 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70347
70657
|
}, undefined, false, undefined, this)
|
|
70348
70658
|
]
|
|
70349
70659
|
}, `${skill.repo}/${skill.path}`, true, undefined, this)),
|
|
70350
|
-
/* @__PURE__ */
|
|
70660
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70351
70661
|
marginTop: 1,
|
|
70352
|
-
children: /* @__PURE__ */
|
|
70662
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
70353
70663
|
dimColor: true,
|
|
70354
70664
|
children: [
|
|
70355
70665
|
state.skills.length,
|
|
@@ -70363,7 +70673,7 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70363
70673
|
]
|
|
70364
70674
|
}, undefined, true, undefined, this);
|
|
70365
70675
|
case "error":
|
|
70366
|
-
return /* @__PURE__ */
|
|
70676
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusMessage, {
|
|
70367
70677
|
type: "error",
|
|
70368
70678
|
children: state.message
|
|
70369
70679
|
}, undefined, false, undefined, this);
|
|
@@ -70371,14 +70681,14 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70371
70681
|
return null;
|
|
70372
70682
|
}
|
|
70373
70683
|
};
|
|
70374
|
-
return /* @__PURE__ */
|
|
70684
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(jsx_dev_runtime22.Fragment, {
|
|
70375
70685
|
children: [
|
|
70376
|
-
(state.phase === "checking" || state.phase === "searching") && /* @__PURE__ */
|
|
70686
|
+
(state.phase === "checking" || state.phase === "searching") && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Spinner2, {
|
|
70377
70687
|
text: state.phase === "searching" ? `Searching ${state.repo}...` : "Initializing..."
|
|
70378
70688
|
}, undefined, false, undefined, this),
|
|
70379
|
-
/* @__PURE__ */
|
|
70689
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Static, {
|
|
70380
70690
|
items: outputItems,
|
|
70381
|
-
children: (item) => /* @__PURE__ */
|
|
70691
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
70382
70692
|
flexDirection: "column",
|
|
70383
70693
|
children: renderContent()
|
|
70384
70694
|
}, item.id, false, undefined, this)
|
|
@@ -70389,10 +70699,10 @@ function Search({ args: [keyword], options: opts }) {
|
|
|
70389
70699
|
|
|
70390
70700
|
// src/commands/uninstall.tsx
|
|
70391
70701
|
import { rm } from "node:fs/promises";
|
|
70392
|
-
var
|
|
70393
|
-
var
|
|
70702
|
+
var import_react46 = __toESM(require_react(), 1);
|
|
70703
|
+
var jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70394
70704
|
var args9 = exports_external.tuple([exports_external.string().describe("Skill name to uninstall")]);
|
|
70395
|
-
var
|
|
70705
|
+
var options16 = exports_external.object({
|
|
70396
70706
|
force: exports_external.boolean().default(false).describe("Skip confirmation prompt")
|
|
70397
70707
|
});
|
|
70398
70708
|
function ConfirmPrompt({
|
|
@@ -70407,20 +70717,20 @@ function ConfirmPrompt({
|
|
|
70407
70717
|
onCancel();
|
|
70408
70718
|
}
|
|
70409
70719
|
});
|
|
70410
|
-
return /* @__PURE__ */
|
|
70720
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70411
70721
|
flexDirection: "column",
|
|
70412
70722
|
children: [
|
|
70413
|
-
/* @__PURE__ */
|
|
70723
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70414
70724
|
children: [
|
|
70415
|
-
/* @__PURE__ */
|
|
70725
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70416
70726
|
children: "Uninstall "
|
|
70417
70727
|
}, undefined, false, undefined, this),
|
|
70418
|
-
/* @__PURE__ */
|
|
70728
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70419
70729
|
color: "cyan",
|
|
70420
70730
|
bold: true,
|
|
70421
70731
|
children: skill.name
|
|
70422
70732
|
}, undefined, false, undefined, this),
|
|
70423
|
-
/* @__PURE__ */
|
|
70733
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70424
70734
|
children: [
|
|
70425
70735
|
" v",
|
|
70426
70736
|
skill.version,
|
|
@@ -70429,9 +70739,9 @@ function ConfirmPrompt({
|
|
|
70429
70739
|
}, undefined, true, undefined, this)
|
|
70430
70740
|
]
|
|
70431
70741
|
}, undefined, true, undefined, this),
|
|
70432
|
-
/* @__PURE__ */
|
|
70742
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70433
70743
|
marginLeft: 2,
|
|
70434
|
-
children: /* @__PURE__ */
|
|
70744
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70435
70745
|
dimColor: true,
|
|
70436
70746
|
children: [
|
|
70437
70747
|
"Location: ",
|
|
@@ -70439,26 +70749,26 @@ function ConfirmPrompt({
|
|
|
70439
70749
|
]
|
|
70440
70750
|
}, undefined, true, undefined, this)
|
|
70441
70751
|
}, undefined, false, undefined, this),
|
|
70442
|
-
/* @__PURE__ */
|
|
70752
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70443
70753
|
marginTop: 1,
|
|
70444
70754
|
children: [
|
|
70445
|
-
/* @__PURE__ */
|
|
70755
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70446
70756
|
dimColor: true,
|
|
70447
70757
|
children: "Press "
|
|
70448
70758
|
}, undefined, false, undefined, this),
|
|
70449
|
-
/* @__PURE__ */
|
|
70759
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70450
70760
|
color: "green",
|
|
70451
70761
|
children: "Y"
|
|
70452
70762
|
}, undefined, false, undefined, this),
|
|
70453
|
-
/* @__PURE__ */
|
|
70763
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70454
70764
|
dimColor: true,
|
|
70455
70765
|
children: " to confirm, "
|
|
70456
70766
|
}, undefined, false, undefined, this),
|
|
70457
|
-
/* @__PURE__ */
|
|
70767
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70458
70768
|
color: "red",
|
|
70459
70769
|
children: "N"
|
|
70460
70770
|
}, undefined, false, undefined, this),
|
|
70461
|
-
/* @__PURE__ */
|
|
70771
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70462
70772
|
dimColor: true,
|
|
70463
70773
|
children: " to cancel"
|
|
70464
70774
|
}, undefined, false, undefined, this)
|
|
@@ -70469,9 +70779,9 @@ function ConfirmPrompt({
|
|
|
70469
70779
|
}
|
|
70470
70780
|
function Uninstall({ args: [skillName], options: opts }) {
|
|
70471
70781
|
const { exit } = use_app_default();
|
|
70472
|
-
const [state, setState] =
|
|
70473
|
-
const [outputItems, setOutputItems] =
|
|
70474
|
-
const performUninstall =
|
|
70782
|
+
const [state, setState] = import_react46.useState({ phase: "checking" });
|
|
70783
|
+
const [outputItems, setOutputItems] = import_react46.useState([]);
|
|
70784
|
+
const performUninstall = import_react46.useCallback(async (skill) => {
|
|
70475
70785
|
setState({ phase: "uninstalling", skill });
|
|
70476
70786
|
try {
|
|
70477
70787
|
await rm(skill.installedPath, { recursive: true, force: true });
|
|
@@ -70484,7 +70794,7 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70484
70794
|
});
|
|
70485
70795
|
}
|
|
70486
70796
|
}, []);
|
|
70487
|
-
|
|
70797
|
+
import_react46.useEffect(() => {
|
|
70488
70798
|
const config2 = getConfig();
|
|
70489
70799
|
const currentAgentId = getCurrentAgent();
|
|
70490
70800
|
const agentInfo = getAgent(currentAgentId);
|
|
@@ -70500,13 +70810,13 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70500
70810
|
setState({ phase: "confirming", skill });
|
|
70501
70811
|
}
|
|
70502
70812
|
}, [skillName, opts.force, performUninstall]);
|
|
70503
|
-
|
|
70813
|
+
import_react46.useEffect(() => {
|
|
70504
70814
|
const isFinalState = state.phase === "not_found" || state.phase === "success" || state.phase === "cancelled" || state.phase === "error";
|
|
70505
70815
|
if (isFinalState && outputItems.length === 0) {
|
|
70506
70816
|
setOutputItems([{ id: "output" }]);
|
|
70507
70817
|
}
|
|
70508
70818
|
}, [state.phase, outputItems.length]);
|
|
70509
|
-
|
|
70819
|
+
import_react46.useEffect(() => {
|
|
70510
70820
|
if (outputItems.length > 0) {
|
|
70511
70821
|
process.nextTick(() => exit());
|
|
70512
70822
|
}
|
|
@@ -70522,10 +70832,10 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70522
70832
|
const renderContent = () => {
|
|
70523
70833
|
switch (state.phase) {
|
|
70524
70834
|
case "not_found":
|
|
70525
|
-
return /* @__PURE__ */
|
|
70835
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70526
70836
|
flexDirection: "column",
|
|
70527
70837
|
children: [
|
|
70528
|
-
/* @__PURE__ */
|
|
70838
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70529
70839
|
type: "error",
|
|
70530
70840
|
children: [
|
|
70531
70841
|
'Skill "',
|
|
@@ -70534,9 +70844,9 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70534
70844
|
state.agentName
|
|
70535
70845
|
]
|
|
70536
70846
|
}, undefined, true, undefined, this),
|
|
70537
|
-
/* @__PURE__ */
|
|
70847
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70538
70848
|
marginTop: 1,
|
|
70539
|
-
children: /* @__PURE__ */
|
|
70849
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
70540
70850
|
dimColor: true,
|
|
70541
70851
|
children: "Run 'skilluse list' to see installed skills."
|
|
70542
70852
|
}, undefined, false, undefined, this)
|
|
@@ -70544,7 +70854,7 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70544
70854
|
]
|
|
70545
70855
|
}, undefined, true, undefined, this);
|
|
70546
70856
|
case "success":
|
|
70547
|
-
return /* @__PURE__ */
|
|
70857
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70548
70858
|
type: "success",
|
|
70549
70859
|
children: [
|
|
70550
70860
|
'Uninstalled "',
|
|
@@ -70553,12 +70863,12 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70553
70863
|
]
|
|
70554
70864
|
}, undefined, true, undefined, this);
|
|
70555
70865
|
case "cancelled":
|
|
70556
|
-
return /* @__PURE__ */
|
|
70866
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70557
70867
|
type: "warning",
|
|
70558
70868
|
children: "Uninstall cancelled"
|
|
70559
70869
|
}, undefined, false, undefined, this);
|
|
70560
70870
|
case "error":
|
|
70561
|
-
return /* @__PURE__ */
|
|
70871
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(StatusMessage, {
|
|
70562
70872
|
type: "error",
|
|
70563
70873
|
children: state.message
|
|
70564
70874
|
}, undefined, false, undefined, this);
|
|
@@ -70566,22 +70876,22 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70566
70876
|
return null;
|
|
70567
70877
|
}
|
|
70568
70878
|
};
|
|
70569
|
-
return /* @__PURE__ */
|
|
70879
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(jsx_dev_runtime23.Fragment, {
|
|
70570
70880
|
children: [
|
|
70571
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
70881
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Spinner2, {
|
|
70572
70882
|
text: "Loading..."
|
|
70573
70883
|
}, undefined, false, undefined, this),
|
|
70574
|
-
state.phase === "confirming" && /* @__PURE__ */
|
|
70884
|
+
state.phase === "confirming" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(ConfirmPrompt, {
|
|
70575
70885
|
skill: state.skill,
|
|
70576
70886
|
onConfirm: handleConfirm,
|
|
70577
70887
|
onCancel: handleCancel
|
|
70578
70888
|
}, undefined, false, undefined, this),
|
|
70579
|
-
state.phase === "uninstalling" && /* @__PURE__ */
|
|
70889
|
+
state.phase === "uninstalling" && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Spinner2, {
|
|
70580
70890
|
text: `Uninstalling ${state.skill.name}...`
|
|
70581
70891
|
}, undefined, false, undefined, this),
|
|
70582
|
-
/* @__PURE__ */
|
|
70892
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Static, {
|
|
70583
70893
|
items: outputItems,
|
|
70584
|
-
children: (item) => /* @__PURE__ */
|
|
70894
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
70585
70895
|
flexDirection: "column",
|
|
70586
70896
|
children: renderContent()
|
|
70587
70897
|
}, item.id, false, undefined, this)
|
|
@@ -70593,13 +70903,13 @@ function Uninstall({ args: [skillName], options: opts }) {
|
|
|
70593
70903
|
// src/commands/upgrade.tsx
|
|
70594
70904
|
import { mkdir as mkdir2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
|
|
70595
70905
|
import { join as join4 } from "node:path";
|
|
70596
|
-
var
|
|
70597
|
-
var
|
|
70906
|
+
var import_react47 = __toESM(require_react(), 1);
|
|
70907
|
+
var jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70598
70908
|
var args10 = exports_external.tuple([
|
|
70599
70909
|
exports_external.string().optional().describe("Skill name to upgrade (optional, upgrades all if omitted)")
|
|
70600
70910
|
]);
|
|
70601
|
-
var
|
|
70602
|
-
function
|
|
70911
|
+
var options17 = exports_external.object({});
|
|
70912
|
+
function parseFrontmatter6(content) {
|
|
70603
70913
|
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
70604
70914
|
if (!frontmatterMatch)
|
|
70605
70915
|
return {};
|
|
@@ -70645,7 +70955,7 @@ async function checkForUpdate2(token, skill, repoConfig) {
|
|
|
70645
70955
|
let latestVersion = skill.version;
|
|
70646
70956
|
if (skillResponse.ok) {
|
|
70647
70957
|
const content = await skillResponse.text();
|
|
70648
|
-
const frontmatter =
|
|
70958
|
+
const frontmatter = parseFrontmatter6(content);
|
|
70649
70959
|
if (frontmatter.version) {
|
|
70650
70960
|
latestVersion = String(frontmatter.version);
|
|
70651
70961
|
}
|
|
@@ -70707,9 +71017,9 @@ async function downloadSkillFiles2(token, repo, skillPath, branch, targetDir) {
|
|
|
70707
71017
|
}
|
|
70708
71018
|
function Upgrade({ args: [skillName] }) {
|
|
70709
71019
|
const { exit } = use_app_default();
|
|
70710
|
-
const [state, setState] =
|
|
70711
|
-
const [outputItems, setOutputItems] =
|
|
70712
|
-
|
|
71020
|
+
const [state, setState] = import_react47.useState({ phase: "checking" });
|
|
71021
|
+
const [outputItems, setOutputItems] = import_react47.useState([]);
|
|
71022
|
+
import_react47.useEffect(() => {
|
|
70713
71023
|
async function upgrade() {
|
|
70714
71024
|
const config2 = getConfig();
|
|
70715
71025
|
let skillsToCheck = [];
|
|
@@ -70796,13 +71106,13 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70796
71106
|
});
|
|
70797
71107
|
});
|
|
70798
71108
|
}, [skillName]);
|
|
70799
|
-
|
|
71109
|
+
import_react47.useEffect(() => {
|
|
70800
71110
|
const isFinalState = state.phase === "not_found" || state.phase === "no_updates" || state.phase === "success" || state.phase === "auth_required" || state.phase === "error";
|
|
70801
71111
|
if (isFinalState && outputItems.length === 0) {
|
|
70802
71112
|
setOutputItems([{ id: "output" }]);
|
|
70803
71113
|
}
|
|
70804
71114
|
}, [state.phase, outputItems.length]);
|
|
70805
|
-
|
|
71115
|
+
import_react47.useEffect(() => {
|
|
70806
71116
|
if (outputItems.length > 0) {
|
|
70807
71117
|
process.nextTick(() => exit());
|
|
70808
71118
|
}
|
|
@@ -70810,18 +71120,18 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70810
71120
|
const renderContent = () => {
|
|
70811
71121
|
switch (state.phase) {
|
|
70812
71122
|
case "auth_required":
|
|
70813
|
-
return /* @__PURE__ */
|
|
71123
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70814
71124
|
flexDirection: "column",
|
|
70815
|
-
children: /* @__PURE__ */
|
|
71125
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
70816
71126
|
type: "error",
|
|
70817
71127
|
children: state.message
|
|
70818
71128
|
}, undefined, false, undefined, this)
|
|
70819
71129
|
}, undefined, false, undefined, this);
|
|
70820
71130
|
case "not_found":
|
|
70821
|
-
return /* @__PURE__ */
|
|
71131
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70822
71132
|
flexDirection: "column",
|
|
70823
71133
|
children: [
|
|
70824
|
-
/* @__PURE__ */
|
|
71134
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
70825
71135
|
type: "error",
|
|
70826
71136
|
children: [
|
|
70827
71137
|
'Skill "',
|
|
@@ -70829,9 +71139,9 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70829
71139
|
'" is not installed'
|
|
70830
71140
|
]
|
|
70831
71141
|
}, undefined, true, undefined, this),
|
|
70832
|
-
/* @__PURE__ */
|
|
71142
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70833
71143
|
marginTop: 1,
|
|
70834
|
-
children: /* @__PURE__ */
|
|
71144
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70835
71145
|
dimColor: true,
|
|
70836
71146
|
children: "Run 'skilluse list' to see installed skills."
|
|
70837
71147
|
}, undefined, false, undefined, this)
|
|
@@ -70839,15 +71149,15 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70839
71149
|
]
|
|
70840
71150
|
}, undefined, true, undefined, this);
|
|
70841
71151
|
case "no_updates":
|
|
70842
|
-
return /* @__PURE__ */
|
|
71152
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
70843
71153
|
type: "success",
|
|
70844
71154
|
children: "All skills are up to date"
|
|
70845
71155
|
}, undefined, false, undefined, this);
|
|
70846
71156
|
case "success":
|
|
70847
|
-
return /* @__PURE__ */
|
|
71157
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70848
71158
|
flexDirection: "column",
|
|
70849
71159
|
children: [
|
|
70850
|
-
/* @__PURE__ */
|
|
71160
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
70851
71161
|
type: "success",
|
|
70852
71162
|
children: [
|
|
70853
71163
|
"Upgraded ",
|
|
@@ -70855,10 +71165,10 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70855
71165
|
" skill(s)"
|
|
70856
71166
|
]
|
|
70857
71167
|
}, undefined, true, undefined, this),
|
|
70858
|
-
/* @__PURE__ */
|
|
71168
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70859
71169
|
flexDirection: "column",
|
|
70860
71170
|
marginLeft: 2,
|
|
70861
|
-
children: state.upgraded.map((name) => /* @__PURE__ */
|
|
71171
|
+
children: state.upgraded.map((name) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70862
71172
|
dimColor: true,
|
|
70863
71173
|
children: name
|
|
70864
71174
|
}, name, false, undefined, this))
|
|
@@ -70866,7 +71176,7 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70866
71176
|
]
|
|
70867
71177
|
}, undefined, true, undefined, this);
|
|
70868
71178
|
case "error":
|
|
70869
|
-
return /* @__PURE__ */
|
|
71179
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(StatusMessage, {
|
|
70870
71180
|
type: "error",
|
|
70871
71181
|
children: state.message
|
|
70872
71182
|
}, undefined, false, undefined, this);
|
|
@@ -70874,49 +71184,49 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70874
71184
|
return null;
|
|
70875
71185
|
}
|
|
70876
71186
|
};
|
|
70877
|
-
return /* @__PURE__ */
|
|
71187
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
|
|
70878
71188
|
children: [
|
|
70879
|
-
state.phase === "checking" && /* @__PURE__ */
|
|
71189
|
+
state.phase === "checking" && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Spinner2, {
|
|
70880
71190
|
text: "Initializing..."
|
|
70881
71191
|
}, undefined, false, undefined, this),
|
|
70882
|
-
state.phase === "checking_updates" && /* @__PURE__ */
|
|
71192
|
+
state.phase === "checking_updates" && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Spinner2, {
|
|
70883
71193
|
text: `Checking for updates (${state.current}/${state.total})...`
|
|
70884
71194
|
}, undefined, false, undefined, this),
|
|
70885
|
-
state.phase === "upgrading" && /* @__PURE__ */
|
|
71195
|
+
state.phase === "upgrading" && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70886
71196
|
flexDirection: "column",
|
|
70887
71197
|
children: [
|
|
70888
|
-
/* @__PURE__ */
|
|
71198
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70889
71199
|
marginBottom: 1,
|
|
70890
|
-
children: /* @__PURE__ */
|
|
71200
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70891
71201
|
bold: true,
|
|
70892
71202
|
children: "Upgrading skills..."
|
|
70893
71203
|
}, undefined, false, undefined, this)
|
|
70894
71204
|
}, undefined, false, undefined, this),
|
|
70895
|
-
state.upgrades.map((upgrade, i) => /* @__PURE__ */
|
|
71205
|
+
state.upgrades.map((upgrade, i) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70896
71206
|
children: [
|
|
70897
|
-
/* @__PURE__ */
|
|
71207
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70898
71208
|
children: [
|
|
70899
|
-
i < state.current && /* @__PURE__ */
|
|
71209
|
+
i < state.current && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70900
71210
|
color: "green",
|
|
70901
71211
|
children: "✔"
|
|
70902
71212
|
}, undefined, false, undefined, this),
|
|
70903
|
-
i === state.current && /* @__PURE__ */
|
|
71213
|
+
i === state.current && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70904
71214
|
color: "yellow",
|
|
70905
71215
|
children: "◐"
|
|
70906
71216
|
}, undefined, false, undefined, this),
|
|
70907
|
-
i > state.current && /* @__PURE__ */
|
|
71217
|
+
i > state.current && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70908
71218
|
dimColor: true,
|
|
70909
71219
|
children: "○"
|
|
70910
71220
|
}, undefined, false, undefined, this)
|
|
70911
71221
|
]
|
|
70912
71222
|
}, undefined, true, undefined, this),
|
|
70913
|
-
/* @__PURE__ */
|
|
71223
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70914
71224
|
children: [
|
|
70915
71225
|
" ",
|
|
70916
71226
|
upgrade.skill.name
|
|
70917
71227
|
]
|
|
70918
71228
|
}, undefined, true, undefined, this),
|
|
70919
|
-
/* @__PURE__ */
|
|
71229
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
70920
71230
|
dimColor: true,
|
|
70921
71231
|
children: [
|
|
70922
71232
|
" ",
|
|
@@ -70928,18 +71238,18 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70928
71238
|
}, undefined, true, undefined, this)
|
|
70929
71239
|
]
|
|
70930
71240
|
}, upgrade.skill.name, true, undefined, this)),
|
|
70931
|
-
/* @__PURE__ */
|
|
71241
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70932
71242
|
marginTop: 1,
|
|
70933
|
-
children: /* @__PURE__ */
|
|
71243
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(ProgressBar, {
|
|
70934
71244
|
percent: state.progress,
|
|
70935
71245
|
width: 30
|
|
70936
71246
|
}, undefined, false, undefined, this)
|
|
70937
71247
|
}, undefined, false, undefined, this)
|
|
70938
71248
|
]
|
|
70939
71249
|
}, undefined, true, undefined, this),
|
|
70940
|
-
/* @__PURE__ */
|
|
71250
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Static, {
|
|
70941
71251
|
items: outputItems,
|
|
70942
|
-
children: (item) => /* @__PURE__ */
|
|
71252
|
+
children: (item) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
70943
71253
|
flexDirection: "column",
|
|
70944
71254
|
children: renderContent()
|
|
70945
71255
|
}, item.id, false, undefined, this)
|
|
@@ -70950,7 +71260,7 @@ function Upgrade({ args: [skillName] }) {
|
|
|
70950
71260
|
// package.json
|
|
70951
71261
|
var package_default = {
|
|
70952
71262
|
name: "skilluse",
|
|
70953
|
-
version: "0.
|
|
71263
|
+
version: "0.7.0",
|
|
70954
71264
|
description: "CLI tool for managing and installing AI Coding Agent Skills",
|
|
70955
71265
|
main: "dist/cli.js",
|
|
70956
71266
|
bin: {
|
|
@@ -71020,7 +71330,7 @@ var package_default = {
|
|
|
71020
71330
|
};
|
|
71021
71331
|
|
|
71022
71332
|
// src/cli.tsx
|
|
71023
|
-
var
|
|
71333
|
+
var jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
|
|
71024
71334
|
var VERSION = process.env.VERSION || package_default.version;
|
|
71025
71335
|
var BUILD_TIME = process.env.BUILD_TIME || new Date().toISOString();
|
|
71026
71336
|
var program2 = new Command;
|
|
@@ -71030,110 +71340,115 @@ program2.name("skilluse").description("CLI tool for managing and installing AI C
|
|
|
71030
71340
|
process.exit(0);
|
|
71031
71341
|
});
|
|
71032
71342
|
program2.command("login").description("Authenticate with GitHub").action(() => {
|
|
71033
|
-
render_default(/* @__PURE__ */
|
|
71343
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Login, {
|
|
71034
71344
|
options: {}
|
|
71035
71345
|
}, undefined, false, undefined, this));
|
|
71036
71346
|
});
|
|
71037
71347
|
program2.command("logout").description("Clear stored credentials").action(() => {
|
|
71038
|
-
render_default(/* @__PURE__ */
|
|
71348
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Logout, {
|
|
71039
71349
|
options: {}
|
|
71040
71350
|
}, undefined, false, undefined, this));
|
|
71041
71351
|
});
|
|
71042
71352
|
program2.command("list").description("List installed skills").option("-o, --outdated", "Show only outdated skills").action((opts) => {
|
|
71043
|
-
const
|
|
71044
|
-
render_default(/* @__PURE__ */
|
|
71045
|
-
options:
|
|
71353
|
+
const options18 = options4.parse(opts);
|
|
71354
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(List, {
|
|
71355
|
+
options: options18
|
|
71046
71356
|
}, undefined, false, undefined, this));
|
|
71047
71357
|
});
|
|
71048
71358
|
program2.command("search <keyword>").description("Search for skills").option("-a, --all", "Search in all configured repos").action((keyword, opts) => {
|
|
71049
71359
|
const args11 = args8.parse([keyword]);
|
|
71050
|
-
const
|
|
71051
|
-
render_default(/* @__PURE__ */
|
|
71360
|
+
const options18 = options15.parse(opts);
|
|
71361
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Search, {
|
|
71052
71362
|
args: args11,
|
|
71053
|
-
options:
|
|
71363
|
+
options: options18
|
|
71054
71364
|
}, undefined, false, undefined, this));
|
|
71055
71365
|
});
|
|
71056
71366
|
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) => {
|
|
71057
71367
|
const args11 = args2.parse([skillName]);
|
|
71058
|
-
const
|
|
71059
|
-
render_default(/* @__PURE__ */
|
|
71368
|
+
const options18 = options3.parse(opts);
|
|
71369
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Install, {
|
|
71060
71370
|
args: args11,
|
|
71061
|
-
options:
|
|
71371
|
+
options: options18
|
|
71062
71372
|
}, undefined, false, undefined, this));
|
|
71063
71373
|
});
|
|
71064
71374
|
program2.command("uninstall <skill-name>").description("Uninstall a skill").option("-f, --force", "Skip confirmation").action((skillName, opts) => {
|
|
71065
71375
|
const args11 = args9.parse([skillName]);
|
|
71066
|
-
const
|
|
71067
|
-
render_default(/* @__PURE__ */
|
|
71376
|
+
const options18 = options16.parse(opts);
|
|
71377
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Uninstall, {
|
|
71068
71378
|
args: args11,
|
|
71069
|
-
options:
|
|
71379
|
+
options: options18
|
|
71070
71380
|
}, undefined, false, undefined, this));
|
|
71071
71381
|
});
|
|
71072
71382
|
program2.command("upgrade [skill-name]").description("Upgrade skill(s) to latest version").action((skillName) => {
|
|
71073
71383
|
const args11 = args10.parse([skillName]);
|
|
71074
|
-
render_default(/* @__PURE__ */
|
|
71384
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Upgrade, {
|
|
71075
71385
|
args: args11,
|
|
71076
71386
|
options: {}
|
|
71077
71387
|
}, undefined, false, undefined, this));
|
|
71078
71388
|
});
|
|
71079
71389
|
program2.command("info <skill-name>").description("Show skill details").action((skillName) => {
|
|
71080
71390
|
const args11 = args.parse([skillName]);
|
|
71081
|
-
render_default(/* @__PURE__ */
|
|
71391
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Info, {
|
|
71082
71392
|
args: args11,
|
|
71083
71393
|
options: {}
|
|
71084
71394
|
}, undefined, false, undefined, this));
|
|
71085
71395
|
});
|
|
71086
71396
|
var repoCmd = program2.command("repo").description("Manage skill repositories");
|
|
71087
71397
|
repoCmd.command("list").description("List configured repositories").action(() => {
|
|
71088
|
-
render_default(/* @__PURE__ */
|
|
71398
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoList, {
|
|
71399
|
+
options: {}
|
|
71400
|
+
}, undefined, false, undefined, this));
|
|
71401
|
+
});
|
|
71402
|
+
repoCmd.command("skills").description("List all skills in current repository").action(() => {
|
|
71403
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoSkills, {
|
|
71089
71404
|
options: {}
|
|
71090
71405
|
}, undefined, false, undefined, this));
|
|
71091
71406
|
});
|
|
71092
71407
|
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) => {
|
|
71093
71408
|
const args11 = args3.parse([url2]);
|
|
71094
|
-
const
|
|
71095
|
-
render_default(/* @__PURE__ */
|
|
71409
|
+
const options18 = options7.parse(opts);
|
|
71410
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoAdd, {
|
|
71096
71411
|
args: args11,
|
|
71097
|
-
options:
|
|
71412
|
+
options: options18
|
|
71098
71413
|
}, undefined, false, undefined, this));
|
|
71099
71414
|
});
|
|
71100
71415
|
repoCmd.command("remove <name>").description("Remove a repository").option("-f, --force", "Skip confirmation").action((name, opts) => {
|
|
71101
71416
|
const args11 = args5.parse([name]);
|
|
71102
|
-
const
|
|
71103
|
-
render_default(/* @__PURE__ */
|
|
71417
|
+
const options18 = options12.parse(opts);
|
|
71418
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoRemove, {
|
|
71104
71419
|
args: args11,
|
|
71105
|
-
options:
|
|
71420
|
+
options: options18
|
|
71106
71421
|
}, undefined, false, undefined, this));
|
|
71107
71422
|
});
|
|
71108
71423
|
repoCmd.command("edit <name>").description("Edit repository settings").option("-p, --path <path>", "New skill path").option("-b, --branch <branch>", "New branch").action((name, opts) => {
|
|
71109
71424
|
const args11 = args4.parse([name]);
|
|
71110
|
-
const
|
|
71111
|
-
render_default(/* @__PURE__ */
|
|
71425
|
+
const options18 = options8.parse(opts);
|
|
71426
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoEdit, {
|
|
71112
71427
|
args: args11,
|
|
71113
|
-
options:
|
|
71428
|
+
options: options18
|
|
71114
71429
|
}, undefined, false, undefined, this));
|
|
71115
71430
|
});
|
|
71116
71431
|
repoCmd.command("use <name>").description("Set default repository").action((name, _opts) => {
|
|
71117
71432
|
const args11 = args6.parse([name]);
|
|
71118
|
-
render_default(/* @__PURE__ */
|
|
71433
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RepoUse, {
|
|
71119
71434
|
args: args11,
|
|
71120
71435
|
options: {}
|
|
71121
71436
|
}, undefined, false, undefined, this));
|
|
71122
71437
|
});
|
|
71123
71438
|
repoCmd.action(() => {
|
|
71124
|
-
render_default(/* @__PURE__ */
|
|
71439
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Repo, {
|
|
71125
71440
|
options: {}
|
|
71126
71441
|
}, undefined, false, undefined, this));
|
|
71127
71442
|
});
|
|
71128
71443
|
program2.command("agent [agent-id]").description("Switch agent or select interactively").action((agentId) => {
|
|
71129
71444
|
const args11 = args7.parse([agentId]);
|
|
71130
|
-
render_default(/* @__PURE__ */
|
|
71445
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Agent, {
|
|
71131
71446
|
args: args11,
|
|
71132
71447
|
options: {}
|
|
71133
71448
|
}, undefined, false, undefined, this));
|
|
71134
71449
|
});
|
|
71135
71450
|
program2.action(() => {
|
|
71136
|
-
render_default(/* @__PURE__ */
|
|
71451
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Index, {
|
|
71137
71452
|
options: {}
|
|
71138
71453
|
}, undefined, false, undefined, this));
|
|
71139
71454
|
});
|