scream-code 0.18.5 → 0.18.6
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-DTuYJJwB.mjs → app-Ca2pwAk7.mjs} +37 -13
- package/dist/{dispatch-fJ2MwyhX.mjs → dispatch-0mihbsV3.mjs} +1 -1
- package/dist/{dispatch-BFsePVX6.mjs → dispatch-BgO7wAf9.mjs} +786 -272
- package/dist/main.mjs +1 -1
- package/dist/{text-input-dialog-CxdRYbA4.mjs → text-input-dialog-BvbqjvzB.mjs} +2 -0
- package/dist/{text-input-dialog-BcAJghtL.mjs → text-input-dialog-DWepgNF4.mjs} +1 -1
- package/package.json +1 -1
|
@@ -5,8 +5,8 @@ const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
|
5
5
|
const __dirname = __cjsShimDirname(__filename);
|
|
6
6
|
import "./suppress-sqlite-warning-C2VB0doZ.mjs";
|
|
7
7
|
import { A as sharedMemoStore } from "./src-C7C9e5Ds.mjs";
|
|
8
|
-
import { $ as refineGoal, $n as ScreamHarness, $t as FooterComponent, A as renderDiffLinesClustered, An as setExperimentalFlags, At as isEmptySessionHintDismissed, B as AssistantMessageComponent, Bn as saveTuiConfig, Bt as ENABLE_TERMINAL_FOCUS_REPORTING, C as readJsonlFile, Cn as getCtrlDHint, Ct as supportsBalance, D as UserMessageComponent, Dn as BUILTIN_SLASH_COMMANDS, Dt as resolveThemeSync, En as buildSkillSlashCommands, F as NoticeMessageComponent, Fn as PIXEL_PULSE_FRAMES, Ft as getColorPalette, G as BackgroundAgentStatusComponent, Gn as detectInstallSource, Gt as OSC11_RESPONSE_PREFIX_NO_ESC, H as charsForTokenBudget, Hn as getDataDir, Ht as OSC11_QUERY, I as StatusMessageComponent, In as PULSE_WAVE_FRAMES, It as detectTerminalTheme, J as BREATHE_CYCLE_MS, Jn as CLI_USER_AGENT_PRODUCT, Jt as TERMINAL_FOCUS_OUT, K as AgentGroupComponent, Kn as CLI_COMMAND_NAME, Kt as QUERY_TERMINAL_THEME, L as replaceTabs, Ln as TuiConfigParseError, Lt as parseOsc11BackgroundTheme, M as langFromPath, Mn as getKnowledgeStore, Mt as toggleEmptySessionHint, N as CachedContainer, Nn as hasEmbeddingModelCache, Nt as createThemeStyles, O as ToolCallComponent, On as sortSlashCommands, Ot as createEditorTheme, P as ThinkingComponent, Pn as startManualEmbeddingDownload, Pt as contrastTextHex, Q as clearGoalState, Qn as saveCatalogCache, Qt as isStreaming, R as sanitizeShellOutput, Rn as TuiLikePreferencesSchema, Rt as DISABLE_TERMINAL_FOCUS_REPORTING, S as appendJsonlLine, Sn as getCtrlCHint, St as refreshProviderBalance, T as getDaemonInstructions, Tn as getNoActiveSessionMessage, U as estimateTokens, Un as getInputHistoryFile, Ut as OSC11_RESPONSE, V as ActivityGroupComponent, Vn as detectShellEnvironment, Vt as ENABLE_TERMINAL_THEME_REPORTING, W as getSharedSpeedTracker, Wn as getLogDir, Wt as OSC11_RESPONSE_PREFIX, X as resetBreathingClock, Xn as DEFAULT_CATALOG_URL, Xt as TERMINAL_THEME_LIGHT, Y as getBreathingFrame, Yn as PRODUCT_NAME, Yt as TERMINAL_THEME_DARK, Z as CompactionComponent, Zn as fetchCatalog, Zt as isBusy, _n as EMPTY_SESSION_HINT_URL, a as buildRoleAdditionalText, at as isInternalMessage, b as refreshUpdateCache, bn as SESSION_TIPS, cn as appendSessionHeaderHint, cr as resolveScreamHome, ct as getModelCycleLevel, d as isExpandable, dn as formatErrorMessage, dr as resolveGlobalLogPath, en as lerpGradient, er as encodeWorkDirKey, f as isPlanExpandable, fn as isTodoItemShape, fr as isScreamError, gn as truncateErrorMessage, hn as stringValue, hr as SCREAM_ERROR_INFO, ht as handlePlanCommand, i as openUrl, ir as removeSessionIndexEntry, j as highlightLines, jn as embeddingFailureDetail, jt as isTurnElapsedEnabled, k as renderDiffLines, kn as isExperimentalFlagEnabled, kt as createMarkdownTheme, l as disposeChildren, ln as appendStreamingArgsPreview, lr as flushDiagnosticLogs, m as formatMemoryMemoForInjection, mn as serializeToolResultOutput, mr as ErrorCodes, n as clearEvalPanelState, nr as appendSessionIndexEntry, o as syncDiagramCapabilityPrompt, on as printableChar, or as isRealUserPrompt, ot as toTerminalHyperlink, p as MoonLoader, pn as parseStreamingArgs, pr as isOrphanedToolCallError, pt as handleFusionPlanCommand, q as WelcomeComponent, qn as CLI_UI_MODE, qt as TERMINAL_FOCUS_IN, rr as readSessionIndex, sn as STATUS_BULLET, sr as parseRlmMaxDepthArg, st as changeThinkingLevel, t as dispatchInput, tn as SubagentSlots, tr as normalizeWorkDir, u as hasDispose, un as argsRecord, ur as log, vn as EXIT_CONFIRM_WINDOW_MS, wn as getLlmNotSetMessage, wt as clearInfoPanelState, x as readUpdateCache, xn as TIP_ROTATION_INTERVAL_MS, y as selectUpdateTarget, yn as MAIN_AGENT_ID, z as SkillActivationComponent, zn as loadTuiConfig, zt as DISABLE_TERMINAL_THEME_REPORTING } from "./dispatch-
|
|
9
|
-
import { i as t, n as getLocale, r as setLocale } from "./text-input-dialog-
|
|
8
|
+
import { $ as refineGoal, $n as ScreamHarness, $t as FooterComponent, A as renderDiffLinesClustered, An as setExperimentalFlags, At as isEmptySessionHintDismissed, B as AssistantMessageComponent, Bn as saveTuiConfig, Bt as ENABLE_TERMINAL_FOCUS_REPORTING, C as readJsonlFile, Cn as getCtrlDHint, Ct as supportsBalance, D as UserMessageComponent, Dn as BUILTIN_SLASH_COMMANDS, Dt as resolveThemeSync, En as buildSkillSlashCommands, F as NoticeMessageComponent, Fn as PIXEL_PULSE_FRAMES, Ft as getColorPalette, G as BackgroundAgentStatusComponent, Gn as detectInstallSource, Gt as OSC11_RESPONSE_PREFIX_NO_ESC, H as charsForTokenBudget, Hn as getDataDir, Ht as OSC11_QUERY, I as StatusMessageComponent, In as PULSE_WAVE_FRAMES, It as detectTerminalTheme, J as BREATHE_CYCLE_MS, Jn as CLI_USER_AGENT_PRODUCT, Jt as TERMINAL_FOCUS_OUT, K as AgentGroupComponent, Kn as CLI_COMMAND_NAME, Kt as QUERY_TERMINAL_THEME, L as replaceTabs, Ln as TuiConfigParseError, Lt as parseOsc11BackgroundTheme, M as langFromPath, Mn as getKnowledgeStore, Mt as toggleEmptySessionHint, N as CachedContainer, Nn as hasEmbeddingModelCache, Nt as createThemeStyles, O as ToolCallComponent, On as sortSlashCommands, Ot as createEditorTheme, P as ThinkingComponent, Pn as startManualEmbeddingDownload, Pt as contrastTextHex, Q as clearGoalState, Qn as saveCatalogCache, Qt as isStreaming, R as sanitizeShellOutput, Rn as TuiLikePreferencesSchema, Rt as DISABLE_TERMINAL_FOCUS_REPORTING, S as appendJsonlLine, Sn as getCtrlCHint, St as refreshProviderBalance, T as getDaemonInstructions, Tn as getNoActiveSessionMessage, U as estimateTokens, Un as getInputHistoryFile, Ut as OSC11_RESPONSE, V as ActivityGroupComponent, Vn as detectShellEnvironment, Vt as ENABLE_TERMINAL_THEME_REPORTING, W as getSharedSpeedTracker, Wn as getLogDir, Wt as OSC11_RESPONSE_PREFIX, X as resetBreathingClock, Xn as DEFAULT_CATALOG_URL, Xt as TERMINAL_THEME_LIGHT, Y as getBreathingFrame, Yn as PRODUCT_NAME, Yt as TERMINAL_THEME_DARK, Z as CompactionComponent, Zn as fetchCatalog, Zt as isBusy, _n as EMPTY_SESSION_HINT_URL, a as buildRoleAdditionalText, at as isInternalMessage, b as refreshUpdateCache, bn as SESSION_TIPS, cn as appendSessionHeaderHint, cr as resolveScreamHome, ct as getModelCycleLevel, d as isExpandable, dn as formatErrorMessage, dr as resolveGlobalLogPath, en as lerpGradient, er as encodeWorkDirKey, f as isPlanExpandable, fn as isTodoItemShape, fr as isScreamError, gn as truncateErrorMessage, hn as stringValue, hr as SCREAM_ERROR_INFO, ht as handlePlanCommand, i as openUrl, ir as removeSessionIndexEntry, j as highlightLines, jn as embeddingFailureDetail, jt as isTurnElapsedEnabled, k as renderDiffLines, kn as isExperimentalFlagEnabled, kt as createMarkdownTheme, l as disposeChildren, ln as appendStreamingArgsPreview, lr as flushDiagnosticLogs, m as formatMemoryMemoForInjection, mn as serializeToolResultOutput, mr as ErrorCodes, n as clearEvalPanelState, nr as appendSessionIndexEntry, o as syncDiagramCapabilityPrompt, on as printableChar, or as isRealUserPrompt, ot as toTerminalHyperlink, p as MoonLoader, pn as parseStreamingArgs, pr as isOrphanedToolCallError, pt as handleFusionPlanCommand, q as WelcomeComponent, qn as CLI_UI_MODE, qt as TERMINAL_FOCUS_IN, rr as readSessionIndex, sn as STATUS_BULLET, sr as parseRlmMaxDepthArg, st as changeThinkingLevel, t as dispatchInput, tn as SubagentSlots, tr as normalizeWorkDir, u as hasDispose, un as argsRecord, ur as log, vn as EXIT_CONFIRM_WINDOW_MS, wn as getLlmNotSetMessage, wt as clearInfoPanelState, x as readUpdateCache, xn as TIP_ROTATION_INTERVAL_MS, y as selectUpdateTarget, yn as MAIN_AGENT_ID, z as SkillActivationComponent, zn as loadTuiConfig, zt as DISABLE_TERMINAL_THEME_REPORTING } from "./dispatch-BgO7wAf9.mjs";
|
|
9
|
+
import { i as t, n as getLocale, r as setLocale } from "./text-input-dialog-BvbqjvzB.mjs";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import { randomBytes, randomUUID, scryptSync, timingSafeEqual } from "node:crypto";
|
|
12
12
|
import { access, appendFile, chmod, mkdir, mkdtemp, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -33,7 +33,7 @@ function optionalBuildString(value) {
|
|
|
33
33
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
34
34
|
}
|
|
35
35
|
const SCREAM_BUILD_INFO = {
|
|
36
|
-
version: optionalBuildString("0.18.
|
|
36
|
+
version: optionalBuildString("0.18.6"),
|
|
37
37
|
channel: optionalBuildString(""),
|
|
38
38
|
commit: optionalBuildString(""),
|
|
39
39
|
buildTarget: optionalBuildString("darwin-arm64")
|
|
@@ -3450,6 +3450,7 @@ var SessionEventHandler = class {
|
|
|
3450
3450
|
this.host.setAppState({ streamingPhase: "waiting" });
|
|
3451
3451
|
}
|
|
3452
3452
|
handleTurnEnd(event, sendQueued) {
|
|
3453
|
+
if (event.stepBudgetExhausted === true) this.host.showStatus(t("handler.max_steps_reached"), this.host.state.theme.colors.warning);
|
|
3453
3454
|
this.host.setAppState({ reconnectAttempt: 0 });
|
|
3454
3455
|
const todos = this.host.state.todoPanel.getTodos();
|
|
3455
3456
|
if (todos.length > 0 && todos.every((todo) => todo.status === "done")) this.host.streamingUI.setTodoList([]);
|
|
@@ -3502,6 +3503,7 @@ var SessionEventHandler = class {
|
|
|
3502
3503
|
reconnectDelayMs: event.delayMs,
|
|
3503
3504
|
reconnectStatusCode: event.statusCode,
|
|
3504
3505
|
reconnectErrorName: event.errorName,
|
|
3506
|
+
reconnectErrorCode: event.errorCode,
|
|
3505
3507
|
sessionApiCalls: this.host.state.appState.sessionApiCalls + 1
|
|
3506
3508
|
});
|
|
3507
3509
|
}
|
|
@@ -3520,7 +3522,8 @@ var SessionEventHandler = class {
|
|
|
3520
3522
|
reconnectMaxAttempts: void 0,
|
|
3521
3523
|
reconnectDelayMs: void 0,
|
|
3522
3524
|
reconnectStatusCode: void 0,
|
|
3523
|
-
reconnectErrorName: void 0
|
|
3525
|
+
reconnectErrorName: void 0,
|
|
3526
|
+
reconnectErrorCode: void 0
|
|
3524
3527
|
});
|
|
3525
3528
|
}
|
|
3526
3529
|
maybeShowDebugTiming(event) {
|
|
@@ -3578,7 +3581,7 @@ var SessionEventHandler = class {
|
|
|
3578
3581
|
this.host.showStatus(t("handler.user_interrupted"), this.host.state.theme.colors.error);
|
|
3579
3582
|
return;
|
|
3580
3583
|
}
|
|
3581
|
-
this.host.showError(
|
|
3584
|
+
this.host.showError(t("handler.step_interrupted", { reason }));
|
|
3582
3585
|
}
|
|
3583
3586
|
handleThinkingDelta(event) {
|
|
3584
3587
|
const { state, streamingUI } = this.host;
|
|
@@ -3701,7 +3704,9 @@ var SessionEventHandler = class {
|
|
|
3701
3704
|
is_error: event.isError,
|
|
3702
3705
|
synthetic: event.synthetic,
|
|
3703
3706
|
display: event.display,
|
|
3704
|
-
message: event.message
|
|
3707
|
+
message: event.message,
|
|
3708
|
+
code: event.code,
|
|
3709
|
+
abort_reason: event.abortReason
|
|
3705
3710
|
};
|
|
3706
3711
|
if (isBackgroundedHandoffResult(resultData.output)) streamingUI.markSubagentBackgrounded({ toolCallId: event.toolCallId });
|
|
3707
3712
|
streamingUI.completeToolResult(event.toolCallId, resultData);
|
|
@@ -8875,6 +8880,21 @@ var PulseWaveLoader = class extends Text {
|
|
|
8875
8880
|
};
|
|
8876
8881
|
//#endregion
|
|
8877
8882
|
//#region src/tui/controllers/lifecycle-controller.ts
|
|
8883
|
+
/**
|
|
8884
|
+
* Reason label for the status-bar reconnect line.
|
|
8885
|
+
*
|
|
8886
|
+
* The structured `errorCode` carried by the retry event is authoritative. The
|
|
8887
|
+
* status-code and error-name checks are the fallback for retry records written
|
|
8888
|
+
* before that field existed — and for codes this label has no wording for.
|
|
8889
|
+
*/
|
|
8890
|
+
function reconnectReasonKey(a) {
|
|
8891
|
+
if (a.reconnectErrorCode === "provider.timeout") return "status.reason_timeout";
|
|
8892
|
+
if (a.reconnectErrorCode === "provider.rate_limit") return "status.reason_rate_limit";
|
|
8893
|
+
if (a.reconnectStatusCode === 429) return "status.reason_rate_limit";
|
|
8894
|
+
if (a.reconnectStatusCode !== void 0 && a.reconnectStatusCode >= 500) return "status.reason_server";
|
|
8895
|
+
if (a.reconnectErrorCode === void 0 && (a.reconnectErrorName ?? "").includes("Timeout")) return "status.reason_timeout";
|
|
8896
|
+
return "status.reason_connection";
|
|
8897
|
+
}
|
|
8878
8898
|
var LifecycleController = class LifecycleController {
|
|
8879
8899
|
host;
|
|
8880
8900
|
signalCleanupHandlers = [];
|
|
@@ -9342,7 +9362,7 @@ var LifecycleController = class LifecycleController {
|
|
|
9342
9362
|
buildReconnectLabel(state) {
|
|
9343
9363
|
const a = state.appState;
|
|
9344
9364
|
if (a.reconnectAttempt <= 0) return "";
|
|
9345
|
-
const reasonKey =
|
|
9365
|
+
const reasonKey = reconnectReasonKey(a);
|
|
9346
9366
|
const reason = a.reconnectStatusCode !== void 0 ? `${t(reasonKey)} (${String(a.reconnectStatusCode)})` : a.reconnectErrorName !== void 0 && a.reconnectErrorName.length > 0 ? `${t(reasonKey)} (${a.reconnectErrorName})` : t(reasonKey);
|
|
9347
9367
|
const delaySec = Math.max(1, Math.round((a.reconnectDelayMs ?? 0) / 1e3));
|
|
9348
9368
|
const label = t("status.reconnecting_detail", {
|
|
@@ -14653,6 +14673,7 @@ function createInitialAppState(input) {
|
|
|
14653
14673
|
streamingPhase: "idle",
|
|
14654
14674
|
streamingStartTime: 0,
|
|
14655
14675
|
pendingUserAction: null,
|
|
14676
|
+
pendingUserActionSince: null,
|
|
14656
14677
|
theme: input.tuiConfig.theme,
|
|
14657
14678
|
version: input.version,
|
|
14658
14679
|
hasNewVersion: false,
|
|
@@ -15133,7 +15154,10 @@ var ScreamTUI = class {
|
|
|
15133
15154
|
syncPendingUserAction() {
|
|
15134
15155
|
const { pendingApproval, pendingQuestion } = this.state.livePane;
|
|
15135
15156
|
const next = pendingApproval !== null ? "approval" : pendingQuestion !== null ? "question" : null;
|
|
15136
|
-
if (next !== this.state.appState.pendingUserAction) this.setAppState({
|
|
15157
|
+
if (next !== this.state.appState.pendingUserAction) this.setAppState({
|
|
15158
|
+
pendingUserAction: next,
|
|
15159
|
+
pendingUserActionSince: next === null ? null : Date.now()
|
|
15160
|
+
});
|
|
15137
15161
|
}
|
|
15138
15162
|
requireSession() {
|
|
15139
15163
|
if (this.session === void 0) throw new Error(getNoActiveSessionMessage());
|
|
@@ -15211,7 +15235,7 @@ var ScreamTUI = class {
|
|
|
15211
15235
|
const card = new OnboardingCardComponent({
|
|
15212
15236
|
colors: this.state.theme.colors,
|
|
15213
15237
|
onConfigure: () => {
|
|
15214
|
-
import("./dispatch-
|
|
15238
|
+
import("./dispatch-0mihbsV3.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
|
|
15215
15239
|
this.restoreEditor();
|
|
15216
15240
|
onDone?.();
|
|
15217
15241
|
});
|
|
@@ -16582,7 +16606,7 @@ async function runStreamJson(opts) {
|
|
|
16582
16606
|
if (event.agentId !== "main") return;
|
|
16583
16607
|
const errCode = event.code;
|
|
16584
16608
|
let exitCode = 1;
|
|
16585
|
-
if (errCode === "provider.auth_error" || errCode === "provider.rate_limit" || errCode === "provider.api_error" || errCode === "provider.connection_error") exitCode = 3;
|
|
16609
|
+
if (errCode === "provider.auth_error" || errCode === "provider.rate_limit" || errCode === "provider.api_error" || errCode === "provider.connection_error" || errCode === "provider.timeout") exitCode = 3;
|
|
16586
16610
|
finish(/* @__PURE__ */ new Error(`${event.code}: ${event.message}`), exitCode);
|
|
16587
16611
|
return;
|
|
16588
16612
|
}
|
|
@@ -16623,14 +16647,14 @@ async function runStreamJson(opts) {
|
|
|
16623
16647
|
const inputTotal = (event.usage.inputOther ?? 0) + (event.usage.inputCacheRead ?? 0) + (event.usage.inputCacheCreation ?? 0);
|
|
16624
16648
|
writer.updateUsage(inputTotal, event.usage.output ?? 0);
|
|
16625
16649
|
}
|
|
16626
|
-
} else if (type === "turn.ended") if (event.reason === "completed") finish();
|
|
16650
|
+
} else if (type === "turn.ended") if (event.reason === "completed") if (event.stepBudgetExhausted === true) finish(/* @__PURE__ */ new Error("Turn ended: step budget exhausted"), 4);
|
|
16651
|
+
else finish();
|
|
16627
16652
|
else if (event.reason === "cancelled") finish(/* @__PURE__ */ new Error("Turn cancelled"));
|
|
16628
16653
|
else {
|
|
16629
16654
|
const errCode = event.error?.code;
|
|
16630
16655
|
const errMsg = event.error !== void 0 ? `${event.error.code}: ${event.error.message}` : `Turn ended: ${event.reason}`;
|
|
16631
16656
|
let code = 1;
|
|
16632
|
-
if (errCode === "
|
|
16633
|
-
else if (errCode === "provider.auth_error" || errCode === "provider.rate_limit" || errCode === "provider.api_error" || errCode === "provider.connection_error") code = 3;
|
|
16657
|
+
if (errCode === "provider.auth_error" || errCode === "provider.rate_limit" || errCode === "provider.api_error" || errCode === "provider.connection_error" || errCode === "provider.timeout") code = 3;
|
|
16634
16658
|
finish(new Error(errMsg), code);
|
|
16635
16659
|
}
|
|
16636
16660
|
});
|
|
@@ -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 { in as handleConnectCommand } from "./dispatch-
|
|
6
|
+
import { in as handleConnectCommand } from "./dispatch-BgO7wAf9.mjs";
|
|
7
7
|
export { handleConnectCommand };
|