agent-afk 5.338.1 → 5.340.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 (48) hide show
  1. package/dist/agent/daemon/github-event-poller.d.ts +2 -0
  2. package/dist/agent/file-checkpoint/bash-checkpoint.d.ts +5 -0
  3. package/dist/agent/file-checkpoint/file-checkpoint.d.ts +6 -0
  4. package/dist/agent/file-checkpoint/git-snapshot.attrs.d.ts +9 -0
  5. package/dist/agent/file-checkpoint/git-snapshot.d.ts +49 -0
  6. package/dist/agent/file-checkpoint/git-snapshot.diff.d.ts +27 -0
  7. package/dist/agent/file-checkpoint/git-snapshot.exec.d.ts +34 -0
  8. package/dist/agent/file-checkpoint/git-snapshot.index.d.ts +6 -0
  9. package/dist/agent/file-checkpoint/rewind-plan.d.ts +1 -0
  10. package/dist/agent/file-checkpoint/turn-log.d.ts +9 -1
  11. package/dist/agent/hooks.d.ts +1 -0
  12. package/dist/agent/operator-notify.d.ts +12 -0
  13. package/dist/agent/provider.d.ts +1 -0
  14. package/dist/agent/providers/openai-compatible/system-prompt-wiring.d.ts +10 -0
  15. package/dist/agent/providers/shared/prompt-fragment-tokens.d.ts +23 -0
  16. package/dist/agent/risk-classifier.d.ts +1 -1
  17. package/dist/agent/session/session-meta.d.ts +1 -0
  18. package/dist/agent/session-control/index.d.ts +1 -1
  19. package/dist/agent/session-control/reads.d.ts +0 -2
  20. package/dist/agent/shell-jobs/process-jobs.d.ts +2 -0
  21. package/dist/agent/subscription-usage.d.ts +0 -1
  22. package/dist/agent/tools/hooks/inline-image-hook.d.ts +2 -0
  23. package/dist/agent/tools/hooks/inline-image-render.d.ts +8 -0
  24. package/dist/agent/tools/skill-bridge.d.ts +1 -2
  25. package/dist/agent/tools/subagent-executor.execute-once.read-scope.d.ts +10 -0
  26. package/dist/agent/tools/tool-call-ledger.d.ts +19 -0
  27. package/dist/agent/trace/events.d.ts +5 -0
  28. package/dist/agent/trace/events.session-phase.d.ts +2 -0
  29. package/dist/agent/trace/receipt.journal.d.ts +2 -2
  30. package/dist/agent/trace/types.session-phase.d.ts +1 -1
  31. package/dist/agent/types/session-types.d.ts +1 -0
  32. package/dist/agent/usage/usage-http.d.ts +2 -0
  33. package/dist/cli/render/picker.d.ts +1 -1
  34. package/dist/cli/terminal-compositor.frame.lines.d.ts +1 -1
  35. package/dist/cli/terminal-compositor.types.d.ts +1 -0
  36. package/dist/cli.mjs +612 -601
  37. package/dist/config/env.auth.d.ts +8 -0
  38. package/dist/config/env.d.ts +50 -0
  39. package/dist/config/env.file-checkpoint.d.ts +21 -0
  40. package/dist/config/env.session-storage.d.ts +21 -0
  41. package/dist/config/env.ui.d.ts +21 -0
  42. package/dist/index.mjs +476 -475
  43. package/dist/paths.checkpoint.d.ts +2 -0
  44. package/dist/paths.d.ts +1 -1
  45. package/dist/telegram.mjs +517 -506
  46. package/dist/utils/errors.d.ts +2 -0
  47. package/dist/web-server/fork-ledger.d.ts +1 -0
  48. package/package.json +1 -1
@@ -10,6 +10,8 @@ export interface GithubPollerOptions {
10
10
  ghRunner?: GhRunner;
11
11
  }
12
12
  export type GhRunner = (path: string, extraArgs?: string[]) => Promise<unknown>;
13
+ export declare const MAX_SEEN_FOR_TESTS = 10000;
14
+ export declare function _pruneSeen(seen: Set<string>): Set<string>;
13
15
  export declare function renderCommand(template: string, eventType: GithubEventType, repo: string, eventId: string, payloadSummary: string): string;
14
16
  export declare class GithubEventPoller {
15
17
  private readonly repo;
@@ -0,0 +1,5 @@
1
+ import type { FileCheckpointRegistry } from './file-checkpoint.js';
2
+ export interface BashCheckpoint {
3
+ finish(partialReason?: string): Promise<void>;
4
+ }
5
+ export declare function beginBashCheckpoint(registry: FileCheckpointRegistry | undefined, cwd: string, skipReason?: string, signal?: AbortSignal): Promise<BashCheckpoint>;
@@ -1,5 +1,11 @@
1
1
  export interface FileCheckpointRegistry {
2
2
  snapshotFile(absPath: string): Promise<void>;
3
+ recordPriorState(absPath: string, prior: {
4
+ bytes: Buffer;
5
+ mode: number;
6
+ } | null): Promise<void>;
7
+ readonly sessionId: string;
8
+ readonly stateDir?: string;
3
9
  readonly turnId: string;
4
10
  touchedPaths(): string[];
5
11
  }
@@ -0,0 +1,9 @@
1
+ import { type Failure, type GitCtx } from './git-snapshot.exec.js';
2
+ export declare function _setAttrSourceSupportForTests(value: boolean | undefined): void;
3
+ export declare function attrSourceSupported(ctx: GitCtx, cwd: string, emptyTree: string): Promise<boolean | null>;
4
+ export declare function hasConvertingAttribute(text: string): boolean;
5
+ export declare function findConverting(files: readonly string[]): Promise<string | null>;
6
+ export declare function workTreeAttributeFiles(ctx: GitCtx, repoRoot: string): Promise<string[] | Failure>;
7
+ export declare function globalAttributeFiles(ctx: GitCtx, cwd: string): Promise<string[]>;
8
+ export declare function systemAttributeFile(ctx: GitCtx, cwd: string): Promise<string | undefined>;
9
+ export declare function captureAttributeCheck(ctx: GitCtx, repoRoot: string, infoAttributes: string, supported: boolean): Promise<Failure | null>;
@@ -0,0 +1,49 @@
1
+ export { MAX_BLOB_BYTES } from './git-snapshot.diff.js';
2
+ export type GitSnapshotFailure = 'not-git' | 'timeout' | 'unsafe-attributes' | 'error';
3
+ export interface CaptureOptions {
4
+ cwd: string;
5
+ objectDir: string;
6
+ indexFile: string;
7
+ timeoutMs: number;
8
+ }
9
+ export type CaptureResult = {
10
+ ok: true;
11
+ repoRoot: string;
12
+ tree: string;
13
+ partial?: string;
14
+ } | {
15
+ ok: false;
16
+ reason: GitSnapshotFailure;
17
+ detail?: string;
18
+ };
19
+ export interface DiffOptions {
20
+ repoRoot: string;
21
+ objectDir: string;
22
+ before: string;
23
+ after: string;
24
+ maxFiles: number;
25
+ timeoutMs: number;
26
+ }
27
+ export interface TreeChange {
28
+ absPath: string;
29
+ prior: {
30
+ bytes: Buffer;
31
+ mode: number;
32
+ } | null;
33
+ }
34
+ export interface SkippedChange {
35
+ absPath: string;
36
+ reason: string;
37
+ }
38
+ export type DiffResult = {
39
+ ok: true;
40
+ changes: TreeChange[];
41
+ skipped: SkippedChange[];
42
+ truncated: boolean;
43
+ } | {
44
+ ok: false;
45
+ reason: GitSnapshotFailure;
46
+ detail?: string;
47
+ };
48
+ export declare function captureWorkspaceTree(options: CaptureOptions): Promise<CaptureResult>;
49
+ export declare function diffTrees(options: DiffOptions): Promise<DiffResult>;
@@ -0,0 +1,27 @@
1
+ import { type GitCtx } from './git-snapshot.exec.js';
2
+ import type { DiffOptions, DiffResult } from './git-snapshot.js';
3
+ export interface RawEntry {
4
+ oldMode: string;
5
+ newMode: string;
6
+ oldSha: string;
7
+ status: string;
8
+ gitPath: string;
9
+ }
10
+ export declare function parseRawDiff(buf: Buffer, onNonUtf8Path?: (rawPath: Buffer) => void): RawEntry[] | null;
11
+ export declare function toAbsPath(repoRoot: string, gitPath: string): string;
12
+ type Classified = {
13
+ kind: 'added';
14
+ } | {
15
+ kind: 'prior';
16
+ mode: number;
17
+ } | {
18
+ kind: 'skip';
19
+ reason: string;
20
+ };
21
+ export declare function classifyEntry(e: RawEntry): Classified;
22
+ export declare function parseCatFileBatch(buf: Buffer, count: number): Buffer[] | null;
23
+ export declare const MAX_BLOB_BYTES: number;
24
+ export declare function _setMaxBlobBytesForTests(value: number | undefined): void;
25
+ export declare function parseBatchCheck(buf: Buffer, count: number): number[] | null;
26
+ export declare function diffWithCtx(options: DiffOptions, ctx: GitCtx): Promise<DiffResult>;
27
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { GitSnapshotFailure } from './git-snapshot.js';
2
+ export type GitEnv = Record<string, string | undefined>;
3
+ export declare const GIT_SNAPSHOT_GLOBAL_ARGS: readonly string[];
4
+ export declare function snapshotArgs(hooksDir: string): string[];
5
+ export interface GitCtx {
6
+ args: readonly string[];
7
+ env: GitEnv;
8
+ deadline: number;
9
+ }
10
+ export declare function buildSnapshotEnv(): GitEnv;
11
+ export interface GitRun {
12
+ code: number | null;
13
+ stdout: Buffer;
14
+ stderr: string;
15
+ timedOut: boolean;
16
+ spawnError?: NodeJS.ErrnoException;
17
+ }
18
+ export interface RunOptions {
19
+ cwd: string;
20
+ env: GitEnv;
21
+ deadline: number;
22
+ input?: Buffer | string;
23
+ }
24
+ export declare function runGit(args: readonly string[], opts: RunOptions): Promise<GitRun>;
25
+ export interface Failure {
26
+ ok: false;
27
+ reason: GitSnapshotFailure;
28
+ detail?: string;
29
+ }
30
+ export declare function classifyFailure(run: GitRun, what: string): Failure;
31
+ export declare function isOk(run: GitRun): boolean;
32
+ export declare function firstLine(s: string): string;
33
+ export declare function runIn(ctx: GitCtx, cwd: string, args: readonly string[], input?: string): Promise<GitRun>;
34
+ export declare function quoteAlternate(dir: string, sep?: string): string;
@@ -0,0 +1,6 @@
1
+ import { type GitCtx } from './git-snapshot.exec.js';
2
+ export declare function withIndexLock<T>(indexFile: string, fn: () => Promise<T>): Promise<T>;
3
+ export declare function hasFlaggedEntries(lsFilesV: Buffer): boolean;
4
+ export declare function seedingSafe(ctx: GitCtx, repoRoot: string, infoAttributes: string): Promise<boolean>;
5
+ export declare function preparePrivateIndex(indexFile: string, repoRoot: string, seed: () => Promise<string | null>): Promise<void>;
6
+ export declare function discardPrivateIndex(indexFile: string): Promise<void>;
@@ -2,6 +2,7 @@ import { type FileSnapshot } from './file-checkpoint.js';
2
2
  export interface RewindPlan {
3
3
  snapshots: FileSnapshot[];
4
4
  expected: Map<string, string | null>;
5
+ uncaptured: string[];
5
6
  }
6
7
  export type RewindPlanResult = {
7
8
  plan: RewindPlan;
@@ -1,4 +1,12 @@
1
1
  export type PathHashes = Record<string, string | null>;
2
+ export type BashLogEntry = {
3
+ kind: 'bash';
4
+ turnId: string;
5
+ status: 'captured' | 'partial' | 'skipped';
6
+ reason?: string;
7
+ files?: number;
8
+ ts: number;
9
+ };
2
10
  export type TurnLogEntry = {
3
11
  kind: 'turn';
4
12
  turnId: string;
@@ -12,7 +20,7 @@ export type TurnLogEntry = {
12
20
  kind: 'restore';
13
21
  paths: PathHashes;
14
22
  ts: number;
15
- };
23
+ } | BashLogEntry;
16
24
  export declare function hashBytes(bytes: Buffer | null): string | null;
17
25
  export declare function currentHash(absPath: string): string | null;
18
26
  export declare function appendTurnLog(sessionId: string, entry: TurnLogEntry, stateDir?: string): boolean;
@@ -6,6 +6,7 @@ export interface HookDecision {
6
6
  continue?: boolean;
7
7
  decision?: 'block' | 'approve';
8
8
  reason?: string;
9
+ riskCategory?: import('./risk-classifier.js').RiskCategory;
9
10
  injectContext?: string;
10
11
  updatedInput?: Record<string, unknown>;
11
12
  }
@@ -0,0 +1,12 @@
1
+ import type { PushResult } from '../telegram/push.js';
2
+ export type { PushResult } from '../telegram/push.js';
3
+ export interface OperatorNotifyOptions {
4
+ parseMode?: 'MarkdownV2' | 'HTML' | 'Markdown';
5
+ markdown?: boolean;
6
+ replyMarkup?: import('telegraf/types').InlineKeyboardMarkup;
7
+ fetchImpl?: typeof fetch;
8
+ target?: number | readonly number[];
9
+ messageThreadId?: number;
10
+ }
11
+ export type OperatorNotifyFn = (text: string, opts?: OperatorNotifyOptions) => Promise<PushResult[] | null>;
12
+ export declare const operatorNotify: OperatorNotifyFn;
@@ -281,6 +281,7 @@ export interface ProviderRewindResult {
281
281
  deletions?: number;
282
282
  failures?: RewindFileFailure[];
283
283
  conflicts?: string[];
284
+ uncaptured?: string[];
284
285
  }
285
286
  export interface RewindFileFailure {
286
287
  path: string;
@@ -17,5 +17,15 @@ export interface SystemPromptWiringResult {
17
17
  initialSystemPrompt: string;
18
18
  rebuildAfterCwdChange: () => string;
19
19
  systemPromptRebuildFactory: (base: string | undefined) => string;
20
+ stableFragments: {
21
+ toolBase: string;
22
+ userSystem: string | undefined;
23
+ memoryPrompt: string;
24
+ workspacePrompt: string;
25
+ hotMemory: string;
26
+ goalPrompt: string;
27
+ manifest: string;
28
+ agentTypeListing: string;
29
+ };
20
30
  }
21
31
  export declare function buildSystemPromptWiring(args: SystemPromptWiringArgs): SystemPromptWiringResult;
@@ -0,0 +1,23 @@
1
+ import type { TraceSink } from '../../trace/writer.js';
2
+ export interface PromptFragments {
3
+ toolBase?: string;
4
+ userSystem?: string | null;
5
+ memoryPrompt?: string;
6
+ workspacePrompt?: string;
7
+ hotMemory?: string;
8
+ goalPrompt?: string;
9
+ environment?: string;
10
+ manifest?: string;
11
+ agentTypeListing?: string;
12
+ }
13
+ export declare function logFragmentTokens(traceWriter: TraceSink | undefined, fragments: PromptFragments): void;
14
+ export declare function logStablePartsTokens(traceWriter: TraceSink | undefined, parts: {
15
+ toolBase: string;
16
+ userSystem: string | null;
17
+ memoryPrompt: string;
18
+ workspacePrompt: string;
19
+ hotMemory: string;
20
+ goalPrompt?: string;
21
+ manifest: string;
22
+ agentTypeListing?: string;
23
+ }): void;
@@ -1,5 +1,5 @@
1
1
  export type RiskLevel = 'safe' | 'medium' | 'high';
2
- export declare const RISK_CATEGORIES: readonly ["read-only", "bash-destructive", "bash-mutating", "bash-background", "workspace-write", "credential-path", "workspace-escape", "network-mutation", "schedule-mutation", "mcp-destructive", "mcp-unknown", "worktree-mutation", "browser-action", "remote-exec", "outbound-message", "unknown"];
2
+ export declare const RISK_CATEGORIES: readonly ["read-only", "bash-destructive", "bash-mutating", "bash-background", "workspace-write", "credential-path", "workspace-escape", "network-mutation", "schedule-mutation", "mcp-destructive", "mcp-unknown", "worktree-mutation", "browser-action", "remote-exec", "outbound-message", "release-boundary", "unknown"];
3
3
  export type RiskCategory = (typeof RISK_CATEGORIES)[number];
4
4
  export interface RiskVerdict {
5
5
  level: RiskLevel;
@@ -8,6 +8,7 @@ export interface SessionMeta {
8
8
  provider?: string;
9
9
  startedAt?: number;
10
10
  afkVersion?: string;
11
+ forkedFrom?: string;
11
12
  }
12
13
  export declare function writeSessionMeta(meta: SessionMeta): Promise<void>;
13
14
  export declare function readSessionMeta(sessionId: string): SessionMeta | null;
@@ -2,4 +2,4 @@ export { clearConversation } from './clear.js';
2
2
  export { compactConversation, type CompactConversationResult, type CompactProgress } from './compact.js';
3
3
  export { setSessionModel, type SetSessionModelResult } from './model.js';
4
4
  export { setSessionName, sessionDisplayName, type SetSessionNameResult, type SessionNameOptions, THINKING_MODES, getSessionThinking, setSessionThinking, readSessionFast, setSessionFast, getUsageAwareness, setUsageAwarenessPreference, } from './preferences.js';
5
- export { readSubscriptionUsage, readContextUsage, readLocalTokenUsage, readTokenUsage, readMcpStatus, readMcpOauthPending, type ContextUsage, type LocalTokenUsage, type TokenUsage, } from './reads.js';
5
+ export { readContextUsage, readLocalTokenUsage, readTokenUsage, readMcpStatus, readMcpOauthPending, type ContextUsage, type LocalTokenUsage, type TokenUsage, } from './reads.js';
@@ -1,6 +1,5 @@
1
1
  import type { AgentSession } from '../session.js';
2
2
  import type { SessionStats } from '../../cli/slash/types.js';
3
- import { fetchSubscriptionUsage } from '../subscription-usage.js';
4
3
  export type ContextUsage = Awaited<ReturnType<AgentSession['getContextUsage']>>;
5
4
  export interface LocalTokenUsage {
6
5
  kind: 'local';
@@ -17,7 +16,6 @@ export type TokenUsage = {
17
16
  kind: 'sdk';
18
17
  usage: ContextUsage;
19
18
  } | LocalTokenUsage;
20
- export declare function readSubscriptionUsage(): ReturnType<typeof fetchSubscriptionUsage>;
21
19
  export declare function readContextUsage(session: Pick<AgentSession, 'getContextUsage'>): Promise<ContextUsage>;
22
20
  export declare function readLocalTokenUsage(stats: SessionStats): LocalTokenUsage;
23
21
  export declare function readTokenUsage(session: Pick<AgentSession, 'getContextUsage'>, stats: SessionStats): Promise<TokenUsage>;
@@ -60,6 +60,7 @@ export declare class ProcessJobRegistry extends EventEmitter<ProcessJobRegistryE
60
60
  private traceWriter;
61
61
  private readonly jobs;
62
62
  private counter;
63
+ private startedProcsEver;
63
64
  private closed;
64
65
  private exitHookInstalled;
65
66
  private readonly exitHook;
@@ -69,6 +70,7 @@ export declare class ProcessJobRegistry extends EventEmitter<ProcessJobRegistryE
69
70
  tail(id: string, maxChars: number): string | undefined;
70
71
  list(): readonly ProcessJobSnapshot[];
71
72
  runningCount(): number;
73
+ startedCount(): number;
72
74
  leaderExited(id: string): boolean;
73
75
  cancel(id: string, source: ProcessCancelSource, graceMs?: number): ProcessJobSnapshot | undefined;
74
76
  emitCancelTimeout(id: string): void;
@@ -22,4 +22,3 @@ export interface FetchSubscriptionUsageOptions {
22
22
  readonly timeoutMs?: number;
23
23
  }
24
24
  export declare function fetchSubscriptionUsage(options?: FetchSubscriptionUsageOptions): Promise<UsageResult>;
25
- export declare function formatUsagePlain(result: UsageResult): string;
@@ -0,0 +1,2 @@
1
+ import type { HookHandler } from '../../hooks.js';
2
+ export declare function createInlineImageHook(agentCwd?: string | undefined): HookHandler;
@@ -0,0 +1,8 @@
1
+ export type TerminalProtocol = 'kitty' | 'iterm2' | 'none';
2
+ export declare function detectTerminalProtocol(): TerminalProtocol;
3
+ export interface RenderInlineImageOptions {
4
+ filePath: string;
5
+ toolName: string;
6
+ agentCwd?: string | undefined;
7
+ }
8
+ export declare function renderInlineImage(opts: RenderInlineImageOptions): Promise<void>;
@@ -33,6 +33,5 @@ export declare function discoverPluginSkillBodies(pluginConfigs?: SdkPluginConfi
33
33
  export declare function discoverPluginAgents(pluginConfigs?: SdkPluginConfig[], warn?: (message: string) => void): RegisteredAgent[];
34
34
  export declare function scanAllPluginRoots(opts?: CollectSkillEntriesOptions): SdkPluginConfig[];
35
35
  export interface EnsurePluginEntrypointsOptions {
36
- stateStore?: import('../state/state-store.js').StateStore;
37
36
  }
38
- export declare function ensurePluginEntrypointsLoaded(opts?: EnsurePluginEntrypointsOptions): Promise<void>;
37
+ export declare function ensurePluginEntrypointsLoaded(_opts?: EnsurePluginEntrypointsOptions): Promise<void>;
@@ -0,0 +1,10 @@
1
+ export declare function resolveChildInheritedReadRoots(getReadScopeInputs: (() => {
2
+ parentReadRoots: string[] | undefined;
3
+ parentCwd: string | undefined;
4
+ }) | undefined): {
5
+ childScopeInputs: {
6
+ parentReadRoots: string[] | undefined;
7
+ parentCwd: string | undefined;
8
+ };
9
+ childInheritedReadRoots: string[] | undefined;
10
+ };
@@ -0,0 +1,19 @@
1
+ import type { ToolResult } from './types.js';
2
+ export declare const DEFAULT_TURN_WINDOW = 20;
3
+ export declare const MAX_LEDGER_KEYS = 2000;
4
+ export interface LedgerEntry {
5
+ readonly result: ToolResult;
6
+ readonly turnIndex: number;
7
+ }
8
+ export type LedgerHistory = readonly LedgerEntry[];
9
+ export declare class ToolCallLedger {
10
+ private readonly buckets;
11
+ private readonly turnWindow;
12
+ constructor(turnWindow?: number);
13
+ record(toolName: string, inputHash: string, result: ToolResult, turnIndex: number): void;
14
+ lookup(toolName: string, inputHash: string, currentTurn: number): LedgerHistory;
15
+ prune(currentTurn: number): void;
16
+ get keyCount(): number;
17
+ get entryCount(): number;
18
+ rawEntryCountFor(toolName: string, inputHash: string): number;
19
+ }
@@ -135,6 +135,7 @@ export declare const HookDecisionPayloadSchema: z.ZodObject<{
135
135
  "browser-action": "browser-action";
136
136
  "remote-exec": "remote-exec";
137
137
  "outbound-message": "outbound-message";
138
+ "release-boundary": "release-boundary";
138
139
  }>>;
139
140
  }, z.core.$strip>;
140
141
  export declare const HookSummaryPayloadSchema: z.ZodObject<{
@@ -412,6 +413,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
412
413
  "browser-action": "browser-action";
413
414
  "remote-exec": "remote-exec";
414
415
  "outbound-message": "outbound-message";
416
+ "release-boundary": "release-boundary";
415
417
  }>>;
416
418
  }, z.core.$strip>;
417
419
  }, z.core.$strip>, z.ZodObject<{
@@ -758,6 +760,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
758
760
  subagent_model_fallback: "subagent_model_fallback";
759
761
  round_cap_notice_dropped: "round_cap_notice_dropped";
760
762
  continuation_settle_degraded: "continuation_settle_degraded";
763
+ prompt_fragment_sizes: "prompt_fragment_sizes";
761
764
  }>;
762
765
  durationMs: z.ZodOptional<z.ZodNumber>;
763
766
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -869,6 +872,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
869
872
  "browser-action": "browser-action";
870
873
  "remote-exec": "remote-exec";
871
874
  "outbound-message": "outbound-message";
875
+ "release-boundary": "release-boundary";
872
876
  }>>;
873
877
  }, z.core.$strip>;
874
878
  }, z.core.$strip>, z.ZodObject<{
@@ -1243,6 +1247,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1243
1247
  subagent_model_fallback: "subagent_model_fallback";
1244
1248
  round_cap_notice_dropped: "round_cap_notice_dropped";
1245
1249
  continuation_settle_degraded: "continuation_settle_degraded";
1250
+ prompt_fragment_sizes: "prompt_fragment_sizes";
1246
1251
  }>;
1247
1252
  durationMs: z.ZodOptional<z.ZodNumber>;
1248
1253
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -54,6 +54,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
54
54
  subagent_model_fallback: "subagent_model_fallback";
55
55
  round_cap_notice_dropped: "round_cap_notice_dropped";
56
56
  continuation_settle_degraded: "continuation_settle_degraded";
57
+ prompt_fragment_sizes: "prompt_fragment_sizes";
57
58
  }>;
58
59
  export declare const SessionPhasePayloadSchema: z.ZodObject<{
59
60
  phase: z.ZodEnum<{
@@ -111,6 +112,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
111
112
  subagent_model_fallback: "subagent_model_fallback";
112
113
  round_cap_notice_dropped: "round_cap_notice_dropped";
113
114
  continuation_settle_degraded: "continuation_settle_degraded";
115
+ prompt_fragment_sizes: "prompt_fragment_sizes";
114
116
  }>;
115
117
  durationMs: z.ZodOptional<z.ZodNumber>;
116
118
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -1,4 +1,4 @@
1
- import type { JournalMessage } from '../journal/types.js';
1
+ import type { JournalMessage, JournalRecord } from '../journal/types.js';
2
2
  export interface JournalSummary {
3
3
  firstUserMessage?: string;
4
4
  lastAssistantMessage?: string;
@@ -7,4 +7,4 @@ export interface JournalSummary {
7
7
  messageCount: number;
8
8
  textRedacted?: boolean;
9
9
  }
10
- export declare function extractJournalSummary(messages: JournalMessage[] | null, textDisabled: boolean): JournalSummary | undefined;
10
+ export declare function extractJournalSummary(messages: JournalMessage[] | null, textDisabled: boolean, rawRecords?: readonly JournalRecord[]): JournalSummary | undefined;
@@ -1,4 +1,4 @@
1
- export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded';
1
+ export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded' | 'prompt_fragment_sizes';
2
2
  export interface SessionPhasePayload {
3
3
  phase: SessionPhaseName;
4
4
  durationMs?: number;
@@ -151,6 +151,7 @@ export interface RewindFilesResult {
151
151
  error: string;
152
152
  }>;
153
153
  conflicts?: string[];
154
+ uncaptured?: string[];
154
155
  }
155
156
  export interface IAgentSession {
156
157
  readonly state: SessionState;
@@ -1,5 +1,7 @@
1
1
  import type { UsageUnavailable } from '../subscription-usage.js';
2
2
  export declare const DEFAULT_USAGE_TIMEOUT_MS = 10000;
3
+ export declare const MAX_REASONABLE_EPOCH_SECONDS = 4102444800;
4
+ export declare function clampFraction(n: number): number;
3
5
  export interface UsageHttpOptions {
4
6
  readonly fetchImpl?: typeof fetch;
5
7
  readonly timeoutMs?: number;
@@ -23,7 +23,7 @@ export interface PickerState {
23
23
  filteredResults: ReturnType<typeof filterOptions>;
24
24
  selected: Set<number>;
25
25
  }
26
- export declare function renderPickerRows(state: PickerState, header: readonly string[], options: readonly string[], multi: boolean, searchable: boolean, terminalRowsFn: (() => number | undefined) | undefined, bandWidth?: number): readonly string[];
26
+ export declare function renderPickerRows(state: PickerState, header: readonly string[], options: readonly string[], multi: boolean, searchable: boolean, terminalRowsFn: (() => number | undefined) | undefined): readonly string[];
27
27
  export type PickerKeyAction = {
28
28
  kind: 'repaint';
29
29
  } | {
@@ -1,3 +1,3 @@
1
1
  import type { ChromeRows } from './terminal-compositor.frame.layout.js';
2
2
  export declare function buildFrameLines(chrome: ChromeRows, trimmedOverlay: string[], renderGap: boolean, dropdownRows: string[], hintRow: string | null, inputLine: string, margin?: string): string[];
3
- export declare function buildPickerFrameLines(chrome: ChromeRows, trimmedOverlay: string[], renderGap: boolean, pickerRows: string[], margin?: string): string[];
3
+ export declare function buildPickerFrameLines(chrome: ChromeRows, trimmedOverlay: string[], renderGap: boolean, pickerRows: string[], margin?: string, bandWidth?: number): string[];
@@ -51,6 +51,7 @@ export interface PickerController {
51
51
  meta?: boolean;
52
52
  sequence?: string;
53
53
  }) => void;
54
+ skipBandTruncation?: boolean;
54
55
  }
55
56
  export interface SubmissionPayload {
56
57
  text: string;