@codelia/config 0.1.82 → 0.1.84
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/dist/index.cjs +55 -5
- package/dist/index.d.cts +15 -6
- package/dist/index.d.ts +15 -6
- package/dist/index.js +53 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,10 +24,12 @@ __export(index_exports, {
|
|
|
24
24
|
CONFIG_GROUP_DEFAULT_WRITE_SCOPE: () => CONFIG_GROUP_DEFAULT_WRITE_SCOPE,
|
|
25
25
|
CONFIG_VERSION: () => CONFIG_VERSION,
|
|
26
26
|
ConfigRegistry: () => ConfigRegistry,
|
|
27
|
+
GOOGLE_IMAGE_MODELS: () => GOOGLE_IMAGE_MODELS,
|
|
27
28
|
OPENAI_CODEX_IMAGE_MODELS: () => OPENAI_CODEX_IMAGE_MODELS,
|
|
28
29
|
OPENAI_IMAGE_MODELS: () => OPENAI_IMAGE_MODELS,
|
|
29
30
|
SUBAGENT_MAX_CONCURRENT_LIMIT: () => SUBAGENT_MAX_CONCURRENT_LIMIT,
|
|
30
31
|
configRegistry: () => configRegistry,
|
|
32
|
+
normalizePermissionRule: () => normalizePermissionRule,
|
|
31
33
|
parseConfig: () => parseConfig,
|
|
32
34
|
parseImageGenerationConfig: () => parseImageGenerationConfig,
|
|
33
35
|
parseResponsesProviders: () => parseResponsesProviders
|
|
@@ -40,6 +42,7 @@ var BUILTIN_PROVIDER_NAMES = [
|
|
|
40
42
|
"anthropic",
|
|
41
43
|
"openrouter",
|
|
42
44
|
"google",
|
|
45
|
+
"deepseek",
|
|
43
46
|
"moonshot",
|
|
44
47
|
"zai",
|
|
45
48
|
"xai"
|
|
@@ -185,12 +188,19 @@ function parseResponsesProviders(value, source = "config") {
|
|
|
185
188
|
// src/image-generation.ts
|
|
186
189
|
var OPENAI_IMAGE_MODELS = [
|
|
187
190
|
"gpt-image-2.5-sunburst",
|
|
188
|
-
"gpt-image-2.5-flare"
|
|
191
|
+
"gpt-image-2.5-flare",
|
|
192
|
+
"gpt-image-2.6-sunburst",
|
|
193
|
+
"gpt-image-2.6-flare"
|
|
189
194
|
];
|
|
190
195
|
var OPENAI_CODEX_IMAGE_MODELS = [
|
|
191
196
|
"gpt-image-2",
|
|
192
197
|
...OPENAI_IMAGE_MODELS
|
|
193
198
|
];
|
|
199
|
+
var GOOGLE_IMAGE_MODELS = [
|
|
200
|
+
"gemini-nano-banana-2.1",
|
|
201
|
+
"gemini-3.1-flash-lite-image",
|
|
202
|
+
"gemini-3-pro-image"
|
|
203
|
+
];
|
|
194
204
|
var object = (v) => {
|
|
195
205
|
if (!v || typeof v !== "object" || Array.isArray(v)) invalid();
|
|
196
206
|
return v;
|
|
@@ -223,7 +233,33 @@ var parseImageGenerationConfig = (value) => {
|
|
|
223
233
|
const options = {};
|
|
224
234
|
if (v.provider_options !== void 0) {
|
|
225
235
|
const p = object(v.provider_options);
|
|
226
|
-
keys(p, ["openai", "openrouter"]);
|
|
236
|
+
keys(p, ["openai", "openrouter", "google"]);
|
|
237
|
+
if (p.google !== void 0) {
|
|
238
|
+
const o = object(p.google);
|
|
239
|
+
keys(o, ["image_size", "aspect_ratio", "output_format"]);
|
|
240
|
+
options.google = {
|
|
241
|
+
...o.image_size !== void 0 ? { image_size: choice(o.image_size, ["1K", "2K", "4K"]) } : {},
|
|
242
|
+
...o.aspect_ratio !== void 0 ? {
|
|
243
|
+
aspect_ratio: choice(o.aspect_ratio, [
|
|
244
|
+
"1:1",
|
|
245
|
+
"2:3",
|
|
246
|
+
"3:2",
|
|
247
|
+
"3:4",
|
|
248
|
+
"4:3",
|
|
249
|
+
"4:5",
|
|
250
|
+
"5:4",
|
|
251
|
+
"9:16",
|
|
252
|
+
"16:9",
|
|
253
|
+
"21:9",
|
|
254
|
+
"1:8",
|
|
255
|
+
"8:1",
|
|
256
|
+
"1:4",
|
|
257
|
+
"4:1"
|
|
258
|
+
])
|
|
259
|
+
} : {},
|
|
260
|
+
...o.output_format !== void 0 ? { output_format: choice(o.output_format, ["jpeg"]) } : {}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
227
263
|
if (p.openai !== void 0) {
|
|
228
264
|
const o = object(p.openai);
|
|
229
265
|
keys(o, ["model", "size", "quality"]);
|
|
@@ -255,9 +291,15 @@ var parseImageGenerationConfig = (value) => {
|
|
|
255
291
|
}
|
|
256
292
|
const common = v.provider_options !== void 0 ? { provider_options: options } : {};
|
|
257
293
|
if (mode === "builtin") return { mode, ...common };
|
|
258
|
-
const provider = choice(v.provider, ["openai", "openrouter"]);
|
|
259
|
-
const model = provider === "openai" ? choice(v.model, OPENAI_IMAGE_MODELS) : id(v.model);
|
|
294
|
+
const provider = choice(v.provider, ["openai", "openrouter", "google"]);
|
|
295
|
+
const model = provider === "openai" ? choice(v.model, OPENAI_IMAGE_MODELS) : provider === "google" ? choice(v.model, GOOGLE_IMAGE_MODELS) : id(v.model);
|
|
260
296
|
if (provider === "openai" && options.openai?.model !== void 0) invalid();
|
|
297
|
+
if (provider !== "google" && options.google !== void 0 || provider === "google" && (options.openai !== void 0 || options.openrouter !== void 0))
|
|
298
|
+
invalid();
|
|
299
|
+
if (provider === "google" && model === "gemini-3.1-flash-lite-image" && options.google?.image_size && options.google.image_size !== "1K")
|
|
300
|
+
invalid();
|
|
301
|
+
if (provider === "google" && model !== "gemini-nano-banana-2.1" && ["1:8", "8:1", "1:4", "4:1"].includes(options.google?.aspect_ratio ?? ""))
|
|
302
|
+
invalid();
|
|
261
303
|
if (v.api_key_env !== void 0 && (typeof v.api_key_env !== "string" || !/^[A-Za-z_][A-Za-z0-9_]{0,127}$/.test(v.api_key_env)))
|
|
262
304
|
invalid();
|
|
263
305
|
return {
|
|
@@ -337,6 +379,7 @@ var parsePermissionRule = (value) => {
|
|
|
337
379
|
...skillName ? { skill_name: skillName } : {}
|
|
338
380
|
};
|
|
339
381
|
};
|
|
382
|
+
var normalizePermissionRule = (value) => parsePermissionRule(value);
|
|
340
383
|
var parsePermissionRules = (value) => {
|
|
341
384
|
if (!Array.isArray(value)) return void 0;
|
|
342
385
|
const rules = value.map((entry) => parsePermissionRule(entry)).filter((entry) => !!entry);
|
|
@@ -559,12 +602,17 @@ var parseSearchConfig = (value) => {
|
|
|
559
602
|
}
|
|
560
603
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
561
604
|
};
|
|
605
|
+
var parseModelFastMode = (value) => {
|
|
606
|
+
if (value === void 0 || typeof value === "boolean" || value === "ultrafast")
|
|
607
|
+
return value;
|
|
608
|
+
throw new Error('model.fast must be true, false, or "ultrafast"');
|
|
609
|
+
};
|
|
562
610
|
var parseModelConfig = (value) => isRecord(value) ? {
|
|
563
611
|
provider: pickString(value.provider),
|
|
564
612
|
name: pickString(value.name),
|
|
565
613
|
reasoning: pickString(value.reasoning),
|
|
566
614
|
verbosity: pickString(value.verbosity),
|
|
567
|
-
fast:
|
|
615
|
+
fast: parseModelFastMode(value.fast)
|
|
568
616
|
} : void 0;
|
|
569
617
|
var parseSubagentConfig = (value, source) => {
|
|
570
618
|
if (!isRecord(value)) return void 0;
|
|
@@ -803,10 +851,12 @@ var configRegistry = new ConfigRegistry();
|
|
|
803
851
|
CONFIG_GROUP_DEFAULT_WRITE_SCOPE,
|
|
804
852
|
CONFIG_VERSION,
|
|
805
853
|
ConfigRegistry,
|
|
854
|
+
GOOGLE_IMAGE_MODELS,
|
|
806
855
|
OPENAI_CODEX_IMAGE_MODELS,
|
|
807
856
|
OPENAI_IMAGE_MODELS,
|
|
808
857
|
SUBAGENT_MAX_CONCURRENT_LIMIT,
|
|
809
858
|
configRegistry,
|
|
859
|
+
normalizePermissionRule,
|
|
810
860
|
parseConfig,
|
|
811
861
|
parseImageGenerationConfig,
|
|
812
862
|
parseResponsesProviders
|
package/dist/index.d.cts
CHANGED
|
@@ -27,11 +27,12 @@ type ResponsesProviderConfig = {
|
|
|
27
27
|
};
|
|
28
28
|
models: Record<string, ResponsesModelConfig>;
|
|
29
29
|
};
|
|
30
|
-
declare const BUILTIN_PROVIDER_NAMES: readonly ["openai", "anthropic", "openrouter", "google", "moonshot", "zai", "xai"];
|
|
30
|
+
declare const BUILTIN_PROVIDER_NAMES: readonly ["openai", "anthropic", "openrouter", "google", "deepseek", "moonshot", "zai", "xai"];
|
|
31
31
|
declare function parseResponsesProviders(value: unknown, source?: string): Record<string, ResponsesProviderConfig>;
|
|
32
32
|
|
|
33
|
-
declare const OPENAI_IMAGE_MODELS: readonly ["gpt-image-2.5-sunburst", "gpt-image-2.5-flare"];
|
|
34
|
-
declare const OPENAI_CODEX_IMAGE_MODELS: readonly ["gpt-image-2", "gpt-image-2.5-sunburst", "gpt-image-2.5-flare"];
|
|
33
|
+
declare const OPENAI_IMAGE_MODELS: readonly ["gpt-image-2.5-sunburst", "gpt-image-2.5-flare", "gpt-image-2.6-sunburst", "gpt-image-2.6-flare"];
|
|
34
|
+
declare const OPENAI_CODEX_IMAGE_MODELS: readonly ["gpt-image-2", "gpt-image-2.5-sunburst", "gpt-image-2.5-flare", "gpt-image-2.6-sunburst", "gpt-image-2.6-flare"];
|
|
35
|
+
declare const GOOGLE_IMAGE_MODELS: readonly ["gemini-nano-banana-2.1", "gemini-3.1-flash-lite-image", "gemini-3-pro-image"];
|
|
35
36
|
type OpenAiImageOptions = {
|
|
36
37
|
model?: string;
|
|
37
38
|
quality?: "auto" | "low" | "medium" | "high";
|
|
@@ -43,9 +44,15 @@ type OpenRouterImageOptions = {
|
|
|
43
44
|
resolution?: "512" | "1K" | "2K" | "4K";
|
|
44
45
|
aspect_ratio?: string;
|
|
45
46
|
};
|
|
47
|
+
type GoogleImageOptions = {
|
|
48
|
+
image_size?: "1K" | "2K" | "4K";
|
|
49
|
+
aspect_ratio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1";
|
|
50
|
+
output_format?: "jpeg";
|
|
51
|
+
};
|
|
46
52
|
type ImageProviderOptions = {
|
|
47
53
|
openai?: OpenAiImageOptions;
|
|
48
54
|
openrouter?: OpenRouterImageOptions;
|
|
55
|
+
google?: GoogleImageOptions;
|
|
49
56
|
};
|
|
50
57
|
type ImageGenerationConfig = {
|
|
51
58
|
mode: "off";
|
|
@@ -54,7 +61,7 @@ type ImageGenerationConfig = {
|
|
|
54
61
|
provider_options?: ImageProviderOptions;
|
|
55
62
|
} | {
|
|
56
63
|
mode: "custom";
|
|
57
|
-
provider: "openai" | "openrouter";
|
|
64
|
+
provider: "openai" | "openrouter" | "google";
|
|
58
65
|
model: string;
|
|
59
66
|
api_key_env?: string;
|
|
60
67
|
provider_options?: ImageProviderOptions;
|
|
@@ -67,7 +74,7 @@ type ModelConfig = {
|
|
|
67
74
|
name?: string;
|
|
68
75
|
reasoning?: string;
|
|
69
76
|
verbosity?: string;
|
|
70
|
-
fast?: boolean;
|
|
77
|
+
fast?: boolean | "ultrafast";
|
|
71
78
|
};
|
|
72
79
|
declare const SUBAGENT_MAX_CONCURRENT_LIMIT = 16;
|
|
73
80
|
type SubagentConfig = {
|
|
@@ -190,6 +197,8 @@ type ConfigWriteScope = "global" | "project";
|
|
|
190
197
|
type ConfigWriteGroup = Exclude<keyof CodeliaConfig, "version">;
|
|
191
198
|
declare const CONFIG_GROUP_DEFAULT_WRITE_SCOPE: Record<ConfigWriteGroup, ConfigWriteScope>;
|
|
192
199
|
declare const CONFIG_VERSION = 1;
|
|
200
|
+
/** Normalizes one rule exactly as `parseConfig` does (null when invalid). */
|
|
201
|
+
declare const normalizePermissionRule: (value: unknown) => PermissionRule | null;
|
|
193
202
|
declare const parseConfig: (value: unknown, sourceLabel: string) => CodeliaConfig;
|
|
194
203
|
type ConfigLayer = {
|
|
195
204
|
providers?: Record<string, ResponsesProviderConfig>;
|
|
@@ -211,4 +220,4 @@ declare class ConfigRegistry {
|
|
|
211
220
|
}
|
|
212
221
|
declare const configRegistry: ConfigRegistry;
|
|
213
222
|
|
|
214
|
-
export { BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiConfig, configRegistry, parseConfig, parseImageGenerationConfig, parseResponsesProviders };
|
|
223
|
+
export { BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, GOOGLE_IMAGE_MODELS, type GoogleImageOptions, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiConfig, configRegistry, normalizePermissionRule, parseConfig, parseImageGenerationConfig, parseResponsesProviders };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,11 +27,12 @@ type ResponsesProviderConfig = {
|
|
|
27
27
|
};
|
|
28
28
|
models: Record<string, ResponsesModelConfig>;
|
|
29
29
|
};
|
|
30
|
-
declare const BUILTIN_PROVIDER_NAMES: readonly ["openai", "anthropic", "openrouter", "google", "moonshot", "zai", "xai"];
|
|
30
|
+
declare const BUILTIN_PROVIDER_NAMES: readonly ["openai", "anthropic", "openrouter", "google", "deepseek", "moonshot", "zai", "xai"];
|
|
31
31
|
declare function parseResponsesProviders(value: unknown, source?: string): Record<string, ResponsesProviderConfig>;
|
|
32
32
|
|
|
33
|
-
declare const OPENAI_IMAGE_MODELS: readonly ["gpt-image-2.5-sunburst", "gpt-image-2.5-flare"];
|
|
34
|
-
declare const OPENAI_CODEX_IMAGE_MODELS: readonly ["gpt-image-2", "gpt-image-2.5-sunburst", "gpt-image-2.5-flare"];
|
|
33
|
+
declare const OPENAI_IMAGE_MODELS: readonly ["gpt-image-2.5-sunburst", "gpt-image-2.5-flare", "gpt-image-2.6-sunburst", "gpt-image-2.6-flare"];
|
|
34
|
+
declare const OPENAI_CODEX_IMAGE_MODELS: readonly ["gpt-image-2", "gpt-image-2.5-sunburst", "gpt-image-2.5-flare", "gpt-image-2.6-sunburst", "gpt-image-2.6-flare"];
|
|
35
|
+
declare const GOOGLE_IMAGE_MODELS: readonly ["gemini-nano-banana-2.1", "gemini-3.1-flash-lite-image", "gemini-3-pro-image"];
|
|
35
36
|
type OpenAiImageOptions = {
|
|
36
37
|
model?: string;
|
|
37
38
|
quality?: "auto" | "low" | "medium" | "high";
|
|
@@ -43,9 +44,15 @@ type OpenRouterImageOptions = {
|
|
|
43
44
|
resolution?: "512" | "1K" | "2K" | "4K";
|
|
44
45
|
aspect_ratio?: string;
|
|
45
46
|
};
|
|
47
|
+
type GoogleImageOptions = {
|
|
48
|
+
image_size?: "1K" | "2K" | "4K";
|
|
49
|
+
aspect_ratio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1";
|
|
50
|
+
output_format?: "jpeg";
|
|
51
|
+
};
|
|
46
52
|
type ImageProviderOptions = {
|
|
47
53
|
openai?: OpenAiImageOptions;
|
|
48
54
|
openrouter?: OpenRouterImageOptions;
|
|
55
|
+
google?: GoogleImageOptions;
|
|
49
56
|
};
|
|
50
57
|
type ImageGenerationConfig = {
|
|
51
58
|
mode: "off";
|
|
@@ -54,7 +61,7 @@ type ImageGenerationConfig = {
|
|
|
54
61
|
provider_options?: ImageProviderOptions;
|
|
55
62
|
} | {
|
|
56
63
|
mode: "custom";
|
|
57
|
-
provider: "openai" | "openrouter";
|
|
64
|
+
provider: "openai" | "openrouter" | "google";
|
|
58
65
|
model: string;
|
|
59
66
|
api_key_env?: string;
|
|
60
67
|
provider_options?: ImageProviderOptions;
|
|
@@ -67,7 +74,7 @@ type ModelConfig = {
|
|
|
67
74
|
name?: string;
|
|
68
75
|
reasoning?: string;
|
|
69
76
|
verbosity?: string;
|
|
70
|
-
fast?: boolean;
|
|
77
|
+
fast?: boolean | "ultrafast";
|
|
71
78
|
};
|
|
72
79
|
declare const SUBAGENT_MAX_CONCURRENT_LIMIT = 16;
|
|
73
80
|
type SubagentConfig = {
|
|
@@ -190,6 +197,8 @@ type ConfigWriteScope = "global" | "project";
|
|
|
190
197
|
type ConfigWriteGroup = Exclude<keyof CodeliaConfig, "version">;
|
|
191
198
|
declare const CONFIG_GROUP_DEFAULT_WRITE_SCOPE: Record<ConfigWriteGroup, ConfigWriteScope>;
|
|
192
199
|
declare const CONFIG_VERSION = 1;
|
|
200
|
+
/** Normalizes one rule exactly as `parseConfig` does (null when invalid). */
|
|
201
|
+
declare const normalizePermissionRule: (value: unknown) => PermissionRule | null;
|
|
193
202
|
declare const parseConfig: (value: unknown, sourceLabel: string) => CodeliaConfig;
|
|
194
203
|
type ConfigLayer = {
|
|
195
204
|
providers?: Record<string, ResponsesProviderConfig>;
|
|
@@ -211,4 +220,4 @@ declare class ConfigRegistry {
|
|
|
211
220
|
}
|
|
212
221
|
declare const configRegistry: ConfigRegistry;
|
|
213
222
|
|
|
214
|
-
export { BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiConfig, configRegistry, parseConfig, parseImageGenerationConfig, parseResponsesProviders };
|
|
223
|
+
export { BUILTIN_PROVIDER_NAMES, CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExecutionEnvironmentConfig, type ExecutionEnvironmentStartupChecksConfig, type ExecutionEnvironmentStartupChecksMode, type ExperimentalConfig, GOOGLE_IMAGE_MODELS, type GoogleImageOptions, type ImageGenerationConfig, type ImageProviderOptions, type McpConfig, type McpServerConfig, type ModelConfig, OPENAI_CODEX_IMAGE_MODELS, OPENAI_IMAGE_MODELS, type OpenAiExperimentalConfig, type OpenAiImageOptions, type OpenRouterImageOptions, type PermissionRule, type PermissionsConfig, type ResponsesModelConfig, type ResponsesProviderConfig, SUBAGENT_MAX_CONCURRENT_LIMIT, type SearchConfig, type SearchMode, type SkillsConfig, type SubagentConfig, type TuiConfig, configRegistry, normalizePermissionRule, parseConfig, parseImageGenerationConfig, parseResponsesProviders };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var BUILTIN_PROVIDER_NAMES = [
|
|
|
4
4
|
"anthropic",
|
|
5
5
|
"openrouter",
|
|
6
6
|
"google",
|
|
7
|
+
"deepseek",
|
|
7
8
|
"moonshot",
|
|
8
9
|
"zai",
|
|
9
10
|
"xai"
|
|
@@ -149,12 +150,19 @@ function parseResponsesProviders(value, source = "config") {
|
|
|
149
150
|
// src/image-generation.ts
|
|
150
151
|
var OPENAI_IMAGE_MODELS = [
|
|
151
152
|
"gpt-image-2.5-sunburst",
|
|
152
|
-
"gpt-image-2.5-flare"
|
|
153
|
+
"gpt-image-2.5-flare",
|
|
154
|
+
"gpt-image-2.6-sunburst",
|
|
155
|
+
"gpt-image-2.6-flare"
|
|
153
156
|
];
|
|
154
157
|
var OPENAI_CODEX_IMAGE_MODELS = [
|
|
155
158
|
"gpt-image-2",
|
|
156
159
|
...OPENAI_IMAGE_MODELS
|
|
157
160
|
];
|
|
161
|
+
var GOOGLE_IMAGE_MODELS = [
|
|
162
|
+
"gemini-nano-banana-2.1",
|
|
163
|
+
"gemini-3.1-flash-lite-image",
|
|
164
|
+
"gemini-3-pro-image"
|
|
165
|
+
];
|
|
158
166
|
var object = (v) => {
|
|
159
167
|
if (!v || typeof v !== "object" || Array.isArray(v)) invalid();
|
|
160
168
|
return v;
|
|
@@ -187,7 +195,33 @@ var parseImageGenerationConfig = (value) => {
|
|
|
187
195
|
const options = {};
|
|
188
196
|
if (v.provider_options !== void 0) {
|
|
189
197
|
const p = object(v.provider_options);
|
|
190
|
-
keys(p, ["openai", "openrouter"]);
|
|
198
|
+
keys(p, ["openai", "openrouter", "google"]);
|
|
199
|
+
if (p.google !== void 0) {
|
|
200
|
+
const o = object(p.google);
|
|
201
|
+
keys(o, ["image_size", "aspect_ratio", "output_format"]);
|
|
202
|
+
options.google = {
|
|
203
|
+
...o.image_size !== void 0 ? { image_size: choice(o.image_size, ["1K", "2K", "4K"]) } : {},
|
|
204
|
+
...o.aspect_ratio !== void 0 ? {
|
|
205
|
+
aspect_ratio: choice(o.aspect_ratio, [
|
|
206
|
+
"1:1",
|
|
207
|
+
"2:3",
|
|
208
|
+
"3:2",
|
|
209
|
+
"3:4",
|
|
210
|
+
"4:3",
|
|
211
|
+
"4:5",
|
|
212
|
+
"5:4",
|
|
213
|
+
"9:16",
|
|
214
|
+
"16:9",
|
|
215
|
+
"21:9",
|
|
216
|
+
"1:8",
|
|
217
|
+
"8:1",
|
|
218
|
+
"1:4",
|
|
219
|
+
"4:1"
|
|
220
|
+
])
|
|
221
|
+
} : {},
|
|
222
|
+
...o.output_format !== void 0 ? { output_format: choice(o.output_format, ["jpeg"]) } : {}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
191
225
|
if (p.openai !== void 0) {
|
|
192
226
|
const o = object(p.openai);
|
|
193
227
|
keys(o, ["model", "size", "quality"]);
|
|
@@ -219,9 +253,15 @@ var parseImageGenerationConfig = (value) => {
|
|
|
219
253
|
}
|
|
220
254
|
const common = v.provider_options !== void 0 ? { provider_options: options } : {};
|
|
221
255
|
if (mode === "builtin") return { mode, ...common };
|
|
222
|
-
const provider = choice(v.provider, ["openai", "openrouter"]);
|
|
223
|
-
const model = provider === "openai" ? choice(v.model, OPENAI_IMAGE_MODELS) : id(v.model);
|
|
256
|
+
const provider = choice(v.provider, ["openai", "openrouter", "google"]);
|
|
257
|
+
const model = provider === "openai" ? choice(v.model, OPENAI_IMAGE_MODELS) : provider === "google" ? choice(v.model, GOOGLE_IMAGE_MODELS) : id(v.model);
|
|
224
258
|
if (provider === "openai" && options.openai?.model !== void 0) invalid();
|
|
259
|
+
if (provider !== "google" && options.google !== void 0 || provider === "google" && (options.openai !== void 0 || options.openrouter !== void 0))
|
|
260
|
+
invalid();
|
|
261
|
+
if (provider === "google" && model === "gemini-3.1-flash-lite-image" && options.google?.image_size && options.google.image_size !== "1K")
|
|
262
|
+
invalid();
|
|
263
|
+
if (provider === "google" && model !== "gemini-nano-banana-2.1" && ["1:8", "8:1", "1:4", "4:1"].includes(options.google?.aspect_ratio ?? ""))
|
|
264
|
+
invalid();
|
|
225
265
|
if (v.api_key_env !== void 0 && (typeof v.api_key_env !== "string" || !/^[A-Za-z_][A-Za-z0-9_]{0,127}$/.test(v.api_key_env)))
|
|
226
266
|
invalid();
|
|
227
267
|
return {
|
|
@@ -301,6 +341,7 @@ var parsePermissionRule = (value) => {
|
|
|
301
341
|
...skillName ? { skill_name: skillName } : {}
|
|
302
342
|
};
|
|
303
343
|
};
|
|
344
|
+
var normalizePermissionRule = (value) => parsePermissionRule(value);
|
|
304
345
|
var parsePermissionRules = (value) => {
|
|
305
346
|
if (!Array.isArray(value)) return void 0;
|
|
306
347
|
const rules = value.map((entry) => parsePermissionRule(entry)).filter((entry) => !!entry);
|
|
@@ -523,12 +564,17 @@ var parseSearchConfig = (value) => {
|
|
|
523
564
|
}
|
|
524
565
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
525
566
|
};
|
|
567
|
+
var parseModelFastMode = (value) => {
|
|
568
|
+
if (value === void 0 || typeof value === "boolean" || value === "ultrafast")
|
|
569
|
+
return value;
|
|
570
|
+
throw new Error('model.fast must be true, false, or "ultrafast"');
|
|
571
|
+
};
|
|
526
572
|
var parseModelConfig = (value) => isRecord(value) ? {
|
|
527
573
|
provider: pickString(value.provider),
|
|
528
574
|
name: pickString(value.name),
|
|
529
575
|
reasoning: pickString(value.reasoning),
|
|
530
576
|
verbosity: pickString(value.verbosity),
|
|
531
|
-
fast:
|
|
577
|
+
fast: parseModelFastMode(value.fast)
|
|
532
578
|
} : void 0;
|
|
533
579
|
var parseSubagentConfig = (value, source) => {
|
|
534
580
|
if (!isRecord(value)) return void 0;
|
|
@@ -766,10 +812,12 @@ export {
|
|
|
766
812
|
CONFIG_GROUP_DEFAULT_WRITE_SCOPE,
|
|
767
813
|
CONFIG_VERSION,
|
|
768
814
|
ConfigRegistry,
|
|
815
|
+
GOOGLE_IMAGE_MODELS,
|
|
769
816
|
OPENAI_CODEX_IMAGE_MODELS,
|
|
770
817
|
OPENAI_IMAGE_MODELS,
|
|
771
818
|
SUBAGENT_MAX_CONCURRENT_LIMIT,
|
|
772
819
|
configRegistry,
|
|
820
|
+
normalizePermissionRule,
|
|
773
821
|
parseConfig,
|
|
774
822
|
parseImageGenerationConfig,
|
|
775
823
|
parseResponsesProviders
|