@ddwang/magnitude-core 0.3.1-ddwang.13 → 0.3.1-ddwang.15

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.
package/dist/index.d.cts CHANGED
@@ -232,6 +232,12 @@ interface ProviderAttemptDiagnostics {
232
232
  plannerCallId?: string;
233
233
  /** HTTP outcome, not successful parsing or completion of the agent's task. */
234
234
  outcome: 'succeeded' | 'failed' | 'unknown';
235
+ /** Reported input tokens, including cached input, or null when the response has no usage. */
236
+ promptTokens: number | null;
237
+ /** Reported input tokens read from the provider's cache, or null when the response has no usage. */
238
+ cachedPromptTokens: number | null;
239
+ /** Reported output tokens, including reasoning, or null when the response has no usage. */
240
+ outputTokens: number | null;
235
241
  }
236
242
  interface PlannerCallDiagnostics {
237
243
  id: string;
@@ -526,6 +532,8 @@ interface AgentConnector {
526
532
  onStop?(): Promise<void>;
527
533
  beforeAction?(action: Action, options?: OperationOptions): Promise<void>;
528
534
  onTaskStart?(options?: OperationOptions): void;
535
+ /** Called before each planner request, after the observations it will see are recorded. */
536
+ beforePlan?(options?: OperationOptions): Promise<void>;
529
537
  getActionSpace?(): ActionDefinition<any>[];
530
538
  collectObservations?(options?: OperationOptions): Promise<Observation[]>;
531
539
  getInstructions?(options?: OperationOptions): Promise<void | string>;
@@ -852,7 +860,7 @@ interface BrowserConnectorOptions {
852
860
  minScreenshots?: number;
853
861
  visuals?: ActionVisualizerOptions;
854
862
  recovery?: RecoveryOptions | false;
855
- /** Opt in to current-viewport link/button observations and browser:click references. */
863
+ /** Opt in to current-viewport link, button, and native field observations with browser:click, browser:select, and browser:fill references. */
856
864
  groundedControls?: boolean;
857
865
  }
858
866
  interface BrowserConnectorStateData {
@@ -879,6 +887,7 @@ declare class BrowserConnector implements AgentConnector {
879
887
  getActionSpace(): ActionDefinition<any>[];
880
888
  private onResponse;
881
889
  beforeAction(action: Action): Promise<void>;
890
+ beforePlan(): Promise<void>;
882
891
  onTaskStart(): void;
883
892
  wait(requestedMs: number): Promise<void>;
884
893
  getHarness(): WebHarness;