skilluse 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +48 -39
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -67782,6 +67782,7 @@ async function checkForUpdate(token, skill, repoConfig) {
67782
67782
  function List({ options: opts }) {
67783
67783
  const { exit } = use_app_default();
67784
67784
  const [state, setState] = import_react33.useState({ phase: "checking" });
67785
+ const [outputItems, setOutputItems] = import_react33.useState([]);
67785
67786
  import_react33.useEffect(() => {
67786
67787
  async function loadSkills() {
67787
67788
  const config2 = getConfig();
@@ -67795,7 +67796,6 @@ function List({ options: opts }) {
67795
67796
  currentAgent,
67796
67797
  showingAll: opts.all
67797
67798
  });
67798
- exit();
67799
67799
  return;
67800
67800
  }
67801
67801
  const credentials = await getCredentials();
@@ -67816,7 +67816,6 @@ function List({ options: opts }) {
67816
67816
  phase: "auth_required",
67817
67817
  message: result.message
67818
67818
  });
67819
- exit();
67820
67819
  return;
67821
67820
  }
67822
67821
  if (result.hasUpdate) {
@@ -67831,42 +67830,44 @@ function List({ options: opts }) {
67831
67830
  currentAgent,
67832
67831
  showingAll: opts.all
67833
67832
  });
67834
- exit();
67835
67833
  }
67836
67834
  loadSkills();
67837
- }, [opts.outdated, opts.all, exit]);
67838
- switch (state.phase) {
67839
- case "checking":
67840
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner2, {
67841
- text: "Loading..."
67842
- }, undefined, false, undefined, this);
67843
- case "auth_required":
67844
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67845
- flexDirection: "column",
67846
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67847
- type: "error",
67848
- children: state.message
67849
- }, undefined, false, undefined, this)
67835
+ }, [opts.outdated, opts.all]);
67836
+ import_react33.useEffect(() => {
67837
+ const isFinalState = state.phase === "success" || state.phase === "error" || state.phase === "auth_required";
67838
+ if (isFinalState && outputItems.length === 0) {
67839
+ setOutputItems([{ id: "output" }]);
67840
+ }
67841
+ }, [state.phase, outputItems.length]);
67842
+ import_react33.useEffect(() => {
67843
+ if (outputItems.length > 0) {
67844
+ process.nextTick(() => exit());
67845
+ }
67846
+ }, [outputItems.length, exit]);
67847
+ const renderContent = () => {
67848
+ if (state.phase === "auth_required") {
67849
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67850
+ type: "error",
67851
+ children: state.message
67850
67852
  }, undefined, false, undefined, this);
67851
- case "checking_updates":
67852
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner2, {
67853
- text: `Checking for updates (${state.current}/${state.total})...`
67853
+ }
67854
+ if (state.phase === "error") {
67855
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67856
+ type: "error",
67857
+ children: state.message
67854
67858
  }, undefined, false, undefined, this);
67855
- case "success": {
67859
+ }
67860
+ if (state.phase === "success") {
67856
67861
  const agentInfo = getAgent(state.currentAgent);
67857
67862
  const agentName = agentInfo?.name || state.currentAgent;
67858
67863
  if (state.skills.length === 0) {
67859
67864
  if (state.showingOutdated) {
67860
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67861
- flexDirection: "column",
67862
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67863
- type: "success",
67864
- children: "All skills are up to date"
67865
- }, undefined, false, undefined, this)
67865
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
67866
+ type: "success",
67867
+ children: "All skills are up to date"
67866
67868
  }, undefined, false, undefined, this);
67867
67869
  }
67868
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67869
- flexDirection: "column",
67870
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
67870
67871
  children: [
67871
67872
  /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67872
67873
  children: [
@@ -67908,8 +67909,7 @@ function List({ options: opts }) {
67908
67909
  }, undefined, true, undefined, this);
67909
67910
  }
67910
67911
  if (state.showingOutdated) {
67911
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67912
- flexDirection: "column",
67912
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
67913
67913
  children: [
67914
67914
  /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67915
67915
  children: [
@@ -67989,8 +67989,7 @@ function List({ options: opts }) {
67989
67989
  ]
67990
67990
  }, undefined, true, undefined, this);
67991
67991
  }
67992
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67993
- flexDirection: "column",
67992
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
67994
67993
  children: [
67995
67994
  /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
67996
67995
  children: [
@@ -68071,12 +68070,22 @@ function List({ options: opts }) {
68071
68070
  ]
68072
68071
  }, undefined, true, undefined, this);
68073
68072
  }
68074
- case "error":
68075
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(StatusMessage, {
68076
- type: "error",
68077
- children: state.message
68078
- }, undefined, false, undefined, this);
68079
- }
68073
+ return null;
68074
+ };
68075
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
68076
+ children: [
68077
+ (state.phase === "checking" || state.phase === "checking_updates") && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Spinner2, {
68078
+ text: state.phase === "checking_updates" ? `Checking for updates (${state.current}/${state.total})...` : "Loading..."
68079
+ }, undefined, false, undefined, this),
68080
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Static, {
68081
+ items: outputItems,
68082
+ children: (item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
68083
+ flexDirection: "column",
68084
+ children: renderContent()
68085
+ }, item.id, false, undefined, this)
68086
+ }, undefined, false, undefined, this)
68087
+ ]
68088
+ }, undefined, true, undefined, this);
68080
68089
  }
68081
68090
 
68082
68091
  // src/commands/login.tsx
@@ -70427,7 +70436,7 @@ function Upgrade({ args: [skillName] }) {
70427
70436
  // package.json
70428
70437
  var package_default = {
70429
70438
  name: "skilluse",
70430
- version: "0.2.0",
70439
+ version: "0.2.1",
70431
70440
  description: "CLI tool for managing and installing AI Coding Agent Skills",
70432
70441
  main: "dist/cli.js",
70433
70442
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilluse",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI tool for managing and installing AI Coding Agent Skills",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {