agent-afk 5.254.2 → 5.254.3

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.
@@ -1,4 +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; minimize the longest dependency chain)\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\nDefault to parallel execution. When a task decomposes into 2+ independent sub-tasks, dispatch them in a single compose wave or parallel agent calls -- do not run them one after another. Sequential dispatch is reserved for chains where an earlier output materially shapes the later prompt.\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\nAfter local work is ready to push and PR \u2192 `/ship`; to fix PR review feedback or red CI \u2192 `/fix-pr`; to clean up complexity or dead code \u2192 `/simplify`; large-scope structural refactors \u2192 `/refactor`.\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: <one-sentence summary>\n- Evidence: <durable location \u2014 file path, commit SHA, trace path, test output, or memory key; never transcript-only>\n- What changed: <world-state delta>\n- Deferred: <anything still pending, with why; or \"none\">\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: <the blocker>\n- What must change to unblock: <the unblock condition>\n- What has already been done: <progress so far>\n\n**Asking**\n- Question: <one precise question>\n- Assumption it resolves: <what answering clarifies>\n- Once answered: <what you will do>\n\n**Interrupted**\n- What you were doing: <the in-progress task>\n- Where state was saved: <location>\n- What resumption requires: <prerequisites>\n\nBefore emitting a terminal state, consider whether this session produced knowledge reusable across future sessions \u2014 a decision with rationale, a surprising debugging learning, a user preference or correction, or a non-obvious project convention. If so, call `memory_update` (target: \"fact\") before the terminal-state block. Do not force a write when there is nothing genuinely new \u2014 many sessions have nothing worth persisting, and that is fine.\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
- export type PromptSurface = 'repl' | 'telegram' | 'one-shot' | 'subagent';
3
+ export type PromptSurface = 'repl' | 'telegram' | 'one-shot';
4
4
  export declare function assembleSystemPrompt(base: string | undefined, autoRouting: boolean, surface?: PromptSurface): string | undefined;
@@ -11,7 +11,7 @@ export interface ModelSlotBinding {
11
11
  export type ModelSlots = Record<SlotName, ModelSlotBinding>;
12
12
  export declare const CLAUDE_HAIKU_ID = "claude-haiku-4-5-20251001";
13
13
  export declare const CLAUDE_SONNET_ID = "claude-sonnet-4-6";
14
- export declare const CLAUDE_OPUS_ID = "claude-opus-5";
14
+ export declare const CLAUDE_OPUS_ID = "claude-opus-5-5";
15
15
  export declare const CLAUDE_OPUS_55_ID = "claude-opus-5-5";
16
16
  export declare const CLAUDE_FABLE_5_ID = "claude-fable-5";
17
17
  export declare const GROK_FLAGSHIP_ID = "grok-4.6";
@@ -0,0 +1,8 @@
1
+ import type { AgentConfig } from '../types/config-types.js';
2
+ export interface SubagentIdentityFacts {
3
+ isNonInteractive: boolean | undefined;
4
+ depth: number | undefined;
5
+ maxDepth: number | undefined;
6
+ }
7
+ export declare function renderSubagentIdentityPreamble(facts: SubagentIdentityFacts): string;
8
+ export declare function injectSubagentIdentityPreamble(config: AgentConfig): AgentConfig;
@@ -11,6 +11,7 @@ import type { StageTrackerState } from '../commands/interactive/loop-stage.js';
11
11
  import type { CommitCoordinator } from './commit-coordinator.js';
12
12
  import type { SourceState } from './stream-renderer-source.js';
13
13
  import type { ChildActivityTracker } from './child-activity-select.js';
14
+ import type { ThoughtSummaryHold } from './thought-summary-hold.js';
14
15
  export declare function makeOrchestratorCtx(args: {
15
16
  out: Writer;
16
17
  isTTY: boolean;
@@ -28,6 +29,7 @@ export declare function makeOrchestratorCtx(args: {
28
29
  lastProgressByTask: Map<string, ProgressEvent>;
29
30
  sources?: ReadonlyMap<string, SourceState>;
30
31
  childActivity?: ChildActivityTracker;
32
+ thoughtHold?: ThoughtSummaryHold;
31
33
  }): OrchestratorCtx;
32
34
  export declare function makeSubagentCtx(args: {
33
35
  isTTY: boolean;
@@ -8,6 +8,7 @@ import type { ThinkingLane } from '../commands/interactive/thinking-lane.js';
8
8
  import { StreamingMarkdownRenderer } from '../markdown-stream.js';
9
9
  import type { CommitCoordinator } from './commit-coordinator.js';
10
10
  import type { OverlayComposer } from './overlay-composer.js';
11
+ import type { ThoughtSummaryHold } from './thought-summary-hold.js';
11
12
  import { type StageTrackerState } from '../commands/interactive/loop-stage.js';
12
13
  export { emitPanel, finalizeOrchestrator, emitMarkdown, emitErrorBox, flushToolLaneToScrollback, } from './stream-renderer-orchestrator-emit.js';
13
14
  export interface OrchestratorCtx {
@@ -21,6 +22,7 @@ export interface OrchestratorCtx {
21
22
  streamingMarkdown: {
22
23
  current: StreamingMarkdownRenderer | null;
23
24
  };
25
+ thoughtHold?: ThoughtSummaryHold;
24
26
  stageTracker?: StageTrackerState;
25
27
  activeSkillName?: string;
26
28
  skillBadgeEmitted?: boolean;
@@ -0,0 +1,15 @@
1
+ import type { ToolLane } from '../commands/interactive/tool-lane.js';
2
+ import type { OverlayComposer } from './overlay-composer.js';
3
+ import { ThoughtSummaryHold, type HoldCompositor } from './thought-summary-hold.js';
4
+ export { THOUGHT_SUMMARY_SLOT } from './thought-summary-hold.js';
5
+ export interface SmokeEffects {
6
+ readonly thoughtHold: ThoughtSummaryHold;
7
+ dispose(): void;
8
+ }
9
+ export declare function armSmokeEffects(args: {
10
+ compositor: HoldCompositor;
11
+ overlayComposer: OverlayComposer;
12
+ toolLane: ToolLane;
13
+ reducedMotion: boolean;
14
+ deferFlush: (slot: string) => void;
15
+ }): SmokeEffects | null;
@@ -36,6 +36,7 @@ export declare class StreamRenderer {
36
36
  private inFlightTools;
37
37
  private disposed;
38
38
  private toolLaneFlash;
39
+ private smoke;
39
40
  private pauseTickInterval;
40
41
  private resizeUnsub;
41
42
  private subagentTickInterval;
@@ -0,0 +1,23 @@
1
+ import { type ElementFade } from '../smoke-fade.js';
2
+ export declare const THOUGHT_SUMMARY_SLOT = "thought-summary";
3
+ export interface HoldCompositor {
4
+ commitAbove(text: string): void;
5
+ setCommitBarrier(fn: (() => void) | null): void;
6
+ }
7
+ export interface HoldComposer {
8
+ markDirty(key: string): void;
9
+ flush(): void;
10
+ }
11
+ export declare class ThoughtSummaryHold {
12
+ private readonly compositor;
13
+ private readonly composer;
14
+ private readonly fade;
15
+ private held;
16
+ private settleTimer;
17
+ private seq;
18
+ constructor(compositor: HoldCompositor, composer: HoldComposer, fade: ElementFade);
19
+ hold(line: string): void;
20
+ render(): string;
21
+ commitHeld(): void;
22
+ dispose(): void;
23
+ }
@@ -1,7 +1,12 @@
1
- import { type Entry } from './tool-lane-render.js';
1
+ import { type ToolEntry, type Entry } from './tool-lane-render.js';
2
2
  import type { ToolLaneFlash } from './tool-lane-flash.js';
3
+ import type { ElementFade } from '../../smoke-fade.js';
4
+ export declare function selectVisibleRoots(entries: Map<string, Entry>, order: string[], maxOverlayRoots: number): {
5
+ visibleRoots: ToolEntry[];
6
+ hiddenDoneCount: number;
7
+ };
3
8
  export declare function renderToolLaneOverlay(entries: Map<string, Entry>, order: string[], activeTools: {
4
9
  activeCount: number;
5
10
  toolUseIds: Set<string>;
6
11
  toolIndex?: Map<string, number>;
7
- } | null, flash: ToolLaneFlash | null, maxOverlayRoots: number): string;
12
+ } | null, flash: ToolLaneFlash | null, maxOverlayRoots: number, fade?: ElementFade | null): string;
@@ -1,4 +1,5 @@
1
1
  import type { Entry, Glyphs } from './tool-lane-render.js';
2
- declare function renderOverlayChildren(children: Entry[], childMap: Map<string, Entry[]>, lines: string[], cols?: number, ancestorIsLast?: readonly boolean[], g?: Readonly<Glyphs>, parentIsLast?: boolean): void;
2
+ import type { ElementFade } from '../../smoke-fade.js';
3
+ declare function renderOverlayChildren(children: Entry[], childMap: Map<string, Entry[]>, lines: string[], cols?: number, ancestorIsLast?: readonly boolean[], g?: Readonly<Glyphs>, parentIsLast?: boolean, fade?: ElementFade | null): void;
3
4
  declare function renderFlushChildren(children: Entry[], childMap: Map<string, Entry[]>, homeDir?: string, agentResultSummary?: string, cols?: number, ancestorIsLast?: readonly boolean[], g?: Readonly<Glyphs>, parentIsLast?: boolean): string[];
4
5
  export { renderOverlayChildren, renderFlushChildren };
@@ -3,6 +3,7 @@ import { formatToolLine, formatToolResultLine } from './tool-lane-format.js';
3
3
  import type { DiffPayload } from '../../../utils/diff.js';
4
4
  import { type ToolEntry, type TextEntry, type Entry } from './tool-lane-render.js';
5
5
  import type { ToolLaneFlash } from './tool-lane-flash.js';
6
+ import type { ElementFade } from '../../smoke-fade.js';
6
7
  export type { ToolEntry, TextEntry, Entry };
7
8
  export declare const MAX_OVERLAY_ROOTS = 6;
8
9
  export declare class ToolLane {
@@ -12,6 +13,7 @@ export declare class ToolLane {
12
13
  private lastElapsedSecond;
13
14
  private activeTools;
14
15
  flash: ToolLaneFlash | null;
16
+ fade: ElementFade | null;
15
17
  compactScrollback: boolean;
16
18
  addStart(toolUseId: string, toolName: string, toolInput: string): void;
17
19
  addStartWithAgentContext(toolUseId: string, toolName: string, toolInput: string, agentContext: string | undefined, maxWidth?: number): void;
@@ -0,0 +1,2 @@
1
+ import type { Entry } from './tool-lane-render.js';
2
+ export declare function trailingCompletedRootToolName(entries: ReadonlyMap<string, Entry>, order: readonly string[]): string | undefined;
@@ -0,0 +1,17 @@
1
+ export declare const FADE_MS = 180;
2
+ export declare const FADE_FLOOR = 0.12;
3
+ export declare const FADE_CEIL = 0.6;
4
+ export declare const FADE_FRAME_MS = 33;
5
+ export declare function fadeLine(line: string, p: number): string;
6
+ export declare class ElementFade {
7
+ private readonly onFrame;
8
+ private readonly now;
9
+ private readonly births;
10
+ private timer;
11
+ private disposed;
12
+ constructor(onFrame: () => void, now?: () => number);
13
+ progress(key: string): number | null;
14
+ fadeLines(key: string, lines: string[], from: number): void;
15
+ dispose(): void;
16
+ private armFrame;
17
+ }
@@ -87,6 +87,7 @@ export declare class TerminalCompositor {
87
87
  bandGeometryStale: boolean;
88
88
  lifecycleStateDirty: boolean;
89
89
  commitInFlight: boolean;
90
+ private commitBarrier;
90
91
  private readonly debugCompositor;
91
92
  readonly ghostEngine: SuggestEngine | undefined;
92
93
  readonly ghostGetContext: (() => SuggestContext) | undefined;
@@ -113,6 +114,8 @@ export declare class TerminalCompositor {
113
114
  arm(): Promise<void>;
114
115
  endTurn(): void;
115
116
  disarm(): void;
117
+ setCommitBarrier(fn: (() => void) | null): void;
118
+ private runCommitBarrier;
116
119
  setOverlay(text: string): void;
117
120
  setSpinner(config: {
118
121
  enabled: boolean;