agent-afk 5.7.0 → 5.8.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.
package/README.md CHANGED
@@ -159,6 +159,58 @@ afk --help # full command tree
159
159
 
160
160
  Aliases: `afk c` → `chat`, `afk i` → `interactive`, `afk s` → `status`.
161
161
 
162
+ ### Queue management
163
+
164
+ `afk queue` manages the pull-trigger daemon's task queue — tasks are persisted as JSON files and consumed one-by-one by `afk daemon --trigger pull`.
165
+
166
+ ```bash
167
+ afk queue add "/forge-friction --auto" --notify-on failure
168
+ # enqueue a command; daemon picks it up on next poll
169
+ afk queue list # print all pending tasks (id, enqueued time, command)
170
+ afk queue remove <id> # drop a single pending task by id
171
+ afk queue clear # remove all pending tasks (prompts for confirmation)
172
+ afk queue clear --yes # clear without prompting (CI / non-interactive)
173
+ ```
174
+
175
+ ### Self-improvement pipeline
176
+
177
+ `afk improve` is a zero-LLM, deterministic pipeline that mines `~/.afk/state/witness/` session traces for ranked failure patterns, without making any model calls.
178
+
179
+ ```bash
180
+ # Scan traces for failure patterns (dry-run; add --write to persist cards)
181
+ afk improve scan [--since 7d] [--write] [--only <detector,...>]
182
+
183
+ # Inspect failure cards
184
+ afk improve cards list [--pattern <name>] [--severity <level>] [--status open|deferred|resolved]
185
+ afk improve cards show <slug>
186
+ afk improve cards triage <slug> --note "..." [--status resolved]
187
+
188
+ # Draft a template-mode improvement proposal for a card (no LLM)
189
+ afk improve propose <slug> [--no-write]
190
+
191
+ # Generate a replay-mode eval-case from a failure card
192
+ afk improve eval-gen <cardSlug> [--evidence-row <i>] [--no-write]
193
+
194
+ # Run the deterministic guardrail contract for an eval-case
195
+ afk improve eval-run <evalCaseIdOrCardSlug> [--no-write]
196
+ ```
197
+
198
+ Available detectors (run `afk improve scan --help` for thresholds): `repeated-tool-use`, `subagent-block`, `closure-anomaly`, `tool-failure-density`.
199
+
200
+ ### Speculative branch farm
201
+
202
+ `afk farm` spawns N isolated git worktrees, runs an agent on each in parallel, scores the results (tests + lint + LoC delta), and prints a ranked summary.
203
+
204
+ ```bash
205
+ afk farm "add retry logic to the queue consumer" --branches 3
206
+ afk farm "<task>" -n 5 --model sonnet --fail-fast
207
+ afk farm "<task>" -n 3 --no-score # skip post-run scoring
208
+ afk farm "<task>" -n 3 --labels "approach-a,approach-b,approach-c"
209
+ afk farm "<task>" -n 3 --no-memory --no-digest # skip memory write + Telegram
210
+ ```
211
+
212
+ Each branch gets a dedicated worktree under `~/.afk/state/farm/`. A commit-count escape check confirms each agent did real work. On completion, the winner (branch that passes tests and makes the smallest net change) is surfaced; the rest are left for manual cherry-pick or deletion.
213
+
162
214
  ## A note on permissions
163
215
 
164
216
  `afk` does not prompt before each tool call — there is no per-tool approval flow. Claude runs bash, reads and writes files, fetches URLs, and calls MCP servers without asking each time. This is intentional — `afk` is built for unattended work, where a permission prompt with no human in front of it is just a wedged session.
@@ -11,3 +11,5 @@ export interface EnqueueOptions {
11
11
  export declare function enqueue(command: string, opts?: EnqueueOptions, queueDir?: string): QueuedTask;
12
12
  export declare function dequeueNext(queueDir?: string): QueuedTask | null;
13
13
  export declare function listPending(queueDir?: string): QueuedTask[];
14
+ export declare function removePending(queueDir: string | undefined, id: string): boolean;
15
+ export declare function clearPending(queueDir?: string): number;