opencrush 0.3.2 → 0.3.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/dist/index.js +20 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -245010,7 +245010,7 @@ async function runSetupWizard() {
|
|
|
245010
245010
|
console.clear();
|
|
245011
245011
|
console.log(source_default.magenta(`
|
|
245012
245012
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
245013
|
-
\u2551
|
|
245013
|
+
\u2551 \u{1F49D} O P E N C R U S H \u2551
|
|
245014
245014
|
\u2551 Your AI companion lives on your device \u2551
|
|
245015
245015
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
245016
245016
|
`));
|
|
@@ -245550,7 +245550,7 @@ async function runSetupWizard() {
|
|
|
245550
245550
|
}
|
|
245551
245551
|
function getCharacterPreview(name) {
|
|
245552
245552
|
var _a3, _b2;
|
|
245553
|
-
const identityPath = (0, import_path14.join)(
|
|
245553
|
+
const identityPath = (0, import_path14.join)(findCharDir(name), "IDENTITY.md");
|
|
245554
245554
|
if (!(0, import_fs20.existsSync)(identityPath)) return "";
|
|
245555
245555
|
try {
|
|
245556
245556
|
const { readFileSync: readFileSync8 } = require("fs");
|
|
@@ -245565,7 +245565,7 @@ function getCharacterPreview(name) {
|
|
|
245565
245565
|
}
|
|
245566
245566
|
}
|
|
245567
245567
|
function maybeOpenCard(name) {
|
|
245568
|
-
const cardPath = (0, import_path14.join)(
|
|
245568
|
+
const cardPath = (0, import_path14.join)(findCharDir(name), "card.png");
|
|
245569
245569
|
if (!(0, import_fs20.existsSync)(cardPath)) return;
|
|
245570
245570
|
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
245571
245571
|
(0, import_child_process5.exec)(`${opener} "${cardPath}"`);
|
|
@@ -245573,15 +245573,25 @@ function maybeOpenCard(name) {
|
|
|
245573
245573
|
function getCharsDirResolved() {
|
|
245574
245574
|
return (0, import_path14.join)(ROOT_DIR4, "characters");
|
|
245575
245575
|
}
|
|
245576
|
+
function getAllCharsDirs() {
|
|
245577
|
+
return [.../* @__PURE__ */ new Set([getCharsDirResolved(), getCharactersDir()])];
|
|
245578
|
+
}
|
|
245579
|
+
function findCharDir(name) {
|
|
245580
|
+
for (const dir of getAllCharsDirs()) {
|
|
245581
|
+
if ((0, import_fs20.existsSync)((0, import_path14.join)(dir, name))) return (0, import_path14.join)(dir, name);
|
|
245582
|
+
}
|
|
245583
|
+
return (0, import_path14.join)(getCharsDirResolved(), name);
|
|
245584
|
+
}
|
|
245576
245585
|
function getExistingCharacters() {
|
|
245577
|
-
const
|
|
245578
|
-
|
|
245579
|
-
|
|
245580
|
-
|
|
245581
|
-
|
|
245582
|
-
|
|
245583
|
-
|
|
245586
|
+
const names = /* @__PURE__ */ new Set();
|
|
245587
|
+
for (const dir of getAllCharsDirs()) {
|
|
245588
|
+
if (!(0, import_fs20.existsSync)(dir)) continue;
|
|
245589
|
+
try {
|
|
245590
|
+
(0, import_fs20.readdirSync)(dir, { withFileTypes: true }).filter((d2) => d2.isDirectory() && d2.name !== "example").forEach((d2) => names.add(d2.name));
|
|
245591
|
+
} catch {
|
|
245592
|
+
}
|
|
245584
245593
|
}
|
|
245594
|
+
return [...names];
|
|
245585
245595
|
}
|
|
245586
245596
|
function generateEnvFile(values) {
|
|
245587
245597
|
const sections = {
|