agent-afk 5.346.0 → 5.348.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.
Files changed (41) hide show
  1. package/dist/agent/agents/index.d.ts +1 -1
  2. package/dist/agent/agents/tool-def.d.ts +4 -1
  3. package/dist/agent/daemon.startup-register.d.ts +3 -1
  4. package/dist/agent/episodes/facet-bridge.d.ts +2 -0
  5. package/dist/agent/episodes/index.d.ts +6 -3
  6. package/dist/agent/episodes/q-ingest.d.ts +16 -0
  7. package/dist/agent/episodes/q-store.d.ts +35 -0
  8. package/dist/agent/episodes/types.d.ts +0 -11
  9. package/dist/agent/memory/index.d.ts +1 -1
  10. package/dist/agent/memory/memory-loader.d.ts +10 -0
  11. package/dist/agent/memory/memory-store.d.ts +1 -0
  12. package/dist/agent/memory/memory-store.schema.d.ts +2 -2
  13. package/dist/agent/memory/types.d.ts +5 -3
  14. package/dist/agent/outcomes/terminal-state.d.ts +1 -0
  15. package/dist/agent/providers/shared/abortable-stream.d.ts +6 -1
  16. package/dist/agent/providers/shared/stream-stall-timeout.d.ts +2 -0
  17. package/dist/agent/session/default-subagent-model.d.ts +2 -0
  18. package/dist/agent/session/pause-controller.d.ts +3 -0
  19. package/dist/agent/session/session-meta.d.ts +5 -4
  20. package/dist/agent/subagent/fork-child-config.d.ts +1 -0
  21. package/dist/agent/subagent/identity-preamble.d.ts +5 -1
  22. package/dist/agent/tools/handlers/index.d.ts +2 -1
  23. package/dist/agent/tools/handlers/journal.d.ts +2 -0
  24. package/dist/agent/tools/schemas.journal.d.ts +2 -0
  25. package/dist/agent/tools/schemas.order.d.ts +1 -1
  26. package/dist/agent/tools/subagent-executor.d.ts +1 -0
  27. package/dist/agent/trace/receipt.types.d.ts +4 -0
  28. package/dist/bundled-plugins/awa-bundled/skills/ground-state/SKILL.md +1 -1
  29. package/dist/cli/_lib/stream-renderer-lifecycle.d.ts +1 -1
  30. package/dist/cli/commands/doctor-checks.subsystem.d.ts +30 -0
  31. package/dist/cli/commands/interactive/bootstrap-session-builder.d.ts +1 -1
  32. package/dist/cli.mjs +702 -593
  33. package/dist/config/delegation-profiles.d.ts +28 -0
  34. package/dist/config/env.d.ts +15 -0
  35. package/dist/config/env.episode.d.ts +8 -0
  36. package/dist/config/env.model.d.ts +7 -0
  37. package/dist/index.mjs +466 -406
  38. package/dist/telegram.mjs +510 -470
  39. package/package.json +1 -1
  40. package/dist/agent/episodes/extract.d.ts +0 -2
  41. package/dist/agent/episodes/synthesize.d.ts +0 -2
@@ -1,4 +1,4 @@
1
1
  export type { AgentRegistry, RegisteredAgent, } from './types.js';
2
2
  export { resolveAgentToolAccess } from './resolve.js';
3
3
  export { loadAgentRegistry } from './registry.js';
4
- export { buildAgentToolDef, buildAgentTypeListing } from './tool-def.js';
4
+ export { buildAgentToolDef, buildAgentTypeListing, buildComposeTool, buildAgentModelParamDescription } from './tool-def.js';
@@ -1,4 +1,7 @@
1
1
  import type { AnthropicToolDef } from '../tools/types.js';
2
2
  import type { AgentRegistry } from './types.js';
3
- export declare function buildAgentToolDef(registry: AgentRegistry | undefined): AnthropicToolDef;
3
+ import type { AgentModelInput } from '../types.js';
4
+ export declare function buildAgentModelParamDescription(parentModel?: AgentModelInput): string;
5
+ export declare function buildAgentToolDef(registry: AgentRegistry | undefined, parentModel?: AgentModelInput): AnthropicToolDef;
6
+ export declare function buildComposeTool(parentModel?: AgentModelInput): AnthropicToolDef;
4
7
  export declare function buildAgentTypeListing(registry: AgentRegistry | undefined): string;
@@ -1,3 +1,5 @@
1
1
  import type { CronScheduler } from './daemon/scheduler.js';
2
2
  import type { ScheduledTask } from './daemon/triggers.js';
3
- export declare function registerTasksWithQuarantine(scheduler: CronScheduler, tasks: ScheduledTask[]): void;
3
+ export declare function registerTasksWithQuarantine(scheduler: CronScheduler, tasks: ScheduledTask[], options?: {
4
+ telemetryPath?: string;
5
+ }): void;
@@ -0,0 +1,2 @@
1
+ import type { EpisodeRecord } from './types.js';
2
+ export declare function buildEpisodeFromFacet(sessionId: string): EpisodeRecord | null;
@@ -1,6 +1,9 @@
1
- export type { EpisodeRecord, EpisodeInput } from './types.js';
2
- export { extractEpisodeInput } from './extract.js';
3
- export { synthesizeEpisode } from './synthesize.js';
1
+ export type { EpisodeRecord } from './types.js';
2
+ export { buildEpisodeFromFacet } from './facet-bridge.js';
4
3
  export { writeEpisode, formatEpisodeContent, sanitizeNarrative } from './writer.js';
4
+ export { ingestEpisodes } from './q-ingest.js';
5
+ export type { IngestResult, ParsedEpisodeContent } from './q-ingest.js';
6
+ export { QEpisodesStore, Q_EPISODES_SCHEMA_VERSION } from './q-store.js';
7
+ export type { QEpisodeRow, QEpisodeInput } from './q-store.js';
5
8
  import type { EpisodeRecord } from './types.js';
6
9
  export declare function synthesizeAndWriteEpisode(sessionId: string): Promise<EpisodeRecord | null>;
@@ -0,0 +1,16 @@
1
+ export interface IngestResult {
2
+ found: number;
3
+ upserted: number;
4
+ watermark: string | null;
5
+ totalStored: number;
6
+ }
7
+ export interface ParsedEpisodeContent {
8
+ sessionId: string;
9
+ goal: string;
10
+ narrative: string;
11
+ tags: string[];
12
+ files: string[];
13
+ synthesizedAt: string;
14
+ }
15
+ export declare function parseEpisodeContent(content: string, fallbackSessionId: string | null): ParsedEpisodeContent | null;
16
+ export declare function ingestEpisodes(memoryDir?: string, storeDir?: string): IngestResult;
@@ -0,0 +1,35 @@
1
+ export declare const Q_EPISODES_SCHEMA_VERSION = 1;
2
+ export interface QEpisodeRow {
3
+ session_id: string;
4
+ goal: string;
5
+ narrative: string;
6
+ tags_json: string;
7
+ files_json: string;
8
+ synthesized_at: string;
9
+ ingested_at: string;
10
+ }
11
+ export interface QEpisodeInput {
12
+ sessionId: string;
13
+ goal: string;
14
+ narrative: string;
15
+ tags: string[];
16
+ files: string[];
17
+ synthesizedAt: string;
18
+ }
19
+ export declare class QEpisodesStore {
20
+ private readonly dir;
21
+ private readonly db;
22
+ constructor(storeDir?: string);
23
+ getWatermark(): string | null;
24
+ setWatermark(ts: string): void;
25
+ upsertEpisode(input: QEpisodeInput): void;
26
+ getEpisode(sessionId: string): QEpisodeRow | null;
27
+ listEpisodes(opts?: {
28
+ domain?: string;
29
+ since?: string;
30
+ limit?: number;
31
+ }): QEpisodeRow[];
32
+ searchEpisodes(query: string, limit?: number): QEpisodeRow[];
33
+ count(): number;
34
+ close(): void;
35
+ }
@@ -11,14 +11,3 @@ export interface EpisodeRecord {
11
11
  narrative: string;
12
12
  synthesizedAt: string;
13
13
  }
14
- export interface EpisodeInput {
15
- sessionId: string;
16
- firstUserMessage: string;
17
- markSequence: string[];
18
- toolsUsed: string[];
19
- toolErrors: string[];
20
- lastAssistantMessage: string;
21
- facetSummary?: string;
22
- durationMs?: number;
23
- costUsd?: number;
24
- }
@@ -1,6 +1,6 @@
1
1
  export { MemoryStore } from './memory-store.js';
2
2
  export { estimateTokens } from './estimate-tokens.js';
3
- export { loadHotMemory, injectHotMemory } from './memory-loader.js';
3
+ export { loadHotMemory, injectHotMemory, injectEpisodeRecall } from './memory-loader.js';
4
4
  export { injectGoalPrompt } from '../goals/inject.js';
5
5
  export { createMemorySessionEndHook, createChildMemoryHotBlockHook } from './memory-hooks.js';
6
6
  export { guardChildHotWrites, isForkedChildSession, CHILD_HOT_WRITE_DENIED, type ForkSignals } from './memory-hot-guard.js';
@@ -1,3 +1,13 @@
1
1
  import type { AgentConfig } from '../types/config-types.js';
2
+ import { MemoryStore } from './memory-store.js';
3
+ import type { Fact } from './types.js';
2
4
  export declare function loadHotMemory(): string | null;
3
5
  export declare function injectHotMemory(config: AgentConfig): AgentConfig;
6
+ export declare function getCurrentBranch(cwd?: string): string | null;
7
+ export declare function getRecentlyModifiedFiles(cwd?: string): string[];
8
+ export declare function parseEpisodeFiles(content: string): string[];
9
+ export declare function scoreEpisode(fact: Fact, fileBasenames: Set<string>, branch: string | null, highFreqFiles: Set<string>): number;
10
+ export declare function buildHighFreqFiles(episodes: Fact[]): Set<string>;
11
+ export declare function formatEpisodeForRecall(fact: Fact): string;
12
+ export declare function recallEpisodes(memoryDir?: string, cwd?: string, store?: MemoryStore): Fact[];
13
+ export declare function injectEpisodeRecall(config: AgentConfig, memoryDir?: string, cwd?: string, store?: MemoryStore): AgentConfig;
@@ -23,6 +23,7 @@ export declare class MemoryStore {
23
23
  getFact(factId: number): Fact | null;
24
24
  getUnaccessed(minAgeDays?: number): Fact[];
25
25
  getAccessStats(): AccessStats;
26
+ getEpisodes(limit?: number): Fact[];
26
27
  searchFacts(query: string, opts?: SearchOpts): Fact[];
27
28
  startSession(session: NewSession): void;
28
29
  endSession(sessionId: string, summary: string, outcome: SessionOutcome, tokenCount?: number, costUsd?: number): void;
@@ -1,4 +1,4 @@
1
1
  import type BetterSqlite3 from 'better-sqlite3';
2
- export declare const SCHEMA_VERSION = 5;
3
- export declare const SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS sessions (\n session_id TEXT PRIMARY KEY,\n surface TEXT NOT NULL,\n started_at TEXT NOT NULL,\n ended_at TEXT,\n summary TEXT,\n tools_used TEXT NOT NULL DEFAULT '[]',\n outcome TEXT,\n token_count INTEGER,\n cost_usd REAL,\n -- v3: execution role 'main' | 'subagent'. Nullable (NULL on pre-v3 rows).\n -- Listed last to match the position ALTER TABLE ADD COLUMN appends it on\n -- migrated databases, so fresh and migrated DBs share one column order.\n actor TEXT\n);\n\nCREATE TABLE IF NOT EXISTS facts (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n session_id TEXT,\n created_at TEXT NOT NULL,\n category TEXT NOT NULL CHECK(category IN ('preference', 'convention', 'decision', 'learning')),\n content TEXT NOT NULL,\n source_surface TEXT NOT NULL DEFAULT 'cli',\n superseded_by INTEGER REFERENCES facts(id),\n confidence REAL NOT NULL DEFAULT 1.0,\n access_count INTEGER NOT NULL DEFAULT 0,\n last_accessed TEXT,\n -- v4: provenance citation backing a codebase fact (file:line, commit SHA,\n -- trace-event id). Nullable (NULL on pre-v4 rows and uncited writes).\n -- Listed last to match the position ALTER TABLE ADD COLUMN appends it on\n -- migrated databases, so fresh and migrated DBs share one column order.\n evidence TEXT\n);\n\nCREATE VIRTUAL TABLE IF NOT EXISTS facts_fts USING fts5(\n content,\n category,\n content=facts,\n content_rowid=id,\n tokenize='porter'\n);\n\nCREATE TRIGGER IF NOT EXISTS facts_ai AFTER INSERT ON facts BEGIN\n INSERT INTO facts_fts(rowid, content, category) VALUES (new.id, new.content, new.category);\nEND;\n\nCREATE TRIGGER IF NOT EXISTS facts_ad AFTER DELETE ON facts BEGIN\n INSERT INTO facts_fts(facts_fts, rowid, content, category) VALUES ('delete', old.id, old.content, old.category);\nEND;\n\nCREATE TABLE IF NOT EXISTS memory_metadata (key TEXT PRIMARY KEY, value TEXT NOT NULL);\n\nCREATE TRIGGER IF NOT EXISTS facts_au AFTER UPDATE OF content, category ON facts BEGIN\n INSERT INTO facts_fts(facts_fts, rowid, content, category) VALUES ('delete', old.id, old.content, old.category);\n INSERT INTO facts_fts(rowid, content, category) VALUES (new.id, new.content, new.category);\nEND;\n\nCREATE INDEX IF NOT EXISTS idx_sessions_started_at ON sessions(started_at DESC);\nCREATE INDEX IF NOT EXISTS idx_facts_session_id ON facts(session_id);\n\n-- v2: Fingerprint uniqueness for WAL replay. The four-field key (content,\n-- created_at, session_id, category) is the stable identity used by supersede\n-- WAL entries to locate rows across crash+restart cycles. Without a UNIQUE\n-- constraint, same-ms duplicate inserts make .get() return an arbitrary row.\n-- NULL session_id is coerced to the empty string so it participates in the\n-- uniqueness check (SQLite treats NULLs as distinct in UNIQUE indexes).\nCREATE UNIQUE INDEX IF NOT EXISTS idx_facts_fingerprint\n ON facts(content, created_at, COALESCE(session_id, ''), category);\n";
2
+ export declare const SCHEMA_VERSION = 6;
3
+ export declare const SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS sessions (\n session_id TEXT PRIMARY KEY,\n surface TEXT NOT NULL,\n started_at TEXT NOT NULL,\n ended_at TEXT,\n summary TEXT,\n tools_used TEXT NOT NULL DEFAULT '[]',\n outcome TEXT,\n token_count INTEGER,\n cost_usd REAL,\n -- v3: execution role 'main' | 'subagent'. Nullable (NULL on pre-v3 rows).\n -- Listed last to match the position ALTER TABLE ADD COLUMN appends it on\n -- migrated databases, so fresh and migrated DBs share one column order.\n actor TEXT\n);\n\nCREATE TABLE IF NOT EXISTS facts (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n session_id TEXT,\n created_at TEXT NOT NULL,\n category TEXT NOT NULL CHECK(category IN ('preference', 'convention', 'decision', 'learning', 'episode')),\n content TEXT NOT NULL,\n source_surface TEXT NOT NULL DEFAULT 'cli',\n superseded_by INTEGER REFERENCES facts(id),\n confidence REAL NOT NULL DEFAULT 1.0,\n access_count INTEGER NOT NULL DEFAULT 0,\n last_accessed TEXT,\n -- v4: provenance citation backing a codebase fact (file:line, commit SHA,\n -- trace-event id). Nullable (NULL on pre-v4 rows and uncited writes).\n -- Listed last to match the position ALTER TABLE ADD COLUMN appends it on\n -- migrated databases, so fresh and migrated DBs share one column order.\n evidence TEXT\n);\n\nCREATE VIRTUAL TABLE IF NOT EXISTS facts_fts USING fts5(\n content,\n category,\n content=facts,\n content_rowid=id,\n tokenize='porter'\n);\n\nCREATE TRIGGER IF NOT EXISTS facts_ai AFTER INSERT ON facts BEGIN\n INSERT INTO facts_fts(rowid, content, category) VALUES (new.id, new.content, new.category);\nEND;\n\nCREATE TRIGGER IF NOT EXISTS facts_ad AFTER DELETE ON facts BEGIN\n INSERT INTO facts_fts(facts_fts, rowid, content, category) VALUES ('delete', old.id, old.content, old.category);\nEND;\n\nCREATE TABLE IF NOT EXISTS memory_metadata (key TEXT PRIMARY KEY, value TEXT NOT NULL);\n\nCREATE TRIGGER IF NOT EXISTS facts_au AFTER UPDATE OF content, category ON facts BEGIN\n INSERT INTO facts_fts(facts_fts, rowid, content, category) VALUES ('delete', old.id, old.content, old.category);\n INSERT INTO facts_fts(rowid, content, category) VALUES (new.id, new.content, new.category);\nEND;\n\nCREATE INDEX IF NOT EXISTS idx_sessions_started_at ON sessions(started_at DESC);\nCREATE INDEX IF NOT EXISTS idx_facts_session_id ON facts(session_id);\n\n-- v2: Fingerprint uniqueness for WAL replay. The four-field key (content,\n-- created_at, session_id, category) is the stable identity used by supersede\n-- WAL entries to locate rows across crash+restart cycles. Without a UNIQUE\n-- constraint, same-ms duplicate inserts make .get() return an arbitrary row.\n-- NULL session_id is coerced to the empty string so it participates in the\n-- uniqueness check (SQLite treats NULLs as distinct in UNIQUE indexes).\nCREATE UNIQUE INDEX IF NOT EXISTS idx_facts_fingerprint\n ON facts(content, created_at, COALESCE(session_id, ''), category);\n";
4
4
  export declare function runMigrations(db: BetterSqlite3.Database, existingVersion: number): void;
@@ -1,5 +1,5 @@
1
1
  import type { TraceActor } from '../session/session-identity.js';
2
- export type FactCategory = 'preference' | 'convention' | 'decision' | 'learning';
2
+ export type FactCategory = 'preference' | 'convention' | 'decision' | 'learning' | 'episode';
3
3
  export type SessionOutcome = 'completed' | 'failed' | 'abandoned';
4
4
  export type MemoryUpdateAction = 'set' | 'supersede' | 'remove';
5
5
  export type MemoryUpdateTarget = 'hot' | 'fact';
@@ -10,7 +10,7 @@ export interface Fact {
10
10
  created_at: string;
11
11
  category: FactCategory;
12
12
  content: string;
13
- source_surface: string;
13
+ source_surface: SourceSurface | (string & {});
14
14
  superseded_by: number | null;
15
15
  confidence: number;
16
16
  access_count: number;
@@ -21,7 +21,7 @@ export interface NewFact {
21
21
  session_id?: string;
22
22
  category: FactCategory;
23
23
  content: string;
24
- source_surface: string;
24
+ source_surface: SourceSurface | (string & {});
25
25
  evidence?: string | null;
26
26
  }
27
27
  export interface SessionRecord {
@@ -48,10 +48,12 @@ export interface Procedure {
48
48
  source_session: string | null;
49
49
  access_count: number;
50
50
  }
51
+ export type SourceSurface = 'cli' | 'telegram' | 'daemon' | 'afk' | 'episode-synthesis' | 'whatif' | 'test';
51
52
  export interface SearchOpts {
52
53
  category?: FactCategory;
53
54
  since?: string;
54
55
  limit?: number;
56
+ source_surface?: SourceSurface;
55
57
  }
56
58
  export interface MemorySearchResult {
57
59
  type: 'fact' | 'procedure';
@@ -5,6 +5,7 @@ export interface TerminalState {
5
5
  evidence?: string;
6
6
  whatChanged?: string;
7
7
  deferred?: string;
8
+ worthDoing?: string;
8
9
  whatBlocks?: string;
9
10
  unblockCondition?: string;
10
11
  alreadyDone?: string;
@@ -1 +1,6 @@
1
- export declare function abortableStream<T>(source: AsyncIterable<T>, signal: AbortSignal): AsyncGenerator<T>;
1
+ interface PauseSuspendable {
2
+ suspend(): void;
3
+ resumeTimer(): void;
4
+ }
5
+ export declare function abortableStream<T>(source: AsyncIterable<T>, signal: AbortSignal, stallHandle?: PauseSuspendable): AsyncGenerator<T>;
6
+ export {};
@@ -7,6 +7,8 @@ export interface StreamStallHandle {
7
7
  readonly signal: AbortSignal;
8
8
  timedOut(): boolean;
9
9
  progress(): void;
10
+ suspend(): void;
11
+ resumeTimer(): void;
10
12
  dispose(): void;
11
13
  }
12
14
  export declare function armStreamStallWatchdog(baseSignal: AbortSignal, timeoutMs: number, onFire?: (info: {
@@ -1,2 +1,4 @@
1
1
  import type { AgentModelInput } from '../types.js';
2
+ import { type ModelSlots } from './model-slots.js';
2
3
  export declare function getDefaultSubagentModel(parentModel?: AgentModelInput): AgentModelInput;
4
+ export declare function describeDefaultSubagentModelSource(defaultModel: AgentModelInput, bindings: ModelSlots): string;
@@ -6,9 +6,12 @@ export declare class PauseController {
6
6
  private _paused;
7
7
  private _pollInterval;
8
8
  private _watchPath;
9
+ private _pauseStartedAt;
10
+ private _lastPauseDurationMs;
9
11
  private constructor();
10
12
  dispose(): void;
11
13
  isPaused(): boolean;
14
+ consumeLastPauseDuration(): number | undefined;
12
15
  check(signal?: AbortSignal): Promise<void>;
13
16
  private _handlePause;
14
17
  private _handleResume;
@@ -9,14 +9,15 @@ export interface SessionMeta {
9
9
  startedAt?: number;
10
10
  afkVersion?: string;
11
11
  forkedFrom?: string;
12
- gitHead?: SessionStart | null;
12
+ gitHead?: GitHeadSnapshot | null;
13
13
  }
14
- export interface SessionStart {
14
+ export interface GitHeadSnapshot {
15
15
  branch: string | null;
16
16
  headSha: string | null;
17
17
  capturedAt: number;
18
18
  }
19
- export declare function captureGitHead(cwd: string): SessionStart;
19
+ export type SessionStart = GitHeadSnapshot;
20
+ export declare function captureGitHead(cwd: string): GitHeadSnapshot;
20
21
  export declare function writeSessionMeta(meta: SessionMeta): Promise<void>;
21
22
  export declare function readSessionMeta(sessionId: string): SessionMeta | null;
22
- export declare function readSessionStart(sessionId: string): SessionStart | null;
23
+ export declare function readSessionStart(sessionId: string): GitHeadSnapshot | null;
@@ -27,6 +27,7 @@ export interface AssembleChildConfigArgs<T> {
27
27
  parentRootSessionId: string | undefined;
28
28
  yieldEnabled?: boolean;
29
29
  nestedAgentAllowlist?: readonly string[];
30
+ resolvedAgentType?: string;
30
31
  }
31
32
  export type ParentForkFields = Pick<AssembleChildConfigArgs<unknown>, 'parentCwd' | 'parentApiKey' | 'parentBaseUrl' | 'parentProvider' | 'parentTraceWriter' | 'parentSurface' | 'parentCanUseTool' | 'parentRootSessionId'>;
32
33
  export declare function assembleChildConfig<T>(args: AssembleChildConfigArgs<T>): AgentConfig;
@@ -7,6 +7,10 @@ export interface SubagentIdentityFacts {
7
7
  nestedAgentAllowlist?: readonly string[];
8
8
  cwd?: string;
9
9
  yieldEnabled?: boolean;
10
+ resolvedAgentType?: string;
11
+ parentSessionId?: string;
10
12
  }
13
+ declare function shouldEmitOrientationBlock(resolvedAgentType: string | undefined): boolean;
14
+ export { shouldEmitOrientationBlock };
11
15
  export declare function renderSubagentIdentityPreamble(facts: SubagentIdentityFacts): string;
12
- export declare function injectSubagentIdentityPreamble(config: AgentConfig, nestedAgentAllowlist?: readonly string[], yieldEnabled?: boolean): AgentConfig;
16
+ export declare function injectSubagentIdentityPreamble(config: AgentConfig, nestedAgentAllowlist?: readonly string[], yieldEnabled?: boolean, resolvedAgentType?: string, parentSessionId?: string): AgentConfig;
@@ -17,6 +17,7 @@ import { createScheduleHandler, updateScheduleHandler, listSchedulesHandler, get
17
17
  import { terminalFontSizeHandler } from './terminal-font-size.js';
18
18
  import { createWorktreeHandler } from './worktree.js';
19
19
  import { configGetHandler, configSetHandler } from './config-ops.js';
20
+ import { readJournalHandler } from './journal.js';
20
21
  import { askQuestionHandler } from './ask-question.js';
21
22
  import { browserOpenHandler } from './browser-open.js';
22
23
  import { browserObserveHandler } from './browser-observe.js';
@@ -33,4 +34,4 @@ import { remoteAgentHandler } from './remote-agent.js';
33
34
  import { clipboardWriteHandler, clipboardReadHandler, createClipboardWriteHandler, createClipboardReadHandler } from './clipboard.js';
34
35
  import { listSessionsHandler, sendToSessionHandler } from './peer.js';
35
36
  export declare function createBuiltinHandlers(permissionMode?: string, cwd?: string): Map<string, ToolHandler>;
36
- export { bashHandler, readFileHandler, extractDocumentHandler, writeFileHandler, editFileHandler, globHandler, grepHandler, listDirectoryHandler, sendTelegramHandler, webScrapeHandler, webRequestHandler, imageGenerateHandler, imageEditHandler, createImageEditHandler, viewImageHandler, createViewImageHandler, createScheduleHandler, updateScheduleHandler, listSchedulesHandler, getScheduleHistoryHandler, cancelScheduleHandler, terminalFontSizeHandler, createWorktreeHandler, configGetHandler, configSetHandler, askQuestionHandler, waitForHandler, patchApplyHandler, browserOpenHandler, browserObserveHandler, browserActHandler, browserScreenshotHandler, browserCloseHandler, testRunHandler, getFacetHandler, jsonQueryHandler, modelCompleteHandler, remoteAgentHandler, createJsonQueryHandler, clipboardWriteHandler, clipboardReadHandler, createClipboardWriteHandler, createClipboardReadHandler, listSessionsHandler, sendToSessionHandler, };
37
+ export { bashHandler, readFileHandler, extractDocumentHandler, writeFileHandler, editFileHandler, globHandler, grepHandler, listDirectoryHandler, sendTelegramHandler, webScrapeHandler, webRequestHandler, imageGenerateHandler, imageEditHandler, createImageEditHandler, viewImageHandler, createViewImageHandler, createScheduleHandler, updateScheduleHandler, listSchedulesHandler, getScheduleHistoryHandler, cancelScheduleHandler, terminalFontSizeHandler, createWorktreeHandler, configGetHandler, configSetHandler, askQuestionHandler, waitForHandler, patchApplyHandler, browserOpenHandler, browserObserveHandler, browserActHandler, browserScreenshotHandler, browserCloseHandler, testRunHandler, getFacetHandler, jsonQueryHandler, modelCompleteHandler, remoteAgentHandler, createJsonQueryHandler, clipboardWriteHandler, clipboardReadHandler, createClipboardWriteHandler, createClipboardReadHandler, listSessionsHandler, sendToSessionHandler, readJournalHandler, };
@@ -0,0 +1,2 @@
1
+ import type { ToolHandler } from '../types.js';
2
+ export declare const readJournalHandler: ToolHandler;
@@ -0,0 +1,2 @@
1
+ import type { AnthropicToolDef } from './types.js';
2
+ export declare const readJournalTool: AnthropicToolDef;
@@ -1,3 +1,3 @@
1
1
  import type { AnthropicToolDef } from './types.js';
2
- export declare const INVARIANT_CORE_COUNT = 23;
2
+ export declare const INVARIANT_CORE_COUNT = 24;
3
3
  export declare function sortMcpSchemas(schemas: AnthropicToolDef[]): AnthropicToolDef[];
@@ -16,6 +16,7 @@ export declare class SubagentExecutor implements SubagentControl {
16
16
  setCwd(cwd: string): void;
17
17
  setTraceWriter(writer: TraceSink | undefined): void;
18
18
  describeAgentTool(): AnthropicToolDef;
19
+ describeComposeTool(): AnthropicToolDef;
19
20
  describeAgentTypeListing(): string;
20
21
  private readonly promotionTriggers;
21
22
  private readonly activeForegroundHandles;
@@ -21,6 +21,8 @@ export interface RunReceipt {
21
21
  sessionId?: string;
22
22
  cwd?: string;
23
23
  endReason?: string;
24
+ model?: string;
25
+ resolvedModel?: string;
24
26
  status: 'succeeded' | 'failed' | 'cancelled' | 'unknown';
25
27
  closureReason?: ClosureReason;
26
28
  lastStopReason?: string;
@@ -78,4 +80,6 @@ export interface ReceiptMeta {
78
80
  now?: Date;
79
81
  journalSummary?: JournalSummary;
80
82
  outcomes?: OutcomesV1 | null;
83
+ model?: string;
84
+ resolvedModel?: string;
81
85
  }
@@ -70,7 +70,7 @@ Read `SPINE.md` from the repo root (same directory as `AFK.md`). If the file doe
70
70
 
71
71
  For software-domain sessions, check whether the eval-run pipeline is current. This guard catches silent regressions that accumulate when the pipeline goes unrun during high-velocity sprints.
72
72
 
73
- Read the last line of `~/.afk/agent-framework/improve/eval-runs/.index.jsonl` (use `read_file`; if the file does not exist, treat as "never run").
73
+ Read `~/.afk/agent-framework/improve/eval-runs/.index.jsonl` in full (use `read_file` with no `offset` or `limit`; the file is operationally small — typically a few dozen lines — so a full read is safe). If the file does not exist, treat as "never run". Take the last non-empty line as the most recent entry.
74
74
 
75
75
  Parse the `timestamp` field from the output. Then compute the age in days relative to today's date.
76
76
 
@@ -38,4 +38,4 @@ export declare function registerOverlaySlots(overlayComposer: OverlayComposer, c
38
38
  export declare function formatInterruptAffordance(interrupting: boolean): string;
39
39
  export declare function subscribeToResize(overlayComposer: OverlayComposer, disposed: boolean): () => void;
40
40
  export declare function checkPauseAnnotations(ctx: LifecycleContext): boolean;
41
- export declare function checkThinkingAnnotation(ctx: LifecycleContext, _now: number): boolean;
41
+ export declare function checkThinkingAnnotation(ctx: LifecycleContext, now: number): boolean;
@@ -0,0 +1,30 @@
1
+ import type { Check } from './doctor-checks.js';
2
+ export interface MemoryStoreDeps {
3
+ dbPath?: string;
4
+ openAndCount?: (dbPath: string) => Promise<number>;
5
+ }
6
+ export declare function checkMemoryStore(deps?: MemoryStoreDeps): Promise<Check>;
7
+ export interface DaemonStateDeps {
8
+ lockPath?: string;
9
+ readLockFile?: (path: string) => Promise<string>;
10
+ isAlive?: (pid: number) => boolean;
11
+ }
12
+ export declare function checkDaemonState(deps?: DaemonStateDeps): Promise<Check>;
13
+ export interface NodeVersionDeps {
14
+ enginesNode?: string | null;
15
+ currentVersion?: string;
16
+ satisfies?: ((version: string, range: string) => boolean) | null;
17
+ }
18
+ export declare function checkNodeVersion(deps?: NodeVersionDeps): Promise<Check>;
19
+ export interface HookConfigDeps {
20
+ settingsPath?: string;
21
+ readFile?: (path: string) => Promise<string>;
22
+ }
23
+ export declare function checkHookConfig(deps?: HookConfigDeps): Promise<Check>;
24
+ export interface WitnessDirDeps {
25
+ witnessRoot?: string;
26
+ checkAccess?: (path: string, mode: number) => Promise<void>;
27
+ writeProbe?: (path: string) => Promise<void>;
28
+ removeProbe?: (path: string) => Promise<void>;
29
+ }
30
+ export declare function checkWitnessDir(deps?: WitnessDirDeps): Promise<Check>;
@@ -37,7 +37,7 @@ export interface BuildAgentSessionDeps {
37
37
  temperature?: number;
38
38
  explicitProvider?: string;
39
39
  }
40
- export declare function buildAgentSession(deps: BuildAgentSessionDeps): AgentSession;
40
+ export declare function buildAgentSession(deps: BuildAgentSessionDeps, sharedMemoryStore?: import('../../../agent/memory/memory-store.js').MemoryStore): AgentSession;
41
41
  export declare function buildSharedDeps(a: {
42
42
  sessionModel: string;
43
43
  resumeConfig: Partial<AgentConfig>;