opencrush 0.2.6 → 0.2.8

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -74
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38420,11 +38420,6 @@ async function callLLMDirect(provider, apiKey, systemPrompt, messages, maxTokens
38420
38420
  function getProviderInfo(id) {
38421
38421
  return PROVIDER_INFO.find((p2) => p2.id === id);
38422
38422
  }
38423
- function detectRegion() {
38424
- const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
38425
- const cnZones = ["Asia/Shanghai", "Asia/Beijing", "Asia/Chongqing", "Asia/Harbin", "PRC"];
38426
- return cnZones.includes(tz) ? "cn" : "overseas";
38427
- }
38428
38423
  var PROVIDER_META, PROVIDER_INFO;
38429
38424
  var init_llm_direct = __esm({
38430
38425
  "src/llm-direct.ts"() {
@@ -245012,7 +245007,6 @@ async function openBrowserPrompt(url, isCN) {
245012
245007
  }
245013
245008
  }
245014
245009
  async function runSetupWizard() {
245015
- var _a3;
245016
245010
  console.clear();
245017
245011
  console.log(source_default.magenta(`
245018
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,8 +245014,7 @@ async function runSetupWizard() {
245020
245014
  \u2551 Your AI companion, always there \u2551
245021
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\u255D
245022
245016
  `));
245023
- const region = detectRegion();
245024
- const isCN = region === "cn";
245017
+ const isCN = false;
245025
245018
  console.log(source_default.cyan(isCN ? "\u6B22\u8FCE\uFF01\u51E0\u6B65\u5C31\u80FD\u641E\u5B9A\u3002\n" : "Welcome! Let's get you set up.\n"));
245026
245019
  const { setupMode } = await esm_default12.prompt([{
245027
245020
  type: "list",
@@ -245029,18 +245022,18 @@ async function runSetupWizard() {
245029
245022
  message: isCN ? "\u9009\u62E9\u5B89\u88C5\u65B9\u5F0F:" : "How would you like to set up?",
245030
245023
  choices: [
245031
245024
  {
245032
- name: isCN ? `\u26A1 \u5FEB\u901F\u8BBE\u7F6E ${source_default.gray("(3\u6B65\uFF0C2\u5206\u949F\u641E\u5B9A \u2014 \u63A8\u8350\u65B0\u624B)")}` : `\u26A1 Quick setup ${source_default.gray("(3 steps, ~2 min \u2014 recommended)")}`,
245025
+ name: `\u26A1 Quick setup ${source_default.gray("(selfies, Spotify, all core features \u2014 recommended)")}`,
245033
245026
  value: "quick",
245034
- short: isCN ? "\u5FEB\u901F" : "Quick"
245027
+ short: "Quick"
245035
245028
  },
245036
245029
  {
245037
- name: isCN ? `\u{1F527} \u5B8C\u6574\u8BBE\u7F6E ${source_default.gray("(5\u6B65\uFF0C\u89E3\u9501\u81EA\u62CD/\u8BED\u97F3/\u81EA\u4E3B\u53D1\u5E16\u7B49)")}` : `\u{1F527} Full setup ${source_default.gray("(5 steps, unlock selfies / voice / auto-post)")}`,
245030
+ name: `\u{1F527} Full setup ${source_default.gray("(+ voice messages, browser, Twitter auto-posting)")}`,
245038
245031
  value: "full",
245039
- short: isCN ? "\u5B8C\u6574" : "Full"
245032
+ short: "Full"
245040
245033
  }
245041
245034
  ]
245042
245035
  }]);
245043
- const TOTAL_STEPS = setupMode === "quick" ? 3 : 5;
245036
+ const TOTAL_STEPS = 5;
245044
245037
  const step = (n2, label) => {
245045
245038
  console.log(source_default.cyan(`
245046
245039
  [${n2}/${TOTAL_STEPS}] ${label}`));
@@ -245256,69 +245249,24 @@ async function runSetupWizard() {
245256
245249
  envValues.OLLAMA_BASE_URL = "http://localhost:11434";
245257
245250
  envValues.OLLAMA_MODEL = "qwen2.5:7b";
245258
245251
  }
245259
- if (setupMode === "quick") {
245260
- envValues.PROACTIVE_MESSAGE_MIN_INTERVAL = "120";
245261
- envValues.PROACTIVE_MESSAGE_MAX_INTERVAL = "240";
245262
- envValues.QUIET_HOURS_START = "23";
245263
- envValues.QUIET_HOURS_END = "8";
245264
- const quickEnvPath = (0, import_fs20.existsSync)(_legacyEnv) && _legacyEnv !== getEnvPath() ? _legacyEnv : getEnvPath();
245265
- const quickSpinner = ora("Writing configuration...").start();
245266
- (0, import_fs20.writeFileSync)(quickEnvPath, generateEnvFile(envValues), "utf-8");
245267
- quickSpinner.succeed(`Configuration saved to ${quickEnvPath}`);
245268
- console.log("\n" + boxen(
245269
- 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") + [
245270
- `\u{1F9E0} AI: ${((_a3 = getProviderInfo(envValues.LLM_PROVIDER)) == null ? void 0 : _a3.name) ?? envValues.LLM_PROVIDER}`,
245271
- `\u{1F49D} ${isCN ? "\u89D2\u8272" : "Character"}: ${characterName}`,
245272
- envValues.WHATSAPP_ENABLED ? "\u{1F4AC} WhatsApp" : "",
245273
- envValues.DISCORD_BOT_TOKEN ? "\u{1F3AE} Discord" : "",
245274
- envValues.TELEGRAM_BOT_TOKEN ? "\u{1F4EC} Telegram" : "",
245275
- "\u{1F495} Emotion engine \u{1F91D} Relationship tracking \u{1F9E0} Memory"
245276
- ].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"),
245277
- { padding: 1, margin: 1, borderStyle: "round", borderColor: "magenta" }
245278
- ));
245279
- const { startNow: quickStart } = await esm_default12.prompt([{
245280
- type: "confirm",
245281
- name: "startNow",
245282
- message: isCN ? "\u73B0\u5728\u542F\u52A8\u4F60\u7684\u4F34\u4FA3\uFF1F" : "Start your companion now?",
245283
- default: true
245284
- }]);
245285
- if (quickStart) {
245286
- const dotenv3 = await Promise.resolve().then(() => __toESM(require_main()));
245287
- dotenv3.config({ path: quickEnvPath, override: true });
245288
- const { startOpencrush: startOpencrush2 } = await Promise.resolve().then(() => (init_start(), start_exports));
245289
- await startOpencrush2();
245290
- }
245291
- return;
245292
- }
245293
- step(4, isCN ? "\u611F\u5B98\u529F\u80FD\uFF08\u53EF\u9009\uFF09" : "Sensory features (optional)");
245294
- 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, "Features");
245253
+ console.log(source_default.gray("These features make your companion come alive \u2014 visible, audible, and social.\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
+ ];
245295
245265
  const { optionalFeatures } = await esm_default12.prompt([{
245296
245266
  type: "checkbox",
245297
245267
  name: "optionalFeatures",
245298
- message: isCN ? "\u9009\u62E9\u8981\u542F\u7528\u7684\u611F\u5B98\u529F\u80FD:" : "Which features do you want?",
245299
- choices: [
245300
- {
245301
- 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)",
245302
- value: "images",
245303
- checked: false
245304
- },
245305
- {
245306
- 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)",
245307
- value: "voice"
245308
- },
245309
- {
245310
- 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]")}`,
245311
- value: "twitter"
245312
- },
245313
- {
245314
- 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]")}`,
245315
- value: "browser"
245316
- },
245317
- {
245318
- 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)",
245319
- value: "spotify"
245320
- }
245321
- ]
245268
+ message: "Which features do you want?",
245269
+ choices: setupMode === "quick" ? quickChoices : fullChoices
245322
245270
  }]);
245323
245271
  if (optionalFeatures.includes("images")) {
245324
245272
  console.log(source_default.yellow("\n \u{1F449} fal.ai API key (free credits on signup):"));
@@ -245584,7 +245532,7 @@ async function runSetupWizard() {
245584
245532
  console.log("\n" + boxen(
245585
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
245586
245534
 
245587
- `) + 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"),
245588
245536
  { padding: 1, margin: 1, borderStyle: "round", borderColor: "magenta" }
245589
245537
  ));
245590
245538
  const { startNow } = await esm_default12.prompt([{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencrush",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Your AI companion lives on your computer. She watches dramas, listens to music, and thinks of you.",
5
5
  "bin": {
6
6
  "opencrush": "dist/index.js"