shiva-code 0.7.17 → 0.7.18
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 +76 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -190,6 +190,21 @@ function completeOnboarding() {
|
|
|
190
190
|
function setTheme(theme) {
|
|
191
191
|
onboardingStore.set("theme", theme);
|
|
192
192
|
}
|
|
193
|
+
function stripAnsi(str) {
|
|
194
|
+
return str.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "");
|
|
195
|
+
}
|
|
196
|
+
function drawBox(title, width = 45) {
|
|
197
|
+
const innerWidth = width - 2;
|
|
198
|
+
const visibleLen = stripAnsi(title).length;
|
|
199
|
+
const paddingLeft = Math.floor((innerWidth - visibleLen) / 2);
|
|
200
|
+
const paddingRight = innerWidth - visibleLen - paddingLeft;
|
|
201
|
+
console.log(colors.orange(" \u256D" + "\u2500".repeat(innerWidth) + "\u256E"));
|
|
202
|
+
console.log(colors.orange(" \u2502") + " ".repeat(paddingLeft) + title + " ".repeat(paddingRight) + colors.orange("\u2502"));
|
|
203
|
+
console.log(colors.orange(" \u2570" + "\u2500".repeat(innerWidth) + "\u256F"));
|
|
204
|
+
}
|
|
205
|
+
function drawDivider(width = 45) {
|
|
206
|
+
console.log(colors.dim(" " + "\u2500".repeat(width - 2)));
|
|
207
|
+
}
|
|
193
208
|
function showBanner() {
|
|
194
209
|
console.log("");
|
|
195
210
|
console.log(colors.orange(" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 "));
|
|
@@ -203,42 +218,53 @@ function showBanner() {
|
|
|
203
218
|
console.log("");
|
|
204
219
|
}
|
|
205
220
|
function showStep(current, total, title) {
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
221
|
+
const filled = "\u25CF".repeat(current);
|
|
222
|
+
const empty = "\u25CB".repeat(total - current);
|
|
223
|
+
const progressBar = colors.orange(filled) + colors.dim(empty);
|
|
224
|
+
console.log("");
|
|
225
|
+
console.log(` ${progressBar} ${colors.dim(`Schritt ${current} von ${total}`)}`);
|
|
226
|
+
console.log(` ${colors.bold(title)}`);
|
|
227
|
+
console.log("");
|
|
210
228
|
}
|
|
211
229
|
function showClaudeInstallInstructions() {
|
|
212
|
-
|
|
230
|
+
drawBox(colors.yellow("\u26A0") + " Claude Code nicht gefunden");
|
|
231
|
+
console.log("");
|
|
213
232
|
console.log(" SHIVA erweitert Claude Code mit persistentem Speicher.");
|
|
214
|
-
console.log(" Du brauchst Claude Code um SHIVA nutzen zu k\xF6nnen
|
|
233
|
+
console.log(" Du brauchst Claude Code um SHIVA nutzen zu k\xF6nnen.");
|
|
234
|
+
console.log("");
|
|
215
235
|
console.log(colors.bold(" Installation:"));
|
|
216
|
-
console.log(colors.cyan("
|
|
217
|
-
console.log(
|
|
236
|
+
console.log(" " + colors.cyan("curl -fsSL https://claude.ai/install.sh | bash"));
|
|
237
|
+
console.log("");
|
|
238
|
+
console.log(colors.dim(" Mehr Infos: https://claude.ai/code"));
|
|
239
|
+
console.log("");
|
|
218
240
|
}
|
|
219
241
|
async function selectTheme() {
|
|
220
|
-
console.log(" " + chalk.
|
|
221
|
-
console.log(" " + chalk.
|
|
242
|
+
console.log(" " + chalk.bgHex("#1a1a2e").white(" \u25A0 Dark ") + " " + colors.dim("F\xFCr dunkle Terminals"));
|
|
243
|
+
console.log(" " + chalk.bgHex("#f5f5f5").black(" \u25A1 Light ") + " " + colors.dim("F\xFCr helle Terminals"));
|
|
244
|
+
console.log("");
|
|
222
245
|
const { theme } = await inquirer.prompt([
|
|
223
246
|
{
|
|
224
247
|
type: "list",
|
|
225
248
|
name: "theme",
|
|
226
|
-
message: "Theme:",
|
|
249
|
+
message: "W\xE4hle dein Theme:",
|
|
227
250
|
choices: [
|
|
228
|
-
{ name: "Dark Mode (empfohlen)", value: "dark" },
|
|
229
|
-
{ name: "Light Mode", value: "light" }
|
|
251
|
+
{ name: colors.orange("\u25CF") + " Dark Mode " + colors.dim("(empfohlen)"), value: "dark" },
|
|
252
|
+
{ name: colors.dim("\u25CB") + " Light Mode", value: "light" }
|
|
230
253
|
],
|
|
231
254
|
default: "dark"
|
|
232
255
|
}
|
|
233
256
|
]);
|
|
234
257
|
setTheme(theme);
|
|
258
|
+
console.log(" " + colors.green("\u2713") + " Theme gespeichert");
|
|
235
259
|
return theme;
|
|
236
260
|
}
|
|
237
261
|
async function promptLogin() {
|
|
238
262
|
console.log(" Mit einem Account bekommst du:");
|
|
263
|
+
console.log("");
|
|
239
264
|
console.log(" " + colors.green("\u2713") + " Cloud-Sync f\xFCr Memories");
|
|
240
265
|
console.log(" " + colors.green("\u2713") + " Sessions zwischen Ger\xE4ten");
|
|
241
|
-
console.log(" " + colors.green("\u2713") + " Secrets Vault (verschl\xFCsselt)
|
|
266
|
+
console.log(" " + colors.green("\u2713") + " Secrets Vault " + colors.dim("(verschl\xFCsselt)"));
|
|
267
|
+
console.log("");
|
|
242
268
|
const { wantLogin } = await inquirer.prompt([
|
|
243
269
|
{
|
|
244
270
|
type: "confirm",
|
|
@@ -248,11 +274,14 @@ async function promptLogin() {
|
|
|
248
274
|
}
|
|
249
275
|
]);
|
|
250
276
|
if (wantLogin) {
|
|
251
|
-
console.log("
|
|
277
|
+
console.log("");
|
|
278
|
+
console.log(" " + colors.cyan("\u2192") + " \xD6ffne Browser...");
|
|
279
|
+
console.log("");
|
|
252
280
|
const { loginCommand: loginCommand2 } = await import("./login-DBN2L25M.js");
|
|
253
281
|
await loginCommand2.parseAsync([], { from: "user" });
|
|
254
282
|
return isAuthenticated();
|
|
255
283
|
}
|
|
284
|
+
console.log(" " + colors.dim("Sp\xE4ter: shiva login"));
|
|
256
285
|
return false;
|
|
257
286
|
}
|
|
258
287
|
async function installHooksSilently() {
|
|
@@ -303,8 +332,10 @@ async function installHooksSilently() {
|
|
|
303
332
|
}
|
|
304
333
|
async function promptHooks() {
|
|
305
334
|
console.log(" SHIVA integriert sich automatisch mit Claude Code:");
|
|
306
|
-
console.log("
|
|
307
|
-
console.log(" " + colors.
|
|
335
|
+
console.log("");
|
|
336
|
+
console.log(" " + colors.orange("\u2192") + " Memories beim Start laden");
|
|
337
|
+
console.log(" " + colors.orange("\u2190") + " Memories beim Beenden speichern");
|
|
338
|
+
console.log("");
|
|
308
339
|
const { installHooks } = await inquirer.prompt([
|
|
309
340
|
{
|
|
310
341
|
type: "confirm",
|
|
@@ -316,36 +347,44 @@ async function promptHooks() {
|
|
|
316
347
|
if (installHooks) {
|
|
317
348
|
const success = await installHooksSilently();
|
|
318
349
|
if (success) {
|
|
319
|
-
console.log("
|
|
350
|
+
console.log("");
|
|
351
|
+
console.log(" " + colors.green("\u2713") + " Hooks installiert");
|
|
320
352
|
onboardingStore.set("hooksInstalled", true);
|
|
321
353
|
return true;
|
|
322
354
|
} else {
|
|
323
|
-
console.log("
|
|
324
|
-
console.log(" " + colors.
|
|
355
|
+
console.log("");
|
|
356
|
+
console.log(" " + colors.yellow("\u26A0") + " Hook-Installation fehlgeschlagen");
|
|
357
|
+
console.log(" " + colors.dim("Sp\xE4ter: shiva hook install"));
|
|
325
358
|
}
|
|
359
|
+
} else {
|
|
360
|
+
console.log(" " + colors.dim("Sp\xE4ter: shiva hook install"));
|
|
326
361
|
}
|
|
327
362
|
return false;
|
|
328
363
|
}
|
|
329
364
|
function showQuickStart(loggedIn, claudeInstalled) {
|
|
330
|
-
|
|
331
|
-
console.log(colors.orange(" \u2502") + colors.green.bold(" \u2713 Setup abgeschlossen!") + " " + colors.orange("\u2502"));
|
|
332
|
-
console.log(colors.orange(" \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"));
|
|
365
|
+
drawBox(colors.green("\u2713") + colors.bold(" Setup abgeschlossen!"));
|
|
333
366
|
console.log("");
|
|
334
367
|
if (!claudeInstalled) {
|
|
335
|
-
console.log(colors.bold(" N\xE4chste Schritte
|
|
336
|
-
console.log("
|
|
337
|
-
console.log(colors.
|
|
338
|
-
console.log("
|
|
339
|
-
console.log(
|
|
368
|
+
console.log(colors.bold(" N\xE4chste Schritte:"));
|
|
369
|
+
console.log("");
|
|
370
|
+
console.log(" " + colors.orange("1.") + " Installiere Claude Code:");
|
|
371
|
+
console.log(" " + colors.cyan("curl -fsSL https://claude.ai/install.sh | bash"));
|
|
372
|
+
console.log("");
|
|
373
|
+
console.log(" " + colors.orange("2.") + " Initialisiere SHIVA in deinem Projekt:");
|
|
374
|
+
console.log(" " + colors.cyan("cd dein-projekt && shiva init"));
|
|
375
|
+
console.log("");
|
|
340
376
|
} else {
|
|
341
|
-
console.log(colors.bold(" Los geht's
|
|
377
|
+
console.log(colors.bold(" Los geht's:"));
|
|
378
|
+
console.log("");
|
|
342
379
|
console.log(" " + colors.cyan("cd dein-projekt") + " " + colors.dim("Zu deinem Projekt wechseln"));
|
|
343
380
|
console.log(" " + colors.cyan("shiva init") + " " + colors.dim("SHIVA initialisieren"));
|
|
344
381
|
console.log(" " + colors.cyan("claude") + " " + colors.dim("Claude Code starten"));
|
|
345
382
|
console.log("");
|
|
346
383
|
}
|
|
347
|
-
|
|
348
|
-
console.log(
|
|
384
|
+
drawDivider();
|
|
385
|
+
console.log("");
|
|
386
|
+
console.log(colors.bold(" Befehle:"));
|
|
387
|
+
console.log("");
|
|
349
388
|
const commands = [
|
|
350
389
|
["shiva init", "Projekt initialisieren"],
|
|
351
390
|
['shiva remember "..."', "Memory speichern"],
|
|
@@ -357,11 +396,14 @@ function showQuickStart(loggedIn, claudeInstalled) {
|
|
|
357
396
|
console.log(` ${colors.cyan(cmd.padEnd(22))}${colors.dim(desc)}`);
|
|
358
397
|
}
|
|
359
398
|
console.log("");
|
|
399
|
+
drawDivider();
|
|
400
|
+
console.log("");
|
|
360
401
|
if (!loggedIn) {
|
|
361
402
|
console.log(colors.dim(" Sp\xE4ter anmelden: shiva login"));
|
|
362
403
|
}
|
|
363
404
|
console.log(colors.dim(" Hilfe: shiva --help"));
|
|
364
|
-
console.log(colors.dim(" Docs: https://shiva.li/docs
|
|
405
|
+
console.log(colors.dim(" Docs: https://shiva.li/docs"));
|
|
406
|
+
console.log("");
|
|
365
407
|
}
|
|
366
408
|
async function runOnboarding() {
|
|
367
409
|
console.clear();
|
|
@@ -16762,7 +16804,7 @@ async function interactiveMenu(choices, shortcuts) {
|
|
|
16762
16804
|
process.stdin.on("keypress", handler);
|
|
16763
16805
|
});
|
|
16764
16806
|
}
|
|
16765
|
-
function
|
|
16807
|
+
function drawBox2(title, width = 50) {
|
|
16766
16808
|
const innerWidth = width - 2;
|
|
16767
16809
|
const titleLen = title.length;
|
|
16768
16810
|
const paddingLeft = Math.floor((innerWidth - titleLen) / 2);
|
|
@@ -16774,7 +16816,7 @@ function drawBox(title, width = 50) {
|
|
|
16774
16816
|
async function showDashboard() {
|
|
16775
16817
|
console.clear();
|
|
16776
16818
|
log.newline();
|
|
16777
|
-
|
|
16819
|
+
drawBox2("SHIVA Control Station", 44);
|
|
16778
16820
|
log.newline();
|
|
16779
16821
|
if (!isClaudeInstalled()) {
|
|
16780
16822
|
console.log(colors.yellow(" \u26A0 Claude Code nicht installiert"));
|