agent-afk 5.232.0 → 5.232.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/README.md +10 -11
- package/dist/agent/branch/branch-prune.d.ts +36 -0
- package/dist/bundled-plugins/awa-bundled/skills/fix-pr/SKILL.md +1 -1
- package/dist/cli/commands/branch.d.ts +2 -0
- package/dist/cli.mjs +250 -247
- package/dist/index.mjs +111 -111
- package/dist/telegram.mjs +129 -129
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,23 +19,22 @@ Open source. Runs locally. Works with any model provider, including local models
|
|
|
19
19
|
|
|
20
20
|
> ⭐ **Like the idea of an agent you can walk away from? [Star the repo](https://github.com/griffinwork40/agent-afk/stargazers)** -- it's the fastest way to help other people find it.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Quick Start
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm install -g agent-afk
|
|
25
|
+
npm install -g agent-afk # Node ≥ 22 required
|
|
26
|
+
afk login # authenticate (auto-detects Claude Code / Codex creds)
|
|
27
|
+
afk doctor # verify everything works
|
|
28
|
+
afk chat "hello" # first real conversation
|
|
26
29
|
```
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
That's it. You're in.
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
**Try without installing:** `npx agent-afk chat "hello"` runs a one-shot turn with zero global install.
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
afk --version # confirm the install (works before login)
|
|
34
|
-
afk doctor # environment self-check
|
|
35
|
-
afk chat "hello"
|
|
36
|
-
```
|
|
35
|
+
**Already using Claude Code or Codex?** `afk login` will detect your existing credentials automatically. Run `afk migrate` to import your plugins, skills, and MCP servers too -- it live-reads the source tool's dirs, so anything you install there keeps showing up in AFK with no re-run.
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
> 📖 **Full documentation at [docs.agentafk.com](https://docs.agentafk.com)** -- quickstart, configuration, model setup, surfaces, skills, and SDK reference.
|
|
39
38
|
|
|
40
39
|
## What you can do with it
|
|
41
40
|
|
|
@@ -231,7 +230,7 @@ With containment on (`default`), a file tool (read/write/edit/list/glob/grep) ta
|
|
|
231
230
|
|
|
232
231
|
## Troubleshooting
|
|
233
232
|
|
|
234
|
-
**`invalid x-api-key` / `ANTHROPIC_API_KEY not found`** — run `afk
|
|
233
|
+
**`invalid x-api-key` / `ANTHROPIC_API_KEY not found`** — run `afk login` to authenticate interactively, or set the key manually: `export ANTHROPIC_API_KEY=sk-ant-...` (or add it to `~/.afk/config/afk.env`). Run `afk doctor` to confirm.
|
|
235
234
|
|
|
236
235
|
**`Cannot send message: session is closed`** — the session timed out or was closed. Start a new one (`afk i` or a fresh `afk chat`).
|
|
237
236
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type ExecForBranchPrune = (file: string, args: string[], opts?: {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
}) => Promise<{
|
|
4
|
+
stdout: string;
|
|
5
|
+
stderr: string;
|
|
6
|
+
}>;
|
|
7
|
+
export type PrState = 'open' | 'merged' | 'closed' | 'none';
|
|
8
|
+
export type BranchVerdict = 'prune' | 'keep' | 'error';
|
|
9
|
+
export interface BranchCandidate {
|
|
10
|
+
remoteBranch: string;
|
|
11
|
+
shortName: string;
|
|
12
|
+
prState: PrState;
|
|
13
|
+
commitsAhead: number;
|
|
14
|
+
verdict: BranchVerdict;
|
|
15
|
+
reason: string;
|
|
16
|
+
errorDetail?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BranchPruneResult {
|
|
19
|
+
candidates: BranchCandidate[];
|
|
20
|
+
deleted: string[];
|
|
21
|
+
warnings: string[];
|
|
22
|
+
dryRun: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface BranchPruneOptions {
|
|
25
|
+
execFn: ExecForBranchPrune;
|
|
26
|
+
remote?: string;
|
|
27
|
+
baseBranch?: string;
|
|
28
|
+
branchPrefix?: string;
|
|
29
|
+
dryRun?: boolean;
|
|
30
|
+
cwd?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function parseGhPrState(ghOutput: string): PrState;
|
|
33
|
+
export declare function parseCommitsAhead(revListOutput: string): number;
|
|
34
|
+
export declare function classify(prState: PrState, commitsAhead: number): Pick<BranchCandidate, 'verdict' | 'reason'>;
|
|
35
|
+
export declare function listRemoteBranches(execFn: ExecForBranchPrune, remote: string, branchPrefix: string, cwd: string): Promise<string[]>;
|
|
36
|
+
export declare function runBranchPrune(options: BranchPruneOptions): Promise<BranchPruneResult>;
|
|
@@ -74,7 +74,7 @@ This phase validates each spec item independently before any writes begin. The g
|
|
|
74
74
|
|
|
75
75
|
**Fast-path:** if the numbered spec contains exactly 1 item, skip this phase entirely -- dispatch directly to Phase 3 with the raw spec item. The parallel wave's value is proportional to item count; for a single item the overhead exceeds the benefit.
|
|
76
76
|
|
|
77
|
-
**For 2+ spec items:** dispatch N read-only sub-agents in parallel via the `agent` tool (one call per spec item in the same tool-use turn -- pure fan-out).
|
|
77
|
+
**For 2+ spec items:** dispatch N read-only sub-agents in parallel via the `agent` tool (one call per spec item in the same tool-use turn -- pure fan-out). `compose` now supports `agent_type`, `cwd`, `readRoots`, and `writeRoots` per node (so the read-only and worktree-scoping guarantees are NOT silently lost when using compose), but the `agent` fan-out is preferred here: it gives simpler rate-limiting control (see the rate note below) and each probe is truly independent with no DAG dependencies to model. If DAG dependency tracking between probes matters for a future extension, compose is a valid alternative -- just wire `agent_type: "research-agent"` and `cwd: <worktree path>` on each node. Each probe:
|
|
78
78
|
|
|
79
79
|
- **agent_type:** `research-agent` (mechanically read-only -- cannot write files, run bash, or commit).
|
|
80
80
|
- **cwd:** `<worktree path>` (so file reads target the PR branch, not the main working tree).
|