agent-afk 5.26.1 → 5.26.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.
- package/dist/agent/ask-question-gate.d.ts +7 -0
- package/dist/agent/elicitation-router.d.ts +1 -0
- package/dist/bundled-plugins/awa-bundled/skills/diagnose/SKILL.md +11 -0
- package/dist/cli/commands/skill-router.d.ts +0 -1
- package/dist/cli.mjs +506 -782
- package/dist/index.mjs +189 -466
- package/dist/skills/all.d.ts +0 -1
- package/dist/skills/mint/_phases/heal.d.ts +1 -1
- package/dist/telegram.mjs +228 -504
- package/package.json +1 -1
- package/dist/skills/diagnose/_phases/orchestrator.d.ts +0 -8
- package/dist/skills/diagnose/_phases/triage.d.ts +0 -4
- package/dist/skills/diagnose/_phases/types.d.ts +0 -144
- package/dist/skills/diagnose/_phases/verifier.d.ts +0 -16
- package/dist/skills/diagnose/index.d.ts +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HookContext, HookDecision } from './hooks.js';
|
|
2
|
+
export declare const ASK_QUESTION_GATE_REASON: string;
|
|
3
|
+
export interface AskQuestionGateOptions {
|
|
4
|
+
hasHandler?: () => boolean;
|
|
5
|
+
notify?: (message: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createAskQuestionGate(options?: AskQuestionGateOptions): (context: HookContext) => HookDecision;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diagnose
|
|
3
|
+
description: "Parallel root-cause analysis for bugs and failing tests. Use when a test fails, a bug is reported, or behavior is unexplained — dispatches sub-agents to form and validate hypotheses in isolated worktrees."
|
|
4
|
+
context: fork
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Gather context: read the failing test or bug description, relevant error output, and recent git changes. If no failing test exists yet, write a minimal reproducer test (or identify a concrete verification command) before proceeding — hypotheses need a pass/fail signal to validate against. Dispatch two sub-agents in parallel — one to search the codebase for code paths involved in the failure (`subagent_type: research-agent`, read-only), and one to check recent commits and diffs that could have introduced the regression (`subagent_type: general-purpose` — requires Bash for `git log`/`git diff`/`git show`). When both return, synthesize findings into 2–4 ranked hypotheses, each with a specific code location and proposed cause.
|
|
8
|
+
|
|
9
|
+
For each hypothesis, first create a dedicated git worktree with the `worktree` tool (`action: "create"`, one per hypothesis), then dispatch a sub-agent with its `cwd` set to that worktree's absolute path. This is how afk isolates a sub-agent to its own tree — the `agent` tool has NO `isolation` parameter, so parallel agents that omit `cwd` all inherit the same working tree and would contaminate each other's speculative fixes and test runs, invalidating the pass/fail attribution. Each sub-agent applies a minimal speculative fix, runs the test or verification command, then runs the broader related test suite to check for regressions. Run all hypothesis-testing agents in parallel, each in its own worktree; after collecting a result, remove that worktree with the `worktree` tool (`action: "remove"`). Collect results: which fixes passed, which didn't, and any regressions surfaced by the broader suite.
|
|
10
|
+
|
|
11
|
+
Report the validated root cause (the hypothesis whose fix passed), the speculative fix diff, and regression status from the broader test run. If no hypothesis passes, synthesize what was learned and form a second round of hypotheses. If the user approves the fix, apply it to the main worktree.
|