agent-afk 5.328.2 → 5.329.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 (126) hide show
  1. package/dist/agent/agents/index.d.ts +1 -1
  2. package/dist/agent/agents/tool-def.d.ts +1 -0
  3. package/dist/agent/hooks.d.ts +2 -0
  4. package/dist/agent/providers/anthropic-direct/query/prompt-assembly.d.ts +1 -0
  5. package/dist/agent/providers/anthropic-direct/query/system-prompt.d.ts +1 -0
  6. package/dist/agent/providers/openai-compatible/query/turn-driver.d.ts +2 -1
  7. package/dist/agent/providers/openai-compatible/system-prompt-wiring.d.ts +1 -0
  8. package/dist/agent/safe-destruct-detect.d.ts +2 -1
  9. package/dist/agent/session/model-slots.utils.d.ts +1 -2
  10. package/dist/agent/subagent/continuation-guards.d.ts +28 -0
  11. package/dist/agent/subagent/continuation-registry.d.ts +85 -0
  12. package/dist/agent/subagent/fork-lifecycle.d.ts +5 -0
  13. package/dist/agent/subagent/fork-resolution.d.ts +2 -1
  14. package/dist/agent/subagent/fork-types.d.ts +7 -1
  15. package/dist/agent/subagent/handle.d.ts +1 -0
  16. package/dist/agent/subagent/handle.streaming.d.ts +1 -0
  17. package/dist/agent/subagent/identity-preamble.d.ts +2 -0
  18. package/dist/agent/subagent/result.d.ts +8 -0
  19. package/dist/agent/tools/handlers/lsp-shared.d.ts +1 -0
  20. package/dist/agent/tools/handlers/lsp-symbols.d.ts +3 -2
  21. package/dist/agent/tools/schemas.order.d.ts +1 -1
  22. package/dist/agent/tools/subagent/child-config.d.ts +1 -0
  23. package/dist/agent/tools/subagent/continuation-dispatch.d.ts +88 -0
  24. package/dist/agent/tools/subagent/continuation-run.d.ts +33 -0
  25. package/dist/agent/tools/subagent/foreground-promotion.d.ts +1 -0
  26. package/dist/agent/tools/subagent/input-parse.d.ts +1 -0
  27. package/dist/agent/tools/subagent-executor/types.d.ts +1 -0
  28. package/dist/agent/tools/subagent-executor.d.ts +1 -0
  29. package/dist/agent/tools/subagent-executor.execute-once.d.ts +2 -1
  30. package/dist/agent/tools/subagent-executor.execute-once.gates.d.ts +8 -0
  31. package/dist/agent/tools/subagent-executor.execute-once.helpers.d.ts +1 -0
  32. package/dist/agent/tools/subagent-executor.execute-once.remote.d.ts +3 -0
  33. package/dist/agent/trace/events.d.ts +10 -0
  34. package/dist/agent/trace/events.session-phase.d.ts +4 -0
  35. package/dist/agent/trace/events.subagent-lifecycle.d.ts +6 -0
  36. package/dist/agent/trace/types.d.ts +3 -0
  37. package/dist/agent/trace/types.session-phase.d.ts +1 -1
  38. package/dist/bundled-plugins/awa-bundled/skills/refactor/SKILL.md +1 -1
  39. package/dist/cli.mjs +438 -431
  40. package/dist/config/env.continuation.d.ts +17 -0
  41. package/dist/config/env.d.ts +24 -0
  42. package/dist/config/env.tools.d.ts +8 -0
  43. package/dist/improve/eval-run/contracts.sab.d.ts +4 -0
  44. package/dist/improve/eval-run/runner.d.ts +2 -0
  45. package/dist/index.mjs +228 -221
  46. package/dist/telegram/handlers/insights.d.ts +3 -1
  47. package/dist/telegram.mjs +249 -242
  48. package/dist/web-ui-assets/assets/{angular-html-CC3lIXKP.js → angular-html-DB8uHnwt.js} +1 -1
  49. package/dist/web-ui-assets/assets/{angular-ts-B55StdDa.js → angular-ts-lHP_pklW.js} +1 -1
  50. package/dist/web-ui-assets/assets/{apl-CodQVCEj.js → apl-BOnAxoH6.js} +1 -1
  51. package/dist/web-ui-assets/assets/{astro-D_fPYeDd.js → astro-CBmmpRMR.js} +1 -1
  52. package/dist/web-ui-assets/assets/{blade-BNccT06L.js → blade-AiinM4D6.js} +1 -1
  53. package/dist/web-ui-assets/assets/{c-C-qzdgmp.js → c-D_uY8_QG.js} +1 -1
  54. package/dist/web-ui-assets/assets/{chapel-DsZFg65P.js → chapel-BxtMW0PL.js} +1 -1
  55. package/dist/web-ui-assets/assets/{cobol-B2ulHFSx.js → cobol-CsbLyFzO.js} +1 -1
  56. package/dist/web-ui-assets/assets/{coffee-D0yCs5eE.js → coffee-B4J9bMqV.js} +1 -1
  57. package/dist/web-ui-assets/assets/{cpp-Bxbsp_nz.js → cpp-BMCtJA5e.js} +1 -1
  58. package/dist/web-ui-assets/assets/{crystal-BY2bY632.js → crystal-DTCIajFW.js} +1 -1
  59. package/dist/web-ui-assets/assets/{css-DCCzboh8.js → css-D8OcsCi9.js} +1 -1
  60. package/dist/web-ui-assets/assets/{dist-UwYaNxlm.js → dist-BCZrngb-.js} +2 -2
  61. package/dist/web-ui-assets/assets/{edge-9TiGLit-.js → edge-BL3Xh0aL.js} +1 -1
  62. package/dist/web-ui-assets/assets/{elixir-B83WkyBZ.js → elixir-DYMV70gA.js} +1 -1
  63. package/dist/web-ui-assets/assets/{elm-jejqKQFX.js → elm-ZEY_5Gld.js} +1 -1
  64. package/dist/web-ui-assets/assets/{erb-CJKGWEWI.js → erb-B4fTA01u.js} +1 -1
  65. package/dist/web-ui-assets/assets/{git-rebase-ob6EunlV.js → git-rebase-B4wbWtFe.js} +1 -1
  66. package/dist/web-ui-assets/assets/{glimmer-js-DRRkpqBC.js → glimmer-js-Bk8ocTiI.js} +1 -1
  67. package/dist/web-ui-assets/assets/{glimmer-ts-DdPZl6xW.js → glimmer-ts-D1Bs59KY.js} +1 -1
  68. package/dist/web-ui-assets/assets/{glsl-D1CrBs2Z.js → glsl-Cud0AnQ7.js} +1 -1
  69. package/dist/web-ui-assets/assets/{graphql-DOEPJbJj.js → graphql-rprXDq6g.js} +1 -1
  70. package/dist/web-ui-assets/assets/{hack-Bhnm8i0e.js → hack-SA7mTB5H.js} +1 -1
  71. package/dist/web-ui-assets/assets/{haml-Bmonj8m3.js → haml-BEUsHksc.js} +1 -1
  72. package/dist/web-ui-assets/assets/{handlebars-D7Ai8STP.js → handlebars-CQrcHvjw.js} +1 -1
  73. package/dist/web-ui-assets/assets/{html-CSHkoXuE.js → html-BNjcP3ae.js} +1 -1
  74. package/dist/web-ui-assets/assets/{html-derivative-N9AU_aiL.js → html-derivative-tXcnSwla.js} +1 -1
  75. package/dist/web-ui-assets/assets/{http-yFDJl3gv.js → http-CU3AcuDW.js} +1 -1
  76. package/dist/web-ui-assets/assets/{hurl-CIGeOBK2.js → hurl-BlEMQ0mz.js} +1 -1
  77. package/dist/web-ui-assets/assets/{index-zkBC82Wl.js → index-XjH5AFoQ.js} +2 -2
  78. package/dist/web-ui-assets/assets/{java-Ar_hCEd5.js → java-Dv44VZIQ.js} +1 -1
  79. package/dist/web-ui-assets/assets/{javascript-CAN1vxRM.js → javascript-BCHMR2T1.js} +1 -1
  80. package/dist/web-ui-assets/assets/{jinja-CUnd_v0D.js → jinja-CXaA1rSy.js} +1 -1
  81. package/dist/web-ui-assets/assets/{jison-DkTpZHxU.js → jison-CB25dCAh.js} +1 -1
  82. package/dist/web-ui-assets/assets/{json-4JHHm6tv.js → json-BIgZtm75.js} +1 -1
  83. package/dist/web-ui-assets/assets/{jsx-B_H-_0Li.js → jsx-o303RfKm.js} +1 -1
  84. package/dist/web-ui-assets/assets/{julia-dnSsLWEc.js → julia-C1TY8lKP.js} +1 -1
  85. package/dist/web-ui-assets/assets/{just-CEwIOa2N.js → just-Tw4mDbax.js} +1 -1
  86. package/dist/web-ui-assets/assets/{latex-B1ICfqDe.js → latex-C7tdKkSX.js} +1 -1
  87. package/dist/web-ui-assets/assets/{liquid-B1fj2wiT.js → liquid-BB7mJnwo.js} +1 -1
  88. package/dist/web-ui-assets/assets/{lua-CQf9tEbB.js → lua-BEoyE6dJ.js} +1 -1
  89. package/dist/web-ui-assets/assets/{marko-B14iEITE.js → marko-BEwpbV-M.js} +1 -1
  90. package/dist/web-ui-assets/assets/{mdc-_KQwbym8.js → mdc-BRxZnNvW.js} +1 -1
  91. package/dist/web-ui-assets/assets/{nginx-ClNzgFQl.js → nginx-DDfVoxOW.js} +1 -1
  92. package/dist/web-ui-assets/assets/{nim-Dw8QObp-.js → nim-DKNRKwRp.js} +1 -1
  93. package/dist/web-ui-assets/assets/{org-B51yx_Tx.js → org-DQ3K8kn0.js} +1 -1
  94. package/dist/web-ui-assets/assets/{perl-DLCCwaC1.js → perl-D7M6_0Sj.js} +1 -1
  95. package/dist/web-ui-assets/assets/{php-CL-uaO29.js → php-BHtfzS6_.js} +1 -1
  96. package/dist/web-ui-assets/assets/{pug-DkBENREJ.js → pug-C47_bBn3.js} +1 -1
  97. package/dist/web-ui-assets/assets/{qml-ClbJFFI5.js → qml-GWJnns_A.js} +1 -1
  98. package/dist/web-ui-assets/assets/{r-XUrK4grx.js → r-B5whi3IO.js} +1 -1
  99. package/dist/web-ui-assets/assets/{razor-DqSMwGmL.js → razor-y6G1LkzI.js} +1 -1
  100. package/dist/web-ui-assets/assets/{regexp-BSFJ_-TJ.js → regexp-uGurlfu3.js} +1 -1
  101. package/dist/web-ui-assets/assets/{rst-B7tMGYn-.js → rst-DOSRVvDO.js} +1 -1
  102. package/dist/web-ui-assets/assets/{ruby-BYrWHkBB.js → ruby-BMWD1lXn.js} +1 -1
  103. package/dist/web-ui-assets/assets/{sas-D-Mi-ZRr.js → sas-sJodyODK.js} +1 -1
  104. package/dist/web-ui-assets/assets/{scss-55HhYd4M.js → scss-FKoWviz4.js} +1 -1
  105. package/dist/web-ui-assets/assets/{shellscript-WUEN4iWi.js → shellscript-CX4uun1S.js} +1 -1
  106. package/dist/web-ui-assets/assets/{shellsession-Ciheliad.js → shellsession-BJeG5Uqg.js} +1 -1
  107. package/dist/web-ui-assets/assets/{soy-CafU_uPV.js → soy-dTEOPSGv.js} +1 -1
  108. package/dist/web-ui-assets/assets/{sql-DeKe_haY.js → sql-CjJutFxy.js} +1 -1
  109. package/dist/web-ui-assets/assets/{stata-BBkdAkCn.js → stata-qv7Vtzqg.js} +1 -1
  110. package/dist/web-ui-assets/assets/{surrealql-wu5RlJnG.js → surrealql-ZFi8Udj8.js} +1 -1
  111. package/dist/web-ui-assets/assets/{svelte-DxIeVq8R.js → svelte-CONS17iI.js} +1 -1
  112. package/dist/web-ui-assets/assets/{templ-Lj5RUv5J.js → templ-D6wwa1g9.js} +1 -1
  113. package/dist/web-ui-assets/assets/{tex-9jYK7mHi.js → tex-BORTsoU8.js} +1 -1
  114. package/dist/web-ui-assets/assets/{ts-tags-BuzwQUez.js → ts-tags-DSykcd4j.js} +1 -1
  115. package/dist/web-ui-assets/assets/{tsx-UsxPa86A.js → tsx-ypvKBKZA.js} +1 -1
  116. package/dist/web-ui-assets/assets/{twig-B51i7Ozb.js → twig-BNNw8R5U.js} +1 -1
  117. package/dist/web-ui-assets/assets/{typescript-DMHh-0ba.js → typescript-CEY3oKvf.js} +1 -1
  118. package/dist/web-ui-assets/assets/{typst-BOD5AJSC.js → typst-Br9tV5S3.js} +1 -1
  119. package/dist/web-ui-assets/assets/{vue-uYltmeEy.js → vue-ByQBamrH.js} +1 -1
  120. package/dist/web-ui-assets/assets/{vue-html-B9IwtKYs.js → vue-html-D_-H3Kc8.js} +1 -1
  121. package/dist/web-ui-assets/assets/{vue-vine-DLZ0OiIA.js → vue-vine-CCNA5xb1.js} +1 -1
  122. package/dist/web-ui-assets/assets/{xml-hKTv5UOt.js → xml-DXfCRANb.js} +1 -1
  123. package/dist/web-ui-assets/assets/{xsl-CQdCmkQ2.js → xsl-D8v7jI2q.js} +1 -1
  124. package/dist/web-ui-assets/assets/{yaml-CUNK3s1f.js → yaml-Dc0tn1VO.js} +1 -1
  125. package/dist/web-ui-assets/index.html +1 -1
  126. package/package.json +1 -1
@@ -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 } from './tool-def.js';
4
+ export { buildAgentToolDef, buildAgentTypeListing } from './tool-def.js';
@@ -1,3 +1,4 @@
1
1
  import type { AnthropicToolDef } from '../tools/types.js';
2
2
  import type { AgentRegistry } from './types.js';
3
3
  export declare function buildAgentToolDef(registry: AgentRegistry | undefined): AnthropicToolDef;
4
+ export declare function buildAgentTypeListing(registry: AgentRegistry | undefined): string;
@@ -28,6 +28,8 @@ export interface SubagentStartContext {
28
28
  event: 'SubagentStart';
29
29
  subagentId: string;
30
30
  parentSessionId?: string;
31
+ chainId?: string;
32
+ continuationIndex?: number;
31
33
  }
32
34
  export interface SubagentStopContext {
33
35
  event: 'SubagentStop';
@@ -12,6 +12,7 @@ export interface PromptAssemblyArgs {
12
12
  skillExecutor?: SkillExecutor;
13
13
  runtimeStateSource: RuntimeStateSource;
14
14
  userSystem: string | null;
15
+ agentTypeListing?: string;
15
16
  }
16
17
  export interface AssembledPrompt {
17
18
  stableSystemPrefix: StableSystemParts;
@@ -6,6 +6,7 @@ export interface StableSystemPromptInputs {
6
6
  hotMemory: string;
7
7
  goalPrompt?: string;
8
8
  manifest: string;
9
+ agentTypeListing?: string;
9
10
  userSystem: string | null;
10
11
  }
11
12
  export type StableSystemParts = StableSystemPromptInputs;
@@ -2,7 +2,7 @@ import type { ProviderEvent, ProviderUserTurn } from '../../../provider.js';
2
2
  import { type IterationContext, type FinishTurnContext } from './turn-iteration.js';
3
3
  import type { AbortCoordinator } from '../../shared/abort-coordinator.js';
4
4
  import type { ToolDispatcher } from '../../anthropic-direct/tool-dispatcher.js';
5
- import type { TraceSink } from '../../../trace/index.js';
5
+ import type { TraceSink } from '../../../trace/writer.js';
6
6
  import type { OpenAIMessage } from '../messages.js';
7
7
  import type { OpenAIJournalWiring } from './journal-wiring.js';
8
8
  import type { AgentConfig } from '../../../types/config-types.js';
@@ -28,4 +28,5 @@ export interface TurnDriverContext extends IterationContext, FinishTurnContext {
28
28
  }
29
29
  export declare function applyBeforeNextRound(priorTurns: OpenAIMessage[], steeringText: string | undefined, traceWriter: TraceSink | undefined, subagentId: string | undefined): void;
30
30
  export declare function applyAndSyncSteering(ctx: TurnDriverContext): void;
31
+ export declare function injectRoundCapNotice(priorTurns: OpenAIMessage[], round: number, maxIterations: number, traceWriter: TraceSink | undefined): void;
31
32
  export declare function runTurnInner(ctx: TurnDriverContext, content: ProviderUserTurn['content'], controller: AbortController, turnStartTime: number, taskId: string): AsyncGenerator<ProviderEvent>;
@@ -11,6 +11,7 @@ export interface SystemPromptWiringArgs {
11
11
  surface: string;
12
12
  getCurrentCwd: () => string;
13
13
  runtimeStateSource: RuntimeStateSource;
14
+ agentTypeListing?: string;
14
15
  }
15
16
  export interface SystemPromptWiringResult {
16
17
  initialSystemPrompt: string;
@@ -1,5 +1,6 @@
1
1
  import type { HookContext, HookDecision } from './hooks.js';
2
2
  export declare const SAFE_DESTRUCT_DETECT_REASON_PREFIX = "safe-destruct observe-only: destructive-command attempt";
3
3
  export declare const SAFE_DESTRUCT_BLOCK_INJECT_CONTEXT: string;
4
+ export declare const WORKTREE_SCOPED_BLOCK_IDS: ReadonlySet<string>;
4
5
  export declare function detectDestructiveCommands(command: string): string[];
5
- export declare function createSafeDestructDetect(): (context: HookContext) => HookDecision;
6
+ export declare function createSafeDestructDetect(sessionCwd?: string): (context: HookContext) => HookDecision;
@@ -1,4 +1,3 @@
1
- type SlotProvider = 'anthropic' | 'openai' | 'chatgpt-oauth' | 'xai' | 'xai-oauth';
1
+ import type { SlotProvider } from './model-slots.js';
2
2
  export declare function normalizeSlotProvider(value: unknown): SlotProvider | undefined;
3
3
  export declare function parseStringField(value: unknown): string;
4
- export {};
@@ -0,0 +1,28 @@
1
+ import type { ChainRecord, WorkspaceCheckpoint } from './continuation-registry.js';
2
+ export interface ContinuationOverrides {
3
+ agent_type?: string;
4
+ model?: string;
5
+ cwd?: string;
6
+ readRoots?: string[];
7
+ writeRoots?: string[];
8
+ isolation?: 'worktree';
9
+ host?: string;
10
+ }
11
+ export declare function checkContinuationOverrides(chain: ChainRecord, call: ContinuationOverrides): string | undefined;
12
+ export type GitOutcome = {
13
+ ok: true;
14
+ stdout: string;
15
+ } | {
16
+ ok: false;
17
+ timedOut: boolean;
18
+ };
19
+ export type CheckpointGitExec = (cwd: string, args: string[]) => Promise<GitOutcome>;
20
+ export declare const CHECKPOINT_GIT_GLOBAL_ARGS: readonly string[];
21
+ export declare const CHECKPOINT_GIT_TIMEOUT_MS = 10000;
22
+ export declare const CHECKPOINT_GIT_KILL_GRACE_MS = 1000;
23
+ export declare const CHECKPOINT_CAPTURE_DEADLINE_MS = 25000;
24
+ export declare function captureCheckpointWithin(cwd: string, capture?: (cwd: string) => Promise<WorkspaceCheckpoint>, ms?: number): Promise<WorkspaceCheckpoint>;
25
+ export declare function captureWorkspaceCheckpoint(cwd: string, exec?: CheckpointGitExec): Promise<WorkspaceCheckpoint>;
26
+ export declare const CHECKPOINT_UNAVAILABLE_REASON = "workspace checkpoint unavailable (git status failed or timed out), so drift cannot be ruled out; retry the continuation";
27
+ export declare const PRIOR_CHECKPOINT_UNAVAILABLE_REASON: string;
28
+ export declare function checkWorkspaceDrift(chain: ChainRecord, recapture?: (cwd: string) => Promise<WorkspaceCheckpoint>): Promise<string | undefined>;
@@ -0,0 +1,85 @@
1
+ export interface WorkspaceCheckpoint {
2
+ cwd: string;
3
+ git: boolean;
4
+ branch?: string;
5
+ head?: string;
6
+ dirtyFingerprint?: string;
7
+ unavailable?: true;
8
+ }
9
+ export interface ChainDispatchInputs {
10
+ agent_type?: string;
11
+ model?: string;
12
+ cwd?: string;
13
+ readRoots?: string[];
14
+ writeRoots?: string[];
15
+ isolation?: 'worktree';
16
+ writeCapable: boolean;
17
+ }
18
+ export interface ContinuationLimits {
19
+ maxRounds: number;
20
+ maxContinuations: number;
21
+ }
22
+ export interface ChainRecord {
23
+ chainId: string;
24
+ owner: string;
25
+ rootSessionId: string | undefined;
26
+ latestChildId: string | undefined;
27
+ inputs: ChainDispatchInputs;
28
+ roundsCharged: number;
29
+ continuations: number;
30
+ limits: ContinuationLimits;
31
+ inFlight: boolean;
32
+ initialUncharged: boolean;
33
+ checkpoint: WorkspaceCheckpoint | undefined;
34
+ lastEndReason: string | undefined;
35
+ settling: Promise<void> | undefined;
36
+ admitting: boolean;
37
+ }
38
+ export type AdmissionResult = {
39
+ ok: true;
40
+ chain: ChainRecord;
41
+ allowance: number;
42
+ index: number;
43
+ rollback: () => void;
44
+ } | {
45
+ ok: false;
46
+ reason: string;
47
+ };
48
+ export interface TerminalUpdate {
49
+ childId: string;
50
+ journalUsable: boolean;
51
+ roundsUsed: number;
52
+ checkpoint: WorkspaceCheckpoint | undefined;
53
+ endReason: string;
54
+ }
55
+ export declare const CONTINUATION_DEFAULTS: ContinuationLimits;
56
+ export declare function resolveContinuationLimits(): ContinuationLimits;
57
+ export declare const MAX_CHAINS = 256;
58
+ export declare class ContinuationRegistry {
59
+ private readonly limits;
60
+ private readonly maxChains;
61
+ private readonly chains;
62
+ readonly rootActor: string;
63
+ constructor(limits?: ContinuationLimits, maxChains?: number);
64
+ get size(): number;
65
+ private evictForInsert;
66
+ createChain(args: {
67
+ owner: string;
68
+ rootSessionId: string | undefined;
69
+ inputs: ChainDispatchInputs;
70
+ roundCap: number;
71
+ }): ChainRecord;
72
+ get(chainId: string): ChainRecord | undefined;
73
+ admitContinuation(chainId: string, caller: string, requested: number | undefined, defaultAllowance: number, reserved?: boolean): AdmissionResult;
74
+ reserveAdmission(chainId: string): {
75
+ ok: true;
76
+ release: () => void;
77
+ } | {
78
+ ok: false;
79
+ reason: string;
80
+ };
81
+ chargeInitialRounds(chainId: string, roundsUsed: number): void;
82
+ setSettling(chainId: string, settling: Promise<void>): void;
83
+ recordTerminal(chainId: string, update: TerminalUpdate): void;
84
+ }
85
+ export declare function formatContinuationLine(chain: ChainRecord): string;
@@ -10,6 +10,11 @@ export interface EmitForkStartedArgs {
10
10
  promptHead: string | undefined;
11
11
  effectiveAgentType: string | undefined;
12
12
  effectiveResolvedAgentType: string | undefined;
13
+ continuation?: {
14
+ chainId: string;
15
+ continuationOf: string;
16
+ continuationIndex: number;
17
+ } | undefined;
13
18
  }
14
19
  export declare function emitForkStarted(args: EmitForkStartedArgs): string;
15
20
  export interface AppendForkTelemetryArgs {
@@ -1,6 +1,6 @@
1
1
  import type { HookRegistry } from '../hooks.js';
2
2
  import type { TraceSink } from '../trace/index.js';
3
- import type { AgentModelInput } from '../types.js';
3
+ import type { AgentConfig, AgentModelInput } from '../types.js';
4
4
  import type { ForkSubagentOptions } from './fork-types.js';
5
5
  export interface ResolveForkInputsArgs {
6
6
  options: ForkSubagentOptions;
@@ -19,3 +19,4 @@ export interface ForkResolved {
19
19
  effectiveTimeoutMs: number;
20
20
  }
21
21
  export declare function resolveForkInputs(args: ResolveForkInputsArgs): ForkResolved;
22
+ export declare function applyContinuationSeed(config: AgentConfig, options: Pick<ForkSubagentOptions, 'continuation'>): AgentConfig;
@@ -7,7 +7,7 @@ import type { SubagentProgressSink, OutputEvent } from '../types/session-types.j
7
7
  import type { TraceSink } from '../trace/index.js';
8
8
  import type { Surface } from '../awareness/types.js';
9
9
  import type { PhaseRole } from '../tools/nesting.js';
10
- import type { MessageJournal } from '../journal/index.js';
10
+ import type { MessageJournal, JournalMessage } from '../journal/index.js';
11
11
  export interface ForkParent {
12
12
  sessionId?: string;
13
13
  id?: string;
@@ -27,6 +27,12 @@ export interface ForkSubagentOptions<T = unknown> {
27
27
  parentId?: string;
28
28
  promptHead?: string;
29
29
  denyElicitations?: boolean;
30
+ continuation?: {
31
+ messages: JournalMessage[];
32
+ chainId: string;
33
+ continuationOf: string;
34
+ continuationIndex: number;
35
+ };
30
36
  progressEvents?: boolean;
31
37
  phaseRole?: PhaseRole;
32
38
  nestedAgentAllowlist?: readonly string[];
@@ -56,6 +56,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
56
56
  _parentId: string | undefined;
57
57
  _currentTrace: SubagentTrace;
58
58
  _lastStreamedContent: string;
59
+ _runtimeRoundsUsed: number;
59
60
  _pauseCeiling: PauseAwareCeiling | undefined;
60
61
  _lastStopReason: string | undefined;
61
62
  _billingContext: RunBillingContext;
@@ -10,3 +10,4 @@ export declare function runInBackground<T>(handle: SubagentHandleImpl<T>, prompt
10
10
  export declare function dispatchStopAndRelease<T>(handle: SubagentHandleImpl<T>, reportedStatus: SubagentStatus, options?: {
11
11
  deferInjectContextToCaller?: boolean;
12
12
  }): Promise<void>;
13
+ export declare function countRuntimeRounds<T>(handle: Pick<SubagentHandleImpl<T>, '_runtimeRoundsUsed'>, event: OutputEvent, last: number): number;
@@ -1,9 +1,11 @@
1
1
  import type { AgentConfig } from '../types/config-types.js';
2
+ export declare const WORKTREE_STASH_RULE: string;
2
3
  export interface SubagentIdentityFacts {
3
4
  isNonInteractive: boolean | undefined;
4
5
  depth: number | undefined;
5
6
  maxDepth: number | undefined;
6
7
  nestedAgentAllowlist?: readonly string[];
8
+ cwd?: string;
7
9
  }
8
10
  export declare function renderSubagentIdentityPreamble(facts: SubagentIdentityFacts): string;
9
11
  export declare function injectSubagentIdentityPreamble(config: AgentConfig, nestedAgentAllowlist?: readonly string[]): AgentConfig;
@@ -49,6 +49,14 @@ export interface SubagentResult<T = unknown> extends Partial<CappedHandoff> {
49
49
  trace?: SubagentTrace;
50
50
  signal?: Signal;
51
51
  stopReason?: string;
52
+ continuation?: {
53
+ chainId: string;
54
+ roundsCharged: number;
55
+ maxRounds: number;
56
+ continuations: number;
57
+ maxContinuations: number;
58
+ continuable: boolean;
59
+ };
52
60
  setupNotice?: string;
53
61
  }
54
62
  export declare function buildResultFromMessage<T>(id: string, status: SubagentStatus, message: Message, outputSchema: ZodType<T> | undefined, trace?: SubagentTrace, stopReason?: string): SubagentResult<T>;
@@ -7,3 +7,4 @@ export declare function parseMessages(buf: Buffer): {
7
7
  };
8
8
  export declare function languageIdForExt(ext: string): string | undefined;
9
9
  export declare function getTimeoutMs(): number;
10
+ export declare function getSymbolsTimeoutMs(): number;
@@ -9,12 +9,13 @@ export interface LspSymbolResult {
9
9
  error?: string;
10
10
  }
11
11
  export type SymbolSubcommand = 'definition' | 'references';
12
+ export declare function parseLocation(raw: unknown): LspLocation | null;
12
13
  export declare function isLspSymbolsEnabled(): boolean;
13
- export declare function queryLspSymbol(filePath: string, subcommand: SymbolSubcommand, line: number, col: number, rootDir?: string, serverCmd?: readonly string[]): Promise<LspSymbolResult>;
14
+ export declare function queryLspSymbol(filePath: string, subcommand: SymbolSubcommand, line: number, col: number, rootDir?: string, serverCmd?: readonly string[], signal?: AbortSignal): Promise<LspSymbolResult>;
14
15
  export declare function formatSymbolResult(filePath: string, subcommand: SymbolSubcommand, line: number, col: number, result: LspSymbolResult): string;
15
16
  export declare function handleCodeSymbols(input: {
16
17
  file_path: string;
17
18
  subcommand: SymbolSubcommand;
18
19
  line: number;
19
20
  col: number;
20
- }, context?: ToolHandlerContext, cwd?: string, serverCmd?: readonly string[]): Promise<string>;
21
+ }, context?: ToolHandlerContext, cwd?: string, serverCmd?: readonly string[], signal?: AbortSignal): Promise<string>;
@@ -1,3 +1,3 @@
1
1
  import type { AnthropicToolDef } from './types.js';
2
- export declare const INVARIANT_CORE_COUNT = 26;
2
+ export declare const INVARIANT_CORE_COUNT = 23;
3
3
  export declare function sortMcpSchemas(schemas: AnthropicToolDef[]): AnthropicToolDef[];
@@ -42,6 +42,7 @@ export interface BuildChildConfigArgs {
42
42
  onSubagentSucceeded?: import('../../subagent/fork-types.js').SubagentManagerOptions['onSubagentSucceeded'];
43
43
  workspaceStore?: import('../../workspace/index.js').WorkspaceStore;
44
44
  delegationBudget?: import('../../tools/delegation-budget.js').DelegationBudget;
45
+ continuationRegistry?: import('../../subagent/continuation-registry.js').ContinuationRegistry;
45
46
  hookRegistry?: import('../../hooks.js').HookRegistry;
46
47
  parentRootSessionId?: string;
47
48
  parentBillingStreams?: Set<Promise<void>>;
@@ -0,0 +1,88 @@
1
+ import type { ToolResult } from '../types.js';
2
+ import { type AgentInput } from './input-parse.js';
3
+ import { type ChainRecord, type ContinuationRegistry, type WorkspaceCheckpoint } from '../../subagent/continuation-registry.js';
4
+ import type { ContinuationPlan } from './continuation-run.js';
5
+ import type { TraceSink } from '../../trace/writer.js';
6
+ export interface ContinuationResultFields {
7
+ continuation?: {
8
+ chainId: string;
9
+ roundsCharged: number;
10
+ maxRounds: number;
11
+ continuations: number;
12
+ maxContinuations: number;
13
+ continuable: boolean;
14
+ };
15
+ }
16
+ export declare function parseDispatchInput(input: unknown): {
17
+ parsed: AgentInput;
18
+ } | {
19
+ error: ToolResult;
20
+ };
21
+ export interface ActorCtx {
22
+ depth: number;
23
+ continuationRegistry?: ContinuationRegistry;
24
+ parentSession: {
25
+ sessionId?: string | undefined;
26
+ };
27
+ }
28
+ export declare function actorIdentity(ctx: ActorCtx): string | undefined;
29
+ export interface MintChainArgs {
30
+ registry: ContinuationRegistry | undefined;
31
+ owner: string | undefined;
32
+ rootSessionId: string | undefined;
33
+ parsed: AgentInput;
34
+ model: string | undefined;
35
+ cwd: string | undefined;
36
+ writeCapable: boolean;
37
+ roundCap: number | undefined;
38
+ }
39
+ export declare function mintDispatchChain(args: MintChainArgs): ChainRecord | undefined;
40
+ export interface ChainTerminalArgs {
41
+ registry: ContinuationRegistry | undefined;
42
+ chain: ChainRecord | undefined;
43
+ childId: string;
44
+ cwd: string | undefined;
45
+ roundsUsed: number | undefined;
46
+ journalUsable: boolean;
47
+ endReason: string;
48
+ capture?: (cwd: string) => Promise<WorkspaceCheckpoint>;
49
+ traceWriter?: TraceSink | undefined;
50
+ }
51
+ export declare function recordChainTerminal(args: ChainTerminalArgs): Promise<WorkspaceCheckpoint | undefined>;
52
+ export declare function markChainPromoted(handle: object): void;
53
+ export declare function annotateChainResult<R extends ToolResult>(result: R, chain: ChainRecord | undefined, always?: boolean, handle?: object): R & ContinuationResultFields;
54
+ export declare function endReasonOf(result: ToolResult): string;
55
+ type ChainHandle = {
56
+ readonly id: string;
57
+ runToResult(prompt: never, ...rest: never[]): Promise<import('../../subagent/result.js').SubagentResult>;
58
+ runInBackground(prompt: never, onResult?: (r: import('../../subagent/result.js').SubagentResult) => void, ...rest: never[]): unknown;
59
+ };
60
+ export declare function instrumentHandleForChain(handle: ChainHandle, terminal: Omit<ChainTerminalArgs, 'childId' | 'roundsUsed' | 'endReason' | 'journalUsable'> & {
61
+ journalUsable: () => boolean;
62
+ flushJournal?: () => Promise<void>;
63
+ rollbackIfNotStarted?: () => void;
64
+ alwaysLine?: boolean;
65
+ }): void;
66
+ export type SettleDegradedReason = 'flush_timeout' | 'checkpoint_unavailable' | 'error';
67
+ export declare const JOURNAL_FLUSH_TIMEOUT_MS = 5000;
68
+ export declare function wireDispatchChain(args: {
69
+ ctx: ActorCtx & {
70
+ parentRootSessionId?: string;
71
+ traceWriter?: TraceSink | undefined;
72
+ };
73
+ parsed: AgentInput;
74
+ handle: ChainHandle & {
75
+ session?: {
76
+ messageJournal?: unknown;
77
+ };
78
+ };
79
+ childConfig: {
80
+ model?: string;
81
+ cwd?: string;
82
+ maxToolUseIterations?: number;
83
+ };
84
+ currentCwd: string | undefined;
85
+ writeCapable: boolean;
86
+ plan?: ContinuationPlan | undefined;
87
+ }): ChainRecord | undefined;
88
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { ToolCall, ToolResult } from '../types.js';
2
+ import type { AgentInput } from './input-parse.js';
3
+ import type { ForkSubagentOptions } from '../../subagent/fork-types.js';
4
+ import type { ChainRecord, ContinuationRegistry, WorkspaceCheckpoint } from '../../subagent/continuation-registry.js';
5
+ export interface ContinuationPlan {
6
+ chain: ChainRecord;
7
+ allowance: number;
8
+ rollback: () => void;
9
+ wired: boolean;
10
+ fork: NonNullable<ForkSubagentOptions['continuation']>;
11
+ }
12
+ interface AdmitCtx {
13
+ depth: number;
14
+ continuationRegistry?: ContinuationRegistry;
15
+ parentSession: {
16
+ sessionId?: string | undefined;
17
+ };
18
+ parentRootSessionId?: string;
19
+ recaptureCheckpoint?: (cwd: string) => Promise<WorkspaceCheckpoint>;
20
+ }
21
+ export declare function refuseContinuation(reason: string): {
22
+ error: ToolResult;
23
+ };
24
+ export declare function continuationNote(chain: ChainRecord, index: number, allowance: number): string;
25
+ export declare const SETTLING_WAIT_MS = 15000;
26
+ export declare function admitContinuationCall(parsed: AgentInput, ctx: AdmitCtx): Promise<{
27
+ plan: ContinuationPlan;
28
+ input: Record<string, unknown>;
29
+ } | {
30
+ error: ToolResult;
31
+ }>;
32
+ export declare function runContinuation(call: ToolCall, parsed: AgentInput, ctx: AdmitCtx, dispatch: (call: ToolCall, plan: ContinuationPlan) => Promise<ToolResult>): Promise<ToolResult>;
33
+ export {};
@@ -48,5 +48,6 @@ export interface RunForegroundArgs {
48
48
  promotionTookBudget?: {
49
49
  value: boolean;
50
50
  };
51
+ onPromoted?: () => void;
51
52
  }
52
53
  export declare function runForegroundWithPromotion(args: RunForegroundArgs): Promise<ToolResult>;
@@ -16,5 +16,6 @@ export interface AgentInput {
16
16
  isolation?: 'worktree';
17
17
  progress_events?: boolean;
18
18
  host?: string;
19
+ continuation_chain_id?: string;
19
20
  }
20
21
  export declare function parseAgentInput(input: unknown): AgentInput;
@@ -36,6 +36,7 @@ export interface SubagentExecutorContext {
36
36
  traceWriter?: TraceSink;
37
37
  workspaceStore?: import('../../workspace/index.js').WorkspaceStore;
38
38
  delegationBudget?: DelegationBudget;
39
+ continuationRegistry?: import('../../subagent/continuation-registry.js').ContinuationRegistry;
39
40
  hookRegistry?: HookRegistry;
40
41
  allowedTools?: string[];
41
42
  readOnlyBash?: boolean;
@@ -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
+ describeAgentTypeListing(): string;
19
20
  private readonly promotionTriggers;
20
21
  private readonly activeForegroundHandles;
21
22
  private readonly waveTracker;
@@ -4,6 +4,7 @@ import { type PromotionTrigger } from './subagent/foreground-promotion.js';
4
4
  import type { StreamCutProbe } from '../subagent/stream-cut-retry.js';
5
5
  import { WaveManifestTracker } from './subagent-executor.wave-manifest.js';
6
6
  import type { SubagentExecutorContext } from './subagent-executor/types.js';
7
+ import { type ContinuationPlan } from './subagent/continuation-run.js';
7
8
  export interface ExecuteOnceArgs {
8
9
  ctx: SubagentExecutorContext;
9
10
  currentCwd: string | undefined;
@@ -19,4 +20,4 @@ export interface ExecuteOnceArgs {
19
20
  inheritedChildConfigArgs: () => Partial<BuildChildConfigArgs>;
20
21
  updateCurrentWaveUnit: (callId: string, status: 'running' | 'done' | 'failed', error?: string, cwd?: string) => void;
21
22
  }
22
- export declare function executeOnce(call: ToolCall, args: ExecuteOnceArgs, probe?: StreamCutProbe, retryCancelGeneration?: number): Promise<ToolResult>;
23
+ export declare function executeOnce(call: ToolCall, args: ExecuteOnceArgs, probe?: StreamCutProbe, retryCancelGeneration?: number, plan?: ContinuationPlan): Promise<ToolResult>;
@@ -0,0 +1,8 @@
1
+ import type { RegisteredAgent } from '../agents/index.js';
2
+ import type { ToolResult } from './types.js';
3
+ import type { SubagentExecutorContext } from './subagent-executor/types.js';
4
+ export declare function resolveNamedAgent(ctx: Pick<SubagentExecutorContext, 'agentRegistry'>, agentType: string | undefined): {
5
+ namedAgent: RegisteredAgent | undefined;
6
+ } | {
7
+ error: ToolResult;
8
+ };
@@ -64,6 +64,7 @@ export interface ForkAndCheckCancelArgs {
64
64
  updateCurrentWaveUnit: (callId: string, status: 'running' | 'done' | 'failed', error?: string, cwd?: string) => void;
65
65
  callId: string;
66
66
  modelFallback?: ForkSubagentOptions['modelFallback'];
67
+ continuation?: ForkSubagentOptions['continuation'];
67
68
  }
68
69
  export type ForkResult = {
69
70
  handle: Awaited<ReturnType<SubagentManager['forkSubagent']>>;
@@ -2,6 +2,9 @@ import type { AgentInput } from './subagent/input-parse.js';
2
2
  import type { ToolResult } from './types.js';
3
3
  import { readUnlockPassword } from '../../remote/keychain-unlock.js';
4
4
  import { defaultSshRunner } from '../../remote/ssh-runner.js';
5
+ import { type RemoteRunOutcome } from '../../remote/remote-run.js';
6
+ import type { RemoteHost } from '../../remote/hosts.js';
7
+ export declare function formatRemoteOutcome(outcome: RemoteRunOutcome, host: RemoteHost, runId: string, sessionId: string): ToolResult;
5
8
  export interface RemoteAgentDispatchDeps {
6
9
  runner?: typeof defaultSshRunner;
7
10
  loadHostsFn?: () => Promise<Record<string, import('../../remote/hosts.js').RemoteHost>>;
@@ -435,6 +435,9 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
435
435
  agentType: z.ZodOptional<z.ZodString>;
436
436
  resolvedAgentType: z.ZodOptional<z.ZodString>;
437
437
  maxToolUseIterations: z.ZodOptional<z.ZodNumber>;
438
+ chainId: z.ZodOptional<z.ZodString>;
439
+ continuationOf: z.ZodOptional<z.ZodString>;
440
+ continuationIndex: z.ZodOptional<z.ZodNumber>;
438
441
  }, z.core.$strip>, z.ZodObject<{
439
442
  provider: z.ZodOptional<z.ZodString>;
440
443
  tokens: z.ZodOptional<z.ZodObject<{
@@ -752,6 +755,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
752
755
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
753
756
  billing_settled: "billing_settled";
754
757
  subagent_model_fallback: "subagent_model_fallback";
758
+ round_cap_notice_dropped: "round_cap_notice_dropped";
759
+ continuation_settle_degraded: "continuation_settle_degraded";
755
760
  }>;
756
761
  durationMs: z.ZodOptional<z.ZodNumber>;
757
762
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -890,6 +895,9 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
890
895
  agentType: z.ZodOptional<z.ZodString>;
891
896
  resolvedAgentType: z.ZodOptional<z.ZodString>;
892
897
  maxToolUseIterations: z.ZodOptional<z.ZodNumber>;
898
+ chainId: z.ZodOptional<z.ZodString>;
899
+ continuationOf: z.ZodOptional<z.ZodString>;
900
+ continuationIndex: z.ZodOptional<z.ZodNumber>;
893
901
  }, z.core.$strip>, z.ZodObject<{
894
902
  provider: z.ZodOptional<z.ZodString>;
895
903
  tokens: z.ZodOptional<z.ZodObject<{
@@ -1231,6 +1239,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1231
1239
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
1232
1240
  billing_settled: "billing_settled";
1233
1241
  subagent_model_fallback: "subagent_model_fallback";
1242
+ round_cap_notice_dropped: "round_cap_notice_dropped";
1243
+ continuation_settle_degraded: "continuation_settle_degraded";
1234
1244
  }>;
1235
1245
  durationMs: z.ZodOptional<z.ZodNumber>;
1236
1246
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -51,6 +51,8 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
51
51
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
52
52
  billing_settled: "billing_settled";
53
53
  subagent_model_fallback: "subagent_model_fallback";
54
+ round_cap_notice_dropped: "round_cap_notice_dropped";
55
+ continuation_settle_degraded: "continuation_settle_degraded";
54
56
  }>;
55
57
  export declare const SessionPhasePayloadSchema: z.ZodObject<{
56
58
  phase: z.ZodEnum<{
@@ -105,6 +107,8 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
105
107
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
106
108
  billing_settled: "billing_settled";
107
109
  subagent_model_fallback: "subagent_model_fallback";
110
+ round_cap_notice_dropped: "round_cap_notice_dropped";
111
+ continuation_settle_degraded: "continuation_settle_degraded";
108
112
  }>;
109
113
  durationMs: z.ZodOptional<z.ZodNumber>;
110
114
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -24,6 +24,9 @@ export declare const SubagentStartedPayloadSchema: z.ZodObject<{
24
24
  agentType: z.ZodOptional<z.ZodString>;
25
25
  resolvedAgentType: z.ZodOptional<z.ZodString>;
26
26
  maxToolUseIterations: z.ZodOptional<z.ZodNumber>;
27
+ chainId: z.ZodOptional<z.ZodString>;
28
+ continuationOf: z.ZodOptional<z.ZodString>;
29
+ continuationIndex: z.ZodOptional<z.ZodNumber>;
27
30
  }, z.core.$strip>;
28
31
  export declare const SubagentSucceededPayloadSchema: z.ZodObject<{
29
32
  provider: z.ZodOptional<z.ZodString>;
@@ -96,6 +99,9 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
96
99
  agentType: z.ZodOptional<z.ZodString>;
97
100
  resolvedAgentType: z.ZodOptional<z.ZodString>;
98
101
  maxToolUseIterations: z.ZodOptional<z.ZodNumber>;
102
+ chainId: z.ZodOptional<z.ZodString>;
103
+ continuationOf: z.ZodOptional<z.ZodString>;
104
+ continuationIndex: z.ZodOptional<z.ZodNumber>;
99
105
  }, z.core.$strip>, z.ZodObject<{
100
106
  provider: z.ZodOptional<z.ZodString>;
101
107
  tokens: z.ZodOptional<z.ZodObject<{
@@ -60,6 +60,9 @@ export interface SubagentStartedPayload {
60
60
  agentType?: string;
61
61
  resolvedAgentType?: string;
62
62
  maxToolUseIterations?: number;
63
+ chainId?: string;
64
+ continuationOf?: string;
65
+ continuationIndex?: number;
63
66
  }
64
67
  export interface SubagentSucceededPayload extends SubagentBillingFields {
65
68
  incomplete?: true;
@@ -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' | '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' | 'billing_settled' | 'subagent_model_fallback';
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' | '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' | 'billing_settled' | 'subagent_model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded';
2
2
  export interface SessionPhasePayload {
3
3
  phase: SessionPhaseName;
4
4
  durationMs?: number;