agent-afk 5.58.0 → 5.59.0

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.
@@ -27,6 +27,7 @@ export interface InputSurfaceArmOpts {
27
27
  promptFn: () => string;
28
28
  onCancel: () => void;
29
29
  onShiftTab?: () => void;
30
+ onOpenEditor?: () => void;
30
31
  scrollRegion?: CompositorScrollRegionGuard;
31
32
  stdout?: NodeJS.WriteStream;
32
33
  stdin?: NodeJS.ReadStream;
@@ -1,5 +1,15 @@
1
1
  import type { Candidate, Trigger } from './types.js';
2
2
  export declare function detectTrigger(buffer: string, cursorCol: number): Trigger | null;
3
3
  export declare function filterSlashCandidates(query: string): Candidate[];
4
+ export interface FileDirent {
5
+ name: string;
6
+ isDirectory(): boolean;
7
+ }
8
+ export declare const FILE_SCAN_TTL_MS = 2000;
9
+ export declare function invalidateFileScanCache(): void;
10
+ export declare function __fileScanCacheSize(): number;
11
+ export declare function buildFileCandidates(entries: FileDirent[], query: string, rootDir?: string, homeDir?: string): Candidate[];
12
+ export declare function filterFileCandidatesCached(query: string, rootDir?: string, homeDir?: string): Candidate[] | null;
13
+ export declare function filterFileCandidatesAsync(query: string, rootDir?: string, homeDir?: string): Promise<Candidate[]>;
4
14
  export declare function filterFileCandidates(query: string, rootDir?: string, homeDir?: string): Candidate[];
5
15
  export declare function filterFlagCandidates(command: string, query: string): Candidate[];
@@ -0,0 +1,12 @@
1
+ import type { TerminalCompositor } from '../../terminal-compositor.js';
2
+ export type EditorNotifyKind = 'info' | 'warn' | 'error';
3
+ export interface EditorHandoffDeps {
4
+ compositor: TerminalCompositor | null;
5
+ notify: (kind: EditorNotifyKind, message: string) => void;
6
+ }
7
+ export type EditorHandoffResult = 'no-tty' | 'no-editor' | 'loaded' | 'kept' | 'spawn-failed';
8
+ export declare function resolveEditor(): {
9
+ cmd: string;
10
+ args: string[];
11
+ } | null;
12
+ export declare function openEditorForBuffer(deps: EditorHandoffDeps): Promise<EditorHandoffResult>;
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../types.js';
2
+ export declare const editorCmd: SlashCommand;
@@ -19,6 +19,7 @@ export declare class TerminalCompositor {
19
19
  onBackground?: () => void;
20
20
  onPauseInterrupt?: () => void;
21
21
  onShiftTab?: () => void;
22
+ onOpenEditor?: () => void;
22
23
  readonly promptTextFn: () => string;
23
24
  readonly history?: IHistoryRing;
24
25
  readonly autocompleteState?: AutocompleteState;
@@ -55,6 +56,8 @@ export declare class TerminalCompositor {
55
56
  readonly spinnerController: SpinnerController;
56
57
  readonly caretBlinkController: CaretBlinkController;
57
58
  repaintCount: number;
59
+ pendingTrailingRepaint: boolean;
60
+ burstActive: boolean;
58
61
  committing: boolean;
59
62
  hasCommitted: boolean;
60
63
  committedBand: string[];
@@ -86,6 +89,7 @@ export declare class TerminalCompositor {
86
89
  setOnSoftStop(handler: (() => void) | null): void;
87
90
  setOnBackground(handler: (() => void) | null): void;
88
91
  setOnShiftTab(handler: (() => void) | null): void;
92
+ setOnOpenEditor(handler: (() => void) | null): void;
89
93
  enterPickerMode(controller: PickerController): void;
90
94
  exitPickerMode(): void;
91
95
  repaintPicker(): void;
@@ -116,6 +120,8 @@ export declare class TerminalCompositor {
116
120
  renderDropdownRows(): string[];
117
121
  renderHintRow(): string | null;
118
122
  repaint(): void;
123
+ scheduleRepaint(): void;
124
+ flushPendingRepaint(): void;
119
125
  clearScreen(): void;
120
126
  resetState(): void;
121
127
  applyEdit(next: InputCoreState): boolean;
@@ -5,6 +5,7 @@ import type { ImageAttachment } from './input/attachments.js';
5
5
  import type { CompositorInputMode, KeyInfo, PickerController, SubmissionPayload } from './terminal-compositor.types.js';
6
6
  export interface KeyDispatchHost {
7
7
  repaint(): void;
8
+ scheduleRepaint(): void;
8
9
  clearScreen(): void;
9
10
  applyEdit(next: InputCoreState): boolean;
10
11
  updateAutocomplete(): void;
@@ -38,6 +39,7 @@ export interface KeyDispatchHost {
38
39
  readonly onBackground?: () => void;
39
40
  readonly onPauseInterrupt?: () => void;
40
41
  readonly onShiftTab?: () => void;
42
+ readonly onOpenEditor?: () => void;
41
43
  readonly onSubmit?: (payload: SubmissionPayload) => void;
42
44
  }
43
45
  export declare function applyEdit(self: KeyDispatchHost, next: InputCoreState): boolean;
@@ -14,6 +14,8 @@ export interface ResetStateHost {
14
14
  postEscCoalesce: boolean;
15
15
  postEscPayload: SubmissionPayload | null;
16
16
  paused: boolean;
17
+ pendingTrailingRepaint: boolean;
18
+ burstActive: boolean;
17
19
  activeGhost: string | null;
18
20
  anchorRow: number | undefined;
19
21
  hasCommitted: boolean;
@@ -63,6 +63,7 @@ export interface TerminalCompositorOptions {
63
63
  onBackground?: () => void;
64
64
  onPauseInterrupt?: () => void;
65
65
  onShiftTab?: () => void;
66
+ onOpenEditor?: () => void;
66
67
  onSubmit?: (payload: SubmissionPayload) => void;
67
68
  promptText?: string | (() => string);
68
69
  history?: IHistoryRing;