@anvailabs/sandhi 0.6.0 → 0.7.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.
package/contracts.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  // Generated by scripts/gen-binding-contract-facades.py; DO NOT EDIT.
2
- // schema-sha256: 812a2d001ca2d5566be1458cdb98242aab3a828a3f4b14c7b02d12efb4d39cfa
2
+ // schema-sha256: b6ef1e7aeedcf9356c5babbd40e95f457edda7b26719a91af16906b880481e14
3
3
  export type JsonValue = unknown
4
4
  export type Role = "developer" | "system" | "user" | "assistant" | "tool" | "function"
5
5
  export type FinishReasonV1 = "stop" | "length" | "tool_calls" | "content_filter" | "function_call" | "unknown"
6
6
  export type UsageCompleteness = "final" | "partial" | "unavailable"
7
7
  export type UsageBasis = "provider_reported" | "estimated"
8
+ export type LatencySource = "origin" | "boundary"
8
9
  export type ContentPart =
9
10
  | { type: "text"; text: string }
10
11
  | { type: "image_url"; image_url: string; detail?: string }
@@ -32,7 +33,8 @@ export interface UsageV2 {
32
33
  tokens_in: number; tokens_out: number; cache_creation_tokens: number; cache_read_tokens: number
33
34
  completeness?: UsageCompleteness; basis?: UsageBasis; attempts?: number; outcome?: string
34
35
  upstream_request_id?: string
35
- duration_ms?: number; time_to_first_token_ms?: number
36
+ duration_ms?: number; duration_source?: LatencySource
37
+ time_to_first_token_ms?: number; time_to_first_token_source?: LatencySource
36
38
  audio_input_tokens?: number; audio_output_tokens?: number; reasoning_tokens?: number
37
39
  reasoning_included?: boolean
38
40
  accepted_prediction_tokens?: number; rejected_prediction_tokens?: number
package/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export interface UsageBreakdown {
11
11
  cacheReadTokens: number
12
12
  reasoningTokens: number
13
13
  reasoningIncluded?: boolean
14
+ durationMs?: number
15
+ timeToFirstTokenMs?: number
14
16
  }
15
17
  /** A neutral usage event (mirrors `usage-event.v1.schema.json`). */
16
18
  export interface Event {
@@ -36,6 +38,10 @@ export interface Event {
36
38
  outcome?: string
37
39
  upstreamRequestId?: string
38
40
  gpuSeconds?: number
41
+ durationMs?: number
42
+ durationSource?: string
43
+ timeToFirstTokenMs?: number
44
+ timeToFirstTokenSource?: string
39
45
  }
40
46
  /** The usage-event wire-contract major version this build targets. */
41
47
  export declare function wireContractVersion(): string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvailabs/sandhi",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Sandhi — the metering layer for AI agents (Node binding): in-process virtual keys, budgets, and neutral usage-event metering.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/anvai-labs/sandhi",
@@ -47,7 +47,7 @@
47
47
  "access": "public"
48
48
  },
49
49
  "optionalDependencies": {
50
- "@anvailabs/sandhi-linux-x64-gnu": "0.6.0",
51
- "@anvailabs/sandhi-darwin-arm64": "0.6.0"
50
+ "@anvailabs/sandhi-linux-x64-gnu": "0.7.0",
51
+ "@anvailabs/sandhi-darwin-arm64": "0.7.0"
52
52
  }
53
53
  }