@byokkit/cmd-provider-anthropic 0.1.2 → 0.1.4
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.
|
@@ -7,6 +7,18 @@ var EFFORT_LOW_TO_MAX = [
|
|
|
7
7
|
"max"
|
|
8
8
|
];
|
|
9
9
|
var ANTHROPIC_MODEL_OPTIONS = {
|
|
10
|
+
SONNET_5_5: {
|
|
11
|
+
id: "claude-sonnet-5-5",
|
|
12
|
+
inputModalities: ["text", "image"],
|
|
13
|
+
provider: "anthropic",
|
|
14
|
+
spec: "chatComplete",
|
|
15
|
+
label: "Claude Sonnet 5.5",
|
|
16
|
+
name: "Claude Sonnet 5.5",
|
|
17
|
+
description: "best combo of speed & intelligence (recommended)",
|
|
18
|
+
reasoning: true,
|
|
19
|
+
reasoningEfforts: EFFORT_LOW_TO_MAX,
|
|
20
|
+
contextWindow: 1e6
|
|
21
|
+
},
|
|
10
22
|
SONNET_5: {
|
|
11
23
|
id: "claude-sonnet-5",
|
|
12
24
|
inputModalities: ["text", "image"],
|
|
@@ -14,7 +26,7 @@ var ANTHROPIC_MODEL_OPTIONS = {
|
|
|
14
26
|
spec: "chatComplete",
|
|
15
27
|
label: "Claude Sonnet 5",
|
|
16
28
|
name: "Claude Sonnet 5",
|
|
17
|
-
description: "
|
|
29
|
+
description: "prev Sonnet, still fast & capable",
|
|
18
30
|
// Sonnet 5 rejects non-default `temperature` with a 400 (new for
|
|
19
31
|
// Sonnet-class, same as Opus 4.7+). `reasoning: true` stops the API from
|
|
20
32
|
// injecting temperature. Sonnet 4.6 still accepts it, so it stays unset.
|
|
@@ -29,7 +41,7 @@ var ANTHROPIC_MODEL_OPTIONS = {
|
|
|
29
41
|
spec: "chatComplete",
|
|
30
42
|
label: "Claude Sonnet 4.6",
|
|
31
43
|
name: "Claude Sonnet 4.6",
|
|
32
|
-
description: "
|
|
44
|
+
description: "older Sonnet, still fast & capable",
|
|
33
45
|
reasoningEfforts: EFFORT_LOW_TO_MAX,
|
|
34
46
|
contextWindow: 1e6
|
|
35
47
|
},
|
|
@@ -105,6 +117,18 @@ var ANTHROPIC_MODEL_OPTIONS = {
|
|
|
105
117
|
reasoningEfforts: EFFORT_LOW_TO_MAX,
|
|
106
118
|
contextWindow: 1e6
|
|
107
119
|
},
|
|
120
|
+
HAIKU_5_5: {
|
|
121
|
+
id: "claude-haiku-5-5",
|
|
122
|
+
inputModalities: ["text", "image"],
|
|
123
|
+
provider: "anthropic",
|
|
124
|
+
spec: "chatComplete",
|
|
125
|
+
label: "Claude Haiku 5.5",
|
|
126
|
+
name: "Claude Haiku 5.5",
|
|
127
|
+
description: "fastest & most compact, great for quick tasks",
|
|
128
|
+
reasoning: true,
|
|
129
|
+
reasoningEfforts: EFFORT_LOW_TO_MAX,
|
|
130
|
+
contextWindow: 1e6
|
|
131
|
+
},
|
|
108
132
|
HAIKU_4_5: {
|
|
109
133
|
id: "claude-haiku-4-5-20251001",
|
|
110
134
|
inputModalities: ["text", "image"],
|
|
@@ -112,7 +136,7 @@ var ANTHROPIC_MODEL_OPTIONS = {
|
|
|
112
136
|
spec: "chatComplete",
|
|
113
137
|
label: "Claude Haiku 4.5",
|
|
114
138
|
name: "Claude Haiku 4.5",
|
|
115
|
-
description: "
|
|
139
|
+
description: "prev Haiku, still fast for quick tasks",
|
|
116
140
|
contextWindow: 2e5
|
|
117
141
|
}
|
|
118
142
|
};
|
|
@@ -148,4 +172,4 @@ export {
|
|
|
148
172
|
matchesAnthropicModel,
|
|
149
173
|
ANTHROPIC_MODEL_SPECS
|
|
150
174
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
175
|
+
//# sourceMappingURL=chunk-6IXKERNZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models.ts"],"sourcesContent":["// @byokkit/cmd-provider-anthropic/models — the COMPLETE Anthropic model catalog: /model picker\n// metadata, wire-spec kinds, context windows, reasoning efforts, deprecated-alias migrations, and\n// the id heuristics core code used to hardcode. This file is intentionally dependency-free (plain\n// data + tiny helpers, structural types) so it can be consumed by the CLI (via shared/constants),\n// the API worker, and Studio alike, and so this package can move to its own repo without dragging\n// monorepo internals along. Every value is a verbatim port from shared/constants.ts +\n// harness/config/known-models.ts — those sites now import from HERE.\n\nexport type AnthropicReasoningEffort =\n\t| 'low'\n\t| 'medium'\n\t| 'high'\n\t| 'xhigh'\n\t| 'max';\n\n// Structural copy of shared's ModelOption (shared `satisfies`-checks on import, so drift fails the\n// build there, not silently here). Kept local so this package never imports monorepo internals.\nexport interface AnthropicModelOption {\n\treadonly id: string;\n\treadonly provider: 'anthropic';\n\treadonly spec: 'chatComplete';\n\treadonly label: string;\n\treadonly name: string;\n\treadonly description: string;\n\treadonly reasoning?: boolean;\n\treadonly reasoningEfforts?: readonly AnthropicReasoningEffort[];\n\treadonly contextWindow?: number;\n\treadonly inputModalities?: readonly ('text' | 'image')[];\n}\n\nconst EFFORT_LOW_TO_MAX: readonly AnthropicReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n\t'xhigh',\n\t'max',\n];\n\n// The /model catalog entries (verbatim from shared MODEL_OPTIONS). Key names preserved so\n// shared's MODEL_OPTIONS spread keeps identical keys (SONNET_5, OPUS_4_8, …).\nexport const ANTHROPIC_MODEL_OPTIONS = {\n\tSONNET_5_5: {\n\t\tid: 'claude-sonnet-5-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Sonnet 5.5',\n\t\tname: 'Claude Sonnet 5.5',\n\t\tdescription: 'best combo of speed & intelligence (recommended)',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tSONNET_5: {\n\t\tid: 'claude-sonnet-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Sonnet 5',\n\t\tname: 'Claude Sonnet 5',\n\t\tdescription: 'prev Sonnet, still fast & capable',\n\t\t// Sonnet 5 rejects non-default `temperature` with a 400 (new for\n\t\t// Sonnet-class, same as Opus 4.7+). `reasoning: true` stops the API from\n\t\t// injecting temperature. Sonnet 4.6 still accepts it, so it stays unset.\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tSONNET_4_6: {\n\t\tid: 'claude-sonnet-4-6',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Sonnet 4.6',\n\t\tname: 'Claude Sonnet 4.6',\n\t\tdescription: 'older Sonnet, still fast & capable',\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tFABLE_5_1: {\n\t\tid: 'claude-fable-5-1',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Fable 5.1',\n\t\tname: 'Claude Fable 5.1',\n\t\tdescription:\n\t\t\t'most capable for demanding reasoning & long-horizon agents',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tFABLE_5: {\n\t\tid: 'claude-fable-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Fable 5',\n\t\tname: 'Claude Fable 5',\n\t\tdescription: 'prev Fable, still strong for deep reasoning & agents',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_5_5: {\n\t\tid: 'claude-opus-5-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 5.5',\n\t\tname: 'Claude Opus 5.5',\n\t\tdescription: 'most intelligent Opus for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_5: {\n\t\tid: 'claude-opus-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 5',\n\t\tname: 'Claude Opus 5',\n\t\tdescription: 'prev flagship, still strong for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_4_8: {\n\t\tid: 'claude-opus-4-8',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 4.8',\n\t\tname: 'Claude Opus 4.8',\n\t\tdescription: 'older Opus, still strong for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_4_7: {\n\t\tid: 'claude-opus-4-7',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 4.7',\n\t\tname: 'Claude Opus 4.7',\n\t\tdescription: 'older Opus, still strong for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tHAIKU_5_5: {\n\t\tid: 'claude-haiku-5-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Haiku 5.5',\n\t\tname: 'Claude Haiku 5.5',\n\t\tdescription: 'fastest & most compact, great for quick tasks',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tHAIKU_4_5: {\n\t\tid: 'claude-haiku-4-5-20251001',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Haiku 4.5',\n\t\tname: 'Claude Haiku 4.5',\n\t\tdescription: 'prev Haiku, still fast for quick tasks',\n\t\tcontextWindow: 200_000,\n\t},\n} as const satisfies Record<string, AnthropicModelOption>;\n\n/** Canonical Anthropic model ids, in catalog order. */\nexport const ANTHROPIC_MODEL_IDS: readonly string[] = Object.values(\n\tANTHROPIC_MODEL_OPTIONS,\n).map(option => option.id);\n\n/**\n * Deprecated / undated aliases → canonical id (verbatim from the harness's former deprecated-alias\n * table — every entry there was an Anthropic id, so the whole map lives here now). Keys are\n * lowercase and matched case-insensitively by consumers.\n */\nexport const ANTHROPIC_DEPRECATED_MODEL_ALIASES: Readonly<\n\tRecord<string, string>\n> = {\n\t'claude-sonnet-4-20250514': 'claude-sonnet-4-6',\n\t'claude-sonnet-4-5-20250929': 'claude-sonnet-4-6',\n\t'claude-opus-4-5-20251101': 'claude-opus-4-7',\n\t'claude-opus-4-6': 'claude-opus-4-7',\n\t// Undated alias for the Haiku 4.5 dated snapshot.\n\t'claude-haiku-4-5': 'claude-haiku-4-5-20251001',\n};\n\n/**\n * Does an id look like an Anthropic model (including BYO/dated ids the catalog doesn't list)?\n * This is the predicate that used to live inline in the harness model client\n * (`model.includes('claude')`) to decide interleaved-thinking finalization — provider heuristics\n * belong to the provider.\n */\nexport function matchesAnthropicModel(modelId: string): boolean {\n\treturn modelId.toLowerCase().includes('claude');\n}\n\n/**\n * Harness ModelSpec-shaped catalog (structural — the harness validates on registration). Declares\n * interleaved thinking for every Anthropic model so the core model client needs no 'claude'\n * string of its own.\n */\nexport const ANTHROPIC_MODEL_SPECS = Object.values(ANTHROPIC_MODEL_OPTIONS).map(\n\toption => ({\n\t\tid: option.id,\n\t\tprovider: 'anthropic' as const,\n\t\tcontextWindow: option.contextWindow,\n\t\treasoningEfforts:\n\t\t\t'reasoningEfforts' in option ? option.reasoningEfforts : undefined,\n\t\tinputModalities: option.inputModalities,\n\t\tinterleavedThinking: true,\n\t}),\n);\n"],"mappings":";AA8BA,IAAM,oBAAyD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAIO,IAAM,0BAA0B;AAAA,EACtC,YAAY;AAAA,IACX,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,eAAe;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,IACT,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA,IAIb,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,eAAe;AAAA,EAChB;AAAA,EACA,YAAY;AAAA,IACX,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,eAAe;AAAA,EAChB;AAAA,EACA,WAAW;AAAA,IACV,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aACC;AAAA,IACD,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,eAAe;AAAA,EAChB;AAAA,EACA,SAAS;AAAA,IACR,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAA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IAClB,eAAe;AAAA,EAChB;AAAA,EACA,WAAW;AAAA,IACV,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,eAAe;AAAA,EAChB;AACD;AAGO,IAAM,sBAAyC,OAAO;AAAA,EAC5D;AACD,EAAE,IAAI,YAAU,OAAO,EAAE;AAOlB,IAAM,qCAET;AAAA,EACH,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAC9B,4BAA4B;AAAA,EAC5B,mBAAmB;AAAA;AAAA,EAEnB,oBAAoB;AACrB;AAQO,SAAS,sBAAsB,SAA0B;AAC/D,SAAO,QAAQ,YAAY,EAAE,SAAS,QAAQ;AAC/C;AAOO,IAAM,wBAAwB,OAAO,OAAO,uBAAuB,EAAE;AAAA,EAC3E,aAAW;AAAA,IACV,IAAI,OAAO;AAAA,IACX,UAAU;AAAA,IACV,eAAe,OAAO;AAAA,IACtB,kBACC,sBAAsB,SAAS,OAAO,mBAAmB;AAAA,IAC1D,iBAAiB,OAAO;AAAA,IACxB,qBAAqB;AAAA,EACtB;AACD;","names":[]}
|
package/dist/index.js
CHANGED
package/dist/models.d.ts
CHANGED
|
@@ -12,6 +12,18 @@ interface AnthropicModelOption {
|
|
|
12
12
|
readonly inputModalities?: readonly ('text' | 'image')[];
|
|
13
13
|
}
|
|
14
14
|
declare const ANTHROPIC_MODEL_OPTIONS: {
|
|
15
|
+
readonly SONNET_5_5: {
|
|
16
|
+
readonly id: "claude-sonnet-5-5";
|
|
17
|
+
readonly inputModalities: readonly ["text", "image"];
|
|
18
|
+
readonly provider: "anthropic";
|
|
19
|
+
readonly spec: "chatComplete";
|
|
20
|
+
readonly label: "Claude Sonnet 5.5";
|
|
21
|
+
readonly name: "Claude Sonnet 5.5";
|
|
22
|
+
readonly description: "best combo of speed & intelligence (recommended)";
|
|
23
|
+
readonly reasoning: true;
|
|
24
|
+
readonly reasoningEfforts: readonly AnthropicReasoningEffort[];
|
|
25
|
+
readonly contextWindow: 1000000;
|
|
26
|
+
};
|
|
15
27
|
readonly SONNET_5: {
|
|
16
28
|
readonly id: "claude-sonnet-5";
|
|
17
29
|
readonly inputModalities: readonly ["text", "image"];
|
|
@@ -19,7 +31,7 @@ declare const ANTHROPIC_MODEL_OPTIONS: {
|
|
|
19
31
|
readonly spec: "chatComplete";
|
|
20
32
|
readonly label: "Claude Sonnet 5";
|
|
21
33
|
readonly name: "Claude Sonnet 5";
|
|
22
|
-
readonly description: "
|
|
34
|
+
readonly description: "prev Sonnet, still fast & capable";
|
|
23
35
|
readonly reasoning: true;
|
|
24
36
|
readonly reasoningEfforts: readonly AnthropicReasoningEffort[];
|
|
25
37
|
readonly contextWindow: 1000000;
|
|
@@ -31,7 +43,7 @@ declare const ANTHROPIC_MODEL_OPTIONS: {
|
|
|
31
43
|
readonly spec: "chatComplete";
|
|
32
44
|
readonly label: "Claude Sonnet 4.6";
|
|
33
45
|
readonly name: "Claude Sonnet 4.6";
|
|
34
|
-
readonly description: "
|
|
46
|
+
readonly description: "older Sonnet, still fast & capable";
|
|
35
47
|
readonly reasoningEfforts: readonly AnthropicReasoningEffort[];
|
|
36
48
|
readonly contextWindow: 1000000;
|
|
37
49
|
};
|
|
@@ -107,6 +119,18 @@ declare const ANTHROPIC_MODEL_OPTIONS: {
|
|
|
107
119
|
readonly reasoningEfforts: readonly AnthropicReasoningEffort[];
|
|
108
120
|
readonly contextWindow: 1000000;
|
|
109
121
|
};
|
|
122
|
+
readonly HAIKU_5_5: {
|
|
123
|
+
readonly id: "claude-haiku-5-5";
|
|
124
|
+
readonly inputModalities: readonly ["text", "image"];
|
|
125
|
+
readonly provider: "anthropic";
|
|
126
|
+
readonly spec: "chatComplete";
|
|
127
|
+
readonly label: "Claude Haiku 5.5";
|
|
128
|
+
readonly name: "Claude Haiku 5.5";
|
|
129
|
+
readonly description: "fastest & most compact, great for quick tasks";
|
|
130
|
+
readonly reasoning: true;
|
|
131
|
+
readonly reasoningEfforts: readonly AnthropicReasoningEffort[];
|
|
132
|
+
readonly contextWindow: 1000000;
|
|
133
|
+
};
|
|
110
134
|
readonly HAIKU_4_5: {
|
|
111
135
|
readonly id: "claude-haiku-4-5-20251001";
|
|
112
136
|
readonly inputModalities: readonly ["text", "image"];
|
|
@@ -114,12 +138,17 @@ declare const ANTHROPIC_MODEL_OPTIONS: {
|
|
|
114
138
|
readonly spec: "chatComplete";
|
|
115
139
|
readonly label: "Claude Haiku 4.5";
|
|
116
140
|
readonly name: "Claude Haiku 4.5";
|
|
117
|
-
readonly description: "
|
|
141
|
+
readonly description: "prev Haiku, still fast for quick tasks";
|
|
118
142
|
readonly contextWindow: 200000;
|
|
119
143
|
};
|
|
120
144
|
};
|
|
121
145
|
/** Canonical Anthropic model ids, in catalog order. */
|
|
122
146
|
declare const ANTHROPIC_MODEL_IDS: readonly string[];
|
|
147
|
+
/**
|
|
148
|
+
* Deprecated / undated aliases → canonical id (verbatim from the harness's former deprecated-alias
|
|
149
|
+
* table — every entry there was an Anthropic id, so the whole map lives here now). Keys are
|
|
150
|
+
* lowercase and matched case-insensitively by consumers.
|
|
151
|
+
*/
|
|
123
152
|
declare const ANTHROPIC_DEPRECATED_MODEL_ALIASES: Readonly<Record<string, string>>;
|
|
124
153
|
/**
|
|
125
154
|
* Does an id look like an Anthropic model (including BYO/dated ids the catalog doesn't list)?
|
|
@@ -134,7 +163,7 @@ declare function matchesAnthropicModel(modelId: string): boolean;
|
|
|
134
163
|
* string of its own.
|
|
135
164
|
*/
|
|
136
165
|
declare const ANTHROPIC_MODEL_SPECS: {
|
|
137
|
-
id: "claude-sonnet-5" | "claude-sonnet-4-6" | "claude-fable-5-1" | "claude-fable-5" | "claude-opus-5-5" | "claude-opus-5" | "claude-opus-4-8" | "claude-opus-4-7" | "claude-haiku-4-5-20251001";
|
|
166
|
+
id: "claude-sonnet-5-5" | "claude-sonnet-5" | "claude-sonnet-4-6" | "claude-fable-5-1" | "claude-fable-5" | "claude-opus-5-5" | "claude-opus-5" | "claude-opus-4-8" | "claude-opus-4-7" | "claude-haiku-5-5" | "claude-haiku-4-5-20251001";
|
|
138
167
|
provider: "anthropic";
|
|
139
168
|
contextWindow: 1000000 | 200000;
|
|
140
169
|
reasoningEfforts: readonly AnthropicReasoningEffort[] | undefined;
|
package/dist/models.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/models.ts"],"sourcesContent":["// @byokkit/cmd-provider-anthropic/models — the COMPLETE Anthropic model catalog: /model picker\n// metadata, wire-spec kinds, context windows, reasoning efforts, deprecated-alias migrations, and\n// the id heuristics core code used to hardcode. This file is intentionally dependency-free (plain\n// data + tiny helpers, structural types) so it can be consumed by the CLI (via shared/constants),\n// the API worker, and Studio alike, and so this package can move to its own repo without dragging\n// monorepo internals along. Every value is a verbatim port from shared/constants.ts +\n// harness/config/known-models.ts — those sites now import from HERE.\n\nexport type AnthropicReasoningEffort =\n\t| 'low'\n\t| 'medium'\n\t| 'high'\n\t| 'xhigh'\n\t| 'max';\n\n// Structural copy of shared's ModelOption (shared `satisfies`-checks on import, so drift fails the\n// build there, not silently here). Kept local so this package never imports monorepo internals.\nexport interface AnthropicModelOption {\n\treadonly id: string;\n\treadonly provider: 'anthropic';\n\treadonly spec: 'chatComplete';\n\treadonly label: string;\n\treadonly name: string;\n\treadonly description: string;\n\treadonly reasoning?: boolean;\n\treadonly reasoningEfforts?: readonly AnthropicReasoningEffort[];\n\treadonly contextWindow?: number;\n\treadonly inputModalities?: readonly ('text' | 'image')[];\n}\n\nconst EFFORT_LOW_TO_MAX: readonly AnthropicReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n\t'xhigh',\n\t'max',\n];\n\n// The /model catalog entries (verbatim from shared MODEL_OPTIONS). Key names preserved so\n// shared's MODEL_OPTIONS spread keeps identical keys (SONNET_5, OPUS_4_8, …).\nexport const ANTHROPIC_MODEL_OPTIONS = {\n\tSONNET_5: {\n\t\tid: 'claude-sonnet-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Sonnet 5',\n\t\tname: 'Claude Sonnet 5',\n\t\tdescription: 'best combo of speed & intelligence (recommended)',\n\t\t// Sonnet 5 rejects non-default `temperature` with a 400 (new for\n\t\t// Sonnet-class, same as Opus 4.7+). `reasoning: true` stops the API from\n\t\t// injecting temperature. Sonnet 4.6 still accepts it, so it stays unset.\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tSONNET_4_6: {\n\t\tid: 'claude-sonnet-4-6',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Sonnet 4.6',\n\t\tname: 'Claude Sonnet 4.6',\n\t\tdescription: 'prev Sonnet, still fast & capable',\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tFABLE_5_1: {\n\t\tid: 'claude-fable-5-1',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Fable 5.1',\n\t\tname: 'Claude Fable 5.1',\n\t\tdescription:\n\t\t\t'most capable for demanding reasoning & long-horizon agents',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tFABLE_5: {\n\t\tid: 'claude-fable-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Fable 5',\n\t\tname: 'Claude Fable 5',\n\t\tdescription: 'prev Fable, still strong for deep reasoning & agents',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_5_5: {\n\t\tid: 'claude-opus-5-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 5.5',\n\t\tname: 'Claude Opus 5.5',\n\t\tdescription: 'most intelligent Opus for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_5: {\n\t\tid: 'claude-opus-5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 5',\n\t\tname: 'Claude Opus 5',\n\t\tdescription: 'prev flagship, still strong for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_4_8: {\n\t\tid: 'claude-opus-4-8',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 4.8',\n\t\tname: 'Claude Opus 4.8',\n\t\tdescription: 'older Opus, still strong for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tOPUS_4_7: {\n\t\tid: 'claude-opus-4-7',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Opus 4.7',\n\t\tname: 'Claude Opus 4.7',\n\t\tdescription: 'older Opus, still strong for agents and coding',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_000_000,\n\t},\n\tHAIKU_4_5: {\n\t\tid: 'claude-haiku-4-5-20251001',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'anthropic',\n\t\tspec: 'chatComplete',\n\t\tlabel: 'Claude Haiku 4.5',\n\t\tname: 'Claude Haiku 4.5',\n\t\tdescription: 'fastest & most compact, great for quick tasks',\n\t\tcontextWindow: 200_000,\n\t},\n} as const satisfies Record<string, AnthropicModelOption>;\n\n/** Canonical Anthropic model ids, in catalog order. */\nexport const ANTHROPIC_MODEL_IDS: readonly string[] = Object.values(\n\tANTHROPIC_MODEL_OPTIONS,\n).map(option => option.id);\n\n// Deprecated / undated aliases → canonical id (verbatim from harness known-models\n// DEPRECATED_MODEL_MIGRATIONS — every entry there is an Anthropic id, so the whole map lives\n// here now). Keys are lowercase and matched case-insensitively by consumers.\nexport const ANTHROPIC_DEPRECATED_MODEL_ALIASES: Readonly<\n\tRecord<string, string>\n> = {\n\t'claude-sonnet-4-20250514': 'claude-sonnet-4-6',\n\t'claude-sonnet-4-5-20250929': 'claude-sonnet-4-6',\n\t'claude-opus-4-5-20251101': 'claude-opus-4-7',\n\t'claude-opus-4-6': 'claude-opus-4-7',\n\t// Undated alias for the Haiku 4.5 dated snapshot.\n\t'claude-haiku-4-5': 'claude-haiku-4-5-20251001',\n};\n\n/**\n * Does an id look like an Anthropic model (including BYO/dated ids the catalog doesn't list)?\n * This is the predicate that used to live inline in the harness model client\n * (`model.includes('claude')`) to decide interleaved-thinking finalization — provider heuristics\n * belong to the provider.\n */\nexport function matchesAnthropicModel(modelId: string): boolean {\n\treturn modelId.toLowerCase().includes('claude');\n}\n\n/**\n * Harness ModelSpec-shaped catalog (structural — the harness validates on registration). Declares\n * interleaved thinking for every Anthropic model so the core model client needs no 'claude'\n * string of its own.\n */\nexport const ANTHROPIC_MODEL_SPECS = Object.values(ANTHROPIC_MODEL_OPTIONS).map(\n\toption => ({\n\t\tid: option.id,\n\t\tprovider: 'anthropic' as const,\n\t\tcontextWindow: option.contextWindow,\n\t\treasoningEfforts:\n\t\t\t'reasoningEfforts' in option ? option.reasoningEfforts : undefined,\n\t\tinputModalities: option.inputModalities,\n\t\tinterleavedThinking: true,\n\t}),\n);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