scream-code 0.4.2 → 0.4.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/main.mjs +62 -14
- 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 = [
|
|
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
|
}
|
|
@@ -135414,6 +135452,7 @@ const SHADOW_CHARS = new Set([
|
|
|
135414
135452
|
]);
|
|
135415
135453
|
const SHEEN_STEP = 2;
|
|
135416
135454
|
const SHEEN_INTERVAL_MS = 150;
|
|
135455
|
+
const LOADING_DURATION_MS = 2200;
|
|
135417
135456
|
const THEME_ACCENT = {
|
|
135418
135457
|
dark: [
|
|
135419
135458
|
78,
|
|
@@ -135456,7 +135495,7 @@ function renderSheen(char, charIndex, sheenPos, isReversing, accent) {
|
|
|
135456
135495
|
else color = charIndex <= sheenPos ? accent : LOGO_RGB;
|
|
135457
135496
|
return `${fg(...color)}${char}${RESET}`;
|
|
135458
135497
|
}
|
|
135459
|
-
const LOADING_TEXT = "
|
|
135498
|
+
const LOADING_TEXT = "Ai正在加载中...";
|
|
135460
135499
|
function buildShimmerPalette(n, accent) {
|
|
135461
135500
|
const size = Math.max(8, Math.min(20, Math.ceil(n * 1.5)));
|
|
135462
135501
|
const palette = [];
|
|
@@ -135542,6 +135581,7 @@ function supportsAnsi() {
|
|
|
135542
135581
|
function runLoadingAnimation(theme = "dark") {
|
|
135543
135582
|
if (!supportsAnsi()) {
|
|
135544
135583
|
for (const line of LOGO) stdout.write(`${fg(...LOGO_RGB)}${line}${RESET}\n`);
|
|
135584
|
+
stdout.write(`${BOLD}${fg(...THEME_ACCENT[theme])}正在唤醒核心...${RESET}\n`);
|
|
135545
135585
|
return Promise.resolve();
|
|
135546
135586
|
}
|
|
135547
135587
|
return new Promise((resolve) => {
|
|
@@ -135565,10 +135605,10 @@ function runLoadingAnimation(theme = "dark") {
|
|
|
135565
135605
|
lines.push(centerPad(colored, cols));
|
|
135566
135606
|
}
|
|
135567
135607
|
if (phase === "loading") lines.push(centerPad(renderShimmer(shimmerPulse, accent), cols));
|
|
135568
|
-
else lines.push(centerPad(`${BOLD}${fg(...accent)}
|
|
135608
|
+
else lines.push(centerPad(`${BOLD}${fg(...accent)}按下 ENTER 唤醒核心${RESET}`, cols));
|
|
135569
135609
|
lines.push("");
|
|
135570
135610
|
lines.push("");
|
|
135571
|
-
lines.push(centerPad(`${fg(...DIM_RGB)}
|
|
135611
|
+
lines.push(centerPad(`${fg(...DIM_RGB)}按住 Ctrl+C 即可退出 Scream Code${RESET}`, cols));
|
|
135572
135612
|
while (lines.length < rows) lines.push("");
|
|
135573
135613
|
stdout.write("\x1B[H");
|
|
135574
135614
|
stdout.write(lines.join("\n"));
|
|
@@ -135579,12 +135619,25 @@ function runLoadingAnimation(theme = "dark") {
|
|
|
135579
135619
|
isReversing = !isReversing;
|
|
135580
135620
|
sheenPos = 0;
|
|
135581
135621
|
}
|
|
135582
|
-
shimmerPulse = (shimmerPulse + 1) %
|
|
135622
|
+
shimmerPulse = (shimmerPulse + 1) % 10;
|
|
135583
135623
|
render();
|
|
135584
135624
|
}
|
|
135625
|
+
function onData(data) {
|
|
135626
|
+
const key = data.toString();
|
|
135627
|
+
if (key === "") {
|
|
135628
|
+
interrupt();
|
|
135629
|
+
return;
|
|
135630
|
+
}
|
|
135631
|
+
if ((key === "\r" || key === "\n") && phase === "ready") {
|
|
135632
|
+
cleanup();
|
|
135633
|
+
resolve();
|
|
135634
|
+
}
|
|
135635
|
+
}
|
|
135585
135636
|
function cleanup() {
|
|
135586
135637
|
clearInterval(timer);
|
|
135587
|
-
stdin.
|
|
135638
|
+
stdin.off("data", onData);
|
|
135639
|
+
process$1.off("SIGINT", interrupt);
|
|
135640
|
+
process$1.off("SIGTERM", interrupt);
|
|
135588
135641
|
stdin.setRawMode(false);
|
|
135589
135642
|
stdout.write("\x1B[?25h");
|
|
135590
135643
|
stdout.write("\x1B[?1049l");
|
|
@@ -135596,19 +135649,13 @@ function runLoadingAnimation(theme = "dark") {
|
|
|
135596
135649
|
process$1.on("SIGINT", interrupt);
|
|
135597
135650
|
process$1.on("SIGTERM", interrupt);
|
|
135598
135651
|
stdin.setRawMode(true);
|
|
135599
|
-
stdin.on("data",
|
|
135600
|
-
const key = data.toString();
|
|
135601
|
-
if ((key === "\r" || key === "\n") && phase === "ready") {
|
|
135602
|
-
cleanup();
|
|
135603
|
-
resolve();
|
|
135604
|
-
}
|
|
135605
|
-
});
|
|
135652
|
+
stdin.on("data", onData);
|
|
135606
135653
|
render();
|
|
135607
135654
|
const timer = setInterval(tick, SHEEN_INTERVAL_MS);
|
|
135608
135655
|
setTimeout(() => {
|
|
135609
135656
|
phase = "ready";
|
|
135610
135657
|
render();
|
|
135611
|
-
},
|
|
135658
|
+
}, LOADING_DURATION_MS);
|
|
135612
135659
|
});
|
|
135613
135660
|
}
|
|
135614
135661
|
//#endregion
|
|
@@ -135648,6 +135695,7 @@ async function runShell(opts, version) {
|
|
|
135648
135695
|
await harness.ensureConfigFile();
|
|
135649
135696
|
const config = await harness.getConfig();
|
|
135650
135697
|
const configMs = Date.now() - configStartedAt;
|
|
135698
|
+
await harness.preflight();
|
|
135651
135699
|
await runLoadingAnimation(resolvedTheme);
|
|
135652
135700
|
const tui = new ScreamTUI(harness, {
|
|
135653
135701
|
cliOptions: opts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scream-code",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
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":
|
|
43
|
+
"provenance": false
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsdown",
|