@@ -40,28 +40,38 @@ export interface LDAgentGraphFlagValue {
4040}
4141
4242/**
43- * Accumulated graph-level metrics collected by an LDGraphTracker.
43+ * Summarized graph-level metrics for a completed graph invocation, as
44+ * returned by {@link ManagedAgentGraph.run} via {@link ManagedGraphResult.metrics}.
45+ *
46+ * For the tracker-layer incremental view (where fields populate as tracking
47+ * calls arrive), see {@link LDGraphTracker.getSummary}, which returns a
48+ * `Partial<LDAIGraphMetricSummary>`.
4449 */
4550export interface LDAIGraphMetricSummary {
4651 /**
47- * Whether the graph invocation succeeded. Absent if not yet tracked.
52+ * Whether the graph invocation succeeded.
4853 */
49- success ? : boolean ;
54+ success : boolean ;
5055
5156 /**
52- * Total graph execution duration in milliseconds. Absent if not yet tracked .
57+ * Execution path through the graph as an ordered array of config keys .
5358 */
54- durationMs ?: number ;
59+ path : string [ ] ;
60+
61+ /**
62+ * Per-node metric summaries keyed by agent config key.
63+ */
64+ nodeMetrics : Record < string , LDAIMetricSummary > ;
5565
5666 /**
57- * Aggregate token usage across the entire graph invocation. Absent if not yet tracked.
67+ * Total graph execution duration in milliseconds, if tracked.
5868 */
59- tokens ?: LDTokenUsage ;
69+ durationMs ?: number ;
6070
6171 /**
62- * Execution path through the graph as an array of config keys. Absent if not yet tracked .
72+ * Aggregate token usage across the entire graph invocation, if available .
6373 */
64- path ?: string [ ] ;
74+ tokens ?: LDTokenUsage ;
6575
6676 /**
6777 * Resumption token for deferred feedback association.
@@ -125,42 +135,6 @@ export interface AgentGraphRunnerResult {
125135// Managed-Layer Graph Types
126136// ============================================================================
127137
128- /**
129- * Graph metric summary returned in ManagedGraphResult.
130- * Includes per-node metrics and a resumption token.
131- */
132- export interface GraphMetricSummary {
133- /**
134- * Whether the graph invocation succeeded.
135- */
136- success : boolean ;
137-
138- /**
139- * Execution path through the graph as an ordered array of config keys.
140- */
141- path : string [ ] ;
142-
143- /**
144- * Total graph execution duration in milliseconds, if tracked.
145- */
146- durationMs ?: number ;
147-
148- /**
149- * Aggregate token usage across the entire graph invocation, if available.
150- */
151- tokens ?: LDTokenUsage ;
152-
153- /**
154- * Per-node metric summaries keyed by agent config key.
155- */
156- nodeMetrics : Record < string , LDAIMetricSummary > ;
157-
158- /**
159- * Resumption token for deferred feedback association.
160- */
161- resumptionToken ?: string ;
162- }
163-
164138/**
165139 * The result returned by a managed graph invocation (ManagedAgentGraph.run()).
166140 */
@@ -173,7 +147,7 @@ export interface ManagedGraphResult {
173147 /**
174148 * Summarized metrics for this graph invocation.
175149 */
176- metrics : GraphMetricSummary ;
150+ metrics : LDAIGraphMetricSummary ;
177151
178152 /**
179153 * The raw response object from the provider, if available.
0 commit comments