strands-darwin 0.0.45 → 0.0.48

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.
Files changed (85) hide show
  1. package/README.md +5 -3
  2. package/README.zh-CN.md +5 -3
  3. package/dist/src/agent/permission-rules.d.ts +11 -7
  4. package/dist/src/agent/permission-rules.js +64 -7
  5. package/dist/src/agent/permission-rules.js.map +1 -1
  6. package/dist/src/agent/permission.js +21 -3
  7. package/dist/src/agent/permission.js.map +1 -1
  8. package/dist/src/agent/runtime.d.ts +41 -1
  9. package/dist/src/agent/runtime.js +80 -4
  10. package/dist/src/agent/runtime.js.map +1 -1
  11. package/dist/src/agent/session-label-write.d.ts +1 -0
  12. package/dist/src/agent/session-label-write.js +50 -0
  13. package/dist/src/agent/session-label-write.js.map +1 -0
  14. package/dist/src/agent/session-label.d.ts +19 -0
  15. package/dist/src/agent/session-label.js +112 -0
  16. package/dist/src/agent/session-label.js.map +1 -0
  17. package/dist/src/agents/child-result-text.d.ts +26 -0
  18. package/dist/src/agents/child-result-text.js +29 -0
  19. package/dist/src/agents/child-result-text.js.map +1 -0
  20. package/dist/src/agents/subagent-tool.js +6 -5
  21. package/dist/src/agents/subagent-tool.js.map +1 -1
  22. package/dist/src/agents/workflow-tool.d.ts +15 -2
  23. package/dist/src/agents/workflow-tool.js +24 -5
  24. package/dist/src/agents/workflow-tool.js.map +1 -1
  25. package/dist/src/cli-completion.d.ts +13 -0
  26. package/dist/src/cli-completion.js +161 -0
  27. package/dist/src/cli-completion.js.map +1 -0
  28. package/dist/src/cli-main.js +4 -0
  29. package/dist/src/cli-main.js.map +1 -1
  30. package/dist/src/cli-sessions.d.ts +30 -2
  31. package/dist/src/cli-sessions.js +53 -13
  32. package/dist/src/cli-sessions.js.map +1 -1
  33. package/dist/src/cli-usage.d.ts +1 -1
  34. package/dist/src/cli-usage.js +1 -0
  35. package/dist/src/cli-usage.js.map +1 -1
  36. package/dist/src/cli.js +5 -1
  37. package/dist/src/cli.js.map +1 -1
  38. package/dist/src/collaboration/local.d.ts +11 -0
  39. package/dist/src/collaboration/local.js +23 -4
  40. package/dist/src/collaboration/local.js.map +1 -1
  41. package/dist/src/commands/custom-commands.d.ts +8 -1
  42. package/dist/src/commands/custom-commands.js +23 -1
  43. package/dist/src/commands/custom-commands.js.map +1 -1
  44. package/dist/src/dev-repl.js +4 -1
  45. package/dist/src/dev-repl.js.map +1 -1
  46. package/dist/src/headless-protocol.d.ts +1 -1
  47. package/dist/src/headless-protocol.js +5 -0
  48. package/dist/src/headless-protocol.js.map +1 -1
  49. package/dist/src/headless-runner.js +5 -0
  50. package/dist/src/headless-runner.js.map +1 -1
  51. package/dist/src/headless.js +5 -0
  52. package/dist/src/headless.js.map +1 -1
  53. package/dist/src/mcp/prompts.d.ts +179 -0
  54. package/dist/src/mcp/prompts.js +349 -0
  55. package/dist/src/mcp/prompts.js.map +1 -0
  56. package/dist/src/mcp/registry.d.ts +8 -1
  57. package/dist/src/mcp/registry.js +3 -1
  58. package/dist/src/mcp/registry.js.map +1 -1
  59. package/dist/src/tools/file-editor-serial.d.ts +5 -3
  60. package/dist/src/tools/file-editor-serial.js +5 -3
  61. package/dist/src/tools/file-editor-serial.js.map +1 -1
  62. package/dist/src/tui/App.js +227 -21
  63. package/dist/src/tui/App.js.map +1 -1
  64. package/dist/src/tui/InputBox.d.ts +10 -2
  65. package/dist/src/tui/InputBox.js +7 -5
  66. package/dist/src/tui/InputBox.js.map +1 -1
  67. package/dist/src/tui/external-editor.d.ts +143 -0
  68. package/dist/src/tui/external-editor.js +482 -0
  69. package/dist/src/tui/external-editor.js.map +1 -0
  70. package/dist/src/tui/help-format.d.ts +1 -1
  71. package/dist/src/tui/help-format.js +3 -3
  72. package/dist/src/tui/help-format.js.map +1 -1
  73. package/dist/src/tui/mcp-format.d.ts +2 -0
  74. package/dist/src/tui/mcp-format.js +23 -1
  75. package/dist/src/tui/mcp-format.js.map +1 -1
  76. package/dist/src/tui/prompt-editor.d.ts +21 -7
  77. package/dist/src/tui/prompt-editor.js +33 -39
  78. package/dist/src/tui/prompt-editor.js.map +1 -1
  79. package/dist/src/tui/sessions-format.d.ts +10 -0
  80. package/dist/src/tui/sessions-format.js +46 -0
  81. package/dist/src/tui/sessions-format.js.map +1 -0
  82. package/dist/src/tui/status-format.d.ts +2 -0
  83. package/dist/src/tui/status-format.js +2 -1
  84. package/dist/src/tui/status-format.js.map +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/mcp/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAA4B,MAAM,qBAAqB,CAAC;AAEjH,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAyCpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA6B;IAC7D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC5B,MAAM,UAAU,GAAI,MAAwD,CAAC,oBAAoB,CAAC;QAClG,MAAM,SAAS,GACb,UAAU,YAAY,GAAG,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,K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,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACvF,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClG,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,cAAc,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,MAAM,qCAAqC,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,QAAgB;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -10,12 +10,14 @@ export declare const MUTATING_FILE_EDITOR_COMMANDS: ReadonlySet<string>;
10
10
  * the parent's system prompt, so a child whose prompt omits the rule still sees it.
11
11
  */
12
12
  export declare const FILE_EDITOR_PAYLOAD_GUIDANCE = "Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls \u2014 never as one whole-document payload.";
13
+ /** SRF-040: whole existing content is checked before slicing or editing, not per payload. */
14
+ export declare const FILE_EDITOR_EXISTING_FILE_GUIDANCE = "The pinned SDK rejects whole existing UTF-8 file content over 1,048,576 bytes (1 MiB) for view, str_replace and insert, before slicing or editing. This existing-file ceiling is separate from the payload bound: small view ranges or replacement/insert strings do not avoid it. create does not share this existing-content check. Do not retry a known oversized file. For a known oversized generated artifact, edit an already-read, authorized source/template/generator and use its normal regeneration path only when unexpected output edits are protected; otherwise report the limitation. This is not authorization for arbitrary shell mutations, permission relaxation or cap increases.";
13
15
  /**
14
16
  * The description the runtime gives `makeFileEditor({ description })`: the SDK's own
15
- * text first, so the tool reads as the vended one, then the payload bound. The
16
- * wrapper below never touches it — it stays a projection of what it wraps.
17
+ * text first, then the separate payload and existing-file bounds. The wrapper below
18
+ * never touches it — it stays a projection of what it wraps.
17
19
  */
18
- export declare const FILE_EDITOR_DESCRIPTION = "Filesystem editor tool for viewing, creating, and editing files. Supports view (with line ranges), create, str_replace, and insert operations. Files must use absolute paths. Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls \u2014 never as one whole-document payload.";
20
+ export declare const FILE_EDITOR_DESCRIPTION = "Filesystem editor tool for viewing, creating, and editing files. Supports view (with line ranges), create, str_replace, and insert operations. Files must use absolute paths. Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls \u2014 never as one whole-document payload. The pinned SDK rejects whole existing UTF-8 file content over 1,048,576 bytes (1 MiB) for view, str_replace and insert, before slicing or editing. This existing-file ceiling is separate from the payload bound: small view ranges or replacement/insert strings do not avoid it. create does not share this existing-content check. Do not retry a known oversized file. For a known oversized generated artifact, edit an already-read, authorized source/template/generator and use its normal regeneration path only when unexpected output edits are protected; otherwise report the limitation. This is not authorization for arbitrary shell mutations, permission relaxation or cap increases.";
19
21
  export declare class SerializedFileEditorTool extends Tool {
20
22
  private readonly original;
21
23
  readonly name: string;
@@ -31,12 +31,14 @@ export const MUTATING_FILE_EDITOR_COMMANDS = new Set(['create', 'str_replace', '
31
31
  * the parent's system prompt, so a child whose prompt omits the rule still sees it.
32
32
  */
33
33
  export const FILE_EDITOR_PAYLOAD_GUIDANCE = "Keep every payload bounded: create's file_text and each str_replace/insert new_str must stay within a few thousand words, because one oversized tool-call payload can exceed what the model stream completes and the whole call is lost. Write a long document as a short skeleton (title, headings, placeholders) with create, then fill it section by section with separate str_replace/insert calls — never as one whole-document payload.";
34
+ /** SRF-040: whole existing content is checked before slicing or editing, not per payload. */
35
+ export const FILE_EDITOR_EXISTING_FILE_GUIDANCE = 'The pinned SDK rejects whole existing UTF-8 file content over 1,048,576 bytes (1 MiB) for view, str_replace and insert, before slicing or editing. This existing-file ceiling is separate from the payload bound: small view ranges or replacement/insert strings do not avoid it. create does not share this existing-content check. Do not retry a known oversized file. For a known oversized generated artifact, edit an already-read, authorized source/template/generator and use its normal regeneration path only when unexpected output edits are protected; otherwise report the limitation. This is not authorization for arbitrary shell mutations, permission relaxation or cap increases.';
34
36
  /**
35
37
  * The description the runtime gives `makeFileEditor({ description })`: the SDK's own
36
- * text first, so the tool reads as the vended one, then the payload bound. The
37
- * wrapper below never touches it — it stays a projection of what it wraps.
38
+ * text first, then the separate payload and existing-file bounds. The wrapper below
39
+ * never touches it — it stays a projection of what it wraps.
38
40
  */
39
- export const FILE_EDITOR_DESCRIPTION = `${DEFAULT_FILE_EDITOR_DESCRIPTION} ${FILE_EDITOR_PAYLOAD_GUIDANCE}`;
41
+ export const FILE_EDITOR_DESCRIPTION = `${DEFAULT_FILE_EDITOR_DESCRIPTION} ${FILE_EDITOR_PAYLOAD_GUIDANCE} ${FILE_EDITOR_EXISTING_FILE_GUIDANCE}`;
40
42
  export class SerializedFileEditorTool extends Tool {
41
43
  original;
42
44
  name;
@@ -1 +1 @@
1
- {"version":3,"file":"file-editor-serial.js","sourceRoot":"","sources":["../../../src/tools/file-editor-serial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO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AC,SAAS,CAAC,CAAC;IAClC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,6BAA6B,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IACjG,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC9C,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IACjD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
@@ -14,9 +14,10 @@ import { peerNotice, peerPrompt } from '../collaboration/protocol.js';
14
14
  * unfinished answer; while idle the first press only arms. A second press within a
15
15
  * short window exits, busy or idle. Ctrl+D always exits.
16
16
  */
17
+ import { open as openFile } from 'node:fs/promises';
17
18
  import os from 'node:os';
18
19
  import path from 'node:path';
19
- import { Box, Text, useApp, useBoxMetrics, useInput, usePaste, useStdout, useWindowSize } from 'ink';
20
+ import { Box, Text, useApp, useBoxMetrics, useInput, usePaste, useStdin, useStdout, useWindowSize } from 'ink';
20
21
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from 'react';
21
22
  import { AGENTS_FILENAME } from '../agent/instructions.js';
22
23
  import { APPROVAL_MODES, describeApprovalMode, isApprovalMode, } from '../agent/permission.js';
@@ -39,6 +40,8 @@ import { BUILTIN_COMMAND_NAMES } from '../commands/custom-commands.js';
39
40
  import { WORKFLOW_COMMAND_USAGE, parseWorkflowCommand } from '../commands/workflow-command.js';
40
41
  import { parseReviewCommand, REVIEW_COMMIT_USAGE } from '../commands/review-command.js';
41
42
  import { MCP_CONFIG_FILENAME, mcpConfigCandidates } from '../mcp/registry.js';
43
+ import { mcpPromptLoadedNotice, mcpPromptOmittedAnything } from '../mcp/prompts.js';
44
+ import { searchPreview } from './search-preview.js';
42
45
  import { DARWIN_DIRNAME } from '../paths.js';
43
46
  import { readBackgroundTail, readBackgroundTails } from '../tools/background-tail.js';
44
47
  import { formatShellEnvNotice } from '../tools/shell-env.js';
@@ -57,7 +60,7 @@ import { PermissionRulePreview, ruleReviewClaim, ruleReviewLayout } from './perm
57
60
  import { welcomeLayout } from './WelcomeHeader.js';
58
61
  import { ActiveToolCalls } from './ToolCallPanel.js';
59
62
  import { QueuedMessages } from './QueuedMessages.js';
60
- import { backspaceAtCursor, deleteAtCursor, deleteWordAfter, deleteWordBefore, insertAtCursor, killToRowEdge, layoutEditor, moveHorizontal, moveToDraftEdge, moveToRowEdge, moveVertical, moveWordHorizontal, popUndo, pushUndo, updateLastCut, LAST_CUT_OVERFLOW_NOTICE, } from './prompt-editor.js';
63
+ import { backspaceAtCursor, deleteAtCursor, deleteWordAfter, deleteWordBefore, insertAtCursor, killToRowEdge, layoutEditor, moveHorizontal, moveToDraftEdge, moveToRowEdge, moveVertical, moveWordHorizontal, normalizeDraftText, popUndo, pushUndo, updateLastCut, LAST_CUT_OVERFLOW_NOTICE, } from './prompt-editor.js';
61
64
  import { NO_WORKSPACE_PATHS, applyPathCompletion, scanWorkspacePaths, workspacePathsNote, } from './path-completion.js';
62
65
  import { promptCompletionState, visiblePromptCompletions, } from './prompt-completion.js';
63
66
  import { openPromptRecall, promptRecallIndicator, stepPromptRecall, } from './prompt-recall.js';
@@ -71,6 +74,8 @@ import { GOAL_CONDITION_MAX_CODE_POINTS, parseGoalCommand } from '../commands/go
71
74
  import { boundedReason } from '../agent/goal-check.js';
72
75
  import { GOAL_SET_NOTICE, composeGoalEvidence, goalAction, goalAfterCheck, goalAfterTurn, goalBeforeTurn, goalContinuationPrompt, goalContinued, goalLiveSuffix, goalStatusText, newGoal, } from './goal.js';
73
76
  import { composeShellReport, parseShellCommand, projectShellOutput, runShellCommand, } from './shell-command.js';
77
+ import { EXTERNAL_EDITOR_UNSET_NOTICE, canQuiesceTerminalInput, editorLabel, externalEditorRefusal, quiesceTerminalInput, resolveEditorCommand, runExternalEditor, } from './external-editor.js';
78
+ import { scrubShellEnv, withDarwinMarker } from '../tools/shell-env.js';
74
79
  import { formatTaskCompletion, formatTasksReport, runningTasksHeader } from './task-format.js';
75
80
  import { TASK_WAKE_TAIL_LINES, formatTaskNotification, formatTaskWakeUndelivered, taskNotificationFields, } from './task-wake.js';
76
81
  import { formatDispatchCancellation, formatDispatchCompletion, formatDispatchesReport, } from './subagent-format.js';
@@ -78,6 +83,7 @@ import { liveBackgroundDelegationRefusal } from '../agent/background-delegation.
78
83
  import { createContextWarnLatch, formatContextReport, formatContextReportWithBreakdown } from './context-format.js';
79
84
  import { COPY_COMMAND_USAGE, runCopyCommand } from './copy-command.js';
80
85
  import { formatHelpReport } from './help-format.js';
86
+ import { readSessionsReport } from './sessions-format.js';
81
87
  import { formatMcpReport } from './mcp-format.js';
82
88
  import { describeMode, formatPromptCache, formatPromptCacheState, formatStatusReport, formatThinking, } from './status-format.js';
83
89
  import { PlanChecklist } from './PlanChecklist.js';
@@ -106,8 +112,6 @@ const PATH_SCAN_TTL_MS = 5000;
106
112
  * guessing low costs the scrollback.
107
113
  */
108
114
  const ASSUMED_HEADER_ROWS = 14;
109
- /** C0 controls except LF and tab, plus DEL: never treated as draft text. */
110
- const NON_TEXT_CONTROLS = /[\u0000-\u0008\u000b-\u001f\u007f]/g;
111
115
  /**
112
116
  * Erase the screen, the scrollback and home the cursor — Ink's own `clearTerminal`,
113
117
  * spelled out here because `ansi-escapes` is Ink's dependency and not darwin's.
@@ -118,12 +122,9 @@ const NON_TEXT_CONTROLS = /[\u0000-\u0008\u000b-\u001f\u007f]/g;
118
122
  * different thing from one per text delta.
119
123
  */
120
124
  const CLEAR_TERMINAL = '\u001B[2J\u001B[3J\u001B[H';
121
- /** Canonicalizes terminal line endings and drops controls without losing layout. */
122
- function normalizeDraftText(value) {
123
- return value.replace(/\r+\n/g, '\n').replace(/\r/g, '\n').replace(NON_TEXT_CONTROLS, '');
124
- }
125
125
  export function App({ runtime: initialRuntime, permissions, initialHistory = [], startNewSession, startRewind, }) {
126
- const { exit: inkExit, waitUntilRenderFlush } = useApp();
126
+ const { exit: inkExit, waitUntilRenderFlush, suspendTerminal } = useApp();
127
+ const { stdin } = useStdin();
127
128
  const { columns, rows } = useWindowSize();
128
129
  const { write: writeToTerminal } = useStdout();
129
130
  // The live session. A prop at startup, state afterwards: `/clear` replaces the
@@ -155,7 +156,16 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
155
156
  ...BUILTIN_COMMAND_NAMES,
156
157
  ...runtime.info.commandNames,
157
158
  ...runtime.info.skillNames,
159
+ // SER-114: lowest precedence, after every existing entry. Names were already
160
+ // claimed against everything above, so none of these dedupes anything away.
161
+ ...runtime.info.mcpPromptCommands.map((command) => command.name),
158
162
  ])], [runtime]);
163
+ // Completion-row descriptions for MCP prompt commands: the server's bounded
164
+ // description plus the argument hint; InputBox escapes controls when drawing.
165
+ const commandDescriptions = useMemo(() => new Map(runtime.info.mcpPromptCommands.map((command) => [
166
+ command.name,
167
+ [command.argumentHint, command.description ?? `MCP prompt`].filter((part) => part !== '').join(' · '),
168
+ ])), [runtime]);
159
169
  // Escape suppresses one computed query generation, not the draft. Mirrors are
160
170
  // required for the same reason as the editor/selection mirrors: a second batched
161
171
  // key must see the first Escape before React commits its render.
@@ -229,14 +239,14 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
229
239
  */
230
240
  const applyDestructive = useCallback((edit) => {
231
241
  const current = editorRef.current;
232
- const next = edit(current);
233
- if (next.text !== current.text)
242
+ const deletion = edit(current);
243
+ if (deletion.value.text !== current.text)
234
244
  undoStack.current = pushUndo(undoStack.current, current);
235
- const cut = updateLastCut(lastCut.current, current, next);
245
+ const cut = updateLastCut(lastCut.current, current, deletion);
236
246
  lastCut.current = cut.text;
237
247
  if (cut.overflow)
238
248
  dispatch({ type: 'notice', text: LAST_CUT_OVERFLOW_NOTICE, severity: 'warn' });
239
- setEditor(next);
249
+ setEditor(deletion.value);
240
250
  }, [dispatch, setEditor]);
241
251
  // The frame's fixed furniture. Only the header is *measured*: its height depends
242
252
  // on nothing below it, so measuring it cannot oscillate. Everything else states
@@ -330,6 +340,16 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
330
340
  const clipboardReadGeneration = useRef(0);
331
341
  /** Image currently owned by one model-bound invocation, blocking reassociation. */
332
342
  const imageTurnInFlight = useRef(false);
343
+ /**
344
+ * Ctrl+G external editing (SER-113). `editorActive` is the repeated-chord fence;
345
+ * the run handle is what unmount reaps. While the terminal is released the shared
346
+ * `draining` latch is held too, so queue, peer and goal drains wait, and the Static
347
+ * history is frozen at its released length: Ink discards renders while suspended,
348
+ * so a notice committed then would advance `<Static>` past an item never printed.
349
+ */
350
+ const editorActive = useRef(false);
351
+ const editorRun = useRef(undefined);
352
+ const [heldHistory, setHeldHistory] = useState(undefined);
333
353
  /**
334
354
  * Terminal-only acknowledgement for the answer-close handoff. Dispatching a
335
355
  * reducer action proves only that React accepted it; the layout effect below
@@ -714,6 +734,9 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
714
734
  // A `!` command must not outlive the TUI that ran it: on unmount (Ctrl+D, /exit,
715
735
  // a second Ctrl+C) the group gets the same TERM→KILL reaping a cancel gives it.
716
736
  useEffect(() => () => shellRun.current?.kill(), []);
737
+ // Same for an external editor (SER-113): darwin shutdown TERM→KILLs it and removes
738
+ // its private storage synchronously, since the exit path may not await settlement.
739
+ useEffect(() => () => editorRun.current?.kill(), []);
717
740
  // Terminal window/tab title (SER-073): `darwin · <project> · <state>`, one OSC 2
718
741
  // sequence straight to the real stdout — the seam the bell uses, never Ink's
719
742
  // frame path — and only when the composed title changes, so this is a
@@ -980,13 +1003,16 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
980
1003
  lifecycleOutcome = turnAborted.current ? 'cancelled' : 'failure';
981
1004
  turnAborted.current = true;
982
1005
  // Only final failure reaches here: the exact stream continuation above
983
- // keeps its inbox. Fence admission before idle can drain another peer.
1006
+ // keeps its inbox. Drop what was already queued before idle can drain
1007
+ // it, but leave the listening incarnation in place — a turn failure is
1008
+ // not a new process, and retiring the UUID is how a long cross-project
1009
+ // session loses every peer it can send to.
984
1010
  if (lifecycleOutcome === 'failure') {
985
1011
  const local = runtime.collaboration;
986
- const wasAvailable = local?.address !== undefined || (local?.pending ?? 0) > 0;
987
- local?.close('turn failed');
988
- if (wasAvailable)
989
- dispatch({ type: 'notice', severity: 'warn', text: 'Collaboration paused after turn failure; queued peers dropped. User: /collaborate on to publish a fresh endpoint. Project grants unchanged.' });
1012
+ const queued = local?.pending ?? 0;
1013
+ local?.dropQueued('turn failed');
1014
+ if (queued > 0)
1015
+ dispatch({ type: 'notice', severity: 'warn', text: 'Queued peer messages dropped after turn failure; they are not replayed. This endpoint stays published at the same address.' });
990
1016
  }
991
1017
  // A throttled turn names how retry ended — the cap (`after N attempts`) or a
992
1018
  // wait Esc cut short — from the runtime's own outcome, never the message text.
@@ -1157,6 +1183,23 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
1157
1183
  });
1158
1184
  return;
1159
1185
  }
1186
+ // Saved snapshots in this project only. Local idle/busy before queueing; one
1187
+ // Static notice, no runtime state transition or model/tool/MCP work.
1188
+ if (/^\/sessions(?:\s|$)/.test(text)) {
1189
+ setEditor({ text: '', cursor: { offset: 0, affinity: 'downstream' } });
1190
+ setSelectedCompletion(0);
1191
+ if (text !== '/sessions') {
1192
+ dispatch({ type: 'notice', text: '/sessions takes no arguments' });
1193
+ return;
1194
+ }
1195
+ try {
1196
+ dispatch({ type: 'notice', text: await readSessionsReport(runtime.info.projectRoot) });
1197
+ }
1198
+ catch {
1199
+ dispatch({ type: 'notice', text: 'could not list saved sessions in this project' });
1200
+ }
1201
+ return;
1202
+ }
1160
1203
  // SER-057: the last *completed* answer's transcript text onto the clipboard —
1161
1204
  // OSC 52 through Ink's own stdout writer first (this is usually an SSH session),
1162
1205
  // the platform tool only when a display is present. Before the busy guard like
@@ -1491,6 +1534,15 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
1491
1534
  });
1492
1535
  return;
1493
1536
  }
1537
+ // User-only display metadata. Read the untrimmed suffix so exterior controls
1538
+ // cannot disappear in submit's ordinary trim; never send or queue this command.
1539
+ if (/^\/rename(?:\s|$)/.test(text)) {
1540
+ setEditor({ text: '', cursor: { offset: 0, affinity: 'downstream' } });
1541
+ setSelectedCompletion(0);
1542
+ const suffix = raw.trimStart().slice('/rename'.length);
1543
+ dispatch({ type: 'notice', text: await runtime.renameSession(suffix) });
1544
+ return;
1545
+ }
1494
1546
  // One consolidated read of state the session already holds (SER-026), on the
1495
1547
  // /mcp precedent: a formatter over existing accessors, never a new information
1496
1548
  // channel — no model call, no connection attempt, no mutation. Above the busy
@@ -1520,6 +1572,7 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
1520
1572
  text: formatStatusReport({
1521
1573
  config: runtime.config,
1522
1574
  sessionId: runtime.info.sessionId,
1575
+ sessionLabel: runtime.sessionLabel,
1523
1576
  resumed: runtime.info.resumed,
1524
1577
  promptCache: runtime.promptCache,
1525
1578
  thinking: runtime.thinking,
@@ -1936,6 +1989,15 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
1936
1989
  // Skills and project commands send their expanded prompt instead of the
1937
1990
  // literal command. Unknown slash input falls through as ordinary input.
1938
1991
  let toSend = text;
1992
+ // SER-114: an MCP prompt is the one expansion that waits on a server. Hold the
1993
+ // session busy meanwhile — submissions queue, Ctrl+C reaches `runtime.cancel()`,
1994
+ // which aborts the `prompts/get` — exactly like the goal check's busy state.
1995
+ const fetchingMcpPrompt = runtime.isMcpPromptCommand(text);
1996
+ if (fetchingMcpPrompt) {
1997
+ turnAborted.current = false;
1998
+ turnStartedAt.current = Date.now();
1999
+ setStatus('streaming');
2000
+ }
1939
2001
  try {
1940
2002
  const expanded = await runtime.expandSlashCommand(text);
1941
2003
  if (expanded !== null) {
@@ -1951,12 +2013,19 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
1951
2013
  ? expanded.message.startsWith('Review commit ')
1952
2014
  ? 'reviewing commit with /review'
1953
2015
  : 'reviewing current changes with /review'
1954
- : `loaded command "/${expanded.command.name}"`,
2016
+ : expanded.kind === 'mcp-prompt'
2017
+ ? mcpPromptLoadedNotice(expanded)
2018
+ : `loaded command "/${expanded.command.name}"`,
2019
+ ...(expanded.kind === 'mcp-prompt' && mcpPromptOmittedAnything(expanded.omitted) ? { severity: 'warn' } : {}),
1955
2020
  });
1956
2021
  toSend = expanded.message;
1957
2022
  }
1958
2023
  }
1959
2024
  catch (error) {
2025
+ if (fetchingMcpPrompt) {
2026
+ turnStartedAt.current = undefined;
2027
+ setStatus('idle');
2028
+ }
1960
2029
  dispatch({
1961
2030
  type: 'notice',
1962
2031
  text: `could not expand ${text}: ${error instanceof Error ? error.message : String(error)}; prompt not sent — restored to the editor`,
@@ -2446,6 +2515,134 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
2446
2515
  if (opened.text !== undefined)
2447
2516
  applyRecalled(opened.text);
2448
2517
  }, [applyRecalled, history, setRecall]);
2518
+ /**
2519
+ * Ctrl+G (SER-113): edit the exact unsent draft in the user's VISUAL/EDITOR. Eligible
2520
+ * only at idle with nothing about to claim the session; the editor gets the terminal
2521
+ * through Ink's `suspendTerminal`, darwin's own tty reads are paused for its lifetime
2522
+ * (see `quiesceTerminalInput`), and drains hold behind the shared `draining` latch.
2523
+ * A valid changed result replaces the draft, cursor at the end, and stays unsent.
2524
+ * Everything else — refusal, launch failure, nonzero/signal exit, invalid output or
2525
+ * no change — leaves the draft, cursor and image exactly as they were.
2526
+ */
2527
+ const openExternalEditor = useCallback(() => {
2528
+ if (historySearchRef.current !== undefined || rewindSearchRef.current !== undefined)
2529
+ return;
2530
+ const goalOwed = goalAction(goalRef.current, {
2531
+ idle: true, permissionPending: false, clearing: false, draining: false, queued: 0, peerPending: 0,
2532
+ }) !== 'none';
2533
+ const refusal = externalEditorRefusal({
2534
+ editorActive: editorActive.current,
2535
+ idle: status === 'idle' && pendingPermission === undefined,
2536
+ queued: queuedRef.current.length,
2537
+ draining: draining.current,
2538
+ clearing: clearing.current,
2539
+ goalOwed,
2540
+ peerPending: runtime.collaboration?.pending ?? 0,
2541
+ liveDelegations: runtime.listBackgroundDelegations().length,
2542
+ });
2543
+ if (refusal === 'ignore')
2544
+ return;
2545
+ if (refusal !== undefined) {
2546
+ dispatch({ type: 'notice', text: refusal, severity: 'warn' });
2547
+ return;
2548
+ }
2549
+ const command = resolveEditorCommand(process.env);
2550
+ if (command.kind === 'unset') {
2551
+ dispatch({ type: 'notice', text: EXTERNAL_EDITOR_UNSET_NOTICE, severity: 'warn' });
2552
+ return;
2553
+ }
2554
+ if (command.kind === 'refused') {
2555
+ dispatch({ type: 'notice', text: `${command.source} not used: it ${command.reason} — draft unchanged`, severity: 'warn' });
2556
+ return;
2557
+ }
2558
+ if (!stdin.isTTY || !canQuiesceTerminalInput(stdin)) {
2559
+ dispatch({ type: 'notice', text: 'Ctrl+G needs an interactive terminal darwin can hand over safely — draft unchanged', severity: 'warn' });
2560
+ return;
2561
+ }
2562
+ const original = editorRef.current;
2563
+ const label = editorLabel(command.argv);
2564
+ // The same sanitized map the model's `bash` gets, plus `DARWIN=1` (SER-082/094).
2565
+ const env = withDarwinMarker(scrubShellEnv(process.env, runtime.info.shellEnv.passthrough).env);
2566
+ const cwd = runtime.info.projectRoot;
2567
+ editorActive.current = true;
2568
+ draining.current = true;
2569
+ // A clipboard read still pending must not attach while (or after) the draft is away.
2570
+ clipboardReadGeneration.current += 1;
2571
+ setHeldHistory(historyRef.current);
2572
+ void (async () => {
2573
+ let outcome;
2574
+ let failure;
2575
+ let restartInput = () => { };
2576
+ try {
2577
+ // Let Ink finish the input batch that carried Ctrl+G and commit the held history.
2578
+ await waitUntilRenderFlush();
2579
+ // A fresh description of the controlling terminal: whatever the editor does to
2580
+ // its file status flags (O_NONBLOCK) cannot leak into darwin's own stdin.
2581
+ const terminal = await openFile('/dev/tty', 'r+').catch(() => undefined);
2582
+ try {
2583
+ await suspendTerminal(async () => {
2584
+ restartInput = await quiesceTerminalInput(stdin);
2585
+ const run = runExternalEditor(original.text, {
2586
+ argv: command.argv,
2587
+ cwd,
2588
+ env,
2589
+ normalize: normalizeDraftText,
2590
+ projectRoot: cwd,
2591
+ ...(terminal === undefined ? {} : { terminalFd: terminal.fd }),
2592
+ });
2593
+ editorRun.current = run;
2594
+ outcome = await run.done;
2595
+ });
2596
+ }
2597
+ finally {
2598
+ editorRun.current = undefined;
2599
+ await terminal?.close().catch(() => undefined);
2600
+ }
2601
+ }
2602
+ catch (error) {
2603
+ failure = error instanceof Error ? error.message : String(error);
2604
+ }
2605
+ finally {
2606
+ // Shutdown leaves darwin's terminal reads stopped on purpose.
2607
+ if (presentationMounted.current)
2608
+ restartInput();
2609
+ setHeldHistory(undefined);
2610
+ editorActive.current = false;
2611
+ draining.current = false;
2612
+ setDrainCycle((cycle) => cycle + 1);
2613
+ }
2614
+ if (!presentationMounted.current)
2615
+ return;
2616
+ if (outcome === undefined) {
2617
+ dispatch({ type: 'notice', text: `external editor failed: ${failure ?? 'no result'} — draft unchanged`, severity: 'warn' });
2618
+ }
2619
+ else if (outcome.kind === 'changed') {
2620
+ if (editorRef.current !== original) {
2621
+ dispatch({ type: 'notice', text: 'the draft changed while the editor was open; editor result discarded', severity: 'warn' });
2622
+ }
2623
+ else {
2624
+ // A different draft: undo/cut/recall/completion state belonged to the old one.
2625
+ undoStack.current = [];
2626
+ lastCut.current = '';
2627
+ preferredColumn.current = undefined;
2628
+ setRecall(undefined);
2629
+ setDismissedCompletion(undefined);
2630
+ setSelectedCompletion(0);
2631
+ setEditor({ text: outcome.text, cursor: moveToDraftEdge(outcome.text, 'end') });
2632
+ dispatch({ type: 'notice', text: `draft replaced from ${label} — not sent; Enter sends it` });
2633
+ }
2634
+ }
2635
+ else if (outcome.kind === 'unchanged') {
2636
+ dispatch({ type: 'notice', text: `${label} closed without changes — draft unchanged` });
2637
+ }
2638
+ else {
2639
+ dispatch({ type: 'notice', text: `external editor: ${outcome.reason} — draft unchanged`, severity: 'warn' });
2640
+ }
2641
+ if (outcome?.cleanupProblem !== undefined) {
2642
+ dispatch({ type: 'notice', text: `external editor storage: ${outcome.cleanupProblem}`, severity: 'warn' });
2643
+ }
2644
+ })();
2645
+ }, [dispatch, pendingPermission, runtime, setDismissedCompletion, setEditor, setRecall, setSelectedCompletion, status, stdin, suspendTerminal, waitUntilRenderFlush]);
2449
2646
  const handleInterrupt = useCallback(() => {
2450
2647
  const now = Date.now();
2451
2648
  const previous = interruptedAt.current;
@@ -2625,6 +2822,13 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
2625
2822
  }
2626
2823
  return;
2627
2824
  }
2825
+ // External editor (SER-113): composer ownership like Ctrl+S/Ctrl+O, below the
2826
+ // permission, compaction and search owners. Eligibility and the repeated-chord
2827
+ // fence live in `openExternalEditor`.
2828
+ if (key.ctrl && typed === 'g') {
2829
+ openExternalEditor();
2830
+ return;
2831
+ }
2628
2832
  // Escape belongs to the highest transient prompt UI currently shown. A menu
2629
2833
  // wins over recall just as it wins the arrow keys; neither branch touches the
2630
2834
  // editor, submits, dispatches, or changes the queue/runtime. The dismissed query
@@ -2912,7 +3116,7 @@ export function App({ runtime: initialRuntime, permissions, initialHistory = [],
2912
3116
  setSelectedCompletion(0);
2913
3117
  endRecall();
2914
3118
  });
2915
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MessageList, { history: state.history, ...(state.staticEpoch === 0 ? { welcome: initialWelcome } : {}), liveText: state.liveText, liveCodeOpen: fenceOpenAfter(state.committedAnswer), columns: columns, maxLiveRows: grants.live, staticEpoch: state.staticEpoch }), _jsx(Box, { ref: headerRef, flexDirection: "column", children: _jsx(Header, { runtime: runtime, status: effectiveStatus, frame: frame, tangent: tangent, goal: goal, runningTaskCount: runningTaskCount, draftStashed: statusHint === undefined && draftStash !== undefined }) }), _jsxs(Box, { ref: chromeRef, flexDirection: "column", children: [state.thinking && effectiveStatus === 'streaming' && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: `thinking…${busyElapsedMs === undefined ? '' : busySuffix(busyElapsedMs, undefined, busyRetryWait)}` })), _jsx(ActiveToolCalls, { tools: state.activeTools, frame: frame, toolDetailsExpanded: state.toolDetailsExpanded, columns: columns, maxRows: grants.tools }), _jsx(PlanChecklist, { plan: state.livePlan, maxRows: grants.plan }), _jsx(QueuedMessages, { entries: queued, maxRows: grants.queued }), activeRuleReview !== undefined ? _jsx(PermissionRulePreview, { review: activeRuleReview }) : pendingPermission !== undefined ? (_jsx(PermissionPrompt, { request: pendingPermission, waiting: permissions.waiting, columns: columns, maxRows: grants.prompt })) : (_jsx(InputBox, { layout: layout, completions: completions, completionKind: completionKind, completionNote: completionNote, selectedCompletion: selectedCompletion, editable: effectiveStatus !== 'compacting', offset: { top: chrome.top, left: chrome.left }, maxRows: grants.prompt, hint: streamingHint, attachment: attachedImage === undefined ? undefined : clipboardImageFact(attachedImage), recallIndicator: recallIndicator, historySearch: historySearchProjection, rewindSearch: rewindSearchProjection }))] })] }));
3119
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MessageList, { history: heldHistory ?? state.history, ...(state.staticEpoch === 0 ? { welcome: initialWelcome } : {}), liveText: state.liveText, liveCodeOpen: fenceOpenAfter(state.committedAnswer), columns: columns, maxLiveRows: grants.live, staticEpoch: state.staticEpoch }), _jsx(Box, { ref: headerRef, flexDirection: "column", children: _jsx(Header, { runtime: runtime, status: effectiveStatus, frame: frame, tangent: tangent, goal: goal, runningTaskCount: runningTaskCount, draftStashed: statusHint === undefined && draftStash !== undefined }) }), _jsxs(Box, { ref: chromeRef, flexDirection: "column", children: [state.thinking && effectiveStatus === 'streaming' && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: `thinking…${busyElapsedMs === undefined ? '' : busySuffix(busyElapsedMs, undefined, busyRetryWait)}` })), _jsx(ActiveToolCalls, { tools: state.activeTools, frame: frame, toolDetailsExpanded: state.toolDetailsExpanded, columns: columns, maxRows: grants.tools }), _jsx(PlanChecklist, { plan: state.livePlan, maxRows: grants.plan }), _jsx(QueuedMessages, { entries: queued, maxRows: grants.queued }), activeRuleReview !== undefined ? _jsx(PermissionRulePreview, { review: activeRuleReview }) : pendingPermission !== undefined ? (_jsx(PermissionPrompt, { request: pendingPermission, waiting: permissions.waiting, columns: columns, maxRows: grants.prompt })) : (_jsx(InputBox, { layout: layout, completions: completions, completionKind: completionKind, completionNote: completionNote, commandDescriptions: commandDescriptions, selectedCompletion: selectedCompletion, editable: effectiveStatus !== 'compacting', shellMode: parseShellCommand(draft) !== undefined, offset: { top: chrome.top, left: chrome.left }, maxRows: grants.prompt, hint: streamingHint, attachment: attachedImage === undefined ? undefined : clipboardImageFact(attachedImage), recallIndicator: recallIndicator, historySearch: historySearchProjection, rewindSearch: rewindSearchProjection }))] })] }));
2916
3120
  }
2917
3121
  /** The hint row under the draft, or nothing when the session is idle. */
2918
3122
  function hintForStatus(status, busyReadout, queuedCount = 0, queuedWakeCount = 0, goalSuffix = '') {
@@ -2973,9 +3177,11 @@ export function Header({ runtime, status = 'idle', frame = 0, tangent, goal, run
2973
3177
  const tangentSuffix = tangentHeaderSuffix(tangent) + goalLiveSuffix(goal);
2974
3178
  const activity = runningTasksHeader(runningTaskCount, columns - `◆ DARWIN · ${stateLabel}${tangentSuffix}`.length, frame);
2975
3179
  return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { wrap: "truncate-end", children: [_jsxs(Text, { color: visualColor.identity, bold: true, children: [visualMarker.identity, " DARWIN"] }), _jsxs(Text, { dimColor: true, children: [' · ', status === 'streaming' ? _jsx(WorkingStatus, { frame: frame }) : headerStatus(status), tangentSuffix] }), _jsx(Text, { color: visualColor.active, children: activity.label }), _jsx(Text, { dimColor: true, children: activity.hint })] }), _jsxs(Text, { dimColor: true, children: [runtime.config.provider, "/", runtime.config.model, " \u00B7 session ", info.sessionId, info.resumed ? ' (resumed)' : '', formatPromptCache(runtime.promptCache), formatThinking(runtime.thinking)] }), mode === 'yolo' ? (_jsxs(Text, { color: visualColor.warning, children: ["mode: ", describeMode(mode, runtime.allowRuleCount, runtime.denyRuleCount)] })) : mode === 'plan' ? (_jsxs(Text, { color: visualColor.warning, children: ["mode: ", describeMode(mode, runtime.allowRuleCount, runtime.denyRuleCount)] })) : (_jsxs(Text, { dimColor: true, children: ["mode: ", describeMode(mode, runtime.allowRuleCount, runtime.denyRuleCount)] })), instructions !== undefined &&
2976
- (instructions.truncated ? (_jsx(Text, { color: visualColor.warning, children: formatInstructionsLoadedRow(instructions) })) : (_jsx(Text, { dimColor: true, children: formatInstructionsLoadedRow(instructions) }))), info.projectInstructionsProblem !== undefined && (_jsx(Text, { color: visualColor.warning, children: formatInstructionsProblemRow(info.projectInstructionsProblemFile ?? AGENTS_FILENAME, info.projectInstructionsProblem) })), info.systemPromptSource === 'config' && (_jsxs(Text, { dimColor: true, children: ["system prompt: overridden by ", DARWIN_DIRNAME, "/", CONFIG_FILENAME] })), info.systemPromptSource === 'file' && (_jsxs(Text, { dimColor: true, children: ["system prompt: ", DARWIN_DIRNAME, "/", SYSTEM_PROMPT_FILENAME] })), info.systemPromptProblem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["system prompt: using the default \u2014 ", info.systemPromptProblem] })), info.workingContextProblem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["working context: no directory listing \u2014 ", info.workingContextProblem] })), info.promptCache.problem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["prompt cache: off \u2014 ", info.promptCache.problem] })), runtime.thinking.problem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["thinking: ", runtime.thinking.problem] })), hasCapabilities(info) && (_jsxs(Text, { dimColor: true, children: ["loaded: ", formatCapabilities(info), " \u00B7 type / for commands"] })), info.mcpIgnoredConfigPath !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["mcp: using ", DARWIN_DIRNAME, "/", MCP_CONFIG_FILENAME, " \u2014 ", info.mcpIgnoredConfigPath, " ignored"] })), info.hookShadowNotices.map((notice) => (_jsxs(Text, { color: visualColor.warning, wrap: "truncate-end", children: ["hooks: ", notice.layer, " ", notice.directory, " shadows ", notice.shadowed.join(', ')] }, notice.directory))), info.skillProblems.map((problem) => (_jsxs(Text, { color: visualColor.warning, children: ["skill skipped: ", problem.directory, " \u2014 ", problem.reason] }, problem.directory))), info.commandProblems.map((problem) => (_jsxs(Text, { color: visualColor.warning, children: ["command skipped: ", problem.file, " \u2014 ", problem.reason] }, problem.file))), info.agentProblems.map((problem) => (_jsxs(Text, { color: visualColor.warning, children: ["agent skipped: ", problem.file, " \u2014 ", problem.reason] }, problem.file))), _jsx(Text, { dimColor: true, children: stashHint('/ for actions · @ for paths · ctrl+c cancels · /exit quits', draftStashed, columns) })] }));
3180
+ (instructions.truncated ? (_jsx(Text, { color: visualColor.warning, children: formatInstructionsLoadedRow(instructions) })) : (_jsx(Text, { dimColor: true, children: formatInstructionsLoadedRow(instructions) }))), info.projectInstructionsProblem !== undefined && (_jsx(Text, { color: visualColor.warning, children: formatInstructionsProblemRow(info.projectInstructionsProblemFile ?? AGENTS_FILENAME, info.projectInstructionsProblem) })), info.systemPromptSource === 'config' && (_jsxs(Text, { dimColor: true, children: ["system prompt: overridden by ", DARWIN_DIRNAME, "/", CONFIG_FILENAME] })), info.systemPromptSource === 'file' && (_jsxs(Text, { dimColor: true, children: ["system prompt: ", DARWIN_DIRNAME, "/", SYSTEM_PROMPT_FILENAME] })), info.systemPromptProblem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["system prompt: using the default \u2014 ", info.systemPromptProblem] })), info.workingContextProblem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["working context: no directory listing \u2014 ", info.workingContextProblem] })), info.promptCache.problem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["prompt cache: off \u2014 ", info.promptCache.problem] })), runtime.thinking.problem !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["thinking: ", runtime.thinking.problem] })), hasCapabilities(info) && (_jsxs(Text, { dimColor: true, children: ["loaded: ", formatCapabilities(info), " \u00B7 type / for commands"] })), info.mcpIgnoredConfigPath !== undefined && (_jsxs(Text, { color: visualColor.warning, children: ["mcp: using ", DARWIN_DIRNAME, "/", MCP_CONFIG_FILENAME, " \u2014 ", info.mcpIgnoredConfigPath, " ignored"] })), info.hookShadowNotices.map((notice) => (_jsxs(Text, { color: visualColor.warning, wrap: "truncate-end", children: ["hooks: ", notice.layer, " ", notice.directory, " shadows ", notice.shadowed.join(', ')] }, notice.directory))), info.skillProblems.map((problem) => (_jsxs(Text, { color: visualColor.warning, children: ["skill skipped: ", problem.directory, " \u2014 ", problem.reason] }, problem.directory))), info.commandProblems.map((problem) => (_jsxs(Text, { color: visualColor.warning, children: ["command skipped: ", problem.file, " \u2014 ", problem.reason] }, problem.file))), info.mcpPromptProblems.slice(0, MAX_MCP_PROMPT_PROBLEM_ROWS).map((problem, index) => (_jsx(Text, { color: visualColor.warning, wrap: "truncate-end", children: searchPreview(problem) }, `mcp-prompt-${index}`))), info.mcpPromptProblems.length > MAX_MCP_PROMPT_PROBLEM_ROWS && (_jsxs(Text, { color: visualColor.warning, wrap: "truncate-end", children: ["\u2026 ", info.mcpPromptProblems.length - MAX_MCP_PROMPT_PROBLEM_ROWS, " more MCP prompt problems \u2014 /mcp shows per-server counts"] })), info.agentProblems.map((problem) => (_jsxs(Text, { color: visualColor.warning, children: ["agent skipped: ", problem.file, " \u2014 ", problem.reason] }, problem.file))), _jsx(Text, { dimColor: true, children: stashHint('/ for actions · @ for paths · ctrl+c cancels · /exit quits', draftStashed, columns) })] }));
2977
3181
  }
2978
3182
  const WORKING_LABEL = 'working';
3183
+ /** Startup header rows for MCP prompt problems before one `… N more` row (SER-114). */
3184
+ const MAX_MCP_PROMPT_PROBLEM_ROWS = 3;
2979
3185
  /** Highlights one letter in place, preserving the header's exact width and row count. */
2980
3186
  export function workingStatusIndex(frame) {
2981
3187
  return frame % WORKING_LABEL.length;