@koda-sl/baker-bridge 0.39.1 → 0.39.2
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/README.md
CHANGED
|
@@ -41,7 +41,7 @@ await server.start();
|
|
|
41
41
|
| `BAKER_API_KEY` | API key for Convex callbacks (`bk_...`) |
|
|
42
42
|
| `INTERNAL_SECRET_KEY` | AES key for encrypting flow `_data.json` config at rest |
|
|
43
43
|
| `ANTHROPIC_API_KEY` | Anthropic API key (required by the Agent SDK) |
|
|
44
|
-
| `NOTDIAMOND_ENABLED` | `"true"` to route each prompt through NotDiamond's model selector. Defaults to `false` — every turn runs on Opus 4.
|
|
44
|
+
| `NOTDIAMOND_ENABLED` | `"true"` to route each prompt through NotDiamond's model selector. Defaults to `false` — every turn runs on Opus 4.6 (`claude-opus-4-6`) |
|
|
45
45
|
| `NOTDIAMOND_API_KEY` | NotDiamond bearer token. Required when `NOTDIAMOND_ENABLED=true` |
|
|
46
46
|
|
|
47
47
|
All variables are validated at startup via `@t3-oss/env-core` + `zod`.
|
|
@@ -50,14 +50,14 @@ All variables are validated at startup via `@t3-oss/env-core` + `zod`.
|
|
|
50
50
|
|
|
51
51
|
The bridge picks a Claude model per turn before calling the Agent SDK:
|
|
52
52
|
|
|
53
|
-
- **Default (router disabled):** every turn runs on `claude-opus-4-
|
|
53
|
+
- **Default (router disabled):** every turn runs on `claude-opus-4-6`.
|
|
54
54
|
- **Router enabled (`NOTDIAMOND_ENABLED=true`):** the prompt + repo context are
|
|
55
|
-
sent to NotDiamond with three candidates (Haiku 4.5, Sonnet 4.6, Opus 4.
|
|
55
|
+
sent to NotDiamond with three candidates (Haiku 4.5, Sonnet 4.6, Opus 4.6).
|
|
56
56
|
NotDiamond's default selection tradeoff is used — no `latency` / `cost`
|
|
57
57
|
override. The returned OpenRouter-formatted ID is normalized to the
|
|
58
|
-
Anthropic-native form (e.g. `anthropic/claude-opus-4.
|
|
58
|
+
Anthropic-native form (e.g. `anthropic/claude-opus-4.6` → `claude-opus-4-6`)
|
|
59
59
|
before being passed to `query({ options: { model } })`. On any router error
|
|
60
|
-
or empty response, it falls back to Opus 4.
|
|
60
|
+
or empty response, it falls back to Opus 4.6.
|
|
61
61
|
|
|
62
62
|
## Endpoints
|
|
63
63
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DEFAULT_MODEL = "claude-opus-4-
|
|
1
|
+
export declare const DEFAULT_MODEL = "claude-opus-4-6";
|
|
2
2
|
export declare function normalizeModel(model: string): string;
|
|
3
3
|
interface SelectModelResult {
|
|
4
4
|
model: string;
|
|
@@ -9,7 +9,7 @@ interface SelectModelResult {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Use NotDiamond to select the optimal Claude model for a given prompt.
|
|
12
|
-
* Set NOTDIAMOND_ENABLED=true to enable routing; defaults to Opus 4.
|
|
12
|
+
* Set NOTDIAMOND_ENABLED=true to enable routing; defaults to Opus 4.6 otherwise.
|
|
13
13
|
*/
|
|
14
14
|
export declare function selectModel(prompt: string): Promise<SelectModelResult>;
|
|
15
15
|
export {};
|
|
@@ -5,14 +5,14 @@ const NOTDIAMOND_API_URL = "https://api.notdiamond.ai/v2/modelRouter/modelSelect
|
|
|
5
5
|
const CANDIDATE_MODELS = [
|
|
6
6
|
{ model: "anthropic/claude-haiku-4.5" },
|
|
7
7
|
{ model: "anthropic/claude-sonnet-4.6" },
|
|
8
|
-
{ model: "anthropic/claude-opus-4.
|
|
8
|
+
{ model: "anthropic/claude-opus-4.6" },
|
|
9
9
|
];
|
|
10
10
|
// Anthropic-native ID expected by the Claude Agent SDK `query({ options: { model } })`.
|
|
11
|
-
export const DEFAULT_MODEL = "claude-opus-4-
|
|
11
|
+
export const DEFAULT_MODEL = "claude-opus-4-6";
|
|
12
12
|
export function normalizeModel(model) {
|
|
13
13
|
const lower = model.toLowerCase();
|
|
14
14
|
if (lower.includes("opus")) {
|
|
15
|
-
return "claude-opus-4-
|
|
15
|
+
return "claude-opus-4-6";
|
|
16
16
|
}
|
|
17
17
|
if (lower.includes("haiku")) {
|
|
18
18
|
return "claude-haiku-4-5";
|
|
@@ -32,7 +32,7 @@ function getRepoContext() {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Use NotDiamond to select the optimal Claude model for a given prompt.
|
|
35
|
-
* Set NOTDIAMOND_ENABLED=true to enable routing; defaults to Opus 4.
|
|
35
|
+
* Set NOTDIAMOND_ENABLED=true to enable routing; defaults to Opus 4.6 otherwise.
|
|
36
36
|
*/
|
|
37
37
|
export async function selectModel(prompt) {
|
|
38
38
|
const systemPrompt = await getRepoContext();
|
|
@@ -16,7 +16,7 @@ import { DEFAULT_MODEL, normalizeModel } from "./model-router.js";
|
|
|
16
16
|
// its CLI default (Sonnet). normalizeModel bridges the two formats.
|
|
17
17
|
describe("normalizeModel", () => {
|
|
18
18
|
it("strips the anthropic/ prefix and converts dotted Opus version to dashes", () => {
|
|
19
|
-
expect(normalizeModel("anthropic/claude-opus-4.
|
|
19
|
+
expect(normalizeModel("anthropic/claude-opus-4.6")).toBe("claude-opus-4-6");
|
|
20
20
|
});
|
|
21
21
|
it("normalizes Sonnet (already dashed) by stripping the prefix", () => {
|
|
22
22
|
expect(normalizeModel("anthropic/claude-sonnet-4-6")).toBe("claude-sonnet-4-6");
|
|
@@ -28,7 +28,7 @@ describe("normalizeModel", () => {
|
|
|
28
28
|
expect(normalizeModel("anthropic/claude-haiku-4-5-20251001")).toBe("claude-haiku-4-5");
|
|
29
29
|
});
|
|
30
30
|
it("ignores casing", () => {
|
|
31
|
-
expect(normalizeModel("ANTHROPIC/Claude-OPUS-4.
|
|
31
|
+
expect(normalizeModel("ANTHROPIC/Claude-OPUS-4.6")).toBe("claude-opus-4-6");
|
|
32
32
|
});
|
|
33
33
|
it("returns the input unchanged when no family keyword matches", () => {
|
|
34
34
|
expect(normalizeModel("anthropic/gpt-5")).toBe("anthropic/gpt-5");
|
|
@@ -38,7 +38,7 @@ describe("DEFAULT_MODEL", () => {
|
|
|
38
38
|
// Locks the fallback to the SDK-native format. If this regresses to the
|
|
39
39
|
// OpenRouter/NotDiamond form, the SDK silently picks Sonnet instead of Opus.
|
|
40
40
|
it("uses the Claude Agent SDK-native format", () => {
|
|
41
|
-
expect(DEFAULT_MODEL).toBe("claude-opus-4-
|
|
41
|
+
expect(DEFAULT_MODEL).toBe("claude-opus-4-6");
|
|
42
42
|
expect(DEFAULT_MODEL).not.toMatch(/^anthropic\//);
|
|
43
43
|
expect(DEFAULT_MODEL).not.toMatch(/\./);
|
|
44
44
|
});
|
package/package.json
CHANGED