scream-code 0.14.1 → 0.14.2
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-DfvDxCXT.mjs} +5 -8
- package/dist/{dispatch-D71h_08g.mjs → dispatch-CUAgZqJU.mjs} +1 -1
- package/dist/{dispatch-202xtik3.mjs → dispatch-zO63olZl.mjs} +100 -52
- 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-zO63olZl.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.2"),
|
|
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-CUAgZqJU.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-zO63olZl.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,32 @@ 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;
|
|
125010
|
-
|
|
125027
|
+
if (!baseUrl.trim()) {
|
|
125028
|
+
host.showError(t("auth.error_empty_base_url"));
|
|
125029
|
+
return;
|
|
125030
|
+
}
|
|
125031
|
+
const apiKey = await promptTextInput$2(host, t("auth.input_api_key"), {
|
|
125032
|
+
subtitle: t("auth.api_key_hint"),
|
|
125033
|
+
masked: true
|
|
125034
|
+
});
|
|
125011
125035
|
if (apiKey === void 0) return;
|
|
125012
125036
|
const modelId = await promptTextInput$2(host, t("auth.input_model"), { subtitle: t("auth.model_hint") });
|
|
125013
125037
|
if (modelId === void 0) return;
|
|
125038
|
+
if (!modelId.trim()) {
|
|
125039
|
+
host.showError(t("auth.error_empty_model_id"));
|
|
125040
|
+
return;
|
|
125041
|
+
}
|
|
125014
125042
|
const maxContextStr = await promptTextInput$2(host, t("auth.input_context"), {
|
|
125015
125043
|
subtitle: t("auth.context_hint"),
|
|
125016
125044
|
placeholder: "131072"
|
|
125017
125045
|
});
|
|
125018
125046
|
if (maxContextStr === void 0) return;
|
|
125019
|
-
const
|
|
125047
|
+
const parsed = parseInt(maxContextStr, 10);
|
|
125048
|
+
if (Number.isNaN(parsed) || parsed < 4096) {
|
|
125049
|
+
host.showError(t("auth.error_invalid_context_size"));
|
|
125050
|
+
return;
|
|
125051
|
+
}
|
|
125052
|
+
const maxContextTokens = parsed;
|
|
125020
125053
|
const thinkingLevel = await promptThinkingMode(host);
|
|
125021
125054
|
if (thinkingLevel === void 0) return;
|
|
125022
125055
|
const imageEnabled = await promptImageMode(host);
|
|
@@ -125041,28 +125074,22 @@ async function handleDiyConfig(host) {
|
|
|
125041
125074
|
maxOutputSize: wire === "anthropic" ? 32e3 : void 0
|
|
125042
125075
|
};
|
|
125043
125076
|
if ((await host.harness.getConfig()).providers[providerId] !== void 0) await host.harness.removeProvider(providerId);
|
|
125044
|
-
const
|
|
125045
|
-
|
|
125046
|
-
|
|
125077
|
+
const freshConfig = await host.harness.getConfig();
|
|
125078
|
+
applyCatalogProvider(freshConfig, {
|
|
125079
|
+
providerId,
|
|
125080
|
+
wire,
|
|
125047
125081
|
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
|
-
};
|
|
125082
|
+
apiKey,
|
|
125083
|
+
models: [catalogModel],
|
|
125084
|
+
selectedModelId: modelId,
|
|
125085
|
+
thinkingLevel
|
|
125086
|
+
});
|
|
125060
125087
|
await host.harness.setConfig({
|
|
125061
|
-
providers:
|
|
125062
|
-
models:
|
|
125063
|
-
defaultModel:
|
|
125064
|
-
defaultThinking:
|
|
125065
|
-
thinking:
|
|
125088
|
+
providers: freshConfig.providers,
|
|
125089
|
+
models: freshConfig.models,
|
|
125090
|
+
defaultModel: freshConfig.defaultModel,
|
|
125091
|
+
defaultThinking: freshConfig.defaultThinking,
|
|
125092
|
+
thinking: freshConfig.thinking
|
|
125066
125093
|
});
|
|
125067
125094
|
await host.authFlow.refreshConfigAfterLogin();
|
|
125068
125095
|
host.showStatus(t("auth.connected", { name: `${providerId} · ${modelId} (${wire})` }));
|
|
@@ -128547,6 +128574,7 @@ function getModelCycleLevel(models, alias, current) {
|
|
|
128547
128574
|
"low",
|
|
128548
128575
|
"medium",
|
|
128549
128576
|
"high",
|
|
128577
|
+
"xhigh",
|
|
128550
128578
|
"max"
|
|
128551
128579
|
];
|
|
128552
128580
|
const idx = levels.indexOf(current);
|
|
@@ -129472,7 +129500,7 @@ async function guidedGoalSetup(host) {
|
|
|
129472
129500
|
host.showNotice(t("goal.storm_breaker"), t("goal.conflict_loop"));
|
|
129473
129501
|
return;
|
|
129474
129502
|
}
|
|
129475
|
-
const { TextInputDialogComponent } = await import("./text-input-dialog-
|
|
129503
|
+
const { TextInputDialogComponent } = await import("./text-input-dialog-BLM32jyJ.mjs");
|
|
129476
129504
|
const initialDesc = await promptText(host, TextInputDialogComponent, {
|
|
129477
129505
|
title: t("goal.setup_title_initial"),
|
|
129478
129506
|
subtitle: t("goal.setup_desc_hint"),
|
|
@@ -129493,7 +129521,7 @@ async function guidedGoalSetup(host) {
|
|
|
129493
129521
|
await showGoalConfigWizard(host, session, confirmed.trim() || objective, false);
|
|
129494
129522
|
}
|
|
129495
129523
|
async function showGoalConfigWizard(host, session, objective, replace) {
|
|
129496
|
-
const { TextInputDialogComponent } = await import("./text-input-dialog-
|
|
129524
|
+
const { TextInputDialogComponent } = await import("./text-input-dialog-BLM32jyJ.mjs");
|
|
129497
129525
|
const turnInput = await promptNumber(host, TextInputDialogComponent, {
|
|
129498
129526
|
title: t("goal.wizard_title", { objective }),
|
|
129499
129527
|
subtitle: t("goal.budget_turns_hint"),
|
|
@@ -130681,25 +130709,43 @@ var SpeedTracker = class {
|
|
|
130681
130709
|
while (this.observations.length > 0 && this.observations[0].time < threshold) this.observations.shift();
|
|
130682
130710
|
}
|
|
130683
130711
|
/**
|
|
130684
|
-
* Record one
|
|
130685
|
-
*
|
|
130686
|
-
*
|
|
130712
|
+
* Record one delta: the estimated tokens it carried and the elapsed ms since
|
|
130713
|
+
* the previous delta. Non-finite/negative values are ignored. The windowed
|
|
130714
|
+
* figure in {@link getSpeed} is `Σtokens / Σelapsed` (the standard
|
|
130715
|
+
* "generation speed"), which is robust to bursty arrivals and needs no
|
|
130716
|
+
* clamping.
|
|
130687
130717
|
*/
|
|
130688
|
-
observe(
|
|
130689
|
-
if (!Number.isFinite(
|
|
130718
|
+
observe(tokens, elapsedMs, now = performance.now()) {
|
|
130719
|
+
if (!Number.isFinite(tokens) || tokens < 0) return;
|
|
130720
|
+
if (!Number.isFinite(elapsedMs) || elapsedMs <= 0) return;
|
|
130721
|
+
if (elapsedMs > 3e3) return;
|
|
130690
130722
|
this.observations.push({
|
|
130691
130723
|
time: now,
|
|
130692
|
-
|
|
130724
|
+
tokens,
|
|
130725
|
+
elapsedMs
|
|
130693
130726
|
});
|
|
130694
130727
|
this.prune(now);
|
|
130695
130728
|
}
|
|
130696
|
-
/**
|
|
130729
|
+
/**
|
|
130730
|
+
* Windowed generation speed = Σtokens / Σseconds over the 3s rolling
|
|
130731
|
+
* window. This is the "pure generation speed" measure: a single delta's
|
|
130732
|
+
* sudden burst of tokens is counted honestly (it genuinely arrived in that
|
|
130733
|
+
* window), while a near-zero-interval artifact no longer produces an
|
|
130734
|
+
* implausible instantaneous figure. Observations whose gap exceeds the
|
|
130735
|
+
* window (network/load stalls) are dropped so they don't read as a false
|
|
130736
|
+
* slow-down. 0 once the window empties.
|
|
130737
|
+
*/
|
|
130697
130738
|
getSpeed(now = performance.now()) {
|
|
130698
130739
|
this.prune(now);
|
|
130699
130740
|
if (this.observations.length === 0) return 0;
|
|
130700
|
-
let
|
|
130701
|
-
|
|
130702
|
-
|
|
130741
|
+
let totalTokens = 0;
|
|
130742
|
+
let totalElapsedMs = 0;
|
|
130743
|
+
for (const o of this.observations) {
|
|
130744
|
+
totalTokens += o.tokens;
|
|
130745
|
+
totalElapsedMs += o.elapsedMs;
|
|
130746
|
+
}
|
|
130747
|
+
if (totalElapsedMs <= 0) return 0;
|
|
130748
|
+
return totalTokens / totalElapsedMs * 1e3;
|
|
130703
130749
|
}
|
|
130704
130750
|
reset() {
|
|
130705
130751
|
this.observations = [];
|
|
@@ -130721,7 +130767,7 @@ function getSharedSpeedTracker() {
|
|
|
130721
130767
|
* from a dim gray toward the theme accent as tok/s rises.
|
|
130722
130768
|
*/
|
|
130723
130769
|
function lerpHex(from, to, t) {
|
|
130724
|
-
const k = t < 0 ? 0 :
|
|
130770
|
+
const k = t < 0 ? 0 : Math.min(1, t);
|
|
130725
130771
|
const fr = Number.parseInt(from.slice(1, 3), 16);
|
|
130726
130772
|
const fg = Number.parseInt(from.slice(3, 5), 16);
|
|
130727
130773
|
const fb = Number.parseInt(from.slice(5, 7), 16);
|
|
@@ -130748,7 +130794,7 @@ function estimateTokens(delta) {
|
|
|
130748
130794
|
* makes the color jump toward accent as soon as any tokens flow.
|
|
130749
130795
|
*/
|
|
130750
130796
|
function easeSpeedRatio(ratio) {
|
|
130751
|
-
const t = ratio < 0 ? 0 :
|
|
130797
|
+
const t = ratio < 0 ? 0 : Math.min(1, ratio);
|
|
130752
130798
|
return t * t * (3 - 2 * t);
|
|
130753
130799
|
}
|
|
130754
130800
|
//#endregion
|
|
@@ -130822,7 +130868,7 @@ var ThinkingComponent = class {
|
|
|
130822
130868
|
if (this.mode === "live") {
|
|
130823
130869
|
const visibleLines = contentLines.length > 2 ? contentLines.slice(contentLines.length - 2) : contentLines;
|
|
130824
130870
|
const spinner = chalk.hex(this.color)(`${BRAILLE_SPINNER_FRAMES[this.spinnerFrame] ?? BRAILLE_SPINNER_FRAMES[0]} `);
|
|
130825
|
-
const rate =
|
|
130871
|
+
const rate = getSharedSpeedTracker().getSpeed();
|
|
130826
130872
|
const rateSuffix = rate > .05 ? chalk.hex(lerpHex(this.dimColor, this.accentColor, easeSpeedRatio(rate / 200)))(` · ${rate.toFixed(1)} toks/s`) : "";
|
|
130827
130873
|
return [
|
|
130828
130874
|
"",
|
|
@@ -130919,7 +130965,7 @@ var CachedContainer = class extends Container {
|
|
|
130919
130965
|
//#region src/tui/theme/code-highlight-theme.ts
|
|
130920
130966
|
function createCodeHighlightTheme(colors) {
|
|
130921
130967
|
const keyword = chalk.hex(colors.mdCodeBlock);
|
|
130922
|
-
const str = chalk.hex(colors.
|
|
130968
|
+
const str = chalk.hex(colors.mdLink);
|
|
130923
130969
|
const num = chalk.hex(colors.primary);
|
|
130924
130970
|
const fn = chalk.hex(colors.warning);
|
|
130925
130971
|
const builtin = chalk.hex(colors.planMode);
|
|
@@ -131561,7 +131607,7 @@ var TruncatedOutputComponent = class {
|
|
|
131561
131607
|
return [chalk.dim(collapseHint), ...contentLines];
|
|
131562
131608
|
}
|
|
131563
131609
|
const remaining = contentLines.length - this.maxLines;
|
|
131564
|
-
const tail = contentLines.slice(-this.maxLines);
|
|
131610
|
+
const tail = this.maxLines <= 0 ? [] : contentLines.slice(-this.maxLines);
|
|
131565
131611
|
const expandHint = this.hintFormatter ? this.hintFormatter(remaining) : t("shell.more_lines", { count: String(remaining) });
|
|
131566
131612
|
return [chalk.dim(expandHint), ...tail];
|
|
131567
131613
|
}
|
|
@@ -131610,7 +131656,8 @@ const shellExecutionResultRenderer = (toolCall, result, ctx) => [new ShellExecut
|
|
|
131610
131656
|
colors: ctx.colors,
|
|
131611
131657
|
expanded: ctx.expanded,
|
|
131612
131658
|
showCommand: true,
|
|
131613
|
-
commandPreviewLines: ctx.expanded ? void 0 : 3
|
|
131659
|
+
commandPreviewLines: ctx.expanded ? void 0 : 3,
|
|
131660
|
+
resultPreviewLines: ctx.expanded ? void 0 : result.is_error ? void 0 : ctx.isLive ? void 0 : 0
|
|
131614
131661
|
})];
|
|
131615
131662
|
//#endregion
|
|
131616
131663
|
//#region src/tui/components/media/image-thumbnail.ts
|
|
@@ -133079,7 +133126,8 @@ var ToolCallComponent = class ToolCallComponent extends CachedContainer {
|
|
|
133079
133126
|
is_error: false
|
|
133080
133127
|
}, {
|
|
133081
133128
|
expanded: this.expanded,
|
|
133082
|
-
colors: this.colors
|
|
133129
|
+
colors: this.colors,
|
|
133130
|
+
isLive: true
|
|
133083
133131
|
});
|
|
133084
133132
|
for (const component of components) this.addChild(component);
|
|
133085
133133
|
}
|
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-DfvDxCXT.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",
|