shiva-code 0.7.0 → 0.7.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/index.js +251 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -219,27 +219,27 @@ function generateBackupCodes(count = 10) {
|
|
|
219
219
|
return codes;
|
|
220
220
|
}
|
|
221
221
|
function generateDeviceFingerprint() {
|
|
222
|
-
const
|
|
222
|
+
const os8 = __require("os");
|
|
223
223
|
const components = [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
os8.hostname(),
|
|
225
|
+
os8.platform(),
|
|
226
|
+
os8.arch(),
|
|
227
|
+
os8.cpus()[0]?.model || "unknown",
|
|
228
|
+
os8.userInfo().username
|
|
229
229
|
];
|
|
230
230
|
const fingerprint = crypto.createHash("sha256").update(components.join("|")).digest("hex").slice(0, 32);
|
|
231
231
|
return fingerprint;
|
|
232
232
|
}
|
|
233
233
|
function getDeviceName() {
|
|
234
|
-
const
|
|
235
|
-
const hostname =
|
|
236
|
-
const
|
|
234
|
+
const os8 = __require("os");
|
|
235
|
+
const hostname = os8.hostname();
|
|
236
|
+
const platform2 = os8.platform();
|
|
237
237
|
const platformNames = {
|
|
238
238
|
darwin: "macOS",
|
|
239
239
|
linux: "Linux",
|
|
240
240
|
win32: "Windows"
|
|
241
241
|
};
|
|
242
|
-
return `${hostname} (${platformNames[
|
|
242
|
+
return `${hostname} (${platformNames[platform2] || platform2})`;
|
|
243
243
|
}
|
|
244
244
|
var TwoFactorService = class {
|
|
245
245
|
/**
|
|
@@ -7214,7 +7214,7 @@ sessionsCommand.command("resume <sessionId>").description("Cloud-Session fortset
|
|
|
7214
7214
|
sessionsCommand.command("export <sessionId>").description("Cloud-Session exportieren").option("-o, --output <file>", "Ausgabedatei").action(async (sessionId, options) => {
|
|
7215
7215
|
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7216
7216
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7217
|
-
const { writeFileSync:
|
|
7217
|
+
const { writeFileSync: writeFileSync12 } = await import("fs");
|
|
7218
7218
|
if (!isAuthenticated2()) {
|
|
7219
7219
|
log.error("Nicht angemeldet");
|
|
7220
7220
|
log.info("Anmelden mit: shiva login");
|
|
@@ -7225,7 +7225,7 @@ sessionsCommand.command("export <sessionId>").description("Cloud-Session exporti
|
|
|
7225
7225
|
const exportData = await api2.exportSession(sessionId);
|
|
7226
7226
|
spinner.stop();
|
|
7227
7227
|
if (options.output) {
|
|
7228
|
-
|
|
7228
|
+
writeFileSync12(options.output, JSON.stringify(exportData, null, 2));
|
|
7229
7229
|
log.success(`Session exportiert: ${options.output}`);
|
|
7230
7230
|
} else {
|
|
7231
7231
|
console.log(JSON.stringify(exportData, null, 2));
|
|
@@ -9003,8 +9003,7 @@ var PackageScannerService = class {
|
|
|
9003
9003
|
};
|
|
9004
9004
|
packageInfoCache.set(cacheKey, { data: info, timestamp: Date.now() });
|
|
9005
9005
|
return info;
|
|
9006
|
-
} catch
|
|
9007
|
-
console.error(`Failed to fetch npm package info for ${name}:`, error);
|
|
9006
|
+
} catch {
|
|
9008
9007
|
return null;
|
|
9009
9008
|
}
|
|
9010
9009
|
}
|
|
@@ -9040,8 +9039,7 @@ var PackageScannerService = class {
|
|
|
9040
9039
|
};
|
|
9041
9040
|
packageInfoCache.set(cacheKey, { data: info, timestamp: Date.now() });
|
|
9042
9041
|
return info;
|
|
9043
|
-
} catch
|
|
9044
|
-
console.error(`Failed to fetch PyPI package info for ${name}:`, error);
|
|
9042
|
+
} catch {
|
|
9045
9043
|
return null;
|
|
9046
9044
|
}
|
|
9047
9045
|
}
|
|
@@ -9080,8 +9078,7 @@ var PackageScannerService = class {
|
|
|
9080
9078
|
};
|
|
9081
9079
|
packageInfoCache.set(cacheKey, { data: info, timestamp: Date.now() });
|
|
9082
9080
|
return info;
|
|
9083
|
-
} catch
|
|
9084
|
-
console.error(`Failed to fetch Cargo package info for ${name}:`, error);
|
|
9081
|
+
} catch {
|
|
9085
9082
|
return null;
|
|
9086
9083
|
}
|
|
9087
9084
|
}
|
|
@@ -12979,10 +12976,39 @@ import { Command as Command29 } from "commander";
|
|
|
12979
12976
|
import { execSync as execSync4, spawn as spawn6 } from "child_process";
|
|
12980
12977
|
import * as fs12 from "fs";
|
|
12981
12978
|
import * as path13 from "path";
|
|
12979
|
+
import * as os6 from "os";
|
|
12980
|
+
import * as crypto3 from "crypto";
|
|
12982
12981
|
import { fileURLToPath } from "url";
|
|
12983
12982
|
var __filename = fileURLToPath(import.meta.url);
|
|
12984
12983
|
var __dirname = path13.dirname(__filename);
|
|
12985
12984
|
var PACKAGE_NAME = "shiva-code";
|
|
12985
|
+
var GITHUB_REPO = "Aimtaim/shiva-code";
|
|
12986
|
+
function detectInstallationType() {
|
|
12987
|
+
const execPath = process.execPath;
|
|
12988
|
+
const execName = path13.basename(execPath).toLowerCase();
|
|
12989
|
+
if (execName === "shiva" || execName === "shiva.exe") {
|
|
12990
|
+
const possibleNodeModules = path13.resolve(path13.dirname(execPath), "../node_modules");
|
|
12991
|
+
if (!fs12.existsSync(possibleNodeModules)) {
|
|
12992
|
+
return "native";
|
|
12993
|
+
}
|
|
12994
|
+
}
|
|
12995
|
+
try {
|
|
12996
|
+
const npmGlobal = execSync4("npm list -g --depth=0 2>/dev/null", { encoding: "utf-8" });
|
|
12997
|
+
if (npmGlobal.includes(PACKAGE_NAME)) return "npm";
|
|
12998
|
+
} catch {
|
|
12999
|
+
}
|
|
13000
|
+
try {
|
|
13001
|
+
const yarnGlobal = execSync4("yarn global list 2>/dev/null", { encoding: "utf-8" });
|
|
13002
|
+
if (yarnGlobal.includes(PACKAGE_NAME)) return "yarn";
|
|
13003
|
+
} catch {
|
|
13004
|
+
}
|
|
13005
|
+
try {
|
|
13006
|
+
const pnpmGlobal = execSync4("pnpm list -g 2>/dev/null", { encoding: "utf-8" });
|
|
13007
|
+
if (pnpmGlobal.includes(PACKAGE_NAME)) return "pnpm";
|
|
13008
|
+
} catch {
|
|
13009
|
+
}
|
|
13010
|
+
return "npm";
|
|
13011
|
+
}
|
|
12986
13012
|
function getCurrentVersion() {
|
|
12987
13013
|
try {
|
|
12988
13014
|
const packageJsonPath = path13.resolve(__dirname, "../../package.json");
|
|
@@ -12992,23 +13018,32 @@ function getCurrentVersion() {
|
|
|
12992
13018
|
}
|
|
12993
13019
|
} catch {
|
|
12994
13020
|
}
|
|
12995
|
-
|
|
13021
|
+
try {
|
|
13022
|
+
const output = execSync4(`"${process.execPath}" --version 2>/dev/null`, { encoding: "utf-8" }).trim();
|
|
13023
|
+
return output || "0.0.0";
|
|
13024
|
+
} catch {
|
|
13025
|
+
return "0.7.0";
|
|
13026
|
+
}
|
|
12996
13027
|
}
|
|
12997
|
-
async function
|
|
13028
|
+
async function getLatestNpmVersion() {
|
|
12998
13029
|
try {
|
|
12999
13030
|
const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}`);
|
|
13000
13031
|
if (!response.ok) return null;
|
|
13001
13032
|
const data = await response.json();
|
|
13002
13033
|
return data["dist-tags"]?.latest || null;
|
|
13003
13034
|
} catch {
|
|
13004
|
-
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13035
|
+
return null;
|
|
13036
|
+
}
|
|
13037
|
+
}
|
|
13038
|
+
async function getLatestGitHubVersion() {
|
|
13039
|
+
try {
|
|
13040
|
+
const response = await fetch(`https://api.github.com/repos/${GITHUB_REPO}/releases/latest`);
|
|
13041
|
+
if (!response.ok) return null;
|
|
13042
|
+
const release2 = await response.json();
|
|
13043
|
+
const version = release2.tag_name.replace(/^v/, "");
|
|
13044
|
+
return { version, release: release2 };
|
|
13045
|
+
} catch {
|
|
13046
|
+
return null;
|
|
13012
13047
|
}
|
|
13013
13048
|
}
|
|
13014
13049
|
function compareVersions(current, latest) {
|
|
@@ -13022,32 +13057,155 @@ function compareVersions(current, latest) {
|
|
|
13022
13057
|
}
|
|
13023
13058
|
return 0;
|
|
13024
13059
|
}
|
|
13025
|
-
async function checkForUpdates() {
|
|
13060
|
+
async function checkForUpdates(installType) {
|
|
13026
13061
|
const current = getCurrentVersion();
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13062
|
+
if (installType === "native") {
|
|
13063
|
+
const github = await getLatestGitHubVersion();
|
|
13064
|
+
return {
|
|
13065
|
+
current,
|
|
13066
|
+
latest: github?.version || current,
|
|
13067
|
+
isOutdated: github ? compareVersions(current, github.version) < 0 : false,
|
|
13068
|
+
source: "github"
|
|
13069
|
+
};
|
|
13070
|
+
} else {
|
|
13071
|
+
const latest = await getLatestNpmVersion();
|
|
13072
|
+
return {
|
|
13073
|
+
current,
|
|
13074
|
+
latest: latest || current,
|
|
13075
|
+
isOutdated: latest ? compareVersions(current, latest) < 0 : false,
|
|
13076
|
+
source: "npm"
|
|
13077
|
+
};
|
|
13078
|
+
}
|
|
13033
13079
|
}
|
|
13034
|
-
function
|
|
13035
|
-
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13080
|
+
function getPlatformIdentifier() {
|
|
13081
|
+
const platform2 = os6.platform();
|
|
13082
|
+
const arch3 = os6.arch();
|
|
13083
|
+
let platformStr;
|
|
13084
|
+
let archStr;
|
|
13085
|
+
switch (platform2) {
|
|
13086
|
+
case "linux":
|
|
13087
|
+
platformStr = "linux";
|
|
13088
|
+
break;
|
|
13089
|
+
case "darwin":
|
|
13090
|
+
platformStr = "darwin";
|
|
13091
|
+
break;
|
|
13092
|
+
case "win32":
|
|
13093
|
+
platformStr = "windows";
|
|
13094
|
+
break;
|
|
13095
|
+
default:
|
|
13096
|
+
return null;
|
|
13097
|
+
}
|
|
13098
|
+
switch (arch3) {
|
|
13099
|
+
case "x64":
|
|
13100
|
+
case "amd64":
|
|
13101
|
+
archStr = "x64";
|
|
13102
|
+
break;
|
|
13103
|
+
case "arm64":
|
|
13104
|
+
case "aarch64":
|
|
13105
|
+
archStr = "arm64";
|
|
13106
|
+
break;
|
|
13107
|
+
default:
|
|
13108
|
+
return null;
|
|
13109
|
+
}
|
|
13110
|
+
const ext = platform2 === "win32" ? ".exe" : "";
|
|
13111
|
+
const binaryName = `shiva-${platformStr}-${archStr}${ext}`;
|
|
13112
|
+
return { platform: platformStr, arch: archStr, binaryName };
|
|
13113
|
+
}
|
|
13114
|
+
async function downloadFile(url, dest) {
|
|
13115
|
+
const response = await fetch(url);
|
|
13116
|
+
if (!response.ok) {
|
|
13117
|
+
throw new Error(`Download failed: ${response.status} ${response.statusText}`);
|
|
13039
13118
|
}
|
|
13119
|
+
const buffer = await response.arrayBuffer();
|
|
13120
|
+
fs12.writeFileSync(dest, Buffer.from(buffer));
|
|
13121
|
+
}
|
|
13122
|
+
async function verifyChecksum(filePath, checksumUrl) {
|
|
13040
13123
|
try {
|
|
13041
|
-
const
|
|
13042
|
-
if (
|
|
13124
|
+
const response = await fetch(checksumUrl);
|
|
13125
|
+
if (!response.ok) {
|
|
13126
|
+
log.warn("Checksum-Datei nicht gefunden, \xFCberspringe Verifikation");
|
|
13127
|
+
return true;
|
|
13128
|
+
}
|
|
13129
|
+
const expectedHash = (await response.text()).trim().split(" ")[0].toLowerCase();
|
|
13130
|
+
const fileBuffer = fs12.readFileSync(filePath);
|
|
13131
|
+
const actualHash = crypto3.createHash("sha256").update(fileBuffer).digest("hex").toLowerCase();
|
|
13132
|
+
return expectedHash === actualHash;
|
|
13043
13133
|
} catch {
|
|
13134
|
+
log.warn("Checksum-Verifikation fehlgeschlagen, \xFCberspringe");
|
|
13135
|
+
return true;
|
|
13044
13136
|
}
|
|
13137
|
+
}
|
|
13138
|
+
async function updateNativeBinary(targetVersion) {
|
|
13139
|
+
const platformInfo = getPlatformIdentifier();
|
|
13140
|
+
if (!platformInfo) {
|
|
13141
|
+
log.error("Plattform nicht unterst\xFCtzt f\xFCr Native Update");
|
|
13142
|
+
return false;
|
|
13143
|
+
}
|
|
13144
|
+
const { binaryName } = platformInfo;
|
|
13145
|
+
const downloadUrl = `https://github.com/${GITHUB_REPO}/releases/download/v${targetVersion}/${binaryName}`;
|
|
13146
|
+
const checksumUrl = `${downloadUrl}.sha256`;
|
|
13147
|
+
const currentBinary = process.execPath;
|
|
13148
|
+
const tempDir = os6.tmpdir();
|
|
13149
|
+
const tempBinary = path13.join(tempDir, `shiva-update-${Date.now()}${platformInfo.platform === "windows" ? ".exe" : ""}`);
|
|
13150
|
+
const backupBinary = `${currentBinary}.backup`;
|
|
13045
13151
|
try {
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13152
|
+
log.info(`Lade ${binaryName} herunter...`);
|
|
13153
|
+
log.dim(` URL: ${downloadUrl}`);
|
|
13154
|
+
await downloadFile(downloadUrl, tempBinary);
|
|
13155
|
+
log.info("Verifiziere Checksum...");
|
|
13156
|
+
const checksumValid = await verifyChecksum(tempBinary, checksumUrl);
|
|
13157
|
+
if (!checksumValid) {
|
|
13158
|
+
log.error("Checksum stimmt nicht \xFCberein! Update abgebrochen.");
|
|
13159
|
+
fs12.unlinkSync(tempBinary);
|
|
13160
|
+
return false;
|
|
13161
|
+
}
|
|
13162
|
+
log.success(" Checksum OK");
|
|
13163
|
+
if (platformInfo.platform !== "windows") {
|
|
13164
|
+
fs12.chmodSync(tempBinary, 493);
|
|
13165
|
+
}
|
|
13166
|
+
log.info("Erstelle Backup...");
|
|
13167
|
+
if (fs12.existsSync(currentBinary)) {
|
|
13168
|
+
fs12.copyFileSync(currentBinary, backupBinary);
|
|
13169
|
+
}
|
|
13170
|
+
log.info("Installiere neue Version...");
|
|
13171
|
+
if (platformInfo.platform === "windows") {
|
|
13172
|
+
const updateScript = path13.join(tempDir, "shiva-update.bat");
|
|
13173
|
+
const scriptContent = `
|
|
13174
|
+
@echo off
|
|
13175
|
+
timeout /t 1 /nobreak >nul
|
|
13176
|
+
move /y "${tempBinary}" "${currentBinary}"
|
|
13177
|
+
del "${backupBinary}" 2>nul
|
|
13178
|
+
del "%~f0"
|
|
13179
|
+
`;
|
|
13180
|
+
fs12.writeFileSync(updateScript, scriptContent);
|
|
13181
|
+
spawn6("cmd", ["/c", updateScript], { detached: true, stdio: "ignore" }).unref();
|
|
13182
|
+
log.success("Update wird nach Beenden angewendet");
|
|
13183
|
+
log.info("Bitte starte SHIVA neu.");
|
|
13184
|
+
} else {
|
|
13185
|
+
fs12.renameSync(tempBinary, currentBinary);
|
|
13186
|
+
if (fs12.existsSync(backupBinary)) {
|
|
13187
|
+
fs12.unlinkSync(backupBinary);
|
|
13188
|
+
}
|
|
13189
|
+
}
|
|
13190
|
+
return true;
|
|
13191
|
+
} catch (error) {
|
|
13192
|
+
log.error(`Update fehlgeschlagen: ${error instanceof Error ? error.message : String(error)}`);
|
|
13193
|
+
if (fs12.existsSync(backupBinary) && fs12.existsSync(currentBinary)) {
|
|
13194
|
+
try {
|
|
13195
|
+
fs12.copyFileSync(backupBinary, currentBinary);
|
|
13196
|
+
log.info("Backup wiederhergestellt");
|
|
13197
|
+
} catch {
|
|
13198
|
+
log.warn("Backup konnte nicht wiederhergestellt werden");
|
|
13199
|
+
}
|
|
13200
|
+
}
|
|
13201
|
+
if (fs12.existsSync(tempBinary)) {
|
|
13202
|
+
try {
|
|
13203
|
+
fs12.unlinkSync(tempBinary);
|
|
13204
|
+
} catch {
|
|
13205
|
+
}
|
|
13206
|
+
}
|
|
13207
|
+
return false;
|
|
13049
13208
|
}
|
|
13050
|
-
return "npm";
|
|
13051
13209
|
}
|
|
13052
13210
|
function getUpgradeCommand(pm) {
|
|
13053
13211
|
switch (pm) {
|
|
@@ -13061,7 +13219,7 @@ function getUpgradeCommand(pm) {
|
|
|
13061
13219
|
return `npm install -g ${PACKAGE_NAME}@latest`;
|
|
13062
13220
|
}
|
|
13063
13221
|
}
|
|
13064
|
-
async function
|
|
13222
|
+
async function runPackageManagerUpgrade(pm) {
|
|
13065
13223
|
const command = getUpgradeCommand(pm);
|
|
13066
13224
|
const [cmd, ...args] = command.split(" ");
|
|
13067
13225
|
return new Promise((resolve14) => {
|
|
@@ -13079,14 +13237,22 @@ async function runUpgrade(pm) {
|
|
|
13079
13237
|
});
|
|
13080
13238
|
});
|
|
13081
13239
|
}
|
|
13082
|
-
var upgradeCommand = new Command29("upgrade").description("SHIVA CLI aktualisieren").option("-c, --check", "Nur auf Updates pr\xFCfen, nicht installieren").option("-f, --force", "Update erzwingen, auch wenn aktuell").option("--npm", "npm verwenden").option("--yarn", "yarn verwenden").option("--pnpm", "pnpm verwenden").action(async (options) => {
|
|
13240
|
+
var upgradeCommand = new Command29("upgrade").description("SHIVA CLI aktualisieren").option("-c, --check", "Nur auf Updates pr\xFCfen, nicht installieren").option("-f, --force", "Update erzwingen, auch wenn aktuell").option("--npm", "npm verwenden (f\xFCr npm-Installationen)").option("--yarn", "yarn verwenden").option("--pnpm", "pnpm verwenden").option("--native", "Native Binary Update erzwingen").action(async (options) => {
|
|
13083
13241
|
log.newline();
|
|
13084
13242
|
console.log(colors.orange.bold("\u{1F680} SHIVA Upgrade"));
|
|
13085
13243
|
log.newline();
|
|
13244
|
+
let installType = detectInstallationType();
|
|
13245
|
+
if (options.native) installType = "native";
|
|
13246
|
+
else if (options.npm) installType = "npm";
|
|
13247
|
+
else if (options.yarn) installType = "yarn";
|
|
13248
|
+
else if (options.pnpm) installType = "pnpm";
|
|
13249
|
+
log.dim(`Installation: ${installType}`);
|
|
13250
|
+
log.newline();
|
|
13086
13251
|
log.info("Pr\xFCfe auf Updates...");
|
|
13087
|
-
const versionInfo = await checkForUpdates();
|
|
13252
|
+
const versionInfo = await checkForUpdates(installType);
|
|
13088
13253
|
console.log(` Installiert: ${colors.bold(versionInfo.current)}`);
|
|
13089
13254
|
console.log(` Verf\xFCgbar: ${colors.bold(versionInfo.latest)}`);
|
|
13255
|
+
console.log(` Quelle: ${colors.dim(versionInfo.source)}`);
|
|
13090
13256
|
log.newline();
|
|
13091
13257
|
if (!versionInfo.isOutdated && !options.force) {
|
|
13092
13258
|
log.success("SHIVA ist bereits auf dem neuesten Stand!");
|
|
@@ -13102,26 +13268,34 @@ var upgradeCommand = new Command29("upgrade").description("SHIVA CLI aktualisier
|
|
|
13102
13268
|
}
|
|
13103
13269
|
return;
|
|
13104
13270
|
}
|
|
13105
|
-
let pm = "npm";
|
|
13106
|
-
if (options.npm) pm = "npm";
|
|
13107
|
-
else if (options.yarn) pm = "yarn";
|
|
13108
|
-
else if (options.pnpm) pm = "pnpm";
|
|
13109
|
-
else pm = detectPackageManager2();
|
|
13110
13271
|
log.newline();
|
|
13111
|
-
|
|
13112
|
-
|
|
13272
|
+
let success;
|
|
13273
|
+
if (installType === "native") {
|
|
13274
|
+
success = await updateNativeBinary(versionInfo.latest);
|
|
13275
|
+
} else {
|
|
13276
|
+
log.info(`Verwende: ${installType}`);
|
|
13277
|
+
success = await runPackageManagerUpgrade(installType);
|
|
13278
|
+
}
|
|
13113
13279
|
log.newline();
|
|
13114
13280
|
if (success) {
|
|
13115
13281
|
log.success("SHIVA wurde erfolgreich aktualisiert!");
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13282
|
+
if (installType !== "native" || os6.platform() !== "win32") {
|
|
13283
|
+
const newVersion = getCurrentVersion();
|
|
13284
|
+
if (newVersion !== versionInfo.current) {
|
|
13285
|
+
log.info(`Neue Version: ${newVersion}`);
|
|
13286
|
+
}
|
|
13119
13287
|
}
|
|
13120
13288
|
} else {
|
|
13121
13289
|
log.error("Upgrade fehlgeschlagen");
|
|
13122
13290
|
log.newline();
|
|
13123
|
-
|
|
13124
|
-
|
|
13291
|
+
if (installType === "native") {
|
|
13292
|
+
log.info("Alternativen:");
|
|
13293
|
+
log.plain(" curl -fsSL https://shiva.li/install | bash");
|
|
13294
|
+
log.plain(" npm install -g shiva-code");
|
|
13295
|
+
} else {
|
|
13296
|
+
log.info("Versuche manuell:");
|
|
13297
|
+
log.plain(` ${getUpgradeCommand(installType)}`);
|
|
13298
|
+
}
|
|
13125
13299
|
}
|
|
13126
13300
|
});
|
|
13127
13301
|
var selfUpdateCommand = new Command29("self-update").description('Alias f\xFCr "shiva upgrade"').action(async () => {
|
|
@@ -13385,9 +13559,9 @@ complete -F _shiva_completions shiva
|
|
|
13385
13559
|
}
|
|
13386
13560
|
async function installBashCompletion() {
|
|
13387
13561
|
const fs15 = await import("fs");
|
|
13388
|
-
const
|
|
13562
|
+
const os8 = await import("os");
|
|
13389
13563
|
const path15 = await import("path");
|
|
13390
|
-
const bashrcPath = path15.join(
|
|
13564
|
+
const bashrcPath = path15.join(os8.homedir(), ".bashrc");
|
|
13391
13565
|
const completionScript = generateBashCompletion();
|
|
13392
13566
|
const marker = "# SHIVA Code Bash Completion";
|
|
13393
13567
|
try {
|
|
@@ -13528,9 +13702,9 @@ compdef _shiva shiva
|
|
|
13528
13702
|
}
|
|
13529
13703
|
async function installZshCompletion() {
|
|
13530
13704
|
const fs15 = await import("fs");
|
|
13531
|
-
const
|
|
13705
|
+
const os8 = await import("os");
|
|
13532
13706
|
const path15 = await import("path");
|
|
13533
|
-
const zshrcPath = path15.join(
|
|
13707
|
+
const zshrcPath = path15.join(os8.homedir(), ".zshrc");
|
|
13534
13708
|
const completionScript = generateZshCompletion();
|
|
13535
13709
|
const marker = "# SHIVA Code Zsh Completion";
|
|
13536
13710
|
try {
|
|
@@ -13633,9 +13807,9 @@ complete -c shiva -n "__fish_seen_subcommand_from stats" -l json -d "JSON Output
|
|
|
13633
13807
|
}
|
|
13634
13808
|
async function installFishCompletion() {
|
|
13635
13809
|
const fs15 = await import("fs");
|
|
13636
|
-
const
|
|
13810
|
+
const os8 = await import("os");
|
|
13637
13811
|
const path15 = await import("path");
|
|
13638
|
-
const fishCompletionsDir = path15.join(
|
|
13812
|
+
const fishCompletionsDir = path15.join(os8.homedir(), ".config", "fish", "completions");
|
|
13639
13813
|
const fishCompletionPath = path15.join(fishCompletionsDir, "shiva.fish");
|
|
13640
13814
|
const completionScript = generateFishCompletion();
|
|
13641
13815
|
try {
|
|
@@ -13955,7 +14129,7 @@ statsCommand.command("tools").description("Tool Usage Analytics (Pro Feature)").
|
|
|
13955
14129
|
statsCommand.command("export").description("Analytics-Daten exportieren (Pro Feature)").option("--start <date>", "Start-Datum (YYYY-MM-DD)").option("--end <date>", "End-Datum (YYYY-MM-DD)").option("--format <format>", "Format: json, csv", "json").option("-o, --output <file>", "Ausgabedatei").action(async (options) => {
|
|
13956
14130
|
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
13957
14131
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
13958
|
-
const { writeFileSync:
|
|
14132
|
+
const { writeFileSync: writeFileSync12 } = await import("fs");
|
|
13959
14133
|
if (!isAuthenticated2()) {
|
|
13960
14134
|
log.error("Nicht angemeldet");
|
|
13961
14135
|
log.info("Anmelden mit: shiva login");
|
|
@@ -13971,7 +14145,7 @@ statsCommand.command("export").description("Analytics-Daten exportieren (Pro Fea
|
|
|
13971
14145
|
spinner.stop();
|
|
13972
14146
|
if (options.output) {
|
|
13973
14147
|
const content = options.format === "json" ? JSON.stringify(result.data, null, 2) : String(result.data);
|
|
13974
|
-
|
|
14148
|
+
writeFileSync12(options.output, content);
|
|
13975
14149
|
log.success(`Analytics exportiert: ${options.output}`);
|
|
13976
14150
|
} else {
|
|
13977
14151
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -14524,7 +14698,7 @@ dockerCommand.action(() => {
|
|
|
14524
14698
|
import { Command as Command35 } from "commander";
|
|
14525
14699
|
import * as fs13 from "fs";
|
|
14526
14700
|
import * as path14 from "path";
|
|
14527
|
-
import * as
|
|
14701
|
+
import * as os7 from "os";
|
|
14528
14702
|
import ora22 from "ora";
|
|
14529
14703
|
import inquirer12 from "inquirer";
|
|
14530
14704
|
var builtInWorkflows = {
|
|
@@ -14683,7 +14857,7 @@ workflowCommand.command("delete").alias("rm").description("Workflow l\xF6schen")
|
|
|
14683
14857
|
log.success(`Workflow "${name}" gel\xF6scht`);
|
|
14684
14858
|
});
|
|
14685
14859
|
function getWorkflowsPath() {
|
|
14686
|
-
return path14.join(
|
|
14860
|
+
return path14.join(os7.homedir(), ".shiva", "workflows.json");
|
|
14687
14861
|
}
|
|
14688
14862
|
function loadCustomWorkflows() {
|
|
14689
14863
|
const filepath = getWorkflowsPath();
|
|
@@ -14801,10 +14975,10 @@ async function executeStep(step) {
|
|
|
14801
14975
|
|
|
14802
14976
|
// src/commands/advanced/hook.ts
|
|
14803
14977
|
import { Command as Command36 } from "commander";
|
|
14804
|
-
import { existsSync as existsSync22, readFileSync as readFileSync12, writeFileSync as
|
|
14978
|
+
import { existsSync as existsSync22, readFileSync as readFileSync12, writeFileSync as writeFileSync11, mkdirSync as mkdirSync6 } from "fs";
|
|
14805
14979
|
import { homedir as homedir7 } from "os";
|
|
14806
|
-
import { join as
|
|
14807
|
-
var CLAUDE_SETTINGS_PATH =
|
|
14980
|
+
import { join as join13 } from "path";
|
|
14981
|
+
var CLAUDE_SETTINGS_PATH = join13(homedir7(), ".claude", "settings.json");
|
|
14808
14982
|
function getClaudeSettings() {
|
|
14809
14983
|
if (!existsSync22(CLAUDE_SETTINGS_PATH)) {
|
|
14810
14984
|
return {};
|
|
@@ -14817,11 +14991,11 @@ function getClaudeSettings() {
|
|
|
14817
14991
|
}
|
|
14818
14992
|
}
|
|
14819
14993
|
function saveClaudeSettings(settings) {
|
|
14820
|
-
const dir =
|
|
14994
|
+
const dir = join13(homedir7(), ".claude");
|
|
14821
14995
|
if (!existsSync22(dir)) {
|
|
14822
14996
|
mkdirSync6(dir, { recursive: true });
|
|
14823
14997
|
}
|
|
14824
|
-
|
|
14998
|
+
writeFileSync11(CLAUDE_SETTINGS_PATH, JSON.stringify(settings, null, 2));
|
|
14825
14999
|
}
|
|
14826
15000
|
function hasShivaHook(hooks, event) {
|
|
14827
15001
|
if (!hooks || !hooks[event]) return false;
|
|
@@ -14838,7 +15012,7 @@ function removeShivaHooks(eventHooks) {
|
|
|
14838
15012
|
var hookCommand = new Command36("hook").description("Claude Code Hook Integration verwalten");
|
|
14839
15013
|
hookCommand.command("install").description("SHIVA Hooks in Claude Code installieren").option("--github", "GitHub Context Injection aktivieren").option("--sync", "Cloud Sync Hooks aktivieren (Standard)").option("--scan", "Package Security Scanning aktivieren").option("--all", "Alle Hooks aktivieren").action((options) => {
|
|
14840
15014
|
log.brand();
|
|
14841
|
-
const claudePath =
|
|
15015
|
+
const claudePath = join13(homedir7(), ".claude");
|
|
14842
15016
|
if (!existsSync22(claudePath)) {
|
|
14843
15017
|
log.error("Claude Code nicht gefunden");
|
|
14844
15018
|
log.newline();
|