opencrush 0.2.8 → 0.3.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.js +27 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -245019,7 +245019,7 @@ async function runSetupWizard() {
|
|
|
245019
245019
|
const { setupMode } = await esm_default12.prompt([{
|
|
245020
245020
|
type: "list",
|
|
245021
245021
|
name: "setupMode",
|
|
245022
|
-
message:
|
|
245022
|
+
message: "Pick a setup mode:",
|
|
245023
245023
|
choices: [
|
|
245024
245024
|
{
|
|
245025
245025
|
name: `\u26A1 Quick setup ${source_default.gray("(selfies, Spotify, all core features \u2014 recommended)")}`,
|
|
@@ -245027,7 +245027,7 @@ async function runSetupWizard() {
|
|
|
245027
245027
|
short: "Quick"
|
|
245028
245028
|
},
|
|
245029
245029
|
{
|
|
245030
|
-
name: `\u{1F527} Full setup ${source_default.gray("(+ voice messages, browser, Twitter
|
|
245030
|
+
name: `\u{1F527} Full setup ${source_default.gray("(+ voice messages, browser, Twitter posting)")}`,
|
|
245031
245031
|
value: "full",
|
|
245032
245032
|
short: "Full"
|
|
245033
245033
|
}
|
|
@@ -245081,7 +245081,7 @@ async function runSetupWizard() {
|
|
|
245081
245081
|
const { platforms } = await esm_default12.prompt([{
|
|
245082
245082
|
type: "checkbox",
|
|
245083
245083
|
name: "platforms",
|
|
245084
|
-
message: "
|
|
245084
|
+
message: "Which app will you use to chat with her?",
|
|
245085
245085
|
choices: [
|
|
245086
245086
|
{
|
|
245087
245087
|
name: isCN ? "\u{1F4AC} WhatsApp\uFF08\u63A8\u8350\u65B0\u624B \u2014 \u626B\u7801\u5373\u7528\uFF0C\u65E0\u9700\u521B\u5EFA Bot\uFF09" : "\u{1F4AC} WhatsApp \u2190 Easiest! Scan QR code, no bot setup needed",
|
|
@@ -245168,7 +245168,7 @@ async function runSetupWizard() {
|
|
|
245168
245168
|
if (isCN) {
|
|
245169
245169
|
console.log(source_default.cyan(" \u68C0\u6D4B\u5230\u4E2D\u56FD\u5927\u9646\u65F6\u533A \u2014 \u4F18\u5148\u663E\u793A\u56FD\u5185\u53EF\u76F4\u8FDE\u7684\u6A21\u578B\n"));
|
|
245170
245170
|
} else {
|
|
245171
|
-
console.log(source_default.gray("
|
|
245171
|
+
console.log(source_default.gray(" Pick whichever you already have a key for.\n"));
|
|
245172
245172
|
}
|
|
245173
245173
|
const cnFirst = PROVIDER_INFO.filter((p2) => !p2.requiresVPN && !p2.isLocal);
|
|
245174
245174
|
const intl = PROVIDER_INFO.filter((p2) => p2.requiresVPN);
|
|
@@ -245249,8 +245249,8 @@ async function runSetupWizard() {
|
|
|
245249
245249
|
envValues.OLLAMA_BASE_URL = "http://localhost:11434";
|
|
245250
245250
|
envValues.OLLAMA_MODEL = "qwen2.5:7b";
|
|
245251
245251
|
}
|
|
245252
|
-
step(4, "
|
|
245253
|
-
console.log(source_default.gray("
|
|
245252
|
+
step(4, "Extra features");
|
|
245253
|
+
console.log(source_default.gray("All optional. You can skip everything here and add it later.\n"));
|
|
245254
245254
|
const quickChoices = [
|
|
245255
245255
|
{ name: "\u{1F4F8} Selfies & Video \u2014 send photos and short videos (needs fal.ai key)", value: "images", checked: true },
|
|
245256
245256
|
{ name: "\u{1F3B5} Spotify \u2014 listen to music on Spotify and share songs (needs Spotify key)", value: "spotify" }
|
|
@@ -245455,13 +245455,13 @@ async function runSetupWizard() {
|
|
|
245455
245455
|
envValues.SPOTIFY_CLIENT_SECRET = spotifyAnswers.clientSecret;
|
|
245456
245456
|
}
|
|
245457
245457
|
}
|
|
245458
|
-
step(5,
|
|
245459
|
-
console.log(source_default.gray(
|
|
245458
|
+
step(5, "Schedule");
|
|
245459
|
+
console.log(source_default.gray("When should she reach out on her own?\n"));
|
|
245460
245460
|
const scheduleAnswers = await esm_default12.prompt([
|
|
245461
245461
|
{
|
|
245462
245462
|
type: "input",
|
|
245463
245463
|
name: "quietStart",
|
|
245464
|
-
message:
|
|
245464
|
+
message: "Quiet from (hour, 0-23):",
|
|
245465
245465
|
default: "23",
|
|
245466
245466
|
validate: (v2) => {
|
|
245467
245467
|
const n2 = Number(v2);
|
|
@@ -245471,7 +245471,7 @@ async function runSetupWizard() {
|
|
|
245471
245471
|
{
|
|
245472
245472
|
type: "input",
|
|
245473
245473
|
name: "quietEnd",
|
|
245474
|
-
message:
|
|
245474
|
+
message: "Quiet until (hour, 0-23):",
|
|
245475
245475
|
default: "8",
|
|
245476
245476
|
validate: (v2) => {
|
|
245477
245477
|
const n2 = Number(v2);
|
|
@@ -245481,12 +245481,12 @@ async function runSetupWizard() {
|
|
|
245481
245481
|
{
|
|
245482
245482
|
type: "list",
|
|
245483
245483
|
name: "proactiveFrequency",
|
|
245484
|
-
message:
|
|
245484
|
+
message: "How often does she reach out first?",
|
|
245485
245485
|
choices: [
|
|
245486
|
-
{ name:
|
|
245487
|
-
{ name:
|
|
245488
|
-
{ name:
|
|
245489
|
-
{ name:
|
|
245486
|
+
{ name: "\u{1F525} A lot \u2014 every 1-2 hours", value: "frequent" },
|
|
245487
|
+
{ name: "\u26A1 Sometimes \u2014 every 2-4 hours (recommended)", value: "moderate" },
|
|
245488
|
+
{ name: "\u{1F319} Rarely \u2014 every 4-8 hours", value: "rare" },
|
|
245489
|
+
{ name: "\u{1F507} Never \u2014 only when I message first", value: "never" }
|
|
245490
245490
|
],
|
|
245491
245491
|
default: "moderate"
|
|
245492
245492
|
}
|
|
@@ -245515,19 +245515,19 @@ async function runSetupWizard() {
|
|
|
245515
245515
|
if (platforms.includes("whatsapp")) enabledFeatures.push("\u{1F4AC} WhatsApp");
|
|
245516
245516
|
if (optionalFeatures.includes("images")) enabledFeatures.push("\u{1F4F8} Selfies & Video");
|
|
245517
245517
|
if (optionalFeatures.includes("voice")) enabledFeatures.push(`\u{1F3A4} Voice (${envValues.TTS_PROVIDER ?? "n/a"})`);
|
|
245518
|
-
if (optionalFeatures.includes("twitter")) enabledFeatures.push("\u{1F426} Twitter
|
|
245518
|
+
if (optionalFeatures.includes("twitter")) enabledFeatures.push("\u{1F426} Twitter posting");
|
|
245519
245519
|
if (optionalFeatures.includes("browser")) enabledFeatures.push(`\u{1F310} Browser (${envValues.BROWSER_MODE})`);
|
|
245520
245520
|
if (optionalFeatures.includes("spotify")) enabledFeatures.push("\u{1F3B5} Spotify");
|
|
245521
|
-
enabledFeatures.push("\u{1F495} Emotion engine
|
|
245522
|
-
enabledFeatures.push("\u{1F91D} Relationship tracking
|
|
245523
|
-
enabledFeatures.push("\u{1F9E0} Memory
|
|
245521
|
+
enabledFeatures.push("\u{1F495} Emotion engine");
|
|
245522
|
+
enabledFeatures.push("\u{1F91D} Relationship tracking");
|
|
245523
|
+
enabledFeatures.push("\u{1F9E0} Memory");
|
|
245524
245524
|
enabledFeatures.push(`\u23F0 Quiet hours: ${scheduleAnswers.quietStart}:00 \u2013 ${scheduleAnswers.quietEnd}:00`);
|
|
245525
245525
|
const postSetupSteps = [];
|
|
245526
245526
|
if (optionalFeatures.includes("twitter")) {
|
|
245527
|
-
postSetupSteps.push(
|
|
245527
|
+
postSetupSteps.push(" \u2192 Run node test-twitter-oauth2.mjs to finish Twitter auth");
|
|
245528
245528
|
}
|
|
245529
245529
|
if (optionalFeatures.includes("browser")) {
|
|
245530
|
-
postSetupSteps.push(
|
|
245530
|
+
postSetupSteps.push(" \u2192 Run npx playwright install chromium");
|
|
245531
245531
|
}
|
|
245532
245532
|
console.log("\n" + boxen(
|
|
245533
245533
|
source_default.green("\u2705 Setup complete!\n\n") + source_default.white("Enabled features:\n") + enabledFeatures.map((f2) => source_default.cyan(` ${f2}`)).join("\n") + "\n\n" + (postSetupSteps.length > 0 ? source_default.yellow("Next steps:\n") + postSetupSteps.join("\n") + "\n\n" : "") + source_default.white("Start your companion:\n") + source_default.cyan(" npx opencrush@latest start\n\n") + source_default.white("Edit personality anytime:\n") + source_default.cyan(` ~/.opencrush/characters/${characterName}/SOUL.md
|
|
@@ -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)(getCharsDirResolved(), name, "IDENTITY.md");
|
|
245554
245554
|
if (!(0, import_fs20.existsSync)(identityPath)) return "";
|
|
245555
245555
|
try {
|
|
245556
245556
|
const { readFileSync: readFileSync8 } = require("fs");
|
|
@@ -245565,13 +245565,16 @@ 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)(getCharsDirResolved(), 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}"`);
|
|
245572
245572
|
}
|
|
245573
|
+
function getCharsDirResolved() {
|
|
245574
|
+
return (0, import_path14.join)(ROOT_DIR4, "characters");
|
|
245575
|
+
}
|
|
245573
245576
|
function getExistingCharacters() {
|
|
245574
|
-
const charactersDir =
|
|
245577
|
+
const charactersDir = getCharsDirResolved();
|
|
245575
245578
|
if (!(0, import_fs20.existsSync)(charactersDir)) return [];
|
|
245576
245579
|
try {
|
|
245577
245580
|
return (0, import_fs20.readdirSync)(charactersDir, { withFileTypes: true }).filter((d2) => d2.isDirectory() && d2.name !== "example").map((d2) => d2.name);
|