scream-code 0.14.6 → 0.14.8
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/README.md +3 -0
- package/dist/{app-755L4Xpi.mjs → app-CJCkJpo_.mjs} +97 -32
- package/dist/{dispatch-Vy7eCkPt.mjs → dispatch-DVJhr5Rj.mjs} +1 -1
- package/dist/{dispatch-DEFMbHSe.mjs → dispatch-usl5yQnT.mjs} +2113 -170
- package/dist/main.mjs +1 -1
- package/dist/{text-input-dialog-C7gjr4Gk.mjs → text-input-dialog-B0yHChBj.mjs} +10 -2
- package/dist/{text-input-dialog-FGVh3qGR.mjs → text-input-dialog-B9uwX1Uy.mjs} +1 -1
- package/package.json +1 -1
- package/dist/{src-C8lOjRbK.mjs → src-C3oCiVNb.mjs} +1 -1
package/README.md
CHANGED
|
@@ -57,6 +57,7 @@ When Scream wants to modify files or run commands, an approval panel pops up —
|
|
|
57
57
|
- **Context Search** — `/search` (Ctrl+Shift+F) full-screen keyword search over the conversation.
|
|
58
58
|
- **High Cache Hit Rate** — per-session HitR in the status bar, tuned across compatible protocols to maximize cache hits without compromising quality.
|
|
59
59
|
- **MCP / Skills / 130+ providers** — all DIY-configurable; ships with browser (46 tools) and macOS desktop automation.
|
|
60
|
+
- **Self-Evolving Plugins** — a built-in `ManagePlugin` tool lets the agent find, make, and install add-on skills/MCP servers itself and hot-apply them to the running session: nothing executes until an approved activate, a circuit breaker reclaims a plugin after repeated failures, immune memory warns before reinstalling a source that already broke, and upgrades keep a rollback-ready backup.
|
|
60
61
|
- **Remote Control** — drive Scream from WeChat, Feishu, Slack, DingTalk, QQ, Telegram, Discord via cc-connect.
|
|
61
62
|
|
|
62
63
|
### Slash Commands
|
|
@@ -134,6 +135,8 @@ The browser UI shares the same agent-core as the TUI — zero feature loss. Mult
|
|
|
134
135
|
|
|
135
136
|
Website: [scream.chat](https://scream.chat)
|
|
136
137
|
|
|
138
|
+
- **Self-Evolution manual** — walk through making, installing, tripping, and rolling back a plugin: `packages/agent-core/docs/self-evolution-e2e.md`.
|
|
139
|
+
|
|
137
140
|
### Contributing
|
|
138
141
|
|
|
139
142
|
Free and open — forks, feedback and pull requests are welcome. Scream is a lightweight agent foundation: maximize the model's own capability, don't over-constrain it with framework. Inspired by pi, pi-tui, gork, kimicli, Gemini, ohmypi, zero and others.
|
|
@@ -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-usl5yQnT.mjs";
|
|
8
|
+
import { a as setLocale, o as t } from "./text-input-dialog-B0yHChBj.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";
|
|
@@ -17,20 +17,20 @@ import { z } from "zod";
|
|
|
17
17
|
import { exec, execFile, execSync, spawn, spawnSync } from "node:child_process";
|
|
18
18
|
import { promisify } from "node:util";
|
|
19
19
|
import { homedir, tmpdir } from "node:os";
|
|
20
|
-
import { createServer } from "node:http";
|
|
21
20
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
21
|
+
import { createServer } from "node:http";
|
|
22
22
|
import process$1 from "node:process";
|
|
23
23
|
import { Command, Option } from "commander";
|
|
24
24
|
import { createInterface } from "node:readline/promises";
|
|
25
25
|
import chalk, { chalkStderr } from "chalk";
|
|
26
|
-
import { CombinedAutocompleteProvider, Container, Editor,
|
|
26
|
+
import { CombinedAutocompleteProvider, Container, Editor, Input, Key, ProcessTerminal, ScrollView, Spacer, Text, TuiAltScreen, VStack, decodeKittyPrintable, deleteAllKittyImages, fuzzyFilter, fuzzyMatch, getCapabilities, isKeyRelease, matchesKey, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@liutod-scream/pi-tui";
|
|
27
27
|
import { createInterface as createInterface$1 } from "node:readline";
|
|
28
28
|
//#region src/cli/build-info.ts
|
|
29
29
|
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.8"),
|
|
34
34
|
channel: optionalBuildString(""),
|
|
35
35
|
commit: optionalBuildString(""),
|
|
36
36
|
buildTarget: optionalBuildString("darwin-arm64")
|
|
@@ -2542,7 +2542,13 @@ var SessionEventHandler = class {
|
|
|
2542
2542
|
handleStepRetrying(event) {
|
|
2543
2543
|
this.host.streamingUI.resetLiveText();
|
|
2544
2544
|
this.host.streamingUI.resetToolUi();
|
|
2545
|
-
this.host.setAppState({
|
|
2545
|
+
this.host.setAppState({
|
|
2546
|
+
reconnectAttempt: event.nextAttempt,
|
|
2547
|
+
reconnectMaxAttempts: event.maxAttempts,
|
|
2548
|
+
reconnectDelayMs: event.delayMs,
|
|
2549
|
+
reconnectStatusCode: event.statusCode,
|
|
2550
|
+
reconnectErrorName: event.errorName
|
|
2551
|
+
});
|
|
2546
2552
|
}
|
|
2547
2553
|
maybeShowDebugTiming(event) {
|
|
2548
2554
|
if (process.env["SCREAM_CODE_DEBUG"] !== "1") return;
|
|
@@ -6154,6 +6160,30 @@ var GutterContainer = class extends Container {
|
|
|
6154
6160
|
//#endregion
|
|
6155
6161
|
//#region src/tui/components/panes/status-bar-pane.ts
|
|
6156
6162
|
/**
|
|
6163
|
+
* Single-line row: pulse wave immediately followed by its label.
|
|
6164
|
+
*
|
|
6165
|
+
* HStack cannot produce this layout: pi-tui's Text.render pads every line to
|
|
6166
|
+
* the full row width, so each child's intrinsic width equals the full width
|
|
6167
|
+
* and HStack's shrink distribution pushes the label far to the right.
|
|
6168
|
+
* Composing the line manually from the loader's unpadded frame text keeps
|
|
6169
|
+
* the label snug against the wave, and it re-reads the frame on every render
|
|
6170
|
+
* so the wave keeps animating.
|
|
6171
|
+
*/
|
|
6172
|
+
var PulseWaveLabelRow = class {
|
|
6173
|
+
wave;
|
|
6174
|
+
label;
|
|
6175
|
+
constructor(wave, label) {
|
|
6176
|
+
this.wave = wave;
|
|
6177
|
+
this.label = label;
|
|
6178
|
+
}
|
|
6179
|
+
render(width) {
|
|
6180
|
+
return [truncateToWidth(` ${this.wave.getFrameText()} ${this.label}`, Math.max(1, width))];
|
|
6181
|
+
}
|
|
6182
|
+
invalidate() {
|
|
6183
|
+
this.wave.invalidate();
|
|
6184
|
+
}
|
|
6185
|
+
};
|
|
6186
|
+
/**
|
|
6157
6187
|
* A fixed one-line status bar shown directly above the input editor: it
|
|
6158
6188
|
* displays the current work phase (idle / waiting / thinking / composing /
|
|
6159
6189
|
* tool) with its spinner, pinned to the bottom of the terminal via the dock
|
|
@@ -6179,12 +6209,8 @@ var StatusBarPaneComponent = class extends Container {
|
|
|
6179
6209
|
}
|
|
6180
6210
|
if (options.mode === "waiting" || options.mode === "tool" || options.mode === "composing" || options.mode === "thinking") {
|
|
6181
6211
|
if (options.pulseWave !== void 0) {
|
|
6182
|
-
if (options.label.length > 0)
|
|
6183
|
-
|
|
6184
|
-
row.addChild(options.pulseWave);
|
|
6185
|
-
row.addChild(new Text(` ${options.label}`, 1, 0));
|
|
6186
|
-
this.addChild(row);
|
|
6187
|
-
} else this.addChild(options.pulseWave);
|
|
6212
|
+
if (options.label.length > 0) this.addChild(new PulseWaveLabelRow(options.pulseWave, options.label));
|
|
6213
|
+
else this.addChild(options.pulseWave);
|
|
6188
6214
|
return;
|
|
6189
6215
|
}
|
|
6190
6216
|
if (options.spinner !== void 0) {
|
|
@@ -6445,6 +6471,14 @@ var PulseWaveLoader = class extends Text {
|
|
|
6445
6471
|
intervalId = null;
|
|
6446
6472
|
ui;
|
|
6447
6473
|
colorHex;
|
|
6474
|
+
/** Raw frame text without Text's full-width render padding, exposed so
|
|
6475
|
+
* callers can compose the wave inline with trailing content (e.g. the
|
|
6476
|
+
* reconnect label in the status bar). */
|
|
6477
|
+
frameText = "";
|
|
6478
|
+
/** The current frame's cells ("■ ⬝ ⬝"), unpadded. */
|
|
6479
|
+
getFrameText() {
|
|
6480
|
+
return this.frameText;
|
|
6481
|
+
}
|
|
6448
6482
|
constructor(ui, colorHex) {
|
|
6449
6483
|
super("", 1, 0);
|
|
6450
6484
|
this.ui = ui;
|
|
@@ -6475,7 +6509,8 @@ var PulseWaveLoader = class extends Text {
|
|
|
6475
6509
|
1,
|
|
6476
6510
|
2
|
|
6477
6511
|
].map((idx) => this.renderCell(idx, step.active, step.forward));
|
|
6478
|
-
this.
|
|
6512
|
+
this.frameText = cells.join(" ");
|
|
6513
|
+
this.setText(this.frameText);
|
|
6479
6514
|
this.ui.requestRender();
|
|
6480
6515
|
}
|
|
6481
6516
|
renderCell(index, active, forward) {
|
|
@@ -6499,6 +6534,7 @@ var LifecycleController = class LifecycleController {
|
|
|
6499
6534
|
terminalFocusTrackingDispose;
|
|
6500
6535
|
terminalThemeTrackingDispose;
|
|
6501
6536
|
lastActivityMode;
|
|
6537
|
+
lastReconnectAttempt = 0;
|
|
6502
6538
|
/** The active status-bar loader (PulseWaveLoader or MoonLoader). Owned by
|
|
6503
6539
|
* this controller; stopped before replacement to avoid leaking timers. */
|
|
6504
6540
|
statusBarLoader;
|
|
@@ -6741,8 +6777,11 @@ var LifecycleController = class LifecycleController {
|
|
|
6741
6777
|
updateActivityPane() {
|
|
6742
6778
|
const effectiveMode = this.resolveActivityPaneMode();
|
|
6743
6779
|
this.syncTerminalProgress(this.shouldShowTerminalProgress(effectiveMode));
|
|
6744
|
-
|
|
6780
|
+
const reconnectAttempt = this.host.state.appState.reconnectAttempt;
|
|
6781
|
+
const reconnectChanged = reconnectAttempt !== this.lastReconnectAttempt;
|
|
6782
|
+
if (effectiveMode === this.lastActivityMode && !reconnectChanged) return;
|
|
6745
6783
|
this.lastActivityMode = effectiveMode;
|
|
6784
|
+
this.lastReconnectAttempt = reconnectAttempt;
|
|
6746
6785
|
this.updateStatusBar(effectiveMode);
|
|
6747
6786
|
const { state } = this.host;
|
|
6748
6787
|
state.activityContainer.clear();
|
|
@@ -6787,7 +6826,7 @@ var LifecycleController = class LifecycleController {
|
|
|
6787
6826
|
this.statusBarLoader = loader;
|
|
6788
6827
|
state.statusBarContainer.addChild(new StatusBarPaneComponent({
|
|
6789
6828
|
mode,
|
|
6790
|
-
label:
|
|
6829
|
+
label: this.buildReconnectLabel(state),
|
|
6791
6830
|
pulseWave: loader
|
|
6792
6831
|
}));
|
|
6793
6832
|
}
|
|
@@ -6808,6 +6847,25 @@ var LifecycleController = class LifecycleController {
|
|
|
6808
6847
|
}
|
|
6809
6848
|
state.ui.requestRender();
|
|
6810
6849
|
}
|
|
6850
|
+
/** Builds the reconnect label shown next to the status-bar pulse wave
|
|
6851
|
+
* while a step retry is in flight, e.g. "重连中 3/10 · 限流 · 20s 后重试".
|
|
6852
|
+
* Returns an empty string when no retry is active. Static by design: the
|
|
6853
|
+
* delay shown is the value from the latest retry event, not a ticking
|
|
6854
|
+
* countdown. */
|
|
6855
|
+
buildReconnectLabel(state) {
|
|
6856
|
+
const a = state.appState;
|
|
6857
|
+
if (a.reconnectAttempt <= 0) return "";
|
|
6858
|
+
const reasonKey = a.reconnectStatusCode === 429 ? "status.reason_rate_limit" : a.reconnectStatusCode !== void 0 && a.reconnectStatusCode >= 500 ? "status.reason_server" : (a.reconnectErrorName ?? "").includes("Timeout") ? "status.reason_timeout" : "status.reason_connection";
|
|
6859
|
+
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);
|
|
6860
|
+
const delaySec = Math.max(1, Math.round((a.reconnectDelayMs ?? 0) / 1e3));
|
|
6861
|
+
const label = t("status.reconnecting_detail", {
|
|
6862
|
+
attempt: String(a.reconnectAttempt),
|
|
6863
|
+
max: String(a.reconnectMaxAttempts ?? 0),
|
|
6864
|
+
reason,
|
|
6865
|
+
delay: String(delaySec)
|
|
6866
|
+
});
|
|
6867
|
+
return chalk.hex(state.theme.colors.textDim)(label);
|
|
6868
|
+
}
|
|
6811
6869
|
/** Force a status-bar refresh even when the mode is unchanged. Used after
|
|
6812
6870
|
* session switches/clears: the transcript is emptied, so the empty-session
|
|
6813
6871
|
* hint must (re)appear even though idle -> idle normally short-circuits. */
|
|
@@ -9440,25 +9498,31 @@ var SessionManager$1 = class {
|
|
|
9440
9498
|
return { switched: true };
|
|
9441
9499
|
}
|
|
9442
9500
|
async switchToSession(session, statusMessage) {
|
|
9443
|
-
this.
|
|
9444
|
-
|
|
9445
|
-
await this.syncRuntimeState(session);
|
|
9446
|
-
this.host.refreshSessionTitle();
|
|
9447
|
-
try {
|
|
9448
|
-
await this.host.refreshSkillCommands(this.host.session);
|
|
9449
|
-
} catch {}
|
|
9450
|
-
this.host.clearTranscriptAndRedraw();
|
|
9501
|
+
if (this.host.state.appState.isSwitchingSession) return;
|
|
9502
|
+
this.host.setAppState({ isSwitchingSession: true });
|
|
9451
9503
|
try {
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
this.host.
|
|
9504
|
+
this.resetSessionRuntime();
|
|
9505
|
+
await this.setSession(session);
|
|
9506
|
+
await this.syncRuntimeState(session);
|
|
9507
|
+
this.host.refreshSessionTitle();
|
|
9508
|
+
try {
|
|
9509
|
+
await this.host.refreshSkillCommands(this.host.session);
|
|
9510
|
+
} catch {}
|
|
9511
|
+
this.host.clearTranscriptAndRedraw();
|
|
9512
|
+
try {
|
|
9513
|
+
await this.host.sessionReplay.hydrateFromReplay(session);
|
|
9514
|
+
} catch (error) {
|
|
9515
|
+
const msg = formatErrorMessage(error);
|
|
9516
|
+
this.host.showError(t("session.replay_failed", { msg }));
|
|
9517
|
+
} finally {
|
|
9518
|
+
this.host.sessionEventHandler.startSubscription();
|
|
9519
|
+
}
|
|
9520
|
+
const resumeState = session.getResumeState();
|
|
9521
|
+
if (resumeState?.warning !== void 0) this.host.showStatus(t("session.resume_warning", { warning: resumeState.warning }), this.host.state.theme.colors.warning);
|
|
9522
|
+
this.host.showStatus(statusMessage);
|
|
9456
9523
|
} finally {
|
|
9457
|
-
this.host.
|
|
9524
|
+
this.host.setAppState({ isSwitchingSession: false });
|
|
9458
9525
|
}
|
|
9459
|
-
const resumeState = session.getResumeState();
|
|
9460
|
-
if (resumeState?.warning !== void 0) this.host.showStatus(t("session.resume_warning", { warning: resumeState.warning }), this.host.state.theme.colors.warning);
|
|
9461
|
-
this.host.showStatus(statusMessage);
|
|
9462
9526
|
}
|
|
9463
9527
|
async createNewSession() {
|
|
9464
9528
|
if (this.host.state.appState.isReplaying) {
|
|
@@ -11679,6 +11743,7 @@ function createInitialAppState(input) {
|
|
|
11679
11743
|
lastCompactionFinishedAt: void 0,
|
|
11680
11744
|
autoCompactionCount: 0,
|
|
11681
11745
|
isReplaying: false,
|
|
11746
|
+
isSwitchingSession: false,
|
|
11682
11747
|
streamingPhase: "idle",
|
|
11683
11748
|
streamingStartTime: 0,
|
|
11684
11749
|
theme: input.tuiConfig.theme,
|
|
@@ -12190,7 +12255,7 @@ var ScreamTUI = class {
|
|
|
12190
12255
|
const card = new OnboardingCardComponent({
|
|
12191
12256
|
colors: this.state.theme.colors,
|
|
12192
12257
|
onConfigure: () => {
|
|
12193
|
-
import("./dispatch-
|
|
12258
|
+
import("./dispatch-DVJhr5Rj.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
|
|
12194
12259
|
this.restoreEditor();
|
|
12195
12260
|
});
|
|
12196
12261
|
},
|
|
@@ -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-usl5yQnT.mjs";
|
|
7
7
|
export { handleConnectCommand };
|