@usevalt/cli 0.3.0 → 0.3.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.
- package/dist/index.js +6 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1159,27 +1159,19 @@ var hookCommand = new Command13("hook").description("Claude Code hook handlers f
|
|
|
1159
1159
|
// src/commands/setup.ts
|
|
1160
1160
|
import { Command as Command14 } from "commander";
|
|
1161
1161
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, mkdirSync as mkdirSync2, existsSync as existsSync4 } from "fs";
|
|
1162
|
-
import { execSync as execSync2 } from "child_process";
|
|
1163
1162
|
import { join } from "path";
|
|
1164
1163
|
import os3 from "os";
|
|
1165
1164
|
var CLAUDE_DIR = join(os3.homedir(), ".claude");
|
|
1166
1165
|
var HOOKS_FILE = join(CLAUDE_DIR, "hooks.json");
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
execSync2("which valt", { stdio: "pipe", timeout: 3e3 });
|
|
1170
|
-
return "valt";
|
|
1171
|
-
} catch {
|
|
1172
|
-
return "npx --yes @usevalt/cli";
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
function getValtHooks(prefix) {
|
|
1166
|
+
var HOOK_PREFIX = "npx --yes @usevalt/cli";
|
|
1167
|
+
function getValtHooks() {
|
|
1176
1168
|
return {
|
|
1177
1169
|
SessionStart: [
|
|
1178
1170
|
{
|
|
1179
1171
|
hooks: [
|
|
1180
1172
|
{
|
|
1181
1173
|
type: "command",
|
|
1182
|
-
command: `${
|
|
1174
|
+
command: `${HOOK_PREFIX} hook session-start`
|
|
1183
1175
|
}
|
|
1184
1176
|
]
|
|
1185
1177
|
}
|
|
@@ -1190,7 +1182,7 @@ function getValtHooks(prefix) {
|
|
|
1190
1182
|
hooks: [
|
|
1191
1183
|
{
|
|
1192
1184
|
type: "command",
|
|
1193
|
-
command: `${
|
|
1185
|
+
command: `${HOOK_PREFIX} hook tool-call`
|
|
1194
1186
|
}
|
|
1195
1187
|
]
|
|
1196
1188
|
}
|
|
@@ -1201,7 +1193,7 @@ function getValtHooks(prefix) {
|
|
|
1201
1193
|
hooks: [
|
|
1202
1194
|
{
|
|
1203
1195
|
type: "command",
|
|
1204
|
-
command: `${
|
|
1196
|
+
command: `${HOOK_PREFIX} hook session-end`
|
|
1205
1197
|
}
|
|
1206
1198
|
]
|
|
1207
1199
|
}
|
|
@@ -1233,8 +1225,7 @@ var setupCommand = new Command14("setup").description("Configure Claude Code hoo
|
|
|
1233
1225
|
config = { hooks: {} };
|
|
1234
1226
|
}
|
|
1235
1227
|
}
|
|
1236
|
-
const
|
|
1237
|
-
const valtHooks = getValtHooks(prefix);
|
|
1228
|
+
const valtHooks = getValtHooks();
|
|
1238
1229
|
for (const [event, hooks] of Object.entries(valtHooks)) {
|
|
1239
1230
|
const existing = config.hooks[event];
|
|
1240
1231
|
if (existing && Array.isArray(existing)) {
|