gitlab-ai-provider 6.5.0 → 6.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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## 6.7.0 (2026-05-18)
6
+
7
+ - Merge branch 'feat/add-gpt-5-5-model-mapping' into 'main' ([10e84d1](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/10e84d1))
8
+ - feat: add GPT-5.5 model mapping ([eb9b32d](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/eb9b32d))
9
+
10
+ ## 6.6.0 (2026-04-17)
11
+
12
+ - Merge branch 'feat/anthropic-prompt-caching' into 'main' ([d2125eb](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/d2125eb)), closes [#6](https://gitlab.com/vglafirov/gitlab-ai-provider/issues/6)
13
+ - feat(anthropic): enable prompt caching via cache_control on system prompt ([376556f](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/376556f))
14
+
5
15
  ## 6.5.0 (2026-04-17)
6
16
 
7
17
  - Merge branch 'add-opus-4-7-model-mapping' into 'main' ([f95e21a](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/f95e21a))
package/README.md CHANGED
@@ -127,6 +127,7 @@ const customModel = gitlab.agenticChat('duo-chat-opus-4-5', {
127
127
  | `duo-chat-gpt-5-1` | OpenAI | `gpt-5.1-2025-11-13` |
128
128
  | `duo-chat-gpt-5-2` | OpenAI | `gpt-5.2-2025-12-11` |
129
129
  | `duo-chat-gpt-5-4` | OpenAI | `gpt-5.4-2026-03-05` |
130
+ | `duo-chat-gpt-5-5` | OpenAI | `gpt-5.5-2026-04-23` |
130
131
  | `duo-chat-gpt-5-mini` | OpenAI | `gpt-5-mini-2025-08-07` |
131
132
  | `duo-chat-gpt-5-4-mini` | OpenAI | `gpt-5.4-mini` |
132
133
  | `duo-chat-gpt-5-4-nano` | OpenAI | `gpt-5.4-nano` |
package/dist/index.d.mts CHANGED
@@ -79,7 +79,17 @@ declare class GitLabAnthropicLanguageModel implements LanguageModelV3 {
79
79
  */
80
80
  private convertToolChoice;
81
81
  /**
82
- * Convert AI SDK prompt to Anthropic messages format
82
+ * Convert AI SDK prompt to Anthropic messages format.
83
+ *
84
+ * Cache breakpoints (`cache_control: { type: "ephemeral" }`) are placed on:
85
+ * 1. The system prompt content block — static across all turns.
86
+ * 2. The last content block of the second-to-last message — the boundary
87
+ * between conversation history and the current turn.
88
+ *
89
+ * This lets Anthropic cache the system prompt and the accumulated
90
+ * conversation prefix, so each new turn only pays for the new content.
91
+ *
92
+ * @see https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
83
93
  */
84
94
  private convertPrompt;
85
95
  /**
package/dist/index.d.ts CHANGED
@@ -79,7 +79,17 @@ declare class GitLabAnthropicLanguageModel implements LanguageModelV3 {
79
79
  */
80
80
  private convertToolChoice;
81
81
  /**
82
- * Convert AI SDK prompt to Anthropic messages format
82
+ * Convert AI SDK prompt to Anthropic messages format.
83
+ *
84
+ * Cache breakpoints (`cache_control: { type: "ephemeral" }`) are placed on:
85
+ * 1. The system prompt content block — static across all turns.
86
+ * 2. The last content block of the second-to-last message — the boundary
87
+ * between conversation history and the current turn.
88
+ *
89
+ * This lets Anthropic cache the system prompt and the accumulated
90
+ * conversation prefix, so each new turn only pays for the new content.
91
+ *
92
+ * @see https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
83
93
  */
84
94
  private convertPrompt;
85
95
  /**
package/dist/index.js CHANGED
@@ -353,7 +353,17 @@ var GitLabAnthropicLanguageModel = class {
353
353
  }
354
354
  }
355
355
  /**
356
- * Convert AI SDK prompt to Anthropic messages format
356
+ * Convert AI SDK prompt to Anthropic messages format.
357
+ *
358
+ * Cache breakpoints (`cache_control: { type: "ephemeral" }`) are placed on:
359
+ * 1. The system prompt content block — static across all turns.
360
+ * 2. The last content block of the second-to-last message — the boundary
361
+ * between conversation history and the current turn.
362
+ *
363
+ * This lets Anthropic cache the system prompt and the accumulated
364
+ * conversation prefix, so each new turn only pays for the new content.
365
+ *
366
+ * @see https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
357
367
  */
358
368
  convertPrompt(prompt) {
359
369
  let systemMessage;
@@ -425,7 +435,23 @@ ${message.content}` : message.content;
425
435
  }
426
436
  }
427
437
  }
428
- return { system: systemMessage, messages };
438
+ const system = systemMessage ? [
439
+ {
440
+ type: "text",
441
+ text: systemMessage,
442
+ cache_control: { type: "ephemeral" }
443
+ }
444
+ ] : void 0;
445
+ if (messages.length >= 2) {
446
+ const penultimate = messages[messages.length - 2];
447
+ if (Array.isArray(penultimate.content)) {
448
+ const lastBlock = penultimate.content[penultimate.content.length - 1];
449
+ lastBlock.cache_control = {
450
+ type: "ephemeral"
451
+ };
452
+ }
453
+ }
454
+ return { system, messages };
429
455
  }
430
456
  /**
431
457
  * Convert Anthropic finish reason to AI SDK format
@@ -795,6 +821,7 @@ var MODEL_MAPPINGS = {
795
821
  "duo-chat-gpt-5-1": { provider: "openai", model: "gpt-5.1-2025-11-13", openaiApiType: "chat" },
796
822
  "duo-chat-gpt-5-2": { provider: "openai", model: "gpt-5.2-2025-12-11", openaiApiType: "chat" },
797
823
  "duo-chat-gpt-5-4": { provider: "openai", model: "gpt-5.4-2026-03-05", openaiApiType: "chat" },
824
+ "duo-chat-gpt-5-5": { provider: "openai", model: "gpt-5.5-2026-04-23", openaiApiType: "chat" },
798
825
  "duo-chat-gpt-5-mini": {
799
826
  provider: "openai",
800
827
  model: "gpt-5-mini-2025-08-07",
@@ -1654,7 +1681,7 @@ var GitLabOpenAILanguageModel = class {
1654
1681
  var import_isomorphic_ws = __toESM(require("isomorphic-ws"));
1655
1682
 
1656
1683
  // src/version.ts
1657
- var VERSION = true ? "6.4.2" : "0.0.0-dev";
1684
+ var VERSION = true ? "6.6.0" : "0.0.0-dev";
1658
1685
 
1659
1686
  // src/gitlab-workflow-types.ts
1660
1687
  var WorkflowType = /* @__PURE__ */ ((WorkflowType2) => {