@codelia/config-loader 0.1.13 → 0.1.15
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 +18 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +17 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
removeMcpServerConfig: () => removeMcpServerConfig,
|
|
38
38
|
setMcpServerEnabled: () => setMcpServerEnabled,
|
|
39
39
|
updateModelConfig: () => updateModelConfig,
|
|
40
|
+
updateTuiConfig: () => updateTuiConfig,
|
|
40
41
|
upsertMcpServerConfig: () => upsertMcpServerConfig
|
|
41
42
|
});
|
|
42
43
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -213,6 +214,22 @@ var appendPermissionAllowRules = async (configPath, rules) => {
|
|
|
213
214
|
var appendPermissionAllowRule = async (configPath, rule) => {
|
|
214
215
|
return appendPermissionAllowRules(configPath, [rule]);
|
|
215
216
|
};
|
|
217
|
+
var updateTuiConfig = async (configPath, tui) => {
|
|
218
|
+
const raw = await readConfigRaw(configPath) ?? {};
|
|
219
|
+
const version = ensureVersion(raw, configPath);
|
|
220
|
+
const currentTui = isRecord(raw.tui) ? raw.tui : {};
|
|
221
|
+
const nextTui = {
|
|
222
|
+
...currentTui,
|
|
223
|
+
...pickDefined(tui)
|
|
224
|
+
};
|
|
225
|
+
const nextRaw = {
|
|
226
|
+
...raw,
|
|
227
|
+
version,
|
|
228
|
+
tui: nextTui
|
|
229
|
+
};
|
|
230
|
+
await writeConfigRaw(configPath, nextRaw);
|
|
231
|
+
return (0, import_config.parseConfig)(nextRaw, configPath);
|
|
232
|
+
};
|
|
216
233
|
// Annotate the CommonJS export names for ESM import in node:
|
|
217
234
|
0 && (module.exports = {
|
|
218
235
|
appendPermissionAllowRule,
|
|
@@ -222,5 +239,6 @@ var appendPermissionAllowRule = async (configPath, rule) => {
|
|
|
222
239
|
removeMcpServerConfig,
|
|
223
240
|
setMcpServerEnabled,
|
|
224
241
|
updateModelConfig,
|
|
242
|
+
updateTuiConfig,
|
|
225
243
|
upsertMcpServerConfig
|
|
226
244
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PermissionRule, CodeliaConfig, McpServerConfig, ModelConfig } from '@codelia/config';
|
|
1
|
+
import { PermissionRule, CodeliaConfig, McpServerConfig, ModelConfig, TuiConfig } from '@codelia/config';
|
|
2
2
|
|
|
3
3
|
declare const loadConfig: (configPath: string) => Promise<CodeliaConfig | null>;
|
|
4
4
|
declare const updateModelConfig: (configPath: string, model: ModelConfig) => Promise<CodeliaConfig>;
|
|
@@ -8,5 +8,6 @@ declare const removeMcpServerConfig: (configPath: string, serverId: string) => P
|
|
|
8
8
|
declare const setMcpServerEnabled: (configPath: string, serverId: string, enabled: boolean) => Promise<boolean>;
|
|
9
9
|
declare const appendPermissionAllowRules: (configPath: string, rules: PermissionRule[]) => Promise<CodeliaConfig>;
|
|
10
10
|
declare const appendPermissionAllowRule: (configPath: string, rule: PermissionRule) => Promise<CodeliaConfig>;
|
|
11
|
+
declare const updateTuiConfig: (configPath: string, tui: TuiConfig) => Promise<CodeliaConfig>;
|
|
11
12
|
|
|
12
|
-
export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateModelConfig, upsertMcpServerConfig };
|
|
13
|
+
export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateModelConfig, updateTuiConfig, upsertMcpServerConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PermissionRule, CodeliaConfig, McpServerConfig, ModelConfig } from '@codelia/config';
|
|
1
|
+
import { PermissionRule, CodeliaConfig, McpServerConfig, ModelConfig, TuiConfig } from '@codelia/config';
|
|
2
2
|
|
|
3
3
|
declare const loadConfig: (configPath: string) => Promise<CodeliaConfig | null>;
|
|
4
4
|
declare const updateModelConfig: (configPath: string, model: ModelConfig) => Promise<CodeliaConfig>;
|
|
@@ -8,5 +8,6 @@ declare const removeMcpServerConfig: (configPath: string, serverId: string) => P
|
|
|
8
8
|
declare const setMcpServerEnabled: (configPath: string, serverId: string, enabled: boolean) => Promise<boolean>;
|
|
9
9
|
declare const appendPermissionAllowRules: (configPath: string, rules: PermissionRule[]) => Promise<CodeliaConfig>;
|
|
10
10
|
declare const appendPermissionAllowRule: (configPath: string, rule: PermissionRule) => Promise<CodeliaConfig>;
|
|
11
|
+
declare const updateTuiConfig: (configPath: string, tui: TuiConfig) => Promise<CodeliaConfig>;
|
|
11
12
|
|
|
12
|
-
export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateModelConfig, upsertMcpServerConfig };
|
|
13
|
+
export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateModelConfig, updateTuiConfig, upsertMcpServerConfig };
|
package/dist/index.js
CHANGED
|
@@ -172,6 +172,22 @@ var appendPermissionAllowRules = async (configPath, rules) => {
|
|
|
172
172
|
var appendPermissionAllowRule = async (configPath, rule) => {
|
|
173
173
|
return appendPermissionAllowRules(configPath, [rule]);
|
|
174
174
|
};
|
|
175
|
+
var updateTuiConfig = async (configPath, tui) => {
|
|
176
|
+
const raw = await readConfigRaw(configPath) ?? {};
|
|
177
|
+
const version = ensureVersion(raw, configPath);
|
|
178
|
+
const currentTui = isRecord(raw.tui) ? raw.tui : {};
|
|
179
|
+
const nextTui = {
|
|
180
|
+
...currentTui,
|
|
181
|
+
...pickDefined(tui)
|
|
182
|
+
};
|
|
183
|
+
const nextRaw = {
|
|
184
|
+
...raw,
|
|
185
|
+
version,
|
|
186
|
+
tui: nextTui
|
|
187
|
+
};
|
|
188
|
+
await writeConfigRaw(configPath, nextRaw);
|
|
189
|
+
return parseConfig(nextRaw, configPath);
|
|
190
|
+
};
|
|
175
191
|
export {
|
|
176
192
|
appendPermissionAllowRule,
|
|
177
193
|
appendPermissionAllowRules,
|
|
@@ -180,5 +196,6 @@ export {
|
|
|
180
196
|
removeMcpServerConfig,
|
|
181
197
|
setMcpServerEnabled,
|
|
182
198
|
updateModelConfig,
|
|
199
|
+
updateTuiConfig,
|
|
183
200
|
upsertMcpServerConfig
|
|
184
201
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codelia/config-loader",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"typecheck": "tsc --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@codelia/config": "0.1.
|
|
23
|
+
"@codelia/config": "0.1.15",
|
|
24
24
|
"cosmiconfig": "^9.0.0"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|