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 +2 -2
- package/dist/agent/hooks/hook-utils.d.ts +2 -1
- package/dist/agent/memory/index.d.ts +1 -1
- package/dist/agent/memory/memory-hooks.d.ts +2 -1
- package/dist/agent/providers/anthropic-direct/loop/_many-image-guard.d.ts +4 -0
- package/dist/agent/providers/openai-compatible/query/fast-mode.d.ts +2 -1
- package/dist/agent/session/preamble-strip.d.ts +0 -1
- package/dist/agent/trace/index.d.ts +1 -0
- package/dist/agent/types/session-types.d.ts +2 -1
- package/dist/cli.mjs +272 -272
- package/dist/config/env.d.ts +2 -3
- package/dist/index.mjs +112 -112
- package/dist/telegram.mjs +135 -135
- package/package.json +1 -1
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
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FastModeController, FastTurnDecision } from '../../../fast-mode.js';
|
|
2
|
-
|
|
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;
|
|
@@ -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:
|
|
75
|
+
kind: NoticeKind;
|
|
75
76
|
} | {
|
|
76
77
|
type: 'tool-activity';
|
|
77
78
|
activeCount: number;
|