vibora 5.4.0 → 5.4.4
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/bin/vibora.js +1 -1
- package/dist/assets/{index-BK9vtnsx.js → index-CvRnUzFV.js} +82 -82
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/index.js +70 -44
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/jpeg" href="/logo.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-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CvRnUzFV.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-_L2gAsP8.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -10132,7 +10132,7 @@ var logger = (fn = console.log) => {
|
|
|
10132
10132
|
// server/app.ts
|
|
10133
10133
|
import { readFile as readFile2 } from "fs/promises";
|
|
10134
10134
|
import { join as join15 } from "path";
|
|
10135
|
-
import { existsSync as
|
|
10135
|
+
import { existsSync as existsSync14 } from "fs";
|
|
10136
10136
|
|
|
10137
10137
|
// server/routes/health.ts
|
|
10138
10138
|
var app = new Hono2;
|
|
@@ -14070,8 +14070,9 @@ function migrate(db, config) {
|
|
|
14070
14070
|
|
|
14071
14071
|
// server/db/index.ts
|
|
14072
14072
|
import { Database as Database2 } from "bun:sqlite";
|
|
14073
|
-
import { join as join3 } from "path";
|
|
14074
|
-
import { readdirSync } from "fs";
|
|
14073
|
+
import { join as join3, dirname as dirname2 } from "path";
|
|
14074
|
+
import { readdirSync, existsSync as existsSync2 } from "fs";
|
|
14075
|
+
import { spawnSync } from "child_process";
|
|
14075
14076
|
|
|
14076
14077
|
// server/db/schema.ts
|
|
14077
14078
|
var exports_schema = {};
|
|
@@ -14276,6 +14277,7 @@ function createLogger(component) {
|
|
|
14276
14277
|
return new ServerLogger(component);
|
|
14277
14278
|
}
|
|
14278
14279
|
var log2 = {
|
|
14280
|
+
db: createLogger("Database"),
|
|
14279
14281
|
pty: createLogger("PTYManager"),
|
|
14280
14282
|
ws: createLogger("WS"),
|
|
14281
14283
|
terminal: createLogger("Terminal"),
|
|
@@ -14723,6 +14725,9 @@ function initializeDatabase() {
|
|
|
14723
14725
|
return _db;
|
|
14724
14726
|
initializeViboraDirectories();
|
|
14725
14727
|
const dbPath = getDatabasePath();
|
|
14728
|
+
if (!process.env.VIBORA_PACKAGE_ROOT) {
|
|
14729
|
+
runSourceModeSchemaSync(dbPath);
|
|
14730
|
+
}
|
|
14726
14731
|
_sqlite = new Database2(dbPath);
|
|
14727
14732
|
_sqlite.exec("PRAGMA journal_mode = WAL");
|
|
14728
14733
|
_db = drizzle(_sqlite, { schema: exports_schema });
|
|
@@ -14739,6 +14744,27 @@ var db = new Proxy({}, {
|
|
|
14739
14744
|
return value;
|
|
14740
14745
|
}
|
|
14741
14746
|
});
|
|
14747
|
+
function runSourceModeSchemaSync(dbPath) {
|
|
14748
|
+
const serverDir = dirname2(import.meta.dir);
|
|
14749
|
+
const projectRoot = dirname2(serverDir);
|
|
14750
|
+
const configPath = join3(projectRoot, "drizzle.config.ts");
|
|
14751
|
+
if (!existsSync2(configPath)) {
|
|
14752
|
+
return;
|
|
14753
|
+
}
|
|
14754
|
+
const result = spawnSync("bun", ["run", "drizzle-kit", "push", "--force"], {
|
|
14755
|
+
cwd: projectRoot,
|
|
14756
|
+
env: {
|
|
14757
|
+
...process.env,
|
|
14758
|
+
VIBORA_DATABASE_PATH: dbPath
|
|
14759
|
+
},
|
|
14760
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
14761
|
+
timeout: 30000
|
|
14762
|
+
});
|
|
14763
|
+
if (result.status !== 0) {
|
|
14764
|
+
const stderr = result.stderr?.toString() || "";
|
|
14765
|
+
log2.db.error("drizzle-kit push failed", { stderr });
|
|
14766
|
+
}
|
|
14767
|
+
}
|
|
14742
14768
|
function runBundledMigrations(sqlite, drizzleDb) {
|
|
14743
14769
|
if (!process.env.VIBORA_PACKAGE_ROOT)
|
|
14744
14770
|
return;
|
|
@@ -20318,8 +20344,8 @@ glob.glob = glob;
|
|
|
20318
20344
|
// node_modules/bun-pty/dist/index.js
|
|
20319
20345
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
20320
20346
|
import { Buffer as Buffer2 } from "buffer";
|
|
20321
|
-
import { join as join4, dirname as
|
|
20322
|
-
import { existsSync as
|
|
20347
|
+
import { join as join4, dirname as dirname3, basename } from "path";
|
|
20348
|
+
import { existsSync as existsSync3 } from "fs";
|
|
20323
20349
|
|
|
20324
20350
|
class EventEmitter2 {
|
|
20325
20351
|
listeners = [];
|
|
@@ -20351,15 +20377,15 @@ function shQuote(s) {
|
|
|
20351
20377
|
}
|
|
20352
20378
|
function resolveLibPath() {
|
|
20353
20379
|
const env = process.env.BUN_PTY_LIB;
|
|
20354
|
-
if (env &&
|
|
20380
|
+
if (env && existsSync3(env))
|
|
20355
20381
|
return env;
|
|
20356
20382
|
const platform = process.platform;
|
|
20357
20383
|
const arch = process.arch;
|
|
20358
20384
|
const filenames = platform === "darwin" ? arch === "arm64" ? ["librust_pty_arm64.dylib", "librust_pty.dylib"] : ["librust_pty.dylib"] : platform === "win32" ? ["rust_pty.dll"] : arch === "arm64" ? ["librust_pty_arm64.so", "librust_pty.so"] : ["librust_pty.so"];
|
|
20359
20385
|
const base = Bun.fileURLToPath(import.meta.url);
|
|
20360
|
-
const fileDir =
|
|
20386
|
+
const fileDir = dirname3(base);
|
|
20361
20387
|
const dirName = basename(fileDir);
|
|
20362
|
-
const here = dirName === "src" || dirName === "dist" ?
|
|
20388
|
+
const here = dirName === "src" || dirName === "dist" ? dirname3(fileDir) : fileDir;
|
|
20363
20389
|
const basePaths = [
|
|
20364
20390
|
join4(here, "rust-pty", "target", "release"),
|
|
20365
20391
|
join4(here, "..", "bun-pty", "rust-pty", "target", "release"),
|
|
@@ -20372,7 +20398,7 @@ function resolveLibPath() {
|
|
|
20372
20398
|
}
|
|
20373
20399
|
}
|
|
20374
20400
|
for (const path3 of fallbackPaths) {
|
|
20375
|
-
if (
|
|
20401
|
+
if (existsSync3(path3))
|
|
20376
20402
|
return path3;
|
|
20377
20403
|
}
|
|
20378
20404
|
throw new Error(`librust_pty shared library not found.
|
|
@@ -20506,7 +20532,7 @@ function spawn(file, args, options) {
|
|
|
20506
20532
|
import { unlinkSync as unlinkSync3 } from "fs";
|
|
20507
20533
|
|
|
20508
20534
|
// server/terminal/dtach-service.ts
|
|
20509
|
-
import { existsSync as
|
|
20535
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readdirSync as readdirSync3, readFileSync as readFileSync2 } from "fs";
|
|
20510
20536
|
import * as path3 from "path";
|
|
20511
20537
|
import { execSync } from "child_process";
|
|
20512
20538
|
function findProcessesByArg(searchArg) {
|
|
@@ -20580,7 +20606,7 @@ class DtachService {
|
|
|
20580
20606
|
socketsDir;
|
|
20581
20607
|
constructor() {
|
|
20582
20608
|
this.socketsDir = path3.join(getViboraDir(), "sockets");
|
|
20583
|
-
if (!
|
|
20609
|
+
if (!existsSync4(this.socketsDir)) {
|
|
20584
20610
|
mkdirSync2(this.socketsDir, { recursive: true });
|
|
20585
20611
|
}
|
|
20586
20612
|
}
|
|
@@ -20588,7 +20614,7 @@ class DtachService {
|
|
|
20588
20614
|
return path3.join(this.socketsDir, `terminal-${terminalId}.sock`);
|
|
20589
20615
|
}
|
|
20590
20616
|
hasSession(terminalId) {
|
|
20591
|
-
return
|
|
20617
|
+
return existsSync4(this.getSocketPath(terminalId));
|
|
20592
20618
|
}
|
|
20593
20619
|
getCreateCommand(terminalId) {
|
|
20594
20620
|
const socketPath = this.getSocketPath(terminalId);
|
|
@@ -20639,12 +20665,12 @@ function getDtachService() {
|
|
|
20639
20665
|
}
|
|
20640
20666
|
|
|
20641
20667
|
// server/terminal/buffer-manager.ts
|
|
20642
|
-
import { existsSync as
|
|
20668
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2, unlinkSync as unlinkSync2 } from "fs";
|
|
20643
20669
|
import * as path4 from "path";
|
|
20644
20670
|
var MAX_BUFFER_BYTES = 1e6;
|
|
20645
20671
|
function getBuffersDir() {
|
|
20646
20672
|
const dir = path4.join(getViboraDir(), "buffers");
|
|
20647
|
-
if (!
|
|
20673
|
+
if (!existsSync5(dir)) {
|
|
20648
20674
|
mkdirSync3(dir, { recursive: true });
|
|
20649
20675
|
}
|
|
20650
20676
|
return dir;
|
|
@@ -20697,7 +20723,7 @@ class BufferManager {
|
|
|
20697
20723
|
return;
|
|
20698
20724
|
const filePath = path4.join(getBuffersDir(), `${this.terminalId}.buf`);
|
|
20699
20725
|
try {
|
|
20700
|
-
if (
|
|
20726
|
+
if (existsSync5(filePath)) {
|
|
20701
20727
|
const raw2 = readFileSync3(filePath, "utf-8");
|
|
20702
20728
|
let content;
|
|
20703
20729
|
try {
|
|
@@ -20725,7 +20751,7 @@ class BufferManager {
|
|
|
20725
20751
|
return;
|
|
20726
20752
|
const filePath = path4.join(getBuffersDir(), `${this.terminalId}.buf`);
|
|
20727
20753
|
try {
|
|
20728
|
-
if (
|
|
20754
|
+
if (existsSync5(filePath)) {
|
|
20729
20755
|
unlinkSync2(filePath);
|
|
20730
20756
|
}
|
|
20731
20757
|
} catch {}
|
|
@@ -146780,7 +146806,7 @@ var config_default = app5;
|
|
|
146780
146806
|
|
|
146781
146807
|
// server/routes/uploads.ts
|
|
146782
146808
|
import { mkdir, writeFile, readFile, unlink } from "fs/promises";
|
|
146783
|
-
import { existsSync as
|
|
146809
|
+
import { existsSync as existsSync9 } from "fs";
|
|
146784
146810
|
import { join as join10 } from "path";
|
|
146785
146811
|
var mimeTypes = {
|
|
146786
146812
|
png: "image/png",
|
|
@@ -146822,7 +146848,7 @@ app6.post("/sound", async (c) => {
|
|
|
146822
146848
|
const filePath = join10(viboraDir, filename);
|
|
146823
146849
|
for (const ext2 of ["mp3", "wav", "ogg"]) {
|
|
146824
146850
|
const oldPath = join10(viboraDir, `notification-sound.${ext2}`);
|
|
146825
|
-
if (
|
|
146851
|
+
if (existsSync9(oldPath)) {
|
|
146826
146852
|
try {
|
|
146827
146853
|
await unlink(oldPath);
|
|
146828
146854
|
} catch {}
|
|
@@ -146842,7 +146868,7 @@ app6.delete("/sound", async (c) => {
|
|
|
146842
146868
|
const viboraDir = getViboraDir();
|
|
146843
146869
|
for (const ext2 of ["mp3", "wav", "ogg"]) {
|
|
146844
146870
|
const filePath = join10(viboraDir, `notification-sound.${ext2}`);
|
|
146845
|
-
if (
|
|
146871
|
+
if (existsSync9(filePath)) {
|
|
146846
146872
|
try {
|
|
146847
146873
|
await unlink(filePath);
|
|
146848
146874
|
} catch {}
|
|
@@ -146859,7 +146885,7 @@ app6.delete("/sound", async (c) => {
|
|
|
146859
146885
|
app6.get("/sound", async (c) => {
|
|
146860
146886
|
const settings = getNotificationSettings();
|
|
146861
146887
|
const customSoundFile = settings.sound?.customSoundFile;
|
|
146862
|
-
if (!customSoundFile || !
|
|
146888
|
+
if (!customSoundFile || !existsSync9(customSoundFile)) {
|
|
146863
146889
|
return c.notFound();
|
|
146864
146890
|
}
|
|
146865
146891
|
const ext2 = customSoundFile.split(".").pop()?.toLowerCase() || "";
|
|
@@ -146887,7 +146913,7 @@ app6.post("/", async (c) => {
|
|
|
146887
146913
|
};
|
|
146888
146914
|
const extension = mimeToExt[file.type] || "png";
|
|
146889
146915
|
const saveDir = join10(getViboraDir(), "uploads");
|
|
146890
|
-
if (!
|
|
146916
|
+
if (!existsSync9(saveDir)) {
|
|
146891
146917
|
await mkdir(saveDir, { recursive: true });
|
|
146892
146918
|
}
|
|
146893
146919
|
const filename = generateFilename(extension);
|
|
@@ -146902,7 +146928,7 @@ app6.get("/:filename", async (c) => {
|
|
|
146902
146928
|
return c.notFound();
|
|
146903
146929
|
}
|
|
146904
146930
|
const filePath = join10(getViboraDir(), "uploads", filename);
|
|
146905
|
-
if (!
|
|
146931
|
+
if (!existsSync9(filePath)) {
|
|
146906
146932
|
return c.notFound();
|
|
146907
146933
|
}
|
|
146908
146934
|
const ext2 = filename.split(".").pop()?.toLowerCase() || "";
|
|
@@ -147421,7 +147447,7 @@ app8.patch("/", async (c) => {
|
|
|
147421
147447
|
var terminal_view_state_default = app8;
|
|
147422
147448
|
|
|
147423
147449
|
// server/routes/repositories.ts
|
|
147424
|
-
import { existsSync as
|
|
147450
|
+
import { existsSync as existsSync11, rmSync as rmSync4, readdirSync as readdirSync7, mkdirSync as mkdirSync6 } from "fs";
|
|
147425
147451
|
import { join as join12, resolve as resolve4 } from "path";
|
|
147426
147452
|
import { execSync as execSync4 } from "child_process";
|
|
147427
147453
|
import { homedir as homedir5 } from "os";
|
|
@@ -147525,10 +147551,10 @@ app9.post("/clone", async (c) => {
|
|
|
147525
147551
|
if (!resolvedTarget.startsWith(resolvedParent + "/") && resolvedTarget !== resolvedParent) {
|
|
147526
147552
|
return c.json({ error: "Invalid target path" }, 400);
|
|
147527
147553
|
}
|
|
147528
|
-
if (
|
|
147554
|
+
if (existsSync11(targetPath)) {
|
|
147529
147555
|
return c.json({ error: `Directory already exists: ${targetPath}` }, 400);
|
|
147530
147556
|
}
|
|
147531
|
-
if (!
|
|
147557
|
+
if (!existsSync11(parentDir)) {
|
|
147532
147558
|
if (resolve4(parentDir) === home) {
|
|
147533
147559
|
return c.json({ error: "Cannot create home directory" }, 400);
|
|
147534
147560
|
}
|
|
@@ -147541,7 +147567,7 @@ app9.post("/clone", async (c) => {
|
|
|
147541
147567
|
timeout: 120000
|
|
147542
147568
|
});
|
|
147543
147569
|
} catch (cloneErr) {
|
|
147544
|
-
if (
|
|
147570
|
+
if (existsSync11(targetPath) && resolvedTarget.startsWith(resolvedParent + "/")) {
|
|
147545
147571
|
rmSync4(targetPath, { recursive: true, force: true });
|
|
147546
147572
|
}
|
|
147547
147573
|
const errorMessage = cloneErr instanceof Error ? cloneErr.message : "Clone failed";
|
|
@@ -147616,9 +147642,9 @@ app9.delete("/:id", (c) => {
|
|
|
147616
147642
|
if (dangerousPaths.includes(resolve4(repoPath))) {
|
|
147617
147643
|
return c.json({ error: "Cannot delete system directory" }, 400);
|
|
147618
147644
|
}
|
|
147619
|
-
if (
|
|
147645
|
+
if (existsSync11(repoPath)) {
|
|
147620
147646
|
const gitPath = join12(repoPath, ".git");
|
|
147621
|
-
if (!
|
|
147647
|
+
if (!existsSync11(gitPath)) {
|
|
147622
147648
|
return c.json({ error: "Directory does not appear to be a git repository" }, 400);
|
|
147623
147649
|
}
|
|
147624
147650
|
try {
|
|
@@ -147638,7 +147664,7 @@ app9.post("/scan", async (c) => {
|
|
|
147638
147664
|
const body = await c.req.json().catch(() => ({}));
|
|
147639
147665
|
const settings = getSettings();
|
|
147640
147666
|
const directory = expandPath(body.directory || settings.paths.defaultGitReposDir);
|
|
147641
|
-
if (!
|
|
147667
|
+
if (!existsSync11(directory)) {
|
|
147642
147668
|
return c.json({ error: `Directory does not exist: ${directory}` }, 400);
|
|
147643
147669
|
}
|
|
147644
147670
|
const existingRepos = db.select({ path: repositories.path }).from(repositories).all();
|
|
@@ -147652,7 +147678,7 @@ app9.post("/scan", async (c) => {
|
|
|
147652
147678
|
continue;
|
|
147653
147679
|
const subPath = join12(directory, entry.name);
|
|
147654
147680
|
const gitPath = join12(subPath, ".git");
|
|
147655
|
-
if (
|
|
147681
|
+
if (existsSync11(gitPath)) {
|
|
147656
147682
|
discovered.push({
|
|
147657
147683
|
path: subPath,
|
|
147658
147684
|
name: entry.name,
|
|
@@ -147680,7 +147706,7 @@ app9.post("/bulk", async (c) => {
|
|
|
147680
147706
|
for (const repo of body.repositories) {
|
|
147681
147707
|
if (existingPaths.has(repo.path))
|
|
147682
147708
|
continue;
|
|
147683
|
-
if (!
|
|
147709
|
+
if (!existsSync11(repo.path))
|
|
147684
147710
|
continue;
|
|
147685
147711
|
const displayName = repo.displayName || repo.path.split("/").pop() || "repo";
|
|
147686
147712
|
toCreate.push({
|
|
@@ -147756,7 +147782,7 @@ var $visit = visit.visit;
|
|
|
147756
147782
|
var $visitAsync = visit.visitAsync;
|
|
147757
147783
|
|
|
147758
147784
|
// server/routes/copier.ts
|
|
147759
|
-
import { existsSync as
|
|
147785
|
+
import { existsSync as existsSync12, readFileSync as readFileSync6, writeFileSync as writeFileSync5, unlinkSync as unlinkSync5, mkdtempSync, rmSync as rmSync5 } from "fs";
|
|
147760
147786
|
import { join as join13 } from "path";
|
|
147761
147787
|
import { tmpdir } from "os";
|
|
147762
147788
|
import { execSync as execSync5 } from "child_process";
|
|
@@ -147832,9 +147858,9 @@ function fetchCopierYamlFromGit(gitUrl) {
|
|
|
147832
147858
|
const yamlPath = join13(tempDir, "copier.yml");
|
|
147833
147859
|
const yamlAltPath = join13(tempDir, "copier.yaml");
|
|
147834
147860
|
let content = null;
|
|
147835
|
-
if (
|
|
147861
|
+
if (existsSync12(yamlPath)) {
|
|
147836
147862
|
content = readFileSync6(yamlPath, "utf-8");
|
|
147837
|
-
} else if (
|
|
147863
|
+
} else if (existsSync12(yamlAltPath)) {
|
|
147838
147864
|
content = readFileSync6(yamlAltPath, "utf-8");
|
|
147839
147865
|
}
|
|
147840
147866
|
if (!content) {
|
|
@@ -147853,13 +147879,13 @@ function fetchCopierYamlFromGit(gitUrl) {
|
|
|
147853
147879
|
async function fetchCopierYaml(source) {
|
|
147854
147880
|
const repo = db.select().from(repositories).where(eq(repositories.id, source)).get();
|
|
147855
147881
|
const templatePath = repo ? repo.path : source;
|
|
147856
|
-
if (
|
|
147882
|
+
if (existsSync12(templatePath)) {
|
|
147857
147883
|
const yamlPath = join13(templatePath, "copier.yml");
|
|
147858
147884
|
const yamlAltPath = join13(templatePath, "copier.yaml");
|
|
147859
|
-
if (
|
|
147885
|
+
if (existsSync12(yamlPath)) {
|
|
147860
147886
|
return { content: readFileSync6(yamlPath, "utf-8"), templatePath };
|
|
147861
147887
|
}
|
|
147862
|
-
if (
|
|
147888
|
+
if (existsSync12(yamlAltPath)) {
|
|
147863
147889
|
return { content: readFileSync6(yamlAltPath, "utf-8"), templatePath };
|
|
147864
147890
|
}
|
|
147865
147891
|
throw new Error("copier.yml not found in template directory");
|
|
@@ -147911,7 +147937,7 @@ app10.post("/create", async (c) => {
|
|
|
147911
147937
|
const repo = db.select().from(repositories).where(eq(repositories.id, templateSource)).get();
|
|
147912
147938
|
const templatePath = repo ? repo.path : templateSource;
|
|
147913
147939
|
const fullOutputPath = join13(outputPath, projectName);
|
|
147914
|
-
if (
|
|
147940
|
+
if (existsSync12(fullOutputPath)) {
|
|
147915
147941
|
return c.json({ error: `Output directory already exists: ${fullOutputPath}` }, 400);
|
|
147916
147942
|
}
|
|
147917
147943
|
const filteredAnswers = {};
|
|
@@ -147961,7 +147987,7 @@ app10.post("/create", async (c) => {
|
|
|
147961
147987
|
log2.api.error("Failed to create project from template", { error: String(err) });
|
|
147962
147988
|
return c.json({ error: err instanceof Error ? err.message : "Failed to create project" }, 500);
|
|
147963
147989
|
} finally {
|
|
147964
|
-
if (answersFile &&
|
|
147990
|
+
if (answersFile && existsSync12(answersFile)) {
|
|
147965
147991
|
unlinkSync5(answersFile);
|
|
147966
147992
|
}
|
|
147967
147993
|
}
|
|
@@ -151696,7 +151722,7 @@ app12.get("/prs", async (c) => {
|
|
|
151696
151722
|
var github_default = app12;
|
|
151697
151723
|
|
|
151698
151724
|
// server/routes/monitoring.ts
|
|
151699
|
-
import { readdirSync as readdirSync8, readFileSync as readFileSync7, readlinkSync as readlinkSync2, existsSync as
|
|
151725
|
+
import { readdirSync as readdirSync8, readFileSync as readFileSync7, readlinkSync as readlinkSync2, existsSync as existsSync13 } from "fs";
|
|
151700
151726
|
import { execSync as execSync7 } from "child_process";
|
|
151701
151727
|
import { homedir as homedir6 } from "os";
|
|
151702
151728
|
import { join as join14 } from "path";
|
|
@@ -152506,7 +152532,7 @@ var USAGE_CACHE_MS = 15 * 1000;
|
|
|
152506
152532
|
async function getClaudeOAuthToken() {
|
|
152507
152533
|
const primaryPath = join14(homedir6(), ".claude", ".credentials.json");
|
|
152508
152534
|
try {
|
|
152509
|
-
if (
|
|
152535
|
+
if (existsSync13(primaryPath)) {
|
|
152510
152536
|
const content = readFileSync7(primaryPath, "utf-8");
|
|
152511
152537
|
const config = JSON.parse(content);
|
|
152512
152538
|
if (config.claudeAiOauth && typeof config.claudeAiOauth === "object") {
|
|
@@ -152952,14 +152978,14 @@ function createApp() {
|
|
|
152952
152978
|
};
|
|
152953
152979
|
app15.get("/assets/*", async (c) => {
|
|
152954
152980
|
const assetPath = join15(distPath, c.req.path);
|
|
152955
|
-
if (
|
|
152981
|
+
if (existsSync14(assetPath)) {
|
|
152956
152982
|
return serveFile(assetPath);
|
|
152957
152983
|
}
|
|
152958
152984
|
return c.notFound();
|
|
152959
152985
|
});
|
|
152960
152986
|
app15.get("/sounds/*", async (c) => {
|
|
152961
152987
|
const soundPath = join15(distPath, c.req.path);
|
|
152962
|
-
if (
|
|
152988
|
+
if (existsSync14(soundPath)) {
|
|
152963
152989
|
return serveFile(soundPath);
|
|
152964
152990
|
}
|
|
152965
152991
|
return c.notFound();
|
|
@@ -152968,7 +152994,7 @@ function createApp() {
|
|
|
152968
152994
|
for (const file of staticFiles) {
|
|
152969
152995
|
app15.get(`/${file}`, async () => {
|
|
152970
152996
|
const filePath = join15(distPath, file);
|
|
152971
|
-
if (
|
|
152997
|
+
if (existsSync14(filePath)) {
|
|
152972
152998
|
return serveFile(filePath);
|
|
152973
152999
|
}
|
|
152974
153000
|
return new Response("Not Found", { status: 404 });
|