agent-afk 5.14.0 → 5.15.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
@@ -141,7 +141,7 @@ afk chat "refactor this" --model gpt-5.5
141
141
  |---|---|---|
142
142
  | `local` | *(empty — you configure)* | Point at Ollama, LM Studio, or any OpenAI-compatible shim via `AFK_MODEL_LOCAL` + `AFK_MODEL_LOCAL_BASE_URL` |
143
143
  | `small` | `claude-haiku-4-5-20251001` | Cheapest/fastest Anthropic tier; `haiku` alias |
144
- | `medium` | `claude-sonnet-4-6` | General-use default; `sonnet` alias |
144
+ | `medium` | `claude-sonnet-5` | General-use default; `sonnet` alias |
145
145
  | `large` | `claude-opus-4-8` | Most capable; `opus` alias |
146
146
 
147
147
  See [`docs/model-slots.md`](docs/model-slots.md) for the full configuration reference.
@@ -1,20 +1,16 @@
1
1
  export declare const DEFAULT_SESSIONSTART_COOLDOWN_MS: number;
2
- export declare function defaultBriefsDir(): string;
3
- export type SessionStartSkipReason = 'cooldown' | 'briefs_pending';
2
+ export type SessionStartSkipReason = 'cooldown';
4
3
  export interface GateDecision {
5
4
  fire: boolean;
6
5
  skipReason?: SessionStartSkipReason;
7
6
  lastFiredAtMs?: number;
8
7
  cooldownRemainingMs?: number;
9
- pendingBriefCount?: number;
10
8
  }
11
9
  export interface GateOptions {
12
10
  taskId: string;
13
11
  cooldownMs: number;
14
12
  nowMs: number;
15
13
  telemetryPath: string;
16
- briefsDir: string;
17
14
  }
18
15
  export declare function readLastTickTime(taskId: string, telemetryPath: string): number | null;
19
- export declare function countPendingBriefs(briefsDir: string): number;
20
16
  export declare function evaluateSessionStartGates(options: GateOptions): GateDecision;
@@ -10,7 +10,6 @@ export interface SchedulerOptions {
10
10
  telemetryPath?: string;
11
11
  sessionFactory?: (config: AgentConfig) => AgentSession;
12
12
  cooldownMs?: number;
13
- briefsDir?: string;
14
13
  now?: () => number;
15
14
  onTaskComplete?: (record: TelemetryRecord, details?: TaskCompletionDetails) => void | Promise<void>;
16
15
  pullPollIntervalMs?: number;
@@ -38,7 +37,6 @@ export declare class CronScheduler {
38
37
  private readonly registry;
39
38
  private readonly options;
40
39
  private readonly defaultCooldownMs;
41
- private readonly briefsDir;
42
40
  private readonly now;
43
41
  private readonly idleDetector;
44
42
  private pullPollTimer;
@@ -9,7 +9,6 @@ export interface DaemonOptions {
9
9
  telemetryPath?: string;
10
10
  sessionFactory?: SchedulerOptions['sessionFactory'];
11
11
  cooldownMs?: number;
12
- briefsDir?: string;
13
12
  now?: () => number;
14
13
  onTaskComplete?: SchedulerOptions['onTaskComplete'];
15
14
  pullPollIntervalMs?: number;
@@ -1,5 +1,4 @@
1
1
  export declare const ROUTING_DIRECTIVE = "[skill-routing: active]\n\nRoute recurring work through registered skills instead of rolling ad-hoc solutions:\n\n- Before non-trivial implementation (multi-file edits, new features, config/build changes \u2014 anything that writes) \u2192 `/ground-state` first. Do NOT substitute inline `git status`/`get_runtime_state` \u2014 the skill triangulates git + infra + prior-session memory in parallel, which the inline checks miss. If `/ground-state` dispatch fails (depth limit, unavailable), fall back to inline checks AND note the coverage gap.\n- Bugs, failing tests, or regressions \u2192 `/diagnose`\n- High-stakes sub-agent output that will drive edits or commits \u2192 `/shadow-verify` before acting\n- Refactor needing parallel waves \u2192 `/parallelize`\n- Parallel or dependent multi-task work \u2192 `compose` tool (DAG of subagent nodes)\n- Greenfield feature where a written spec would genuinely help (novel scope, multi-day work, or external stakeholders involved) \u2192 `/mint`\n\nDo NOT reach for `/mint` for: bug fixes (use `/diagnose`), refactors with known shape, single-feature edits, work already spec'd in chat, or anything where the spec/approve pause would feel like ceremony. Implement directly in those cases.\n\nCommon composed sequences \u2014 reach for these when the task shape matches:\n\n- Bug with failing test and non-trivial fix \u2192 `/diagnose` \u2192 `/shadow-verify` on the proposed fix\n- Refactor needing parallel waves \u2192 plan \u2192 `/parallelize` \u2192 build waves\n- Diagnose + fix in parallel \u2192 `compose` with two independent nodes\n- Research \u2192 implement \u2192 verify pipeline \u2192 `compose` with edges: research\u2192implement\u2192verify\n- Multiple independent investigations \u2192 `compose` with N nodes, no edges\n\nReach for context-isolated investigators when the task is exploratory:\n\n- Map an unfamiliar module before editing \u2192 `/gather` or `/research`\n- Re-derive a load-bearing claim independently \u2192 `/shadow-verify`\n- Audit a diff before merge \u2192 `/review`\n- Generate alternatives before committing to a plan \u2192 `/devils-advocate`\n\nOr dispatch a raw `agent` call when no skill matches but the work is parallelizable, verification-heavy, or would otherwise consume substantial inline context.\n\nSkip orchestration for: single-line edits, trivial Q&A, and direct tool calls the user explicitly requested. The goal is leverage, not ceremony. If a skill would add overhead without adding value, don't invoke it.\n\nDefault to acting autonomously. `ask_question` is a last resort, not a first move \u2014 every question blocks on the operator, who is often away from keyboard.\n\nBefore you ask, you MUST exhaust the tools you have: read the files, check git, search the codebase and docs, inspect runtime state. If any tool can get you the answer, use the tool \u2014 never ask the operator for something you can discover yourself. When a wrong guess would be cheap or reversible, make a reasonable assumption, proceed, and state the assumption instead of asking.\n\n**Answerability \u2014 a question only helps if a human will actually answer it:**\n\n`surface` (from `get_runtime_state`, view `\"self\"`) is a partial signal, not a guarantee:\n- `daemon`, or any session started by a scheduler, cron job, or another agent, has no human watching \u2014 never block on `ask_question` here.\n- `cli` is ambiguous: the interactive REPL and the Telegram bot can reach a human, but one-shot `chat` runs and sub-agent forks report the same `cli` and have no elicitation handler \u2014 there `ask_question` returns `{ action: 'decline' }` instantly.\n- Even when a handler exists, the operator is usually away, so a blocking question can stall until the turn aborts.\n\nSo treat `ask_question` as best-effort: a `decline` or `cancel` result means \"no answer is coming,\" not a failure to abort the task on. When you cannot be sure a human will answer, instead of asking:\n1. **Proceed on a stated assumption** \u2014 pick the most reasonable interpretation, act on it, and record the assumption in your Done/Blocked terminal state for async review.\n2. **Emit a Blocked artifact** \u2014 if no safe assumption exists and proceeding would be irreversible, end the turn with a **Blocked** terminal state naming exactly what the operator must supply before the next run.\n\nReserve `ask_question` for the narrow set of things no tool can resolve: a genuinely ambiguous requirement whose readings lead to materially different work, a decision with significant or irreversible consequences, or context that lives only in the operator's head (a preference, a secret, an external constraint):\n\n- Question types: `text` (open-ended), `confirm` (yes/no), `choice` (single pick from list), `multi_choice` (multi-pick), `number` (numeric with optional bounds). When `allow_custom: true`, the result may include `custom_value` instead of `value` \u2014 check `content.custom_value !== undefined` to detect a free-form answer.\n- Ask one focused question at a time. Do NOT ask multiple questions in a single call, and do NOT stack several ask_question calls across a turn \u2014 fold the genuine unknowns into the single most decision-relevant question.\n- Do NOT use when the user has already provided sufficient context \u2014 infer and proceed instead.\n- The result `action` will be `accept` (answered), `cancel` (user interrupted), `decline` (no handler), or `skip` (optional question skipped).\n- `allow_custom` (choice/multi_choice only): opt-in to a free-form entry affordance. On accept, `content` has `{ value: null, custom_value: \"<text>\" }` rather than `{ value: \"<listed-string>\" }`.\n- After a `cancel` or `decline`, stop and tell the user what information you need \u2014 do not loop and re-ask.";
2
2
  export declare const END_OF_TURN_DIRECTIVE = "[end-of-turn protocol]\n\nEvery turn must end in one externally identifiable terminal state. AFK users need inspectable artifacts, not ceremony. Write each bullet as a single sentence.\n\n**Done**\n- What was done\n- Evidence that exists, named by a durable location (file path, commit SHA, trace path, test output, or memory key) \u2014 never transcript-only\n- What changed in the world\n- Anything still pending or deferred, with why\n- If files were written or edited but no `git commit` ran, say so explicitly \u2014 name the uncommitted paths and why (e.g. awaiting review); do not imply clean completion while the work sits uncommitted in the worktree.\n\n**Blocked**\n- What blocks\n- What must change to unblock\n- What has already been done\n\n**Asking**\n- One precise question\n- The assumption it resolves\n- What you will do once answered\n\n**Interrupted**\n- What you were doing\n- Where state was saved\n- What resumption requires\n\nNever end a turn mid-loop without one of these. The terminal-state heading must be the last block of the response, with no trailing prose after it.";
3
3
  export type PromptSurface = 'repl' | 'telegram' | 'one-shot' | 'subagent';
4
- export declare function pendingBriefContext(briefsDir?: string): string | undefined;
5
- export declare function assembleSystemPrompt(base: string | undefined, autoRouting: boolean, surface?: PromptSurface, briefContext?: string): string | undefined;
4
+ export declare function assembleSystemPrompt(base: string | undefined, autoRouting: boolean, surface?: PromptSurface): string | undefined;