lazy-skill 0.1.0 → 0.1.2

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.
@@ -75,6 +75,25 @@ export function createInstallPlan(input) {
75
75
  const scope = input.scope === "project" ? "project" : "global";
76
76
  return { skillRef: input.skillRef, agents, scope };
77
77
  }
78
+ /**
79
+ * Splits a registry id into the package and skill the installer expects.
80
+ *
81
+ * A registry id is `{source}/{slug}`, and for GitHub sources the source is
82
+ * itself `owner/repo` — so `skills-101/superpowers/ai-video-generation` means
83
+ * the repo `skills-101/superpowers` and the single skill
84
+ * `ai-video-generation`. Passing the whole id as the package makes the
85
+ * installer look for a repository that does not exist, and it reports
86
+ * "No valid skills found" rather than failing loudly.
87
+ *
88
+ * A two-segment id is a whole repository, so every skill in it is installed.
89
+ */
90
+ export function splitSkillRef(skillRef) {
91
+ const parts = skillRef.split("/");
92
+ if (parts.length >= 3) {
93
+ return { pkg: parts.slice(0, 2).join("/"), skill: parts.slice(2).join("/") };
94
+ }
95
+ return { pkg: skillRef, skill: "*" };
96
+ }
78
97
  /**
79
98
  * The exact argv passed to the installer.
80
99
  *
@@ -84,6 +103,7 @@ export function createInstallPlan(input) {
84
103
  * flag even if the pattern above is ever loosened.
85
104
  */
86
105
  export function buildInstallArgs(plan) {
106
+ const { pkg, skill } = splitSkillRef(plan.skillRef);
87
107
  const args = [
88
108
  "--yes",
89
109
  UPSTREAM_PACKAGE,
@@ -91,12 +111,12 @@ export function buildInstallArgs(plan) {
91
111
  "--agent",
92
112
  plan.agents.join(","),
93
113
  "--skill",
94
- "*",
114
+ skill,
95
115
  "--yes",
96
116
  ];
97
117
  if (plan.scope === "global")
98
118
  args.push("--global");
99
- args.push("--", plan.skillRef);
119
+ args.push("--", pkg);
100
120
  return args;
101
121
  }
102
122
  /** What the user is shown before anything runs (§23). */
@@ -128,13 +128,17 @@ export async function connectCommand(options) {
128
128
  console.log(bottom(theme));
129
129
  console.log();
130
130
  console.log(` ${style.gray("Credential stored in ~/.lazyskill/config.json (0600).")}`);
131
- if (options.listen) {
132
- const { listenCommand } = await import("./listen.js");
133
- return listenCommand();
131
+ // Keep listening by default. Someone who has just paired a computer and
132
+ // reached for their phone wants an install to land, not a second command
133
+ // to remember — a queued job with nothing polling for it just looks broken.
134
+ if (options.listen === false) {
135
+ console.log(` ${style.gray("Run")} ${rgb(theme.accent, "lazy-skill listen")} ${style.gray("when you want to install from your phone.")}`);
136
+ console.log();
137
+ return 0;
134
138
  }
135
- console.log(` ${style.gray("Run")} ${rgb(theme.accent, "lazy-skill listen")} ${style.gray("to install from your phone.")}`);
136
139
  console.log();
137
- return 0;
140
+ const { listenCommand } = await import("./listen.js");
141
+ return listenCommand();
138
142
  }
139
143
  const reason = result.status === "consumed"
140
144
  ? "That code was already used."
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ function help() {
16
16
  ${style.bold("LAZY")} ${rgb(theme.accent, style.bold("SKILL"))}${rgb(theme.support, " Zz")} ${style.gray("See it. Search it. Install it.")}
17
17
 
18
18
  ${style.bold("Usage")}
19
- ${cmd("lazy-skill connect")}Pair this computer with the app
19
+ ${cmd("lazy-skill connect")}Pair, then wait for installs
20
20
  ${cmd("lazy-skill listen")}Wait for installs sent from your phone
21
21
  ${cmd("lazy-skill status")}Show connection and detected tools
22
22
  ${cmd("lazy-skill skills")}List skills installed on this computer
@@ -26,7 +26,7 @@ function help() {
26
26
 
27
27
  ${style.bold("Options")}
28
28
  ${cmd("--agent=<ids>")}Comma-separated agents to install to
29
- ${cmd("--listen")}After connecting, keep waiting for installs
29
+ ${cmd("--no-listen")}Pair only; do not wait for installs
30
30
  ${cmd("-p, --project")}Install into this project, not globally
31
31
  ${cmd("-y, --yes")}Skip the confirmation prompt
32
32
  ${cmd("-v, --verbose")}Show how each tool was detected
@@ -53,7 +53,11 @@ async function main() {
53
53
  const verbose = flags.has("-v") || flags.has("--verbose");
54
54
  switch (command) {
55
55
  case "connect":
56
- return connectCommand({ verbose, listen: flags.has("--listen") });
56
+ return connectCommand({
57
+ verbose,
58
+ // Listening is the default; --no-listen opts out.
59
+ listen: flags.has("--no-listen") ? false : true,
60
+ });
57
61
  case "disconnect":
58
62
  return disconnectCommand();
59
63
  case "status":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lazy-skill",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Found an AI skill while scrolling? Install it to your computer from your phone.",
5
5
  "type": "module",
6
6
  "bin": {