scream-code 0.4.2 → 0.4.3

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/main.mjs +45 -5
  2. package/package.json +2 -2
package/dist/main.mjs CHANGED
@@ -113599,10 +113599,27 @@ async function locateWindowsGitBash(deps) {
113599
113599
  checked.push(inferred);
113600
113600
  if (await deps.isFile(inferred)) return inferred;
113601
113601
  }
113602
+ const fellback = inferBashByWalkingUp(gitExe);
113603
+ if (fellback !== void 0) {
113604
+ checked.push(fellback);
113605
+ if (await deps.isFile(fellback)) return fellback;
113606
+ }
113607
+ }
113608
+ const bashExe = await deps.findExecutable("bash.exe");
113609
+ if (bashExe !== void 0) {
113610
+ checked.push(bashExe);
113611
+ return bashExe;
113602
113612
  }
113603
- const candidates = ["C:\\Program Files\\Git\\bin\\bash.exe", "C:\\Program Files (x86)\\Git\\bin\\bash.exe"];
113613
+ const candidates = [
113614
+ "C:\\Program Files\\Git\\bin\\bash.exe",
113615
+ "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
113616
+ "C:\\msys64\\usr\\bin\\bash.exe",
113617
+ "C:\\cygwin64\\bin\\bash.exe"
113618
+ ];
113604
113619
  const localAppData = deps.env["LOCALAPPDATA"]?.trim();
113605
113620
  if (localAppData !== void 0 && localAppData.length > 0) candidates.push(`${localAppData}\\Programs\\Git\\bin\\bash.exe`);
113621
+ const userProfile = deps.env["USERPROFILE"]?.trim();
113622
+ if (userProfile !== void 0 && userProfile.length > 0) candidates.push(`${userProfile}\\scoop\\apps\\git\\current\\bin\\bash.exe`);
113606
113623
  for (const candidate of candidates) {
113607
113624
  checked.push(candidate);
113608
113625
  if (await deps.isFile(candidate)) return candidate;
@@ -113620,6 +113637,16 @@ function inferGitBashFromGitExe(gitExe) {
113620
113637
  }
113621
113638
  }
113622
113639
  }
113640
+ function inferBashByWalkingUp(gitExe) {
113641
+ const sep = gitExe.includes("\\") ? "\\" : "/";
113642
+ const parts = gitExe.split(sep);
113643
+ for (let i = parts.length - 1; i >= 1 && parts.length - i <= 6; i -= 1) {
113644
+ const root = parts.slice(0, i).join(sep) || sep;
113645
+ const candidate = `${root}${sep}bin${sep}bash.exe`;
113646
+ const gitDir = parts.slice(0, -1).join(sep);
113647
+ if (`${root}${sep}bin` !== gitDir) return candidate;
113648
+ }
113649
+ }
113623
113650
  /**
113624
113651
  * Production convenience — derive the deps bag from Node's ambient surface.
113625
113652
  *
@@ -114250,6 +114277,10 @@ var ScreamCore = class {
114250
114277
  });
114251
114278
  this.sdk = rpcClient(this);
114252
114279
  }
114280
+ /** Resolve the shell environment so missing Git Bash is surfaced early. */
114281
+ async preflight() {
114282
+ await this.jian;
114283
+ }
114253
114284
  async createSession(input) {
114254
114285
  const options = input;
114255
114286
  const workDir = requiredWorkDir("createSession", options.workDir);
@@ -114954,6 +114985,9 @@ var SDKRpcClient = class {
114954
114985
  get configPath() {
114955
114986
  return this.core.configPath;
114956
114987
  }
114988
+ async preflight() {
114989
+ await this.core.preflight();
114990
+ }
114957
114991
  async createSession(input) {
114958
114992
  const rpc = await this.getRpc();
114959
114993
  const { planMode, ...coreInput } = input;
@@ -115892,6 +115926,10 @@ var ScreamHarness = class {
115892
115926
  async getExperimentalFlags() {
115893
115927
  return this.rpc.getExperimentalFlags();
115894
115928
  }
115929
+ /** Validate host environment before starting the UI. */
115930
+ async preflight() {
115931
+ await this.rpc.preflight();
115932
+ }
115895
115933
  async ensureConfigFile() {
115896
115934
  await ensureConfigFile(this.configPath);
115897
115935
  }
@@ -135456,7 +135494,7 @@ function renderSheen(char, charIndex, sheenPos, isReversing, accent) {
135456
135494
  else color = charIndex <= sheenPos ? accent : LOGO_RGB;
135457
135495
  return `${fg(...color)}${char}${RESET}`;
135458
135496
  }
135459
- const LOADING_TEXT = "加载中...";
135497
+ const LOADING_TEXT = "Ai正在加载中...";
135460
135498
  function buildShimmerPalette(n, accent) {
135461
135499
  const size = Math.max(8, Math.min(20, Math.ceil(n * 1.5)));
135462
135500
  const palette = [];
@@ -135565,10 +135603,10 @@ function runLoadingAnimation(theme = "dark") {
135565
135603
  lines.push(centerPad(colored, cols));
135566
135604
  }
135567
135605
  if (phase === "loading") lines.push(centerPad(renderShimmer(shimmerPulse, accent), cols));
135568
- else lines.push(centerPad(`${BOLD}${fg(...accent)}点击 ENTER 进入${RESET}`, cols));
135606
+ else lines.push(centerPad(`${BOLD}${fg(...accent)}点击按下 ENTER 唤醒核心${RESET}`, cols));
135569
135607
  lines.push("");
135570
135608
  lines.push("");
135571
- lines.push(centerPad(`${fg(...DIM_RGB)} Ctrl+C 即可退出Scream Code${RESET}`, cols));
135609
+ lines.push(centerPad(`${fg(...DIM_RGB)}按住 Ctrl+C 即可退出 Scream Code${RESET}`, cols));
135572
135610
  while (lines.length < rows) lines.push("");
135573
135611
  stdout.write("\x1B[H");
135574
135612
  stdout.write(lines.join("\n"));
@@ -135579,7 +135617,7 @@ function runLoadingAnimation(theme = "dark") {
135579
135617
  isReversing = !isReversing;
135580
135618
  sheenPos = 0;
135581
135619
  }
135582
- shimmerPulse = (shimmerPulse + 1) % 6;
135620
+ shimmerPulse = (shimmerPulse + 1) % 10;
135583
135621
  render();
135584
135622
  }
135585
135623
  function cleanup() {
@@ -135598,6 +135636,7 @@ function runLoadingAnimation(theme = "dark") {
135598
135636
  stdin.setRawMode(true);
135599
135637
  stdin.on("data", (data) => {
135600
135638
  const key = data.toString();
135639
+ if (key === "") interrupt();
135601
135640
  if ((key === "\r" || key === "\n") && phase === "ready") {
135602
135641
  cleanup();
135603
135642
  resolve();
@@ -135648,6 +135687,7 @@ async function runShell(opts, version) {
135648
135687
  await harness.ensureConfigFile();
135649
135688
  const config = await harness.getConfig();
135650
135689
  const configMs = Date.now() - configStartedAt;
135690
+ await harness.preflight();
135651
135691
  await runLoadingAnimation(resolvedTheme);
135652
135692
  const tui = new ScreamTUI(harness, {
135653
135693
  cliOptions: opts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scream-code",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "The Starting Point for Next-Gen Agents",
5
5
  "license": "MIT",
6
6
  "author": "ScreamCli",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public",
43
- "provenance": true
43
+ "provenance": false
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsdown",