agent-afk 5.257.2 → 5.257.4

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
@@ -83,8 +83,8 @@ AFK_MODEL=sonnet
83
83
  TELEGRAM_BOT_TOKEN=1234567890:ABC...
84
84
  AFK_TELEGRAM_ALLOWED_CHAT_IDS=12345678
85
85
 
86
- # Per-task safety rails
87
- AFK_MAX_BUDGET_USD=5.00
86
+ # Optional per-session cost cap (unset = no limit)
87
+ # AFK_MAX_BUDGET_USD=5.00
88
88
  ```
89
89
 
90
90
  **Project-scoped system prompt.** Drop an `AFK.md` at your project root and `afk` appends it to its built-in framework prompt whenever you run from that directory — your instructions layer on top of the base, they don't replace it. No frontmatter needed.
@@ -1,2 +1,3 @@
1
1
  import type { HookContext } from '../hooks.js';
2
- export declare function isSubagentContext(context: HookContext): boolean;
2
+ import type { ForkSignals } from '../memory/memory-hot-guard.js';
3
+ export declare function isSubagentContext(context: HookContext, extraSignals?: ForkSignals): boolean;
@@ -2,6 +2,6 @@ export { MemoryStore, estimateTokens } from './memory-store.js';
2
2
  export { loadHotMemory, injectHotMemory } from './memory-loader.js';
3
3
  export { injectGoalPrompt } from '../goals/inject.js';
4
4
  export { createMemorySessionEndHook, createChildMemoryHotBlockHook } from './memory-hooks.js';
5
- export { guardChildHotWrites, isForkedChildSession, CHILD_HOT_WRITE_DENIED } from './memory-hot-guard.js';
5
+ export { guardChildHotWrites, isForkedChildSession, CHILD_HOT_WRITE_DENIED, type ForkSignals } from './memory-hot-guard.js';
6
6
  export { memorySearchTool, memoryUpdateTool, procedureWriteTool, memoryToolSchemas, MEMORY_TOOL_NAMES, createMemoryHandlers, } from './memory-tools.js';
7
7
  export type { Fact, NewFact, FactCategory, SessionRecord, NewSession, SessionOutcome, Procedure, SearchOpts, MemorySearchResult, MemoryUpdateAction, MemoryUpdateTarget, WALEntry, } from './types.js';
@@ -1,4 +1,5 @@
1
1
  import type { HookHandler } from '../hooks.js';
2
2
  import { MemoryStore } from './memory-store.js';
3
- export declare function createChildMemoryHotBlockHook(): HookHandler;
3
+ import type { ForkSignals } from './memory-hot-guard.js';
4
+ export declare function createChildMemoryHotBlockHook(forkSignals?: ForkSignals): HookHandler;
4
5
  export declare function createMemorySessionEndHook(store: MemoryStore, surface?: string): HookHandler;
@@ -0,0 +1,4 @@
1
+ import type { MessageParam } from '@anthropic-ai/sdk/resources';
2
+ export declare const MANY_IMAGE_THRESHOLD = 20;
3
+ export declare const MAX_DIMENSION_MANY_IMAGES = 2000;
4
+ export declare function enforceManyImageLimit(messages: MessageParam[]): number;
@@ -1,5 +1,6 @@
1
1
  import type { FastModeController, FastTurnDecision } from '../../../fast-mode.js';
2
- export declare function snapshotFastDecision(controller: FastModeController | undefined, model: string, hasCustomEndpoint: boolean): FastTurnDecision | undefined;
2
+ import { type CatalogReaderDeps } from '../models-catalog.js';
3
+ export declare function snapshotFastDecision(controller: FastModeController | undefined, model: string, hasCustomEndpoint: boolean, catalogDeps?: CatalogReaderDeps): FastTurnDecision | undefined;
3
4
  export declare function isFastModeServiceTierError(error: unknown): boolean;
4
5
  export declare function extractResponsesServiceTier(responseObj: Record<string, unknown> | null | undefined): string | undefined;
5
6
  export declare function extractChatCompletionsServiceTier(chunk: Record<string, unknown> | null | undefined): string | undefined;
@@ -1,3 +1,2 @@
1
1
  export declare function isPreamble(text: string): boolean;
2
- export declare function extractSkillTitle(text: string): string | undefined;
3
2
  export declare function extractUserContent(text: string): string | undefined;
@@ -2,3 +2,4 @@ export type { AfkApprovalOutcome, AbortOrigin, AbortPayload, BackgroundAgentCanc
2
2
  export { AbortOriginSchema, AbortPayloadSchema, BackgroundAgentCancelledPayloadSchema, BackgroundAgentCompletedPayloadSchema, BackgroundAgentFailedPayloadSchema, BackgroundAgentJoinedPayloadSchema, BackgroundAgentPayloadSchema, BackgroundAgentStartedPayloadSchema, BrowserActActionSchema, BrowserEventPayloadSchema, BrowserEventTargetSchema, BrowserEventToolSchema, BudgetPayloadSchema, ClaimPayloadSchema, QueuedUserMessagePayloadSchema, ClosurePayloadSchema, ClosureReasonSchema, CompactionPayloadInputSchema, CompactionPayloadPersistedSchema, CompactionSidecarRefSchema, CompactionTriggerSchema, HookDecisionPayloadSchema, HookEventNameSchema, SessionPhaseNameSchema, SessionPhasePayloadSchema, SessionSealedPayloadSchema, SubagentCancelledPayloadSchema, SubagentFailedPayloadSchema, SubagentLifecyclePayloadSchema, SubagentStartedPayloadSchema, SubagentSucceededPayloadSchema, ToolCallCompletedPayloadSchema, ToolCallPayloadSchema, ToolCallStartedPayloadSchema, TraceEventInputSchema, TraceEventSchema, } from './events.js';
3
3
  export { InMemoryTraceWriter, NdjsonTraceWriter, } from './writer.js';
4
4
  export type { NdjsonTraceWriterOptions, TraceSink, TraceWriter } from './writer.js';
5
+ export { emitSessionIdAssigned } from '../session/session-id-trace.js';
@@ -42,6 +42,7 @@ export interface PanelSpec {
42
42
  title?: string;
43
43
  body: string | string[];
44
44
  }
45
+ export type NoticeKind = 'truncation' | 'refusal' | 'fast-tier';
45
46
  export type OutputEvent = {
46
47
  type: 'message';
47
48
  message: Message;
@@ -71,7 +72,7 @@ export type OutputEvent = {
71
72
  } | {
72
73
  type: 'notice';
73
74
  text: string;
74
- kind: 'truncation' | 'refusal' | 'fast-tier';
75
+ kind: NoticeKind;
75
76
  } | {
76
77
  type: 'tool-activity';
77
78
  activeCount: number;