@agentvault/agentvault 0.21.0 → 0.21.1

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.
@@ -8,7 +8,7 @@
8
8
  * completion content (`messages`, `content`, `choices[].message.content`)
9
9
  * never crosses the wire to AgentVault — only the extracted metadata.
10
10
  */
11
- export type LlmProvider = "anthropic" | "openai";
11
+ export type LlmProvider = "anthropic" | "openai" | "openrouter" | "groq" | "together" | "mistral" | "deepseek" | "azure";
12
12
  export interface ParsedLlmResponse {
13
13
  model: string;
14
14
  tokensInput: number;
@@ -17,6 +17,11 @@ export interface ParsedLlmResponse {
17
17
  /**
18
18
  * Detect whether a URL is a known LLM API endpoint we can parse.
19
19
  * Returns the provider key, or null if not recognized.
20
+ *
21
+ * Coverage as of 2026-05-01: Anthropic + 7 OpenAI-compatible providers.
22
+ * Bedrock and Gemini intentionally NOT included — they require dedicated
23
+ * parser branches (region routing for Bedrock, different usage shape for
24
+ * Gemini). Add via separate PR when needed.
20
25
  */
21
26
  export declare function detectLlmEndpoint(url: string): LlmProvider | null;
22
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"llm-response-parser.d.ts","sourceRoot":"","sources":["../src/llm-response-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAwBjE;AAUD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,OAAO,GACZ,iBAAiB,GAAG,IAAI,CAO1B"}
1
+ {"version":3,"file":"llm-response-parser.d.ts","sourceRoot":"","sources":["../src/llm-response-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,UAAU,GACV,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CA6DjE;AAUD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,OAAO,GACZ,iBAAiB,GAAG,IAAI,CAoB1B"}
@@ -49020,6 +49020,24 @@ function detectLlmEndpoint(url) {
49020
49020
  if (host === "api.openai.com" && (path === "/v1/chat/completions" || path === "/v1/responses")) {
49021
49021
  return "openai";
49022
49022
  }
49023
+ if (host === "openrouter.ai" && path === "/api/v1/chat/completions") {
49024
+ return "openrouter";
49025
+ }
49026
+ if (host === "api.groq.com" && path === "/openai/v1/chat/completions") {
49027
+ return "groq";
49028
+ }
49029
+ if (host === "api.together.xyz" && path === "/v1/chat/completions") {
49030
+ return "together";
49031
+ }
49032
+ if (host === "api.mistral.ai" && path === "/v1/chat/completions") {
49033
+ return "mistral";
49034
+ }
49035
+ if (host === "api.deepseek.com" && path === "/v1/chat/completions") {
49036
+ return "deepseek";
49037
+ }
49038
+ if (host.endsWith(".openai.azure.com") && path.includes("/openai/deployments/") && path.endsWith("/chat/completions")) {
49039
+ return "azure";
49040
+ }
49023
49041
  return null;
49024
49042
  }
49025
49043
  function isPlainObject(x2) {
@@ -49031,8 +49049,15 @@ function asNumber(x2) {
49031
49049
  function parseLlmResponse(provider, body) {
49032
49050
  if (!isPlainObject(body)) return null;
49033
49051
  if (provider === "anthropic") return parseAnthropic(body);
49034
- if (provider === "openai") return parseOpenAI(body);
49035
- return null;
49052
+ const result = parseOpenAI(body);
49053
+ if (!result) return null;
49054
+ if (provider === "openrouter") {
49055
+ const slash = result.model.indexOf("/");
49056
+ if (slash !== -1) {
49057
+ result.model = result.model.slice(slash + 1);
49058
+ }
49059
+ }
49060
+ return result;
49036
49061
  }
49037
49062
  function parseAnthropic(body) {
49038
49063
  if (!isPlainObject(body.usage)) return null;