@codelia/config 0.1.23 → 0.1.26
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 +27 -0
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +27 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(index_exports);
|
|
30
30
|
var CONFIG_GROUP_DEFAULT_WRITE_SCOPE = {
|
|
31
31
|
model: "global",
|
|
32
|
+
experimental: "global",
|
|
32
33
|
permissions: "project",
|
|
33
34
|
mcp: "project",
|
|
34
35
|
skills: "project",
|
|
@@ -167,6 +168,18 @@ var parseSearchMode = (value) => {
|
|
|
167
168
|
}
|
|
168
169
|
return value;
|
|
169
170
|
};
|
|
171
|
+
var parseExperimentalConfig = (value) => {
|
|
172
|
+
if (!isRecord(value)) return void 0;
|
|
173
|
+
let openai;
|
|
174
|
+
if (isRecord(value.openai)) {
|
|
175
|
+
const websocketMode = value.openai.websocket_mode === "off" || value.openai.websocket_mode === "auto" || value.openai.websocket_mode === "on" ? value.openai.websocket_mode : void 0;
|
|
176
|
+
if (websocketMode) {
|
|
177
|
+
openai = { websocket_mode: websocketMode };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (!openai) return void 0;
|
|
181
|
+
return { openai };
|
|
182
|
+
};
|
|
170
183
|
var parseSearchConfig = (value) => {
|
|
171
184
|
if (!isRecord(value)) return void 0;
|
|
172
185
|
const mode = parseSearchMode(value.mode);
|
|
@@ -251,6 +264,7 @@ var parseConfig = (value, sourceLabel) => {
|
|
|
251
264
|
const hasPermissions = permissions && (permissions.allow || permissions.deny) ? permissions : void 0;
|
|
252
265
|
const mcp = parseMcpConfig(value.mcp);
|
|
253
266
|
const skills = parseSkillsConfig(value.skills);
|
|
267
|
+
const experimental = parseExperimentalConfig(value.experimental);
|
|
254
268
|
const search = parseSearchConfig(value.search);
|
|
255
269
|
const tui = isRecord(value.tui) ? {
|
|
256
270
|
...pickString(value.tui.theme) ? { theme: pickString(value.tui.theme) } : {}
|
|
@@ -265,6 +279,9 @@ var parseConfig = (value, sourceLabel) => {
|
|
|
265
279
|
if (skills) {
|
|
266
280
|
result.skills = skills;
|
|
267
281
|
}
|
|
282
|
+
if (experimental) {
|
|
283
|
+
result.experimental = experimental;
|
|
284
|
+
}
|
|
268
285
|
if (search) {
|
|
269
286
|
result.search = search;
|
|
270
287
|
}
|
|
@@ -284,6 +301,16 @@ var ConfigRegistry = class {
|
|
|
284
301
|
if (layer?.model) {
|
|
285
302
|
merged.model = { ...merged.model, ...layer.model };
|
|
286
303
|
}
|
|
304
|
+
if (layer?.experimental) {
|
|
305
|
+
const nextExperimental = layer.experimental;
|
|
306
|
+
merged.experimental ??= {};
|
|
307
|
+
if (nextExperimental.openai) {
|
|
308
|
+
merged.experimental.openai = {
|
|
309
|
+
...merged.experimental.openai ?? {},
|
|
310
|
+
...nextExperimental.openai
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
}
|
|
287
314
|
if (layer?.permissions) {
|
|
288
315
|
const nextAllow = layer.permissions.allow ?? [];
|
|
289
316
|
const nextDeny = layer.permissions.deny ?? [];
|
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +4,12 @@ type ModelConfig = {
|
|
|
4
4
|
reasoning?: string;
|
|
5
5
|
verbosity?: string;
|
|
6
6
|
};
|
|
7
|
+
type OpenAiExperimentalConfig = {
|
|
8
|
+
websocket_mode?: "off" | "auto" | "on";
|
|
9
|
+
};
|
|
10
|
+
type ExperimentalConfig = {
|
|
11
|
+
openai?: OpenAiExperimentalConfig;
|
|
12
|
+
};
|
|
7
13
|
type PermissionRule = {
|
|
8
14
|
tool: string;
|
|
9
15
|
command?: string;
|
|
@@ -72,6 +78,7 @@ type TuiConfig = {
|
|
|
72
78
|
type CodeliaConfig = {
|
|
73
79
|
version: number;
|
|
74
80
|
model?: ModelConfig;
|
|
81
|
+
experimental?: ExperimentalConfig;
|
|
75
82
|
permissions?: PermissionsConfig;
|
|
76
83
|
mcp?: McpConfig;
|
|
77
84
|
skills?: SkillsConfig;
|
|
@@ -85,6 +92,7 @@ declare const CONFIG_VERSION = 1;
|
|
|
85
92
|
declare const parseConfig: (value: unknown, sourceLabel: string) => CodeliaConfig;
|
|
86
93
|
type ConfigLayer = {
|
|
87
94
|
model?: ModelConfig;
|
|
95
|
+
experimental?: ExperimentalConfig;
|
|
88
96
|
permissions?: PermissionsConfig;
|
|
89
97
|
mcp?: McpConfig;
|
|
90
98
|
skills?: SkillsConfig;
|
|
@@ -98,4 +106,4 @@ declare class ConfigRegistry {
|
|
|
98
106
|
}
|
|
99
107
|
declare const configRegistry: ConfigRegistry;
|
|
100
108
|
|
|
101
|
-
export { CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type McpConfig, type McpServerConfig, type ModelConfig, type PermissionRule, type PermissionsConfig, type SearchConfig, type SearchMode, type SkillsConfig, type TuiConfig, configRegistry, parseConfig };
|
|
109
|
+
export { CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExperimentalConfig, type McpConfig, type McpServerConfig, type ModelConfig, type OpenAiExperimentalConfig, type PermissionRule, type PermissionsConfig, type SearchConfig, type SearchMode, type SkillsConfig, type TuiConfig, configRegistry, parseConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,12 @@ type ModelConfig = {
|
|
|
4
4
|
reasoning?: string;
|
|
5
5
|
verbosity?: string;
|
|
6
6
|
};
|
|
7
|
+
type OpenAiExperimentalConfig = {
|
|
8
|
+
websocket_mode?: "off" | "auto" | "on";
|
|
9
|
+
};
|
|
10
|
+
type ExperimentalConfig = {
|
|
11
|
+
openai?: OpenAiExperimentalConfig;
|
|
12
|
+
};
|
|
7
13
|
type PermissionRule = {
|
|
8
14
|
tool: string;
|
|
9
15
|
command?: string;
|
|
@@ -72,6 +78,7 @@ type TuiConfig = {
|
|
|
72
78
|
type CodeliaConfig = {
|
|
73
79
|
version: number;
|
|
74
80
|
model?: ModelConfig;
|
|
81
|
+
experimental?: ExperimentalConfig;
|
|
75
82
|
permissions?: PermissionsConfig;
|
|
76
83
|
mcp?: McpConfig;
|
|
77
84
|
skills?: SkillsConfig;
|
|
@@ -85,6 +92,7 @@ declare const CONFIG_VERSION = 1;
|
|
|
85
92
|
declare const parseConfig: (value: unknown, sourceLabel: string) => CodeliaConfig;
|
|
86
93
|
type ConfigLayer = {
|
|
87
94
|
model?: ModelConfig;
|
|
95
|
+
experimental?: ExperimentalConfig;
|
|
88
96
|
permissions?: PermissionsConfig;
|
|
89
97
|
mcp?: McpConfig;
|
|
90
98
|
skills?: SkillsConfig;
|
|
@@ -98,4 +106,4 @@ declare class ConfigRegistry {
|
|
|
98
106
|
}
|
|
99
107
|
declare const configRegistry: ConfigRegistry;
|
|
100
108
|
|
|
101
|
-
export { CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type McpConfig, type McpServerConfig, type ModelConfig, type PermissionRule, type PermissionsConfig, type SearchConfig, type SearchMode, type SkillsConfig, type TuiConfig, configRegistry, parseConfig };
|
|
109
|
+
export { CONFIG_GROUP_DEFAULT_WRITE_SCOPE, CONFIG_VERSION, type CodeliaConfig, ConfigRegistry, type ConfigWriteGroup, type ConfigWriteScope, type ExperimentalConfig, type McpConfig, type McpServerConfig, type ModelConfig, type OpenAiExperimentalConfig, type PermissionRule, type PermissionsConfig, type SearchConfig, type SearchMode, type SkillsConfig, type TuiConfig, configRegistry, parseConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
var CONFIG_GROUP_DEFAULT_WRITE_SCOPE = {
|
|
3
3
|
model: "global",
|
|
4
|
+
experimental: "global",
|
|
4
5
|
permissions: "project",
|
|
5
6
|
mcp: "project",
|
|
6
7
|
skills: "project",
|
|
@@ -139,6 +140,18 @@ var parseSearchMode = (value) => {
|
|
|
139
140
|
}
|
|
140
141
|
return value;
|
|
141
142
|
};
|
|
143
|
+
var parseExperimentalConfig = (value) => {
|
|
144
|
+
if (!isRecord(value)) return void 0;
|
|
145
|
+
let openai;
|
|
146
|
+
if (isRecord(value.openai)) {
|
|
147
|
+
const websocketMode = value.openai.websocket_mode === "off" || value.openai.websocket_mode === "auto" || value.openai.websocket_mode === "on" ? value.openai.websocket_mode : void 0;
|
|
148
|
+
if (websocketMode) {
|
|
149
|
+
openai = { websocket_mode: websocketMode };
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (!openai) return void 0;
|
|
153
|
+
return { openai };
|
|
154
|
+
};
|
|
142
155
|
var parseSearchConfig = (value) => {
|
|
143
156
|
if (!isRecord(value)) return void 0;
|
|
144
157
|
const mode = parseSearchMode(value.mode);
|
|
@@ -223,6 +236,7 @@ var parseConfig = (value, sourceLabel) => {
|
|
|
223
236
|
const hasPermissions = permissions && (permissions.allow || permissions.deny) ? permissions : void 0;
|
|
224
237
|
const mcp = parseMcpConfig(value.mcp);
|
|
225
238
|
const skills = parseSkillsConfig(value.skills);
|
|
239
|
+
const experimental = parseExperimentalConfig(value.experimental);
|
|
226
240
|
const search = parseSearchConfig(value.search);
|
|
227
241
|
const tui = isRecord(value.tui) ? {
|
|
228
242
|
...pickString(value.tui.theme) ? { theme: pickString(value.tui.theme) } : {}
|
|
@@ -237,6 +251,9 @@ var parseConfig = (value, sourceLabel) => {
|
|
|
237
251
|
if (skills) {
|
|
238
252
|
result.skills = skills;
|
|
239
253
|
}
|
|
254
|
+
if (experimental) {
|
|
255
|
+
result.experimental = experimental;
|
|
256
|
+
}
|
|
240
257
|
if (search) {
|
|
241
258
|
result.search = search;
|
|
242
259
|
}
|
|
@@ -256,6 +273,16 @@ var ConfigRegistry = class {
|
|
|
256
273
|
if (layer?.model) {
|
|
257
274
|
merged.model = { ...merged.model, ...layer.model };
|
|
258
275
|
}
|
|
276
|
+
if (layer?.experimental) {
|
|
277
|
+
const nextExperimental = layer.experimental;
|
|
278
|
+
merged.experimental ??= {};
|
|
279
|
+
if (nextExperimental.openai) {
|
|
280
|
+
merged.experimental.openai = {
|
|
281
|
+
...merged.experimental.openai ?? {},
|
|
282
|
+
...nextExperimental.openai
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
259
286
|
if (layer?.permissions) {
|
|
260
287
|
const nextAllow = layer.permissions.allow ?? [];
|
|
261
288
|
const nextDeny = layer.permissions.deny ?? [];
|