shiva-code 0.7.15 → 0.7.17
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 +78 -49
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12845,7 +12845,7 @@ function detectInstallationType() {
|
|
|
12845
12845
|
}
|
|
12846
12846
|
return "npm";
|
|
12847
12847
|
}
|
|
12848
|
-
var CLI_VERSION = "0.7.
|
|
12848
|
+
var CLI_VERSION = "0.7.17";
|
|
12849
12849
|
function getCurrentVersion() {
|
|
12850
12850
|
try {
|
|
12851
12851
|
const output = execSync3(`npm list -g ${PACKAGE_NAME} --depth=0 --json 2>/dev/null`, {
|
|
@@ -13101,11 +13101,18 @@ async function runPackageManagerUpgrade(pm) {
|
|
|
13101
13101
|
});
|
|
13102
13102
|
});
|
|
13103
13103
|
}
|
|
13104
|
+
function drawUpgradeBox(title, width = 40) {
|
|
13105
|
+
const innerWidth = width - 2;
|
|
13106
|
+
const visibleLen = title.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "").length;
|
|
13107
|
+
const paddingLeft = Math.floor((innerWidth - visibleLen) / 2);
|
|
13108
|
+
const paddingRight = innerWidth - visibleLen - paddingLeft;
|
|
13109
|
+
console.log(colors.orange(" \u256D" + "\u2500".repeat(innerWidth) + "\u256E"));
|
|
13110
|
+
console.log(colors.orange(" \u2502") + " ".repeat(paddingLeft) + title + " ".repeat(paddingRight) + colors.orange("\u2502"));
|
|
13111
|
+
console.log(colors.orange(" \u2570" + "\u2500".repeat(innerWidth) + "\u256F"));
|
|
13112
|
+
}
|
|
13104
13113
|
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) => {
|
|
13105
13114
|
log.newline();
|
|
13106
|
-
|
|
13107
|
-
console.log(colors.orange.bold("\u2502") + " \u{1F680} " + colors.orange.bold("SHIVA") + " " + colors.cyan("Upgrade") + " " + colors.orange.bold("\u2502"));
|
|
13108
|
-
console.log(colors.orange.bold("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"));
|
|
13115
|
+
drawUpgradeBox("\u{1F680} " + colors.bold("SHIVA") + " " + colors.cyan("Upgrade"), 36);
|
|
13109
13116
|
log.newline();
|
|
13110
13117
|
let installType = detectInstallationType();
|
|
13111
13118
|
if (options.native) installType = "native";
|
|
@@ -13120,18 +13127,24 @@ var upgradeCommand = new Command29("upgrade").description("SHIVA CLI aktualisier
|
|
|
13120
13127
|
process.stdout.write("\x1B[1A\x1B[2K");
|
|
13121
13128
|
console.log(colors.orange(" \u25CF") + " Version-Check abgeschlossen");
|
|
13122
13129
|
log.newline();
|
|
13123
|
-
const
|
|
13124
|
-
const
|
|
13125
|
-
const
|
|
13126
|
-
|
|
13130
|
+
const BOX_WIDTH = 34;
|
|
13131
|
+
const current = `v${versionInfo.current}`;
|
|
13132
|
+
const latest = `v${versionInfo.latest}`;
|
|
13133
|
+
const arrow = versionInfo.isOutdated ? " \u2192 " : " = ";
|
|
13134
|
+
const versionLine = current + arrow + latest;
|
|
13135
|
+
const statusText = versionInfo.isOutdated ? "UPDATE VERF\xDCGBAR" : "AKTUELL \u2713";
|
|
13136
|
+
const vPadLeft = Math.floor((BOX_WIDTH - 2 - versionLine.length) / 2);
|
|
13137
|
+
const vPadRight = BOX_WIDTH - 2 - versionLine.length - vPadLeft;
|
|
13138
|
+
const sPadLeft = Math.floor((BOX_WIDTH - 2 - statusText.length) / 2);
|
|
13139
|
+
const sPadRight = BOX_WIDTH - 2 - statusText.length - sPadLeft;
|
|
13140
|
+
console.log(colors.orange(" \u250C" + "\u2500".repeat(BOX_WIDTH - 2) + "\u2510"));
|
|
13141
|
+
console.log(colors.orange(" \u2502") + " ".repeat(vPadLeft) + colors.bold(current) + colors.dim(arrow) + colors.green.bold(latest) + " ".repeat(vPadRight) + colors.orange("\u2502"));
|
|
13127
13142
|
if (versionInfo.isOutdated) {
|
|
13128
|
-
console.log(colors.orange(" \u2502") + "
|
|
13129
|
-
console.log(colors.orange(" \u2502") + " " + colors.yellow.bold("UPDATE VERF\xDCGBAR") + " " + colors.orange("\u2502"));
|
|
13143
|
+
console.log(colors.orange(" \u2502") + " ".repeat(sPadLeft) + colors.yellow.bold(statusText) + " ".repeat(sPadRight) + colors.orange("\u2502"));
|
|
13130
13144
|
} else {
|
|
13131
|
-
console.log(colors.orange(" \u2502") + "
|
|
13132
|
-
console.log(colors.orange(" \u2502") + " " + colors.green.bold("AKTUELL \u2713") + " " + colors.orange("\u2502"));
|
|
13145
|
+
console.log(colors.orange(" \u2502") + " ".repeat(sPadLeft) + colors.green.bold(statusText) + " ".repeat(sPadRight) + colors.orange("\u2502"));
|
|
13133
13146
|
}
|
|
13134
|
-
console.log(colors.orange(" \u2514\u2500\
|
|
13147
|
+
console.log(colors.orange(" \u2514" + "\u2500".repeat(BOX_WIDTH - 2) + "\u2518"));
|
|
13135
13148
|
log.newline();
|
|
13136
13149
|
const sourceIcon = versionInfo.source === "npm" ? "\u{1F4E6}" : "\u{1F419}";
|
|
13137
13150
|
console.log(colors.dim(` ${sourceIcon} Quelle: ${versionInfo.source}`));
|
|
@@ -13161,9 +13174,13 @@ var upgradeCommand = new Command29("upgrade").description("SHIVA CLI aktualisier
|
|
|
13161
13174
|
}
|
|
13162
13175
|
log.newline();
|
|
13163
13176
|
if (success) {
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13177
|
+
const successMsg = "\u2713 Upgrade erfolgreich!";
|
|
13178
|
+
const sWidth = 32;
|
|
13179
|
+
const sPad = Math.floor((sWidth - 2 - successMsg.length) / 2);
|
|
13180
|
+
const sPadR = sWidth - 2 - successMsg.length - sPad;
|
|
13181
|
+
console.log(colors.green(" \u256D" + "\u2500".repeat(sWidth - 2) + "\u256E"));
|
|
13182
|
+
console.log(colors.green(" \u2502") + " ".repeat(sPad) + colors.green.bold(successMsg) + " ".repeat(sPadR) + colors.green("\u2502"));
|
|
13183
|
+
console.log(colors.green(" \u2570" + "\u2500".repeat(sWidth - 2) + "\u256F"));
|
|
13167
13184
|
log.newline();
|
|
13168
13185
|
if (installType !== "native" || os6.platform() !== "win32") {
|
|
13169
13186
|
const newVersion = getCurrentVersion();
|
|
@@ -13173,9 +13190,13 @@ var upgradeCommand = new Command29("upgrade").description("SHIVA CLI aktualisier
|
|
|
13173
13190
|
}
|
|
13174
13191
|
}
|
|
13175
13192
|
} else {
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13193
|
+
const errorMsg = "\u2717 Upgrade fehlgeschlagen";
|
|
13194
|
+
const eWidth = 32;
|
|
13195
|
+
const ePad = Math.floor((eWidth - 2 - errorMsg.length) / 2);
|
|
13196
|
+
const ePadR = eWidth - 2 - errorMsg.length - ePad;
|
|
13197
|
+
console.log(colors.red(" \u256D" + "\u2500".repeat(eWidth - 2) + "\u256E"));
|
|
13198
|
+
console.log(colors.red(" \u2502") + " ".repeat(ePad) + colors.red.bold(errorMsg) + " ".repeat(ePadR) + colors.red("\u2502"));
|
|
13199
|
+
console.log(colors.red(" \u2570" + "\u2500".repeat(eWidth - 2) + "\u256F"));
|
|
13179
13200
|
log.newline();
|
|
13180
13201
|
if (installType === "native") {
|
|
13181
13202
|
console.log(colors.dim(" Alternativen:"));
|
|
@@ -16602,7 +16623,7 @@ sandboxCommand.command("delete <id>").description("Sandbox l\xF6schen").option("
|
|
|
16602
16623
|
|
|
16603
16624
|
// src/index.ts
|
|
16604
16625
|
var program = new Command41();
|
|
16605
|
-
program.name("shiva").description("SHIVA Code - Control Station for Claude Code").version("0.7.
|
|
16626
|
+
program.name("shiva").description("SHIVA Code - Control Station for Claude Code").version("0.7.17").option("--debug", "Debug-Modus aktivieren").hook("preAction", (thisCommand) => {
|
|
16606
16627
|
const opts = thisCommand.opts();
|
|
16607
16628
|
if (opts.debug) {
|
|
16608
16629
|
enableDebug();
|
|
@@ -16741,12 +16762,19 @@ async function interactiveMenu(choices, shortcuts) {
|
|
|
16741
16762
|
process.stdin.on("keypress", handler);
|
|
16742
16763
|
});
|
|
16743
16764
|
}
|
|
16765
|
+
function drawBox(title, width = 50) {
|
|
16766
|
+
const innerWidth = width - 2;
|
|
16767
|
+
const titleLen = title.length;
|
|
16768
|
+
const paddingLeft = Math.floor((innerWidth - titleLen) / 2);
|
|
16769
|
+
const paddingRight = innerWidth - titleLen - paddingLeft;
|
|
16770
|
+
console.log(colors.orange(" \u256D" + "\u2500".repeat(innerWidth) + "\u256E"));
|
|
16771
|
+
console.log(colors.orange(" \u2502") + " ".repeat(paddingLeft) + colors.bold(title) + " ".repeat(paddingRight) + colors.orange("\u2502"));
|
|
16772
|
+
console.log(colors.orange(" \u2570" + "\u2500".repeat(innerWidth) + "\u256F"));
|
|
16773
|
+
}
|
|
16744
16774
|
async function showDashboard() {
|
|
16745
16775
|
console.clear();
|
|
16746
16776
|
log.newline();
|
|
16747
|
-
|
|
16748
|
-
console.log(colors.orange.bold("\u2502 SHIVA Control Station \u2502"));
|
|
16749
|
-
console.log(colors.orange.bold("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"));
|
|
16777
|
+
drawBox("SHIVA Control Station", 44);
|
|
16750
16778
|
log.newline();
|
|
16751
16779
|
if (!isClaudeInstalled()) {
|
|
16752
16780
|
console.log(colors.yellow(" \u26A0 Claude Code nicht installiert"));
|
|
@@ -16757,55 +16785,56 @@ async function showDashboard() {
|
|
|
16757
16785
|
const packages = getAllPackages();
|
|
16758
16786
|
const recentProjects = projects.filter((p) => p.sessions.length > 0).slice(0, 5);
|
|
16759
16787
|
if (recentProjects.length === 0 && packages.length === 0) {
|
|
16760
|
-
log.dim("Keine Sessions
|
|
16788
|
+
console.log(colors.dim(" Keine Sessions gefunden."));
|
|
16761
16789
|
log.newline();
|
|
16762
|
-
log.
|
|
16763
|
-
log.
|
|
16790
|
+
console.log(" " + colors.cyan("\u2192") + " Starte Claude Code in einem Projekt");
|
|
16791
|
+
console.log(" " + colors.cyan("\u2192") + " Oder: " + colors.bold('shiva package create "Name"'));
|
|
16764
16792
|
log.newline();
|
|
16765
16793
|
showHelpMenu();
|
|
16766
16794
|
return;
|
|
16767
16795
|
}
|
|
16768
16796
|
const choices = [];
|
|
16769
16797
|
if (recentProjects.length > 0) {
|
|
16770
|
-
choices.push({
|
|
16771
|
-
name: colors.dim("\u2500\u2500\u2500 Letzte Projekte \u2500\u2500\u2500"),
|
|
16772
|
-
value: { type: "separator" }
|
|
16773
|
-
});
|
|
16774
16798
|
for (const project of recentProjects) {
|
|
16775
16799
|
const latest = project.latestSession;
|
|
16776
|
-
const time = formatRelativeTime(latest.modified)
|
|
16777
|
-
const branch =
|
|
16778
|
-
const msgs = `${latest.messageCount} msgs
|
|
16800
|
+
const time = formatRelativeTime(latest.modified);
|
|
16801
|
+
const branch = latest.gitBranch || "main";
|
|
16802
|
+
const msgs = `${latest.messageCount} msgs`;
|
|
16803
|
+
const name = project.projectName.slice(0, 16).padEnd(16);
|
|
16804
|
+
const timeStr = colors.dim(`(${time})`.padEnd(8));
|
|
16805
|
+
const branchStr = colors.cyan(branch.slice(0, 10).padEnd(10));
|
|
16806
|
+
const msgsStr = colors.dim(msgs.padStart(10));
|
|
16779
16807
|
choices.push({
|
|
16780
|
-
name:
|
|
16808
|
+
name: `${name} ${timeStr} ${branchStr} ${msgsStr}`,
|
|
16781
16809
|
value: { type: "resume", data: project }
|
|
16782
16810
|
});
|
|
16783
16811
|
}
|
|
16784
|
-
}
|
|
16785
|
-
if (packages.length > 0) {
|
|
16786
16812
|
choices.push({
|
|
16787
|
-
name: colors.dim("\u2500\u2500\u2500
|
|
16813
|
+
name: colors.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),
|
|
16788
16814
|
value: { type: "separator" }
|
|
16789
16815
|
});
|
|
16790
|
-
|
|
16816
|
+
}
|
|
16817
|
+
if (packages.length > 0) {
|
|
16818
|
+
for (const pkg of packages.slice(0, 2)) {
|
|
16791
16819
|
const count = `${pkg.projects.length} Projekte`;
|
|
16792
16820
|
choices.push({
|
|
16793
|
-
name:
|
|
16821
|
+
name: `\u{1F4E6} ${pkg.name.padEnd(14)} ${colors.dim(count)}`,
|
|
16794
16822
|
value: { type: "package", data: pkg.name }
|
|
16795
16823
|
});
|
|
16796
16824
|
}
|
|
16825
|
+
choices.push({
|
|
16826
|
+
name: colors.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),
|
|
16827
|
+
value: { type: "separator" }
|
|
16828
|
+
});
|
|
16797
16829
|
}
|
|
16798
|
-
choices.push({
|
|
16799
|
-
name: colors.dim("\u2500\u2500\u2500 Aktionen \u2500\u2500\u2500"),
|
|
16800
|
-
value: { type: "separator" }
|
|
16801
|
-
});
|
|
16802
16830
|
choices.push(
|
|
16803
|
-
{ name: colors.
|
|
16804
|
-
{ name: colors.
|
|
16805
|
-
{ name: colors.
|
|
16806
|
-
{ name: colors.
|
|
16807
|
-
{ name: colors.
|
|
16808
|
-
{ name: colors.
|
|
16831
|
+
{ name: colors.orange("[S]") + " Sessions " + colors.dim("Alle anzeigen"), value: { type: "sessions" } },
|
|
16832
|
+
{ name: colors.orange("[P]") + " Packages " + colors.dim("Verwalten"), value: { type: "packages" } },
|
|
16833
|
+
{ name: colors.orange("[G]") + " Issues " + colors.dim("GitHub Issues"), value: { type: "issues" } },
|
|
16834
|
+
{ name: colors.orange("[R]") + " PRs " + colors.dim("Pull Requests"), value: { type: "prs" } },
|
|
16835
|
+
{ name: colors.orange("[C]") + " Config " + colors.dim("Einstellungen"), value: { type: "config" } },
|
|
16836
|
+
{ name: colors.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"), value: { type: "separator" } },
|
|
16837
|
+
{ name: colors.red("[Q]") + " Beenden", value: { type: "quit" } }
|
|
16809
16838
|
);
|
|
16810
16839
|
const shortcuts = {
|
|
16811
16840
|
"s": "sessions",
|