shiva-code 0.8.4 → 0.8.6
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 +23 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -143,6 +143,7 @@ import {
|
|
|
143
143
|
// src/index.ts
|
|
144
144
|
import { Command as Command44 } from "commander";
|
|
145
145
|
import * as readline from "readline";
|
|
146
|
+
import * as os8 from "os";
|
|
146
147
|
|
|
147
148
|
// src/services/onboarding/welcome.ts
|
|
148
149
|
import { existsSync } from "fs";
|
|
@@ -334,9 +335,9 @@ async function promptLogin() {
|
|
|
334
335
|
async function installHooksSilently() {
|
|
335
336
|
try {
|
|
336
337
|
const { existsSync: existsSync27, readFileSync: readFileSync15, writeFileSync: writeFileSync13, mkdirSync: mkdirSync7 } = await import("fs");
|
|
337
|
-
const { homedir:
|
|
338
|
+
const { homedir: homedir12 } = await import("os");
|
|
338
339
|
const { join: join17 } = await import("path");
|
|
339
|
-
const CLAUDE_SETTINGS_PATH3 = join17(
|
|
340
|
+
const CLAUDE_SETTINGS_PATH3 = join17(homedir12(), ".claude", "settings.json");
|
|
340
341
|
let settings = {};
|
|
341
342
|
if (existsSync27(CLAUDE_SETTINGS_PATH3)) {
|
|
342
343
|
try {
|
|
@@ -367,7 +368,7 @@ async function installHooksSilently() {
|
|
|
367
368
|
hooks: [{ type: "command", command: "shiva sync --push --quiet", timeout: 30 }]
|
|
368
369
|
});
|
|
369
370
|
}
|
|
370
|
-
const dir = join17(
|
|
371
|
+
const dir = join17(homedir12(), ".claude");
|
|
371
372
|
if (!existsSync27(dir)) {
|
|
372
373
|
mkdirSync7(dir, { recursive: true });
|
|
373
374
|
}
|
|
@@ -4205,13 +4206,9 @@ async function spawnInTmux(projects, sessionName) {
|
|
|
4205
4206
|
"-n",
|
|
4206
4207
|
safeName,
|
|
4207
4208
|
"-c",
|
|
4208
|
-
project.projectPath
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
spawnSync2("tmux", [
|
|
4212
|
-
"send-keys",
|
|
4213
|
-
claudeCmd,
|
|
4214
|
-
"Enter"
|
|
4209
|
+
project.projectPath,
|
|
4210
|
+
"claude",
|
|
4211
|
+
...claudeArgs
|
|
4215
4212
|
], { stdio: "inherit" });
|
|
4216
4213
|
} else {
|
|
4217
4214
|
if (i === 0) {
|
|
@@ -4223,7 +4220,9 @@ async function spawnInTmux(projects, sessionName) {
|
|
|
4223
4220
|
"-n",
|
|
4224
4221
|
safeName,
|
|
4225
4222
|
"-c",
|
|
4226
|
-
project.projectPath
|
|
4223
|
+
project.projectPath,
|
|
4224
|
+
"claude",
|
|
4225
|
+
...claudeArgs
|
|
4227
4226
|
], { stdio: "inherit" });
|
|
4228
4227
|
const tmuxStyleCommands = [
|
|
4229
4228
|
// Status bar background: dark with orange accent
|
|
@@ -4252,17 +4251,11 @@ async function spawnInTmux(projects, sessionName) {
|
|
|
4252
4251
|
"-n",
|
|
4253
4252
|
safeName,
|
|
4254
4253
|
"-c",
|
|
4255
|
-
project.projectPath
|
|
4254
|
+
project.projectPath,
|
|
4255
|
+
"claude",
|
|
4256
|
+
...claudeArgs
|
|
4256
4257
|
], { stdio: "inherit" });
|
|
4257
4258
|
}
|
|
4258
|
-
const claudeCmd = ["claude", ...claudeArgs].join(" ");
|
|
4259
|
-
spawnSync2("tmux", [
|
|
4260
|
-
"send-keys",
|
|
4261
|
-
"-t",
|
|
4262
|
-
`${tmuxSession}:${safeName}`,
|
|
4263
|
-
claudeCmd,
|
|
4264
|
-
"Enter"
|
|
4265
|
-
], { stdio: "inherit" });
|
|
4266
4259
|
}
|
|
4267
4260
|
}
|
|
4268
4261
|
if (!insideTmux) {
|
|
@@ -13362,9 +13355,9 @@ complete -F _shiva_completions shiva
|
|
|
13362
13355
|
}
|
|
13363
13356
|
async function installBashCompletion() {
|
|
13364
13357
|
const fs15 = await import("fs");
|
|
13365
|
-
const
|
|
13358
|
+
const os9 = await import("os");
|
|
13366
13359
|
const path15 = await import("path");
|
|
13367
|
-
const bashrcPath = path15.join(
|
|
13360
|
+
const bashrcPath = path15.join(os9.homedir(), ".bashrc");
|
|
13368
13361
|
const completionScript = generateBashCompletion();
|
|
13369
13362
|
const marker = "# SHIVA Code Bash Completion";
|
|
13370
13363
|
try {
|
|
@@ -13505,9 +13498,9 @@ compdef _shiva shiva
|
|
|
13505
13498
|
}
|
|
13506
13499
|
async function installZshCompletion() {
|
|
13507
13500
|
const fs15 = await import("fs");
|
|
13508
|
-
const
|
|
13501
|
+
const os9 = await import("os");
|
|
13509
13502
|
const path15 = await import("path");
|
|
13510
|
-
const zshrcPath = path15.join(
|
|
13503
|
+
const zshrcPath = path15.join(os9.homedir(), ".zshrc");
|
|
13511
13504
|
const completionScript = generateZshCompletion();
|
|
13512
13505
|
const marker = "# SHIVA Code Zsh Completion";
|
|
13513
13506
|
try {
|
|
@@ -13610,9 +13603,9 @@ complete -c shiva -n "__fish_seen_subcommand_from stats" -l json -d "JSON Output
|
|
|
13610
13603
|
}
|
|
13611
13604
|
async function installFishCompletion() {
|
|
13612
13605
|
const fs15 = await import("fs");
|
|
13613
|
-
const
|
|
13606
|
+
const os9 = await import("os");
|
|
13614
13607
|
const path15 = await import("path");
|
|
13615
|
-
const fishCompletionsDir = path15.join(
|
|
13608
|
+
const fishCompletionsDir = path15.join(os9.homedir(), ".config", "fish", "completions");
|
|
13616
13609
|
const fishCompletionPath = path15.join(fishCompletionsDir, "shiva.fish");
|
|
13617
13610
|
const completionScript = generateFishCompletion();
|
|
13618
13611
|
try {
|
|
@@ -16203,7 +16196,7 @@ hookCommand.command("scan-session").description("Session nach sensiblen Tokens s
|
|
|
16203
16196
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
16204
16197
|
const { existsSync: existsSync27, readFileSync: readFileSync15, writeFileSync: writeFileSync13, readdirSync: readdirSync6, statSync: statSync7 } = await import("fs");
|
|
16205
16198
|
const { join: join17 } = await import("path");
|
|
16206
|
-
const { homedir:
|
|
16199
|
+
const { homedir: homedir12 } = await import("os");
|
|
16207
16200
|
const quiet = options.quiet;
|
|
16208
16201
|
try {
|
|
16209
16202
|
let autoRedact = options.redact || false;
|
|
@@ -16218,7 +16211,7 @@ hookCommand.command("scan-session").description("Session nach sensiblen Tokens s
|
|
|
16218
16211
|
} catch {
|
|
16219
16212
|
}
|
|
16220
16213
|
}
|
|
16221
|
-
const claudeProjectsPath = join17(
|
|
16214
|
+
const claudeProjectsPath = join17(homedir12(), ".claude", "projects");
|
|
16222
16215
|
let sessionFiles = [];
|
|
16223
16216
|
if (options.path) {
|
|
16224
16217
|
sessionFiles = [options.path];
|
|
@@ -17221,8 +17214,10 @@ async function showDashboard() {
|
|
|
17221
17214
|
}
|
|
17222
17215
|
const projects = await getAllClaudeProjects();
|
|
17223
17216
|
const packages = getAllPackages();
|
|
17217
|
+
const homeDir = os8.homedir();
|
|
17224
17218
|
const recentProjects = projects.filter((p) => {
|
|
17225
17219
|
if (p.sessions.length === 0) return false;
|
|
17220
|
+
if (p.absolutePath === homeDir) return false;
|
|
17226
17221
|
if (p.latestSession && isSessionCorrupted(p.latestSession)) return false;
|
|
17227
17222
|
return true;
|
|
17228
17223
|
}).slice(0, 5);
|