agent-afk 5.344.0 → 5.346.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.
@@ -16,8 +16,8 @@ export declare function daemonTraceLabel(taskId: string): string;
16
16
  export declare function _resetDaemonDefaultCwdCache(): void;
17
17
  export declare function daemonDefaultCwd(): string;
18
18
  export declare function parseDaemonEnvLimits(rawMaxToolIters: string | undefined, rawMaxBudget: string | undefined): {
19
- parsedMaxToolIters: number | undefined;
20
- parsedMaxBudget: number | undefined;
19
+ parsedMaxToolIters: number;
20
+ parsedMaxBudget: number;
21
21
  };
22
22
  export declare function spawnDaemonSession(taskId: string, options: DaemonSpawnOptions): Promise<{
23
23
  session: AgentSession;
@@ -1,6 +1,7 @@
1
1
  export declare class DaemonAlreadyRunningError extends Error {
2
2
  readonly ownerPid: number | null;
3
- constructor(lockPath: string, ownerPid: number | null);
3
+ readonly windowsEpermAmbiguous: boolean;
4
+ constructor(lockPath: string, ownerPid: number | null, windowsEpermAmbiguous?: boolean);
4
5
  }
5
6
  export declare function getDaemonLockPath(instanceId?: string): string;
6
7
  export declare function acquireDaemonLock(lockPath?: string, platform?: string): Promise<() => Promise<void>>;
@@ -3,4 +3,4 @@ export { extractEpisodeInput } from './extract.js';
3
3
  export { synthesizeEpisode } from './synthesize.js';
4
4
  export { writeEpisode, formatEpisodeContent, sanitizeNarrative } from './writer.js';
5
5
  import type { EpisodeRecord } from './types.js';
6
- export declare function synthesizeAndWriteEpisode(sessionId: string): Promise<EpisodeRecord>;
6
+ export declare function synthesizeAndWriteEpisode(sessionId: string): Promise<EpisodeRecord | null>;
@@ -2,3 +2,4 @@ export { FACET_VERSION, SessionFacetSchema, StoredSessionInputSchema, FacetOutco
2
2
  export { deriveSessionFacet, type DeriveOptions } from './derive.js';
3
3
  export { getOrDeriveFacet, loadStoredSession, listSessionIds, type FacetStoreOptions, } from './store.js';
4
4
  export { createFacetSessionEndHook } from './session-end-hook.js';
5
+ export { patchFacetDecisions } from './yield-probe.js';
@@ -9,4 +9,5 @@ export declare function getCurrentBranch(execFn: ExecFnYield, cwd?: string): Pro
9
9
  export declare function queryPrState(execFn: ExecFnYield, branch: string, cwd?: string): Promise<'merged' | 'open' | 'closed' | 'none' | 'error'>;
10
10
  export declare function queryPrStateByUrl(execFn: ExecFnYield, prUrl: string, cwd?: string): Promise<'merged' | 'open' | 'closed' | 'error'>;
11
11
  export declare function patchYieldFields(sessionId: string, produced_pr: boolean, pr_merged: boolean | null, cacheDir?: string, pr_url?: string | null): void;
12
+ export declare function patchFacetDecisions(sessionId: string, decisions: string[], cacheDir?: string): void;
12
13
  export declare function writeFacetYield(sessionId: string, execFn: ExecFnYield, cwd?: string, cacheDir?: string): Promise<void>;
@@ -20,6 +20,10 @@ export type TurnLogEntry = {
20
20
  kind: 'restore';
21
21
  paths: PathHashes;
22
22
  ts: number;
23
+ } | {
24
+ kind: 'tip';
25
+ turnId: string;
26
+ ts: number;
23
27
  } | BashLogEntry;
24
28
  export declare function hashBytes(bytes: Buffer | null): string | null;
25
29
  export declare function currentHash(absPath: string): string | null;
@@ -28,3 +32,5 @@ export declare function readTurnLog(sessionId: string, stateDir?: string): TurnL
28
32
  export declare function turnsFrom(log: readonly TurnLogEntry[], turnId: string): string[] | undefined;
29
33
  export declare function expectedHashes(log: readonly TurnLogEntry[]): Map<string, string | null>;
30
34
  export declare function hashPaths(paths: Iterable<string>): PathHashes;
35
+ export declare function latestCheckpointTurnId(sessionId: string, stateDir?: string): string | undefined;
36
+ export declare function latestTipTurnId(sessionId: string, stateDir?: string): string | undefined;
@@ -13,7 +13,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
13
13
  private _stateStore;
14
14
  private readonly providerFactory?;
15
15
  private readonly skillExecutor?;
16
- private readonly schemas;
16
+ private schemas;
17
17
  private readonly hookRegistry;
18
18
  private readonly permissions;
19
19
  private readonly canUseTool;
@@ -0,0 +1,19 @@
1
+ export declare function getPauseLockPath(): string;
2
+ export declare class PauseController {
3
+ private static _instance;
4
+ static instance(): PauseController;
5
+ static _resetForTest(): void;
6
+ private _paused;
7
+ private _pollInterval;
8
+ private _watchPath;
9
+ private constructor();
10
+ dispose(): void;
11
+ isPaused(): boolean;
12
+ check(signal?: AbortSignal): Promise<void>;
13
+ private _handlePause;
14
+ private _handleResume;
15
+ private _syncState;
16
+ private _startWatching;
17
+ }
18
+ export declare function writePauseLock(): boolean;
19
+ export declare function removePauseLock(): void;
@@ -63,6 +63,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
63
63
  readonly _pendingBillingStreams: Set<Promise<void>>;
64
64
  _billingStreamSink?: Set<Promise<void>>;
65
65
  get pendingBillingStreams(): Promise<void>[];
66
+ get pendingWorkspaceEntryCount(): number;
66
67
  get _runBilling(): BillingUsage | undefined;
67
68
  set _runBilling(value: BillingUsage | undefined);
68
69
  _modelFallback?: HandleModelFallback;
@@ -0,0 +1,6 @@
1
+ import type { AgentConfig } from './types.js';
2
+ export declare const DEFAULT_UNATTENDED_BUDGET_USD = 5;
3
+ export declare const DEFAULT_UNATTENDED_TOOL_ROUNDS = 100;
4
+ type Limits = Pick<AgentConfig, 'maxBudgetUsd' | 'maxToolUseIterations'>;
5
+ export declare function resolveUnattendedLimits(rawRounds: string | undefined, rawBudget: string | undefined, explicit?: Limits): Required<Limits>;
6
+ export {};
@@ -5,6 +5,8 @@ context: fork
5
5
  category: Debug & fix
6
6
  ---
7
7
 
8
+ **Reference documents.** Before forming hypotheses, check `references/` alongside this SKILL.md for decision tables matching the bug's domain keywords (e.g. layout jumps, reflow). When a reference applies, use it to constrain the hypothesis space rather than exploring from scratch.
9
+
8
10
  Gather context: read the failing test or bug description, relevant error output, and recent git changes. If no failing test exists yet, write a minimal reproducer test (or identify a concrete verification command) before proceeding — hypotheses need a pass/fail signal to validate against. Dispatch two sub-agents in parallel — one to search the codebase for code paths involved in the failure (`subagent_type: research-agent`, read-only), and one to check recent commits and diffs that could have introduced the regression (`subagent_type: general-purpose` — requires Bash for `git log`/`git diff`/`git show`). When both return, synthesize findings into 2–4 ranked hypotheses, each with a specific code location and proposed cause.
9
11
 
10
12
  **TUI label convention.** Set `id_prefix` on each Agent dispatch to a short, descriptive label so the live progress view shows the agent's role:
@@ -0,0 +1,52 @@
1
+ # Layout Jump Decision Table
2
+
3
+ Consult this reference when a bug report mentions **jump**, **gap**, **shift**, **pop**, **reflow**, or **flicker** in a UI context (TUI, web, or desktop). These keywords warrant checking layout behavior; they do not establish a single root cause or remedy.
4
+
5
+ ## Core invariant
6
+
7
+ First establish the intended layout contract and inspect the element's existing layout footprint:
8
+
9
+ - **Intended overlay** (e.g. a floating toast or modal): it should not displace siblings. Absolute/fixed positioning and layering can be appropriate; do not reserve in-flow space merely because the overlay appears dynamically.
10
+ - **Intentional expansion/collapse** (e.g. an accordion or expanding sidebar): sibling movement may be expected. Verify the intended transition rather than forcing a permanently reserved box.
11
+ - **Stable in-flow footprint** (e.g. a mascot bar or loading slot whose siblings should stay put): if insertion/removal or resizing changes that footprint, **reserve space before reveal, not after**. If the element already retains its in-flow footprint, investigate another cause (e.g. changing dimensions, margins, or ancestor layout) rather than adding a redundant placeholder.
12
+
13
+ The decision table below applies to unintended shifts where a stable in-flow footprint is required.
14
+
15
+ ## Signal keywords
16
+
17
+ | Keyword | Example report phrasing |
18
+ |---------|------------------------|
19
+ | jump | "the input area jumps up" |
20
+ | gap | "there's a gap when X appears" |
21
+ | shift | "content shifts down when the banner loads" |
22
+ | pop | "the element pops in and pushes everything" |
23
+ | reflow | "reflow when toggling the sidebar" |
24
+ | flicker | "layout flickers on mount" |
25
+
26
+ ## Decision table
27
+
28
+ | Symptom | Root cause | Fix strategy | Anti-pattern to avoid |
29
+ |---------|-----------|-------------|----------------------|
30
+ | Element appears and displaces siblings | Conditional render inserts new layout space | Reserve space with hidden/opacity-zero placeholder; toggle visibility, not existence | Using z-index/absolute positioning instead of preserving the required in-flow footprint (not an exclusion for intended overlays); animation-delay |
31
+ | Element disappears and siblings collapse | Conditional render removes layout space | Keep element in DOM with `visibility: hidden` or `opacity: 0`; preserve its layout box | Removing from DOM and re-inserting |
32
+ | Element animates in and causes reflow | Height/width transition from 0 triggers layout recalc | Reserve full space in a fixed-size wrapper; animate content within it using `transform: scale` or `opacity` | Animating `height`/`width`/`max-height` from 0 (all change the layout box) |
33
+ | Content shifts after async load | Placeholder absent during fetch; content insertion changes layout | Reserve exact or minimum dimensions before content arrives | Rendering nothing then inserting loaded content |
34
+ | Show/hide toggle causes jump per cycle | Each toggle adds/removes layout participation | Toggle `opacity` or `visibility`, not `display: none`/DOM presence | Conditional rendering (`if`/`v-if`/ternary) that adds/removes nodes |
35
+
36
+ ## Verification
37
+
38
+ For the stable in-flow footprint remedy, a fix is valid when:
39
+
40
+ 1. The target element can cycle through every show/hide state without unintended sibling movement
41
+ 2. The reserved in-flow footprint remains stable during the visibility transition, even if content inside the wrapper mounts/unmounts
42
+ 3. The fix survives fast repeated toggles (no transient jump on race conditions)
43
+
44
+ For intended overlays or intentional expansion/collapse, verify the declared layout contract instead: overlays do not displace siblings; expansion/collapse produces only the intended movement, including under fast repeated toggles.
45
+
46
+ ## Falsifier
47
+
48
+ The reservation diagnosis is wrong for a stable in-flow case if the jump is fixed durably without stabilizing a changing footprint and does not recur under repeated show/hide cycles. Intended overlays, intentional expansion/collapse, and elements that already retain their in-flow footprint do not establish a need for additional space reservation.
49
+
50
+ ## Provenance
51
+
52
+ Derived from pattern card `layout-jumps-caused-by-dynamic-element-insertion-a-2026-10-04t21-54-24-831` (session `1d6cf0de`, score 26/35, status: operational). Original fix: opacity-toggle reservation for mascot-bar vertical jump in Goblin Portal TUI.
@@ -11,6 +11,7 @@ import type { ProgressEvent } from '../../agent/types.js';
11
11
  import { type TtfbTickCtx } from './stream-renderer-ttfb.js';
12
12
  export declare const WAITING_LABEL_PREFIX = " \u00B7 waiting ";
13
13
  export declare const AWAITING_LABEL_PREFIX = " \u00B7 awaiting ";
14
+ export declare const THINKING_GRACE_MS = 2000;
14
15
  export interface LifecycleContext extends TtfbTickCtx {
15
16
  compositor: TerminalCompositor | null;
16
17
  overlayComposer: OverlayComposer | null;
@@ -26,6 +27,7 @@ export interface LifecycleContext extends TtfbTickCtx {
26
27
  sources: Map<string, SourceState>;
27
28
  pauseTickInterval: ReturnType<typeof setInterval> | null;
28
29
  resizeUnsub: (() => void) | null;
30
+ lastThinkingAnnotation: string;
29
31
  }
30
32
  export declare function registerOverlaySlots(overlayComposer: OverlayComposer, ctx: Readonly<Pick<LifecycleContext, 'stageTracker' | 'thinkingMode' | 'thinkingLane' | 'streamingMarkdownRef' | 'toolLane' | 'lastProgressByTask'>> & {
31
33
  sources?: ReadonlyMap<string, SourceState>;
@@ -36,3 +38,4 @@ export declare function registerOverlaySlots(overlayComposer: OverlayComposer, c
36
38
  export declare function formatInterruptAffordance(interrupting: boolean): string;
37
39
  export declare function subscribeToResize(overlayComposer: OverlayComposer, disposed: boolean): () => void;
38
40
  export declare function checkPauseAnnotations(ctx: LifecycleContext): boolean;
41
+ export declare function checkThinkingAnnotation(ctx: LifecycleContext, _now: number): boolean;
@@ -44,6 +44,7 @@ export declare class StreamRenderer {
44
44
  private readonly ttfbStartedAt;
45
45
  private ttfbDone;
46
46
  private lastTtfbAnnotation;
47
+ private lastThinkingAnnotation;
47
48
  private readonly addPreviewDiffRef;
48
49
  private completionWriter;
49
50
  readonly sink: (event: OutputEvent, meta?: SubagentProgressMeta) => void;
@@ -15,4 +15,5 @@ export declare class ThinkingLane {
15
15
  drainPhase(): string;
16
16
  collapse(): string | null;
17
17
  inlineSummary(): string | null;
18
+ activeThinkingElapsedMs(): number | null;
18
19
  }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerPauseCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerResumeAllCommand(program: Command): void;
@@ -1,2 +1,6 @@
1
- import type { SlashCommand } from '../types.js';
1
+ import type { SlashCommand, SlashContext } from '../types.js';
2
+ type Session = SlashContext['session']['current'];
3
+ export declare function pick(ctx: SlashContext, choices: string[], title?: string): Promise<number | ':cancel' | null>;
4
+ export declare function restoreFiles(ctx: SlashContext, session: Session, checkpointTurnId: string): Promise<boolean>;
2
5
  export declare const rewindCmd: SlashCommand;
6
+ export {};