agent-afk 5.308.1 → 5.308.2

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.
@@ -1,5 +1,6 @@
1
1
  import type { AnthropicToolDef } from '../tools/types.js';
2
2
  import type { RuntimeStateSource, RuntimeSubagents, PhaseRole } from './types.js';
3
+ export declare function resetOutcomeSummaryCache(): void;
3
4
  export interface RuntimeSourceDeps {
4
5
  sessionId?: string | undefined;
5
6
  surface: string;
@@ -19,5 +20,6 @@ export interface RuntimeSourceDeps {
19
20
  error?: string;
20
21
  }[];
21
22
  getSubagents: () => RuntimeSubagents;
23
+ afkHome?: string | undefined;
22
24
  }
23
25
  export declare function buildRuntimeStateSource(deps: RuntimeSourceDeps): RuntimeStateSource;
@@ -12,5 +12,5 @@ export interface GateOptions {
12
12
  nowMs: number;
13
13
  telemetryPath: string;
14
14
  }
15
- export declare function readLastTickTime(taskId: string, telemetryPath: string): number | null;
16
- export declare function evaluateSessionStartGates(options: GateOptions): GateDecision;
15
+ export declare function readLastTickTime(taskId: string, telemetryPath: string): Promise<number | null>;
16
+ export declare function evaluateSessionStartGates(options: GateOptions): Promise<GateDecision>;
@@ -1,3 +1 @@
1
- export { createEffectLedgerPostHook, createEffectLedgerPreHook } from './hook.js';
2
- export type { EffectRecord, EffectStatus, EffectQuery, PendingEffectInput, ExecuteEffectInput, } from './types.js';
3
- export type { Classification } from './classifier.js';
1
+ export { createEffectLedgerPostHook } from './hook.js';
@@ -18,9 +18,4 @@ declare class ElicitationRouter {
18
18
  }): Promise<ElicitationResult>;
19
19
  }
20
20
  export declare const elicitationRouter: ElicitationRouter;
21
- export declare function routeElicitation(request: ElicitationRequest, options: {
22
- signal: AbortSignal;
23
- onActive?: () => void;
24
- sessionId?: string;
25
- }): Promise<ElicitationResult>;
26
21
  export {};
@@ -4,8 +4,6 @@ export declare const FIX_OF_FIX_LABEL = "fix-of-fix";
4
4
  export declare function extractReferencedPrNumbers(text: string): number[];
5
5
  export declare function getPrMergedAt(prNumber: number, execFn?: ExecFn): Promise<string | null>;
6
6
  export declare function isMergedWithinDays(mergedAt: string, withinDays: number, now?: Date): boolean;
7
- export declare function ensureFixOfFixLabel(execFn?: ExecFn): Promise<void>;
8
- export declare function applyFixOfFixLabel(prNumber: number | string, execFn?: ExecFn): Promise<void>;
9
7
  export interface FixOfFixResult {
10
8
  isFixOfFix: boolean;
11
9
  recentlyMergedRefs: number[];
@@ -1,5 +1,5 @@
1
1
  import type { HarnessHookEvent } from '../hooks.js';
2
- export { compileMatcher, CLAUDE_CODE_ALIASES } from './matcher.js';
2
+ export { compileMatcher } from './matcher.js';
3
3
  export { isPluginHookDisabled } from './disabled-plugin-hooks.js';
4
4
  export interface RawCommandHook {
5
5
  type: 'command';
@@ -14,7 +14,6 @@ export interface MarketplaceManifest {
14
14
  };
15
15
  plugins: MarketplacePluginEntry[];
16
16
  }
17
- export declare const MARKETPLACE_MANIFEST_RELPATH = ".claude-plugin/marketplace.json";
18
17
  export declare function manifestPath(marketplaceDir: string): string;
19
18
  export declare function isMarketplaceDir(dir: string): boolean;
20
19
  export declare function readManifest(dir: string): MarketplaceManifest;
@@ -1,4 +1,5 @@
1
1
  import type { FactCategory, MemoryUpdateAction, MemoryUpdateTarget } from './types.js';
2
+ export declare function parseOptionalFactCategory(obj: Record<string, unknown>): FactCategory | undefined;
2
3
  export interface MemorySearchInput {
3
4
  query: string;
4
5
  category?: FactCategory;
@@ -1,4 +1,3 @@
1
- export declare const PEER_ENVELOPE_VERSION = 1;
2
1
  export declare const PEER_MAX_BODY_BYTES: number;
3
2
  export declare const PEER_MAX_HOPS = 6;
4
3
  export interface PeerEnvelope {
@@ -2,9 +2,8 @@ import type { ExecFn } from './gh.js';
2
2
  export declare const LABEL_HUMAN_REVIEWED = "human-reviewed";
3
3
  export declare const LABEL_AGENT_REVIEWED = "agent-reviewed";
4
4
  export declare const LABEL_AUTO_MERGED = "auto-merged";
5
- export declare const ALL_REVIEW_LABELS: readonly ["human-reviewed", "agent-reviewed", "auto-merged"];
6
- export type ReviewLabel = (typeof ALL_REVIEW_LABELS)[number];
7
- export declare const BOT_LOGINS: ReadonlySet<string>;
5
+ declare const ALL_REVIEW_LABELS: readonly ["human-reviewed", "agent-reviewed", "auto-merged"];
6
+ type ReviewLabel = (typeof ALL_REVIEW_LABELS)[number];
8
7
  export interface PrReview {
9
8
  author: {
10
9
  login: string;
@@ -30,3 +29,4 @@ export declare function labelPrReviewCoverage(pr: string, opts?: {
30
29
  autoMerged?: boolean;
31
30
  execFn?: ExecFn;
32
31
  }): Promise<ReviewLabel>;
32
+ export {};
@@ -1,9 +1,9 @@
1
- export type SignalKind = 'preexisting-sentence' | 'deferred-bullet';
2
- export type DefectCategory = 'failing-test' | 'gate' | 'size-ceiling' | 'other';
1
+ type SignalKind = 'preexisting-sentence' | 'deferred-bullet';
2
+ type DefectCategory = 'failing-test' | 'gate' | 'size-ceiling' | 'other';
3
3
  export interface DetectedEntry {
4
4
  signal: SignalKind;
5
5
  category: DefectCategory;
6
6
  loci: string[];
7
7
  }
8
- export declare const MAX_SCAN_CHARS = 500000;
9
8
  export declare function detectInText(text: string): DetectedEntry[];
9
+ export {};
@@ -1,13 +1,11 @@
1
1
  import type { MessageParam } from '@anthropic-ai/sdk/resources';
2
2
  import type { AnthropicMessagesCreateParams } from './types.js';
3
- import { COMPACT_ACK_TEXT, COMPACT_SUMMARY_HEADER, COMPACT_SYSTEM_PROMPT, type CompactionOps, type MicrocompactOps, type MicrocompactOptions, type MicrocompactResult } from '../shared/compaction.js';
3
+ import { COMPACT_ACK_TEXT, COMPACT_SUMMARY_HEADER, COMPACT_SYSTEM_PROMPT, type CompactionOps, type MicrocompactOptions, type MicrocompactResult } from '../shared/compaction.js';
4
4
  export { COMPACT_ACK_TEXT, COMPACT_SUMMARY_HEADER, COMPACT_SYSTEM_PROMPT };
5
5
  export declare function isFreshUserTurn(msg: MessageParam): boolean;
6
6
  export declare const anthropicCompactionOps: CompactionOps<MessageParam>;
7
- export declare const anthropicMicrocompactOps: MicrocompactOps<MessageParam>;
8
7
  export declare function microcompactToolResults(messages: ReadonlyArray<MessageParam>, opts?: MicrocompactOptions): MicrocompactResult;
9
8
  export declare function findCompactionBoundary(messages: ReadonlyArray<MessageParam>, keepLastN: number): number;
10
- export declare function findCompactionBoundaryAdaptive(messages: ReadonlyArray<MessageParam>, keepLastN: number, usedFraction: number, shrinkAtFraction: number): number;
11
9
  export declare function buildSummarizationRequest(olderMessages: ReadonlyArray<MessageParam>, model: string, maxTokens: number): AnthropicMessagesCreateParams;
12
10
  export declare function applyCompaction(messages: ReadonlyArray<MessageParam>, boundary: number, summaryText: string): MessageParam[];
13
11
  export declare function estimateTokensSaved(before: ReadonlyArray<MessageParam>, boundary: number, summaryText: string): number;
@@ -0,0 +1,4 @@
1
+ import OpenAI from 'openai';
2
+ import type { OpenAIAuthResolution } from '../auth.js';
3
+ import type { OpenAICompatibleQueryOptions } from './query-options.js';
4
+ export declare function buildRefreshedClient(newAuth: OpenAIAuthResolution, opts: OpenAICompatibleQueryOptions): OpenAI;
@@ -16,3 +16,4 @@ export interface DispatchAndAppendInput {
16
16
  vitalsNote?: string | undefined;
17
17
  }
18
18
  export declare function dispatchAndAppendToolCalls({ state, signal, vision, toolDispatcher, traceWriter, priorTurns, sessionId, subagentId, vitalsNote, }: DispatchAndAppendInput): AsyncGenerator<ProviderEvent, ToolResult | undefined>;
19
+ export declare function stripVitalsSpoofLines(content: string): string;
@@ -0,0 +1,15 @@
1
+ import type { ProviderEvent } from '../../../provider.js';
2
+ import type { OpenAIMessage } from '../messages.js';
3
+ import { type OpenAIAuthResolution, type AuthResolverDeps } from '../auth.js';
4
+ export interface OAuthRefreshContext {
5
+ readonly opts: {
6
+ readonly auth: OpenAIAuthResolution;
7
+ readonly config: {
8
+ readonly forceChatgptOAuth?: boolean;
9
+ };
10
+ };
11
+ rebuildClient(newAuth: OpenAIAuthResolution): void;
12
+ readonly priorTurns: OpenAIMessage[];
13
+ }
14
+ export declare function is401(err: unknown): boolean;
15
+ export declare function wrapTurnWithOAuthRefresh(ctx: OAuthRefreshContext, firstAttempt: AsyncGenerator<ProviderEvent>, makeNewAttempt: () => AsyncGenerator<ProviderEvent>, authDeps?: AuthResolverDeps): AsyncGenerator<ProviderEvent>;
@@ -14,6 +14,7 @@ import { type CompactHandlerContext } from './query/compact-handler.js';
14
14
  import type { OpenAICompatibleQueryOptions } from './query/query-options.js';
15
15
  export type { OpenAICompatibleQueryOptions } from './query/query-options.js';
16
16
  import { type BeforeNextRoundCallback } from './query/live-updates.js';
17
+ import type { AuthResolverDeps } from './auth.js';
17
18
  export { buildQueryFromConfig } from './query/build-query.js';
18
19
  export { __setRetryBaseDelay, __setRetryAfterMaxWaitMs } from './query/retry.js';
19
20
  export { __setOpenAIClientFactory } from './query/client.js';
@@ -21,7 +22,8 @@ export type { OpenAIClientFactory } from './query/client.js';
21
22
  export { isOSeriesModel, mapEffortForOpenAI } from './query/model-params.js';
22
23
  export { resolveReasoningEffort };
23
24
  export declare class OpenAICompatibleQuery implements ProviderQuery, TurnDriverContext, CompactHandlerContext {
24
- readonly client: OpenAI;
25
+ private _client;
26
+ get client(): OpenAI;
25
27
  readonly opts: OpenAICompatibleQueryOptions;
26
28
  readonly initSessionId: string;
27
29
  readonly toolDispatcher: ToolDispatcher | undefined;
@@ -57,6 +59,8 @@ export declare class OpenAICompatibleQuery implements ProviderQuery, TurnDriverC
57
59
  constructor(opts: OpenAICompatibleQueryOptions);
58
60
  activeOpenAITools(): OpenAIFunctionTool[] | undefined;
59
61
  [Symbol.asyncIterator](): AsyncIterator<ProviderEvent>;
62
+ rebuildClient(newAuth: import('./auth.js').OpenAIAuthResolution): void;
63
+ _authDeps: AuthResolverDeps;
60
64
  private runTurn;
61
65
  interrupt(reason?: import('../../abort-reason.js').ProviderAbortReason): Promise<void>;
62
66
  compact(): Promise<ProviderCompactResult>;
@@ -8,7 +8,7 @@ export interface EditorTarget {
8
8
  }
9
9
  export interface TerminalFontSizeHandlerOpts {
10
10
  discoverFn?: () => EditorTarget[];
11
- writeFn?: (path: string, data: string, encoding: BufferEncoding) => Promise<void>;
11
+ writeFn?: (destPath: string, data: string) => Promise<void>;
12
12
  }
13
13
  export declare function discoverEditors(): EditorTarget[];
14
14
  export declare function createTerminalFontSizeHandler(opts?: TerminalFontSizeHandlerOpts): ToolHandler;
@@ -10,5 +10,4 @@ export interface BurnRateProjection {
10
10
  readonly ratePerMs: number;
11
11
  }
12
12
  export declare function computeBurnRate(samples: readonly WindowObservationSample[], now: number, resetsAt?: number): BurnRateProjection | null;
13
- export declare const RING_SIZE: number;
14
13
  export declare function appendSample(ring: readonly WindowObservationSample[], sample: WindowObservationSample): WindowObservationSample[];
@@ -15,13 +15,17 @@ export interface PeerBoundaryOpts {
15
15
  peerNotifier: PeerInboxNotifier;
16
16
  admissionQueue: AdmissionQueue;
17
17
  isQueuedHumanTurn?: () => boolean;
18
- processJobNotifier?: InjectionSource;
18
+ processJobNotifier?: InjectionSource & {
19
+ hasPendingInjections(): boolean;
20
+ };
19
21
  }
20
22
  export declare function installPeerBoundary(opts: PeerBoundaryOpts): () => void;
21
23
  export declare function reinstallPeerBoundary(opts: PeerBoundaryOpts, prevDispose: (() => void) | undefined): () => void;
22
24
  export declare function drainAdmissionQueueFallback(text: string, q: AdmissionQueue): string;
23
25
  export declare function applyDeferPeers(runText: string, queuedHumanTurn: boolean, surface: Pick<InputSurface, 'getCompositor'>, shellPassthrough: InjectionSource, bgResultNotifier: InjectionSource, peerNotifier: InjectionSource, admissionQueue: AdmissionQueue, processJobNotifier?: InjectionSource): string;
24
- export declare function setupPeerBoundary(ctx: InteractiveCtx, surface: InputSurface, peerNotifier: PeerInboxNotifier, isQueuedHumanTurn: () => boolean, processJobNotifier?: InjectionSource): {
26
+ export declare function setupPeerBoundary(ctx: InteractiveCtx, surface: InputSurface, peerNotifier: PeerInboxNotifier, isQueuedHumanTurn: () => boolean, processJobNotifier?: InjectionSource & {
27
+ hasPendingInjections(): boolean;
28
+ }): {
25
29
  admissionQueue: AdmissionQueue;
26
30
  reinstall: () => void;
27
31
  };
@@ -7,7 +7,6 @@ export interface PeerInboxNotifierOpts {
7
7
  writeLine: (text: string) => void;
8
8
  mode?: () => PeerInboundMode;
9
9
  getTraceWriter?: () => TraceSink | undefined;
10
- traceWriter?: TraceSink;
11
10
  now?: () => number;
12
11
  pollMs?: number;
13
12
  }