agent-afk 5.58.1 → 5.59.1

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.
@@ -10,3 +10,9 @@ export declare function visualCursorPos(buffer: string, cursorIdx: number, promp
10
10
  row: number;
11
11
  col: number;
12
12
  };
13
+ export interface VisualPositionMap {
14
+ readonly rowAt: readonly number[];
15
+ readonly colAt: readonly number[];
16
+ readonly totalRows: number;
17
+ }
18
+ export declare function buildVisualPositionMap(buffer: string, promptVisibleLen: number, cols: number): VisualPositionMap;
@@ -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[];
@@ -1,4 +1,5 @@
1
1
  export interface SlashRegistryView {
2
2
  has(name: string): boolean;
3
+ version?(): number;
3
4
  }
4
5
  export declare function colorizeInputBuffer(buffer: string, registry: SlashRegistryView): string;
@@ -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;
@@ -1,5 +1,6 @@
1
1
  import type { SlashCommand, SlashContext, SlashResult } from './types.js';
2
2
  import type { ImageAttachment } from '../input/attachments.js';
3
+ export declare function registryVersion(): number;
3
4
  export declare function register(cmd: SlashCommand): void;
4
5
  export declare function registerOrReplace(cmd: SlashCommand): void;
5
6
  export declare function registerIfAbsent(cmd: SlashCommand): void;
@@ -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;
@@ -88,6 +89,7 @@ export declare class TerminalCompositor {
88
89
  setOnSoftStop(handler: (() => void) | null): void;
89
90
  setOnBackground(handler: (() => void) | null): void;
90
91
  setOnShiftTab(handler: (() => void) | null): void;
92
+ setOnOpenEditor(handler: (() => void) | null): void;
91
93
  enterPickerMode(controller: PickerController): void;
92
94
  exitPickerMode(): void;
93
95
  repaintPicker(): void;
@@ -39,6 +39,7 @@ export interface KeyDispatchHost {
39
39
  readonly onBackground?: () => void;
40
40
  readonly onPauseInterrupt?: () => void;
41
41
  readonly onShiftTab?: () => void;
42
+ readonly onOpenEditor?: () => void;
42
43
  readonly onSubmit?: (payload: SubmissionPayload) => void;
43
44
  }
44
45
  export declare function applyEdit(self: KeyDispatchHost, next: InputCoreState): 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;