scream-code 0.18.1 → 0.18.3

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 CHANGED
@@ -109,6 +109,7 @@ Type `/` in the input to browse. All 55 commands:
109
109
  | `/language` (`/lang`) | Switch interface language |
110
110
  | `/theme` | Set terminal UI theme |
111
111
  | `/permission` | Select permission mode |
112
+ | `/grants` | Review and revoke session approvals |
112
113
  | `/editor` | Set external editor |
113
114
  | `/settings` | Open TUI settings |
114
115
  | `/init` | Analyze codebase and generate AGENTS.md |
@@ -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 { $n as encodeWorkDirKey, $t as lerpGradient, A as highlightLines, An as embeddingFailureDetail, At as isTurnElapsedEnabled, B as ActivityGroupComponent, Bn as detectShellEnvironment, Bt as ENABLE_TERMINAL_THEME_REPORTING, Cn as getLlmNotSetMessage, Ct as clearInfoPanelState, D as ToolCallComponent, Dn as sortSlashCommands, Dt as createEditorTheme, E as UserMessageComponent, En as BUILTIN_SLASH_COMMANDS, Et as resolveThemeSync, F as StatusMessageComponent, Fn as PULSE_WAVE_FRAMES, Ft as detectTerminalTheme, G as AgentGroupComponent, Gn as CLI_COMMAND_NAME, Gt as QUERY_TERMINAL_THEME, H as estimateTokens, Hn as getInputHistoryFile, Ht as OSC11_RESPONSE, I as replaceTabs, In as TuiConfigParseError, It as parseOsc11BackgroundTheme, J as getBreathingFrame, Jn as PRODUCT_NAME, Jt as TERMINAL_THEME_DARK, K as WelcomeComponent, Kn as CLI_UI_MODE, Kt as TERMINAL_FOCUS_IN, L as sanitizeShellOutput, Ln as TuiLikePreferencesSchema, Lt as DISABLE_TERMINAL_FOCUS_REPORTING, M as CachedContainer, Mn as hasEmbeddingModelCache, Mt as createThemeStyles, N as ThinkingComponent, Nn as startManualEmbeddingDownload, Nt as contrastTextHex, O as renderDiffLines, On as isExperimentalFlagEnabled, Ot as createMarkdownTheme, P as NoticeMessageComponent, Pn as PIXEL_PULSE_FRAMES, Pt as getColorPalette, Q as refineGoal, Qn as ScreamHarness, Qt as FooterComponent, R as SkillActivationComponent, Rn as loadTuiConfig, Rt as DISABLE_TERMINAL_THEME_REPORTING, S as readJsonlFile, Sn as getCtrlDHint, St as supportsBalance, Tn as buildSkillSlashCommands, U as getSharedSpeedTracker, Un as getLogDir, Ut as OSC11_RESPONSE_PREFIX, V as charsForTokenBudget, Vn as getDataDir, Vt as OSC11_QUERY, W as BackgroundAgentStatusComponent, Wn as detectInstallSource, Wt as OSC11_RESPONSE_PREFIX_NO_ESC, X as CompactionComponent, Xn as fetchCatalog, Xt as isBusy, Y as resetBreathingClock, Yn as DEFAULT_CATALOG_URL, Yt as TERMINAL_THEME_LIGHT, Z as clearGoalState, Zn as saveCatalogCache, Zt as isStreaming, _n as EXIT_CONFIRM_WINDOW_MS, a as syncDiagramCapabilityPrompt, an as printableChar, ar as isRealUserPrompt, at as toTerminalHyperlink, b as readUpdateCache, bn as TIP_ROTATION_INTERVAL_MS, c as disposeChildren, cn as appendStreamingArgsPreview, cr as flushDiagnosticLogs, d as isPlanExpandable, dn as isTodoItemShape, dr as isScreamError, en as SubagentSlots, er as normalizeWorkDir, f as MoonLoader, fn as parseStreamingArgs, fr as isOrphanedToolCallError, ft as handleFusionPlanCommand, gn as EMPTY_SESSION_HINT_URL, hn as truncateErrorMessage, i as buildRoleAdditionalText, it as isInternalMessage, j as langFromPath, jn as getKnowledgeStore, jt as toggleEmptySessionHint, k as renderDiffLinesClustered, kn as setExperimentalFlags, kt as isEmptySessionHintDismissed, l as hasDispose, ln as argsRecord, lr as log, mn as stringValue, mr as SCREAM_ERROR_INFO, mt as handlePlanCommand, n as clearEvalPanelState, nr as readSessionIndex, on as STATUS_BULLET, or as parseRlmMaxDepthArg, ot as changeThinkingLevel, p as formatMemoryMemoForInjection, pn as serializeToolResultOutput, pr as ErrorCodes, q as BREATHE_CYCLE_MS, qn as CLI_USER_AGENT_PRODUCT, qt as TERMINAL_FOCUS_OUT, r as openUrl, rr as removeSessionIndexEntry, sn as appendSessionHeaderHint, sr as resolveScreamHome, st as getModelCycleLevel, t as dispatchInput, tr as appendSessionIndexEntry, u as isExpandable, un as formatErrorMessage, ur as resolveGlobalLogPath, v as selectUpdateTarget, vn as MAIN_AGENT_ID, w as getDaemonInstructions, wn as getNoActiveSessionMessage, x as appendJsonlLine, xn as getCtrlCHint, xt as refreshProviderBalance, y as refreshUpdateCache, yn as SESSION_TIPS, z as AssistantMessageComponent, zn as saveTuiConfig, zt as ENABLE_TERMINAL_FOCUS_REPORTING } from "./dispatch-FYZpdI9u.mjs";
9
- import { a as setLocale, i as getLocale, o as t } from "./text-input-dialog-Bu8GPguU.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-DD5FtPHZ.mjs";
9
+ import { a as setLocale, i as getLocale, o as t } from "./text-input-dialog-Dw-Cl3DW.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.1"),
36
+ version: optionalBuildString("0.18.3"),
37
37
  channel: optionalBuildString(""),
38
38
  commit: optionalBuildString(""),
39
39
  buildTarget: optionalBuildString("darwin-arm64")
@@ -11754,7 +11754,9 @@ function adaptApprovalRequest(event) {
11754
11754
  action: event.action,
11755
11755
  description: resolved.description,
11756
11756
  display: resolved.blocks,
11757
- choices: adaptChoices(event.toolName, event.display),
11757
+ choices: adaptChoices(event.toolName, event.display, event.grantOptions),
11758
+ ...event.reasons !== void 0 && event.reasons.length > 0 ? { reasons: [...event.reasons] } : {},
11759
+ ...event.requestSummary !== void 0 && event.requestSummary.length > 0 ? { request_summary: event.requestSummary } : {},
11758
11760
  ...sourceLabel !== void 0 ? { source_label: sourceLabel } : {}
11759
11761
  };
11760
11762
  }
@@ -12021,9 +12023,22 @@ function adaptDisplay(display) {
12021
12023
  default: return [];
12022
12024
  }
12023
12025
  }
12024
- function adaptChoices(toolName, display) {
12026
+ function adaptChoices(toolName, display, grantOptions) {
12025
12027
  if (toolName === "ExitPlanMode" || display.kind === "plan_review") return adaptPlanReviewChoices(display);
12026
- return getDefaultApprovalChoices().map((choice) => cloneChoice(choice));
12028
+ return getDefaultApprovalChoices().filter((choice) => isGrantOffered(choice, grantOptions)).map((choice) => cloneChoice(choice));
12029
+ }
12030
+ /**
12031
+ * A narrowed `grantOptions` list drops the grants it does not offer — e.g. a
12032
+ * dangerous-command prompt offers `once` only, so the panel must not paint a
12033
+ * "allow for session" button. The response validation in the core downgrades
12034
+ * such a scope anyway; hiding the button keeps the UI from offering a choice
12035
+ * that cannot be honored. Absent list = every grant (older emitters).
12036
+ */
12037
+ function isGrantOffered(choice, grantOptions) {
12038
+ if (grantOptions === void 0) return true;
12039
+ if (choice.response === "approved") return grantOptions.includes("once");
12040
+ if (choice.response === "approved_for_session") return grantOptions.includes("session");
12041
+ return true;
12027
12042
  }
12028
12043
  function adaptPlanReviewChoices(display) {
12029
12044
  return [...display.kind === "plan_review" && display.options !== void 0 && display.options.length >= 2 ? display.options.map((option) => ({
@@ -12670,6 +12685,15 @@ var ApprovalPanelComponent = class extends Container {
12670
12685
  const title = headerFor(data.tool_name);
12671
12686
  const lines = [horizontalBar, indent(`${borderColorBold("→")} ${borderColorBold(title)}`)];
12672
12687
  if (data.source_label !== void 0 && data.source_label.length > 0) lines.push(indent(dim(truncateToWidth(data.source_label, Math.max(width - 4, 1)))));
12688
+ if (data.request_summary !== void 0 && data.request_summary.length > 0) {
12689
+ const prefix = `${t("approval.request_summary")} `;
12690
+ lines.push(indent(dim(`${prefix}${truncateToWidth(replaceTabs(data.request_summary), Math.max(width - 4 - visibleWidth(prefix), 1))}`)));
12691
+ }
12692
+ if (data.reasons !== void 0 && data.reasons.length > 0) {
12693
+ const warning = chalk.hex(this.colors.warning);
12694
+ lines.push(indent(warning(t("approval.warnings_title"))));
12695
+ for (const reason of data.reasons) lines.push(indent(warning(`· ${truncateToWidth(replaceTabs(reason), Math.max(width - 6, 1))}`)));
12696
+ }
12673
12697
  const visibleBlocks = data.display.filter((block) => !isDuplicateBriefBlock(block, data.description)).slice(0, 5);
12674
12698
  const hasPreviewable = visibleBlocks.some((block) => block.type === "diff" || block.type === "file_content");
12675
12699
  if (visibleBlocks.length > 0) {
@@ -15185,7 +15209,7 @@ var ScreamTUI = class {
15185
15209
  const card = new OnboardingCardComponent({
15186
15210
  colors: this.state.theme.colors,
15187
15211
  onConfigure: () => {
15188
- import("./dispatch-Byc9hdXF.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
15212
+ import("./dispatch-CYy-62kt.mjs").then(({ handleConnectCommand }) => handleConnectCommand(this, "")).finally(() => {
15189
15213
  this.restoreEditor();
15190
15214
  onDone?.();
15191
15215
  });
@@ -18783,7 +18807,10 @@ var WebSession = class {
18783
18807
  sourceAgentId: request.sourceAgentId,
18784
18808
  sourceAgentName: request.sourceAgentName,
18785
18809
  sourceToolName: request.sourceToolName,
18786
- sourceCapabilityMode: request.sourceCapabilityMode
18810
+ sourceCapabilityMode: request.sourceCapabilityMode,
18811
+ reasons: request.reasons,
18812
+ grantOptions: request.grantOptions,
18813
+ requestSummary: request.requestSummary
18787
18814
  });
18788
18815
  const payload = {
18789
18816
  id,
@@ -18793,7 +18820,10 @@ var WebSession = class {
18793
18820
  sourceAgentId: request.sourceAgentId,
18794
18821
  sourceAgentName: request.sourceAgentName,
18795
18822
  sourceToolName: request.sourceToolName,
18796
- sourceCapabilityMode: request.sourceCapabilityMode
18823
+ sourceCapabilityMode: request.sourceCapabilityMode,
18824
+ reasons: request.reasons,
18825
+ grantOptions: request.grantOptions,
18826
+ requestSummary: request.requestSummary
18797
18827
  };
18798
18828
  this.broadcast({
18799
18829
  type: "approval_request",
@@ -18845,7 +18875,10 @@ var WebSession = class {
18845
18875
  sourceAgentId: approval.sourceAgentId,
18846
18876
  sourceAgentName: approval.sourceAgentName,
18847
18877
  sourceToolName: approval.sourceToolName,
18848
- sourceCapabilityMode: approval.sourceCapabilityMode
18878
+ sourceCapabilityMode: approval.sourceCapabilityMode,
18879
+ reasons: approval.reasons,
18880
+ grantOptions: approval.grantOptions,
18881
+ requestSummary: approval.requestSummary
18849
18882
  })),
18850
18883
  status: this.cachedStatus ?? {
18851
18884
  model: "unknown",
@@ -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 { rn as handleConnectCommand } from "./dispatch-FYZpdI9u.mjs";
6
+ import { in as handleConnectCommand } from "./dispatch-DD5FtPHZ.mjs";
7
7
  export { handleConnectCommand };