opencrush 0.2.7 → 0.2.9
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 +39 -102
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -245007,7 +245007,6 @@ async function openBrowserPrompt(url, isCN) {
|
|
|
245007
245007
|
}
|
|
245008
245008
|
}
|
|
245009
245009
|
async function runSetupWizard() {
|
|
245010
|
-
var _a3;
|
|
245011
245010
|
console.clear();
|
|
245012
245011
|
console.log(source_default.magenta(`
|
|
245013
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\u2557
|
|
@@ -245020,21 +245019,21 @@ async function runSetupWizard() {
|
|
|
245020
245019
|
const { setupMode } = await esm_default12.prompt([{
|
|
245021
245020
|
type: "list",
|
|
245022
245021
|
name: "setupMode",
|
|
245023
|
-
message:
|
|
245022
|
+
message: "Pick a setup mode:",
|
|
245024
245023
|
choices: [
|
|
245025
245024
|
{
|
|
245026
|
-
name:
|
|
245025
|
+
name: `\u26A1 Quick setup ${source_default.gray("(selfies, Spotify, all core features \u2014 recommended)")}`,
|
|
245027
245026
|
value: "quick",
|
|
245028
|
-
short:
|
|
245027
|
+
short: "Quick"
|
|
245029
245028
|
},
|
|
245030
245029
|
{
|
|
245031
|
-
name:
|
|
245030
|
+
name: `\u{1F527} Full setup ${source_default.gray("(+ voice messages, browser, Twitter posting)")}`,
|
|
245032
245031
|
value: "full",
|
|
245033
|
-
short:
|
|
245032
|
+
short: "Full"
|
|
245034
245033
|
}
|
|
245035
245034
|
]
|
|
245036
245035
|
}]);
|
|
245037
|
-
const TOTAL_STEPS =
|
|
245036
|
+
const TOTAL_STEPS = 5;
|
|
245038
245037
|
const step = (n2, label) => {
|
|
245039
245038
|
console.log(source_default.cyan(`
|
|
245040
245039
|
[${n2}/${TOTAL_STEPS}] ${label}`));
|
|
@@ -245082,7 +245081,7 @@ async function runSetupWizard() {
|
|
|
245082
245081
|
const { platforms } = await esm_default12.prompt([{
|
|
245083
245082
|
type: "checkbox",
|
|
245084
245083
|
name: "platforms",
|
|
245085
|
-
message: "
|
|
245084
|
+
message: "Which app will you use to chat with her?",
|
|
245086
245085
|
choices: [
|
|
245087
245086
|
{
|
|
245088
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",
|
|
@@ -245169,7 +245168,7 @@ async function runSetupWizard() {
|
|
|
245169
245168
|
if (isCN) {
|
|
245170
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"));
|
|
245171
245170
|
} else {
|
|
245172
|
-
console.log(source_default.gray("
|
|
245171
|
+
console.log(source_default.gray(" Pick whichever you already have a key for.\n"));
|
|
245173
245172
|
}
|
|
245174
245173
|
const cnFirst = PROVIDER_INFO.filter((p2) => !p2.requiresVPN && !p2.isLocal);
|
|
245175
245174
|
const intl = PROVIDER_INFO.filter((p2) => p2.requiresVPN);
|
|
@@ -245250,86 +245249,24 @@ async function runSetupWizard() {
|
|
|
245250
245249
|
envValues.OLLAMA_BASE_URL = "http://localhost:11434";
|
|
245251
245250
|
envValues.OLLAMA_MODEL = "qwen2.5:7b";
|
|
245252
245251
|
}
|
|
245253
|
-
|
|
245254
|
-
|
|
245255
|
-
|
|
245256
|
-
|
|
245257
|
-
|
|
245258
|
-
|
|
245259
|
-
|
|
245260
|
-
|
|
245261
|
-
|
|
245262
|
-
|
|
245263
|
-
}
|
|
245264
|
-
|
|
245265
|
-
|
|
245266
|
-
const { falKey } = await esm_default12.prompt([{
|
|
245267
|
-
type: "password",
|
|
245268
|
-
name: "falKey",
|
|
245269
|
-
message: "Paste your fal.ai key (or press Enter to skip):",
|
|
245270
|
-
mask: "*"
|
|
245271
|
-
}]);
|
|
245272
|
-
if (falKey.trim()) envValues.FAL_KEY = falKey.trim();
|
|
245273
|
-
}
|
|
245274
|
-
const quickEnvPath = (0, import_fs20.existsSync)(_legacyEnv) && _legacyEnv !== getEnvPath() ? _legacyEnv : getEnvPath();
|
|
245275
|
-
const quickSpinner = ora("Writing configuration...").start();
|
|
245276
|
-
(0, import_fs20.writeFileSync)(quickEnvPath, generateEnvFile(envValues), "utf-8");
|
|
245277
|
-
quickSpinner.succeed(`Configuration saved to ${quickEnvPath}`);
|
|
245278
|
-
console.log("\n" + boxen(
|
|
245279
|
-
source_default.green("\u2705 " + (isCN ? "\u8BBE\u7F6E\u5B8C\u6210\uFF01\n\n" : "Setup complete!\n\n")) + source_default.white(isCN ? "\u5DF2\u542F\u7528:\n" : "Enabled:\n") + [
|
|
245280
|
-
`\u{1F9E0} AI: ${((_a3 = getProviderInfo(envValues.LLM_PROVIDER)) == null ? void 0 : _a3.name) ?? envValues.LLM_PROVIDER}`,
|
|
245281
|
-
`\u{1F49D} Character: ${characterName}`,
|
|
245282
|
-
envValues.WHATSAPP_ENABLED ? "\u{1F4AC} WhatsApp" : "",
|
|
245283
|
-
envValues.DISCORD_BOT_TOKEN ? "\u{1F3AE} Discord" : "",
|
|
245284
|
-
envValues.TELEGRAM_BOT_TOKEN ? "\u{1F4EC} Telegram" : "",
|
|
245285
|
-
envValues.FAL_KEY ? "\u{1F4F8} Selfies & Video" : "",
|
|
245286
|
-
"\u{1F495} Emotion engine \u{1F91D} Relationship tracking \u{1F9E0} Memory"
|
|
245287
|
-
].filter(Boolean).map((f2) => source_default.cyan(` ${f2}`)).join("\n") + "\n\n" + source_default.gray(isCN ? " \u89E3\u9501\u81EA\u62CD/\u8BED\u97F3\u7B49: npx opencrush@latest setup \u2192 \u5B8C\u6574\u8BBE\u7F6E" : " Unlock selfies/voice: npx opencrush@latest setup \u2192 Full setup"),
|
|
245288
|
-
{ padding: 1, margin: 1, borderStyle: "round", borderColor: "magenta" }
|
|
245289
|
-
));
|
|
245290
|
-
const { startNow: quickStart } = await esm_default12.prompt([{
|
|
245291
|
-
type: "confirm",
|
|
245292
|
-
name: "startNow",
|
|
245293
|
-
message: isCN ? "\u73B0\u5728\u542F\u52A8\u4F60\u7684\u4F34\u4FA3\uFF1F" : "Start your companion now?",
|
|
245294
|
-
default: true
|
|
245295
|
-
}]);
|
|
245296
|
-
if (quickStart) {
|
|
245297
|
-
const dotenv3 = await Promise.resolve().then(() => __toESM(require_main()));
|
|
245298
|
-
dotenv3.config({ path: quickEnvPath, override: true });
|
|
245299
|
-
const { startOpencrush: startOpencrush2 } = await Promise.resolve().then(() => (init_start(), start_exports));
|
|
245300
|
-
await startOpencrush2();
|
|
245301
|
-
}
|
|
245302
|
-
return;
|
|
245303
|
-
}
|
|
245304
|
-
step(4, isCN ? "\u611F\u5B98\u529F\u80FD\uFF08\u53EF\u9009\uFF09" : "Sensory features (optional)");
|
|
245305
|
-
console.log(source_default.gray(isCN ? "\u8FD9\u4E9B\u529F\u80FD\u8BA9\u4F60\u7684\u4F34\u4FA3\u66F4\u52A0\u771F\u5B9E\u2014\u2014\u770B\u5F97\u89C1\u3001\u542C\u5F97\u5230\u3001\u6709\u81EA\u5DF1\u7684\u793E\u4EA4\u5708\u3002\n" : "These features make your companion come alive \u2014 visible, audible, and social.\n"));
|
|
245252
|
+
step(4, "Extra features");
|
|
245253
|
+
console.log(source_default.gray("All optional. You can skip everything here and add it later.\n"));
|
|
245254
|
+
const quickChoices = [
|
|
245255
|
+
{ name: "\u{1F4F8} Selfies & Video \u2014 send photos and short videos (needs fal.ai key)", value: "images", checked: true },
|
|
245256
|
+
{ name: "\u{1F3B5} Spotify \u2014 listen to music on Spotify and share songs (needs Spotify key)", value: "spotify" }
|
|
245257
|
+
];
|
|
245258
|
+
const fullChoices = [
|
|
245259
|
+
{ name: "\u{1F4F8} Selfies & Video \u2014 send photos and short videos (needs fal.ai key)", value: "images", checked: true },
|
|
245260
|
+
{ name: "\u{1F3A4} Voice messages \u2014 send voice notes (ElevenLabs / Fish Audio / FAL Kokoro)", value: "voice" },
|
|
245261
|
+
{ name: `\u{1F426} Twitter/X \u2014 post tweets autonomously ${source_default.gray("(needs Twitter API + OAuth)")}`, value: "twitter" },
|
|
245262
|
+
{ name: `\u{1F310} Browser \u2014 browse web, watch videos, share screenshots ${source_default.gray("(needs Playwright)")}`, value: "browser" },
|
|
245263
|
+
{ name: "\u{1F3B5} Spotify \u2014 listen to music on Spotify and share songs (needs Spotify key)", value: "spotify" }
|
|
245264
|
+
];
|
|
245306
245265
|
const { optionalFeatures } = await esm_default12.prompt([{
|
|
245307
245266
|
type: "checkbox",
|
|
245308
245267
|
name: "optionalFeatures",
|
|
245309
|
-
message:
|
|
245310
|
-
choices:
|
|
245311
|
-
{
|
|
245312
|
-
name: isCN ? "\u{1F4F8} \u81EA\u62CD & \u89C6\u9891 \u2014 \u53EF\u4EE5\u53D1\u81EA\u62CD\u548C\u77ED\u89C6\u9891 (\u9700\u8981 fal.ai key)" : "\u{1F4F8} Selfies & Video \u2014 send photos and short videos (needs fal.ai key)",
|
|
245313
|
-
value: "images",
|
|
245314
|
-
checked: false
|
|
245315
|
-
},
|
|
245316
|
-
{
|
|
245317
|
-
name: isCN ? "\u{1F3A4} \u8BED\u97F3\u6D88\u606F \u2014 \u53EF\u4EE5\u53D1\u8BED\u97F3 (ElevenLabs / Fish Audio / FAL Kokoro)" : "\u{1F3A4} Voice messages \u2014 send voice notes (ElevenLabs / Fish Audio / FAL Kokoro)",
|
|
245318
|
-
value: "voice"
|
|
245319
|
-
},
|
|
245320
|
-
{
|
|
245321
|
-
name: isCN ? `\u{1F426} Twitter/X \u2014 \u81EA\u4E3B\u53D1\u63A8\u6587\u3001\u5206\u4EAB\u751F\u6D3B ${source_default.gray("[\u9AD8\u7EA7 \u2014 \u9700\u8981 Twitter API + OAuth]")}` : `\u{1F426} Twitter/X \u2014 post tweets autonomously ${source_default.gray("[advanced \u2014 needs Twitter API + OAuth]")}`,
|
|
245322
|
-
value: "twitter"
|
|
245323
|
-
},
|
|
245324
|
-
{
|
|
245325
|
-
name: isCN ? `\u{1F310} \u6D4F\u89C8\u5668 \u2014 \u80FD\u6D4F\u89C8\u7F51\u9875\u3001\u770B\u89C6\u9891\u3001\u5206\u4EAB\u622A\u56FE ${source_default.gray("[\u9AD8\u7EA7 \u2014 \u9700\u8981\u5B89\u88C5 Playwright]")}` : `\u{1F310} Browser \u2014 browse web, watch videos, share screenshots ${source_default.gray("[advanced \u2014 needs Playwright]")}`,
|
|
245326
|
-
value: "browser"
|
|
245327
|
-
},
|
|
245328
|
-
{
|
|
245329
|
-
name: isCN ? "\u{1F3B5} Spotify \u8054\u52A8 \u2014 \u5728 Spotify \u542C\u6B4C\u5E76\u5206\u4EAB (\u9700\u8981 Spotify API)" : "\u{1F3B5} Spotify \u2014 listen to music on Spotify and share songs (needs Spotify key)",
|
|
245330
|
-
value: "spotify"
|
|
245331
|
-
}
|
|
245332
|
-
]
|
|
245268
|
+
message: "Which features do you want?",
|
|
245269
|
+
choices: setupMode === "quick" ? quickChoices : fullChoices
|
|
245333
245270
|
}]);
|
|
245334
245271
|
if (optionalFeatures.includes("images")) {
|
|
245335
245272
|
console.log(source_default.yellow("\n \u{1F449} fal.ai API key (free credits on signup):"));
|
|
@@ -245518,13 +245455,13 @@ async function runSetupWizard() {
|
|
|
245518
245455
|
envValues.SPOTIFY_CLIENT_SECRET = spotifyAnswers.clientSecret;
|
|
245519
245456
|
}
|
|
245520
245457
|
}
|
|
245521
|
-
step(5,
|
|
245522
|
-
console.log(source_default.gray(
|
|
245458
|
+
step(5, "Schedule");
|
|
245459
|
+
console.log(source_default.gray("When should she reach out on her own?\n"));
|
|
245523
245460
|
const scheduleAnswers = await esm_default12.prompt([
|
|
245524
245461
|
{
|
|
245525
245462
|
type: "input",
|
|
245526
245463
|
name: "quietStart",
|
|
245527
|
-
message:
|
|
245464
|
+
message: "Quiet from (hour, 0-23):",
|
|
245528
245465
|
default: "23",
|
|
245529
245466
|
validate: (v2) => {
|
|
245530
245467
|
const n2 = Number(v2);
|
|
@@ -245534,7 +245471,7 @@ async function runSetupWizard() {
|
|
|
245534
245471
|
{
|
|
245535
245472
|
type: "input",
|
|
245536
245473
|
name: "quietEnd",
|
|
245537
|
-
message:
|
|
245474
|
+
message: "Quiet until (hour, 0-23):",
|
|
245538
245475
|
default: "8",
|
|
245539
245476
|
validate: (v2) => {
|
|
245540
245477
|
const n2 = Number(v2);
|
|
@@ -245544,12 +245481,12 @@ async function runSetupWizard() {
|
|
|
245544
245481
|
{
|
|
245545
245482
|
type: "list",
|
|
245546
245483
|
name: "proactiveFrequency",
|
|
245547
|
-
message:
|
|
245484
|
+
message: "How often does she reach out first?",
|
|
245548
245485
|
choices: [
|
|
245549
|
-
{ name:
|
|
245550
|
-
{ name:
|
|
245551
|
-
{ name:
|
|
245552
|
-
{ 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" }
|
|
245553
245490
|
],
|
|
245554
245491
|
default: "moderate"
|
|
245555
245492
|
}
|
|
@@ -245578,24 +245515,24 @@ async function runSetupWizard() {
|
|
|
245578
245515
|
if (platforms.includes("whatsapp")) enabledFeatures.push("\u{1F4AC} WhatsApp");
|
|
245579
245516
|
if (optionalFeatures.includes("images")) enabledFeatures.push("\u{1F4F8} Selfies & Video");
|
|
245580
245517
|
if (optionalFeatures.includes("voice")) enabledFeatures.push(`\u{1F3A4} Voice (${envValues.TTS_PROVIDER ?? "n/a"})`);
|
|
245581
|
-
if (optionalFeatures.includes("twitter")) enabledFeatures.push("\u{1F426} Twitter
|
|
245518
|
+
if (optionalFeatures.includes("twitter")) enabledFeatures.push("\u{1F426} Twitter posting");
|
|
245582
245519
|
if (optionalFeatures.includes("browser")) enabledFeatures.push(`\u{1F310} Browser (${envValues.BROWSER_MODE})`);
|
|
245583
245520
|
if (optionalFeatures.includes("spotify")) enabledFeatures.push("\u{1F3B5} Spotify");
|
|
245584
|
-
enabledFeatures.push("\u{1F495} Emotion engine
|
|
245585
|
-
enabledFeatures.push("\u{1F91D} Relationship tracking
|
|
245586
|
-
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");
|
|
245587
245524
|
enabledFeatures.push(`\u23F0 Quiet hours: ${scheduleAnswers.quietStart}:00 \u2013 ${scheduleAnswers.quietEnd}:00`);
|
|
245588
245525
|
const postSetupSteps = [];
|
|
245589
245526
|
if (optionalFeatures.includes("twitter")) {
|
|
245590
|
-
postSetupSteps.push(
|
|
245527
|
+
postSetupSteps.push(" \u2192 Run node test-twitter-oauth2.mjs to finish Twitter auth");
|
|
245591
245528
|
}
|
|
245592
245529
|
if (optionalFeatures.includes("browser")) {
|
|
245593
|
-
postSetupSteps.push(
|
|
245530
|
+
postSetupSteps.push(" \u2192 Run npx playwright install chromium");
|
|
245594
245531
|
}
|
|
245595
245532
|
console.log("\n" + boxen(
|
|
245596
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
|
|
245597
245534
|
|
|
245598
|
-
`) + source_default.gray("Need help? https://github.com/Hollandchirs/Opencrush"),
|
|
245535
|
+
`) + (setupMode === "quick" ? source_default.gray(" Unlock voice/browser/Twitter: run setup again \u2192 Full setup\n\n") : "") + source_default.gray("Need help? https://github.com/Hollandchirs/Opencrush"),
|
|
245599
245536
|
{ padding: 1, margin: 1, borderStyle: "round", borderColor: "magenta" }
|
|
245600
245537
|
));
|
|
245601
245538
|
const { startNow } = await esm_default12.prompt([{
|