skilllib 1.11.2 → 1.11.3

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/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  unhide,
31
31
  update,
32
32
  usage
33
- } from "./chunk-OFWHWIER.js";
33
+ } from "./chunk-3XDWEHI4.js";
34
34
 
35
35
  // src/index.ts
36
36
  import { readFileSync } from "fs";
@@ -91,33 +91,67 @@ function packageVersion() {
91
91
  return "unknown";
92
92
  }
93
93
  }
94
+ var FLAGS_OF = {
95
+ "": ["days"],
96
+ ui: [],
97
+ status: ["days"],
98
+ add: ["force", "allow-tracked"],
99
+ remove: ["force"],
100
+ sync: ["all", "force", "allow-tracked"],
101
+ update: ["all", "force", "allow-tracked"],
102
+ outdated: ["all"],
103
+ list: ["days"],
104
+ show: [],
105
+ import: ["force", "global"],
106
+ scan: [],
107
+ projects: [],
108
+ link: ["all", "allow-tracked"],
109
+ tidy: ["all", "global", "dry-run", "allow-git", "keep"],
110
+ harnesses: [],
111
+ folders: [],
112
+ unhide: [],
113
+ new: [],
114
+ global: ["allow-tracked", "to"],
115
+ restore: [],
116
+ doctor: ["fix", "days"],
117
+ apply: ["days"],
118
+ usage: ["days"],
119
+ "agent-skill": [],
120
+ version: [],
121
+ help: []
122
+ };
94
123
  async function main() {
95
- const [command, ...rest] = process.argv.slice(2);
96
- setJsonMode(rest.includes("--json"));
124
+ const argv = process.argv.slice(2);
125
+ setJsonMode(argv.includes("--json"));
126
+ let at = 0;
127
+ while (argv[at]?.startsWith("--") && !["--version", "--help"].includes(argv[at])) at += ["--days", "--keep", "--to"].includes(argv[at]) ? 2 : 1;
128
+ const command = argv[at];
129
+ const rest = [...argv.slice(0, at), ...argv.slice(at + 1)];
97
130
  const args = parseArgs(rest);
131
+ const takes = FLAGS_OF[command ?? ""];
132
+ const flagOf = (a) => a.slice(2).split("=")[0];
133
+ const wrong = takes ? rest.filter((a) => a.startsWith("--") && flagOf(a) !== "json" && !takes.includes(flagOf(a))) : [];
134
+ if (wrong.length) throw new Error(`skilllib${command ? ` ${command}` : ""} doesn't take ${wrong.join(", ")}`);
98
135
  if (!["--version", "-v", "version", "help", "--help", "-h"].includes(command ?? "")) refreshAgentSkill();
99
136
  switch (command) {
100
137
  case void 0:
101
- return process.stdin.isTTY && process.stdout.isTTY ? (await import("./tui-NGTOOVAQ.js")).tui() : overview(args);
138
+ return process.stdin.isTTY && process.stdout.isTTY ? (await import("./tui-WSHQRBPF.js")).tui() : overview(args);
102
139
  case "ui":
103
140
  if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error("`skilllib ui` needs an interactive terminal. Agents and scripts: use `skilllib status --json`.");
104
- return (await import("./tui-NGTOOVAQ.js")).tui();
141
+ return (await import("./tui-WSHQRBPF.js")).tui();
105
142
  case "status":
106
143
  return status(args);
107
144
  case "add":
108
145
  return add(args);
109
146
  case "remove":
110
- case "rm":
111
147
  return remove(args);
112
148
  case "sync":
113
149
  return sync(args);
114
150
  case "update":
115
- case "upgrade":
116
151
  return update(args);
117
152
  case "outdated":
118
153
  return outdated(args);
119
154
  case "list":
120
- case "ls":
121
155
  return list(args);
122
156
  case "show":
123
157
  return show(args);
@@ -130,18 +164,14 @@ async function main() {
130
164
  case "link":
131
165
  return link(args);
132
166
  case "tidy":
133
- case "dedup":
134
167
  return tidy(args);
135
168
  case "harnesses":
136
- case "agents":
137
169
  return harnessesCommand(args);
138
170
  case "folders":
139
- case "roots":
140
171
  return folders(args);
141
172
  case "unhide":
142
173
  return unhide(args);
143
174
  case "new":
144
- case "create":
145
175
  return newSkill(args);
146
176
  case "global":
147
177
  return globalCommand(args);
@@ -158,7 +188,7 @@ async function main() {
158
188
  case "--version":
159
189
  case "-v":
160
190
  case "version":
161
- console.log(packageVersion());
191
+ console.log(isJsonMode() ? JSON.stringify(packageVersion()) : packageVersion());
162
192
  return;
163
193
  case "help":
164
194
  case "--help":
package/dist/json.d.cts CHANGED
@@ -15,7 +15,8 @@ type SkillState = "ok" | "update available" | "edited locally" | "edited locally
15
15
  type Change = {
16
16
  name: string;
17
17
  /** reset: back to the version it had; its local edits were overwritten (and backed up, see `backedUp`). */
18
- action: "installed" | "updated" | "reset" | "removed" | "skipped";
18
+ /** relinked: the copy was as pinned; only the links skilllib.json records were put back. */
19
+ action: "installed" | "updated" | "reset" | "relinked" | "removed" | "skipped";
19
20
  reason?: string;
20
21
  from?: number;
21
22
  to?: number;
package/dist/json.d.ts CHANGED
@@ -15,7 +15,8 @@ type SkillState = "ok" | "update available" | "edited locally" | "edited locally
15
15
  type Change = {
16
16
  name: string;
17
17
  /** reset: back to the version it had; its local edits were overwritten (and backed up, see `backedUp`). */
18
- action: "installed" | "updated" | "reset" | "removed" | "skipped";
18
+ /** relinked: the copy was as pinned; only the links skilllib.json records were put back. */
19
+ action: "installed" | "updated" | "reset" | "relinked" | "removed" | "skipped";
19
20
  reason?: string;
20
21
  from?: number;
21
22
  to?: number;