agent-afk 5.318.0 → 5.318.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.
@@ -0,0 +1,12 @@
1
+ import type { HookContext, HookDecision } from './hooks.js';
2
+ export declare const SHADOW_GIT_REASON_PREFIX = "shadow-git observe-only";
3
+ export type ShadowGitHit = {
4
+ kind: 'no-verify';
5
+ pattern: string;
6
+ } | {
7
+ kind: 'identity';
8
+ pattern: string;
9
+ email: string;
10
+ };
11
+ export declare function detectShadowGit(command: string): ShadowGitHit[];
12
+ export declare function createShadowGitDetect(): (context: HookContext) => HookDecision;
@@ -0,0 +1,48 @@
1
+ import type { TraceEvent } from './types.js';
2
+ export type EffectClass = 'write' | 'execute' | 'git' | 'web' | 'other';
3
+ export declare function effectClassOf(toolName: string): EffectClass;
4
+ export interface BlockLedgerKey {
5
+ week: string;
6
+ surface: string;
7
+ blockedTool: string;
8
+ reason: string;
9
+ }
10
+ export interface BlockLedgerRow extends BlockLedgerKey {
11
+ count: number;
12
+ }
13
+ export declare function buildBlockLedger(_sessionId: string, events: TraceEvent[], surface: string): BlockLedgerRow[];
14
+ export interface EvasionCandidate {
15
+ sessionId: string;
16
+ blockSeq: number;
17
+ blockTs: string;
18
+ blockedTool: string;
19
+ reason: string;
20
+ effectClass: EffectClass;
21
+ evasionSeq: number;
22
+ differentTool: string;
23
+ toolCallDistance: number;
24
+ targetMatchUnavailable: true;
25
+ }
26
+ export declare function detectEvasions(sessionId: string, events: TraceEvent[], windowSize?: number): EvasionCandidate[];
27
+ export interface LostWorkCandidate {
28
+ sessionId: string;
29
+ blockSeq: number;
30
+ blockTs: string;
31
+ blockedTool: string;
32
+ reason: string;
33
+ effectClass: EffectClass;
34
+ closureReason: string;
35
+ targetMatchUnavailable: true;
36
+ }
37
+ export declare function detectLostWork(sessionId: string, events: TraceEvent[]): LostWorkCandidate[];
38
+ export interface BlockEvasionReport {
39
+ sessionId: string;
40
+ surface: string;
41
+ blockLedger: BlockLedgerRow[];
42
+ evasions: EvasionCandidate[];
43
+ lostWork: LostWorkCandidate[];
44
+ }
45
+ export declare function analyzeBlockEvasion(sessionId: string, events: TraceEvent[], opts?: {
46
+ evasionWindow?: number;
47
+ }): BlockEvasionReport;
48
+ export declare function formatBlockEvasionReport(report: BlockEvasionReport): string;