scream-code 0.14.1 → 0.14.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.
- package/dist/{app-CFpRDtjN.mjs → app-BFd_pXnN.mjs} +5 -8
- package/dist/{dispatch-D71h_08g.mjs → dispatch-C-4ECE2V.mjs} +1 -1
- package/dist/{dispatch-202xtik3.mjs → dispatch-Swei67j2.mjs} +97 -54
- package/dist/main.mjs +1 -1
- package/dist/{text-input-dialog-DVWsE7Gh.mjs → text-input-dialog-BLM32jyJ.mjs} +1 -1
- package/dist/{text-input-dialog-BzVVVncg.mjs → text-input-dialog-Ciit7nAM.mjs} +24 -10
- package/package.json +1 -1
|
@@ -4,8 +4,8 @@ import { dirname as __cjsShimDirname } from 'node:path';
|
|
|
4
4
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = __cjsShimDirname(__filename);
|
|
6
6
|
import "./suppress-sqlite-warning-C2VB0doZ.mjs";
|
|
7
|
-
import { $t as isTodoItemShape, A as renderDiffLinesClustered, An as CLI_COMMAND_NAME, At as ENABLE_TERMINAL_FOCUS_REPORTING, B as BackgroundAgentStatusComponent, Bn as MemoryMemoStore, Bt as TERMINAL_THEME_LIGHT, Cn as loadTuiConfig, Ct as createThemeStyles, D as toggleEmptySessionHint, Dn as getInputHistoryFile, Dt as parseOsc11BackgroundTheme, E as isTurnElapsedEnabled, En as getDataDir, Et as detectTerminalTheme, F as estimateTokens, Fn as fetchCatalog, Ft as OSC11_RESPONSE_PREFIX_NO_ESC, G as getBreathingFrame, Gn as isOrphanedToolCallError, H as AgentGroupComponent, Hn as log, Ht as isStreaming, I as getSharedSpeedTracker, In as saveCatalogCache, It as QUERY_TERMINAL_THEME, J as refineGoal, Jt as printableChar, K as resetBreathingClock, Kn as ErrorCodes, L as SkillActivationComponent, Ln as ScreamHarness, Lt as TERMINAL_FOCUS_IN, M as langFromPath, Mn as CLI_USER_AGENT_PRODUCT, Mt as OSC11_QUERY, N as CachedContainer, Nn as PRODUCT_NAME, Nt as OSC11_RESPONSE, O as ToolCallComponent, On as getLogDir, Ot as DISABLE_TERMINAL_FOCUS_REPORTING, P as ThinkingComponent, Pn as DEFAULT_CATALOG_URL, Pt as OSC11_RESPONSE_PREFIX, Qt as formatErrorMessage, R as ReadGroupComponent, Rt as TERMINAL_FOCUS_OUT, S as getDaemonInstructions, Sn as TuiLikePreferencesSchema, St as createMarkdownTheme, T as isEmptySessionHintDismissed, Tn as detectShellEnvironment, Tt as getColorPalette, U as WelcomeComponent, Un as resolveGlobalLogPath, Ut as FooterComponent, V as AssistantMessageComponent, Vn as flushDiagnosticLogs, Vt as isBusy, W as BREATHE_CYCLE_MS, Wn as isScreamError, Xt as appendStreamingArgsPreview, Yt as STATUS_BULLET, Zt as argsRecord, _ as refreshUpdateCache, _n as isExperimentalFlagEnabled, _t as clearInfoPanelState, an as EMPTY_SESSION_HINT_URL, b as readJsonlFile, bn as PULSE_WAVE_FRAMES, bt as resolveThemeSync, c as hasDispose, cn as SESSION_TIPS, ct as handlePlanCommand, d as formatMemoryMemoForInjection, dn as getCtrlDHint, en as parseStreamingArgs, et as toTerminalHyperlink, fn as getLlmNotSetMessage, g as selectUpdateTarget, gn as sortSlashCommands, gt as supportsBalance, hn as BUILTIN_SLASH_COMMANDS, ht as refreshProviderBalance, i as buildRoleAdditionalText, in as CHARS_PER_TOKEN, j as highlightLines, jn as CLI_UI_MODE, jt as ENABLE_TERMINAL_THEME_REPORTING, k as renderDiffLines, kn as detectInstallSource, kt as DISABLE_TERMINAL_THEME_REPORTING, l as isPlanExpandable, ln as TIP_ROTATION_INTERVAL_MS, mn as buildSkillSlashCommands, n as clearEvalPanelState, nn as stringValue, nt as getModelCycleLevel, on as EXIT_CONFIRM_WINDOW_MS, ot as handleFusionPlanCommand, pn as getNoActiveSessionMessage, q as clearGoalState, qn as SCREAM_ERROR_INFO, r as openUrl, rn as truncateErrorMessage, s as disposeChildren, sn as MAIN_AGENT_ID, t as dispatchInput, tn as serializeToolResultOutput, tt as changeThinkingLevel, u as MoonLoader, un as getCtrlCHint, v as readUpdateCache, vn as setExperimentalFlags, w as UserMessageComponent, wn as saveTuiConfig, wt as contrastTextHex, xn as TuiConfigParseError, xt as createEditorTheme, y as appendJsonlLine, yn as PIXEL_PULSE_FRAMES, z as parseReadGroupOutput, zn as resolveScreamHome, zt as TERMINAL_THEME_DARK } from "./dispatch-
|
|
8
|
-
import { a as setLocale, o as t } from "./text-input-dialog-
|
|
7
|
+
import { $t as isTodoItemShape, A as renderDiffLinesClustered, An as CLI_COMMAND_NAME, At as ENABLE_TERMINAL_FOCUS_REPORTING, B as BackgroundAgentStatusComponent, Bn as MemoryMemoStore, Bt as TERMINAL_THEME_LIGHT, Cn as loadTuiConfig, Ct as createThemeStyles, D as toggleEmptySessionHint, Dn as getInputHistoryFile, Dt as parseOsc11BackgroundTheme, E as isTurnElapsedEnabled, En as getDataDir, Et as detectTerminalTheme, F as estimateTokens, Fn as fetchCatalog, Ft as OSC11_RESPONSE_PREFIX_NO_ESC, G as getBreathingFrame, Gn as isOrphanedToolCallError, H as AgentGroupComponent, Hn as log, Ht as isStreaming, I as getSharedSpeedTracker, In as saveCatalogCache, It as QUERY_TERMINAL_THEME, J as refineGoal, Jt as printableChar, K as resetBreathingClock, Kn as ErrorCodes, L as SkillActivationComponent, Ln as ScreamHarness, Lt as TERMINAL_FOCUS_IN, M as langFromPath, Mn as CLI_USER_AGENT_PRODUCT, Mt as OSC11_QUERY, N as CachedContainer, Nn as PRODUCT_NAME, Nt as OSC11_RESPONSE, O as ToolCallComponent, On as getLogDir, Ot as DISABLE_TERMINAL_FOCUS_REPORTING, P as ThinkingComponent, Pn as DEFAULT_CATALOG_URL, Pt as OSC11_RESPONSE_PREFIX, Qt as formatErrorMessage, R as ReadGroupComponent, Rt as TERMINAL_FOCUS_OUT, S as getDaemonInstructions, Sn as TuiLikePreferencesSchema, St as createMarkdownTheme, T as isEmptySessionHintDismissed, Tn as detectShellEnvironment, Tt as getColorPalette, U as WelcomeComponent, Un as resolveGlobalLogPath, Ut as FooterComponent, V as AssistantMessageComponent, Vn as flushDiagnosticLogs, Vt as isBusy, W as BREATHE_CYCLE_MS, Wn as isScreamError, Xt as appendStreamingArgsPreview, Yt as STATUS_BULLET, Zt as argsRecord, _ as refreshUpdateCache, _n as isExperimentalFlagEnabled, _t as clearInfoPanelState, an as EMPTY_SESSION_HINT_URL, b as readJsonlFile, bn as PULSE_WAVE_FRAMES, bt as resolveThemeSync, c as hasDispose, cn as SESSION_TIPS, ct as handlePlanCommand, d as formatMemoryMemoForInjection, dn as getCtrlDHint, en as parseStreamingArgs, et as toTerminalHyperlink, fn as getLlmNotSetMessage, g as selectUpdateTarget, gn as sortSlashCommands, gt as supportsBalance, hn as BUILTIN_SLASH_COMMANDS, ht as refreshProviderBalance, i as buildRoleAdditionalText, in as CHARS_PER_TOKEN, j as highlightLines, jn as CLI_UI_MODE, jt as ENABLE_TERMINAL_THEME_REPORTING, k as renderDiffLines, kn as detectInstallSource, kt as DISABLE_TERMINAL_THEME_REPORTING, l as isPlanExpandable, ln as TIP_ROTATION_INTERVAL_MS, mn as buildSkillSlashCommands, n as clearEvalPanelState, nn as stringValue, nt as getModelCycleLevel, on as EXIT_CONFIRM_WINDOW_MS, ot as handleFusionPlanCommand, pn as getNoActiveSessionMessage, q as clearGoalState, qn as SCREAM_ERROR_INFO, r as openUrl, rn as truncateErrorMessage, s as disposeChildren, sn as MAIN_AGENT_ID, t as dispatchInput, tn as serializeToolResultOutput, tt as changeThinkingLevel, u as MoonLoader, un as getCtrlCHint, v as readUpdateCache, vn as setExperimentalFlags, w as UserMessageComponent, wn as saveTuiConfig, wt as contrastTextHex, xn as TuiConfigParseError, xt as createEditorTheme, y as appendJsonlLine, yn as PIXEL_PULSE_FRAMES, z as parseReadGroupOutput, zn as resolveScreamHome, zt as TERMINAL_THEME_DARK } from "./dispatch-Swei67j2.mjs";
|
|
8
|
+
import { a as setLocale, o as t } from "./text-input-dialog-Ciit7nAM.mjs";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
import { access, mkdir, mkdtemp, readFile, readdir, realpath, rm, unlink, writeFile } from "node:fs/promises";
|
|
@@ -30,7 +30,7 @@ function optionalBuildString(value) {
|
|
|
30
30
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
31
31
|
}
|
|
32
32
|
const SCREAM_BUILD_INFO = {
|
|
33
|
-
version: optionalBuildString("0.14.
|
|
33
|
+
version: optionalBuildString("0.14.3"),
|
|
34
34
|
channel: optionalBuildString(""),
|
|
35
35
|
commit: optionalBuildString(""),
|
|
36
36
|
buildTarget: optionalBuildString("darwin-arm64")
|
|
@@ -3998,10 +3998,7 @@ var StreamingUIController = class {
|
|
|
3998
3998
|
const tokens = estimateTokens(delta);
|
|
3999
3999
|
if (this.lastDeltaAt !== void 0) {
|
|
4000
4000
|
const elapsedMs = now - this.lastDeltaAt;
|
|
4001
|
-
if (elapsedMs > 0)
|
|
4002
|
-
const rate = tokens / elapsedMs * 1e3;
|
|
4003
|
-
getSharedSpeedTracker().observe(rate, now);
|
|
4004
|
-
}
|
|
4001
|
+
if (elapsedMs > 0) getSharedSpeedTracker().observe(tokens, elapsedMs, now);
|
|
4005
4002
|
}
|
|
4006
4003
|
this.lastDeltaAt = now;
|
|
4007
4004
|
}
|
|
@@ -12192,7 +12189,7 @@ var ScreamTUI = class {
|
|
|
12192
12189
|
const card = new OnboardingCardComponent({
|
|
12193
12190
|
colors: this.state.theme.colors,
|
|
12194
12191
|
onConfigure: () => {
|
|
12195
|
-
import("./dispatch-
|
|
12192
|
+
import("./dispatch-C-4ECE2V.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
|
|
12196
12193
|
this.restoreEditor();
|
|
12197
12194
|
});
|
|
12198
12195
|
},
|
|
@@ -3,5 +3,5 @@ import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
|
3
3
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
4
4
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = __cjsShimDirname(__filename);
|
|
6
|
-
import { Kt as handleConnectCommand } from "./dispatch-
|
|
6
|
+
import { Kt as handleConnectCommand } from "./dispatch-Swei67j2.mjs";
|
|
7
7
|
export { handleConnectCommand };
|
|
@@ -6,7 +6,7 @@ const __dirname = __cjsShimDirname(__filename);
|
|
|
6
6
|
import { i as __require, o as __toESM, r as __exportAll, t as __commonJSMin } from "./chunk-D90kvbyJ.mjs";
|
|
7
7
|
import { C as join$1, D as resolve$1, E as relative$1, S as isAbsolute$1, T as parse$7, a as isSupportedFile, b as basename$1, i as ingestFile, r as ingestDirectory, t as multiSearch, w as normalize, x as dirname$2, y as KnowledgeStore } from "./src-BH9W5k24.mjs";
|
|
8
8
|
import { t as require_base64_js } from "./base64-js-DzVmk6Nb.mjs";
|
|
9
|
-
import { a as setLocale, i as getLocale, n as assertScreamHostIdentity, o as t, r as createScreamDefaultHeaders, t as TextInputDialogComponent } from "./text-input-dialog-
|
|
9
|
+
import { a as setLocale, i as getLocale, n as assertScreamHostIdentity, o as t, r as createScreamDefaultHeaders, t as TextInputDialogComponent } from "./text-input-dialog-Ciit7nAM.mjs";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import { createHash, randomBytes, randomInt, randomUUID } from "node:crypto";
|
|
12
12
|
import * as fs$1 from "node:fs/promises";
|
|
@@ -123065,7 +123065,7 @@ function applyCatalogProvider(config, options) {
|
|
|
123065
123065
|
config.thinking = {
|
|
123066
123066
|
...config.thinking,
|
|
123067
123067
|
mode: thinkingLevel === "off" ? "off" : "on",
|
|
123068
|
-
effort: thinkingLevel
|
|
123068
|
+
effort: thinkingLevel === "off" ? config.thinking?.effort ?? "low" : thinkingLevel
|
|
123069
123069
|
};
|
|
123070
123070
|
return { defaultModel };
|
|
123071
123071
|
}
|
|
@@ -124443,6 +124443,7 @@ const DEFAULT_THINKING_LEVELS = [
|
|
|
124443
124443
|
"low",
|
|
124444
124444
|
"medium",
|
|
124445
124445
|
"high",
|
|
124446
|
+
"xhigh",
|
|
124446
124447
|
"max"
|
|
124447
124448
|
];
|
|
124448
124449
|
function modelDisplayName$1(alias, model) {
|
|
@@ -124704,15 +124705,23 @@ function runModelSelector(host, modelDict) {
|
|
|
124704
124705
|
});
|
|
124705
124706
|
}
|
|
124706
124707
|
function getWireTypeOptions() {
|
|
124707
|
-
return [
|
|
124708
|
-
|
|
124709
|
-
|
|
124710
|
-
|
|
124711
|
-
|
|
124712
|
-
|
|
124713
|
-
|
|
124714
|
-
|
|
124715
|
-
|
|
124708
|
+
return [
|
|
124709
|
+
{
|
|
124710
|
+
value: "openai",
|
|
124711
|
+
label: t("prompts.wire_openai"),
|
|
124712
|
+
description: t("prompts.wire_openai_desc")
|
|
124713
|
+
},
|
|
124714
|
+
{
|
|
124715
|
+
value: "openai_responses",
|
|
124716
|
+
label: t("prompts.wire_openai_responses"),
|
|
124717
|
+
description: t("prompts.wire_openai_responses_desc")
|
|
124718
|
+
},
|
|
124719
|
+
{
|
|
124720
|
+
value: "anthropic",
|
|
124721
|
+
label: t("prompts.wire_anthropic"),
|
|
124722
|
+
description: t("prompts.wire_anthropic_desc")
|
|
124723
|
+
}
|
|
124724
|
+
];
|
|
124716
124725
|
}
|
|
124717
124726
|
function getThinkingOptions() {
|
|
124718
124727
|
return [
|
|
@@ -124731,6 +124740,14 @@ function getThinkingOptions() {
|
|
|
124731
124740
|
{
|
|
124732
124741
|
value: "high",
|
|
124733
124742
|
label: t("prompts.thinking_high")
|
|
124743
|
+
},
|
|
124744
|
+
{
|
|
124745
|
+
value: "xhigh",
|
|
124746
|
+
label: t("prompts.thinking_xhigh")
|
|
124747
|
+
},
|
|
124748
|
+
{
|
|
124749
|
+
value: "max",
|
|
124750
|
+
label: t("prompts.thinking_max")
|
|
124734
124751
|
}
|
|
124735
124752
|
];
|
|
124736
124753
|
}
|
|
@@ -125007,16 +125024,29 @@ async function handleDiyConfig(host) {
|
|
|
125007
125024
|
if (wire === void 0) return;
|
|
125008
125025
|
const baseUrl = await promptTextInput$2(host, t("auth.input_api_url"), { subtitle: t("auth.api_url_hint") });
|
|
125009
125026
|
if (baseUrl === void 0) return;
|
|
125027
|
+
if (!baseUrl.trim()) {
|
|
125028
|
+
host.showError(t("auth.error_empty_base_url"));
|
|
125029
|
+
return;
|
|
125030
|
+
}
|
|
125010
125031
|
const apiKey = await promptTextInput$2(host, t("auth.input_api_key"), { subtitle: t("auth.api_key_hint") });
|
|
125011
125032
|
if (apiKey === void 0) return;
|
|
125012
125033
|
const modelId = await promptTextInput$2(host, t("auth.input_model"), { subtitle: t("auth.model_hint") });
|
|
125013
125034
|
if (modelId === void 0) return;
|
|
125035
|
+
if (!modelId.trim()) {
|
|
125036
|
+
host.showError(t("auth.error_empty_model_id"));
|
|
125037
|
+
return;
|
|
125038
|
+
}
|
|
125014
125039
|
const maxContextStr = await promptTextInput$2(host, t("auth.input_context"), {
|
|
125015
125040
|
subtitle: t("auth.context_hint"),
|
|
125016
125041
|
placeholder: "131072"
|
|
125017
125042
|
});
|
|
125018
125043
|
if (maxContextStr === void 0) return;
|
|
125019
|
-
const
|
|
125044
|
+
const parsed = parseInt(maxContextStr, 10);
|
|
125045
|
+
if (Number.isNaN(parsed) || parsed < 4096) {
|
|
125046
|
+
host.showError(t("auth.error_invalid_context_size"));
|
|
125047
|
+
return;
|
|
125048
|
+
}
|
|
125049
|
+
const maxContextTokens = parsed;
|
|
125020
125050
|
const thinkingLevel = await promptThinkingMode(host);
|
|
125021
125051
|
if (thinkingLevel === void 0) return;
|
|
125022
125052
|
const imageEnabled = await promptImageMode(host);
|
|
@@ -125041,28 +125071,22 @@ async function handleDiyConfig(host) {
|
|
|
125041
125071
|
maxOutputSize: wire === "anthropic" ? 32e3 : void 0
|
|
125042
125072
|
};
|
|
125043
125073
|
if ((await host.harness.getConfig()).providers[providerId] !== void 0) await host.harness.removeProvider(providerId);
|
|
125044
|
-
const
|
|
125045
|
-
|
|
125046
|
-
|
|
125074
|
+
const freshConfig = await host.harness.getConfig();
|
|
125075
|
+
applyCatalogProvider(freshConfig, {
|
|
125076
|
+
providerId,
|
|
125077
|
+
wire,
|
|
125047
125078
|
baseUrl,
|
|
125048
|
-
apiKey
|
|
125049
|
-
|
|
125050
|
-
|
|
125051
|
-
|
|
125052
|
-
|
|
125053
|
-
config.defaultModel = `${providerId}/${modelId}`;
|
|
125054
|
-
config.defaultThinking = thinkingLevel !== "off";
|
|
125055
|
-
config.thinking = {
|
|
125056
|
-
...config.thinking,
|
|
125057
|
-
mode: thinkingLevel === "off" ? "off" : "on",
|
|
125058
|
-
effort: thinkingLevel
|
|
125059
|
-
};
|
|
125079
|
+
apiKey,
|
|
125080
|
+
models: [catalogModel],
|
|
125081
|
+
selectedModelId: modelId,
|
|
125082
|
+
thinkingLevel
|
|
125083
|
+
});
|
|
125060
125084
|
await host.harness.setConfig({
|
|
125061
|
-
providers:
|
|
125062
|
-
models:
|
|
125063
|
-
defaultModel:
|
|
125064
|
-
defaultThinking:
|
|
125065
|
-
thinking:
|
|
125085
|
+
providers: freshConfig.providers,
|
|
125086
|
+
models: freshConfig.models,
|
|
125087
|
+
defaultModel: freshConfig.defaultModel,
|
|
125088
|
+
defaultThinking: freshConfig.defaultThinking,
|
|
125089
|
+
thinking: freshConfig.thinking
|
|
125066
125090
|
});
|
|
125067
125091
|
await host.authFlow.refreshConfigAfterLogin();
|
|
125068
125092
|
host.showStatus(t("auth.connected", { name: `${providerId} · ${modelId} (${wire})` }));
|
|
@@ -128547,6 +128571,7 @@ function getModelCycleLevel(models, alias, current) {
|
|
|
128547
128571
|
"low",
|
|
128548
128572
|
"medium",
|
|
128549
128573
|
"high",
|
|
128574
|
+
"xhigh",
|
|
128550
128575
|
"max"
|
|
128551
128576
|
];
|
|
128552
128577
|
const idx = levels.indexOf(current);
|
|
@@ -129472,7 +129497,7 @@ async function guidedGoalSetup(host) {
|
|
|
129472
129497
|
host.showNotice(t("goal.storm_breaker"), t("goal.conflict_loop"));
|
|
129473
129498
|
return;
|
|
129474
129499
|
}
|
|
129475
|
-
const { TextInputDialogComponent } = await import("./text-input-dialog-
|
|
129500
|
+
const { TextInputDialogComponent } = await import("./text-input-dialog-BLM32jyJ.mjs");
|
|
129476
129501
|
const initialDesc = await promptText(host, TextInputDialogComponent, {
|
|
129477
129502
|
title: t("goal.setup_title_initial"),
|
|
129478
129503
|
subtitle: t("goal.setup_desc_hint"),
|
|
@@ -129493,7 +129518,7 @@ async function guidedGoalSetup(host) {
|
|
|
129493
129518
|
await showGoalConfigWizard(host, session, confirmed.trim() || objective, false);
|
|
129494
129519
|
}
|
|
129495
129520
|
async function showGoalConfigWizard(host, session, objective, replace) {
|
|
129496
|
-
const { TextInputDialogComponent } = await import("./text-input-dialog-
|
|
129521
|
+
const { TextInputDialogComponent } = await import("./text-input-dialog-BLM32jyJ.mjs");
|
|
129497
129522
|
const turnInput = await promptNumber(host, TextInputDialogComponent, {
|
|
129498
129523
|
title: t("goal.wizard_title", { objective }),
|
|
129499
129524
|
subtitle: t("goal.budget_turns_hint"),
|
|
@@ -130681,25 +130706,43 @@ var SpeedTracker = class {
|
|
|
130681
130706
|
while (this.observations.length > 0 && this.observations[0].time < threshold) this.observations.shift();
|
|
130682
130707
|
}
|
|
130683
130708
|
/**
|
|
130684
|
-
* Record one
|
|
130685
|
-
*
|
|
130686
|
-
*
|
|
130709
|
+
* Record one delta: the estimated tokens it carried and the elapsed ms since
|
|
130710
|
+
* the previous delta. Non-finite/negative values are ignored. The windowed
|
|
130711
|
+
* figure in {@link getSpeed} is `Σtokens / Σelapsed` (the standard
|
|
130712
|
+
* "generation speed"), which is robust to bursty arrivals and needs no
|
|
130713
|
+
* clamping.
|
|
130687
130714
|
*/
|
|
130688
|
-
observe(
|
|
130689
|
-
if (!Number.isFinite(
|
|
130715
|
+
observe(tokens, elapsedMs, now = performance.now()) {
|
|
130716
|
+
if (!Number.isFinite(tokens) || tokens < 0) return;
|
|
130717
|
+
if (!Number.isFinite(elapsedMs) || elapsedMs <= 0) return;
|
|
130718
|
+
if (elapsedMs > 3e3) return;
|
|
130690
130719
|
this.observations.push({
|
|
130691
130720
|
time: now,
|
|
130692
|
-
|
|
130721
|
+
tokens,
|
|
130722
|
+
elapsedMs
|
|
130693
130723
|
});
|
|
130694
130724
|
this.prune(now);
|
|
130695
130725
|
}
|
|
130696
|
-
/**
|
|
130726
|
+
/**
|
|
130727
|
+
* Windowed generation speed = Σtokens / Σseconds over the 3s rolling
|
|
130728
|
+
* window. This is the "pure generation speed" measure: a single delta's
|
|
130729
|
+
* sudden burst of tokens is counted honestly (it genuinely arrived in that
|
|
130730
|
+
* window), while a near-zero-interval artifact no longer produces an
|
|
130731
|
+
* implausible instantaneous figure. Observations whose gap exceeds the
|
|
130732
|
+
* window (network/load stalls) are dropped so they don't read as a false
|
|
130733
|
+
* slow-down. 0 once the window empties.
|
|
130734
|
+
*/
|
|
130697
130735
|
getSpeed(now = performance.now()) {
|
|
130698
130736
|
this.prune(now);
|
|
130699
130737
|
if (this.observations.length === 0) return 0;
|
|
130700
|
-
let
|
|
130701
|
-
|
|
130702
|
-
|
|
130738
|
+
let totalTokens = 0;
|
|
130739
|
+
let totalElapsedMs = 0;
|
|
130740
|
+
for (const o of this.observations) {
|
|
130741
|
+
totalTokens += o.tokens;
|
|
130742
|
+
totalElapsedMs += o.elapsedMs;
|
|
130743
|
+
}
|
|
130744
|
+
if (totalElapsedMs <= 0) return 0;
|
|
130745
|
+
return totalTokens / totalElapsedMs * 1e3;
|
|
130703
130746
|
}
|
|
130704
130747
|
reset() {
|
|
130705
130748
|
this.observations = [];
|
|
@@ -130721,7 +130764,7 @@ function getSharedSpeedTracker() {
|
|
|
130721
130764
|
* from a dim gray toward the theme accent as tok/s rises.
|
|
130722
130765
|
*/
|
|
130723
130766
|
function lerpHex(from, to, t) {
|
|
130724
|
-
const k = t < 0 ? 0 :
|
|
130767
|
+
const k = t < 0 ? 0 : Math.min(1, t);
|
|
130725
130768
|
const fr = Number.parseInt(from.slice(1, 3), 16);
|
|
130726
130769
|
const fg = Number.parseInt(from.slice(3, 5), 16);
|
|
130727
130770
|
const fb = Number.parseInt(from.slice(5, 7), 16);
|
|
@@ -130748,7 +130791,7 @@ function estimateTokens(delta) {
|
|
|
130748
130791
|
* makes the color jump toward accent as soon as any tokens flow.
|
|
130749
130792
|
*/
|
|
130750
130793
|
function easeSpeedRatio(ratio) {
|
|
130751
|
-
const t = ratio < 0 ? 0 :
|
|
130794
|
+
const t = ratio < 0 ? 0 : Math.min(1, ratio);
|
|
130752
130795
|
return t * t * (3 - 2 * t);
|
|
130753
130796
|
}
|
|
130754
130797
|
//#endregion
|
|
@@ -130822,7 +130865,7 @@ var ThinkingComponent = class {
|
|
|
130822
130865
|
if (this.mode === "live") {
|
|
130823
130866
|
const visibleLines = contentLines.length > 2 ? contentLines.slice(contentLines.length - 2) : contentLines;
|
|
130824
130867
|
const spinner = chalk.hex(this.color)(`${BRAILLE_SPINNER_FRAMES[this.spinnerFrame] ?? BRAILLE_SPINNER_FRAMES[0]} `);
|
|
130825
|
-
const rate =
|
|
130868
|
+
const rate = getSharedSpeedTracker().getSpeed();
|
|
130826
130869
|
const rateSuffix = rate > .05 ? chalk.hex(lerpHex(this.dimColor, this.accentColor, easeSpeedRatio(rate / 200)))(` · ${rate.toFixed(1)} toks/s`) : "";
|
|
130827
130870
|
return [
|
|
130828
130871
|
"",
|
|
@@ -131579,16 +131622,16 @@ const renderTruncated = (_toolCall, result, ctx) => {
|
|
|
131579
131622
|
var ShellExecutionComponent = class extends Container {
|
|
131580
131623
|
constructor(options) {
|
|
131581
131624
|
super();
|
|
131582
|
-
if (options.showCommand === true) this.addCommandPreview(options.command ?? "", options.commandPreviewLines
|
|
131583
|
-
if (options.result !== void 0) this.addResultPreview(options.result, options.colors, options.expanded ?? false, options.resultPreviewLines ??
|
|
131625
|
+
if (options.showCommand === true) this.addCommandPreview(options.command ?? "", options.commandPreviewLines);
|
|
131626
|
+
if (options.result !== void 0) this.addResultPreview(options.result, options.colors, options.expanded ?? false, options.resultPreviewLines ?? 10);
|
|
131584
131627
|
}
|
|
131585
|
-
addCommandPreview(command, previewLines
|
|
131628
|
+
addCommandPreview(command, previewLines) {
|
|
131586
131629
|
if (command.length === 0) return;
|
|
131587
|
-
const allLines =
|
|
131630
|
+
const allLines = command.split("\n");
|
|
131588
131631
|
const lines = previewLines === void 0 ? allLines : allLines.slice(0, previewLines);
|
|
131589
131632
|
for (const [i, line] of lines.entries()) {
|
|
131590
131633
|
const prefix = i === 0 ? "$ " : " ";
|
|
131591
|
-
this.addChild(new Text(
|
|
131634
|
+
this.addChild(new Text(chalk.dim(prefix + line), 2, 0));
|
|
131592
131635
|
}
|
|
131593
131636
|
}
|
|
131594
131637
|
addResultPreview(result, colors, expanded, previewLines) {
|
|
@@ -131609,8 +131652,8 @@ const shellExecutionResultRenderer = (toolCall, result, ctx) => [new ShellExecut
|
|
|
131609
131652
|
result,
|
|
131610
131653
|
colors: ctx.colors,
|
|
131611
131654
|
expanded: ctx.expanded,
|
|
131612
|
-
showCommand:
|
|
131613
|
-
commandPreviewLines:
|
|
131655
|
+
showCommand: ctx.expanded,
|
|
131656
|
+
commandPreviewLines: void 0
|
|
131614
131657
|
})];
|
|
131615
131658
|
//#endregion
|
|
131616
131659
|
//#region src/tui/components/media/image-thumbnail.ts
|
package/dist/main.mjs
CHANGED
|
@@ -6,7 +6,7 @@ const __dirname = __cjsShimDirname(__filename);
|
|
|
6
6
|
import "./suppress-sqlite-warning-C2VB0doZ.mjs";
|
|
7
7
|
//#region src/main.ts
|
|
8
8
|
try {
|
|
9
|
-
(await import("./app-
|
|
9
|
+
(await import("./app-BFd_pXnN.mjs")).main();
|
|
10
10
|
} catch (error) {
|
|
11
11
|
process.stderr.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}\n`);
|
|
12
12
|
process.exit(1);
|
|
@@ -3,5 +3,5 @@ import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
|
3
3
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
4
4
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = __cjsShimDirname(__filename);
|
|
6
|
-
import { t as TextInputDialogComponent } from "./text-input-dialog-
|
|
6
|
+
import { t as TextInputDialogComponent } from "./text-input-dialog-Ciit7nAM.mjs";
|
|
7
7
|
export { TextInputDialogComponent };
|
|
@@ -417,14 +417,17 @@ const dictionaries = {
|
|
|
417
417
|
"auth.no_providers": "没有已配置的模型商。",
|
|
418
418
|
"auth.deleted": "已删除模型商: {name}",
|
|
419
419
|
"auth.input_api_url": "输入服务商 API 地址",
|
|
420
|
-
"auth.api_url_hint": "例如 https://api.
|
|
420
|
+
"auth.api_url_hint": "例如 https://api.example.com(可粘贴)",
|
|
421
421
|
"auth.input_api_key": "输入 API Key",
|
|
422
422
|
"auth.api_key_hint": "密钥保存到 ~/.scream/config.toml(可粘贴,Esc 取消)",
|
|
423
423
|
"auth.input_model": "输入模型型号",
|
|
424
|
-
"auth.model_hint": "例如
|
|
424
|
+
"auth.model_hint": "例如 my-model-v2",
|
|
425
425
|
"auth.input_context": "输入模型最大上下文长度 (tokens)",
|
|
426
|
-
"auth.context_hint": "默认 131072
|
|
426
|
+
"auth.context_hint": "默认 131072,请查阅你的服务商获取准确限制",
|
|
427
427
|
"auth.connected": "已连接: {name}",
|
|
428
|
+
"auth.error_empty_base_url": "API 地址不能为空。",
|
|
429
|
+
"auth.error_empty_model_id": "模型名称不能为空。",
|
|
430
|
+
"auth.error_invalid_context_size": "上下文长度必须是 >= 4096 的数字。",
|
|
428
431
|
"like.priority": "用户通过 /like 设置的偏好具有最高优先级,每次回复都必须遵守。",
|
|
429
432
|
"like.nickname": "设置昵称",
|
|
430
433
|
"like.nickname_hint": "你希望我怎么称呼你?留空表示不设置。",
|
|
@@ -1006,13 +1009,17 @@ const dictionaries = {
|
|
|
1006
1009
|
"prompts.no_wire_provider": "目录中没有支持该 wire 类型的提供商。",
|
|
1007
1010
|
"prompts.select_provider": "选择提供商",
|
|
1008
1011
|
"prompts.wire_openai": "OpenAI 兼容协议",
|
|
1009
|
-
"prompts.wire_openai_desc": "
|
|
1012
|
+
"prompts.wire_openai_desc": "Chat Completions API 兼容的服务商",
|
|
1013
|
+
"prompts.wire_openai_responses": "Responses API 协议",
|
|
1014
|
+
"prompts.wire_openai_responses_desc": "OpenAI Responses API(推理模型)",
|
|
1010
1015
|
"prompts.wire_anthropic": "Anthropic 协议",
|
|
1011
|
-
"prompts.wire_anthropic_desc": "
|
|
1016
|
+
"prompts.wire_anthropic_desc": "Messages API 兼容的服务商",
|
|
1012
1017
|
"prompts.thinking_off": "关闭思考",
|
|
1013
1018
|
"prompts.thinking_low": "低强度思考",
|
|
1014
1019
|
"prompts.thinking_medium": "中强度思考",
|
|
1015
1020
|
"prompts.thinking_high": "高强度思考",
|
|
1021
|
+
"prompts.thinking_xhigh": "超高强度思考",
|
|
1022
|
+
"prompts.thinking_max": "最大强度思考",
|
|
1016
1023
|
"prompts.image_off": "关闭识图",
|
|
1017
1024
|
"prompts.image_off_desc": "模型不支持图片输入时请选择此项",
|
|
1018
1025
|
"prompts.image_on": "开启识图",
|
|
@@ -1508,14 +1515,17 @@ const dictionaries = {
|
|
|
1508
1515
|
"auth.no_providers": "No model providers configured.",
|
|
1509
1516
|
"auth.deleted": "Deleted provider: {name}",
|
|
1510
1517
|
"auth.input_api_url": "Enter provider API URL",
|
|
1511
|
-
"auth.api_url_hint": "e.g. https://api.
|
|
1518
|
+
"auth.api_url_hint": "e.g. https://api.example.com (paste supported)",
|
|
1512
1519
|
"auth.input_api_key": "Enter API Key",
|
|
1513
1520
|
"auth.api_key_hint": "Key saved to ~/.scream/config.toml (paste supported, Esc to cancel)",
|
|
1514
1521
|
"auth.input_model": "Enter model name",
|
|
1515
|
-
"auth.model_hint": "e.g.
|
|
1522
|
+
"auth.model_hint": "e.g. my-model-v2",
|
|
1516
1523
|
"auth.input_context": "Enter max context length (tokens)",
|
|
1517
|
-
"auth.context_hint": "Default 131072
|
|
1524
|
+
"auth.context_hint": "Default 131072; check your provider for the exact limit",
|
|
1518
1525
|
"auth.connected": "Connected: {name}",
|
|
1526
|
+
"auth.error_empty_base_url": "Base URL cannot be empty.",
|
|
1527
|
+
"auth.error_empty_model_id": "Model name cannot be empty.",
|
|
1528
|
+
"auth.error_invalid_context_size": "Context size must be a number >= 4096.",
|
|
1519
1529
|
"like.priority": "User preferences set via /like have the highest priority and must be followed in every response.",
|
|
1520
1530
|
"like.nickname": "Set nickname",
|
|
1521
1531
|
"like.nickname_hint": "What should I call you? Leave empty to skip.",
|
|
@@ -2097,13 +2107,17 @@ const dictionaries = {
|
|
|
2097
2107
|
"prompts.no_wire_provider": "No providers supporting this wire type in the catalog.",
|
|
2098
2108
|
"prompts.select_provider": "Select provider",
|
|
2099
2109
|
"prompts.wire_openai": "OpenAI compatible protocol",
|
|
2100
|
-
"prompts.wire_openai_desc": "
|
|
2110
|
+
"prompts.wire_openai_desc": "Chat Completions API compatible providers",
|
|
2111
|
+
"prompts.wire_openai_responses": "Responses API protocol",
|
|
2112
|
+
"prompts.wire_openai_responses_desc": "OpenAI Responses API (reasoning models)",
|
|
2101
2113
|
"prompts.wire_anthropic": "Anthropic protocol",
|
|
2102
|
-
"prompts.wire_anthropic_desc": "
|
|
2114
|
+
"prompts.wire_anthropic_desc": "Messages API compatible providers",
|
|
2103
2115
|
"prompts.thinking_off": "Thinking off",
|
|
2104
2116
|
"prompts.thinking_low": "Low thinking",
|
|
2105
2117
|
"prompts.thinking_medium": "Medium thinking",
|
|
2106
2118
|
"prompts.thinking_high": "High thinking",
|
|
2119
|
+
"prompts.thinking_xhigh": "Extra-high thinking",
|
|
2120
|
+
"prompts.thinking_max": "Max thinking",
|
|
2107
2121
|
"prompts.image_off": "Image off",
|
|
2108
2122
|
"prompts.image_off_desc": "Select this when the model does not support image input",
|
|
2109
2123
|
"prompts.image_on": "Image on",
|