agent-afk 5.313.6 → 5.313.7

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,4 +1,8 @@
1
1
  import { EffectStore } from './store.js';
2
2
  import type { HookHandler } from '../hooks.js';
3
+ export declare function createEffectLedgerHooks(store?: EffectStore): {
4
+ pre: HookHandler;
5
+ post: HookHandler;
6
+ };
3
7
  export declare function createEffectLedgerPostHook(store?: EffectStore): HookHandler;
4
8
  export declare function createEffectLedgerPreHook(pendingIds: Map<string, string>, store?: EffectStore): HookHandler;
@@ -1 +1 @@
1
- export { createEffectLedgerPostHook } from './hook.js';
1
+ export { createEffectLedgerHooks, createEffectLedgerPostHook } from './hook.js';
@@ -7,6 +7,7 @@ export declare class EffectStore {
7
7
  private invalidateCache;
8
8
  writePending(input: PendingEffectInput): EffectRecord;
9
9
  updateStatus(input: ExecuteEffectInput): Promise<EffectRecord>;
10
+ acknowledgeRetry(id: string): Promise<EffectRecord>;
10
11
  findByIdempotencyKey(key: string, sessionId?: string): Promise<EffectRecord | null>;
11
12
  query(filters?: EffectQuery): Promise<EffectRecord[]>;
12
13
  all(): Promise<EffectRecord[]>;
@@ -1,4 +1,4 @@
1
- export type EffectStatus = 'pending' | 'executed' | 'confirmed' | 'failed' | 'ambiguous';
1
+ export type EffectStatus = 'pending' | 'executed' | 'confirmed' | 'failed' | 'unknown' | 'ambiguous';
2
2
  export interface EffectRecord {
3
3
  v: 1;
4
4
  id: string;
@@ -9,6 +9,8 @@ export interface EffectRecord {
9
9
  sessionId?: string;
10
10
  taskId?: string;
11
11
  timestamp: number;
12
+ retryOf?: string;
13
+ retryAcknowledgedAt?: number;
12
14
  result?: unknown;
13
15
  reconciledAt?: number;
14
16
  }
@@ -24,6 +26,7 @@ export interface PendingEffectInput {
24
26
  args: unknown;
25
27
  sessionId?: string;
26
28
  taskId?: string;
29
+ retryOf?: string;
27
30
  }
28
31
  export interface ExecuteEffectInput {
29
32
  id: string;
@@ -53,6 +53,7 @@ export interface PreToolUseContext {
53
53
  }
54
54
  export interface PostToolUseContext {
55
55
  event: 'PostToolUse';
56
+ toolUseId?: string;
56
57
  sessionId?: string;
57
58
  subagentId?: string;
58
59
  parentSessionId?: string;
@@ -72,6 +73,7 @@ export interface PreCompactContext {
72
73
  }
73
74
  export interface PostToolUseFailureContext {
74
75
  event: 'PostToolUseFailure';
76
+ toolUseId?: string;
75
77
  sessionId?: string;
76
78
  subagentId?: string;
77
79
  parentSessionId?: string;
@@ -20,5 +20,12 @@ export declare function safeText(res: Response): Promise<string>;
20
20
  export declare function clearOidcCache(): void;
21
21
  export declare function discoverXaiOidc(deps?: OAuthHttpDeps): Promise<XaiOidcDiscovery>;
22
22
  export declare function discoverXaiOidcCached(deps?: OAuthHttpDeps): Promise<XaiOidcDiscovery>;
23
+ export interface RawPostResult {
24
+ ok: boolean;
25
+ status: number;
26
+ json: Record<string, unknown>;
27
+ text: string;
28
+ }
29
+ export declare function rawPostOAuthForm(url: string, params: Record<string, string>, fetchFn?: FetchFn): Promise<RawPostResult>;
23
30
  export declare function postOAuthForm(url: string, params: Record<string, string>, errPrefix: string, fetchFn?: FetchFn): Promise<Record<string, unknown>>;
24
31
  export declare function tokenResponseToBundle(json: Record<string, unknown>, nowSeconds?: () => number, fallbackRefresh?: string): XaiTokenBundle | null;
@@ -32,8 +32,8 @@ export interface CoreExecDeps {
32
32
  export declare function isRegisteredTool(toolName: string, deps: CoreExecDeps): boolean;
33
33
  export declare function unknownToolMessage(toolName: string, deps: CoreExecDeps): string;
34
34
  export declare function denialReason(toolName: string, permissionReason: string | undefined, deps: CoreExecDeps): string;
35
- export declare function firePostToolUse(toolName: string, output: string, signal: AbortSignal, deps: CoreExecDeps, input?: unknown, resultFlags?: Pick<ToolResult, 'incomplete' | 'incompleteReason' | 'isError'>): void;
36
- export declare function firePostToolUseFailure(toolName: string, errorMessage: string, signal: AbortSignal, deps: CoreExecDeps, input?: unknown): void;
35
+ export declare function firePostToolUse(toolName: string, output: string, signal: AbortSignal, deps: CoreExecDeps, input?: unknown, resultFlags?: Pick<ToolResult, 'incomplete' | 'incompleteReason' | 'isError'>, toolUseId?: string): void;
36
+ export declare function firePostToolUseFailure(toolName: string, errorMessage: string, signal: AbortSignal, deps: CoreExecDeps, input?: unknown, toolUseId?: string): void;
37
37
  export declare function applyOutputCap(result: ToolResult, deps: CoreExecDeps): ToolResult;
38
38
  export declare function executeCompose(call: ToolCall, deps: CoreExecDeps): Promise<ToolResult>;
39
39
  export declare function executeCoreInner(call: ToolCall, deps: CoreExecDeps): Promise<ToolResult>;