agent-afk 5.168.2 → 5.169.1
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 +21 -25
- package/dist/agent/session/agent-session.d.ts +1 -0
- package/dist/agent/session/output-broadcast.d.ts +8 -0
- package/dist/agent/subagent/handle.d.ts +6 -0
- package/dist/cli/commands/interactive/shared.d.ts +1 -0
- package/dist/cli/commands/interactive/task-view-mid-turn.d.ts +9 -0
- package/dist/cli/commands/interactive/turn-handler.d.ts +1 -1
- package/dist/cli/input/input-surface.d.ts +2 -0
- package/dist/cli/slash/commands/tasks.d.ts +1 -0
- package/dist/cli/terminal-compositor.d.ts +1 -0
- package/dist/cli/terminal-compositor.input-dispatch.d.ts +1 -0
- package/dist/cli/terminal-compositor.types.d.ts +1 -0
- package/dist/cli.mjs +593 -579
- package/dist/index.mjs +205 -205
- package/dist/telegram.mjs +268 -268
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# Agent AFK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Start a task and walk away.** AFK builds the feature, verifies its own work, and texts you when it's done. You come back to a receipt of every step, every decision, and what's waiting on you.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
> Agent AFK isn't "smarter than Claude Code." It's *yours* in a way Claude Code can't be.
|
|
5
|
+
Open source. Runs locally. Works with any model provider, including local models. Your keys, your machine, your rules.
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/agent-afk)
|
|
10
8
|
[](https://github.com/griffinwork40/agent-afk/actions/workflows/ci.yml)
|
|
@@ -19,18 +17,7 @@
|
|
|
19
17
|
</video>
|
|
20
18
|
</p>
|
|
21
19
|
|
|
22
|
-
> ⭐ **Like the idea of an agent
|
|
23
|
-
|
|
24
|
-
## Claude Code vs. Agent AFK
|
|
25
|
-
|
|
26
|
-
| | Claude Code | Agent AFK |
|
|
27
|
-
|---|---|---|
|
|
28
|
-
| Harness | Closed binary | Apache-2.0, editable |
|
|
29
|
-
| The loop | You configure *around* it | You edit *the loop* |
|
|
30
|
-
| Behavior | Mostly fixed | Prompts, gates, routing, skills are code |
|
|
31
|
-
| Result | A great default agent | An agent system you own |
|
|
32
|
-
|
|
33
|
-
The model isn't the product — the loop is. Agent AFK hands you the loop as code: prompts, gates, routing, skills, traces, providers, terminal states. Edit any of them.
|
|
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.
|
|
34
21
|
|
|
35
22
|
## Install
|
|
36
23
|
|
|
@@ -57,11 +44,20 @@ afk chat "hello"
|
|
|
57
44
|
- **Read the trace** — every run writes an append-only record of what the agent did. `afk trace show` prints it back as a human-readable receipt — tool calls, gate decisions, subagent lifecycles, cost — so you can audit a run without reaching for `jq`.
|
|
58
45
|
- **Message Claude from Telegram** — `afk telegram setup` walks you through bot token + allowlist. After that you have a private chat surface backed by the same session manager as the REPL.
|
|
59
46
|
- **Built-in orchestrators** — `/mint`, `/diagnose`, `/spec`, `/research`, `/ship`, `/review` dispatch subagent waves. `/mint` takes a feature idea and runs spec → research → plan → parallelize → build → verify → ship. `/diagnose` forks parallel root-cause hypotheses for failing tests and bugs.
|
|
60
|
-
|
|
61
|
-
> **Agent AFK Pro:** Autonomous skill-generation (`/forge`) and the calibrated skill-qualification rubric (`/qualify`) are reserved for Agent AFK Pro and are not part of the open-source build.
|
|
62
47
|
- **Cross-session memory** — Claude remembers preferences, decisions, and procedures across runs. See [Memory](#memory) below.
|
|
63
48
|
- **Background subagent jobs** — dispatch a subagent with `mode:'background'`; results auto-deliver into the model's context when they finish. `/bgsub` lists running and completed jobs, `/bgsub:join <id>` replays a result manually.
|
|
64
49
|
|
|
50
|
+
## How it compares
|
|
51
|
+
|
|
52
|
+
| | Claude Code | Agent AFK |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| Harness | Closed binary | Apache-2.0, editable |
|
|
55
|
+
| The loop | You configure *around* it | You edit *the loop* |
|
|
56
|
+
| Behavior | Mostly fixed | Prompts, gates, routing, skills are code |
|
|
57
|
+
| Result | A great default agent | An agent system you own |
|
|
58
|
+
|
|
59
|
+
The model isn't the product -- the loop is. Agent AFK hands you the loop as code: prompts, gates, routing, skills, traces, providers, terminal states. Edit any of them.
|
|
60
|
+
|
|
65
61
|
## Four surfaces, one session manager
|
|
66
62
|
| Command | Surface |
|
|
67
63
|
|---|---|
|
|
@@ -251,15 +247,15 @@ Recent releases at [`CHANGELOG.md`](CHANGELOG.md), also viewable in-REPL via `/c
|
|
|
251
247
|
|
|
252
248
|
## License
|
|
253
249
|
|
|
254
|
-
Agent AFK is **open
|
|
255
|
-
Use it, modify it, fork it, embed it in commercial or closed-source products
|
|
250
|
+
Agent AFK is **open source**, licensed under **[Apache-2.0](LICENSE)** (SPDX: `Apache-2.0`).
|
|
251
|
+
Use it, modify it, fork it, embed it in commercial or closed-source products -- the
|
|
256
252
|
standard Apache conditions apply (keep the license and [`NOTICE`](NOTICE), note
|
|
257
253
|
significant changes, and don't use the "Agent AFK" name or marks to imply
|
|
258
|
-
endorsement). No copyleft, no CLA.
|
|
254
|
+
endorsement). No copyleft, no CLA. Every feature ships in the open-source repo --
|
|
255
|
+
there are no paid unlocks.
|
|
259
256
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
The core harness is, and will stay, free and open.
|
|
257
|
+
Paid plans are monthly support from the maintainer (setup, custom skills, tuning),
|
|
258
|
+
not feature gates. See [`LICENSING.md`](LICENSING.md).
|
|
263
259
|
|
|
264
260
|
Contributions are accepted under the [DCO](https://developercertificate.org/)
|
|
265
|
-
(`git commit -s`). "Agent AFK" is a trademark of Griffin Long.
|
|
261
|
+
(`git commit -s`). "Agent AFK" is a trademark of Griffin Long. (c) Griffin Long.
|
|
@@ -36,6 +36,7 @@ export declare class AgentSession implements IAgentSession {
|
|
|
36
36
|
private subagentRunningTokens;
|
|
37
37
|
private subagentRunningCostUsd;
|
|
38
38
|
private readonly ledger;
|
|
39
|
+
private readonly outputBroadcast;
|
|
39
40
|
constructor(config: AgentConfig, ownedTraceWriter?: TraceWriter);
|
|
40
41
|
private initSdkLifecycle;
|
|
41
42
|
private pullInitialization;
|
|
@@ -20,6 +20,8 @@ export interface SubagentHandle<T = unknown> {
|
|
|
20
20
|
deferInjectContextToCaller?: boolean;
|
|
21
21
|
}): Promise<void>;
|
|
22
22
|
getLastStopInjectContext(): string | undefined;
|
|
23
|
+
readonly durationMs: number | undefined;
|
|
24
|
+
sendMessage(text: string): void;
|
|
23
25
|
}
|
|
24
26
|
export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
25
27
|
readonly id: string;
|
|
@@ -55,6 +57,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
|
55
57
|
};
|
|
56
58
|
constructor(id: string, session: IAgentSession, _controller: AbortController, abortGraph: AbortGraph, _outputSchema: ZodType<T> | undefined, timeoutMs: number, _hookRegistry: HookRegistry | undefined, _onTerminal: () => void, _parentInputStreamRef?: ReturnType<IAgentSession["getInputStreamRef"]> | undefined, _parentAbortSignal?: AbortSignal | undefined, _agentType?: string | undefined, progressSink?: SubagentProgressSink, parentId?: string, _traceWriter?: TraceSink | undefined, onSubagentSucceeded?: ((usage: SubagentTrace["usage"], costUsd: number | undefined) => void) | undefined, _idleTimeoutMs?: number);
|
|
57
59
|
get status(): SubagentStatus;
|
|
60
|
+
get durationMs(): number | undefined;
|
|
58
61
|
run(prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<Message>;
|
|
59
62
|
runToResult(prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<SubagentResult<T>>;
|
|
60
63
|
runInBackground(prompt: string, onResult?: (result: SubagentResult<T>) => void, onProgress?: (event: OutputEvent) => void): void;
|
|
@@ -63,4 +66,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
|
63
66
|
deferInjectContextToCaller?: boolean;
|
|
64
67
|
}): Promise<void>;
|
|
65
68
|
getLastStopInjectContext(): string | undefined;
|
|
69
|
+
readonly _pendingUserMessages: string[];
|
|
70
|
+
private _drainingMessages;
|
|
71
|
+
sendMessage(text: string): void;
|
|
66
72
|
}
|
|
@@ -106,6 +106,7 @@ export interface TurnHandles {
|
|
|
106
106
|
setBackgroundHandler?(handler: (() => void) | null): void;
|
|
107
107
|
subagentControl?: SubagentControl;
|
|
108
108
|
setSoftStopHandler?(handler: (() => void) | null): void;
|
|
109
|
+
setTaskViewHandler?(handler: (() => boolean) | null): void;
|
|
109
110
|
setPausedState?(paused: boolean): void;
|
|
110
111
|
setPauseInterruptHandler?(handler: (() => void) | null): void;
|
|
111
112
|
onContextProgress?(): void | Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SubagentManager } from '../../../agent/subagent.js';
|
|
2
|
+
import type { TerminalCompositor } from '../../terminal-compositor.js';
|
|
3
|
+
import type { TurnHandles } from './shared.js';
|
|
4
|
+
export interface MidTurnTaskViewOptions {
|
|
5
|
+
manager: SubagentManager;
|
|
6
|
+
compositor: TerminalCompositor;
|
|
7
|
+
}
|
|
8
|
+
export declare function launchMidTurnTaskView(opts: MidTurnTaskViewOptions): Promise<boolean>;
|
|
9
|
+
export declare function createTaskViewHandler(h: Pick<TurnHandles, 'getCompositor' | 'setTaskViewHandler'>): (() => boolean) | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentSession } from '../../../agent/session.js';
|
|
2
2
|
import type { SessionStats } from '../../slash/types.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type ImageAttachment } from '../../input/attachments.js';
|
|
4
4
|
import type { InputSurfaceRefs } from '../../input/input-surface.js';
|
|
5
5
|
import { type CompletionWriter, type ThinkingUiMode, type TurnHandles } from './shared.js';
|
|
6
6
|
export { formatToolLine, formatToolResultLine, ToolLane } from './tool-lane.js';
|
|
@@ -49,6 +49,7 @@ export declare class InputSurface {
|
|
|
49
49
|
private armedStdout;
|
|
50
50
|
private backgroundHandler;
|
|
51
51
|
private softStopHandler;
|
|
52
|
+
private taskViewHandler;
|
|
52
53
|
private pauseInterruptHandler;
|
|
53
54
|
private pendingReadReject;
|
|
54
55
|
private pendingReadResolve;
|
|
@@ -59,6 +60,7 @@ export declare class InputSurface {
|
|
|
59
60
|
getCompositor(): TerminalCompositor | null;
|
|
60
61
|
setBackgroundHandler(handler: (() => void) | null): void;
|
|
61
62
|
setSoftStopHandler(handler: (() => void) | null): void;
|
|
63
|
+
setTaskViewHandler(handler: (() => boolean) | null): void;
|
|
62
64
|
setPauseInterruptHandler(handler: (() => void) | null): void;
|
|
63
65
|
setPausedState(paused: boolean): void;
|
|
64
66
|
suspendForElicitation(): void;
|
|
@@ -3,6 +3,7 @@ import type { SubagentManager } from '../../../agent/subagent.js';
|
|
|
3
3
|
import type { InteractiveCtx } from '../../commands/interactive/shared.js';
|
|
4
4
|
export declare function setTasksRegistry(manager: SubagentManager, sessionLabel: string): void;
|
|
5
5
|
export declare function setTasksIctx(ictx: InteractiveCtx): void;
|
|
6
|
+
export declare function getTasksManager(): SubagentManager | undefined;
|
|
6
7
|
export declare function resetTasksRegistry(): void;
|
|
7
8
|
export declare const tasksCmd: SlashCommand;
|
|
8
9
|
export declare const tasksViewCmd: SlashCommand;
|
|
@@ -23,6 +23,7 @@ export declare class TerminalCompositor {
|
|
|
23
23
|
lastIdleEscAt: number;
|
|
24
24
|
onPauseInterrupt?: () => void;
|
|
25
25
|
onShiftTab?: () => void;
|
|
26
|
+
onTaskView?: () => boolean;
|
|
26
27
|
onOpenEditor?: () => void;
|
|
27
28
|
readonly promptTextFn: () => string;
|
|
28
29
|
readonly history?: IHistoryRing;
|
|
@@ -43,6 +43,7 @@ export interface KeyDispatchHost {
|
|
|
43
43
|
readonly onRewindRequest?: () => void;
|
|
44
44
|
readonly onPauseInterrupt?: () => void;
|
|
45
45
|
readonly onShiftTab?: () => void;
|
|
46
|
+
readonly onTaskView?: () => boolean;
|
|
46
47
|
readonly onOpenEditor?: () => void;
|
|
47
48
|
readonly onSubmit?: (payload: SubmissionPayload) => void;
|
|
48
49
|
}
|
|
@@ -63,6 +63,7 @@ export interface TerminalCompositorOptions {
|
|
|
63
63
|
onBackground?: () => void;
|
|
64
64
|
onPauseInterrupt?: () => void;
|
|
65
65
|
onShiftTab?: () => void;
|
|
66
|
+
onTaskView?: () => boolean;
|
|
66
67
|
onOpenEditor?: () => void;
|
|
67
68
|
onSubmit?: (payload: SubmissionPayload) => void;
|
|
68
69
|
promptText?: string | (() => string);
|