@codelia/config-loader 0.1.81 → 0.1.82

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 CHANGED
@@ -36,6 +36,7 @@ __export(index_exports, {
36
36
  loadMcpServers: () => loadMcpServers,
37
37
  removeMcpServerConfig: () => removeMcpServerConfig,
38
38
  setMcpServerEnabled: () => setMcpServerEnabled,
39
+ updateImageGenerationConfig: () => updateImageGenerationConfig,
39
40
  updateModelConfig: () => updateModelConfig,
40
41
  updateTuiConfig: () => updateTuiConfig,
41
42
  upsertMcpServerConfig: () => upsertMcpServerConfig
@@ -230,6 +231,14 @@ var updateTuiConfig = async (configPath, tui) => {
230
231
  await writeConfigRaw(configPath, nextRaw);
231
232
  return (0, import_config.parseConfig)(nextRaw, configPath);
232
233
  };
234
+ var updateImageGenerationConfig = async (configPath, image) => {
235
+ const raw = await readConfigRaw(configPath) ?? {};
236
+ const version = ensureVersion(raw, configPath);
237
+ const nextRaw = { ...raw, version, image_generation: image };
238
+ const parsed = (0, import_config.parseConfig)(nextRaw, configPath);
239
+ await writeConfigRaw(configPath, nextRaw);
240
+ return parsed;
241
+ };
233
242
  // Annotate the CommonJS export names for ESM import in node:
234
243
  0 && (module.exports = {
235
244
  appendPermissionAllowRule,
@@ -238,6 +247,7 @@ var updateTuiConfig = async (configPath, tui) => {
238
247
  loadMcpServers,
239
248
  removeMcpServerConfig,
240
249
  setMcpServerEnabled,
250
+ updateImageGenerationConfig,
241
251
  updateModelConfig,
242
252
  updateTuiConfig,
243
253
  upsertMcpServerConfig
package/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _codelia_config from '@codelia/config';
1
2
  import { PermissionRule, CodeliaConfig, McpServerConfig, ModelConfig, TuiConfig } from '@codelia/config';
2
3
 
3
4
  declare const loadConfig: (configPath: string) => Promise<CodeliaConfig | null>;
@@ -9,5 +10,7 @@ declare const setMcpServerEnabled: (configPath: string, serverId: string, enable
9
10
  declare const appendPermissionAllowRules: (configPath: string, rules: PermissionRule[]) => Promise<CodeliaConfig>;
10
11
  declare const appendPermissionAllowRule: (configPath: string, rule: PermissionRule) => Promise<CodeliaConfig>;
11
12
  declare const updateTuiConfig: (configPath: string, tui: TuiConfig) => Promise<CodeliaConfig>;
13
+ /** Replace the image block, preserving unrelated raw configuration. */
14
+ declare const updateImageGenerationConfig: (configPath: string, image: _codelia_config.ImageGenerationConfig) => Promise<CodeliaConfig>;
12
15
 
13
- export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateModelConfig, updateTuiConfig, upsertMcpServerConfig };
16
+ export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateImageGenerationConfig, updateModelConfig, updateTuiConfig, upsertMcpServerConfig };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _codelia_config from '@codelia/config';
1
2
  import { PermissionRule, CodeliaConfig, McpServerConfig, ModelConfig, TuiConfig } from '@codelia/config';
2
3
 
3
4
  declare const loadConfig: (configPath: string) => Promise<CodeliaConfig | null>;
@@ -9,5 +10,7 @@ declare const setMcpServerEnabled: (configPath: string, serverId: string, enable
9
10
  declare const appendPermissionAllowRules: (configPath: string, rules: PermissionRule[]) => Promise<CodeliaConfig>;
10
11
  declare const appendPermissionAllowRule: (configPath: string, rule: PermissionRule) => Promise<CodeliaConfig>;
11
12
  declare const updateTuiConfig: (configPath: string, tui: TuiConfig) => Promise<CodeliaConfig>;
13
+ /** Replace the image block, preserving unrelated raw configuration. */
14
+ declare const updateImageGenerationConfig: (configPath: string, image: _codelia_config.ImageGenerationConfig) => Promise<CodeliaConfig>;
12
15
 
13
- export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateModelConfig, updateTuiConfig, upsertMcpServerConfig };
16
+ export { appendPermissionAllowRule, appendPermissionAllowRules, loadConfig, loadMcpServers, removeMcpServerConfig, setMcpServerEnabled, updateImageGenerationConfig, updateModelConfig, updateTuiConfig, upsertMcpServerConfig };
package/dist/index.js CHANGED
@@ -188,6 +188,14 @@ var updateTuiConfig = async (configPath, tui) => {
188
188
  await writeConfigRaw(configPath, nextRaw);
189
189
  return parseConfig(nextRaw, configPath);
190
190
  };
191
+ var updateImageGenerationConfig = async (configPath, image) => {
192
+ const raw = await readConfigRaw(configPath) ?? {};
193
+ const version = ensureVersion(raw, configPath);
194
+ const nextRaw = { ...raw, version, image_generation: image };
195
+ const parsed = parseConfig(nextRaw, configPath);
196
+ await writeConfigRaw(configPath, nextRaw);
197
+ return parsed;
198
+ };
191
199
  export {
192
200
  appendPermissionAllowRule,
193
201
  appendPermissionAllowRules,
@@ -195,6 +203,7 @@ export {
195
203
  loadMcpServers,
196
204
  removeMcpServerConfig,
197
205
  setMcpServerEnabled,
206
+ updateImageGenerationConfig,
198
207
  updateModelConfig,
199
208
  updateTuiConfig,
200
209
  upsertMcpServerConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codelia/config-loader",
3
- "version": "0.1.81",
3
+ "version": "0.1.82",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  "typecheck": "tsc --noEmit"
22
22
  },
23
23
  "dependencies": {
24
- "@codelia/config": "0.1.81",
24
+ "@codelia/config": "0.1.82",
25
25
  "cosmiconfig": "^9.0.0"
26
26
  },
27
27
  "publishConfig": {