Skip to content

Commit cbf6f00

Browse files
committed
refactor(agents): narrow runner harness helper types
1 parent bda7581 commit cbf6f00

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎src/agents/embedded-agent-runner/run/failover-observation.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { FailoverReason } from "../../embedded-agent-helpers.js";
1212
import { log } from "../logger.js";
1313

1414
/** Structured fields emitted whenever embedded run failover chooses an action. */
15-
export type FailoverDecisionLoggerInput = {
15+
type FailoverDecisionLoggerInput = {
1616
stage: "prompt" | "assistant";
1717
decision: "rotate_profile" | "fallback_model" | "surface_error";
1818
runId?: string;
@@ -31,7 +31,7 @@ export type FailoverDecisionLoggerInput = {
3131
};
3232

3333
/** Stable context captured before a concrete failover decision is known. */
34-
export type FailoverDecisionLoggerBase = Omit<FailoverDecisionLoggerInput, "decision" | "status">;
34+
type FailoverDecisionLoggerBase = Omit<FailoverDecisionLoggerInput, "decision" | "status">;
3535

3636
/**
3737
* Derives timeout failure reasons for logs that were built from timeout state

‎src/agents/embedded-agent-runner/types.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ export type TraceAttempt = {
8484
status?: number;
8585
};
8686

87-
export type ExecutionTrace = {
87+
type ExecutionTrace = {
8888
winnerProvider?: string;
8989
winnerModel?: string;
9090
attempts?: TraceAttempt[];
9191
fallbackUsed?: boolean;
9292
runner?: "embedded" | "cli";
9393
};
9494

95-
export type RequestShapingTrace = {
95+
type RequestShapingTrace = {
9696
authMode?: string;
9797
thinking?: string;
9898
reasoning?: string;
@@ -102,7 +102,7 @@ export type RequestShapingTrace = {
102102
blockStreaming?: string;
103103
};
104104

105-
export type PromptSegmentTrace = {
105+
type PromptSegmentTrace = {
106106
key: string;
107107
chars: number;
108108
};
@@ -114,13 +114,13 @@ export type ToolSummaryTrace = {
114114
totalToolTimeMs?: number;
115115
};
116116

117-
export type CompletionTrace = {
117+
type CompletionTrace = {
118118
finishReason?: string;
119119
stopReason?: string;
120120
refusal?: boolean;
121121
};
122122

123-
export type ContextManagementTrace = {
123+
type ContextManagementTrace = {
124124
sessionCompactions?: number;
125125
lastTurnCompactions?: number;
126126
preflightCompactionApplied?: boolean;

‎src/agents/harness/lifecycle-hook-helpers.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export async function awaitAgentHarnessAgentEndHook(params: {
145145
}
146146

147147
/** Normalized before-finalize hook decision consumed by harness loops. */
148-
export type AgentHarnessBeforeAgentFinalizeOutcome =
148+
type AgentHarnessBeforeAgentFinalizeOutcome =
149149
| { action: "continue" }
150150
| { action: "revise"; reason: string }
151151
| { action: "finalize"; reason?: string };

‎src/agents/harness/prompt-compaction-hook-helpers.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { buildAgentHookContext, type AgentHarnessHookContext } from "./hook-cont
1818
const log = createSubsystemLogger("agents/harness");
1919

2020
/** Prompt/developer-instruction pair after harness prompt-build hooks run. */
21-
export type AgentHarnessPromptBuildResult = {
21+
type AgentHarnessPromptBuildResult = {
2222
prompt: string;
2323
developerInstructions: string;
2424
};

‎src/agents/harness/types.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export type AgentHarnessDeliveryDefaults = {
8383
sourceVisibleReplies?: "automatic" | "message_tool";
8484
};
8585

86-
export type AgentHarnessRunCapability = {
86+
type AgentHarnessRunCapability = {
8787
id: string;
8888
label: string;
8989
pluginId?: string;
@@ -98,22 +98,22 @@ export type AgentHarnessRunCapability = {
9898
runAttempt(params: AgentHarnessAttemptParams): Promise<AgentHarnessAttemptResult>;
9999
};
100100

101-
export type AgentHarnessSideQuestionCapability = {
101+
type AgentHarnessSideQuestionCapability = {
102102
runSideQuestion?(params: AgentHarnessSideQuestionParams): Promise<AgentHarnessSideQuestionResult>;
103103
};
104104

105-
export type AgentHarnessClassificationCapability = {
105+
type AgentHarnessClassificationCapability = {
106106
classify?(
107107
result: AgentHarnessAttemptResult,
108108
ctx: AgentHarnessAttemptParams,
109109
): AgentHarnessResultClassification | undefined;
110110
};
111111

112-
export type AgentHarnessCompactionCapability = {
112+
type AgentHarnessCompactionCapability = {
113113
compact?(params: AgentHarnessCompactParams): Promise<AgentHarnessCompactResult | undefined>;
114114
};
115115

116-
export type AgentHarnessSessionLifecycleCapability = {
116+
type AgentHarnessSessionLifecycleCapability = {
117117
reset?(params: AgentHarnessResetParams): Promise<void> | void;
118118
dispose?(): Promise<void> | void;
119119
};

0 commit comments

Comments
 (0)