agent-afk 5.345.0 → 5.347.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 (39) 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/session-spawn.d.ts +2 -2
  4. package/dist/agent/daemon.startup-register.d.ts +3 -1
  5. package/dist/agent/episodes/facet-bridge.d.ts +2 -0
  6. package/dist/agent/episodes/index.d.ts +2 -3
  7. package/dist/agent/episodes/types.d.ts +0 -11
  8. package/dist/agent/facets/index.d.ts +1 -0
  9. package/dist/agent/facets/yield-probe.d.ts +1 -0
  10. package/dist/agent/file-checkpoint/turn-log.d.ts +6 -0
  11. package/dist/agent/memory/memory-store.schema.d.ts +2 -2
  12. package/dist/agent/memory/types.d.ts +1 -1
  13. package/dist/agent/outcomes/terminal-state.d.ts +1 -0
  14. package/dist/agent/session/pause-controller.d.ts +19 -0
  15. package/dist/agent/session/session-meta.d.ts +5 -4
  16. package/dist/agent/subagent/fork-child-config.d.ts +1 -0
  17. package/dist/agent/subagent/handle.d.ts +1 -0
  18. package/dist/agent/subagent/identity-preamble.d.ts +5 -1
  19. package/dist/agent/tools/handlers/index.d.ts +2 -1
  20. package/dist/agent/tools/handlers/journal.d.ts +2 -0
  21. package/dist/agent/tools/schemas.journal.d.ts +2 -0
  22. package/dist/agent/tools/schemas.order.d.ts +1 -1
  23. package/dist/agent/tools/subagent-executor.d.ts +1 -0
  24. package/dist/agent/trace/receipt.types.d.ts +4 -0
  25. package/dist/agent/unattended-limits.d.ts +6 -0
  26. package/dist/bundled-plugins/awa-bundled/skills/ground-state/SKILL.md +1 -1
  27. package/dist/cli/commands/doctor-checks.subsystem.d.ts +30 -0
  28. package/dist/cli/commands/pause.d.ts +2 -0
  29. package/dist/cli/commands/resume-all.d.ts +2 -0
  30. package/dist/cli/slash/commands/core.rewind.d.ts +5 -1
  31. package/dist/cli.mjs +595 -573
  32. package/dist/config/delegation-profiles.d.ts +28 -0
  33. package/dist/config/env.d.ts +8 -1
  34. package/dist/config/env.model.d.ts +8 -1
  35. package/dist/index.mjs +457 -417
  36. package/dist/telegram.mjs +493 -472
  37. package/package.json +1 -1
  38. package/dist/agent/episodes/extract.d.ts +0 -2
  39. 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;
@@ -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,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,5 @@
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';
5
4
  import type { EpisodeRecord } from './types.js';
6
5
  export declare function synthesizeAndWriteEpisode(sessionId: string): Promise<EpisodeRecord | null>;
@@ -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
- }
@@ -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;
@@ -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';
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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
  }
@@ -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 {};
@@ -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
 
@@ -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>;
@@ -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 {};