axconfig 3.4.0 → 3.4.2
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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini settings.json helpers.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Read existing settings.json, returning empty object if not found.
|
|
6
|
+
* Throws if file exists but contains invalid JSON to prevent data loss.
|
|
7
|
+
*/
|
|
8
|
+
export declare function readExistingSettings(settingsPath: string): Record<string, unknown>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini settings.json helpers.
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
+
/**
|
|
6
|
+
* Read existing settings.json, returning empty object if not found.
|
|
7
|
+
* Throws if file exists but contains invalid JSON to prevent data loss.
|
|
8
|
+
*/
|
|
9
|
+
export function readExistingSettings(settingsPath) {
|
|
10
|
+
if (!existsSync(settingsPath)) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const content = readFileSync(settingsPath, "utf8");
|
|
15
|
+
return JSON.parse(content);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
19
|
+
throw new Error(`Failed to parse existing settings at ${settingsPath}: ${message}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
package/dist/agents/gemini.js
CHANGED
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
* - Bash patterns via commandPrefix
|
|
9
9
|
* - Does NOT support path restrictions
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import { mkdirSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { atomicWriteFileSync } from "../atomic-write.js";
|
|
14
14
|
import { registerConfigBuilder } from "../builder.js";
|
|
15
15
|
// Re-export reader
|
|
16
16
|
export { geminiConfigReader } from "./gemini-reader.js";
|
|
17
|
+
import { readExistingSettings } from "./gemini-settings.js";
|
|
17
18
|
/** Gemini CLI tool name mapping */
|
|
18
19
|
const TOOL_MAP = {
|
|
19
20
|
read: "read_file",
|
|
@@ -56,23 +57,6 @@ commandPrefix = ${prefixValue}
|
|
|
56
57
|
decision = "${decision}"
|
|
57
58
|
priority = ${priority}`;
|
|
58
59
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Read existing settings.json, returning empty object if not found.
|
|
61
|
-
* Throws if file exists but contains invalid JSON to prevent data loss.
|
|
62
|
-
*/
|
|
63
|
-
function readExistingSettings(settingsPath) {
|
|
64
|
-
if (!existsSync(settingsPath)) {
|
|
65
|
-
return {};
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
const content = readFileSync(settingsPath, "utf8");
|
|
69
|
-
return JSON.parse(content);
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
73
|
-
throw new Error(`Failed to parse existing settings at ${settingsPath}: ${message}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
60
|
/**
|
|
77
61
|
* Build Gemini CLI configuration.
|
|
78
62
|
*
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "axconfig",
|
|
3
3
|
"author": "Łukasz Jerciński",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "3.4.
|
|
5
|
+
"version": "3.4.2",
|
|
6
6
|
"description": "Unified configuration management for AI coding agents - common API for permissions, settings, and config across Claude Code, Codex, Gemini CLI, and OpenCode",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@commander-js/extra-typings": "^14.0.0",
|
|
70
70
|
"@iarna/toml": "^2.2.5",
|
|
71
|
-
"axshared": "^1.7.
|
|
71
|
+
"axshared": "^1.7.1",
|
|
72
72
|
"commander": "^14.0.2"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|