scream-code 0.14.3 → 0.14.5

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.
@@ -4,7 +4,7 @@ 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-Swei67j2.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-BSLRpoBA.mjs";
8
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";
@@ -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.3"),
33
+ version: optionalBuildString("0.14.5"),
34
34
  channel: optionalBuildString(""),
35
35
  commit: optionalBuildString(""),
36
36
  buildTarget: optionalBuildString("darwin-arm64")
@@ -12189,7 +12189,7 @@ var ScreamTUI = class {
12189
12189
  const card = new OnboardingCardComponent({
12190
12190
  colors: this.state.theme.colors,
12191
12191
  onConfigure: () => {
12192
- import("./dispatch-C-4ECE2V.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
12192
+ import("./dispatch-DHFfsRy8.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
12193
12193
  this.restoreEditor();
12194
12194
  });
12195
12195
  },
@@ -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 result = z.object({
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
- }).safeParse(parsed);
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
  }
@@ -130962,7 +130975,7 @@ var CachedContainer = class extends Container {
130962
130975
  //#region src/tui/theme/code-highlight-theme.ts
130963
130976
  function createCodeHighlightTheme(colors) {
130964
130977
  const keyword = chalk.hex(colors.mdCodeBlock);
130965
- const str = chalk.hex(colors.error);
130978
+ const str = chalk.hex(colors.mdLink);
130966
130979
  const num = chalk.hex(colors.primary);
130967
130980
  const fn = chalk.hex(colors.warning);
130968
130981
  const builtin = chalk.hex(colors.planMode);
@@ -131604,7 +131617,7 @@ var TruncatedOutputComponent = class {
131604
131617
  return [chalk.dim(collapseHint), ...contentLines];
131605
131618
  }
131606
131619
  const remaining = contentLines.length - this.maxLines;
131607
- const tail = contentLines.slice(-this.maxLines);
131620
+ const tail = this.maxLines <= 0 ? [] : contentLines.slice(-this.maxLines);
131608
131621
  const expandHint = this.hintFormatter ? this.hintFormatter(remaining) : t("shell.more_lines", { count: String(remaining) });
131609
131622
  return [chalk.dim(expandHint), ...tail];
131610
131623
  }
@@ -131622,16 +131635,16 @@ const renderTruncated = (_toolCall, result, ctx) => {
131622
131635
  var ShellExecutionComponent = class extends Container {
131623
131636
  constructor(options) {
131624
131637
  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 ?? 10);
131638
+ if (options.showCommand === true) this.addCommandPreview(options.command ?? "", options.commandPreviewLines, options.colors);
131639
+ if (options.result !== void 0) this.addResultPreview(options.result, options.colors, options.expanded ?? false, options.resultPreviewLines ?? 15);
131627
131640
  }
131628
- addCommandPreview(command, previewLines) {
131641
+ addCommandPreview(command, previewLines, colors) {
131629
131642
  if (command.length === 0) return;
131630
- const allLines = command.split("\n");
131643
+ const allLines = highlightLines(command, "bash", colors);
131631
131644
  const lines = previewLines === void 0 ? allLines : allLines.slice(0, previewLines);
131632
131645
  for (const [i, line] of lines.entries()) {
131633
131646
  const prefix = i === 0 ? "$ " : " ";
131634
- this.addChild(new Text(chalk.dim(prefix + line), 2, 0));
131647
+ this.addChild(new Text(`${chalk.dim(prefix)}${line}`, 2, 0));
131635
131648
  }
131636
131649
  }
131637
131650
  addResultPreview(result, colors, expanded, previewLines) {
@@ -131652,8 +131665,9 @@ const shellExecutionResultRenderer = (toolCall, result, ctx) => [new ShellExecut
131652
131665
  result,
131653
131666
  colors: ctx.colors,
131654
131667
  expanded: ctx.expanded,
131655
- showCommand: ctx.expanded,
131656
- commandPreviewLines: void 0
131668
+ showCommand: true,
131669
+ commandPreviewLines: ctx.expanded ? void 0 : 3,
131670
+ resultPreviewLines: ctx.expanded ? void 0 : result.is_error ? void 0 : ctx.isLive ? void 0 : 0
131657
131671
  })];
131658
131672
  //#endregion
131659
131673
  //#region src/tui/components/media/image-thumbnail.ts
@@ -133122,7 +133136,8 @@ var ToolCallComponent = class ToolCallComponent extends CachedContainer {
133122
133136
  is_error: false
133123
133137
  }, {
133124
133138
  expanded: this.expanded,
133125
- colors: this.colors
133139
+ colors: this.colors,
133140
+ isLive: true
133126
133141
  });
133127
133142
  for (const component of components) this.addChild(component);
133128
133143
  }
@@ -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-Swei67j2.mjs";
6
+ import { Kt as handleConnectCommand } from "./dispatch-BSLRpoBA.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-BFd_pXnN.mjs")).main();
9
+ (await import("./app-4wRRcsTF.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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scream-code",
3
- "version": "0.14.3",
3
+ "version": "0.14.5",
4
4
  "description": "A terminal-native AI agent for builders",
5
5
  "license": "MIT",
6
6
  "author": "ScreamCli",