skilluse 0.6.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 +62 -32
- 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
|
]
|
|
@@ -71230,7 +71260,7 @@ function Upgrade({ args: [skillName] }) {
|
|
|
71230
71260
|
// package.json
|
|
71231
71261
|
var package_default = {
|
|
71232
71262
|
name: "skilluse",
|
|
71233
|
-
version: "0.
|
|
71263
|
+
version: "0.7.0",
|
|
71234
71264
|
description: "CLI tool for managing and installing AI Coding Agent Skills",
|
|
71235
71265
|
main: "dist/cli.js",
|
|
71236
71266
|
bin: {
|