@opencode/ai 0.0.0-dev-21034 → 0.0.0-dev-21044

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.
@@ -413,7 +413,7 @@ const fromRequest = Effect.fn("BedrockConverse.fromRequest")(function* (request)
413
413
  });
414
414
  // Bedrock-Claude shares Anthropic's 4-breakpoint cap. Spend the budget in
415
415
  // tools → system → messages order to favour the highest-impact prefixes.
416
- const breakpoints = BedrockCache.breakpoints(request.model.id);
416
+ const breakpoints = BedrockCache.breakpoints(request.model);
417
417
  const toolConfig = (() => {
418
418
  if (flattened.tools.length === 0)
419
419
  return undefined;
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import type { CacheHint } from "../../schema/index.js";
2
+ import type { CacheHint, LLMRequest } from "../../schema/index.js";
3
3
  export declare const CachePointBlock: Schema.Struct<{
4
4
  readonly cachePoint: Schema.Struct<{
5
5
  readonly type: Schema.tag<"default">;
@@ -8,7 +8,7 @@ export declare const CachePointBlock: Schema.Struct<{
8
8
  }>;
9
9
  export type CachePointBlock = Schema.Schema.Type<typeof CachePointBlock>;
10
10
  export declare const BEDROCK_BREAKPOINT_CAP = 4;
11
- export declare const breakpoints: (modelID: string) => {
11
+ export declare const breakpoints: (model: LLMRequest["model"]) => {
12
12
  supported: boolean;
13
13
  ttl1h: boolean;
14
14
  remaining: number;
@@ -21,14 +21,16 @@ const CLAUDE_5M = [
21
21
  ];
22
22
  // Callers share the four-breakpoint budget across system, messages, and tools.
23
23
  export const BEDROCK_BREAKPOINT_CAP = 4;
24
- export const breakpoints = (modelID) => {
24
+ export const breakpoints = (model) => {
25
25
  // Substring matching also handles regional prefixes and model-bearing ARNs.
26
- const short = CLAUDE_5M.some((id) => modelID.includes(id));
26
+ const short = CLAUDE_5M.some((id) => model.id.includes(id));
27
27
  return {
28
28
  ...newBreakpoints(BEDROCK_BREAKPOINT_CAP),
29
+ // An explicit Anthropic cache format opts opaque IDs such as application inference profile ARNs in.
29
30
  // Assume modern Claude releases retain caching support; older generations need an explicit exception.
30
31
  // Other model families use implicit caching where available.
31
- supported: modelID.includes("anthropic.claude-") && (short || !LEGACY_CLAUDE.some((id) => modelID.includes(id))),
32
+ supported: model.compatibility?.cacheFormat === "anthropic" ||
33
+ (model.id.includes("anthropic.claude-") && (short || !LEGACY_CLAUDE.some((id) => model.id.includes(id)))),
32
34
  ttl1h: !short,
33
35
  };
34
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-dev-21034",
3
+ "version": "0.0.0-dev-21044",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "@clack/prompts": "1.0.0-alpha.1",
36
36
  "@effect/platform-node": "4.0.1",
37
- "@opencode/http-recorder": "0.0.0-dev-21034",
37
+ "@opencode/http-recorder": "0.0.0-dev-21044",
38
38
  "@tsconfig/bun": "1.0.9",
39
39
  "@types/bun": "1.4.0",
40
40
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -44,7 +44,7 @@
44
44
  "@aws-sdk/credential-providers": "3.1057.0",
45
45
  "@smithy/eventstream-codec": "4.2.14",
46
46
  "@smithy/util-utf8": "4.2.2",
47
- "@opencode/schema": "0.0.0-dev-21034",
47
+ "@opencode/schema": "0.0.0-dev-21044",
48
48
  "aws4fetch": "1.0.20",
49
49
  "effect": "4.0.1",
50
50
  "google-auth-library": "10.5.0"