agent-afk 5.339.0 → 5.340.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.
@@ -10,6 +10,8 @@ export interface GithubPollerOptions {
10
10
  ghRunner?: GhRunner;
11
11
  }
12
12
  export type GhRunner = (path: string, extraArgs?: string[]) => Promise<unknown>;
13
+ export declare const MAX_SEEN_FOR_TESTS = 10000;
14
+ export declare function _pruneSeen(seen: Set<string>): Set<string>;
13
15
  export declare function renderCommand(template: string, eventType: GithubEventType, repo: string, eventId: string, payloadSummary: string): string;
14
16
  export declare class GithubEventPoller {
15
17
  private readonly repo;
@@ -0,0 +1,12 @@
1
+ import type { PushResult } from '../telegram/push.js';
2
+ export type { PushResult } from '../telegram/push.js';
3
+ export interface OperatorNotifyOptions {
4
+ parseMode?: 'MarkdownV2' | 'HTML' | 'Markdown';
5
+ markdown?: boolean;
6
+ replyMarkup?: import('telegraf/types').InlineKeyboardMarkup;
7
+ fetchImpl?: typeof fetch;
8
+ target?: number | readonly number[];
9
+ messageThreadId?: number;
10
+ }
11
+ export type OperatorNotifyFn = (text: string, opts?: OperatorNotifyOptions) => Promise<PushResult[] | null>;
12
+ export declare const operatorNotify: OperatorNotifyFn;
@@ -2,4 +2,4 @@ export { clearConversation } from './clear.js';
2
2
  export { compactConversation, type CompactConversationResult, type CompactProgress } from './compact.js';
3
3
  export { setSessionModel, type SetSessionModelResult } from './model.js';
4
4
  export { setSessionName, sessionDisplayName, type SetSessionNameResult, type SessionNameOptions, THINKING_MODES, getSessionThinking, setSessionThinking, readSessionFast, setSessionFast, getUsageAwareness, setUsageAwarenessPreference, } from './preferences.js';
5
- export { readSubscriptionUsage, readContextUsage, readLocalTokenUsage, readTokenUsage, readMcpStatus, readMcpOauthPending, type ContextUsage, type LocalTokenUsage, type TokenUsage, } from './reads.js';
5
+ export { readContextUsage, readLocalTokenUsage, readTokenUsage, readMcpStatus, readMcpOauthPending, type ContextUsage, type LocalTokenUsage, type TokenUsage, } from './reads.js';
@@ -1,6 +1,5 @@
1
1
  import type { AgentSession } from '../session.js';
2
2
  import type { SessionStats } from '../../cli/slash/types.js';
3
- import { fetchSubscriptionUsage } from '../subscription-usage.js';
4
3
  export type ContextUsage = Awaited<ReturnType<AgentSession['getContextUsage']>>;
5
4
  export interface LocalTokenUsage {
6
5
  kind: 'local';
@@ -17,7 +16,6 @@ export type TokenUsage = {
17
16
  kind: 'sdk';
18
17
  usage: ContextUsage;
19
18
  } | LocalTokenUsage;
20
- export declare function readSubscriptionUsage(): ReturnType<typeof fetchSubscriptionUsage>;
21
19
  export declare function readContextUsage(session: Pick<AgentSession, 'getContextUsage'>): Promise<ContextUsage>;
22
20
  export declare function readLocalTokenUsage(stats: SessionStats): LocalTokenUsage;
23
21
  export declare function readTokenUsage(session: Pick<AgentSession, 'getContextUsage'>, stats: SessionStats): Promise<TokenUsage>;
@@ -60,6 +60,7 @@ export declare class ProcessJobRegistry extends EventEmitter<ProcessJobRegistryE
60
60
  private traceWriter;
61
61
  private readonly jobs;
62
62
  private counter;
63
+ private startedProcsEver;
63
64
  private closed;
64
65
  private exitHookInstalled;
65
66
  private readonly exitHook;
@@ -69,6 +70,7 @@ export declare class ProcessJobRegistry extends EventEmitter<ProcessJobRegistryE
69
70
  tail(id: string, maxChars: number): string | undefined;
70
71
  list(): readonly ProcessJobSnapshot[];
71
72
  runningCount(): number;
73
+ startedCount(): number;
72
74
  leaderExited(id: string): boolean;
73
75
  cancel(id: string, source: ProcessCancelSource, graceMs?: number): ProcessJobSnapshot | undefined;
74
76
  emitCancelTimeout(id: string): void;
@@ -22,4 +22,3 @@ export interface FetchSubscriptionUsageOptions {
22
22
  readonly timeoutMs?: number;
23
23
  }
24
24
  export declare function fetchSubscriptionUsage(options?: FetchSubscriptionUsageOptions): Promise<UsageResult>;
25
- export declare function formatUsagePlain(result: UsageResult): string;
@@ -0,0 +1,2 @@
1
+ import type { HookHandler } from '../../hooks.js';
2
+ export declare function createInlineImageHook(agentCwd?: string | undefined): HookHandler;
@@ -0,0 +1,8 @@
1
+ export type TerminalProtocol = 'kitty' | 'iterm2' | 'none';
2
+ export declare function detectTerminalProtocol(): TerminalProtocol;
3
+ export interface RenderInlineImageOptions {
4
+ filePath: string;
5
+ toolName: string;
6
+ agentCwd?: string | undefined;
7
+ }
8
+ export declare function renderInlineImage(opts: RenderInlineImageOptions): Promise<void>;
@@ -33,6 +33,5 @@ export declare function discoverPluginSkillBodies(pluginConfigs?: SdkPluginConfi
33
33
  export declare function discoverPluginAgents(pluginConfigs?: SdkPluginConfig[], warn?: (message: string) => void): RegisteredAgent[];
34
34
  export declare function scanAllPluginRoots(opts?: CollectSkillEntriesOptions): SdkPluginConfig[];
35
35
  export interface EnsurePluginEntrypointsOptions {
36
- stateStore?: import('../state/state-store.js').StateStore;
37
36
  }
38
- export declare function ensurePluginEntrypointsLoaded(opts?: EnsurePluginEntrypointsOptions): Promise<void>;
37
+ export declare function ensurePluginEntrypointsLoaded(_opts?: EnsurePluginEntrypointsOptions): Promise<void>;
@@ -0,0 +1,10 @@
1
+ export declare function resolveChildInheritedReadRoots(getReadScopeInputs: (() => {
2
+ parentReadRoots: string[] | undefined;
3
+ parentCwd: string | undefined;
4
+ }) | undefined): {
5
+ childScopeInputs: {
6
+ parentReadRoots: string[] | undefined;
7
+ parentCwd: string | undefined;
8
+ };
9
+ childInheritedReadRoots: string[] | undefined;
10
+ };
@@ -0,0 +1,19 @@
1
+ import type { ToolResult } from './types.js';
2
+ export declare const DEFAULT_TURN_WINDOW = 20;
3
+ export declare const MAX_LEDGER_KEYS = 2000;
4
+ export interface LedgerEntry {
5
+ readonly result: ToolResult;
6
+ readonly turnIndex: number;
7
+ }
8
+ export type LedgerHistory = readonly LedgerEntry[];
9
+ export declare class ToolCallLedger {
10
+ private readonly buckets;
11
+ private readonly turnWindow;
12
+ constructor(turnWindow?: number);
13
+ record(toolName: string, inputHash: string, result: ToolResult, turnIndex: number): void;
14
+ lookup(toolName: string, inputHash: string, currentTurn: number): LedgerHistory;
15
+ prune(currentTurn: number): void;
16
+ get keyCount(): number;
17
+ get entryCount(): number;
18
+ rawEntryCountFor(toolName: string, inputHash: string): number;
19
+ }
@@ -1,4 +1,4 @@
1
- import type { JournalMessage } from '../journal/types.js';
1
+ import type { JournalMessage, JournalRecord } from '../journal/types.js';
2
2
  export interface JournalSummary {
3
3
  firstUserMessage?: string;
4
4
  lastAssistantMessage?: string;
@@ -7,4 +7,4 @@ export interface JournalSummary {
7
7
  messageCount: number;
8
8
  textRedacted?: boolean;
9
9
  }
10
- export declare function extractJournalSummary(messages: JournalMessage[] | null, textDisabled: boolean): JournalSummary | undefined;
10
+ export declare function extractJournalSummary(messages: JournalMessage[] | null, textDisabled: boolean, rawRecords?: readonly JournalRecord[]): JournalSummary | undefined;
@@ -1,5 +1,7 @@
1
1
  import type { UsageUnavailable } from '../subscription-usage.js';
2
2
  export declare const DEFAULT_USAGE_TIMEOUT_MS = 10000;
3
+ export declare const MAX_REASONABLE_EPOCH_SECONDS = 4102444800;
4
+ export declare function clampFraction(n: number): number;
3
5
  export interface UsageHttpOptions {
4
6
  readonly fetchImpl?: typeof fetch;
5
7
  readonly timeoutMs?: number;
@@ -23,7 +23,7 @@ export interface PickerState {
23
23
  filteredResults: ReturnType<typeof filterOptions>;
24
24
  selected: Set<number>;
25
25
  }
26
- export declare function renderPickerRows(state: PickerState, header: readonly string[], options: readonly string[], multi: boolean, searchable: boolean, terminalRowsFn: (() => number | undefined) | undefined, bandWidth?: number): readonly string[];
26
+ export declare function renderPickerRows(state: PickerState, header: readonly string[], options: readonly string[], multi: boolean, searchable: boolean, terminalRowsFn: (() => number | undefined) | undefined): readonly string[];
27
27
  export type PickerKeyAction = {
28
28
  kind: 'repaint';
29
29
  } | {
@@ -51,7 +51,7 @@ export interface PickerController {
51
51
  meta?: boolean;
52
52
  sequence?: string;
53
53
  }) => void;
54
- editable?: boolean;
54
+ skipBandTruncation?: boolean;
55
55
  }
56
56
  export interface SubmissionPayload {
57
57
  text: string;