scream-code 0.14.3 → 0.14.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-BFd_pXnN.mjs → app-755L4Xpi.mjs} +6 -5
- package/dist/{dispatch-Swei67j2.mjs → dispatch-DEFMbHSe.mjs} +63 -38
- package/dist/{dispatch-C-4ECE2V.mjs → dispatch-Vy7eCkPt.mjs} +1 -1
- package/dist/main.mjs +1 -1
- package/dist/{text-input-dialog-Ciit7nAM.mjs → text-input-dialog-C7gjr4Gk.mjs} +4 -4
- package/dist/{text-input-dialog-BLM32jyJ.mjs → text-input-dialog-FGVh3qGR.mjs} +1 -1
- 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-DEFMbHSe.mjs";
|
|
8
|
+
import { a as setLocale, o as t } from "./text-input-dialog-C7gjr4Gk.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.6"),
|
|
34
34
|
channel: optionalBuildString(""),
|
|
35
35
|
commit: optionalBuildString(""),
|
|
36
36
|
buildTarget: optionalBuildString("darwin-arm64")
|
|
@@ -2701,7 +2701,8 @@ var SessionEventHandler = class {
|
|
|
2701
2701
|
output: serializeToolResultOutput(event.output),
|
|
2702
2702
|
is_error: event.isError,
|
|
2703
2703
|
synthetic: event.synthetic,
|
|
2704
|
-
display: event.display
|
|
2704
|
+
display: event.display,
|
|
2705
|
+
message: event.message
|
|
2705
2706
|
};
|
|
2706
2707
|
streamingUI.completeToolResult(event.toolCallId, resultData);
|
|
2707
2708
|
if (canTransitionTo(this.host.state.appState.streamingPhase, "waiting")) this.host.setAppState({ streamingPhase: "waiting" });
|
|
@@ -12189,7 +12190,7 @@ var ScreamTUI = class {
|
|
|
12189
12190
|
const card = new OnboardingCardComponent({
|
|
12190
12191
|
colors: this.state.theme.colors,
|
|
12191
12192
|
onConfigure: () => {
|
|
12192
|
-
import("./dispatch-
|
|
12193
|
+
import("./dispatch-Vy7eCkPt.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
|
|
12193
12194
|
this.restoreEditor();
|
|
12194
12195
|
});
|
|
12195
12196
|
},
|
|
@@ -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-C7gjr4Gk.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";
|
|
@@ -64654,7 +64654,7 @@ function renderPrompt(template, vars) {
|
|
|
64654
64654
|
}
|
|
64655
64655
|
//#endregion
|
|
64656
64656
|
//#region ../../packages/agent-core/src/tools/builtin/collaboration/skill-tool.md
|
|
64657
|
-
var skill_tool_default = "Invoke a registered skill from the current skill listing. BLOCKING REQUIREMENT: when a skill from the listing matches the user's request, you MUST call this tool (not free-form text). Do NOT call the same skill repeatedly inside one turn — recursive depth is capped at {{ MAX_SKILL_QUERY_DEPTH }}.\n\n## Currently model-invocable skills\n{{ AVAILABLE_SKILLS }}\nThis list is a construction-time snapshot; for the live catalog inspect the skill registry.";
|
|
64657
|
+
var skill_tool_default = "Invoke a registered skill from the current skill listing. BLOCKING REQUIREMENT: when a skill from the listing matches the user's request, you MUST call this tool (not free-form text). Do NOT call the same skill repeatedly inside one turn — recursive depth is capped at {{ MAX_SKILL_QUERY_DEPTH }}.\n\n## Currently model-invocable skills\n{{ AVAILABLE_SKILLS }}\nThis list is a construction-time snapshot; for the live catalog inspect the skill registry.\n\n## Matching guide\n\n- A skill matches when the user's request involves the scenarios/trigger conditions listed in the skill's \"When to use\" line.\n- Look for: (a) keywords in the user's request that match the skill's trigger phrases, (b) the task type or scenario described in the skill's \"When to use\", (c) similar requests the skill was designed for.\n- If a skill seems relevant, invoke it first — if it doesn't fit, you can always fall back to doing it yourself.";
|
|
64658
64658
|
/** Max skills to list inline in the tool description; rest are summarized. */
|
|
64659
64659
|
const MAX_INLINE_SKILLS = 15;
|
|
64660
64660
|
/** Max description length per skill line. */
|
|
@@ -67623,7 +67623,7 @@ Analyze the conversation transcript and the user's explicit guidance, then produ
|
|
|
67623
67623
|
The package must contain:
|
|
67624
67624
|
- name: kebab-case skill name. Prefer the user's nameHint if it is valid kebab-case; otherwise derive a concise name from the purpose.
|
|
67625
67625
|
- description: one sentence describing when to use this skill.
|
|
67626
|
-
- when-to-use: **required** — 1-2 sentences describing the specific situations/trigger conditions that should make the agent use this skill (e.g. "when the user asks to convert a document to PDF", "when debugging a vitest snapshot failure"
|
|
67626
|
+
- when-to-use: **required** — 1-2 sentences describing the specific situations/trigger conditions that should make the agent use this skill. Must include: (a) concrete trigger phrases/keywords the user might say (e.g. "convert", "PDF", "debug", "snapshot"), (b) the specific scenario or task type (e.g. "document conversion", "test debugging"), (c) avoid vague terms like "when needed" or "when appropriate". Use "When the user [action/request]..." or "When [task type]..." format. Examples: "when the user asks to convert a document to PDF", "when debugging a vitest snapshot failure", "when the user requests to deploy a model gateway". This drives the skill listing's "When to use" line, which is how the model decides to invoke the skill. Never leave it empty.
|
|
67627
67627
|
- content: the complete Markdown body of SKILL.md, following the MANDATORY structure below.
|
|
67628
67628
|
- files: optional supporting files (e.g. scripts, data files) relative to the skill directory. Empty array if none.
|
|
67629
67629
|
|
|
@@ -67754,7 +67754,19 @@ function parsePlanJson(rawText) {
|
|
|
67754
67754
|
} catch (error) {
|
|
67755
67755
|
throw new ScreamError(ErrorCodes.REQUEST_INVALID, `The skill plan is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
67756
67756
|
}
|
|
67757
|
-
const
|
|
67757
|
+
const normalizeWhenToUse = (raw) => {
|
|
67758
|
+
if (raw !== null && typeof raw === "object" && !Array.isArray(raw)) {
|
|
67759
|
+
const obj = raw;
|
|
67760
|
+
if (obj["whenToUse"] === void 0) {
|
|
67761
|
+
const hyphen = obj["when-to-use"];
|
|
67762
|
+
const underscore = obj["when_to_use"];
|
|
67763
|
+
if (typeof hyphen === "string") obj["whenToUse"] = hyphen;
|
|
67764
|
+
else if (typeof underscore === "string") obj["whenToUse"] = underscore;
|
|
67765
|
+
}
|
|
67766
|
+
}
|
|
67767
|
+
return raw;
|
|
67768
|
+
};
|
|
67769
|
+
const planSchema = z.object({
|
|
67758
67770
|
name: z.string(),
|
|
67759
67771
|
description: z.string(),
|
|
67760
67772
|
whenToUse: z.string(),
|
|
@@ -67763,7 +67775,8 @@ function parsePlanJson(rawText) {
|
|
|
67763
67775
|
path: z.string(),
|
|
67764
67776
|
content: z.string()
|
|
67765
67777
|
})).default([])
|
|
67766
|
-
}).
|
|
67778
|
+
}).transform((plan) => plan);
|
|
67779
|
+
const result = z.preprocess(normalizeWhenToUse, planSchema).safeParse(parsed);
|
|
67767
67780
|
if (!result.success) throw new ScreamError(ErrorCodes.REQUEST_INVALID, `The skill plan has an invalid structure: ${result.error.message}`);
|
|
67768
67781
|
return result.data;
|
|
67769
67782
|
}
|
|
@@ -67773,7 +67786,7 @@ function validateSkillPlan(plan, nameHint) {
|
|
|
67773
67786
|
const normalizedHint = sanitizeSkillName(nameHint);
|
|
67774
67787
|
if (plan.name !== normalizedHint) throw new ScreamError(ErrorCodes.REQUEST_INVALID, `Generated skill name "${plan.name}" does not match the user's requested name "${normalizedHint}". Please use the requested name.`);
|
|
67775
67788
|
}
|
|
67776
|
-
if (plan.whenToUse.trim().length === 0) throw new ScreamError(ErrorCodes.REQUEST_INVALID, "Generated skill plan is missing the required \"whenToUse\" field. Describe the specific situations that should trigger this skill (it powers the skill listing's \"When to use\" line
|
|
67789
|
+
if (plan.whenToUse.trim().length === 0) throw new ScreamError(ErrorCodes.REQUEST_INVALID, "Generated skill plan is missing the required \"whenToUse\" field. Describe the specific situations that should trigger this skill with concrete trigger conditions (e.g. \"when the user asks to convert a document to PDF\") — it powers the skill listing's \"When to use\" line.");
|
|
67777
67790
|
let parsedSkill;
|
|
67778
67791
|
try {
|
|
67779
67792
|
parsedSkill = parseSkillText({
|
|
@@ -68446,11 +68459,16 @@ var EditTool = class {
|
|
|
68446
68459
|
await this.jian.writeText(safePath, materializeModelText(newContent, modelView.lineEndingStyle));
|
|
68447
68460
|
scanCache.clear();
|
|
68448
68461
|
const { notice, hasErrors } = await this.appendDiagnostics(safePath);
|
|
68449
|
-
const output = `Replaced 1 occurrence in ${args.path}
|
|
68462
|
+
const output = `Replaced 1 occurrence in ${args.path}`;
|
|
68463
|
+
const message = notice.length > 0 ? notice : void 0;
|
|
68450
68464
|
return hasErrors ? {
|
|
68451
68465
|
isError: true,
|
|
68452
|
-
output
|
|
68453
|
-
|
|
68466
|
+
output,
|
|
68467
|
+
message
|
|
68468
|
+
} : {
|
|
68469
|
+
output,
|
|
68470
|
+
message
|
|
68471
|
+
};
|
|
68454
68472
|
}
|
|
68455
68473
|
const parts = content.split(args.old_string);
|
|
68456
68474
|
const replacementCount = parts.length - 1;
|
|
@@ -68465,11 +68483,16 @@ var EditTool = class {
|
|
|
68465
68483
|
await this.jian.writeText(safePath, materializeModelText(newContent, modelView.lineEndingStyle));
|
|
68466
68484
|
scanCache.clear();
|
|
68467
68485
|
const { notice, hasErrors } = await this.appendDiagnostics(safePath);
|
|
68468
|
-
const output = `Replaced ${String(replacementCount)} occurrences in ${args.path}
|
|
68486
|
+
const output = `Replaced ${String(replacementCount)} occurrences in ${args.path}`;
|
|
68487
|
+
const message = notice.length > 0 ? notice : void 0;
|
|
68469
68488
|
return hasErrors ? {
|
|
68470
68489
|
isError: true,
|
|
68471
|
-
output
|
|
68472
|
-
|
|
68490
|
+
output,
|
|
68491
|
+
message
|
|
68492
|
+
} : {
|
|
68493
|
+
output,
|
|
68494
|
+
message
|
|
68495
|
+
};
|
|
68473
68496
|
} catch (error) {
|
|
68474
68497
|
if (error?.code === "EISDIR") return {
|
|
68475
68498
|
isError: true,
|
|
@@ -74201,11 +74224,16 @@ var WriteTool = class {
|
|
|
74201
74224
|
scanCache.clear();
|
|
74202
74225
|
const bytesWritten = Buffer.byteLength(args.content, "utf8");
|
|
74203
74226
|
const { notice, hasErrors } = await this.appendDiagnostics(safePath);
|
|
74204
|
-
const output = `${mode === "append" ? "Appended" : "Wrote"} ${String(bytesWritten)} bytes to ${args.path}
|
|
74227
|
+
const output = `${mode === "append" ? "Appended" : "Wrote"} ${String(bytesWritten)} bytes to ${args.path}`;
|
|
74228
|
+
const message = notice.length > 0 ? notice : void 0;
|
|
74205
74229
|
return hasErrors ? {
|
|
74206
74230
|
isError: true,
|
|
74207
|
-
output
|
|
74208
|
-
|
|
74231
|
+
output,
|
|
74232
|
+
message
|
|
74233
|
+
} : {
|
|
74234
|
+
output,
|
|
74235
|
+
message
|
|
74236
|
+
};
|
|
74209
74237
|
} catch (error) {
|
|
74210
74238
|
if (error?.code === "ENOENT") return {
|
|
74211
74239
|
isError: true,
|
|
@@ -97404,7 +97432,8 @@ function mapLoopEvent(event, turnId) {
|
|
|
97404
97432
|
toolCallId: event.toolCallId,
|
|
97405
97433
|
output: event.result.output,
|
|
97406
97434
|
isError: event.result.isError,
|
|
97407
|
-
display: event.result.isError === true ? void 0 : event.result.display
|
|
97435
|
+
display: event.result.isError === true ? void 0 : event.result.display,
|
|
97436
|
+
message: event.result.message
|
|
97408
97437
|
};
|
|
97409
97438
|
case "turn.interrupted":
|
|
97410
97439
|
if (event.activeStep === void 0) return void 0;
|
|
@@ -129497,7 +129526,7 @@ async function guidedGoalSetup(host) {
|
|
|
129497
129526
|
host.showNotice(t("goal.storm_breaker"), t("goal.conflict_loop"));
|
|
129498
129527
|
return;
|
|
129499
129528
|
}
|
|
129500
|
-
const { TextInputDialogComponent } = await import("./text-input-dialog-
|
|
129529
|
+
const { TextInputDialogComponent } = await import("./text-input-dialog-FGVh3qGR.mjs");
|
|
129501
129530
|
const initialDesc = await promptText(host, TextInputDialogComponent, {
|
|
129502
129531
|
title: t("goal.setup_title_initial"),
|
|
129503
129532
|
subtitle: t("goal.setup_desc_hint"),
|
|
@@ -129518,7 +129547,7 @@ async function guidedGoalSetup(host) {
|
|
|
129518
129547
|
await showGoalConfigWizard(host, session, confirmed.trim() || objective, false);
|
|
129519
129548
|
}
|
|
129520
129549
|
async function showGoalConfigWizard(host, session, objective, replace) {
|
|
129521
|
-
const { TextInputDialogComponent } = await import("./text-input-dialog-
|
|
129550
|
+
const { TextInputDialogComponent } = await import("./text-input-dialog-FGVh3qGR.mjs");
|
|
129522
129551
|
const turnInput = await promptNumber(host, TextInputDialogComponent, {
|
|
129523
129552
|
title: t("goal.wizard_title", { objective }),
|
|
129524
129553
|
subtitle: t("goal.budget_turns_hint"),
|
|
@@ -130887,7 +130916,7 @@ var ThinkingComponent = class {
|
|
|
130887
130916
|
}
|
|
130888
130917
|
const truncated = rendered.slice(0, 3);
|
|
130889
130918
|
const remaining = contentLines.length - 2;
|
|
130890
|
-
const hint =
|
|
130919
|
+
const hint = t("thinking.more_lines", { count: String(remaining) });
|
|
130891
130920
|
const hintWidth = Math.max(0, width - 2);
|
|
130892
130921
|
truncated.push(" " + chalk.dim(truncateToWidth(hint, hintWidth, "…")));
|
|
130893
130922
|
if (isRenderCacheEnabled()) {
|
|
@@ -130962,7 +130991,7 @@ var CachedContainer = class extends Container {
|
|
|
130962
130991
|
//#region src/tui/theme/code-highlight-theme.ts
|
|
130963
130992
|
function createCodeHighlightTheme(colors) {
|
|
130964
130993
|
const keyword = chalk.hex(colors.mdCodeBlock);
|
|
130965
|
-
const str = chalk.hex(colors.
|
|
130994
|
+
const str = chalk.hex(colors.mdLink);
|
|
130966
130995
|
const num = chalk.hex(colors.primary);
|
|
130967
130996
|
const fn = chalk.hex(colors.warning);
|
|
130968
130997
|
const builtin = chalk.hex(colors.planMode);
|
|
@@ -131581,12 +131610,10 @@ var TruncatedOutputComponent = class {
|
|
|
131581
131610
|
expanded;
|
|
131582
131611
|
maxLines;
|
|
131583
131612
|
hintFormatter;
|
|
131584
|
-
collapseHintFormatter;
|
|
131585
131613
|
constructor(output, options) {
|
|
131586
131614
|
this.expanded = options.expanded;
|
|
131587
131615
|
this.maxLines = options.maxLines ?? PREVIEW_LINES;
|
|
131588
131616
|
this.hintFormatter = options.hintFormatter;
|
|
131589
|
-
this.collapseHintFormatter = options.collapseHintFormatter;
|
|
131590
131617
|
const tint = options.isError ? chalk.hex(options.colors.error) : chalk.dim;
|
|
131591
131618
|
const cleaned = trimTrailingEmptyLines(output.split("\n")).join("\n");
|
|
131592
131619
|
const stripped = options.isError ? cleaned.replaceAll(/\u001B\[[0-9;]*m/g, "") : cleaned;
|
|
@@ -131598,13 +131625,9 @@ var TruncatedOutputComponent = class {
|
|
|
131598
131625
|
}
|
|
131599
131626
|
render(width) {
|
|
131600
131627
|
const contentLines = this.textComponent.render(width);
|
|
131601
|
-
if (contentLines.length <= this.maxLines) return contentLines;
|
|
131602
|
-
if (this.expanded) {
|
|
131603
|
-
const collapseHint = this.collapseHintFormatter ? this.collapseHintFormatter() : t("shell.collapse_hint");
|
|
131604
|
-
return [chalk.dim(collapseHint), ...contentLines];
|
|
131605
|
-
}
|
|
131628
|
+
if (this.expanded || contentLines.length <= this.maxLines) return contentLines;
|
|
131606
131629
|
const remaining = contentLines.length - this.maxLines;
|
|
131607
|
-
const tail = contentLines.slice(-this.maxLines);
|
|
131630
|
+
const tail = this.maxLines <= 0 ? [] : contentLines.slice(-this.maxLines);
|
|
131608
131631
|
const expandHint = this.hintFormatter ? this.hintFormatter(remaining) : t("shell.more_lines", { count: String(remaining) });
|
|
131609
131632
|
return [chalk.dim(expandHint), ...tail];
|
|
131610
131633
|
}
|
|
@@ -131622,16 +131645,16 @@ const renderTruncated = (_toolCall, result, ctx) => {
|
|
|
131622
131645
|
var ShellExecutionComponent = class extends Container {
|
|
131623
131646
|
constructor(options) {
|
|
131624
131647
|
super();
|
|
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 ??
|
|
131648
|
+
if (options.showCommand === true) this.addCommandPreview(options.command ?? "", options.commandPreviewLines, options.colors);
|
|
131649
|
+
if (options.result !== void 0) this.addResultPreview(options.result, options.colors, options.expanded ?? false, options.resultPreviewLines ?? 15);
|
|
131627
131650
|
}
|
|
131628
|
-
addCommandPreview(command, previewLines) {
|
|
131651
|
+
addCommandPreview(command, previewLines, colors) {
|
|
131629
131652
|
if (command.length === 0) return;
|
|
131630
|
-
const allLines = command
|
|
131653
|
+
const allLines = highlightLines(command, "bash", colors);
|
|
131631
131654
|
const lines = previewLines === void 0 ? allLines : allLines.slice(0, previewLines);
|
|
131632
131655
|
for (const [i, line] of lines.entries()) {
|
|
131633
131656
|
const prefix = i === 0 ? "$ " : " ";
|
|
131634
|
-
this.addChild(new Text(chalk.dim(prefix
|
|
131657
|
+
this.addChild(new Text(`${chalk.dim(prefix)}${line}`, 2, 0));
|
|
131635
131658
|
}
|
|
131636
131659
|
}
|
|
131637
131660
|
addResultPreview(result, colors, expanded, previewLines) {
|
|
@@ -131642,8 +131665,7 @@ var ShellExecutionComponent = class extends Container {
|
|
|
131642
131665
|
colors,
|
|
131643
131666
|
maxLines: previewLines,
|
|
131644
131667
|
maxBytes: MAX_SHELL_OUTPUT_BYTES,
|
|
131645
|
-
hintFormatter: (remaining) => t("shell.more_lines", { count: String(remaining) })
|
|
131646
|
-
collapseHintFormatter: () => t("shell.collapse_hint")
|
|
131668
|
+
hintFormatter: (remaining) => t("shell.more_lines", { count: String(remaining) })
|
|
131647
131669
|
}));
|
|
131648
131670
|
}
|
|
131649
131671
|
};
|
|
@@ -131652,8 +131674,9 @@ const shellExecutionResultRenderer = (toolCall, result, ctx) => [new ShellExecut
|
|
|
131652
131674
|
result,
|
|
131653
131675
|
colors: ctx.colors,
|
|
131654
131676
|
expanded: ctx.expanded,
|
|
131655
|
-
showCommand:
|
|
131656
|
-
commandPreviewLines: void 0
|
|
131677
|
+
showCommand: true,
|
|
131678
|
+
commandPreviewLines: ctx.expanded ? void 0 : 3,
|
|
131679
|
+
resultPreviewLines: ctx.expanded ? void 0 : result.is_error ? void 0 : ctx.isLive ? void 0 : 0
|
|
131657
131680
|
})];
|
|
131658
131681
|
//#endregion
|
|
131659
131682
|
//#region src/tui/components/media/image-thumbnail.ts
|
|
@@ -133122,7 +133145,8 @@ var ToolCallComponent = class ToolCallComponent extends CachedContainer {
|
|
|
133122
133145
|
is_error: false
|
|
133123
133146
|
}, {
|
|
133124
133147
|
expanded: this.expanded,
|
|
133125
|
-
colors: this.colors
|
|
133148
|
+
colors: this.colors,
|
|
133149
|
+
isLive: true
|
|
133126
133150
|
});
|
|
133127
133151
|
for (const component of components) this.addChild(component);
|
|
133128
133152
|
}
|
|
@@ -133480,6 +133504,7 @@ var ToolCallComponent = class ToolCallComponent extends CachedContainer {
|
|
|
133480
133504
|
colors: this.colors
|
|
133481
133505
|
});
|
|
133482
133506
|
for (const component of components) this.addChild(component);
|
|
133507
|
+
if (result.message !== void 0 && result.message.length > 0) for (const line of result.message.split("\n")) this.addChild(new Text(chalk.dim(line), 2, 0));
|
|
133483
133508
|
}
|
|
133484
133509
|
/**
|
|
133485
133510
|
* Render AskUserQuestion's JSON payload as a friendly Q/A list.
|
|
@@ -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-DEFMbHSe.mjs";
|
|
7
7
|
export { handleConnectCommand };
|
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-755L4Xpi.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);
|
|
@@ -959,8 +959,8 @@ const dictionaries = {
|
|
|
959
959
|
"cronmsg.missed": "{count} 次错过",
|
|
960
960
|
"cronmsg.final_delivery": "最终投递",
|
|
961
961
|
"thinking.in_progress": "思考中...",
|
|
962
|
-
"
|
|
963
|
-
"shell.
|
|
962
|
+
"thinking.more_lines": "...(还有 {count} 行,按 ctrl+o 展开)",
|
|
963
|
+
"shell.more_lines": "...(还有 {count} 行,按 ctrl+o 展开)",
|
|
964
964
|
"ccconnect.note_botfather": "需先在 @BotFather 创建 bot",
|
|
965
965
|
"ccconnect.note_napcat": "需要 NapCat/OneBot",
|
|
966
966
|
"ccconnect.note_wecom": "需要公网 IP",
|
|
@@ -2057,8 +2057,8 @@ const dictionaries = {
|
|
|
2057
2057
|
"cronmsg.missed": "{count} missed",
|
|
2058
2058
|
"cronmsg.final_delivery": "Final delivery",
|
|
2059
2059
|
"thinking.in_progress": "Thinking...",
|
|
2060
|
-
"
|
|
2061
|
-
"shell.
|
|
2060
|
+
"thinking.more_lines": "... ({count} more lines, ctrl+o to expand)",
|
|
2061
|
+
"shell.more_lines": "... ({count} more lines, ctrl+o to expand)",
|
|
2062
2062
|
"ccconnect.note_botfather": "Create a bot at @BotFather first",
|
|
2063
2063
|
"ccconnect.note_napcat": "Requires NapCat/OneBot",
|
|
2064
2064
|
"ccconnect.note_wecom": "Requires public IP",
|
|
@@ -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-C7gjr4Gk.mjs";
|
|
7
7
|
export { TextInputDialogComponent };
|