agent-afk 5.262.1 → 5.264.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.
@@ -0,0 +1,2 @@
1
+ import type { HookHandler } from '../hooks.js';
2
+ export declare function createChildAttributionHook(): HookHandler;
@@ -8,3 +8,14 @@ export type { PrState, FetchPrState, CheckAncestor, CheckRevert, GetDefaultBranc
8
8
  export { parsePrUrl, lfPrFate, lfCommitSurvival, lfFixOfFix, realFetchPrState, realCheckAncestor, realCheckRevert, } from './lf-delayed.js';
9
9
  export type { CombinerInput, CombinerResult } from './combine.js';
10
10
  export { combine, computeConfidence } from './combine.js';
11
+ export type { UpsertVotesOptions } from './store.js';
12
+ export { readRecord, writeRecord, listRecords, upsertVotes, appendArtifacts } from './store.js';
13
+ export { createOutcomeSessionEndHook } from './session-end-hook.js';
14
+ export { createChildAttributionHook } from './child-attribution.js';
15
+ export { lfReask, normalizeTokens, jaccardSimilarity, REASK_THRESHOLD } from './lf-reask.js';
16
+ export type { ExecFnCi } from './lf-ci.js';
17
+ export { lfCi, realExecFnCi } from './lf-ci.js';
18
+ export type { ExecFnFof } from './lf-fof.js';
19
+ export { lfFixOfFix as lfFixOfFixDelayed, realExecFnFof } from './lf-fof.js';
20
+ export type { RelabelDeps, RelabelJobOptions, RelabelJobResult, ProcessResult } from './relabel-job.js';
21
+ export { runRelabelJob, processRecord, realRelabelDeps } from './relabel-job.js';
@@ -0,0 +1,7 @@
1
+ import type { Vote } from './schema.js';
2
+ export type ExecFnCi = (file: string, args: string[]) => Promise<{
3
+ stdout: string;
4
+ stderr: string;
5
+ }>;
6
+ export declare function lfCi(prUrls: string[], execFn: ExecFnCi, now: string, cache?: Map<string, 'passed' | 'failed' | 'pending' | 'none' | 'error'>): Promise<Vote[]>;
7
+ export declare const realExecFnCi: ExecFnCi;
@@ -0,0 +1,7 @@
1
+ import type { Vote } from './schema.js';
2
+ export type ExecFnFof = (file: string, args: string[]) => Promise<{
3
+ stdout: string;
4
+ stderr: string;
5
+ }>;
6
+ export declare function lfFixOfFix(prUrls: string[], settlesAfter: string | null, execFn: ExecFnFof, now: string, nowDate?: Date): Promise<Vote[]>;
7
+ export declare const realExecFnFof: ExecFnFof;
@@ -0,0 +1,4 @@
1
+ export declare const REASK_THRESHOLD = 0.6;
2
+ export declare function normalizeTokens(text: string): Set<string>;
3
+ export declare function jaccardSimilarity(a: Set<string>, b: Set<string>): number;
4
+ export declare function lfReask(newSessionId: string, newPrompt: string, newCwd: string | undefined, now: string): void;
@@ -0,0 +1,32 @@
1
+ import type { FetchPrState, CheckAncestor, CheckRevert } from './lf-delayed.js';
2
+ import type { ExecFnCi } from './lf-ci.js';
3
+ import type { ExecFnFof } from './lf-fof.js';
4
+ export interface RelabelDeps {
5
+ fetchPrState: FetchPrState;
6
+ checkAncestor: CheckAncestor;
7
+ checkRevert: CheckRevert;
8
+ execFnCi: ExecFnCi;
9
+ execFnFof: ExecFnFof;
10
+ now: () => Date;
11
+ outcomesDir?: string;
12
+ }
13
+ export declare const realRelabelDeps: RelabelDeps;
14
+ export interface RelabelJobOptions {
15
+ limit?: number;
16
+ dryRun?: boolean;
17
+ deps?: RelabelDeps;
18
+ outcomesDir?: string;
19
+ }
20
+ export interface RelabelJobResult {
21
+ scanned: number;
22
+ settled: number;
23
+ updated: number;
24
+ skipped: number;
25
+ errors: number;
26
+ }
27
+ export interface ProcessResult {
28
+ status: 'settled' | 'updated' | 'skipped' | 'error';
29
+ reason?: string;
30
+ }
31
+ export declare function processRecord(sessionId: string, deps: RelabelDeps, dryRun: boolean, outcomesDir?: string): Promise<ProcessResult>;
32
+ export declare function runRelabelJob(opts?: RelabelJobOptions): Promise<RelabelJobResult>;
@@ -69,6 +69,8 @@ export declare const VerifiedOutcomeSchema: z.ZodObject<{
69
69
  label: z.ZodString;
70
70
  reason: z.ZodString;
71
71
  }, z.core.$strip>>;
72
+ first_prompt: z.ZodOptional<z.ZodString>;
73
+ first_cwd: z.ZodOptional<z.ZodString>;
72
74
  }, z.core.$strip>;
73
75
  export type VerifiedOutcome = z.infer<typeof VerifiedOutcomeSchema>;
74
76
  export type OutcomeLabel = VerifiedOutcome['label'];
@@ -0,0 +1,2 @@
1
+ import type { HookHandler } from '../hooks.js';
2
+ export declare function createOutcomeSessionEndHook(): HookHandler;
@@ -0,0 +1,13 @@
1
+ import { type VerifiedOutcome, type Vote } from './schema.js';
2
+ export declare function readRecord(sessionId: string, outcomesDir?: string): VerifiedOutcome | undefined;
3
+ export declare function writeRecord(outcome: VerifiedOutcome, outcomesDir?: string): void;
4
+ export declare function listRecords(limit?: number, outcomesDir?: string): string[];
5
+ export interface UpsertVotesOptions {
6
+ outcomesDir?: string;
7
+ }
8
+ export declare function upsertVotes(sessionId: string, newVotes: Vote[], base?: Omit<VerifiedOutcome, 'votes' | 'history'>, opts?: UpsertVotesOptions): VerifiedOutcome;
9
+ export declare function appendArtifacts(sessionId: string, incoming: {
10
+ commits?: string[];
11
+ prs?: string[];
12
+ repo?: string | null;
13
+ }, opts?: UpsertVotesOptions): void;
@@ -0,0 +1 @@
1
+ export declare function scrubBashEnv(env: Record<string, string | undefined> | undefined): Record<string, string | undefined>;
@@ -0,0 +1,3 @@
1
+ import type { SlashCommand } from '../types.js';
2
+ export declare const goodCmd: SlashCommand;
3
+ export declare const badCmd: SlashCommand;