auriga-cli 1.1.0 → 1.2.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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +17 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ Installs Claude Code hooks into a chosen scope. Each hook is self-contained unde
|
|
|
76
76
|
|
|
77
77
|
| Hook | Description |
|
|
78
78
|
|---|---|
|
|
79
|
-
| notify | Native macOS notification when Claude needs your attention. Auto-installs `
|
|
79
|
+
| notify | Native macOS notification when Claude needs your attention. Shows the brand mark in the small app-icon position, with click-to-activate that brings the originating terminal back to the foreground. Auto-installs `alerter` via Homebrew (`vjeantet/tap/alerter`). Customize sound and icon by editing `.claude/hooks/notify/config.json` and replacing `.claude/hooks/notify/icon.png`. macOS-only at runtime; silent no-op on other platforms. |
|
|
80
80
|
|
|
81
81
|
Scope choices:
|
|
82
82
|
|
|
@@ -90,7 +90,7 @@ Re-running the installer preserves your customized `config.json` and `icon.png`,
|
|
|
90
90
|
|
|
91
91
|
- Node.js >= 18
|
|
92
92
|
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (required for Plugins and Hooks modules)
|
|
93
|
-
- [Homebrew](https://brew.sh) (recommended for the `notify` hook to install `
|
|
93
|
+
- [Homebrew](https://brew.sh) (recommended for the `notify` hook to install `alerter`)
|
|
94
94
|
|
|
95
95
|
## License
|
|
96
96
|
|
package/README.zh-CN.md
CHANGED
|
@@ -76,7 +76,7 @@ npx auriga-cli
|
|
|
76
76
|
|
|
77
77
|
| Hook | 说明 |
|
|
78
78
|
|---|---|
|
|
79
|
-
| notify | 当 Claude 需要你关注时弹一条原生 macOS
|
|
79
|
+
| notify | 当 Claude 需要你关注时弹一条原生 macOS 通知。在通知小图标位显示品牌图,点击通知可把发起 Claude 的终端拉回前台。会自动通过 Homebrew 安装 `alerter`(`vjeantet/tap/alerter`)。改 `.claude/hooks/notify/config.json` 即可换提示音、替换 `.claude/hooks/notify/icon.png` 即可换图标。仅 macOS 运行时生效,其它平台静默 no-op。 |
|
|
80
80
|
|
|
81
81
|
作用域选择:
|
|
82
82
|
|
|
@@ -90,7 +90,7 @@ npx auriga-cli
|
|
|
90
90
|
|
|
91
91
|
- Node.js >= 18
|
|
92
92
|
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code)(Plugins 和 Hooks 模块需要)
|
|
93
|
-
- [Homebrew](https://brew.sh)(`notify` hook 用来安装 `
|
|
93
|
+
- [Homebrew](https://brew.sh)(`notify` hook 用来安装 `alerter`,可选)
|
|
94
94
|
|
|
95
95
|
## License
|
|
96
96
|
|
package/dist/hooks.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export declare function removeHookFromSettings(settings: SettingsFile, marker: s
|
|
|
73
73
|
removed: number;
|
|
74
74
|
};
|
|
75
75
|
type Scope = "project-local" | "project" | "user";
|
|
76
|
+
export declare function depBinary(dep: HookDep): string;
|
|
76
77
|
export declare function loadHooksConfig(packageRoot: string): HooksConfig;
|
|
77
78
|
export interface InstallHookResult {
|
|
78
79
|
hook: string;
|
package/dist/hooks.js
CHANGED
|
@@ -12,7 +12,12 @@ import { exec, fetchExtraContentBinary, log, withEsc, } from "./utils.js";
|
|
|
12
12
|
// for every user running `npx auriga-cli`. Validate every untrusted value
|
|
13
13
|
// once at load time, then trust it through the rest of the install flow.
|
|
14
14
|
const HOOK_NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
15
|
-
|
|
15
|
+
// Matches a flat brew formula name (`jq`, `pngquant`) OR a fully
|
|
16
|
+
// qualified tap-prefixed name (`vjeantet/tap/alerter`) — up to 2
|
|
17
|
+
// slashes separating segments. Each segment is the same charset as
|
|
18
|
+
// the flat-name form. No shell metachars; safe to pass to `brew install`
|
|
19
|
+
// as a single argv item.
|
|
20
|
+
const DEP_NAME_RE = /^[a-z0-9][a-z0-9._+-]*(\/[a-z0-9][a-z0-9._+-]*){0,2}$/;
|
|
16
21
|
const EVENT_NAME_RE = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
17
22
|
// Whitelist for hook command templates. The registry is fetched from raw
|
|
18
23
|
// GitHub at runtime, and the command string is written verbatim into
|
|
@@ -252,9 +257,19 @@ function scopeChoices() {
|
|
|
252
257
|
},
|
|
253
258
|
];
|
|
254
259
|
}
|
|
260
|
+
// brew package names can be tap-prefixed (`vjeantet/tap/alerter`) but
|
|
261
|
+
// the binary the formula installs into PATH is the bare formula name
|
|
262
|
+
// (`alerter`). Strip the tap prefix to get the binary to `which` for.
|
|
263
|
+
// Hook authors with a brew package whose binary name doesn't match the
|
|
264
|
+
// formula name will need to ship a wrapper `bin` field in the future;
|
|
265
|
+
// no such hook exists today.
|
|
266
|
+
export function depBinary(dep) {
|
|
267
|
+
const segments = dep.name.split("/");
|
|
268
|
+
return segments[segments.length - 1];
|
|
269
|
+
}
|
|
255
270
|
function depReady(dep) {
|
|
256
271
|
try {
|
|
257
|
-
exec(`which ${dep
|
|
272
|
+
exec(`which ${depBinary(dep)}`);
|
|
258
273
|
return true;
|
|
259
274
|
}
|
|
260
275
|
catch {
|