vibedino 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.
- package/dist/cli.cjs +66 -10
- package/dist/cli.js +66 -10
- package/dist/main.cjs +66 -10
- package/dist/main.js +66 -10
- package/dist/postinstall.cjs +53 -13
- package/dist/postinstall.js +53 -13
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1161,9 +1161,14 @@ function startGame(options = {}) {
|
|
|
1161
1161
|
var import_fs2 = require("fs");
|
|
1162
1162
|
var import_path2 = require("path");
|
|
1163
1163
|
var HOOK_ENTRY = {
|
|
1164
|
-
matcher: "
|
|
1165
|
-
|
|
1166
|
-
|
|
1164
|
+
matcher: "",
|
|
1165
|
+
hooks: [
|
|
1166
|
+
{
|
|
1167
|
+
type: "command",
|
|
1168
|
+
command: 'npx vibedino --trigger claude --reason "Token limit reached"',
|
|
1169
|
+
timeout: 3e5
|
|
1170
|
+
}
|
|
1171
|
+
]
|
|
1167
1172
|
};
|
|
1168
1173
|
function installClaudeHook(projectDir = process.cwd()) {
|
|
1169
1174
|
const claudeDir = (0, import_path2.join)(projectDir, ".claude");
|
|
@@ -1186,7 +1191,10 @@ function installClaudeHook(projectDir = process.cwd()) {
|
|
|
1186
1191
|
hooks.PostToolUseFailure = [];
|
|
1187
1192
|
}
|
|
1188
1193
|
const existing = hooks.PostToolUseFailure;
|
|
1189
|
-
|
|
1194
|
+
const hasDino = existing.some(
|
|
1195
|
+
(h) => h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1196
|
+
);
|
|
1197
|
+
if (!hasDino) {
|
|
1190
1198
|
existing.push(HOOK_ENTRY);
|
|
1191
1199
|
}
|
|
1192
1200
|
(0, import_fs2.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1202,7 +1210,7 @@ function uninstallClaudeHook(projectDir = process.cwd()) {
|
|
|
1202
1210
|
const hooks = settings.hooks?.PostToolUseFailure;
|
|
1203
1211
|
if (hooks) {
|
|
1204
1212
|
settings.hooks.PostToolUseFailure = hooks.filter(
|
|
1205
|
-
(h) => !h.command?.includes("vibedino")
|
|
1213
|
+
(h) => !h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1206
1214
|
);
|
|
1207
1215
|
}
|
|
1208
1216
|
(0, import_fs2.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1250,6 +1258,50 @@ function uninstallCopilotPlugin() {
|
|
|
1250
1258
|
console.log(" Removed VibeDino Copilot plugin.");
|
|
1251
1259
|
}
|
|
1252
1260
|
|
|
1261
|
+
// src/integrations/commands.ts
|
|
1262
|
+
var import_fs4 = require("fs");
|
|
1263
|
+
var import_path4 = require("path");
|
|
1264
|
+
var import_os3 = require("os");
|
|
1265
|
+
var CLAUDE_COMMANDS_DIR = (0, import_path4.join)((0, import_os3.homedir)(), ".claude", "commands");
|
|
1266
|
+
var DINO_COMMAND_PATH = (0, import_path4.join)(CLAUDE_COMMANDS_DIR, "dino.md");
|
|
1267
|
+
var DINO_COMMAND_CONTENT = `# /dino - Play VibeDino
|
|
1268
|
+
|
|
1269
|
+
Launch the VibeDino terminal T-Rex runner game. Use this when you need a break, when tokens are exhausted, or just for fun.
|
|
1270
|
+
|
|
1271
|
+
Run this command in the terminal:
|
|
1272
|
+
|
|
1273
|
+
\`\`\`bash
|
|
1274
|
+
npx vibedino --trigger claude
|
|
1275
|
+
\`\`\`
|
|
1276
|
+
|
|
1277
|
+
Do not add any commentary. Just run the command above.
|
|
1278
|
+
`;
|
|
1279
|
+
function installClaudeCommand() {
|
|
1280
|
+
try {
|
|
1281
|
+
if (!(0, import_fs4.existsSync)(CLAUDE_COMMANDS_DIR)) {
|
|
1282
|
+
(0, import_fs4.mkdirSync)(CLAUDE_COMMANDS_DIR, { recursive: true });
|
|
1283
|
+
}
|
|
1284
|
+
(0, import_fs4.writeFileSync)(DINO_COMMAND_PATH, DINO_COMMAND_CONTENT, "utf-8");
|
|
1285
|
+
console.log(` Installed /dino command at ${DINO_COMMAND_PATH}`);
|
|
1286
|
+
return true;
|
|
1287
|
+
} catch {
|
|
1288
|
+
return false;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
function uninstallClaudeCommand() {
|
|
1292
|
+
try {
|
|
1293
|
+
if ((0, import_fs4.existsSync)(DINO_COMMAND_PATH)) {
|
|
1294
|
+
(0, import_fs4.unlinkSync)(DINO_COMMAND_PATH);
|
|
1295
|
+
console.log(" Removed /dino command.");
|
|
1296
|
+
return true;
|
|
1297
|
+
}
|
|
1298
|
+
console.log(" No /dino command found.");
|
|
1299
|
+
return false;
|
|
1300
|
+
} catch {
|
|
1301
|
+
return false;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1253
1305
|
// src/cli.ts
|
|
1254
1306
|
function printHelp() {
|
|
1255
1307
|
console.log(`
|
|
@@ -1306,7 +1358,7 @@ async function cli(argv) {
|
|
|
1306
1358
|
process.exit(0);
|
|
1307
1359
|
}
|
|
1308
1360
|
if (args.version) {
|
|
1309
|
-
console.log("vibedino v0.1.
|
|
1361
|
+
console.log("vibedino v0.1.2");
|
|
1310
1362
|
process.exit(0);
|
|
1311
1363
|
}
|
|
1312
1364
|
if (args.scores) {
|
|
@@ -1325,14 +1377,18 @@ async function cli(argv) {
|
|
|
1325
1377
|
process.exit(0);
|
|
1326
1378
|
}
|
|
1327
1379
|
if (args.install) {
|
|
1328
|
-
if (args.install === "claude")
|
|
1329
|
-
|
|
1380
|
+
if (args.install === "claude") {
|
|
1381
|
+
installClaudeHook();
|
|
1382
|
+
installClaudeCommand();
|
|
1383
|
+
} else if (args.install === "copilot") installCopilotPlugin();
|
|
1330
1384
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1331
1385
|
process.exit(0);
|
|
1332
1386
|
}
|
|
1333
1387
|
if (args.uninstall) {
|
|
1334
|
-
if (args.uninstall === "claude")
|
|
1335
|
-
|
|
1388
|
+
if (args.uninstall === "claude") {
|
|
1389
|
+
uninstallClaudeHook();
|
|
1390
|
+
uninstallClaudeCommand();
|
|
1391
|
+
} else if (args.uninstall === "copilot") uninstallCopilotPlugin();
|
|
1336
1392
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1337
1393
|
process.exit(0);
|
|
1338
1394
|
}
|
package/dist/cli.js
CHANGED
|
@@ -1135,9 +1135,14 @@ function startGame(options = {}) {
|
|
|
1135
1135
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
1136
1136
|
import { join as join2 } from "path";
|
|
1137
1137
|
var HOOK_ENTRY = {
|
|
1138
|
-
matcher: "
|
|
1139
|
-
|
|
1140
|
-
|
|
1138
|
+
matcher: "",
|
|
1139
|
+
hooks: [
|
|
1140
|
+
{
|
|
1141
|
+
type: "command",
|
|
1142
|
+
command: 'npx vibedino --trigger claude --reason "Token limit reached"',
|
|
1143
|
+
timeout: 3e5
|
|
1144
|
+
}
|
|
1145
|
+
]
|
|
1141
1146
|
};
|
|
1142
1147
|
function installClaudeHook(projectDir = process.cwd()) {
|
|
1143
1148
|
const claudeDir = join2(projectDir, ".claude");
|
|
@@ -1160,7 +1165,10 @@ function installClaudeHook(projectDir = process.cwd()) {
|
|
|
1160
1165
|
hooks.PostToolUseFailure = [];
|
|
1161
1166
|
}
|
|
1162
1167
|
const existing = hooks.PostToolUseFailure;
|
|
1163
|
-
|
|
1168
|
+
const hasDino = existing.some(
|
|
1169
|
+
(h) => h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1170
|
+
);
|
|
1171
|
+
if (!hasDino) {
|
|
1164
1172
|
existing.push(HOOK_ENTRY);
|
|
1165
1173
|
}
|
|
1166
1174
|
writeFileSync2(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1176,7 +1184,7 @@ function uninstallClaudeHook(projectDir = process.cwd()) {
|
|
|
1176
1184
|
const hooks = settings.hooks?.PostToolUseFailure;
|
|
1177
1185
|
if (hooks) {
|
|
1178
1186
|
settings.hooks.PostToolUseFailure = hooks.filter(
|
|
1179
|
-
(h) => !h.command?.includes("vibedino")
|
|
1187
|
+
(h) => !h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1180
1188
|
);
|
|
1181
1189
|
}
|
|
1182
1190
|
writeFileSync2(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1224,6 +1232,50 @@ function uninstallCopilotPlugin() {
|
|
|
1224
1232
|
console.log(" Removed VibeDino Copilot plugin.");
|
|
1225
1233
|
}
|
|
1226
1234
|
|
|
1235
|
+
// src/integrations/commands.ts
|
|
1236
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4, unlinkSync as unlinkSync2 } from "fs";
|
|
1237
|
+
import { join as join4 } from "path";
|
|
1238
|
+
import { homedir as homedir3 } from "os";
|
|
1239
|
+
var CLAUDE_COMMANDS_DIR = join4(homedir3(), ".claude", "commands");
|
|
1240
|
+
var DINO_COMMAND_PATH = join4(CLAUDE_COMMANDS_DIR, "dino.md");
|
|
1241
|
+
var DINO_COMMAND_CONTENT = `# /dino - Play VibeDino
|
|
1242
|
+
|
|
1243
|
+
Launch the VibeDino terminal T-Rex runner game. Use this when you need a break, when tokens are exhausted, or just for fun.
|
|
1244
|
+
|
|
1245
|
+
Run this command in the terminal:
|
|
1246
|
+
|
|
1247
|
+
\`\`\`bash
|
|
1248
|
+
npx vibedino --trigger claude
|
|
1249
|
+
\`\`\`
|
|
1250
|
+
|
|
1251
|
+
Do not add any commentary. Just run the command above.
|
|
1252
|
+
`;
|
|
1253
|
+
function installClaudeCommand() {
|
|
1254
|
+
try {
|
|
1255
|
+
if (!existsSync4(CLAUDE_COMMANDS_DIR)) {
|
|
1256
|
+
mkdirSync4(CLAUDE_COMMANDS_DIR, { recursive: true });
|
|
1257
|
+
}
|
|
1258
|
+
writeFileSync4(DINO_COMMAND_PATH, DINO_COMMAND_CONTENT, "utf-8");
|
|
1259
|
+
console.log(` Installed /dino command at ${DINO_COMMAND_PATH}`);
|
|
1260
|
+
return true;
|
|
1261
|
+
} catch {
|
|
1262
|
+
return false;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
function uninstallClaudeCommand() {
|
|
1266
|
+
try {
|
|
1267
|
+
if (existsSync4(DINO_COMMAND_PATH)) {
|
|
1268
|
+
unlinkSync2(DINO_COMMAND_PATH);
|
|
1269
|
+
console.log(" Removed /dino command.");
|
|
1270
|
+
return true;
|
|
1271
|
+
}
|
|
1272
|
+
console.log(" No /dino command found.");
|
|
1273
|
+
return false;
|
|
1274
|
+
} catch {
|
|
1275
|
+
return false;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1227
1279
|
// src/cli.ts
|
|
1228
1280
|
function printHelp() {
|
|
1229
1281
|
console.log(`
|
|
@@ -1280,7 +1332,7 @@ async function cli(argv) {
|
|
|
1280
1332
|
process.exit(0);
|
|
1281
1333
|
}
|
|
1282
1334
|
if (args.version) {
|
|
1283
|
-
console.log("vibedino v0.1.
|
|
1335
|
+
console.log("vibedino v0.1.2");
|
|
1284
1336
|
process.exit(0);
|
|
1285
1337
|
}
|
|
1286
1338
|
if (args.scores) {
|
|
@@ -1299,14 +1351,18 @@ async function cli(argv) {
|
|
|
1299
1351
|
process.exit(0);
|
|
1300
1352
|
}
|
|
1301
1353
|
if (args.install) {
|
|
1302
|
-
if (args.install === "claude")
|
|
1303
|
-
|
|
1354
|
+
if (args.install === "claude") {
|
|
1355
|
+
installClaudeHook();
|
|
1356
|
+
installClaudeCommand();
|
|
1357
|
+
} else if (args.install === "copilot") installCopilotPlugin();
|
|
1304
1358
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1305
1359
|
process.exit(0);
|
|
1306
1360
|
}
|
|
1307
1361
|
if (args.uninstall) {
|
|
1308
|
-
if (args.uninstall === "claude")
|
|
1309
|
-
|
|
1362
|
+
if (args.uninstall === "claude") {
|
|
1363
|
+
uninstallClaudeHook();
|
|
1364
|
+
uninstallClaudeCommand();
|
|
1365
|
+
} else if (args.uninstall === "copilot") uninstallCopilotPlugin();
|
|
1310
1366
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1311
1367
|
process.exit(0);
|
|
1312
1368
|
}
|
package/dist/main.cjs
CHANGED
|
@@ -1137,9 +1137,14 @@ function startGame(options = {}) {
|
|
|
1137
1137
|
var import_fs2 = require("fs");
|
|
1138
1138
|
var import_path2 = require("path");
|
|
1139
1139
|
var HOOK_ENTRY = {
|
|
1140
|
-
matcher: "
|
|
1141
|
-
|
|
1142
|
-
|
|
1140
|
+
matcher: "",
|
|
1141
|
+
hooks: [
|
|
1142
|
+
{
|
|
1143
|
+
type: "command",
|
|
1144
|
+
command: 'npx vibedino --trigger claude --reason "Token limit reached"',
|
|
1145
|
+
timeout: 3e5
|
|
1146
|
+
}
|
|
1147
|
+
]
|
|
1143
1148
|
};
|
|
1144
1149
|
function installClaudeHook(projectDir = process.cwd()) {
|
|
1145
1150
|
const claudeDir = (0, import_path2.join)(projectDir, ".claude");
|
|
@@ -1162,7 +1167,10 @@ function installClaudeHook(projectDir = process.cwd()) {
|
|
|
1162
1167
|
hooks.PostToolUseFailure = [];
|
|
1163
1168
|
}
|
|
1164
1169
|
const existing = hooks.PostToolUseFailure;
|
|
1165
|
-
|
|
1170
|
+
const hasDino = existing.some(
|
|
1171
|
+
(h) => h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1172
|
+
);
|
|
1173
|
+
if (!hasDino) {
|
|
1166
1174
|
existing.push(HOOK_ENTRY);
|
|
1167
1175
|
}
|
|
1168
1176
|
(0, import_fs2.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1178,7 +1186,7 @@ function uninstallClaudeHook(projectDir = process.cwd()) {
|
|
|
1178
1186
|
const hooks = settings.hooks?.PostToolUseFailure;
|
|
1179
1187
|
if (hooks) {
|
|
1180
1188
|
settings.hooks.PostToolUseFailure = hooks.filter(
|
|
1181
|
-
(h) => !h.command?.includes("vibedino")
|
|
1189
|
+
(h) => !h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1182
1190
|
);
|
|
1183
1191
|
}
|
|
1184
1192
|
(0, import_fs2.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1226,6 +1234,50 @@ function uninstallCopilotPlugin() {
|
|
|
1226
1234
|
console.log(" Removed VibeDino Copilot plugin.");
|
|
1227
1235
|
}
|
|
1228
1236
|
|
|
1237
|
+
// src/integrations/commands.ts
|
|
1238
|
+
var import_fs4 = require("fs");
|
|
1239
|
+
var import_path4 = require("path");
|
|
1240
|
+
var import_os3 = require("os");
|
|
1241
|
+
var CLAUDE_COMMANDS_DIR = (0, import_path4.join)((0, import_os3.homedir)(), ".claude", "commands");
|
|
1242
|
+
var DINO_COMMAND_PATH = (0, import_path4.join)(CLAUDE_COMMANDS_DIR, "dino.md");
|
|
1243
|
+
var DINO_COMMAND_CONTENT = `# /dino - Play VibeDino
|
|
1244
|
+
|
|
1245
|
+
Launch the VibeDino terminal T-Rex runner game. Use this when you need a break, when tokens are exhausted, or just for fun.
|
|
1246
|
+
|
|
1247
|
+
Run this command in the terminal:
|
|
1248
|
+
|
|
1249
|
+
\`\`\`bash
|
|
1250
|
+
npx vibedino --trigger claude
|
|
1251
|
+
\`\`\`
|
|
1252
|
+
|
|
1253
|
+
Do not add any commentary. Just run the command above.
|
|
1254
|
+
`;
|
|
1255
|
+
function installClaudeCommand() {
|
|
1256
|
+
try {
|
|
1257
|
+
if (!(0, import_fs4.existsSync)(CLAUDE_COMMANDS_DIR)) {
|
|
1258
|
+
(0, import_fs4.mkdirSync)(CLAUDE_COMMANDS_DIR, { recursive: true });
|
|
1259
|
+
}
|
|
1260
|
+
(0, import_fs4.writeFileSync)(DINO_COMMAND_PATH, DINO_COMMAND_CONTENT, "utf-8");
|
|
1261
|
+
console.log(` Installed /dino command at ${DINO_COMMAND_PATH}`);
|
|
1262
|
+
return true;
|
|
1263
|
+
} catch {
|
|
1264
|
+
return false;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function uninstallClaudeCommand() {
|
|
1268
|
+
try {
|
|
1269
|
+
if ((0, import_fs4.existsSync)(DINO_COMMAND_PATH)) {
|
|
1270
|
+
(0, import_fs4.unlinkSync)(DINO_COMMAND_PATH);
|
|
1271
|
+
console.log(" Removed /dino command.");
|
|
1272
|
+
return true;
|
|
1273
|
+
}
|
|
1274
|
+
console.log(" No /dino command found.");
|
|
1275
|
+
return false;
|
|
1276
|
+
} catch {
|
|
1277
|
+
return false;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1229
1281
|
// src/cli.ts
|
|
1230
1282
|
function printHelp() {
|
|
1231
1283
|
console.log(`
|
|
@@ -1282,7 +1334,7 @@ async function cli(argv) {
|
|
|
1282
1334
|
process.exit(0);
|
|
1283
1335
|
}
|
|
1284
1336
|
if (args.version) {
|
|
1285
|
-
console.log("vibedino v0.1.
|
|
1337
|
+
console.log("vibedino v0.1.2");
|
|
1286
1338
|
process.exit(0);
|
|
1287
1339
|
}
|
|
1288
1340
|
if (args.scores) {
|
|
@@ -1301,14 +1353,18 @@ async function cli(argv) {
|
|
|
1301
1353
|
process.exit(0);
|
|
1302
1354
|
}
|
|
1303
1355
|
if (args.install) {
|
|
1304
|
-
if (args.install === "claude")
|
|
1305
|
-
|
|
1356
|
+
if (args.install === "claude") {
|
|
1357
|
+
installClaudeHook();
|
|
1358
|
+
installClaudeCommand();
|
|
1359
|
+
} else if (args.install === "copilot") installCopilotPlugin();
|
|
1306
1360
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1307
1361
|
process.exit(0);
|
|
1308
1362
|
}
|
|
1309
1363
|
if (args.uninstall) {
|
|
1310
|
-
if (args.uninstall === "claude")
|
|
1311
|
-
|
|
1364
|
+
if (args.uninstall === "claude") {
|
|
1365
|
+
uninstallClaudeHook();
|
|
1366
|
+
uninstallClaudeCommand();
|
|
1367
|
+
} else if (args.uninstall === "copilot") uninstallCopilotPlugin();
|
|
1312
1368
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1313
1369
|
process.exit(0);
|
|
1314
1370
|
}
|
package/dist/main.js
CHANGED
|
@@ -1135,9 +1135,14 @@ function startGame(options = {}) {
|
|
|
1135
1135
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
1136
1136
|
import { join as join2 } from "path";
|
|
1137
1137
|
var HOOK_ENTRY = {
|
|
1138
|
-
matcher: "
|
|
1139
|
-
|
|
1140
|
-
|
|
1138
|
+
matcher: "",
|
|
1139
|
+
hooks: [
|
|
1140
|
+
{
|
|
1141
|
+
type: "command",
|
|
1142
|
+
command: 'npx vibedino --trigger claude --reason "Token limit reached"',
|
|
1143
|
+
timeout: 3e5
|
|
1144
|
+
}
|
|
1145
|
+
]
|
|
1141
1146
|
};
|
|
1142
1147
|
function installClaudeHook(projectDir = process.cwd()) {
|
|
1143
1148
|
const claudeDir = join2(projectDir, ".claude");
|
|
@@ -1160,7 +1165,10 @@ function installClaudeHook(projectDir = process.cwd()) {
|
|
|
1160
1165
|
hooks.PostToolUseFailure = [];
|
|
1161
1166
|
}
|
|
1162
1167
|
const existing = hooks.PostToolUseFailure;
|
|
1163
|
-
|
|
1168
|
+
const hasDino = existing.some(
|
|
1169
|
+
(h) => h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1170
|
+
);
|
|
1171
|
+
if (!hasDino) {
|
|
1164
1172
|
existing.push(HOOK_ENTRY);
|
|
1165
1173
|
}
|
|
1166
1174
|
writeFileSync2(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1176,7 +1184,7 @@ function uninstallClaudeHook(projectDir = process.cwd()) {
|
|
|
1176
1184
|
const hooks = settings.hooks?.PostToolUseFailure;
|
|
1177
1185
|
if (hooks) {
|
|
1178
1186
|
settings.hooks.PostToolUseFailure = hooks.filter(
|
|
1179
|
-
(h) => !h.command?.includes("vibedino")
|
|
1187
|
+
(h) => !h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
1180
1188
|
);
|
|
1181
1189
|
}
|
|
1182
1190
|
writeFileSync2(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -1224,6 +1232,50 @@ function uninstallCopilotPlugin() {
|
|
|
1224
1232
|
console.log(" Removed VibeDino Copilot plugin.");
|
|
1225
1233
|
}
|
|
1226
1234
|
|
|
1235
|
+
// src/integrations/commands.ts
|
|
1236
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4, unlinkSync as unlinkSync2 } from "fs";
|
|
1237
|
+
import { join as join4 } from "path";
|
|
1238
|
+
import { homedir as homedir3 } from "os";
|
|
1239
|
+
var CLAUDE_COMMANDS_DIR = join4(homedir3(), ".claude", "commands");
|
|
1240
|
+
var DINO_COMMAND_PATH = join4(CLAUDE_COMMANDS_DIR, "dino.md");
|
|
1241
|
+
var DINO_COMMAND_CONTENT = `# /dino - Play VibeDino
|
|
1242
|
+
|
|
1243
|
+
Launch the VibeDino terminal T-Rex runner game. Use this when you need a break, when tokens are exhausted, or just for fun.
|
|
1244
|
+
|
|
1245
|
+
Run this command in the terminal:
|
|
1246
|
+
|
|
1247
|
+
\`\`\`bash
|
|
1248
|
+
npx vibedino --trigger claude
|
|
1249
|
+
\`\`\`
|
|
1250
|
+
|
|
1251
|
+
Do not add any commentary. Just run the command above.
|
|
1252
|
+
`;
|
|
1253
|
+
function installClaudeCommand() {
|
|
1254
|
+
try {
|
|
1255
|
+
if (!existsSync4(CLAUDE_COMMANDS_DIR)) {
|
|
1256
|
+
mkdirSync4(CLAUDE_COMMANDS_DIR, { recursive: true });
|
|
1257
|
+
}
|
|
1258
|
+
writeFileSync4(DINO_COMMAND_PATH, DINO_COMMAND_CONTENT, "utf-8");
|
|
1259
|
+
console.log(` Installed /dino command at ${DINO_COMMAND_PATH}`);
|
|
1260
|
+
return true;
|
|
1261
|
+
} catch {
|
|
1262
|
+
return false;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
function uninstallClaudeCommand() {
|
|
1266
|
+
try {
|
|
1267
|
+
if (existsSync4(DINO_COMMAND_PATH)) {
|
|
1268
|
+
unlinkSync2(DINO_COMMAND_PATH);
|
|
1269
|
+
console.log(" Removed /dino command.");
|
|
1270
|
+
return true;
|
|
1271
|
+
}
|
|
1272
|
+
console.log(" No /dino command found.");
|
|
1273
|
+
return false;
|
|
1274
|
+
} catch {
|
|
1275
|
+
return false;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1227
1279
|
// src/cli.ts
|
|
1228
1280
|
function printHelp() {
|
|
1229
1281
|
console.log(`
|
|
@@ -1280,7 +1332,7 @@ async function cli(argv) {
|
|
|
1280
1332
|
process.exit(0);
|
|
1281
1333
|
}
|
|
1282
1334
|
if (args.version) {
|
|
1283
|
-
console.log("vibedino v0.1.
|
|
1335
|
+
console.log("vibedino v0.1.2");
|
|
1284
1336
|
process.exit(0);
|
|
1285
1337
|
}
|
|
1286
1338
|
if (args.scores) {
|
|
@@ -1299,14 +1351,18 @@ async function cli(argv) {
|
|
|
1299
1351
|
process.exit(0);
|
|
1300
1352
|
}
|
|
1301
1353
|
if (args.install) {
|
|
1302
|
-
if (args.install === "claude")
|
|
1303
|
-
|
|
1354
|
+
if (args.install === "claude") {
|
|
1355
|
+
installClaudeHook();
|
|
1356
|
+
installClaudeCommand();
|
|
1357
|
+
} else if (args.install === "copilot") installCopilotPlugin();
|
|
1304
1358
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1305
1359
|
process.exit(0);
|
|
1306
1360
|
}
|
|
1307
1361
|
if (args.uninstall) {
|
|
1308
|
-
if (args.uninstall === "claude")
|
|
1309
|
-
|
|
1362
|
+
if (args.uninstall === "claude") {
|
|
1363
|
+
uninstallClaudeHook();
|
|
1364
|
+
uninstallClaudeCommand();
|
|
1365
|
+
} else if (args.uninstall === "copilot") uninstallCopilotPlugin();
|
|
1310
1366
|
else console.log(" Unknown target. Use: claude, copilot");
|
|
1311
1367
|
process.exit(0);
|
|
1312
1368
|
}
|
package/dist/postinstall.cjs
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
// src/postinstall.ts
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var import_fs4 = require("fs");
|
|
5
|
+
var import_path4 = require("path");
|
|
6
|
+
var import_os3 = require("os");
|
|
7
7
|
|
|
8
8
|
// src/integrations/claudeCode.ts
|
|
9
9
|
var import_fs = require("fs");
|
|
10
10
|
var import_path = require("path");
|
|
11
11
|
var HOOK_ENTRY = {
|
|
12
|
-
matcher: "
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
matcher: "",
|
|
13
|
+
hooks: [
|
|
14
|
+
{
|
|
15
|
+
type: "command",
|
|
16
|
+
command: 'npx vibedino --trigger claude --reason "Token limit reached"',
|
|
17
|
+
timeout: 3e5
|
|
18
|
+
}
|
|
19
|
+
]
|
|
15
20
|
};
|
|
16
21
|
function installClaudeHook(projectDir = process.cwd()) {
|
|
17
22
|
const claudeDir = (0, import_path.join)(projectDir, ".claude");
|
|
@@ -34,7 +39,10 @@ function installClaudeHook(projectDir = process.cwd()) {
|
|
|
34
39
|
hooks.PostToolUseFailure = [];
|
|
35
40
|
}
|
|
36
41
|
const existing = hooks.PostToolUseFailure;
|
|
37
|
-
|
|
42
|
+
const hasDino = existing.some(
|
|
43
|
+
(h) => h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
44
|
+
);
|
|
45
|
+
if (!hasDino) {
|
|
38
46
|
existing.push(HOOK_ENTRY);
|
|
39
47
|
}
|
|
40
48
|
(0, import_fs.writeFileSync)(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -70,21 +78,53 @@ function installCopilotPlugin() {
|
|
|
70
78
|
console.log(` Installed VibeDino Copilot plugin at ${MANIFEST_PATH}`);
|
|
71
79
|
}
|
|
72
80
|
|
|
81
|
+
// src/integrations/commands.ts
|
|
82
|
+
var import_fs3 = require("fs");
|
|
83
|
+
var import_path3 = require("path");
|
|
84
|
+
var import_os2 = require("os");
|
|
85
|
+
var CLAUDE_COMMANDS_DIR = (0, import_path3.join)((0, import_os2.homedir)(), ".claude", "commands");
|
|
86
|
+
var DINO_COMMAND_PATH = (0, import_path3.join)(CLAUDE_COMMANDS_DIR, "dino.md");
|
|
87
|
+
var DINO_COMMAND_CONTENT = `# /dino - Play VibeDino
|
|
88
|
+
|
|
89
|
+
Launch the VibeDino terminal T-Rex runner game. Use this when you need a break, when tokens are exhausted, or just for fun.
|
|
90
|
+
|
|
91
|
+
Run this command in the terminal:
|
|
92
|
+
|
|
93
|
+
\`\`\`bash
|
|
94
|
+
npx vibedino --trigger claude
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
Do not add any commentary. Just run the command above.
|
|
98
|
+
`;
|
|
99
|
+
function installClaudeCommand() {
|
|
100
|
+
try {
|
|
101
|
+
if (!(0, import_fs3.existsSync)(CLAUDE_COMMANDS_DIR)) {
|
|
102
|
+
(0, import_fs3.mkdirSync)(CLAUDE_COMMANDS_DIR, { recursive: true });
|
|
103
|
+
}
|
|
104
|
+
(0, import_fs3.writeFileSync)(DINO_COMMAND_PATH, DINO_COMMAND_CONTENT, "utf-8");
|
|
105
|
+
console.log(` Installed /dino command at ${DINO_COMMAND_PATH}`);
|
|
106
|
+
return true;
|
|
107
|
+
} catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
73
112
|
// src/postinstall.ts
|
|
74
113
|
var isGlobal = process.env.npm_config_global === "true" || process.argv.includes("--global") || !process.env.INIT_CWD?.includes("node_modules");
|
|
75
114
|
if (isGlobal) {
|
|
76
|
-
const home = (0,
|
|
115
|
+
const home = (0, import_os3.homedir)();
|
|
77
116
|
let installed = false;
|
|
78
|
-
const claudeDir = (0,
|
|
79
|
-
if ((0,
|
|
117
|
+
const claudeDir = (0, import_path4.join)(home, ".claude");
|
|
118
|
+
if ((0, import_fs4.existsSync)(claudeDir)) {
|
|
80
119
|
try {
|
|
81
120
|
installClaudeHook(home);
|
|
121
|
+
installClaudeCommand();
|
|
82
122
|
installed = true;
|
|
83
123
|
} catch {
|
|
84
124
|
}
|
|
85
125
|
}
|
|
86
|
-
const copilotDir = (0,
|
|
87
|
-
if ((0,
|
|
126
|
+
const copilotDir = (0, import_path4.join)(home, ".copilot");
|
|
127
|
+
if ((0, import_fs4.existsSync)(copilotDir)) {
|
|
88
128
|
try {
|
|
89
129
|
installCopilotPlugin();
|
|
90
130
|
installed = true;
|
|
@@ -92,7 +132,7 @@ if (isGlobal) {
|
|
|
92
132
|
}
|
|
93
133
|
}
|
|
94
134
|
if (installed) {
|
|
95
|
-
console.log("\n \u{1F995} VibeDino
|
|
135
|
+
console.log("\n \u{1F995} VibeDino installed! Hooks + /dino command ready.\n");
|
|
96
136
|
} else {
|
|
97
137
|
console.log("\n \u{1F995} VibeDino installed! Run: vibedino --install claude (or copilot)\n");
|
|
98
138
|
}
|
package/dist/postinstall.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
// src/postinstall.ts
|
|
2
|
-
import { existsSync as
|
|
3
|
-
import { join as
|
|
4
|
-
import { homedir as
|
|
2
|
+
import { existsSync as existsSync4 } from "fs";
|
|
3
|
+
import { join as join4 } from "path";
|
|
4
|
+
import { homedir as homedir3 } from "os";
|
|
5
5
|
|
|
6
6
|
// src/integrations/claudeCode.ts
|
|
7
7
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
8
8
|
import { join } from "path";
|
|
9
9
|
var HOOK_ENTRY = {
|
|
10
|
-
matcher: "
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
matcher: "",
|
|
11
|
+
hooks: [
|
|
12
|
+
{
|
|
13
|
+
type: "command",
|
|
14
|
+
command: 'npx vibedino --trigger claude --reason "Token limit reached"',
|
|
15
|
+
timeout: 3e5
|
|
16
|
+
}
|
|
17
|
+
]
|
|
13
18
|
};
|
|
14
19
|
function installClaudeHook(projectDir = process.cwd()) {
|
|
15
20
|
const claudeDir = join(projectDir, ".claude");
|
|
@@ -32,7 +37,10 @@ function installClaudeHook(projectDir = process.cwd()) {
|
|
|
32
37
|
hooks.PostToolUseFailure = [];
|
|
33
38
|
}
|
|
34
39
|
const existing = hooks.PostToolUseFailure;
|
|
35
|
-
|
|
40
|
+
const hasDino = existing.some(
|
|
41
|
+
(h) => h.hooks?.some((inner) => inner.command?.includes("vibedino"))
|
|
42
|
+
);
|
|
43
|
+
if (!hasDino) {
|
|
36
44
|
existing.push(HOOK_ENTRY);
|
|
37
45
|
}
|
|
38
46
|
writeFileSync(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -68,21 +76,53 @@ function installCopilotPlugin() {
|
|
|
68
76
|
console.log(` Installed VibeDino Copilot plugin at ${MANIFEST_PATH}`);
|
|
69
77
|
}
|
|
70
78
|
|
|
79
|
+
// src/integrations/commands.ts
|
|
80
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, writeFileSync as writeFileSync3, unlinkSync as unlinkSync2 } from "fs";
|
|
81
|
+
import { join as join3 } from "path";
|
|
82
|
+
import { homedir as homedir2 } from "os";
|
|
83
|
+
var CLAUDE_COMMANDS_DIR = join3(homedir2(), ".claude", "commands");
|
|
84
|
+
var DINO_COMMAND_PATH = join3(CLAUDE_COMMANDS_DIR, "dino.md");
|
|
85
|
+
var DINO_COMMAND_CONTENT = `# /dino - Play VibeDino
|
|
86
|
+
|
|
87
|
+
Launch the VibeDino terminal T-Rex runner game. Use this when you need a break, when tokens are exhausted, or just for fun.
|
|
88
|
+
|
|
89
|
+
Run this command in the terminal:
|
|
90
|
+
|
|
91
|
+
\`\`\`bash
|
|
92
|
+
npx vibedino --trigger claude
|
|
93
|
+
\`\`\`
|
|
94
|
+
|
|
95
|
+
Do not add any commentary. Just run the command above.
|
|
96
|
+
`;
|
|
97
|
+
function installClaudeCommand() {
|
|
98
|
+
try {
|
|
99
|
+
if (!existsSync3(CLAUDE_COMMANDS_DIR)) {
|
|
100
|
+
mkdirSync3(CLAUDE_COMMANDS_DIR, { recursive: true });
|
|
101
|
+
}
|
|
102
|
+
writeFileSync3(DINO_COMMAND_PATH, DINO_COMMAND_CONTENT, "utf-8");
|
|
103
|
+
console.log(` Installed /dino command at ${DINO_COMMAND_PATH}`);
|
|
104
|
+
return true;
|
|
105
|
+
} catch {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
71
110
|
// src/postinstall.ts
|
|
72
111
|
var isGlobal = process.env.npm_config_global === "true" || process.argv.includes("--global") || !process.env.INIT_CWD?.includes("node_modules");
|
|
73
112
|
if (isGlobal) {
|
|
74
|
-
const home =
|
|
113
|
+
const home = homedir3();
|
|
75
114
|
let installed = false;
|
|
76
|
-
const claudeDir =
|
|
77
|
-
if (
|
|
115
|
+
const claudeDir = join4(home, ".claude");
|
|
116
|
+
if (existsSync4(claudeDir)) {
|
|
78
117
|
try {
|
|
79
118
|
installClaudeHook(home);
|
|
119
|
+
installClaudeCommand();
|
|
80
120
|
installed = true;
|
|
81
121
|
} catch {
|
|
82
122
|
}
|
|
83
123
|
}
|
|
84
|
-
const copilotDir =
|
|
85
|
-
if (
|
|
124
|
+
const copilotDir = join4(home, ".copilot");
|
|
125
|
+
if (existsSync4(copilotDir)) {
|
|
86
126
|
try {
|
|
87
127
|
installCopilotPlugin();
|
|
88
128
|
installed = true;
|
|
@@ -90,7 +130,7 @@ if (isGlobal) {
|
|
|
90
130
|
}
|
|
91
131
|
}
|
|
92
132
|
if (installed) {
|
|
93
|
-
console.log("\n \u{1F995} VibeDino
|
|
133
|
+
console.log("\n \u{1F995} VibeDino installed! Hooks + /dino command ready.\n");
|
|
94
134
|
} else {
|
|
95
135
|
console.log("\n \u{1F995} VibeDino installed! Run: vibedino --install claude (or copilot)\n");
|
|
96
136
|
}
|