skillwatch 0.1.5 → 0.1.7

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/README.md CHANGED
@@ -1,34 +1,14 @@
1
1
  # skillwatch
2
2
 
3
- Daily macOS notifications when your installed agent skills have updates on GitHub.
4
-
5
- ## Install
3
+ Notifies you when installed agent skills have updates.
6
4
 
7
5
  ```bash
8
6
  npx skillwatch install
9
- ```
10
-
11
- Runs daily at 09:00. Customise with `--hour 14 --minute 30`.
12
-
13
- For frequent use, install globally with `npm install -g skillwatch`.
14
-
15
- ## Verify
16
-
17
- ```bash
18
7
  npx skillwatch check-now
19
8
  ```
20
9
 
21
- ## Uninstall
22
-
23
- ```bash
24
- npx skillwatch uninstall
25
- ```
26
-
27
- ## Troubleshooting
28
-
29
- - **"No skill lock file found"** — run `npx skills` first so the lock file exists.
30
- - **Node path changed** — rerun `npx skillwatch install` to update the LaunchAgent.
10
+ Checks daily at 9:00 am. Change the time with `--hour` and `--minute`.
31
11
 
32
- ## License
12
+ Uninstall with `npx skillwatch uninstall`.
33
13
 
34
14
  [MIT](LICENSE.md)
package/dist/checker.js CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as R, c as Wt, d as __toESM, i as Nt, l as be, n as Gt, o as Rt, r as Me, t as require_picocolors, u as Ct } from "./picocolors-hRUfkPbe.js";
3
- import { execFileSync } from "node:child_process";
3
+ import { execFile, execFileSync } from "node:child_process";
4
4
  import { createHash } from "node:crypto";
5
5
  import { existsSync } from "node:fs";
6
6
  import { mkdir, readFile, writeFile } from "node:fs/promises";
7
7
  import { homedir } from "node:os";
8
8
  import { dirname, join, resolve } from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
+ import { promisify } from "node:util";
10
11
  //#region src/checker.ts
11
12
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
12
13
  const log = (message) => {
@@ -114,7 +115,7 @@ const buildNotificationBody = (grouped) => {
114
115
  if (grouped.length > 3) preview.push(`+${grouped.length - 3} more`);
115
116
  return preview.join(", ");
116
117
  };
117
- const buildSignature = (grouped) => createHash("sha256").update(JSON.stringify(grouped)).digest("hex");
118
+ const buildSignature = (updates) => createHash("sha256").update(JSON.stringify(updates)).digest("hex");
118
119
  const escapeAppleScript = (value) => value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
119
120
  const sendNotification = (title, body) => {
120
121
  execFileSync("/usr/bin/osascript", ["-e", `display notification "${escapeAppleScript(body)}" with title "${escapeAppleScript(title)}"`], { stdio: "ignore" });
@@ -189,7 +190,7 @@ const promptAndUpdate = async (signature, grouped) => {
189
190
  const updateSpinner = be();
190
191
  updateSpinner.start("Updating skills...");
191
192
  try {
192
- execFileSync("npx", ["skills", "update"], { stdio: "pipe" });
193
+ await promisify(execFile)("npx", ["skills", "update"]);
193
194
  updateSpinner.stop("Skills updated successfully");
194
195
  } catch {
195
196
  updateSpinner.stop("Update failed");
@@ -232,22 +233,29 @@ const main = async () => {
232
233
  return;
233
234
  }
234
235
  for (const repo of grouped) info(`Update available: ${import_picocolors.default.bold(repo.repoId)} ${import_picocolors.default.dim("->")} ${repo.skillNames.join(", ")}`);
235
- const signature = buildSignature(grouped);
236
+ const signature = buildSignature(updates);
236
237
  if (tty) {
237
238
  await promptAndUpdate(signature, grouped);
238
239
  return;
239
240
  }
240
241
  if ((await readJson(STATE_PATH, {})).lastNotifiedSignature === signature) {
241
- log("Updates already notified. Skipping duplicate notification.");
242
+ log("Already handled. Skipping.");
242
243
  await writeState(signature, grouped);
243
244
  process.exitCode = 0;
244
245
  return;
245
246
  }
246
247
  const body = buildNotificationBody(grouped);
247
- sendNotification("Skill updates available", body);
248
- log(`Notification sent: ${body}`);
249
- log("To update installed skills, run: npx skills update");
250
- await writeState(signature, grouped);
248
+ try {
249
+ await promisify(execFile)("npx", ["skills", "update"]);
250
+ sendNotification("Skills updated", body);
251
+ log(`Updated: ${body}`);
252
+ await writeState(null);
253
+ } catch {
254
+ sendNotification("Skill update failed", body);
255
+ log(`Update failed: ${body}`);
256
+ log("To update manually, run: npx skills update");
257
+ await writeState(null, grouped);
258
+ }
251
259
  };
252
260
  const isExecutedDirectly = () => {
253
261
  const [, entryArg] = process.argv;
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { c as Wt, d as __toESM, i as Nt, n as Gt, s as Vt, t as require_picocolors } from "./picocolors-hRUfkPbe.js";
3
3
  import { execFileSync } from "node:child_process";
4
- import { existsSync, realpathSync } from "node:fs";
4
+ import { realpathSync } from "node:fs";
5
5
  import { copyFile, mkdir, readdir, rm, writeFile } from "node:fs/promises";
6
6
  import { homedir } from "node:os";
7
7
  import { dirname, join, resolve } from "node:path";
@@ -9,7 +9,7 @@ import { fileURLToPath } from "node:url";
9
9
  //#region src/cli.ts
10
10
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
11
11
  const PACKAGE_NAME = "skillwatch";
12
- const PACKAGE_VERSION = "0.1.5";
12
+ const PACKAGE_VERSION = "0.1.7";
13
13
  const ENTRYPOINT_PATH = fileURLToPath(import.meta.url);
14
14
  const PACKAGE_DIR = dirname(ENTRYPOINT_PATH);
15
15
  const CHECKER_SOURCE_PATH = join(PACKAGE_DIR, "checker.js");
@@ -199,9 +199,7 @@ const uninstallCommand = async () => {
199
199
  };
200
200
  const checkNowCommand = () => {
201
201
  assertMacOS();
202
- const installedChecker = join(getAppDir(), "checker.js");
203
- const checkerPath = existsSync(installedChecker) ? installedChecker : CHECKER_SOURCE_PATH;
204
- execFileSync(process.execPath, [checkerPath], {
202
+ execFileSync(process.execPath, [CHECKER_SOURCE_PATH], {
205
203
  env: process.env,
206
204
  stdio: "inherit"
207
205
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwatch",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Daily macOS notifications when installed GitHub-backed skills have updates.",
5
5
  "keywords": [
6
6
  "agent-skills",
@@ -47,10 +47,12 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@changesets/cli": "^2.29.0",
50
+ "@clack/prompts": "^1.1.0",
50
51
  "@types/node": "^22.15.0",
51
52
  "lefthook": "^2.1.4",
52
53
  "oxfmt": "^0.41.0",
53
54
  "oxlint": "^1.56.0",
55
+ "picocolors": "^1.1.1",
54
56
  "tsdown": "^0.12.0",
55
57
  "typescript": "^5.8.0",
56
58
  "ultracite": "^7.3.2",