agent-afk 5.168.1 → 5.169.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
@@ -1,10 +1,8 @@
1
1
  # Agent AFK
2
2
 
3
- > **Claude Code decides how the agent behaves. Agent AFK lets you edit the rules.**
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
- **Agent AFK** is an open-source coding-agent harness you can actually change. Run long coding tasks while you're away, use any model, and edit the rules that decide what the agent can touch, when it stops, and how it proves the work.
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
  [![npm version](https://img.shields.io/npm/v/agent-afk.svg)](https://www.npmjs.com/package/agent-afk)
10
8
  [![CI](https://github.com/griffinwork40/agent-afk/actions/workflows/ci.yml/badge.svg)](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 loop you fully own? [Star the repo](https://github.com/griffinwork40/agent-afk/stargazers)** — it's the fastest way to help other people find it.
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 core**, licensed under **[Apache-2.0](LICENSE)** (SPDX: `Apache-2.0`).
255
- Use it, modify it, fork it, embed it in commercial or closed-source products — the
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
- **Pro & Team add-ons** (premium skill packs, team features, priority support) are
261
- separate commercial products under their own terms — see [`LICENSING.md`](LICENSING.md).
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. © 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;
@@ -0,0 +1,8 @@
1
+ import type { OutputEvent } from '../types/session-types.js';
2
+ export declare class OutputBroadcast {
3
+ private readonly subscribers;
4
+ private closed;
5
+ push(event: OutputEvent): void;
6
+ close(): void;
7
+ subscribe(): AsyncIterable<OutputEvent>;
8
+ }
@@ -20,6 +20,7 @@ export interface SubagentHandle<T = unknown> {
20
20
  deferInjectContextToCaller?: boolean;
21
21
  }): Promise<void>;
22
22
  getLastStopInjectContext(): string | undefined;
23
+ sendMessage(text: string): void;
23
24
  }
24
25
  export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
25
26
  readonly id: string;
@@ -63,4 +64,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
63
64
  deferInjectContextToCaller?: boolean;
64
65
  }): Promise<void>;
65
66
  getLastStopInjectContext(): string | undefined;
67
+ readonly _pendingUserMessages: string[];
68
+ private _drainingMessages;
69
+ sendMessage(text: string): void;
66
70
  }
@@ -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 { ImageAttachment } from '../../input/attachments.js';
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';
@@ -1,7 +1,7 @@
1
1
  import { Command } from 'commander';
2
2
  import { type OpenAIAuthSource, type AuthResolverDeps } from '../../agent/providers/openai-compatible/auth.js';
3
3
  import { type XaiAuthSource, type XaiAuthResolverDeps } from '../../agent/providers/xai/auth.js';
4
- export declare function buildProviderAuthDiagnose(explicitConfigKey: string | undefined, deps?: AuthResolverDeps): {
4
+ export declare function buildProviderAuthDiagnose(explicitConfigKey: string | undefined, deps?: AuthResolverDeps, forceChatgptOAuth?: boolean): {
5
5
  source: OpenAIAuthSource;
6
6
  message: string;
7
7
  exitCode: number;
@@ -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);