@anvailabs/sandhi 0.10.0 → 0.11.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 +10 -1
- package/package.json +3 -3
package/contracts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/gen-binding-contract-facades.py; DO NOT EDIT.
|
|
2
|
-
// schema-sha256:
|
|
2
|
+
// schema-sha256: 0808e1b284679f40491843e2e0a2446969493c8a1c57e2b3123ca9230992b3d8
|
|
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"
|
|
@@ -44,6 +44,15 @@ export interface UsageV2 {
|
|
|
44
44
|
reasoning_included?: boolean
|
|
45
45
|
accepted_prediction_tokens?: number; rejected_prediction_tokens?: number
|
|
46
46
|
}
|
|
47
|
+
export interface PolicySelectorV1 { issuer?: string | null; subjects?: string[]; groups?: string[]; roles?: string[]; upstreams?: string[]; models?: string[] }
|
|
48
|
+
export type PolicyEvaluatorV1 =
|
|
49
|
+
| { kind: "regex"; pattern: string }
|
|
50
|
+
| { kind: "threshold"; metric: "body_bytes" | "max_output_tokens"; above: number }
|
|
51
|
+
| { kind: "lexical_similarity"; reference: string; at_least: number }
|
|
52
|
+
| { kind: "registered"; name: string; configuration: JsonValue }
|
|
53
|
+
export interface PolicyRuleV1 { id: string; when?: PolicySelectorV1; evaluator: PolicyEvaluatorV1; effect: "audit" | "quarantine" | "block" }
|
|
54
|
+
export interface PolicyDocumentV1 { schema_version: "1"; revision: number; deadline_ms: number; max_body_bytes: number; rules: PolicyRuleV1[] }
|
|
55
|
+
export interface PolicyDecisionV1 { revision: number; disposition: "forward" | "quarantine" | "block" | "unavailable"; matched_rules: string[]; reason: string; elapsed_us: number }
|
|
47
56
|
export interface LatencySummary { samples: number; p50_ms: number; p95_ms: number; ttft_p50_ms?: number }
|
|
48
57
|
export interface UsageAggregateV1 {
|
|
49
58
|
key: string; calls: number; tokens_in: number; tokens_out: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvailabs/sandhi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.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.
|
|
51
|
-
"@anvailabs/sandhi-darwin-arm64": "0.
|
|
50
|
+
"@anvailabs/sandhi-linux-x64-gnu": "0.11.0",
|
|
51
|
+
"@anvailabs/sandhi-darwin-arm64": "0.11.0"
|
|
52
52
|
}
|
|
53
53
|
}
|