agent-afk 5.307.7 → 5.307.9
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 +4 -0
- package/dist/agent/providers/anthropic-direct/cache-policy.d.ts +22 -0
- package/dist/agent/tools/system-prompt.d.ts +1 -1
- package/dist/agent/types/config-types.d.ts +1 -0
- package/dist/cli.mjs +351 -351
- package/dist/index.mjs +151 -151
- package/dist/telegram.mjs +175 -175
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,6 +59,10 @@ Codex imports use `CODEX_HOME` when set (otherwise `~/.codex`) and also discover
|
|
|
59
59
|
|
|
60
60
|
**Jev calibrated judgment.** Jev is an external cross-family judge you configure as an MCP server in `~/.afk/config/mcp.json`. When present, `afk whatif --judge auto` selects Jev to grade verification episodes; it returns calibrated probabilities and removes Anthropic self-preference bias in verdicts. Falls back to Claude when Jev is not configured. Use `--judge claude` to keep all episode data within Anthropic. Source: `src/whatif/judge/jev-connect.ts`, `docs/whatif.md`.
|
|
61
61
|
|
|
62
|
+
## What it has done
|
|
63
|
+
|
|
64
|
+
**Constructed SW(25,16), a math case a 2025 paper listed as open.** Given a one-sentence goal ("settle one published open question"), agent-afk agents picked the target, designed a structured SAT search, found a symmetric 25x25 weighing matrix in 760 seconds of solver time, checked it with independent exact checkers and a prior-work search, and wrote up a short proof. The author of the paper that listed the case as open confirmed it passes his verifier. Check it yourself in under a second: [`docs/results/sw-25-16`](docs/results/sw-25-16/README.md).
|
|
65
|
+
|
|
62
66
|
## How it compares
|
|
63
67
|
|
|
64
68
|
| | Claude Code | Agent AFK |
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentBlockParam, MessageParam } from '@anthropic-ai/sdk/resources';
|
|
2
|
+
export declare const MAX_CACHE_BREAKPOINTS = 4;
|
|
2
3
|
export declare function isCacheEnabled(opts?: {
|
|
3
4
|
baseUrl?: string;
|
|
4
5
|
}): boolean;
|
|
@@ -8,3 +9,24 @@ export declare function isExtendedCacheTtlActive(opts?: {
|
|
|
8
9
|
}): boolean;
|
|
9
10
|
export declare function withSystemBreakpoint(blocks: ContentBlockParam[], ttl: '5m' | '1h'): ContentBlockParam[];
|
|
10
11
|
export declare function withMessagesBreakpoint(messages: MessageParam[], ttl: '5m' | '1h'): MessageParam[];
|
|
12
|
+
export declare function countBreakpoints(params: {
|
|
13
|
+
system?: readonly ContentBlockParam[];
|
|
14
|
+
tools?: readonly CacheableToolLike[];
|
|
15
|
+
messages: readonly MessageParam[];
|
|
16
|
+
}): number;
|
|
17
|
+
export interface CacheableToolLike {
|
|
18
|
+
name: string;
|
|
19
|
+
cache_control?: {
|
|
20
|
+
type: string;
|
|
21
|
+
} | null;
|
|
22
|
+
[k: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
export declare function clampBreakpoints(params: {
|
|
25
|
+
system?: readonly ContentBlockParam[];
|
|
26
|
+
tools?: readonly CacheableToolLike[];
|
|
27
|
+
messages: readonly MessageParam[];
|
|
28
|
+
}): {
|
|
29
|
+
system?: readonly ContentBlockParam[];
|
|
30
|
+
tools?: readonly CacheableToolLike[];
|
|
31
|
+
messages: readonly MessageParam[];
|
|
32
|
+
};
|
|
@@ -13,6 +13,6 @@ export declare const WORKSPACE_SYSTEM_PROMPT = "# Shared Workspace\n\nWhen dispa
|
|
|
13
13
|
export declare const MEMORY_SYSTEM_PROMPT = "# Cross-Session Memory\n\nYou have three tools for persisting knowledge across sessions: memory_search, memory_update, and procedure_write.\n\n## Reading memory\nOn your first turn, decide whether to call memory_search based on the request:\n- Search when the task involves ongoing work, user preferences, project conventions, or prior context \u2014 e.g. repo-specific work, multi-session projects, \"like last time\", or anything where continuity matters.\n- Skip for clearly self-contained requests \u2014 one-off questions, simple lookups, or tasks with no plausible prior context.\n- If hot memory (shown in <cross-session-memory> tags above) already covers the relevant context, skip the search.\n- Search at most once per session for general context. Search again only if new information surfaces a specific topic worth querying.\n\nUse FTS5 syntax: \"exact phrase\", term1 AND term2, prefix*.\n\n## Writing memory (memory_update)\nStore facts when you encounter:\n- User preferences or corrections (\"I prefer X\", \"don't do Y\") \u2192 category: preference\n- Key decisions with rationale (\"we chose X over Y because Z\") \u2192 category: decision\n- Non-obvious project conventions discovered during investigation \u2192 category: convention\n- Surprising learnings from debugging or exploration \u2192 category: learning\n\nDo NOT store: ephemeral task details, information derivable from code or git, speculative observations.\n\n### Hot memory vs. fact archive\n- target \"fact\" \u2192 searchable SQLite archive. **This is the default home for almost everything** \u2014 project stack, conventions, file maps, decisions, learnings. It is unbounded and searchable. When in doubt, it's a fact.\n- target \"hot\" \u2192 HOT.md, injected verbatim into EVERY future session's system prompt, on every surface. Reserve it for the few lines you'd want present in every session forever: user identity, 2\u20133 top durable preferences, and a one-line pointer to the active project (name + path) \u2014 NOT its full context. Hard ~1,500-token cap; over-cap writes are truncated from the END, so order entries most-durable first (identity), least-durable last. If something doesn't need to be in every prompt, it's a fact, not hot.\n- Use action \"supersede\" (not set + remove) when updating an existing fact \u2014 preserves history.\n- Never write to hot memory during an end-of-session reflection pass \u2014 hot entries should be written only when the user explicitly states a durable preference or identity, not inferred from task outcomes.\n\n## Procedures (procedure_write)\nSave reusable multi-step workflows the user teaches you or that you discover work well. Name in kebab-case. Searchable via memory_search.";
|
|
14
14
|
export declare const MEMORY_SYSTEM_PROMPT_READONLY = "# Cross-Session Memory (child session)\n\nYou have access to memory_search and memory_update (target:\"fact\" only). Hot memory writes (target:\"hot\") and procedure_write are not available in this child session \u2014 only the parent can write to hot memory or procedures.\n\n## Reading memory\nOn your first turn, decide whether to call memory_search based on the request:\n- Search when the task involves ongoing work, user preferences, project conventions, or prior context \u2014 e.g. repo-specific work, multi-session projects, \"like last time\", or anything where continuity matters.\n- Skip for clearly self-contained requests \u2014 one-off questions, simple lookups, or tasks with no plausible prior context.\n- If hot memory (shown in <cross-session-memory> tags above) already covers the relevant context, skip the search.\n- Search at most once per session for general context. Search again only if new information surfaces a specific topic worth querying.\n\nUse FTS5 syntax: \"exact phrase\", term1 AND term2, prefix*.\n\n## Persisting facts (memory_update, target:\"fact\" only)\nStore findings when you encounter non-obvious facts worth persisting: project conventions, key decisions, surprising learnings. Use target:\"fact\" \u2014 it goes to the searchable SQLite archive. Do NOT use target:\"hot\" (blocked in child sessions).";
|
|
15
15
|
export declare const MEMORY_SYSTEM_PROMPT_SEARCH_ONLY = "# Cross-Session Memory (read-only)\n\nYou have access to memory_search only. No memory-write tools are available in this session.\n\n## Reading memory\nOn your first turn, decide whether to call memory_search based on the request:\n- Search when the task involves ongoing work, user preferences, project conventions, or prior context \u2014 e.g. repo-specific work, multi-session projects, \"like last time\", or anything where continuity matters.\n- Skip for clearly self-contained requests \u2014 one-off questions, simple lookups, or tasks with no plausible prior context.\n- If hot memory (shown in <cross-session-memory> tags above) already covers the relevant context, skip the search.\n- Search at most once per session for general context. Search again only if new information surfaces a specific topic worth querying.\n\nUse FTS5 syntax: \"exact phrase\", term1 AND term2, prefix*.";
|
|
16
|
-
export declare function resolveToolSystemPrompt(isSkillDispatch: boolean | undefined): string;
|
|
16
|
+
export declare function resolveToolSystemPrompt(isSkillDispatch: boolean | undefined, isUnnamedWorker?: boolean | undefined): string;
|
|
17
17
|
export declare function resolveMemorySystemPrompt(readOnlyMemory: boolean | undefined, readOnlyState?: boolean | undefined): string;
|
|
18
18
|
export declare function resolveWorkspaceSystemPrompt(workspaceEnabled: boolean | undefined): string;
|