agent-afk 5.261.5 → 5.261.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 +1 @@
1
- export declare const WHATIF_USAGE = "afk whatif \u2014 predict the behavioural impact of a proposed change.\n\nUSAGE\n afk whatif [change text...] [flags]\n /whatif [change text...] [flags]\n\nEXAMPLES\n # Plain English \u2014 compiled to a ChangeSpec, confirmed before running\n afk whatif \"turn off auto-routing\"\n afk whatif \"always ask before using tools\"\n\n # Explicit flags (can be combined and repeated)\n afk whatif --append \"Always ask a clarifying question before running tools.\"\n afk whatif --model claude-haiku-4-5 --verify\n afk whatif --memory-add \"prefers pnpm test:file\" --memory-category preference\n\n # Load a prepared ChangeSpec file\n afk whatif --spec ./my-change.json\n\n # Quick single-turn estimate\n afk whatif \"disable diagnose skill\" --quick\n\n # Full verification with custom judge and budget\n afk whatif --append \"Never use bash\" --verify --judge claude --max-usd 3\n\nCHANGE FLAGS (accumulate in order)\n --append <text> Append text to your AFK.md (user scope)\n --append-project <text> Append text to project AFK.md\n --file <path>=<localfile> Set a file (path: home:<rel> or project:<rel>)\n --hot <localfile> Replace HOT.md with a local file's content\n --memory-add <text> Add a memory fact\n --memory-category <cat> Category for the next --memory-add\n (preference|convention|decision|learning; default: preference)\n --memory-remove <id> Remove a memory fact by numeric id\n --disable-skill <name> Disable a skill by name\n --disable-plugin <name> Disable a plugin by name\n --model <id> Test a different candidate model\n --effort <level> Test a different effort level\n --env KEY=VALUE Set an env var in the candidate sandbox\n --spec <file.json> Load a full ChangeSpec from a JSON file\n\nRUN OPTIONS\n --agent-model <id> Model the agent under test uses (default: current)\n --analyst-model <id> Model for compile/predict/judge (default: sonnet)\n --verify Run episodes and verify predictions empirically\n --quick Single-turn episodes (sets --max-turns 1)\n --turns <n> Real turns to replay (default: 12)\n --samples <n> Samples per episode per environment (default: 3)\n --max-usd <n> Budget cap in USD (default: 5)\n --judge auto|jev|claude Judge to use (default: auto)\n --concurrency <n> Parallel episodes (default: 4)\n --max-turns <n> Max turns per episode (default: 3)\n --timeout <sec> Episode timeout in seconds (default: 180)\n --keep-sandboxes Keep sandbox directories after run\n --yes Skip confirmation of compiled spec\n --json Print results as JSON to stdout\n";
1
+ export declare const WHATIF_USAGE = "afk whatif \u2014 predict the behavioural impact of a proposed change.\n\nUSAGE\n afk whatif [change text...] [flags]\n /whatif [change text...] [flags]\n\nEXAMPLES\n # Plain English \u2014 compiled to a ChangeSpec, confirmed before running\n afk whatif \"turn off auto-routing\"\n afk whatif \"always ask before using tools\"\n\n # Explicit flags (can be combined and repeated)\n afk whatif --append \"Always ask a clarifying question before running tools.\"\n afk whatif --model claude-haiku-4-5 --verify\n afk whatif --memory-add \"prefers pnpm test:file\" --memory-category preference\n\n # Load a prepared ChangeSpec file\n afk whatif --spec ./my-change.json\n\n # Quick single-turn estimate\n afk whatif \"disable diagnose skill\" --quick\n\n # Full verification with custom judge and budget\n afk whatif --append \"Never use bash\" --verify --judge claude --max-usd 3\n\nCHANGE FLAGS (accumulate in order)\n --append <text> Append text to your AFK.md (user scope)\n --append-project <text> Append text to project AFK.md\n --file <path>=<localfile> Set a file (path: home:<rel> or project:<rel>)\n --hot <localfile> Replace HOT.md with a local file's content\n --memory-add <text> Add a memory fact\n --memory-category <cat> Category for the next --memory-add\n (preference|convention|decision|learning; default: preference)\n --memory-remove <id> Remove a memory fact by numeric id\n --disable-skill <name> Disable a skill by name\n --disable-plugin <name> Disable a plugin by name\n --model <id> Test a different candidate model\n --effort <level> Test a different effort level\n --env KEY=VALUE Set an env var in the candidate sandbox\n --spec <file.json> Load a full ChangeSpec from a JSON file\n\nRUN OPTIONS\n --agent-model <id> Model the agent under test uses (default: current)\n --analyst-model <id> Model for compile/predict/judge (default: sonnet)\n --verify Run episodes and verify predictions empirically\n --quick Single-turn episodes (sets --max-turns 1)\n --turns <n> Real turns to replay (default: 12)\n --samples <n> Samples per episode per environment (default: 3)\n --max-usd <n> Budget cap in USD (default: 5)\n --judge auto|jev|claude Judge to use (default: auto)\n --concurrency <n> Parallel episodes (default: 4)\n --max-turns <n> Max turns per episode (default: 3)\n --timeout <sec> Episode timeout in seconds (default: 180)\n --keep-sandboxes Keep sandbox directories after run\n --yes Skip confirmation of compiled spec\n --json Print results as JSON to stdout\n\nENV VARS (episode behaviour)\n AFK_WHATIF_KEEP_CONTEXT_HOOKS=1\n Keep SessionStart and UserPromptSubmit hooks enabled inside episodes.\n By default those hooks are disabled so both arms see byte-identical\n first user messages. Set this when your change specifically tests\n context-injecting hook behaviour. The engine sets it automatically\n when the change spec targets hooks or plugins (disable-plugin, or a\n file change to afk.config.json or a hooks.json manifest).\n";
@@ -1,6 +1,6 @@
1
1
  export { runWhatif, WhatifBudgetError } from './run.js';
2
2
  export { computeStructuralImpact } from './structural.js';
3
- export type { Change, ChangeKind, ChangeSpec, LaunchSettings, Environment, OperatorContext, ChangeOperator, RequestSnapshot, StructuralImpact, PredictionDirection, Confidence, Prediction, Episode, ToolRequest, EpisodeTrace, RunnerOptions, AgentRunner, EpisodeFeatures, JudgeQuestion, JudgeInput, JudgeResult, Judge, RateComparison, Verdict, VerifiedPrediction, DiscoveredDifference, FeatureDelta, VerifyResult, WhatifReport, WhatifStage, WhatifProgress, CompleteFn, WhatifOptions, WhatifDeps, } from './types.js';
3
+ export type { Change, ChangeKind, ChangeSpec, LaunchSettings, Environment, OperatorContext, ChangeOperator, RequestSnapshot, StructuralImpact, PredictionDirection, Confidence, Prediction, Episode, ToolRequest, EpisodeTrace, RunnerOptions, AgentRunner, EpisodeFeatures, JudgeQuestion, JudgeInput, JudgeResult, Judge, RateComparison, Verdict, VerifiedPrediction, PredictionScope, DiscoveredDifference, FeatureDelta, VerifyResult, WhatifReport, WhatifStage, WhatifProgress, CompleteFn, WhatifOptions, WhatifDeps, } from './types.js';
4
4
  export { renderTerminal, renderMarkdown } from './report.js';
5
5
  export { createAfkRunner } from './runner/afk-runner.js';
6
6
  export { createAnthropicComplete } from './complete.js';
@@ -1,6 +1,6 @@
1
1
  import type { ThemePalette } from '../cli/palette.js';
2
2
  import type { WhatifReport } from './types.js';
3
- export declare function buildHeadline(report: Omit<WhatifReport, 'headline'>): string;
3
+ export { buildHeadline } from './report.headline.js';
4
4
  export declare function renderMarkdown(report: WhatifReport): string;
5
5
  export declare function renderTerminal(report: WhatifReport, palette: ThemePalette): string[];
6
6
  export declare function standardLimits(opts: {
@@ -0,0 +1,2 @@
1
+ import type { WhatifReport } from './types.js';
2
+ export declare function buildHeadline(report: Omit<WhatifReport, 'headline'>): string;
@@ -1,2 +1,8 @@
1
- import type { VerifyResult } from './types.js';
1
+ import type { VerifyResult, ChangeSpec } from './types.js';
2
+ import type { StructuralImpact } from './types.js';
3
+ export declare function specTargetsHooksOrPlugins(spec: ChangeSpec): boolean;
2
4
  export declare function verifyShortfallLimits(v: VerifyResult): string[];
5
+ export declare function hookIsolationLimits(opts: {
6
+ keepContextHooks: boolean;
7
+ structural: Pick<StructuralImpact, 'userMessageDiff'>;
8
+ }): string[];
@@ -0,0 +1,7 @@
1
+ import type { Episode, EpisodeTrace, Prediction, VerifiedPrediction } from './types.js';
2
+ type Arm = 'baseline' | 'candidate';
3
+ export type JudgeResults = Map<string, Record<string, number>>;
4
+ export declare function traceKey(trace: Pick<EpisodeTrace, 'episodeId' | 'env' | 'sample'>): string;
5
+ export declare function scoresForQuestion(qid: string, env: Arm, goodTraces: EpisodeTrace[], judgeResults: JudgeResults, include?: (episodeId: string) => boolean): number[];
6
+ export declare function scorePrediction(prediction: Prediction, episodes: Episode[], goodTraces: EpisodeTrace[], judgeResults: JudgeResults): VerifiedPrediction;
7
+ export {};
@@ -175,10 +175,19 @@ export interface RateComparison {
175
175
  };
176
176
  }
177
177
  export type Verdict = 'confirmed' | 'refuted' | 'unclear';
178
+ export interface PredictionScope {
179
+ episodes: {
180
+ baseline: string[];
181
+ candidate: string[];
182
+ };
183
+ targetedEpisodes: number;
184
+ background?: RateComparison;
185
+ }
178
186
  export interface VerifiedPrediction {
179
187
  prediction: Prediction;
180
188
  rates: RateComparison;
181
189
  verdict: Verdict;
190
+ scope?: PredictionScope;
182
191
  }
183
192
  export interface DiscoveredDifference {
184
193
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-afk",
3
- "version": "5.261.5",
3
+ "version": "5.261.7",
4
4
  "description": "Open-source coding-agent harness you can actually change — own the loop (prompts, gates, routing, skills, terminal states), use any model, run long tasks while you're away.",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",