vibora 3.7.0 → 3.8.0
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.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="icon" type="image/jpeg" href="/logo-dark.jpg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Vibora</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-gnzvdZ_8.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BT1ZHHzc.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -10131,8 +10131,8 @@ var logger = (fn = console.log) => {
|
|
|
10131
10131
|
|
|
10132
10132
|
// server/app.ts
|
|
10133
10133
|
import { readFile as readFile2 } from "fs/promises";
|
|
10134
|
-
import { join as
|
|
10135
|
-
import { existsSync as
|
|
10134
|
+
import { join as join15 } from "path";
|
|
10135
|
+
import { existsSync as existsSync13 } from "fs";
|
|
10136
10136
|
|
|
10137
10137
|
// server/routes/health.ts
|
|
10138
10138
|
var app = new Hono2;
|
|
@@ -147221,6 +147221,33 @@ app8.patch("/", async (c) => {
|
|
|
147221
147221
|
});
|
|
147222
147222
|
var terminal_view_state_default = app8;
|
|
147223
147223
|
|
|
147224
|
+
// server/routes/repositories.ts
|
|
147225
|
+
import { existsSync as existsSync10, rmSync as rmSync4 } from "fs";
|
|
147226
|
+
import { join as join12 } from "path";
|
|
147227
|
+
import { execSync as execSync4 } from "child_process";
|
|
147228
|
+
|
|
147229
|
+
// server/lib/git-utils.ts
|
|
147230
|
+
function isGitUrl(source) {
|
|
147231
|
+
return source.startsWith("git@") || source.startsWith("https://") || source.startsWith("http://") || source.startsWith("gh:") || source.startsWith("gl:") || source.startsWith("bb:");
|
|
147232
|
+
}
|
|
147233
|
+
function extractRepoNameFromUrl(url) {
|
|
147234
|
+
const cleaned = url.replace(/\.git$/, "");
|
|
147235
|
+
if (cleaned.startsWith("git@")) {
|
|
147236
|
+
const match3 = cleaned.match(/:([^/]+\/)?([^/]+)$/);
|
|
147237
|
+
if (match3)
|
|
147238
|
+
return match3[2];
|
|
147239
|
+
} else if (cleaned.startsWith("gh:") || cleaned.startsWith("gl:") || cleaned.startsWith("bb:")) {
|
|
147240
|
+
const parts = cleaned.split("/");
|
|
147241
|
+
if (parts.length > 0)
|
|
147242
|
+
return parts[parts.length - 1];
|
|
147243
|
+
} else {
|
|
147244
|
+
const parts = cleaned.split("/");
|
|
147245
|
+
if (parts.length > 0)
|
|
147246
|
+
return parts[parts.length - 1];
|
|
147247
|
+
}
|
|
147248
|
+
return cleaned;
|
|
147249
|
+
}
|
|
147250
|
+
|
|
147224
147251
|
// server/routes/repositories.ts
|
|
147225
147252
|
var app9 = new Hono2;
|
|
147226
147253
|
app9.get("/", (c) => {
|
|
@@ -147264,6 +147291,65 @@ app9.post("/", async (c) => {
|
|
|
147264
147291
|
return c.json({ error: err instanceof Error ? err.message : "Failed to create repository" }, 400);
|
|
147265
147292
|
}
|
|
147266
147293
|
});
|
|
147294
|
+
app9.post("/clone", async (c) => {
|
|
147295
|
+
try {
|
|
147296
|
+
const body = await c.req.json();
|
|
147297
|
+
if (!body.url) {
|
|
147298
|
+
return c.json({ error: "url is required" }, 400);
|
|
147299
|
+
}
|
|
147300
|
+
if (!isGitUrl(body.url)) {
|
|
147301
|
+
return c.json({ error: "Invalid git URL format" }, 400);
|
|
147302
|
+
}
|
|
147303
|
+
const settings = getSettings();
|
|
147304
|
+
const gitReposDir = settings.paths.defaultGitReposDir;
|
|
147305
|
+
const repoName = extractRepoNameFromUrl(body.url);
|
|
147306
|
+
const targetPath = join12(gitReposDir, repoName);
|
|
147307
|
+
if (existsSync10(targetPath)) {
|
|
147308
|
+
return c.json({ error: `Directory already exists: ${targetPath}` }, 400);
|
|
147309
|
+
}
|
|
147310
|
+
try {
|
|
147311
|
+
execSync4(`git clone "${body.url}" "${targetPath}"`, {
|
|
147312
|
+
encoding: "utf-8",
|
|
147313
|
+
stdio: "pipe",
|
|
147314
|
+
timeout: 120000
|
|
147315
|
+
});
|
|
147316
|
+
} catch (cloneErr) {
|
|
147317
|
+
if (existsSync10(targetPath)) {
|
|
147318
|
+
rmSync4(targetPath, { recursive: true, force: true });
|
|
147319
|
+
}
|
|
147320
|
+
const errorMessage = cloneErr instanceof Error ? cloneErr.message : "Clone failed";
|
|
147321
|
+
if (errorMessage.includes("Permission denied") || errorMessage.includes("publickey")) {
|
|
147322
|
+
return c.json({ error: "Authentication failed. Check your SSH keys or use HTTPS with credentials." }, 500);
|
|
147323
|
+
}
|
|
147324
|
+
if (errorMessage.includes("not found") || errorMessage.includes("does not exist")) {
|
|
147325
|
+
return c.json({ error: "Repository not found or access denied" }, 500);
|
|
147326
|
+
}
|
|
147327
|
+
return c.json({ error: `Failed to clone repository: ${errorMessage}` }, 500);
|
|
147328
|
+
}
|
|
147329
|
+
const existing = db.select().from(repositories).where(eq(repositories.path, targetPath)).get();
|
|
147330
|
+
if (existing) {
|
|
147331
|
+
return c.json({ error: "Repository with this path already exists in database" }, 400);
|
|
147332
|
+
}
|
|
147333
|
+
const now = new Date().toISOString();
|
|
147334
|
+
const displayName = body.displayName || repoName;
|
|
147335
|
+
const newRepo = {
|
|
147336
|
+
id: crypto.randomUUID(),
|
|
147337
|
+
path: targetPath,
|
|
147338
|
+
displayName,
|
|
147339
|
+
remoteUrl: body.url,
|
|
147340
|
+
startupScript: null,
|
|
147341
|
+
copyFiles: null,
|
|
147342
|
+
isCopierTemplate: false,
|
|
147343
|
+
createdAt: now,
|
|
147344
|
+
updatedAt: now
|
|
147345
|
+
};
|
|
147346
|
+
db.insert(repositories).values(newRepo).run();
|
|
147347
|
+
const created = db.select().from(repositories).where(eq(repositories.id, newRepo.id)).get();
|
|
147348
|
+
return c.json(created, 201);
|
|
147349
|
+
} catch (err) {
|
|
147350
|
+
return c.json({ error: err instanceof Error ? err.message : "Failed to clone repository" }, 500);
|
|
147351
|
+
}
|
|
147352
|
+
});
|
|
147267
147353
|
app9.patch("/:id", async (c) => {
|
|
147268
147354
|
const id = c.req.param("id");
|
|
147269
147355
|
try {
|
|
@@ -147344,14 +147430,14 @@ var $visit = visit.visit;
|
|
|
147344
147430
|
var $visitAsync = visit.visitAsync;
|
|
147345
147431
|
|
|
147346
147432
|
// server/routes/copier.ts
|
|
147347
|
-
import { existsSync as
|
|
147348
|
-
import { join as
|
|
147433
|
+
import { existsSync as existsSync11, readFileSync as readFileSync6, writeFileSync as writeFileSync4, unlinkSync as unlinkSync4, mkdtempSync, rmSync as rmSync5 } from "fs";
|
|
147434
|
+
import { join as join13 } from "path";
|
|
147349
147435
|
import { tmpdir } from "os";
|
|
147350
|
-
import { execSync as
|
|
147436
|
+
import { execSync as execSync5 } from "child_process";
|
|
147351
147437
|
var app10 = new Hono2;
|
|
147352
147438
|
function isUvInstalled() {
|
|
147353
147439
|
try {
|
|
147354
|
-
|
|
147440
|
+
execSync5("uv --version", { stdio: "pipe" });
|
|
147355
147441
|
return true;
|
|
147356
147442
|
} catch {
|
|
147357
147443
|
return false;
|
|
@@ -147410,47 +147496,44 @@ function parseCopierQuestions(yamlContent) {
|
|
|
147410
147496
|
}
|
|
147411
147497
|
return questions;
|
|
147412
147498
|
}
|
|
147413
|
-
function isGitUrl(source) {
|
|
147414
|
-
return source.startsWith("git@") || source.startsWith("https://") || source.startsWith("http://") || source.startsWith("gh:") || source.startsWith("gl:") || source.startsWith("bb:");
|
|
147415
|
-
}
|
|
147416
147499
|
function fetchCopierYamlFromGit(gitUrl) {
|
|
147417
|
-
const tempDir = mkdtempSync(
|
|
147500
|
+
const tempDir = mkdtempSync(join13(tmpdir(), "copier-template-"));
|
|
147418
147501
|
try {
|
|
147419
|
-
|
|
147502
|
+
execSync5(`git clone --depth 1 "${gitUrl}" "${tempDir}"`, {
|
|
147420
147503
|
encoding: "utf-8",
|
|
147421
147504
|
stdio: "pipe"
|
|
147422
147505
|
});
|
|
147423
|
-
const yamlPath =
|
|
147424
|
-
const yamlAltPath =
|
|
147506
|
+
const yamlPath = join13(tempDir, "copier.yml");
|
|
147507
|
+
const yamlAltPath = join13(tempDir, "copier.yaml");
|
|
147425
147508
|
let content = null;
|
|
147426
|
-
if (
|
|
147509
|
+
if (existsSync11(yamlPath)) {
|
|
147427
147510
|
content = readFileSync6(yamlPath, "utf-8");
|
|
147428
|
-
} else if (
|
|
147511
|
+
} else if (existsSync11(yamlAltPath)) {
|
|
147429
147512
|
content = readFileSync6(yamlAltPath, "utf-8");
|
|
147430
147513
|
}
|
|
147431
147514
|
if (!content) {
|
|
147432
|
-
|
|
147515
|
+
rmSync5(tempDir, { recursive: true, force: true });
|
|
147433
147516
|
return null;
|
|
147434
147517
|
}
|
|
147435
147518
|
return {
|
|
147436
147519
|
content,
|
|
147437
|
-
cleanup: () =>
|
|
147520
|
+
cleanup: () => rmSync5(tempDir, { recursive: true, force: true })
|
|
147438
147521
|
};
|
|
147439
147522
|
} catch (err) {
|
|
147440
|
-
|
|
147523
|
+
rmSync5(tempDir, { recursive: true, force: true });
|
|
147441
147524
|
throw err;
|
|
147442
147525
|
}
|
|
147443
147526
|
}
|
|
147444
147527
|
async function fetchCopierYaml(source) {
|
|
147445
147528
|
const repo = db.select().from(repositories).where(eq(repositories.id, source)).get();
|
|
147446
147529
|
const templatePath = repo ? repo.path : source;
|
|
147447
|
-
if (
|
|
147448
|
-
const yamlPath =
|
|
147449
|
-
const yamlAltPath =
|
|
147450
|
-
if (
|
|
147530
|
+
if (existsSync11(templatePath)) {
|
|
147531
|
+
const yamlPath = join13(templatePath, "copier.yml");
|
|
147532
|
+
const yamlAltPath = join13(templatePath, "copier.yaml");
|
|
147533
|
+
if (existsSync11(yamlPath)) {
|
|
147451
147534
|
return { content: readFileSync6(yamlPath, "utf-8"), templatePath };
|
|
147452
147535
|
}
|
|
147453
|
-
if (
|
|
147536
|
+
if (existsSync11(yamlAltPath)) {
|
|
147454
147537
|
return { content: readFileSync6(yamlAltPath, "utf-8"), templatePath };
|
|
147455
147538
|
}
|
|
147456
147539
|
throw new Error("copier.yml not found in template directory");
|
|
@@ -147501,8 +147584,8 @@ app10.post("/create", async (c) => {
|
|
|
147501
147584
|
}
|
|
147502
147585
|
const repo = db.select().from(repositories).where(eq(repositories.id, templateSource)).get();
|
|
147503
147586
|
const templatePath = repo ? repo.path : templateSource;
|
|
147504
|
-
const fullOutputPath =
|
|
147505
|
-
if (
|
|
147587
|
+
const fullOutputPath = join13(outputPath, projectName);
|
|
147588
|
+
if (existsSync11(fullOutputPath)) {
|
|
147506
147589
|
return c.json({ error: `Output directory already exists: ${fullOutputPath}` }, 400);
|
|
147507
147590
|
}
|
|
147508
147591
|
const filteredAnswers = {};
|
|
@@ -147512,10 +147595,10 @@ app10.post("/create", async (c) => {
|
|
|
147512
147595
|
}
|
|
147513
147596
|
filteredAnswers[key] = value;
|
|
147514
147597
|
}
|
|
147515
|
-
answersFile =
|
|
147598
|
+
answersFile = join13(tmpdir(), `copier-answers-${crypto.randomUUID()}.json`);
|
|
147516
147599
|
writeFileSync4(answersFile, JSON.stringify(filteredAnswers));
|
|
147517
147600
|
try {
|
|
147518
|
-
|
|
147601
|
+
execSync5(`uvx copier copy --data-file "${answersFile}" --force --vcs-ref HEAD "${templatePath}" "${fullOutputPath}"`, {
|
|
147519
147602
|
encoding: "utf-8",
|
|
147520
147603
|
stdio: "pipe",
|
|
147521
147604
|
timeout: 120000
|
|
@@ -147551,7 +147634,7 @@ app10.post("/create", async (c) => {
|
|
|
147551
147634
|
log2.api.error("Failed to create project from template", { error: String(err) });
|
|
147552
147635
|
return c.json({ error: err instanceof Error ? err.message : "Failed to create project" }, 500);
|
|
147553
147636
|
} finally {
|
|
147554
|
-
if (answersFile &&
|
|
147637
|
+
if (answersFile && existsSync11(answersFile)) {
|
|
147555
147638
|
unlinkSync4(answersFile);
|
|
147556
147639
|
}
|
|
147557
147640
|
}
|
|
@@ -151286,15 +151369,15 @@ app12.get("/prs", async (c) => {
|
|
|
151286
151369
|
var github_default = app12;
|
|
151287
151370
|
|
|
151288
151371
|
// server/routes/monitoring.ts
|
|
151289
|
-
import { readdirSync as readdirSync7, readFileSync as readFileSync7, readlinkSync as readlinkSync2, existsSync as
|
|
151290
|
-
import { execSync as
|
|
151372
|
+
import { readdirSync as readdirSync7, readFileSync as readFileSync7, readlinkSync as readlinkSync2, existsSync as existsSync12 } from "fs";
|
|
151373
|
+
import { execSync as execSync7 } from "child_process";
|
|
151291
151374
|
import { homedir as homedir5 } from "os";
|
|
151292
|
-
import { join as
|
|
151375
|
+
import { join as join14 } from "path";
|
|
151293
151376
|
|
|
151294
151377
|
// server/services/metrics-collector.ts
|
|
151295
151378
|
import os5 from "os";
|
|
151296
151379
|
import fs7 from "fs";
|
|
151297
|
-
import { execSync as
|
|
151380
|
+
import { execSync as execSync6 } from "child_process";
|
|
151298
151381
|
var COLLECT_INTERVAL = 5000;
|
|
151299
151382
|
var RETENTION_HOURS = 24;
|
|
151300
151383
|
var isMacOS = process.platform === "darwin";
|
|
@@ -151306,13 +151389,13 @@ function getMemoryInfo() {
|
|
|
151306
151389
|
}
|
|
151307
151390
|
function getMemoryInfoMacOS() {
|
|
151308
151391
|
try {
|
|
151309
|
-
const totalStr =
|
|
151392
|
+
const totalStr = execSync6("sysctl -n hw.memsize", {
|
|
151310
151393
|
encoding: "utf-8",
|
|
151311
151394
|
timeout: 5000,
|
|
151312
151395
|
stdio: ["pipe", "pipe", "pipe"]
|
|
151313
151396
|
}).trim();
|
|
151314
151397
|
const total = parseInt(totalStr, 10);
|
|
151315
|
-
const vmstat =
|
|
151398
|
+
const vmstat = execSync6("vm_stat", {
|
|
151316
151399
|
encoding: "utf-8",
|
|
151317
151400
|
timeout: 5000,
|
|
151318
151401
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -151417,7 +151500,7 @@ function calculateCpuPercent() {
|
|
|
151417
151500
|
function getDiskUsage() {
|
|
151418
151501
|
try {
|
|
151419
151502
|
if (isMacOS) {
|
|
151420
|
-
const output =
|
|
151503
|
+
const output = execSync6("df -k /System/Volumes/Data 2>/dev/null || df -k /", {
|
|
151421
151504
|
encoding: "utf-8",
|
|
151422
151505
|
timeout: 5000,
|
|
151423
151506
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -151435,7 +151518,7 @@ function getDiskUsage() {
|
|
|
151435
151518
|
}
|
|
151436
151519
|
}
|
|
151437
151520
|
} else {
|
|
151438
|
-
const output =
|
|
151521
|
+
const output = execSync6("df -B1 / | tail -1", {
|
|
151439
151522
|
encoding: "utf-8",
|
|
151440
151523
|
timeout: 5000,
|
|
151441
151524
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -151559,13 +151642,13 @@ function findAllClaudeProcesses() {
|
|
|
151559
151642
|
}
|
|
151560
151643
|
} catch {
|
|
151561
151644
|
try {
|
|
151562
|
-
const result =
|
|
151645
|
+
const result = execSync7("pgrep -f claude", { encoding: "utf-8" });
|
|
151563
151646
|
for (const line of result.trim().split(`
|
|
151564
151647
|
`)) {
|
|
151565
151648
|
const pid = parseInt(line, 10);
|
|
151566
151649
|
if (!isNaN(pid)) {
|
|
151567
151650
|
try {
|
|
151568
|
-
const cmdline =
|
|
151651
|
+
const cmdline = execSync7(`ps -p ${pid} -o args=`, { encoding: "utf-8" }).trim();
|
|
151569
151652
|
claudeProcesses.push({ pid, cmdline });
|
|
151570
151653
|
} catch {
|
|
151571
151654
|
claudeProcesses.push({ pid, cmdline: "claude" });
|
|
@@ -151583,7 +151666,7 @@ function getProcessCwd(pid) {
|
|
|
151583
151666
|
} catch {}
|
|
151584
151667
|
}
|
|
151585
151668
|
try {
|
|
151586
|
-
const result =
|
|
151669
|
+
const result = execSync7(`lsof -a -p ${pid} -d cwd -F n 2>/dev/null`, {
|
|
151587
151670
|
encoding: "utf-8",
|
|
151588
151671
|
timeout: 5000
|
|
151589
151672
|
});
|
|
@@ -151603,7 +151686,7 @@ function getProcessMemoryMB(pid) {
|
|
|
151603
151686
|
return match3 ? parseInt(match3[1], 10) / 1024 : 0;
|
|
151604
151687
|
} catch {
|
|
151605
151688
|
try {
|
|
151606
|
-
const result =
|
|
151689
|
+
const result = execSync7(`ps -o rss= -p ${pid}`, { encoding: "utf-8" });
|
|
151607
151690
|
return parseInt(result.trim(), 10) / 1024;
|
|
151608
151691
|
} catch {
|
|
151609
151692
|
return 0;
|
|
@@ -151623,7 +151706,7 @@ function getProcessStartTime(pid) {
|
|
|
151623
151706
|
} catch {}
|
|
151624
151707
|
}
|
|
151625
151708
|
try {
|
|
151626
|
-
const result =
|
|
151709
|
+
const result = execSync7(`ps -o lstart= -p ${pid}`, {
|
|
151627
151710
|
encoding: "utf-8",
|
|
151628
151711
|
timeout: 5000
|
|
151629
151712
|
}).trim();
|
|
@@ -151641,9 +151724,9 @@ function getDescendantPids2(pid) {
|
|
|
151641
151724
|
try {
|
|
151642
151725
|
let result;
|
|
151643
151726
|
if (isMacOS2) {
|
|
151644
|
-
result =
|
|
151727
|
+
result = execSync7(`pgrep -P ${pid} 2>/dev/null || true`, { encoding: "utf-8" });
|
|
151645
151728
|
} else {
|
|
151646
|
-
result =
|
|
151729
|
+
result = execSync7(`ps --ppid ${pid} -o pid= 2>/dev/null || true`, { encoding: "utf-8" });
|
|
151647
151730
|
}
|
|
151648
151731
|
for (const line of result.trim().split(`
|
|
151649
151732
|
`)) {
|
|
@@ -151671,7 +151754,7 @@ monitoringRoutes.get("/claude-instances", (c) => {
|
|
|
151671
151754
|
const foundPids = [];
|
|
151672
151755
|
if (isMacOS2) {
|
|
151673
151756
|
try {
|
|
151674
|
-
const psResult =
|
|
151757
|
+
const psResult = execSync7("ps -Axo pid,args", {
|
|
151675
151758
|
encoding: "utf-8",
|
|
151676
151759
|
timeout: 5000,
|
|
151677
151760
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -151798,7 +151881,7 @@ monitoringRoutes.post("/claude-instances/:pid/kill-pid", (c) => {
|
|
|
151798
151881
|
function getTotalMemory() {
|
|
151799
151882
|
if (isMacOS2) {
|
|
151800
151883
|
try {
|
|
151801
|
-
const result =
|
|
151884
|
+
const result = execSync7("sysctl -n hw.memsize", {
|
|
151802
151885
|
encoding: "utf-8",
|
|
151803
151886
|
timeout: 5000,
|
|
151804
151887
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -151823,13 +151906,13 @@ monitoringRoutes.get("/top-processes", (c) => {
|
|
|
151823
151906
|
const memTotal = getTotalMemory();
|
|
151824
151907
|
let psResult;
|
|
151825
151908
|
if (isMacOS2) {
|
|
151826
|
-
psResult =
|
|
151909
|
+
psResult = execSync7("ps -Axo pid,comm,%cpu,rss,args", {
|
|
151827
151910
|
encoding: "utf-8",
|
|
151828
151911
|
timeout: 5000,
|
|
151829
151912
|
stdio: ["pipe", "pipe", "pipe"]
|
|
151830
151913
|
});
|
|
151831
151914
|
} else {
|
|
151832
|
-
psResult =
|
|
151915
|
+
psResult = execSync7("ps -eo pid,comm,%cpu,rss,args --no-headers", {
|
|
151833
151916
|
encoding: "utf-8",
|
|
151834
151917
|
timeout: 5000,
|
|
151835
151918
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -151876,14 +151959,14 @@ monitoringRoutes.get("/docker-stats", (c) => {
|
|
|
151876
151959
|
let result;
|
|
151877
151960
|
let runtime = "docker";
|
|
151878
151961
|
try {
|
|
151879
|
-
result =
|
|
151962
|
+
result = execSync7('docker stats --no-stream --format "{{json .}}"', {
|
|
151880
151963
|
encoding: "utf-8",
|
|
151881
151964
|
timeout: 1e4,
|
|
151882
151965
|
stdio: ["pipe", "pipe", "pipe"]
|
|
151883
151966
|
});
|
|
151884
151967
|
} catch {
|
|
151885
151968
|
try {
|
|
151886
|
-
result =
|
|
151969
|
+
result = execSync7('podman stats --no-stream --format "{{json .}}"', {
|
|
151887
151970
|
encoding: "utf-8",
|
|
151888
151971
|
timeout: 1e4,
|
|
151889
151972
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -152094,9 +152177,9 @@ var cachedUsage = null;
|
|
|
152094
152177
|
var usageCacheTimestamp = 0;
|
|
152095
152178
|
var USAGE_CACHE_MS = 15 * 1000;
|
|
152096
152179
|
async function getClaudeOAuthToken() {
|
|
152097
|
-
const primaryPath =
|
|
152180
|
+
const primaryPath = join14(homedir5(), ".claude", ".credentials.json");
|
|
152098
152181
|
try {
|
|
152099
|
-
if (
|
|
152182
|
+
if (existsSync12(primaryPath)) {
|
|
152100
152183
|
const content = readFileSync7(primaryPath, "utf-8");
|
|
152101
152184
|
const config = JSON.parse(content);
|
|
152102
152185
|
if (config.claudeAiOauth && typeof config.claudeAiOauth === "object") {
|
|
@@ -152109,7 +152192,7 @@ async function getClaudeOAuthToken() {
|
|
|
152109
152192
|
} catch {}
|
|
152110
152193
|
if (isMacOS2) {
|
|
152111
152194
|
try {
|
|
152112
|
-
const result =
|
|
152195
|
+
const result = execSync7('security find-generic-password -s "Claude Code-credentials" -w', {
|
|
152113
152196
|
encoding: "utf-8",
|
|
152114
152197
|
timeout: 5000,
|
|
152115
152198
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -152123,7 +152206,7 @@ async function getClaudeOAuthToken() {
|
|
|
152123
152206
|
}
|
|
152124
152207
|
if (!isMacOS2) {
|
|
152125
152208
|
try {
|
|
152126
|
-
const result =
|
|
152209
|
+
const result = execSync7('secret-tool lookup service "Claude Code"', {
|
|
152127
152210
|
encoding: "utf-8",
|
|
152128
152211
|
timeout: 5000,
|
|
152129
152212
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -152241,9 +152324,9 @@ monitoringRoutes.get("/claude-usage", async (c) => {
|
|
|
152241
152324
|
// server/app.ts
|
|
152242
152325
|
function getDistPath() {
|
|
152243
152326
|
if (process.env.VIBORA_PACKAGE_ROOT) {
|
|
152244
|
-
return
|
|
152327
|
+
return join15(process.env.VIBORA_PACKAGE_ROOT, "dist");
|
|
152245
152328
|
}
|
|
152246
|
-
return
|
|
152329
|
+
return join15(process.cwd(), "dist");
|
|
152247
152330
|
}
|
|
152248
152331
|
function createApp() {
|
|
152249
152332
|
const app13 = new Hono2;
|
|
@@ -152311,15 +152394,15 @@ function createApp() {
|
|
|
152311
152394
|
});
|
|
152312
152395
|
};
|
|
152313
152396
|
app13.get("/assets/*", async (c) => {
|
|
152314
|
-
const assetPath =
|
|
152315
|
-
if (
|
|
152397
|
+
const assetPath = join15(distPath, c.req.path);
|
|
152398
|
+
if (existsSync13(assetPath)) {
|
|
152316
152399
|
return serveFile(assetPath);
|
|
152317
152400
|
}
|
|
152318
152401
|
return c.notFound();
|
|
152319
152402
|
});
|
|
152320
152403
|
app13.get("/sounds/*", async (c) => {
|
|
152321
|
-
const soundPath =
|
|
152322
|
-
if (
|
|
152404
|
+
const soundPath = join15(distPath, c.req.path);
|
|
152405
|
+
if (existsSync13(soundPath)) {
|
|
152323
152406
|
return serveFile(soundPath);
|
|
152324
152407
|
}
|
|
152325
152408
|
return c.notFound();
|
|
@@ -152327,8 +152410,8 @@ function createApp() {
|
|
|
152327
152410
|
const staticFiles = ["vibora-icon.png", "vibora-logo.jpeg", "vite.svg", "logo-dark.jpg", "logo-light.jpg", "goat.jpeg"];
|
|
152328
152411
|
for (const file of staticFiles) {
|
|
152329
152412
|
app13.get(`/${file}`, async () => {
|
|
152330
|
-
const filePath =
|
|
152331
|
-
if (
|
|
152413
|
+
const filePath = join15(distPath, file);
|
|
152414
|
+
if (existsSync13(filePath)) {
|
|
152332
152415
|
return serveFile(filePath);
|
|
152333
152416
|
}
|
|
152334
152417
|
return new Response("Not Found", { status: 404 });
|
|
@@ -152339,7 +152422,7 @@ function createApp() {
|
|
|
152339
152422
|
if (path9.startsWith("/api/") || path9.startsWith("/ws/") || path9 === "/health") {
|
|
152340
152423
|
return next();
|
|
152341
152424
|
}
|
|
152342
|
-
const html = await readFile2(
|
|
152425
|
+
const html = await readFile2(join15(distPath, "index.html"), "utf-8");
|
|
152343
152426
|
return c.html(html);
|
|
152344
152427
|
});
|
|
152345
152428
|
}
|
|
@@ -152347,7 +152430,7 @@ function createApp() {
|
|
|
152347
152430
|
}
|
|
152348
152431
|
|
|
152349
152432
|
// server/services/pr-monitor.ts
|
|
152350
|
-
import { execSync as
|
|
152433
|
+
import { execSync as execSync8 } from "child_process";
|
|
152351
152434
|
var POLL_INTERVAL = 60000;
|
|
152352
152435
|
function parsePrUrl(url) {
|
|
152353
152436
|
const match3 = url.match(/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/);
|
|
@@ -152362,7 +152445,7 @@ function checkPrStatus(prUrl) {
|
|
|
152362
152445
|
return null;
|
|
152363
152446
|
}
|
|
152364
152447
|
try {
|
|
152365
|
-
const output =
|
|
152448
|
+
const output = execSync8(`gh pr view ${parsed.number} --repo ${parsed.owner}/${parsed.repo} --json state,mergedAt`, { encoding: "utf-8", timeout: 1e4, stdio: ["pipe", "pipe", "pipe"] });
|
|
152366
152449
|
const data = JSON.parse(output);
|
|
152367
152450
|
return {
|
|
152368
152451
|
state: data.state,
|