@codeworksh/aikit 0.7.2 → 0.8.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/cli.mjs +5 -5
- package/cli.mjs.map +1 -1
- package/{codex-DyQHzQmn.mjs → codex-MtP1574D.mjs} +63 -50
- package/codex-MtP1574D.mjs.map +1 -0
- package/{failure-C0lCOdFE.d.mts → failure-5Wjd-qFH.d.mts} +6 -2
- package/{failure-xra3YPdY.mjs → failure-SAPyG-w2.mjs} +8 -77
- package/failure-SAPyG-w2.mjs.map +1 -0
- package/index.d.mts +120 -3898
- package/index.mjs +490 -559
- package/index.mjs.map +1 -1
- package/llm/failure.d.mts +1 -1
- package/llm/failure.mjs +2 -1
- package/model-CBnredXj.mjs +453 -0
- package/model-CBnredXj.mjs.map +1 -0
- package/{model-CKKq3s4y.d.mts → model-CpX11Oob.d.mts} +126 -46
- package/{modelgen-xolcfdfT.mjs → modelgen-BjSsusLQ.mjs} +78 -5
- package/modelgen-BjSsusLQ.mjs.map +1 -0
- package/modelgen.d.mts +1 -1
- package/modelgen.mjs +1 -1
- package/oauth/openai/codex.mjs +1 -1
- package/openai-codex-BRH4Qa7l.mjs +2 -0
- package/{openai-codex-_3XkJ4bs.mjs → openai-codex-t4B7g-gv.mjs} +542 -105
- package/openai-codex-t4B7g-gv.mjs.map +1 -0
- package/package.json +2 -2
- package/registry-DYdYTwFt.mjs +65 -0
- package/registry-DYdYTwFt.mjs.map +1 -0
- package/schema-rXSoWhic.mjs +80 -0
- package/schema-rXSoWhic.mjs.map +1 -0
- package/codex-DyQHzQmn.mjs.map +0 -1
- package/failure-xra3YPdY.mjs.map +0 -1
- package/modelgen-xolcfdfT.mjs.map +0 -1
- package/openai-codex-FcyE8vxh.mjs +0 -2
- package/openai-codex-_3XkJ4bs.mjs.map +0 -1
- package/registry-DHskX4NP.mjs +0 -5266
- package/registry-DHskX4NP.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Type$1, { Static
|
|
1
|
+
import Type$1, { Static } from "typebox";
|
|
2
2
|
//#region src/model/catalog.d.ts
|
|
3
3
|
declare const KnownProviderEnum$1: {
|
|
4
4
|
readonly anthropic: "anthropic";
|
|
@@ -51,11 +51,11 @@ declare const ModelCatalogLoadError$1: {
|
|
|
51
51
|
};
|
|
52
52
|
message: string;
|
|
53
53
|
stack?: string;
|
|
54
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
55
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
54
56
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
55
57
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
56
58
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
57
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
58
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
59
59
|
};
|
|
60
60
|
readonly Schema: {
|
|
61
61
|
readonly $id: "ModelCatalogLoadError";
|
|
@@ -105,13 +105,13 @@ declare const ModelCatalogLoadError$1: {
|
|
|
105
105
|
};
|
|
106
106
|
message: string;
|
|
107
107
|
stack?: string;
|
|
108
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
109
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
108
110
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
109
111
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
110
112
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
111
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
112
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
113
113
|
};
|
|
114
|
-
create<Name extends string, Data extends
|
|
114
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): {
|
|
115
115
|
new (data: import("typebox").StaticType<[], "Encode", {}, {}, Data>, options?: ErrorOptions): {
|
|
116
116
|
cause?: unknown;
|
|
117
117
|
readonly name: Name;
|
|
@@ -133,11 +133,11 @@ declare const ModelCatalogLoadError$1: {
|
|
|
133
133
|
};
|
|
134
134
|
message: string;
|
|
135
135
|
stack?: string;
|
|
136
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
137
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
136
138
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
137
139
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
138
140
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
139
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
140
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
141
141
|
};
|
|
142
142
|
readonly Schema: {
|
|
143
143
|
readonly $id: Name;
|
|
@@ -151,7 +151,7 @@ declare const ModelCatalogLoadError$1: {
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
isInstance(input: unknown): input is InstanceType< /*elided*/ any>;
|
|
154
|
-
create<Name extends string, Data extends
|
|
154
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): /*elided*/ any;
|
|
155
155
|
readonly Unknown: {
|
|
156
156
|
new (data: {
|
|
157
157
|
message?: unknown;
|
|
@@ -188,11 +188,11 @@ declare const ModelCatalogLoadError$1: {
|
|
|
188
188
|
};
|
|
189
189
|
message: string;
|
|
190
190
|
stack?: string;
|
|
191
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
192
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
191
193
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
192
194
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
193
195
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
194
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
195
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
196
196
|
};
|
|
197
197
|
readonly Schema: {
|
|
198
198
|
readonly $id: "UnknownError";
|
|
@@ -246,13 +246,13 @@ declare const ModelCatalogLoadError$1: {
|
|
|
246
246
|
};
|
|
247
247
|
message: string;
|
|
248
248
|
stack?: string;
|
|
249
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
250
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
249
251
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
250
252
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
251
253
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
252
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
253
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
254
254
|
};
|
|
255
|
-
create<Name extends string, Data extends
|
|
255
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): /*elided*/ any;
|
|
256
256
|
readonly Unknown: /*elided*/ any;
|
|
257
257
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
258
258
|
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
@@ -298,11 +298,11 @@ declare const ModelCatalogLoadError$1: {
|
|
|
298
298
|
};
|
|
299
299
|
message: string;
|
|
300
300
|
stack?: string;
|
|
301
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
302
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
301
303
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
302
304
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
303
305
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
304
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
305
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
306
306
|
};
|
|
307
307
|
readonly Schema: {
|
|
308
308
|
readonly $id: "UnknownError";
|
|
@@ -356,13 +356,13 @@ declare const ModelCatalogLoadError$1: {
|
|
|
356
356
|
};
|
|
357
357
|
message: string;
|
|
358
358
|
stack?: string;
|
|
359
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
360
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
359
361
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
360
362
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
361
363
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
362
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
363
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
364
364
|
};
|
|
365
|
-
create<Name extends string, Data extends
|
|
365
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): {
|
|
366
366
|
new (data: import("typebox").StaticType<[], "Encode", {}, {}, Data>, options?: ErrorOptions): {
|
|
367
367
|
cause?: unknown;
|
|
368
368
|
readonly name: Name;
|
|
@@ -384,11 +384,11 @@ declare const ModelCatalogLoadError$1: {
|
|
|
384
384
|
};
|
|
385
385
|
message: string;
|
|
386
386
|
stack?: string;
|
|
387
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
388
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
387
389
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
388
390
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
389
391
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
390
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
391
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
392
392
|
};
|
|
393
393
|
readonly Schema: {
|
|
394
394
|
readonly $id: Name;
|
|
@@ -402,7 +402,7 @@ declare const ModelCatalogLoadError$1: {
|
|
|
402
402
|
};
|
|
403
403
|
};
|
|
404
404
|
isInstance(input: unknown): input is InstanceType< /*elided*/ any>;
|
|
405
|
-
create<Name extends string, Data extends
|
|
405
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): /*elided*/ any;
|
|
406
406
|
readonly Unknown: /*elided*/ any;
|
|
407
407
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
408
408
|
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
@@ -419,7 +419,7 @@ declare const ModelCatalogLoadError$1: {
|
|
|
419
419
|
};
|
|
420
420
|
type ModelCatalogLoadError$1 = InstanceType<typeof ModelCatalogLoadError$1>;
|
|
421
421
|
declare namespace model_d_exports {
|
|
422
|
-
export { APIMetadata, APIMetadataSchema, APIMethodEnum, APIMethodEnumSchema, ActiveThinkingLevel, BuiltInModels, Compatibility, CompatibilitySchema, ExtrasSchema, Info, KnownProviderEnum, KnownProviderEnumSchema, ModelCatalogLoadError, ProviderInfo, ProviderToProtocol, Schema, TModel, ThinkingLevel, ThinkingLevelEnum, ThinkingLevelMap, ThinkingLevelMapSchema, calculateCost, clampThinkingLevel, getBuiltInModels, getModel, getModels, getProviders, getSupportedThinkingLevels, modelsAreEqual, normalizeInput, registry, supportsProtocol };
|
|
422
|
+
export { APIMetadata, APIMetadataSchema, APIMethodEnum, APIMethodEnumSchema, ActiveThinkingLevel, BuiltInModels, Compatibility, CompatibilitySchema, ExtrasSchema, Info, KnownProviderEnum, KnownProviderEnumSchema, ModelCatalogLoadError, ProviderInfo, ProviderToProtocol, Schema, TModel, ThinkingBudgets, ThinkingLevel, ThinkingLevelEnum, ThinkingLevelMap, ThinkingLevelMapSchema, calculateCost, clampThinkingLevel, getBuiltInModels, getModel, getModels, getProviders, getSupportedThinkingLevels, modelsAreEqual, normalizeInput, optionsKey, registry, supportsProtocol, thinkingTokenBudgetField };
|
|
423
423
|
}
|
|
424
424
|
declare const KnownProviderEnum: {
|
|
425
425
|
readonly anthropic: "anthropic";
|
|
@@ -472,11 +472,11 @@ declare const ModelCatalogLoadError: {
|
|
|
472
472
|
};
|
|
473
473
|
message: string;
|
|
474
474
|
stack?: string;
|
|
475
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
476
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
475
477
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
476
478
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
477
479
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
478
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
479
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
480
480
|
};
|
|
481
481
|
readonly Schema: {
|
|
482
482
|
readonly $id: "ModelCatalogLoadError";
|
|
@@ -526,13 +526,13 @@ declare const ModelCatalogLoadError: {
|
|
|
526
526
|
};
|
|
527
527
|
message: string;
|
|
528
528
|
stack?: string;
|
|
529
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
530
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
529
531
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
530
532
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
531
533
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
532
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
533
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
534
534
|
};
|
|
535
|
-
create<Name extends string, Data extends
|
|
535
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): {
|
|
536
536
|
new (data: import("typebox").StaticType<[], "Encode", {}, {}, Data>, options?: ErrorOptions): {
|
|
537
537
|
cause?: unknown;
|
|
538
538
|
readonly name: Name;
|
|
@@ -554,11 +554,11 @@ declare const ModelCatalogLoadError: {
|
|
|
554
554
|
};
|
|
555
555
|
message: string;
|
|
556
556
|
stack?: string;
|
|
557
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
558
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
557
559
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
558
560
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
559
561
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
560
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
561
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
562
562
|
};
|
|
563
563
|
readonly Schema: {
|
|
564
564
|
readonly $id: Name;
|
|
@@ -572,7 +572,7 @@ declare const ModelCatalogLoadError: {
|
|
|
572
572
|
};
|
|
573
573
|
};
|
|
574
574
|
isInstance(input: unknown): input is InstanceType< /*elided*/ any>;
|
|
575
|
-
create<Name extends string, Data extends
|
|
575
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): /*elided*/ any;
|
|
576
576
|
readonly Unknown: {
|
|
577
577
|
new (data: {
|
|
578
578
|
message?: unknown;
|
|
@@ -609,11 +609,11 @@ declare const ModelCatalogLoadError: {
|
|
|
609
609
|
};
|
|
610
610
|
message: string;
|
|
611
611
|
stack?: string;
|
|
612
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
613
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
612
614
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
613
615
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
614
616
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
615
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
616
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
617
617
|
};
|
|
618
618
|
readonly Schema: {
|
|
619
619
|
readonly $id: "UnknownError";
|
|
@@ -667,13 +667,13 @@ declare const ModelCatalogLoadError: {
|
|
|
667
667
|
};
|
|
668
668
|
message: string;
|
|
669
669
|
stack?: string;
|
|
670
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
671
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
670
672
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
671
673
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
672
674
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
673
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
674
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
675
675
|
};
|
|
676
|
-
create<Name extends string, Data extends
|
|
676
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): /*elided*/ any;
|
|
677
677
|
readonly Unknown: /*elided*/ any;
|
|
678
678
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
679
679
|
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
@@ -719,11 +719,11 @@ declare const ModelCatalogLoadError: {
|
|
|
719
719
|
};
|
|
720
720
|
message: string;
|
|
721
721
|
stack?: string;
|
|
722
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
723
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
722
724
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
723
725
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
724
726
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
725
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
726
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
727
727
|
};
|
|
728
728
|
readonly Schema: {
|
|
729
729
|
readonly $id: "UnknownError";
|
|
@@ -777,13 +777,13 @@ declare const ModelCatalogLoadError: {
|
|
|
777
777
|
};
|
|
778
778
|
message: string;
|
|
779
779
|
stack?: string;
|
|
780
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
781
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
780
782
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
781
783
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
782
784
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
783
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
784
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
785
785
|
};
|
|
786
|
-
create<Name extends string, Data extends
|
|
786
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): {
|
|
787
787
|
new (data: import("typebox").StaticType<[], "Encode", {}, {}, Data>, options?: ErrorOptions): {
|
|
788
788
|
cause?: unknown;
|
|
789
789
|
readonly name: Name;
|
|
@@ -805,11 +805,11 @@ declare const ModelCatalogLoadError: {
|
|
|
805
805
|
};
|
|
806
806
|
message: string;
|
|
807
807
|
stack?: string;
|
|
808
|
+
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
809
|
+
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
808
810
|
readonly "~effect/ErrorReporter/ignore"?: boolean;
|
|
809
811
|
readonly "~effect/ErrorReporter/severity"?: import("effect/LogLevel").Severity;
|
|
810
812
|
readonly "~effect/ErrorReporter/attributes"?: import("effect/Record").ReadonlyRecord<string, unknown>;
|
|
811
|
-
readonly "~effect/Runtime/errorExitCode"?: number;
|
|
812
|
-
readonly "~effect/Runtime/errorReported"?: boolean;
|
|
813
813
|
};
|
|
814
814
|
readonly Schema: {
|
|
815
815
|
readonly $id: Name;
|
|
@@ -823,7 +823,7 @@ declare const ModelCatalogLoadError: {
|
|
|
823
823
|
};
|
|
824
824
|
};
|
|
825
825
|
isInstance(input: unknown): input is InstanceType< /*elided*/ any>;
|
|
826
|
-
create<Name extends string, Data extends
|
|
826
|
+
create<Name extends string, Data extends Type$1.TSchema>(name: Name, data: Data): /*elided*/ any;
|
|
827
827
|
readonly Unknown: /*elided*/ any;
|
|
828
828
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
829
829
|
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
@@ -852,6 +852,15 @@ declare const ThinkingLevel: Type$1.TUnion<[Type$1.TLiteral<"off">, Type$1.TLite
|
|
|
852
852
|
type ThinkingLevel = Static<typeof ThinkingLevel>;
|
|
853
853
|
declare const ActiveThinkingLevel: Type$1.TUnion<[Type$1.TLiteral<"minimal">, Type$1.TLiteral<"low">, Type$1.TLiteral<"medium">, Type$1.TLiteral<"high">, Type$1.TLiteral<"xhigh">, Type$1.TLiteral<"max">]>;
|
|
854
854
|
type ActiveThinkingLevel = Static<typeof ActiveThinkingLevel>;
|
|
855
|
+
declare const ThinkingBudgets: Type$1.TObject<{
|
|
856
|
+
high: Type$1.TOptional<Type$1.TNumber>;
|
|
857
|
+
low: Type$1.TOptional<Type$1.TNumber>;
|
|
858
|
+
max: Type$1.TOptional<Type$1.TNumber>;
|
|
859
|
+
medium: Type$1.TOptional<Type$1.TNumber>;
|
|
860
|
+
minimal: Type$1.TOptional<Type$1.TNumber>;
|
|
861
|
+
xhigh: Type$1.TOptional<Type$1.TNumber>;
|
|
862
|
+
}>;
|
|
863
|
+
type ThinkingBudgets = Static<typeof ThinkingBudgets>;
|
|
855
864
|
declare const ProviderInfo: Type$1.TObject<{
|
|
856
865
|
id: Type$1.TString;
|
|
857
866
|
name: Type$1.TString;
|
|
@@ -888,10 +897,18 @@ declare const ThinkingLevelMapSchema: Type$1.TObject<{
|
|
|
888
897
|
}>;
|
|
889
898
|
type ThinkingLevelMap = Static<typeof ThinkingLevelMapSchema>;
|
|
890
899
|
declare const CompatibilitySchema: Type$1.TObject<{
|
|
900
|
+
/** The Google protocol accepts thinking levels rather than a token budget. */
|
|
901
|
+
supportsThinkingLevel: Type$1.TOptional<Type$1.TBoolean>;
|
|
891
902
|
supportsToolSearch: Type$1.TOptional<Type$1.TBoolean>;
|
|
892
903
|
supportsAdditionalTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
893
904
|
supportsStrictMode: Type$1.TOptional<Type$1.TBoolean>;
|
|
894
905
|
supportsOpenAIGrammarTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
906
|
+
/** The model takes a thinking-token budget as a top-level request field. */
|
|
907
|
+
supportsThinkingTokenBudget: Type$1.TOptional<Type$1.TBoolean>;
|
|
908
|
+
/** Claude model that sizes its own thinking, driven by `effort` instead of a token budget. */
|
|
909
|
+
forceAdaptiveThinking: Type$1.TOptional<Type$1.TBoolean>;
|
|
910
|
+
/** Name of that field, when it is not the conventional `thinking_token_budget`. */
|
|
911
|
+
thinkingTokenBudgetField: Type$1.TOptional<Type$1.TString>;
|
|
895
912
|
}>;
|
|
896
913
|
type Compatibility = Static<typeof CompatibilitySchema>;
|
|
897
914
|
declare const Schema: Type$1.TObject<{
|
|
@@ -916,6 +933,15 @@ declare const Schema: Type$1.TObject<{
|
|
|
916
933
|
off: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
917
934
|
xhigh: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
918
935
|
}>>;
|
|
936
|
+
/** Default budgets; request-level thinkingBudgets take precedence. */
|
|
937
|
+
thinkingBudgets: Type$1.TOptional<Type$1.TObject<{
|
|
938
|
+
high: Type$1.TOptional<Type$1.TNumber>;
|
|
939
|
+
low: Type$1.TOptional<Type$1.TNumber>;
|
|
940
|
+
max: Type$1.TOptional<Type$1.TNumber>;
|
|
941
|
+
medium: Type$1.TOptional<Type$1.TNumber>;
|
|
942
|
+
minimal: Type$1.TOptional<Type$1.TNumber>;
|
|
943
|
+
xhigh: Type$1.TOptional<Type$1.TNumber>;
|
|
944
|
+
}>>;
|
|
919
945
|
input: Type$1.TArray<Type$1.TUnion<[Type$1.TLiteral<"text">, Type$1.TLiteral<"image">]>>;
|
|
920
946
|
cost: Type$1.TObject<{
|
|
921
947
|
input: Type$1.TNumber;
|
|
@@ -929,6 +955,7 @@ declare const Schema: Type$1.TObject<{
|
|
|
929
955
|
cacheWrite: Type$1.TNumber;
|
|
930
956
|
inputTokensAbove: Type$1.TNumber;
|
|
931
957
|
}>>>;
|
|
958
|
+
serviceTierMultipliers: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TNumber>>;
|
|
932
959
|
}>;
|
|
933
960
|
contextWindow: Type$1.TNumber;
|
|
934
961
|
maxTokens: Type$1.TNumber;
|
|
@@ -943,10 +970,18 @@ declare const Schema: Type$1.TObject<{
|
|
|
943
970
|
options: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TUnknown>>;
|
|
944
971
|
providerOptions: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TUnknown>>;
|
|
945
972
|
compat: Type$1.TOptional<Type$1.TObject<{
|
|
973
|
+
/** The Google protocol accepts thinking levels rather than a token budget. */
|
|
974
|
+
supportsThinkingLevel: Type$1.TOptional<Type$1.TBoolean>;
|
|
946
975
|
supportsToolSearch: Type$1.TOptional<Type$1.TBoolean>;
|
|
947
976
|
supportsAdditionalTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
948
977
|
supportsStrictMode: Type$1.TOptional<Type$1.TBoolean>;
|
|
949
978
|
supportsOpenAIGrammarTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
979
|
+
/** The model takes a thinking-token budget as a top-level request field. */
|
|
980
|
+
supportsThinkingTokenBudget: Type$1.TOptional<Type$1.TBoolean>;
|
|
981
|
+
/** Claude model that sizes its own thinking, driven by `effort` instead of a token budget. */
|
|
982
|
+
forceAdaptiveThinking: Type$1.TOptional<Type$1.TBoolean>;
|
|
983
|
+
/** Name of that field, when it is not the conventional `thinking_token_budget`. */
|
|
984
|
+
thinkingTokenBudgetField: Type$1.TOptional<Type$1.TString>;
|
|
950
985
|
}>>;
|
|
951
986
|
protocol: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
952
987
|
supportedProtocols: Type$1.TOptional<Type$1.TObject<{
|
|
@@ -984,6 +1019,14 @@ declare const Info: Type$1.TObject<{
|
|
|
984
1019
|
off: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
985
1020
|
xhigh: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
986
1021
|
}>>;
|
|
1022
|
+
thinkingBudgets: Type$1.TOptional<Type$1.TObject<{
|
|
1023
|
+
high: Type$1.TOptional<Type$1.TNumber>;
|
|
1024
|
+
low: Type$1.TOptional<Type$1.TNumber>;
|
|
1025
|
+
max: Type$1.TOptional<Type$1.TNumber>;
|
|
1026
|
+
medium: Type$1.TOptional<Type$1.TNumber>;
|
|
1027
|
+
minimal: Type$1.TOptional<Type$1.TNumber>;
|
|
1028
|
+
xhigh: Type$1.TOptional<Type$1.TNumber>;
|
|
1029
|
+
}>>;
|
|
987
1030
|
input: Type$1.TArray<Type$1.TUnion<[Type$1.TLiteral<"text">, Type$1.TLiteral<"image">]>>;
|
|
988
1031
|
cost: Type$1.TObject<{
|
|
989
1032
|
input: Type$1.TNumber;
|
|
@@ -997,6 +1040,7 @@ declare const Info: Type$1.TObject<{
|
|
|
997
1040
|
cacheWrite: Type$1.TNumber;
|
|
998
1041
|
inputTokensAbove: Type$1.TNumber;
|
|
999
1042
|
}>>>;
|
|
1043
|
+
serviceTierMultipliers: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TNumber>>;
|
|
1000
1044
|
}>;
|
|
1001
1045
|
contextWindow: Type$1.TNumber;
|
|
1002
1046
|
maxTokens: Type$1.TNumber;
|
|
@@ -1011,10 +1055,18 @@ declare const Info: Type$1.TObject<{
|
|
|
1011
1055
|
options: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TUnknown>>;
|
|
1012
1056
|
providerOptions: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TUnknown>>;
|
|
1013
1057
|
compat: Type$1.TOptional<Type$1.TObject<{
|
|
1058
|
+
/** The Google protocol accepts thinking levels rather than a token budget. */
|
|
1059
|
+
supportsThinkingLevel: Type$1.TOptional<Type$1.TBoolean>;
|
|
1014
1060
|
supportsToolSearch: Type$1.TOptional<Type$1.TBoolean>;
|
|
1015
1061
|
supportsAdditionalTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
1016
1062
|
supportsStrictMode: Type$1.TOptional<Type$1.TBoolean>;
|
|
1017
1063
|
supportsOpenAIGrammarTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
1064
|
+
/** The model takes a thinking-token budget as a top-level request field. */
|
|
1065
|
+
supportsThinkingTokenBudget: Type$1.TOptional<Type$1.TBoolean>;
|
|
1066
|
+
/** Claude model that sizes its own thinking, driven by `effort` instead of a token budget. */
|
|
1067
|
+
forceAdaptiveThinking: Type$1.TOptional<Type$1.TBoolean>;
|
|
1068
|
+
/** Name of that field, when it is not the conventional `thinking_token_budget`. */
|
|
1069
|
+
thinkingTokenBudgetField: Type$1.TOptional<Type$1.TString>;
|
|
1018
1070
|
}>>;
|
|
1019
1071
|
protocol: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
1020
1072
|
supportedProtocols: Type$1.TOptional<Type$1.TObject<{
|
|
@@ -1038,6 +1090,7 @@ declare function calculateCost(model: Info, usage: {
|
|
|
1038
1090
|
output: number;
|
|
1039
1091
|
cacheRead: number;
|
|
1040
1092
|
cacheWrite: number;
|
|
1093
|
+
cacheWrite1h?: number;
|
|
1041
1094
|
cost: {
|
|
1042
1095
|
input: number;
|
|
1043
1096
|
output: number;
|
|
@@ -1072,6 +1125,14 @@ declare const registry: {
|
|
|
1072
1125
|
off?: string | null;
|
|
1073
1126
|
xhigh?: string | null;
|
|
1074
1127
|
};
|
|
1128
|
+
thinkingBudgets?: {
|
|
1129
|
+
high?: number;
|
|
1130
|
+
low?: number;
|
|
1131
|
+
max?: number;
|
|
1132
|
+
medium?: number;
|
|
1133
|
+
minimal?: number;
|
|
1134
|
+
xhigh?: number;
|
|
1135
|
+
};
|
|
1075
1136
|
input: ("image" | "text")[];
|
|
1076
1137
|
cost: {
|
|
1077
1138
|
input: number;
|
|
@@ -1085,6 +1146,7 @@ declare const registry: {
|
|
|
1085
1146
|
cacheWrite: number;
|
|
1086
1147
|
inputTokensAbove: number;
|
|
1087
1148
|
}[];
|
|
1149
|
+
serviceTierMultipliers?: Record<string, number>;
|
|
1088
1150
|
};
|
|
1089
1151
|
contextWindow: number;
|
|
1090
1152
|
maxTokens: number;
|
|
@@ -1099,10 +1161,14 @@ declare const registry: {
|
|
|
1099
1161
|
options?: Record<string, unknown>;
|
|
1100
1162
|
providerOptions?: Record<string, unknown>;
|
|
1101
1163
|
compat?: {
|
|
1164
|
+
supportsThinkingLevel?: boolean;
|
|
1102
1165
|
supportsToolSearch?: boolean;
|
|
1103
1166
|
supportsAdditionalTools?: boolean;
|
|
1104
1167
|
supportsStrictMode?: boolean;
|
|
1105
1168
|
supportsOpenAIGrammarTools?: boolean;
|
|
1169
|
+
supportsThinkingTokenBudget?: boolean;
|
|
1170
|
+
forceAdaptiveThinking?: boolean;
|
|
1171
|
+
thinkingTokenBudgetField?: string;
|
|
1106
1172
|
};
|
|
1107
1173
|
protocol: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1108
1174
|
supportedProtocols?: {
|
|
@@ -1119,6 +1185,20 @@ declare const registry: {
|
|
|
1119
1185
|
}>>>;
|
|
1120
1186
|
reset: () => void;
|
|
1121
1187
|
};
|
|
1188
|
+
/**
|
|
1189
|
+
* The key a provider's own option bag is filed under.
|
|
1190
|
+
*
|
|
1191
|
+
* Providers that speak another provider's protocol still carry their own option
|
|
1192
|
+
* namespace, so this is not always the protocol.
|
|
1193
|
+
*/
|
|
1194
|
+
/**
|
|
1195
|
+
* The request-body field a model takes its thinking-token budget in, if any.
|
|
1196
|
+
*
|
|
1197
|
+
* OpenAI-compatible endpoints have no standard place for this, so each one names
|
|
1198
|
+
* its own field; a bare `supportsThinkingTokenBudget` means the conventional name.
|
|
1199
|
+
*/
|
|
1200
|
+
declare function thinkingTokenBudgetField(model: Info): string | undefined;
|
|
1201
|
+
declare function optionsKey(model: Info): string;
|
|
1122
1202
|
declare function supportsProtocol(model: Info, protocol: KnownProviderEnum): boolean;
|
|
1123
1203
|
type ProviderToProtocol<TProvider extends string> = TProvider extends KnownProviderEnum ? TProvider : KnownProviderEnum;
|
|
1124
1204
|
declare function getModel<TProvider extends string, TProtocol extends KnownProviderEnum = ProviderToProtocol<TProvider>>(provider: TProvider, model: string, overrides?: Partial<Info> & {
|
|
@@ -1134,5 +1214,5 @@ declare function modelsAreEqual(a: Info | null | undefined, b: Info | null | und
|
|
|
1134
1214
|
declare function getSupportedThinkingLevels<TProtocol extends KnownProviderEnum>(model: TModel<TProtocol>): ThinkingLevel[];
|
|
1135
1215
|
declare function clampThinkingLevel<TProtocol extends KnownProviderEnum>(model: TModel<TProtocol>, level: ThinkingLevel): ThinkingLevel;
|
|
1136
1216
|
//#endregion
|
|
1137
|
-
export {
|
|
1138
|
-
//# sourceMappingURL=model-
|
|
1217
|
+
export { KnownProviderEnum as a, ThinkingBudgets as c, getProviders as d, model_d_exports as f, Info as i, getModel as l, registry as m, ActiveThinkingLevel as n, ProviderToProtocol as o, modelsAreEqual as p, Compatibility as r, TModel as s, APIMethodEnum as t, getModels as u };
|
|
1218
|
+
//# sourceMappingURL=model-CpX11Oob.d.mts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { C as lazy,
|
|
1
|
+
import { C as lazy, b as readJson, h as normalizeInput, i as KnownProviderEnum, t as APIMethodEnum, x as writeJson, y as path } from "./model-CBnredXj.mjs";
|
|
2
|
+
import { a as protocolForPackage, n as isAISDKPackage } from "./registry-DYdYTwFt.mjs";
|
|
2
3
|
import { resolve } from "node:path";
|
|
3
4
|
import { mapValues, pickBy, pipe } from "remeda";
|
|
4
5
|
//#region src/cli/modelgen.ts
|
|
@@ -74,7 +75,79 @@ function mergeThinkingLevelMap(model, map) {
|
|
|
74
75
|
...map
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Claude models that decide their own thinking depth.
|
|
80
|
+
*
|
|
81
|
+
* These take an `effort` level and let the model size each turn's reasoning; the
|
|
82
|
+
* older models take a fixed `budget_tokens` instead. Sending a budget to an
|
|
83
|
+
* adaptive model pins it to one depth for every turn, which is the thing adaptive
|
|
84
|
+
* thinking exists to avoid.
|
|
85
|
+
*/
|
|
86
|
+
function isAnthropicAdaptiveThinkingModel(modelId) {
|
|
87
|
+
return [
|
|
88
|
+
"opus-4-6",
|
|
89
|
+
"opus-4.6",
|
|
90
|
+
"opus-4-7",
|
|
91
|
+
"opus-4.7",
|
|
92
|
+
"opus-4-8",
|
|
93
|
+
"opus-4.8",
|
|
94
|
+
"opus-5",
|
|
95
|
+
"opus.5",
|
|
96
|
+
"sonnet-4-6",
|
|
97
|
+
"sonnet-4.6",
|
|
98
|
+
"sonnet-5",
|
|
99
|
+
"sonnet.5",
|
|
100
|
+
"fable-5"
|
|
101
|
+
].some((needle) => modelId.includes(needle));
|
|
102
|
+
}
|
|
103
|
+
function mergeCompat(model, compat) {
|
|
104
|
+
model.compat = {
|
|
105
|
+
...model.compat,
|
|
106
|
+
...compat
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function applyGoogleThinkingMetadata(model) {
|
|
110
|
+
const id = model.id.toLowerCase();
|
|
111
|
+
const supportsThinkingLevel = /gemini-3(?:\.\d+)?-(?:pro|flash)|gemma-?4/.test(id) || id === "gemini-flash-latest" || id === "gemini-flash-lite-latest";
|
|
112
|
+
mergeCompat(model, { supportsThinkingLevel });
|
|
113
|
+
if (supportsThinkingLevel) return;
|
|
114
|
+
model.thinkingBudgets = [
|
|
115
|
+
["2.5-pro", {
|
|
116
|
+
minimal: 128,
|
|
117
|
+
low: 2048,
|
|
118
|
+
medium: 8192,
|
|
119
|
+
high: 32768
|
|
120
|
+
}],
|
|
121
|
+
["2.5-flash-lite", {
|
|
122
|
+
minimal: 512,
|
|
123
|
+
low: 2048,
|
|
124
|
+
medium: 8192,
|
|
125
|
+
high: 24576
|
|
126
|
+
}],
|
|
127
|
+
["2.5-flash", {
|
|
128
|
+
minimal: 128,
|
|
129
|
+
low: 2048,
|
|
130
|
+
medium: 8192,
|
|
131
|
+
high: 24576
|
|
132
|
+
}]
|
|
133
|
+
].find(([family]) => id.includes(family))?.[1] ?? {
|
|
134
|
+
minimal: -1,
|
|
135
|
+
low: -1,
|
|
136
|
+
medium: -1,
|
|
137
|
+
high: -1
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function applyModelMetadata(model) {
|
|
141
|
+
if (model.protocol === KnownProviderEnum.google || model.protocol === KnownProviderEnum.googleVertex) applyGoogleThinkingMetadata(model);
|
|
142
|
+
if (model.protocol === KnownProviderEnum.openai || model.protocol === KnownProviderEnum.openaiCodex) model.cost.serviceTierMultipliers = {
|
|
143
|
+
flex: .5,
|
|
144
|
+
priority: model.id === "gpt-5.5" ? 2.5 : 2
|
|
145
|
+
};
|
|
146
|
+
if ((model.protocol === KnownProviderEnum.google || model.protocol === KnownProviderEnum.googleVertex) && /gemini-3(?:\.\d+)?-pro|gemini-3\.[78]-flash/.test(model.id.toLowerCase())) mergeThinkingLevelMap(model, {
|
|
147
|
+
off: "low",
|
|
148
|
+
minimal: null
|
|
149
|
+
});
|
|
150
|
+
if ((model.protocol === KnownProviderEnum.anthropic || model.protocol === KnownProviderEnum.googleVertexAnthropic) && isAnthropicAdaptiveThinkingModel(model.id)) mergeCompat(model, { forceAdaptiveThinking: true });
|
|
78
151
|
if (model.protocol === KnownProviderEnum.openai && model.id.startsWith("gpt-5")) mergeThinkingLevelMap(model, { off: null });
|
|
79
152
|
if (model.protocol === KnownProviderEnum.openai && model.provider.id === "openai" && OPENAI_RESPONSES_NONE_REASONING_MODELS.has(model.id)) mergeThinkingLevelMap(model, { off: "none" });
|
|
80
153
|
if (supportsOpenAiXhigh(model)) mergeThinkingLevelMap(model, { xhigh: "xhigh" });
|
|
@@ -245,7 +318,7 @@ function openAICodexBuiltInModels() {
|
|
|
245
318
|
},
|
|
246
319
|
protocol: KnownProviderEnum.openaiCodex
|
|
247
320
|
};
|
|
248
|
-
|
|
321
|
+
applyModelMetadata(info);
|
|
249
322
|
models[seed.id] = info;
|
|
250
323
|
}
|
|
251
324
|
return models;
|
|
@@ -316,10 +389,10 @@ function applyModification(providerId, provider, model) {
|
|
|
316
389
|
protocol
|
|
317
390
|
};
|
|
318
391
|
if (Object.keys(info.headers ?? {}).length === 0) delete info.headers;
|
|
319
|
-
|
|
392
|
+
applyModelMetadata(info);
|
|
320
393
|
return info;
|
|
321
394
|
}
|
|
322
395
|
//#endregion
|
|
323
396
|
export { generateModels as n, ModelgenCommand as t };
|
|
324
397
|
|
|
325
|
-
//# sourceMappingURL=modelgen-
|
|
398
|
+
//# sourceMappingURL=modelgen-BjSsusLQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelgen-BjSsusLQ.mjs","names":["Filesystem.readJson","path","ModelCatalog.path","Filesystem.writeJson","Model.normalizeInput"],"sources":["../../src/cli/modelgen.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { mapValues, pickBy, pipe } from \"remeda\";\nimport type { CommandModule } from \"yargs\";\nimport { DEFAULT_AI_SDK_FALLBACK, isAISDKPackage, protocolForPackage } from \"../llm/registry.ts\";\nimport * as ModelCatalog from \"../model/catalog.ts\";\nimport * as Model from \"../model/model.ts\";\nimport * as Filesystem from \"../utils/filesystem.ts\";\nimport { lazy } from \"../utils/lazy.ts\";\n\nconst DEFAULT_PROVIDER_BASE_URLS: Partial<Record<Model.KnownProviderEnum, string>> = {\n\t[Model.KnownProviderEnum.anthropic]: \"https://api.anthropic.com/v1\",\n\t[Model.KnownProviderEnum.openai]: \"https://api.openai.com/v1\",\n\t[Model.KnownProviderEnum.openrouter]: \"https://openrouter.ai/api/v1\",\n\t[Model.KnownProviderEnum.xai]: \"https://api.x.ai/v1\",\n};\n\ninterface ModelsDevModel {\n\tid: string;\n\tname: string;\n\tfamily: string;\n\tattachment: boolean;\n\treasoning?: boolean;\n\ttool_call?: boolean;\n\ttemperature?: boolean;\n\tknowledge?: string | boolean;\n\trelease_date: string;\n\tlast_updated: string;\n\tmodalities: {\n\t\tinput?: string[];\n\t\toutput: string[];\n\t};\n\topen_weights: boolean;\n\tbaseUrl?: string;\n\theaders?: Record<string, string>;\n\tcost?: {\n\t\tinput?: number;\n\t\toutput?: number;\n\t\tcache_read?: number;\n\t\tcache_write?: number;\n\t};\n\tlimit?: {\n\t\tcontext?: number;\n\t\toutput?: number;\n\t};\n\tstructured_output?: boolean;\n\tprovider?: {\n\t\tnpm?: string;\n\t\tapi?: string;\n\t\theaders?: Record<string, string>;\n\t};\n}\n\ninterface ModelsDevProvider {\n\tid: string;\n\tenv: string[];\n\tnpm?: string;\n\tapi?: string;\n\tname: string;\n\tdoc?: string; // reference documentation link\n\tkey?: string; // runtime placeholder for api/oauth key\n\theaders?: Record<string, string>; // custom overrides at provider level\n\tmodels: Record<string, ModelsDevModel>;\n}\n\nexport type BuiltInModels = Model.BuiltInModels;\n\n// Doesn't represent the full spec from models.dev.\n// Represents the provider entries on a best-effort basis.\ntype ModelsDevCatalog = Record<string, ModelsDevProvider>;\ntype LazyModelsDevCatalog = ReturnType<typeof lazy<Promise<ModelsDevCatalog>>>;\n\nfunction modelsDevURL(): string {\n\treturn process.env.OPENCODE_MODELS_URL || \"https://models.dev\";\n}\n\nfunction modelsDevPath(): string | undefined {\n\treturn process.env.OPENCODE_MODELS_DEV_FILE;\n}\n\nconst modelsDevData: LazyModelsDevCatalog = lazy(async () => {\n\tconst path = modelsDevPath();\n\tif (path) {\n\t\tconst result = await Filesystem.readJson<ModelsDevCatalog>(path).catch(() => undefined);\n\t\tif (result) return result;\n\t}\n\n\tconst json = await fetch(`${modelsDevURL()}/api.json`).then((x) => x.text());\n\treturn JSON.parse(json) as ModelsDevCatalog;\n});\n\nasync function pullModelsDevData(): Promise<ModelsDevCatalog> {\n\treturn modelsDevData();\n}\n\nfunction toModelValue(providerId: string, provider: ModelsDevProvider, model: ModelsDevModel): Model.Info | undefined {\n\treturn applyModification(providerId, provider, model);\n}\n\nasync function loadBuiltInFromModelsDev() {\n\tconst catalog = await pullModelsDevData();\n\treturn pipe(\n\t\tcatalog,\n\t\tpickBy((provider) =>\n\t\t\tObject.values(provider.models).some(\n\t\t\t\t// If `resolveModelNpm` fallbacks to `@ai-sdk/openai-compatible`\n\t\t\t\t// isAISDKPakage will be truthy, modify resolveModelNpm for custom logic if needed.\n\t\t\t\t// Keep `isAISDKPackage` as readonly for supported implemenatations key check\n\t\t\t\t(model) => Boolean(model.tool_call) && isAISDKPackage(resolveModelNpm(provider, model)),\n\t\t\t),\n\t\t),\n\t\tmapValues((provider, providerId) =>\n\t\t\tpipe(\n\t\t\t\tprovider.models,\n\t\t\t\tpickBy((model) => Boolean(model.tool_call) && isAISDKPackage(resolveModelNpm(provider, model))),\n\t\t\t\tmapValues((model) => toModelValue(providerId, provider, model)),\n\t\t\t\tpickBy((model): model is Model.Info => model !== undefined),\n\t\t\t),\n\t\t),\n\t) as BuiltInModels;\n}\n\ntype ThinkingLevelMap = NonNullable<Model.Info[\"thinkingLevelMap\"]>;\n\nfunction resolveModelNpm(provider: ModelsDevProvider, model: ModelsDevModel): string {\n\treturn model.provider?.npm ?? provider.npm ?? DEFAULT_AI_SDK_FALLBACK;\n}\n\nfunction resolveModelBaseUrl(provider: ModelsDevProvider, model: ModelsDevModel): string {\n\tconst npm = resolveModelNpm(provider, model);\n\tconst protocol = protocolForPackage(npm);\n\treturn model.baseUrl ?? model.provider?.api ?? provider.api ?? DEFAULT_PROVIDER_BASE_URLS[protocol] ?? \"\";\n}\n\nfunction resolveModelAPIMethod(npm: string): Model.APIMethodEnum {\n\tconst protocol = protocolForPackage(npm);\n\t// `By default, xai(modelId) uses the Chat API.\n\t// To use the Responses API with server-side agentic tools, explicitly use xai.responses(modelId).`\n\t// References: https://ai-sdk.dev/providers/ai-sdk-providers/xai\n\tif (protocol === Model.KnownProviderEnum.openai || protocol === Model.KnownProviderEnum.xai) {\n\t\treturn Model.APIMethodEnum.responses;\n\t}\n\treturn Model.APIMethodEnum.languageModel;\n}\n\nfunction resolveProviderOptionsKey(protocol: Model.KnownProviderEnum): string {\n\tif (protocol === Model.KnownProviderEnum.openaiCompatible) return \"openai-compatible\";\n\tif (protocol === Model.KnownProviderEnum.googleVertex) return \"google-vertex\";\n\tif (protocol === Model.KnownProviderEnum.googleVertexAnthropic) return \"google-vertex-anthropic\";\n\treturn protocol;\n}\n\n//\n// adhoc helpers variations\nconst OPENAI_RESPONSES_NONE_REASONING_MODELS = new Set([\n\t\"gpt-5.1\",\n\t\"gpt-5.2\",\n\t\"gpt-5.3-codex\",\n\t\"gpt-5.4\",\n\t\"gpt-5.4-mini\",\n\t\"gpt-5.4-nano\",\n\t\"gpt-5.5\",\n]);\n\nfunction supportsOpenAiXhigh(model: Model.Info): boolean {\n\tconst modelId = model.id;\n\treturn (\n\t\tmodelId.includes(\"gpt-5.2\") ||\n\t\tmodelId.includes(\"gpt-5.3\") ||\n\t\tmodelId.includes(\"gpt-5.4\") ||\n\t\tmodelId.includes(\"gpt-5.5\") ||\n\t\t(model.protocol === Model.KnownProviderEnum.openaiCodex && modelId.includes(\"gpt-5.6\"))\n\t);\n}\n\nfunction supportsOpenAiCodexMax(model: Model.Info): boolean {\n\treturn model.protocol === Model.KnownProviderEnum.openaiCodex && model.id.includes(\"gpt-5.6\");\n}\n\nfunction mergeThinkingLevelMap(model: Model.Info, map: ThinkingLevelMap): void {\n\tmodel.thinkingLevelMap = { ...model.thinkingLevelMap, ...map };\n}\n\n/**\n * Claude models that decide their own thinking depth.\n *\n * These take an `effort` level and let the model size each turn's reasoning; the\n * older models take a fixed `budget_tokens` instead. Sending a budget to an\n * adaptive model pins it to one depth for every turn, which is the thing adaptive\n * thinking exists to avoid.\n */\nfunction isAnthropicAdaptiveThinkingModel(modelId: string): boolean {\n\treturn [\n\t\t\"opus-4-6\",\n\t\t\"opus-4.6\",\n\t\t\"opus-4-7\",\n\t\t\"opus-4.7\",\n\t\t\"opus-4-8\",\n\t\t\"opus-4.8\",\n\t\t\"opus-5\",\n\t\t\"opus.5\",\n\t\t\"sonnet-4-6\",\n\t\t\"sonnet-4.6\",\n\t\t\"sonnet-5\",\n\t\t\"sonnet.5\",\n\t\t\"fable-5\",\n\t].some((needle) => modelId.includes(needle));\n}\n\nfunction mergeCompat(model: Model.Info, compat: Model.Compatibility): void {\n\tmodel.compat = { ...model.compat, ...compat };\n}\n\nfunction applyGoogleThinkingMetadata(model: Model.Info): void {\n\tconst id = model.id.toLowerCase();\n\tconst supportsThinkingLevel =\n\t\t/gemini-3(?:\\.\\d+)?-(?:pro|flash)|gemma-?4/.test(id) ||\n\t\tid === \"gemini-flash-latest\" ||\n\t\tid === \"gemini-flash-lite-latest\";\n\tmergeCompat(model, { supportsThinkingLevel });\n\tif (supportsThinkingLevel) return;\n\n\t// Unknown budget-based families ask the provider to size thinking dynamically.\n\tconst defaults: Array<[string, Model.ThinkingBudgets]> = [\n\t\t[\"2.5-pro\", { minimal: 128, low: 2048, medium: 8192, high: 32768 }],\n\t\t[\"2.5-flash-lite\", { minimal: 512, low: 2048, medium: 8192, high: 24576 }],\n\t\t[\"2.5-flash\", { minimal: 128, low: 2048, medium: 8192, high: 24576 }],\n\t];\n\tmodel.thinkingBudgets = defaults.find(([family]) => id.includes(family))?.[1] ?? {\n\t\tminimal: -1,\n\t\tlow: -1,\n\t\tmedium: -1,\n\t\thigh: -1,\n\t};\n}\n\nfunction applyModelMetadata(model: Model.Info): void {\n\tif (model.protocol === Model.KnownProviderEnum.google || model.protocol === Model.KnownProviderEnum.googleVertex) {\n\t\tapplyGoogleThinkingMetadata(model);\n\t}\n\tif (model.protocol === Model.KnownProviderEnum.openai || model.protocol === Model.KnownProviderEnum.openaiCodex) {\n\t\tmodel.cost.serviceTierMultipliers = { flex: 0.5, priority: model.id === \"gpt-5.5\" ? 2.5 : 2 };\n\t}\n\tif (\n\t\t(model.protocol === Model.KnownProviderEnum.google || model.protocol === Model.KnownProviderEnum.googleVertex) &&\n\t\t/gemini-3(?:\\.\\d+)?-pro|gemini-3\\.[78]-flash/.test(model.id.toLowerCase())\n\t) {\n\t\t// These models cannot disable thinking or accept minimal. Expose supported\n\t\t// levels to callers and let the shared clamp promote minimal to low.\n\t\tmergeThinkingLevelMap(model, { off: \"low\", minimal: null });\n\t}\n\tif (\n\t\t(model.protocol === Model.KnownProviderEnum.anthropic ||\n\t\t\tmodel.protocol === Model.KnownProviderEnum.googleVertexAnthropic) &&\n\t\tisAnthropicAdaptiveThinkingModel(model.id)\n\t) {\n\t\tmergeCompat(model, { forceAdaptiveThinking: true });\n\t}\n\tif (model.protocol === Model.KnownProviderEnum.openai && model.id.startsWith(\"gpt-5\")) {\n\t\tmergeThinkingLevelMap(model, { off: null });\n\t}\n\tif (\n\t\tmodel.protocol === Model.KnownProviderEnum.openai &&\n\t\tmodel.provider.id === \"openai\" &&\n\t\tOPENAI_RESPONSES_NONE_REASONING_MODELS.has(model.id)\n\t) {\n\t\tmergeThinkingLevelMap(model, { off: \"none\" });\n\t}\n\tif (supportsOpenAiXhigh(model)) {\n\t\tmergeThinkingLevelMap(model, { xhigh: \"xhigh\" });\n\t}\n\tif (supportsOpenAiCodexMax(model)) {\n\t\tmergeThinkingLevelMap(model, { max: \"max\" });\n\t}\n\tif (model.id.includes(\"opus-4-6\") || model.id.includes(\"opus-4.6\")) {\n\t\tmergeThinkingLevelMap(model, { xhigh: \"max\" });\n\t}\n\tif (model.id.includes(\"opus-4-7\") || model.id.includes(\"opus-4.7\")) {\n\t\tmergeThinkingLevelMap(model, { xhigh: \"xhigh\" });\n\t}\n}\n\n//\n// OpenAI Codex (ChatGPT OAuth) models.\n// NOTE: These are not fetched from models.dev; we keep a small, explicit list to avoid aliases.\n// Context window is based on observed server limits (400s above ~272k), not marketing numbers.\nconst OPENAI_CODEX_PROVIDER_ID = \"openai-codex\";\nconst OPENAI_CODEX_NPM = \"@codeworksh/ai-sdk-openai-codex\";\nconst OPENAI_CODEX_BASE_URL = \"https://chatgpt.com/backend-api\";\nconst OPENAI_CODEX_CONTEXT = 272_000;\nconst OPENAI_CODEX_GPT_56_CONTEXT = 272_000;\nconst OPENAI_CODEX_SPARK_CONTEXT = 128_000;\nconst OPENAI_CODEX_MAX_TOKENS = 128_000;\nconst OPENAI_LONG_CONTEXT_INPUT_THRESHOLD = 272_000;\nconst OPENAI_CODEX_TOOL_SEARCH_MODEL_IDS = new Set([\n\t\"gpt-5.4\",\n\t\"gpt-5.4-mini\",\n\t\"gpt-5.5\",\n\t\"gpt-5.6-luna\",\n\t\"gpt-5.6-sol\",\n\t\"gpt-5.6-terra\",\n]);\nconst OPENAI_CODEX_ADDITIONAL_TOOLS_MODEL_IDS = new Set([\"gpt-5.6-luna\", \"gpt-5.6-sol\", \"gpt-5.6-terra\"]);\n\ntype OpenAICodexModelSeed = Pick<Model.Info, \"id\" | \"name\" | \"input\" | \"cost\" | \"contextWindow\" | \"thinkingLevelMap\">;\n\nfunction roundCost(value: number): number {\n\treturn Number(value.toFixed(6));\n}\n\nfunction withOpenAiLongContextPricing(cost: Model.Info[\"cost\"]): Model.Info[\"cost\"] {\n\treturn {\n\t\t...cost,\n\t\ttiers: [\n\t\t\t{\n\t\t\t\tinputTokensAbove: OPENAI_LONG_CONTEXT_INPUT_THRESHOLD,\n\t\t\t\tinput: roundCost(cost.input * 2),\n\t\t\t\toutput: roundCost(cost.output * 1.5),\n\t\t\t\tcacheRead: roundCost(cost.cacheRead * 2),\n\t\t\t\tcacheWrite: roundCost(cost.cacheWrite * 2),\n\t\t\t},\n\t\t],\n\t};\n}\n\nconst OPENAI_CODEX_GPT_56_COSTS = {\n\t\"gpt-5.6-luna\": { input: 0.2, output: 1.2, cacheRead: 0.02, cacheWrite: 0.25 },\n\t\"gpt-5.6-terra\": { input: 2, output: 12, cacheRead: 0.2, cacheWrite: 2.5 },\n} satisfies Record<string, Model.Info[\"cost\"]>;\n\nconst OPENAI_CODEX_MODELS: OpenAICodexModelSeed[] = [\n\t{\n\t\tid: \"gpt-5.3-codex-spark\",\n\t\tname: \"GPT-5.3 Codex Spark\",\n\t\tinput: [\"text\"],\n\t\tcost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 },\n\t\tcontextWindow: OPENAI_CODEX_SPARK_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.4\",\n\t\tname: \"GPT-5.4\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing({ input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0 }),\n\t\tcontextWindow: OPENAI_CODEX_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.4-mini\",\n\t\tname: \"GPT-5.4 mini\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 },\n\t\tcontextWindow: OPENAI_CODEX_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.5\",\n\t\tname: \"GPT-5.5\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing({ input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 }),\n\t\tcontextWindow: OPENAI_CODEX_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.6-luna\",\n\t\tname: \"GPT-5.6 Luna\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing(OPENAI_CODEX_GPT_56_COSTS[\"gpt-5.6-luna\"]),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\n\t\tthinkingLevelMap: { minimal: null },\n\t},\n\t{\n\t\tid: \"gpt-5.6-sol\",\n\t\tname: \"GPT-5.6 Sol\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing({ input: 5, output: 30, cacheRead: 0.5, cacheWrite: 6.25 }),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\n\t\tthinkingLevelMap: { minimal: null },\n\t},\n\t{\n\t\tid: \"gpt-5.6-terra\",\n\t\tname: \"GPT-5.6 Terra\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing(OPENAI_CODEX_GPT_56_COSTS[\"gpt-5.6-terra\"]),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\n\t\tthinkingLevelMap: { minimal: null },\n\t},\n];\n\nexport function openAICodexBuiltInModels(): Record<string, Model.Info> {\n\tconst models: Record<string, Model.Info> = {};\n\tfor (const seed of OPENAI_CODEX_MODELS) {\n\t\tconst supportsToolSearch = OPENAI_CODEX_TOOL_SEARCH_MODEL_IDS.has(seed.id);\n\t\tconst supportsAdditionalTools = OPENAI_CODEX_ADDITIONAL_TOOLS_MODEL_IDS.has(seed.id);\n\t\tconst info: Model.Info = {\n\t\t\t...seed,\n\t\t\tprovider: {\n\t\t\t\tid: OPENAI_CODEX_PROVIDER_ID,\n\t\t\t\tname: \"OpenAI Codex (ChatGPT)\",\n\t\t\t\tsource: \"custom\",\n\t\t\t\tenv: [\"OPENAI_CODEX_API_KEY\"],\n\t\t\t},\n\t\t\tbaseUrl: OPENAI_CODEX_BASE_URL,\n\t\t\treasoning: true,\n\t\t\t// Codex models always reason; the off level cannot be requested.\n\t\t\tthinkingLevelMap: { off: null, ...seed.thinkingLevelMap },\n\t\t\tmaxTokens: OPENAI_CODEX_MAX_TOKENS,\n\t\t\tnpm: OPENAI_CODEX_NPM,\n\t\t\tapi: {\n\t\t\t\tid: seed.id,\n\t\t\t\turl: OPENAI_CODEX_BASE_URL,\n\t\t\t\tmethod: Model.APIMethodEnum.responses,\n\t\t\t},\n\t\t\tproviderOptionsKey: OPENAI_CODEX_PROVIDER_ID,\n\t\t\tcompat: {\n\t\t\t\tsupportsOpenAIGrammarTools: true,\n\t\t\t\t...(supportsToolSearch ? { supportsToolSearch: true } : {}),\n\t\t\t\t...(supportsAdditionalTools ? { supportsAdditionalTools: true } : {}),\n\t\t\t},\n\t\t\tprotocol: Model.KnownProviderEnum.openaiCodex,\n\t\t};\n\t\tapplyModelMetadata(info);\n\t\tmodels[seed.id] = info;\n\t}\n\treturn models;\n}\n\nexport async function generateModels(args: { path?: string | undefined } = {}): Promise<string> {\n\tconst path = resolve(args.path ?? ModelCatalog.path());\n\tconst modelsDev = await loadBuiltInFromModelsDev();\n\tconst customCodexModels = openAICodexBuiltInModels();\n\n\tconst allModels = { ...modelsDev, [OPENAI_CODEX_PROVIDER_ID]: customCodexModels };\n\tawait Filesystem.writeJson(path, allModels);\n\treturn path;\n}\n\n//\n// CLI entry\nexport const ModelgenCommand: CommandModule<object, { path?: string | undefined }> = {\n\tcommand: \"modelgen [path]\",\n\tdescribe: \"generate models.gen.json\",\n\tbuilder: (yargs) =>\n\t\tyargs.positional(\"path\", {\n\t\t\ttype: \"string\",\n\t\t\tdescribe: \"output path (defaults to CODEWORK_MODELS_FILE or ./models.gen.json)\",\n\t\t}),\n\thandler: async (args) => {\n\t\tconst path = await generateModels(args);\n\t\tconsole.log(`Generated model catalog at ${path}`);\n\t},\n};\n\nexport function applyModification(\n\tproviderId: string,\n\tprovider: ModelsDevProvider,\n\tmodel: ModelsDevModel,\n): Model.Info | undefined {\n\tconst npm = resolveModelNpm(provider, model);\n\tif (!isAISDKPackage(npm)) return;\n\n\tconst protocol = protocolForPackage(npm);\n\tconst baseUrl = resolveModelBaseUrl(provider, model);\n\tconst providerInfo: Model.ProviderInfo = {\n\t\tid: providerId,\n\t\tname: provider.name,\n\t\tsource: \"api\",\n\t\tenv: provider.env,\n\t};\n\tif (provider.key) providerInfo.key = provider.key;\n\tconst api: Model.APIMetadata = {\n\t\tid: model.id,\n\t\tmethod: resolveModelAPIMethod(npm),\n\t};\n\tif (baseUrl) api.url = baseUrl;\n\n\tconst info: Model.Info = {\n\t\tid: model.id,\n\t\tname: model.name,\n\t\tprovider: providerInfo,\n\t\tbaseUrl,\n\t\treasoning: Boolean(model.reasoning),\n\t\tinput: Model.normalizeInput(model.modalities.input),\n\t\tcost: {\n\t\t\tinput: model.cost?.input ?? 0,\n\t\t\toutput: model.cost?.output ?? 0,\n\t\t\tcacheRead: model.cost?.cache_read ?? 0,\n\t\t\tcacheWrite: model.cost?.cache_write ?? 0,\n\t\t},\n\t\tcontextWindow: model.limit?.context ?? 4096,\n\t\tmaxTokens: model.limit?.output ?? 4096,\n\t\theaders: {\n\t\t\t...provider.headers,\n\t\t\t...model.provider?.headers,\n\t\t\t...model.headers,\n\t\t},\n\t\tnpm,\n\t\tapi,\n\t\tproviderOptionsKey: resolveProviderOptionsKey(protocol),\n\t\tprotocol,\n\t};\n\tif (Object.keys(info.headers ?? {}).length === 0) delete info.headers;\n\tapplyModelMetadata(info);\n\treturn info;\n}\n"],"mappings":";;;;;AASA,MAAM,6BAA+E;EAC3D,kBAAA,YAAY;EACZ,kBAAA,SAAS;EACT,kBAAA,aAAa;EACb,kBAAA,MA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