gitlab-ai-provider 6.6.0 → 6.7.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.
package/dist/index.mjs CHANGED
@@ -403,14 +403,15 @@ ${message.content}` : message.content;
403
403
  return { unified, raw: stopReason ?? void 0 };
404
404
  }
405
405
  createUsage(params) {
406
- const inputTotal = params?.inputTotal;
406
+ const inputNoCache = params?.inputTotal;
407
407
  const outputTotal = params?.outputTotal;
408
408
  const cacheRead = params?.cacheRead;
409
409
  const cacheWrite = params?.cacheWrite;
410
+ const inputTotal = inputNoCache != null ? inputNoCache + (cacheRead ?? 0) + (cacheWrite ?? 0) : void 0;
410
411
  return {
411
412
  inputTokens: {
412
413
  total: inputTotal,
413
- noCache: inputTotal == null ? void 0 : Math.max(0, inputTotal - (cacheRead ?? 0) - (cacheWrite ?? 0)),
414
+ noCache: inputNoCache,
414
415
  cacheRead,
415
416
  cacheWrite
416
417
  },
@@ -538,12 +539,13 @@ ${message.content}` : message.content;
538
539
  switch (event.type) {
539
540
  case "message_start":
540
541
  if (event.message.usage) {
542
+ const msgUsage = event.message.usage;
541
543
  usage = self.createUsage({
542
- inputTotal: event.message.usage.input_tokens,
544
+ inputTotal: msgUsage.input_tokens,
543
545
  outputTotal: usage.outputTokens.total,
544
546
  outputReasoning: usage.outputTokens.reasoning,
545
- cacheRead: usage.inputTokens.cacheRead,
546
- cacheWrite: usage.inputTokens.cacheWrite,
547
+ cacheRead: msgUsage.cache_read_input_tokens,
548
+ cacheWrite: msgUsage.cache_creation_input_tokens,
547
549
  raw: usage.raw
548
550
  });
549
551
  }
@@ -617,12 +619,13 @@ ${message.content}` : message.content;
617
619
  }
618
620
  case "message_delta":
619
621
  if (event.usage) {
622
+ const deltaUsage = event.usage;
620
623
  usage = self.createUsage({
621
- inputTotal: usage.inputTokens.total,
622
- outputTotal: event.usage.output_tokens,
624
+ inputTotal: usage.inputTokens.noCache,
625
+ outputTotal: deltaUsage.output_tokens,
623
626
  outputReasoning: usage.outputTokens.reasoning,
624
- cacheRead: usage.inputTokens.cacheRead,
625
- cacheWrite: usage.inputTokens.cacheWrite,
627
+ cacheRead: deltaUsage.cache_read_input_tokens ?? usage.inputTokens.cacheRead,
628
+ cacheWrite: deltaUsage.cache_creation_input_tokens ?? usage.inputTokens.cacheWrite,
626
629
  raw: usage.raw
627
630
  });
628
631
  }
@@ -750,6 +753,7 @@ var MODEL_MAPPINGS = {
750
753
  "duo-chat-gpt-5-1": { provider: "openai", model: "gpt-5.1-2025-11-13", openaiApiType: "chat" },
751
754
  "duo-chat-gpt-5-2": { provider: "openai", model: "gpt-5.2-2025-12-11", openaiApiType: "chat" },
752
755
  "duo-chat-gpt-5-4": { provider: "openai", model: "gpt-5.4-2026-03-05", openaiApiType: "chat" },
756
+ "duo-chat-gpt-5-5": { provider: "openai", model: "gpt-5.5-2026-04-23", openaiApiType: "chat" },
753
757
  "duo-chat-gpt-5-mini": {
754
758
  provider: "openai",
755
759
  model: "gpt-5-mini-2025-08-07",
@@ -1609,7 +1613,7 @@ var GitLabOpenAILanguageModel = class {
1609
1613
  import WebSocket from "isomorphic-ws";
1610
1614
 
1611
1615
  // src/version.ts
1612
- var VERSION = true ? "6.5.0" : "0.0.0-dev";
1616
+ var VERSION = true ? "6.7.0" : "0.0.0-dev";
1613
1617
 
1614
1618
  // src/gitlab-workflow-types.ts
1615
1619
  var WorkflowType = /* @__PURE__ */ ((WorkflowType2) => {