agent-afk 5.20.4 → 5.20.6
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/providers/anthropic-direct/auth.d.ts +2 -1
- package/dist/agent/providers/anthropic-direct/index.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/tracing-fetch.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/usage-limit.d.ts +4 -0
- package/dist/agent/tools/nesting.d.ts +3 -3
- package/dist/agent/tools/skill-executor.d.ts +3 -1
- package/dist/agent/tools/subagent-executor.d.ts +2 -2
- package/dist/agent/trace/events.d.ts +4 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/agent/trace/writer.d.ts +1 -0
- package/dist/bundled-plugins/awa-bundled/.claude-plugin/plugin.json +1 -1
- package/dist/bundled-plugins/awa-bundled/skills/automate/SKILL.md +1 -0
- package/dist/bundled-plugins/awa-bundled/skills/research/SKILL.md +1 -1
- package/dist/bundled-plugins/awa-bundled/skills/review/SKILL.md +1 -1
- package/dist/bundled-plugins/awa-bundled/skills/shadow-verify/SKILL.md +1 -1
- package/dist/bundled-plugins/awa-bundled/skills/simplify/SKILL.md +1 -1
- package/dist/cli/commands/interactive/shared.d.ts +2 -2
- package/dist/cli/slash/commands/thinking.d.ts +2 -0
- package/dist/cli/slash/types.d.ts +2 -0
- package/dist/cli.mjs +450 -454
- package/dist/index.mjs +148 -148
- package/dist/telegram.mjs +204 -208
- package/package.json +1 -1
|
@@ -5,12 +5,13 @@ export declare const EFFORT_BETA_HEADER = "effort-2025-11-24";
|
|
|
5
5
|
export declare const CLI_USER_AGENT = "claude-cli/1.0.0 (external, cli)";
|
|
6
6
|
export declare const BILLING_HEADER_TEXT = "x-anthropic-billing-header: cc_version=1.0.0.test; cc_entrypoint=cli; cch=00000;";
|
|
7
7
|
export declare function detectAuthMode(token: string): AuthMode;
|
|
8
|
-
export declare function buildClientOptions(token: string, mode: AuthMode, baseUrl?: string): ({
|
|
8
|
+
export declare function buildClientOptions(token: string, mode: AuthMode, baseUrl?: string, fetchImpl?: typeof fetch): ({
|
|
9
9
|
authToken: string;
|
|
10
10
|
} | {
|
|
11
11
|
apiKey: string;
|
|
12
12
|
}) & {
|
|
13
13
|
baseURL?: string;
|
|
14
|
+
fetch?: typeof fetch;
|
|
14
15
|
};
|
|
15
16
|
export declare function buildRequestHeaders(mode: AuthMode, sessionId: string, requestId: string, withEffort?: boolean): Record<string, string>;
|
|
16
17
|
export declare function buildSystemPrefix(mode: AuthMode): ContentBlockParam[] | null;
|
|
@@ -15,6 +15,7 @@ export type AnthropicClientFactory = (opts: ({
|
|
|
15
15
|
apiKey: string;
|
|
16
16
|
}) & {
|
|
17
17
|
baseURL?: string;
|
|
18
|
+
fetch?: typeof fetch;
|
|
18
19
|
}) => Anthropic;
|
|
19
20
|
export declare function __setAnthropicClientFactory(factory: AnthropicClientFactory | null): void;
|
|
20
21
|
export interface AnthropicDirectProviderOptions {
|
|
@@ -3,9 +3,13 @@ export type UsageLimitClassification = {
|
|
|
3
3
|
resetsAt: Date;
|
|
4
4
|
} | {
|
|
5
5
|
kind: 'oauth-limit-no-ts';
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'rate-limit-transient';
|
|
8
|
+
retryAfterMs?: number;
|
|
6
9
|
} | {
|
|
7
10
|
kind: 'credit-exhausted';
|
|
8
11
|
};
|
|
12
|
+
export declare function parseRetryAfterMs(error: unknown): number | undefined;
|
|
9
13
|
export declare function classifyUsageLimitError(error: Error): UsageLimitClassification | null;
|
|
10
14
|
export interface WaitForResetOpts {
|
|
11
15
|
resetsAt: Date;
|
|
@@ -23,8 +23,8 @@ export interface CreateChildProviderFactoryOptions {
|
|
|
23
23
|
openaiBaseUrl?: string;
|
|
24
24
|
}
|
|
25
25
|
export declare function createChildProviderFactory(opts?: CreateChildProviderFactoryOptions): (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
26
|
-
export declare function buildReadOnlyReconProvider(model: AgentModelInput | undefined): ModelProvider;
|
|
27
|
-
export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceWriter, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry): (depth: number, maxDepth: number, signal: AbortSignal) => SkillExecutor;
|
|
26
|
+
export declare function buildReadOnlyReconProvider(model: AgentModelInput | undefined, openaiBaseUrl?: string): ModelProvider;
|
|
27
|
+
export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceWriter, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string) => SkillExecutor;
|
|
28
28
|
export type PhaseRole = 'read-only' | 'read-write';
|
|
29
|
-
export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean): ModelProvider;
|
|
29
|
+
export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean, openaiBaseUrl?: string): ModelProvider;
|
|
30
30
|
export declare function buildPhaseRestrictedProvider(_role: 'read-only', model: AgentModelInput | undefined): ModelProvider;
|
|
@@ -14,11 +14,12 @@ export interface SkillExecutorContext {
|
|
|
14
14
|
apiKey?: string;
|
|
15
15
|
resolveApiKeyForModel?: (model: string) => string | undefined;
|
|
16
16
|
baseUrl?: string;
|
|
17
|
+
openaiBaseUrl?: string;
|
|
17
18
|
pluginConfigs?: SdkPluginConfig[];
|
|
18
19
|
depth?: number;
|
|
19
20
|
maxDepth?: number;
|
|
20
21
|
childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
21
|
-
childSkillExecutorFactory?: (depth: number, maxDepth: number, signal: AbortSignal) => SkillExecutor;
|
|
22
|
+
childSkillExecutorFactory?: (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string) => SkillExecutor;
|
|
22
23
|
traceWriter?: TraceWriter;
|
|
23
24
|
backgroundRegistry?: BackgroundAgentRegistry;
|
|
24
25
|
cwd?: string;
|
|
@@ -41,6 +42,7 @@ export declare class SkillExecutor {
|
|
|
41
42
|
private executeLoadedPluginSkill;
|
|
42
43
|
private substituteSkillArgs;
|
|
43
44
|
private executePluginSkill;
|
|
45
|
+
private runForkedSkillToResult;
|
|
44
46
|
private getPluginSkillBody;
|
|
45
47
|
private createDispatchSkillCallback;
|
|
46
48
|
}
|
|
@@ -12,12 +12,12 @@ export { DEFAULT_MAX_NESTING_DEPTH, type ChildProviderFactoryArgs } from './nest
|
|
|
12
12
|
export interface SubagentExecutorContext {
|
|
13
13
|
subagentManager: SubagentManager;
|
|
14
14
|
parentSession: Pick<IAgentSession, 'sessionId' | 'getInputStreamRef' | 'abortSignal'> & Partial<Pick<IAgentSession, 'hookRegistry'>>;
|
|
15
|
-
defaultConfig: Pick<AgentConfig, 'apiKey' | 'systemPrompt' | 'baseUrl'>;
|
|
15
|
+
defaultConfig: Pick<AgentConfig, 'apiKey' | 'systemPrompt' | 'baseUrl' | 'openaiBaseUrl'>;
|
|
16
16
|
surface?: Surface;
|
|
17
17
|
resolveApiKeyForModel?: (model: string) => string | undefined;
|
|
18
18
|
defaultSubagentModel?: AgentModelInput;
|
|
19
19
|
childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
20
|
-
childSkillExecutorFactory?: (depth: number, maxDepth: number, signal: AbortSignal) => SkillExecutor;
|
|
20
|
+
childSkillExecutorFactory?: (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string) => SkillExecutor;
|
|
21
21
|
depth: number;
|
|
22
22
|
maxDepth?: number;
|
|
23
23
|
backgroundRegistry?: BackgroundAgentRegistry;
|
|
@@ -446,6 +446,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
446
446
|
loop_start: "loop_start";
|
|
447
447
|
loop_end: "loop_end";
|
|
448
448
|
model_ttfb: "model_ttfb";
|
|
449
|
+
rate_limit: "rate_limit";
|
|
449
450
|
}>;
|
|
450
451
|
export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
451
452
|
phase: z.ZodEnum<{
|
|
@@ -460,6 +461,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
460
461
|
loop_start: "loop_start";
|
|
461
462
|
loop_end: "loop_end";
|
|
462
463
|
model_ttfb: "model_ttfb";
|
|
464
|
+
rate_limit: "rate_limit";
|
|
463
465
|
}>;
|
|
464
466
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
465
467
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -763,6 +765,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
763
765
|
loop_start: "loop_start";
|
|
764
766
|
loop_end: "loop_end";
|
|
765
767
|
model_ttfb: "model_ttfb";
|
|
768
|
+
rate_limit: "rate_limit";
|
|
766
769
|
}>;
|
|
767
770
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
768
771
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1074,6 +1077,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1074
1077
|
loop_start: "loop_start";
|
|
1075
1078
|
loop_end: "loop_end";
|
|
1076
1079
|
model_ttfb: "model_ttfb";
|
|
1080
|
+
rate_limit: "rate_limit";
|
|
1077
1081
|
}>;
|
|
1078
1082
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
1079
1083
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -194,7 +194,7 @@ export interface BrowserEventPayload {
|
|
|
194
194
|
};
|
|
195
195
|
durationMs: number;
|
|
196
196
|
}
|
|
197
|
-
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb';
|
|
197
|
+
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'rate_limit';
|
|
198
198
|
export interface SessionPhasePayload {
|
|
199
199
|
phase: SessionPhaseName;
|
|
200
200
|
durationMs?: number;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: automate
|
|
3
3
|
description: "Set up a scheduled headless afk run that pushes a summary to Telegram. Use when the user wants to automate a recurring task via the afk daemon scheduler (cron) with push-notified results."
|
|
4
4
|
disable-model-invocation: true
|
|
5
|
+
context: load
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
Set up a recurring headless task using afk's **native** scheduler. Do NOT hand-roll launchd plists or shell scripts — afk has first-class scheduling: the `create_schedule` tool writes `~/.afk/config/schedules.json` entries that `afk daemon` runs on cron.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: review
|
|
3
3
|
description: "Dispatches parallel dimension agents across a diff, PR (URL or number), commit SHA, branch, staged changes, or patch file — covering security, correctness, api-compat, test-coverage, and perf-observability — synthesizes findings by severity, and emits a merge recommendation. Use when changes are ready for review before merge. Read-only: this skill analyzes and reports only — it never edits files, commits, pushes, comments on a PR, or modifies the PR description."
|
|
4
4
|
argument-hint: "[diff|pr-url|pr-number|commit-sha|branch|--staged|--head] [--light] [--change-type hotfix|feature|refactor|dep-bump|new-service] [--post github|telegram] [--brief <text>|--spec <path>]"
|
|
5
|
-
context:
|
|
5
|
+
context: load
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Read-only — hard constraint
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: shadow-verify
|
|
3
3
|
description: "Dispatch a parallel adversarial verifier wave after any high-stakes sub-agent investigation (code reviews, audits, findings reports, large refactors) — or whenever a sub-agent asserts a claim with high-confidence language (confident, certain, clearly, ≥80%), since confidence is a trigger, not a verdict. Shadow verifiers independently re-derive 2–3 key claims from scratch using tool calls only, returning CONFIRMED/REFUTED/UNVERIFIABLE, and flag disagreements before the user acts. Use when sub-agent output will drive decisions, file changes, commits, or external side-effects."
|
|
4
|
-
context:
|
|
4
|
+
context: load
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Sub-agent contract
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: simplify
|
|
3
3
|
description: "Discovers incidental complexity, duplication, and dead code in a codebase and produces a ranked, behavior-preserving reduction plan — optionally applying safe changes. Dispatches four parallel read-only discovery lenses (clone detection, dead code, complexity hotspots, wrong abstraction), synthesizes into a prioritized reduction plan, and gates apply mode behind /refactor and a hard test check."
|
|
4
4
|
argument-hint: "[target] [--apply] [--all]"
|
|
5
|
-
context:
|
|
5
|
+
context: load
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Sub-agent contract
|
|
@@ -6,7 +6,7 @@ import type { AgentModelInput } from '../../../agent/types.js';
|
|
|
6
6
|
import type { BackgroundAgentRegistry } from '../../../agent/background-registry.js';
|
|
7
7
|
import type { BackgroundSummarizer } from '../../../agent/background-summarizer.js';
|
|
8
8
|
import type { SubagentControl } from '../../../agent/tools/subagent-executor.js';
|
|
9
|
-
import type { SlashContext, SessionStats, ResumeSwapResult } from '../../slash/types.js';
|
|
9
|
+
import type { SlashContext, SessionStats, ResumeSwapResult, ThinkingUiMode } from '../../slash/types.js';
|
|
10
10
|
import type { StoredSession } from '../../session-store.js';
|
|
11
11
|
import type { StatusLine } from '../../status-line.js';
|
|
12
12
|
import type { ReplRenderer } from './repl-renderer.js';
|
|
@@ -16,7 +16,7 @@ import type { GitStatusSampler } from '../../git-status-sampler.js';
|
|
|
16
16
|
export type { ResumeSwapResult } from '../../slash/types.js';
|
|
17
17
|
export declare function reseedStatsFromStored(stats: SessionStats, stored: StoredSession, resumeId: string): void;
|
|
18
18
|
export declare function printResumeBanner(stats: SessionStats, writer: CompletionWriter): void;
|
|
19
|
-
export type ThinkingUiMode
|
|
19
|
+
export type { ThinkingUiMode } from '../../slash/types.js';
|
|
20
20
|
export interface CliOptions {
|
|
21
21
|
model: AgentModelInput;
|
|
22
22
|
maxTurns: string;
|
|
@@ -13,6 +13,7 @@ export type ResumeSwapResult = {
|
|
|
13
13
|
ok: false;
|
|
14
14
|
reason: string;
|
|
15
15
|
};
|
|
16
|
+
export type ThinkingUiMode = 'summary' | 'live' | 'off';
|
|
16
17
|
export interface ToolEvent {
|
|
17
18
|
toolName: string;
|
|
18
19
|
toolUseId: string;
|
|
@@ -47,6 +48,7 @@ export interface SessionStats {
|
|
|
47
48
|
turns: TurnRecord[];
|
|
48
49
|
model: AgentModelInput;
|
|
49
50
|
permissionMode: PermissionMode;
|
|
51
|
+
thinkingUi?: ThinkingUiMode;
|
|
50
52
|
sessionId?: string;
|
|
51
53
|
name?: string;
|
|
52
54
|
cwd?: string;
|