strands-darwin 0.0.52 → 0.0.53

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 (52) hide show
  1. package/README.md +9 -2
  2. package/README.zh-CN.md +9 -2
  3. package/dist/patches/{@strands-agents+sdk+1.20.0.patch → @strands-agents+sdk+1.21.0.patch} +9 -9
  4. package/dist/src/agent/compact.js +1 -1
  5. package/dist/src/agent/prompt-suggestion.d.ts +22 -0
  6. package/dist/src/agent/prompt-suggestion.js +120 -0
  7. package/dist/src/agent/prompt-suggestion.js.map +1 -0
  8. package/dist/src/agent/runtime.d.ts +8 -0
  9. package/dist/src/agent/runtime.js +50 -2
  10. package/dist/src/agent/runtime.js.map +1 -1
  11. package/dist/src/agent/session-recap.d.ts +30 -0
  12. package/dist/src/agent/session-recap.js +98 -0
  13. package/dist/src/agent/session-recap.js.map +1 -0
  14. package/dist/src/cli-main.js +5 -1
  15. package/dist/src/cli-main.js.map +1 -1
  16. package/dist/src/commands/custom-commands.d.ts +1 -1
  17. package/dist/src/commands/custom-commands.js +2 -1
  18. package/dist/src/commands/custom-commands.js.map +1 -1
  19. package/dist/src/commands/recap-command.d.ts +4 -0
  20. package/dist/src/commands/recap-command.js +10 -0
  21. package/dist/src/commands/recap-command.js.map +1 -0
  22. package/dist/src/commands/review-command.d.ts +3 -1
  23. package/dist/src/commands/review-command.js +21 -2
  24. package/dist/src/commands/review-command.js.map +1 -1
  25. package/dist/src/config.d.ts +11 -2
  26. package/dist/src/config.js +25 -15
  27. package/dist/src/config.js.map +1 -1
  28. package/dist/src/dev-repl.js +7 -4
  29. package/dist/src/dev-repl.js.map +1 -1
  30. package/dist/src/headless-runner.js +4 -3
  31. package/dist/src/headless-runner.js.map +1 -1
  32. package/dist/src/npm-package/patch-package-format.d.ts +5 -5
  33. package/dist/src/npm-package/patch-package-format.js +4 -4
  34. package/dist/src/sdk-patch-preflight.js +1 -1
  35. package/dist/src/tui/App.d.ts +3 -1
  36. package/dist/src/tui/App.js +211 -14
  37. package/dist/src/tui/App.js.map +1 -1
  38. package/dist/src/tui/InputBox.d.ts +4 -2
  39. package/dist/src/tui/InputBox.js +3 -3
  40. package/dist/src/tui/InputBox.js.map +1 -1
  41. package/dist/src/tui/help-format.d.ts +1 -1
  42. package/dist/src/tui/help-format.js +1 -1
  43. package/dist/src/tui/prompt-suggestion.d.ts +31 -0
  44. package/dist/src/tui/prompt-suggestion.js +65 -0
  45. package/dist/src/tui/prompt-suggestion.js.map +1 -0
  46. package/dist/src/tui/session-recap.d.ts +36 -0
  47. package/dist/src/tui/session-recap.js +109 -0
  48. package/dist/src/tui/session-recap.js.map +1 -0
  49. package/dist/src/tui/terminal-focus.d.ts +29 -0
  50. package/dist/src/tui/terminal-focus.js +128 -0
  51. package/dist/src/tui/terminal-focus.js.map +1 -0
  52. package/package.json +3 -3
@@ -14,7 +14,7 @@ import type { EditorLayout } from './prompt-editor.js';
14
14
  * "… n more" row — a workspace has more paths than any menu could hold, so for them
15
15
  * that row is the normal case rather than the overflow one.
16
16
  */
17
- export declare const MAX_COMPLETIONS = 31;
17
+ export declare const MAX_COMPLETIONS = 32;
18
18
  /**
19
19
  * Which source the offered rows came from.
20
20
  *
@@ -38,8 +38,10 @@ export interface CompletionWindow {
38
38
  export declare function completionWindow(total: number, selected: number, capacity: number): CompletionWindow;
39
39
  /** One counted row truthfully states every candidate outside the visible window. */
40
40
  export declare function hiddenCompletionNotice(hiddenAbove: number, hiddenBelow: number): string;
41
- export declare function InputBox({ layout, completions, completionKind, completionNote, commandDescriptions, selectedCompletion, editable, shellMode, hint, attachment, recallIndicator, historySearch, rewindSearch, offset, maxRows, }: {
41
+ export declare function InputBox({ layout, suggestion, completions, completionKind, completionNote, commandDescriptions, selectedCompletion, editable, shellMode, hint, attachment, recallIndicator, historySearch, rewindSearch, offset, maxRows, }: {
42
42
  readonly layout: EditorLayout;
43
+ /** Fully visible advisory text in an empty draft row; never editor content. */
44
+ readonly suggestion?: string | undefined;
43
45
  readonly completions: readonly string[];
44
46
  readonly completionKind: CompletionKind;
45
47
  /**
@@ -18,7 +18,7 @@ import { visualColor, visualMarker } from './visual-language.js';
18
18
  * "… n more" row — a workspace has more paths than any menu could hold, so for them
19
19
  * that row is the normal case rather than the overflow one.
20
20
  */
21
- export const MAX_COMPLETIONS = 31;
21
+ export const MAX_COMPLETIONS = 32;
22
22
  /** The selected full-list index, with stale state falling back to the first row. */
23
23
  export function completionSelection(selected, total) {
24
24
  return Number.isInteger(selected) && selected >= 0 && selected < total ? selected : 0;
@@ -61,7 +61,7 @@ function hiddenSearchNotice(hiddenAbove, hiddenBelow) {
61
61
  parts.push(`${hiddenBelow} older`);
62
62
  return `… ${hiddenAbove + hiddenBelow} matches not shown (${parts.join(', ')})`;
63
63
  }
64
- export function InputBox({ layout, completions, completionKind, completionNote, commandDescriptions, selectedCompletion, editable, shellMode = false, hint, attachment, recallIndicator, historySearch, rewindSearch, offset, maxRows, }) {
64
+ export function InputBox({ layout, suggestion, completions, completionKind, completionNote, commandDescriptions, selectedCompletion, editable, shellMode = false, hint, attachment, recallIndicator, historySearch, rewindSearch, offset, maxRows, }) {
65
65
  const activeSearch = rewindSearch ?? historySearch;
66
66
  const offered = Math.min(completions.length, MAX_COMPLETIONS);
67
67
  const plan = planPromptBox({
@@ -102,7 +102,7 @@ export function InputBox({ layout, completions, completionKind, completionNote,
102
102
  y: offset.top + metrics.top + (view.notice ? 1 : 0) + (layout.cursor.row - view.start),
103
103
  }
104
104
  : undefined);
105
- return (_jsxs(Box, { ref: inputRef, flexDirection: "column", "aria-role": "textbox", "aria-state": { multiline: true, disabled: !editable }, children: [view.notice && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: hiddenDraftNotice(view.hiddenAbove, view.hiddenBelow) })), rows.map((row, index) => (_jsxs(Box, { children: [_jsx(Text, { ...(editable && row.prefix !== ' ' ? { color: shellMode ? visualColor.warning : visualColor.identity } : {}), bold: editable && row.prefix !== ' ', dimColor: !editable || row.prefix === ' ', children: shellMode && row.prefix === 'you> ' ? 'cmd> ' : row.prefix }), _jsx(Text, { dimColor: !editable, wrap: "truncate-end", children: row.text })] }, `${row.start}:${index}`))), attachment !== undefined && plan.attachment && (_jsx(Text, { color: visualColor.active, bold: true, wrap: "truncate-end", children: attachment })), activeSearch !== undefined && plan.search && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { dimColor: true, wrap: "truncate-end", children: activeSearch.title }), visibleSearchMatches.map((match, index) => {
105
+ return (_jsxs(Box, { ref: inputRef, flexDirection: "column", "aria-role": "textbox", "aria-state": { multiline: true, disabled: !editable }, children: [view.notice && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: hiddenDraftNotice(view.hiddenAbove, view.hiddenBelow) })), rows.map((row, index) => (_jsxs(Box, { children: [_jsx(Text, { ...(editable && row.prefix !== ' ' ? { color: shellMode ? visualColor.warning : visualColor.identity } : {}), bold: editable && row.prefix !== ' ', dimColor: !editable || row.prefix === ' ', children: shellMode && row.prefix === 'you> ' ? 'cmd> ' : row.prefix }), _jsx(Text, { dimColor: !editable || suggestion !== undefined, wrap: "truncate-end", children: suggestion ?? row.text })] }, `${row.start}:${index}`))), attachment !== undefined && plan.attachment && (_jsx(Text, { color: visualColor.active, bold: true, wrap: "truncate-end", children: attachment })), activeSearch !== undefined && plan.search && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { dimColor: true, wrap: "truncate-end", children: activeSearch.title }), visibleSearchMatches.map((match, index) => {
106
106
  const selected = searchWindow !== undefined && index === searchWindow.selected - searchWindow.start;
107
107
  return (_jsxs(Text, { ...(selected ? { color: visualColor.active } : {}), bold: selected, dimColor: !selected, wrap: "truncate-end", children: [selected ? `${visualMarker.completion} ` : ' ', match] }, `${index}:${match}`));
108
108
  }), plan.searchMore && (_jsxs(Text, { dimColor: true, wrap: "truncate-end", children: [' ', hiddenSearchNotice(activeSearch.hiddenAbove + (searchWindow?.hiddenAbove ?? 0), activeSearch.hiddenBelow + (searchWindow?.hiddenBelow ?? 0))] }))] })), recallIndicator !== undefined && plan.recall && (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: recallIndicator })), visible.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { dimColor: true, wrap: "truncate-end", children: completionTitle(completionKind, completionNote) }), visible.map((name, index) => {
@@ -1 +1 @@
1
- {"version":3,"file":"InputBox.js","sourceRoot":"","sources":["../../../src/tui/InputBox.tsx"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAmB,MAAM,KAAK,CAAC;AAC3E,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAWlC,oFAAoF;AACpF,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,KAAa;IACjE,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,uBAAuB,CAAC,QAAgB,EAAE,KAAa,EAAE,KAAa;IACpF,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACzB,OAAO,CAAC,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,GAA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,IAAI,GAAQ,GAC5C,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAoB,EAAE,IAAwB;IAC5E,MAAM,IAAI,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IACvD,MAAM,IAAI,GAAG,gCAAgC,CAAC;IAC9C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,OAAO,IAAI,GAAG,CAAC;AACpF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /** Hard report bounds: help is transcript history, never an unbounded catalogue dump. */
2
- export declare const MAX_HELP_COMMANDS = 31;
2
+ export declare const MAX_HELP_COMMANDS = 32;
3
3
  /**
4
4
  * Fixed rows `formatHelpReport()` always emits: the title, the command-section header,
5
5
  * the "prompt and completion" block and the "editing and session" block, plus the
@@ -2,7 +2,7 @@ import { BUILTIN_COMMAND_DESCRIPTIONS, BUILTIN_COMMAND_NAMES, } from '../command
2
2
  import { COLLABORATION_GRAMMAR } from '../collaboration/grammar.js';
3
3
  import { ESCAPE_REWIND_CHORD_MS } from './rewind-search.js';
4
4
  /** Hard report bounds: help is transcript history, never an unbounded catalogue dump. */
5
- export const MAX_HELP_COMMANDS = 31;
5
+ export const MAX_HELP_COMMANDS = 32;
6
6
  /**
7
7
  * Fixed rows `formatHelpReport()` always emits: the title, the command-section header,
8
8
  * the "prompt and completion" block and the "editing and session" block, plus the
@@ -0,0 +1,31 @@
1
+ /** Transient suggestion ownership. No runtime, filesystem, timer or model imports. */
2
+ import type { SuggestionResult } from '../agent/prompt-suggestion.js';
3
+ export interface SuggestionOwners {
4
+ idle: boolean;
5
+ draft: string;
6
+ permission: boolean;
7
+ search: boolean;
8
+ completion: boolean;
9
+ image: boolean;
10
+ editor: boolean;
11
+ queue: boolean;
12
+ peer: boolean;
13
+ goal: boolean;
14
+ task: boolean;
15
+ replacing: boolean;
16
+ }
17
+ export declare function suggestionUnowned(owners: SuggestionOwners): boolean;
18
+ /** Full text AND key hint must fit in the existing empty composer row. No clipping. */
19
+ export declare function suggestionRow(candidate: string | undefined, columns: number, promptRows: number): string | undefined;
20
+ /** App-scoped, so clear/rewind cannot reset a rejected provider into an endless loop. */
21
+ export declare class PromptSuggestionState {
22
+ revision: number;
23
+ candidate: string | undefined;
24
+ private active;
25
+ private attempted;
26
+ private key;
27
+ private cause;
28
+ private failures;
29
+ invalidate(): void;
30
+ offer(revision: number, key: string, generate: (signal: AbortSignal) => Promise<SuggestionResult>, settled: (result: SuggestionResult, suspension?: string) => void): Promise<void>;
31
+ }
@@ -0,0 +1,65 @@
1
+ import { layoutEditor } from './prompt-editor.js';
2
+ export function suggestionUnowned(owners) {
3
+ return owners.idle && owners.draft === '' && !owners.permission && !owners.search &&
4
+ !owners.completion && !owners.image && !owners.editor && !owners.queue &&
5
+ !owners.peer && !owners.goal && !owners.task && !owners.replacing;
6
+ }
7
+ /** Full text AND key hint must fit in the existing empty composer row. No clipping. */
8
+ export function suggestionRow(candidate, columns, promptRows) {
9
+ if (candidate === undefined || promptRows < 1)
10
+ return undefined;
11
+ const row = `suggest: ${candidate} (Right to edit)`;
12
+ const layout = layoutEditor(row, columns, { offset: row.length, affinity: 'upstream' });
13
+ return columns >= 24 && layout.rows.length === 1 ? row : undefined;
14
+ }
15
+ /** App-scoped, so clear/rewind cannot reset a rejected provider into an endless loop. */
16
+ export class PromptSuggestionState {
17
+ revision = 0;
18
+ candidate;
19
+ active;
20
+ attempted = -1;
21
+ key = '';
22
+ cause = '';
23
+ failures = 0;
24
+ invalidate() {
25
+ this.revision++;
26
+ this.candidate = undefined;
27
+ this.active?.abort();
28
+ this.active = undefined;
29
+ }
30
+ async offer(revision, key, generate, settled) {
31
+ if (revision !== this.revision || this.attempted === revision)
32
+ return;
33
+ if (key !== this.key) {
34
+ this.key = key;
35
+ this.failures = 0;
36
+ this.cause = '';
37
+ }
38
+ if (this.failures >= 3)
39
+ return;
40
+ this.attempted = revision;
41
+ const controller = new AbortController();
42
+ this.active = controller;
43
+ const result = await generate(controller.signal);
44
+ if (this.active === controller)
45
+ this.active = undefined;
46
+ // Usage is still reported for a cancelled/stale attempt; it was a real request.
47
+ let suspension;
48
+ if (!controller.signal.aborted && !result.cancelled && key === this.key) {
49
+ if (result.problem !== undefined && result.problem !== 'no candidate returned') {
50
+ this.failures = this.cause === result.problem ? this.failures + 1 : 1;
51
+ this.cause = result.problem;
52
+ if (this.failures === 3)
53
+ suspension = `prompt suggestions suspended after 3 same-cause failures: ${this.cause}. Change model/config or restart to re-enable; no further automatic attempts in this App.`;
54
+ }
55
+ else {
56
+ this.failures = 0;
57
+ this.cause = '';
58
+ }
59
+ if (revision === this.revision)
60
+ this.candidate = result.candidate;
61
+ }
62
+ settled(result, suspension);
63
+ }
64
+ }
65
+ //# sourceMappingURL=prompt-suggestion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-suggestion.js","sourceRoot":"","sources":["../../../src/tui/prompt-suggestion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiBlD,MAAM,UAAU,iBAAiB,CAAC,MAAwB;IACxD,OAAO,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,MAAM;QAC/E,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK;QACtE,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;AACtE,CAAC;AAED,uFAAuF;AACvF,MAAM,U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IAC9B,CAAC;CACF"}
@@ -0,0 +1,36 @@
1
+ /** Pure away/return state. Clock supplied by the owner; no timers, filesystem or Agent. */
2
+ import type { RecapEvidence, RecapResult } from '../agent/session-recap.js';
3
+ export declare const RECAP_AWAY_MS = 180000;
4
+ export declare const RECAP_MIN_TURNS = 3;
5
+ export declare class SessionRecapState {
6
+ private readonly now;
7
+ private exchanges;
8
+ private truncated;
9
+ private turns;
10
+ private humanCompleted;
11
+ private completedAt;
12
+ private generation;
13
+ private attempted;
14
+ private revision;
15
+ private focused;
16
+ private active;
17
+ private prepared;
18
+ private key;
19
+ private cause;
20
+ private failures;
21
+ constructor(now?: () => number);
22
+ get pending(): boolean;
23
+ get evidence(): RecapEvidence;
24
+ invalidate(): void;
25
+ workStarted(): void;
26
+ resetSession(): void;
27
+ configure(key: string): void;
28
+ complete(user: string, assistant: string, alreadyTruncated?: boolean): void;
29
+ /** Only a real blur -> focus transition may consume a prepared generation. */
30
+ focus(focused: boolean | undefined, unowned: boolean): {
31
+ result: RecapResult;
32
+ evidence: RecapEvidence;
33
+ } | undefined;
34
+ delay(enabled: boolean, unowned: boolean): number | undefined;
35
+ generate(manual: boolean, enabled: boolean, unowned: boolean, request: (evidence: RecapEvidence, signal: AbortSignal) => Promise<RecapResult>, settled: (result: RecapResult, evidence: RecapEvidence, publish: boolean, suspension?: string) => void): Promise<void>;
36
+ }
@@ -0,0 +1,109 @@
1
+ import { recapTail } from '../agent/session-recap.js';
2
+ export const RECAP_AWAY_MS = 180_000;
3
+ export const RECAP_MIN_TURNS = 3;
4
+ export class SessionRecapState {
5
+ now;
6
+ exchanges = [];
7
+ truncated = false;
8
+ turns = 0;
9
+ humanCompleted = false;
10
+ completedAt = 0;
11
+ generation = 0;
12
+ attempted = -1;
13
+ revision = 0;
14
+ focused;
15
+ active;
16
+ prepared;
17
+ key = '';
18
+ cause = '';
19
+ failures = 0;
20
+ constructor(now = Date.now) {
21
+ this.now = now;
22
+ }
23
+ get pending() { return this.active !== undefined; }
24
+ get evidence() { return { exchanges: this.exchanges.map(pair => ({ ...pair })), truncated: this.truncated }; }
25
+ invalidate() {
26
+ this.revision++;
27
+ this.active?.abort();
28
+ this.active = undefined;
29
+ this.prepared = undefined;
30
+ }
31
+ workStarted() { this.invalidate(); this.humanCompleted = false; }
32
+ resetSession() {
33
+ this.invalidate();
34
+ this.exchanges = [];
35
+ this.truncated = false;
36
+ this.turns = 0;
37
+ this.generation++;
38
+ this.focused = undefined;
39
+ this.humanCompleted = false;
40
+ // App-owned failure suspension deliberately survives clear/rewind.
41
+ }
42
+ configure(key) {
43
+ if (key === this.key)
44
+ return;
45
+ this.invalidate();
46
+ this.key = key;
47
+ this.failures = 0;
48
+ this.cause = '';
49
+ }
50
+ complete(user, assistant, alreadyTruncated = false) {
51
+ this.invalidate();
52
+ const u = recapTail(user, 800), a = recapTail(assistant, 1600);
53
+ this.truncated ||= alreadyTruncated || u.truncated || a.truncated || this.exchanges.length >= 6;
54
+ this.exchanges = [...this.exchanges.slice(-5), { user: u.text, assistant: a.text }];
55
+ this.turns++;
56
+ this.generation++;
57
+ this.completedAt = this.now();
58
+ this.humanCompleted = true;
59
+ }
60
+ /** Only a real blur -> focus transition may consume a prepared generation. */
61
+ focus(focused, unowned) {
62
+ const returning = this.focused === false && focused === true;
63
+ this.focused = focused;
64
+ const prepared = returning && unowned ? this.prepared : undefined;
65
+ if (focused !== false)
66
+ this.invalidate();
67
+ return prepared;
68
+ }
69
+ delay(enabled, unowned) {
70
+ if (!enabled || !unowned || !this.humanCompleted || this.focused !== false || this.turns < RECAP_MIN_TURNS || this.attempted === this.generation || this.failures >= 3)
71
+ return undefined;
72
+ return Math.max(0, this.completedAt + RECAP_AWAY_MS - this.now());
73
+ }
74
+ async generate(manual, enabled, unowned, request, settled) {
75
+ if (!unowned || this.pending || this.exchanges.length === 0 || (!manual && this.delay(enabled, unowned) !== 0))
76
+ return;
77
+ this.attempted = this.generation; // Also prevents automatic replay of a manually recapped state.
78
+ const revision = this.revision, key = this.key, evidence = this.evidence;
79
+ const controller = new AbortController();
80
+ this.active = controller;
81
+ let result;
82
+ try {
83
+ result = await request(evidence, controller.signal);
84
+ }
85
+ catch {
86
+ result = { problem: 'recap generation failed' };
87
+ }
88
+ if (this.active === controller)
89
+ this.active = undefined;
90
+ const current = revision === this.revision && !controller.signal.aborted && !result.cancelled;
91
+ let suspension;
92
+ if (current && key === this.key && !manual) {
93
+ if (result.problem !== undefined) {
94
+ this.failures = this.cause === result.problem ? this.failures + 1 : 1;
95
+ this.cause = result.problem;
96
+ if (this.failures === 3)
97
+ suspension = `Automatic session recaps paused after 3 same-cause failures: ${this.cause}. Change model/config or restart to re-enable. Manual /recap remains explicit.`;
98
+ }
99
+ else {
100
+ this.failures = 0;
101
+ this.cause = '';
102
+ }
103
+ }
104
+ if (current && !manual && this.focused === false && result.text !== undefined)
105
+ this.prepared = { result, evidence };
106
+ settled(current ? result : { ...result, cancelled: true }, evidence, current && manual, suspension);
107
+ }
108
+ }
109
+ //# sourceMappingURL=session-recap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-recap.js","sourceRoot":"","sources":["../../../src/tui/session-recap.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC,MAAM,OAAO,iBAAiB;IAeC,GAAG;IAdxB,SAAS,GAA0C,EAAE,CAAC;IACtD,SAAS,GAAG,KAAK,CAAC;IAClB,KAAK,GAAG,CAAC,CAAC;IACV,cAAc,GAAG,KAAK,CAAC;IACvB,WAAW,GAAG,CAAC,CAAC;IAChB,UAAU,GAAG,CAAC,CAAC;IACf,SAAS,GAAG,CAAC,CAAC,CAAC;IACf,QAAQ,GAAG,CAAC,CAAC;IACb,OAAO,CAAsB;IAC7B,MAAM,CAA8B;IACpC,QAAQ,CAA+D;IACvE,G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 1004 adapter at Ink's public render(stdin) seam.
2
+ * Ink retains keyboard/paste parsing. Raw-mode suspension releases the real tty
3
+ * for the external editor. No focus is inferred from silence or terminal identity.
4
+ */
5
+ import { PassThrough } from 'node:stream';
6
+ export declare class TerminalFocusInput extends PassThrough {
7
+ readonly source: NodeJS.ReadStream;
8
+ private readonly output;
9
+ readonly isTTY: boolean;
10
+ /** Ink only consumes the Readable/raw-mode subset; socket operations stay on source. */
11
+ get stdin(): NodeJS.ReadStream;
12
+ private raw;
13
+ private listener;
14
+ private reporting;
15
+ private pending;
16
+ private pasted;
17
+ private timer;
18
+ constructor(source: NodeJS.ReadStream, output: NodeJS.WriteStream);
19
+ get isRaw(): boolean;
20
+ ref(): this;
21
+ unref(): this;
22
+ setRawMode(value: boolean): this;
23
+ watch(listener: (focused: boolean | undefined) => void): () => void;
24
+ close(): void;
25
+ private updateReporting;
26
+ private clearPending;
27
+ private readonly readSource;
28
+ private filterFocus;
29
+ }
@@ -0,0 +1,128 @@
1
+ /** Narrow DECSET 1004 adapter at Ink's public render(stdin) seam.
2
+ * Ink retains keyboard/paste parsing. Raw-mode suspension releases the real tty
3
+ * for the external editor. No focus is inferred from silence or terminal identity.
4
+ */
5
+ import { PassThrough } from 'node:stream';
6
+ export class TerminalFocusInput extends PassThrough {
7
+ source;
8
+ output;
9
+ isTTY;
10
+ /** Ink only consumes the Readable/raw-mode subset; socket operations stay on source. */
11
+ get stdin() { return this; }
12
+ raw = false;
13
+ listener;
14
+ reporting = false;
15
+ pending = '';
16
+ pasted = false;
17
+ timer;
18
+ constructor(source, output) {
19
+ super();
20
+ this.source = source;
21
+ this.output = output;
22
+ this.isTTY = source.isTTY;
23
+ }
24
+ get isRaw() { return this.source.isRaw; }
25
+ ref() { this.source.ref(); return this; }
26
+ unref() { this.source.unref(); return this; }
27
+ setRawMode(value) {
28
+ this.source.setRawMode(value);
29
+ this.raw = value;
30
+ this.source.off('readable', this.readSource);
31
+ if (value) {
32
+ this.source.setEncoding('utf8');
33
+ this.source.on('readable', this.readSource);
34
+ }
35
+ else {
36
+ this.clearPending();
37
+ this.pending = '';
38
+ this.pasted = false;
39
+ while (this.read() !== null) { /* discard suspended input */ }
40
+ }
41
+ this.updateReporting();
42
+ return this;
43
+ }
44
+ watch(listener) {
45
+ this.listener = listener;
46
+ this.updateReporting();
47
+ return () => { this.listener?.(undefined); this.listener = undefined; this.updateReporting(); };
48
+ }
49
+ close() {
50
+ this.listener = undefined;
51
+ this.raw = false;
52
+ this.updateReporting();
53
+ this.source.off('readable', this.readSource);
54
+ this.clearPending();
55
+ this.pending = '';
56
+ this.destroy();
57
+ }
58
+ updateReporting() {
59
+ const next = this.raw && this.listener !== undefined && this.isTTY && this.output.isTTY && process.env['TERM'] !== 'dumb';
60
+ if (next === this.reporting)
61
+ return;
62
+ this.reporting = next;
63
+ this.output.write(next ? '\u001b[?1004h' : '\u001b[?1004l');
64
+ if (!next) {
65
+ this.listener?.(undefined);
66
+ this.clearPending();
67
+ this.pending = '';
68
+ this.pasted = false;
69
+ }
70
+ }
71
+ clearPending() { clearTimeout(this.timer); this.timer = undefined; }
72
+ readSource = () => {
73
+ let chunk;
74
+ while ((chunk = this.source.read()) !== null) {
75
+ if (!this.reporting)
76
+ this.write(chunk);
77
+ else
78
+ this.filterFocus(String(chunk));
79
+ }
80
+ };
81
+ filterFocus(chunk) {
82
+ this.clearPending();
83
+ this.pending += chunk;
84
+ let text = '';
85
+ const sequences = ['\u001b[I', '\u001b[O', '\u001b[200~', '\u001b[201~'];
86
+ while (this.pending !== '') {
87
+ const sequence = sequences.find(value => this.pending.startsWith(value));
88
+ if (sequence !== undefined) {
89
+ this.pending = this.pending.slice(sequence.length);
90
+ if (sequence === sequences[2]) {
91
+ this.pasted = true;
92
+ text += sequence;
93
+ }
94
+ else if (sequence === sequences[3]) {
95
+ this.pasted = false;
96
+ text += sequence;
97
+ }
98
+ else if (this.pasted)
99
+ text += sequence;
100
+ else {
101
+ // Flush keyboard bytes first. Publication checks immediate composer owners
102
+ // after the complete raw chunk has been consumed by Ink.
103
+ const focused = sequence === sequences[0];
104
+ const listener = this.listener;
105
+ queueMicrotask(() => { if (this.reporting && this.listener === listener)
106
+ listener?.(focused); });
107
+ }
108
+ }
109
+ else if (sequences.some(value => value.startsWith(this.pending)))
110
+ break;
111
+ else {
112
+ text += this.pending[0];
113
+ this.pending = this.pending.slice(1);
114
+ }
115
+ }
116
+ if (text !== '')
117
+ this.write(text);
118
+ if (this.pending !== '')
119
+ this.timer = setTimeout(() => {
120
+ const rest = this.pending;
121
+ this.pending = '';
122
+ this.timer = undefined;
123
+ if (rest !== '')
124
+ this.write(rest);
125
+ }, 50);
126
+ }
127
+ }
128
+ //# sourceMappingURL=terminal-focus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-focus.js","sourceRoot":"","sources":["../../../src/tui/terminal-focus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IAU5B,MAAM;IAAsC,MAAM;IAT9D,KAAK,CAAU;IACxB,wFAAwF;IACxF,IAAI,KAAK,KAAwB,OAAO,IAAoC,CAAC,CAAC,CAAC;IACvE,GAAG,GAAG,KAAK,CAAC;IACZ,QAAQ,CAAuD;IAC/D,SAAS,GAAG,KAAK,CAAC;IAClB,OAAO,GAAG,EAAE,CAAC;IACb,MAAM,GAAG,KAAK,CAAC;IACf,KAAK,CAA4C;IACzD,YAAqB,MAAyB,EAAmB,MAA0B;QACzF,KAAK,EAAE,CAAC;sBADW,MAAM;sBAAsC,MAAM;QAC5D,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACrC,CAAC;IACD,IAAI,KAAK,KAAc,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,GAAG,KAAW,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,I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I,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ;wBAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnG,CAAC;YACH,CAAC;iBAAM,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAAE,MAAM;iBACrE,CAAC;gBAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAC,CAAC;QACzE,CAAC;QACD,IAAI,IAAI,KAAK,EAAE;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,OAAO,KAAK,EAAE;YAAE,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBACpD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;gBAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;gBAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;gBACrE,IAAI,IAAI,KAAK,EAAE;oBAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strands-darwin",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "TUI coding agent built on the Strands TypeScript SDK",
5
5
  "type": "module",
6
6
  "engines": {
@@ -43,14 +43,14 @@
43
43
  "@aws/bedrock-token-generator": "^1.1.0",
44
44
  "@modelcontextprotocol/client": "^2.3.1",
45
45
  "@modelcontextprotocol/sdk": "^1.30.0",
46
- "@strands-agents/sdk": "1.20.0",
46
+ "@strands-agents/sdk": "1.21.0",
47
47
  "gray-matter": "^4.0.3",
48
48
  "ink": "7.1.1",
49
49
  "openai": "^6.49.0",
50
50
  "patch-package": "^8.0.1",
51
51
  "react": "^19.2.8",
52
52
  "sharp": "^0.34.5",
53
- "zod": "^4.4.3"
53
+ "zod": "^4.5.4"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^26.2.0",