axconfig 3.3.0 → 3.4.1

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.
@@ -1,14 +1,16 @@
1
1
  /**
2
- * Gemini CLI settings utilities.
2
+ * Gemini settings.json helpers.
3
3
  */
4
- type NestedRecord = Record<string, unknown>;
5
4
  /**
6
5
  * Read existing settings.json, returning empty object if not found.
7
6
  * Throws if file exists but contains invalid JSON to prevent data loss.
8
7
  */
9
- export declare function readExistingSettings(settingsPath: string): NestedRecord;
8
+ export declare function readExistingSettings(settingsPath: string): Record<string, unknown>;
10
9
  /**
11
- * Merge existing settings with security.environmentVariableRedaction.enabled = false.
10
+ * Disable Gemini's environment variable redaction for CI compatibility.
11
+ *
12
+ * Gemini CLI sanitizes environment variables in GitHub Actions, which blocks
13
+ * access to REAL_HOME, GH_TOKEN, and other vars needed for shell commands.
14
+ * Disabling redaction allows all parent env vars to pass through.
12
15
  */
13
- export declare function mergeSecuritySettings(existing: NestedRecord): NestedRecord;
14
- export {};
16
+ export declare function disableEnvironmentVariableRedaction(existingSettings: Record<string, unknown>): Record<string, unknown>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Gemini CLI settings utilities.
2
+ * Gemini settings.json helpers.
3
3
  */
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  /**
@@ -20,17 +20,21 @@ export function readExistingSettings(settingsPath) {
20
20
  }
21
21
  }
22
22
  /**
23
- * Merge existing settings with security.environmentVariableRedaction.enabled = false.
23
+ * Disable Gemini's environment variable redaction for CI compatibility.
24
+ *
25
+ * Gemini CLI sanitizes environment variables in GitHub Actions, which blocks
26
+ * access to REAL_HOME, GH_TOKEN, and other vars needed for shell commands.
27
+ * Disabling redaction allows all parent env vars to pass through.
24
28
  */
25
- export function mergeSecuritySettings(existing) {
26
- const security = (existing.security ?? {});
27
- const redaction = (security.environmentVariableRedaction ??
28
- {});
29
+ export function disableEnvironmentVariableRedaction(existingSettings) {
30
+ const existingSecurity = existingSettings.security ?? {};
29
31
  return {
30
- ...existing,
32
+ ...existingSettings,
31
33
  security: {
32
- ...security,
33
- environmentVariableRedaction: { ...redaction, enabled: false },
34
+ ...existingSecurity,
35
+ environmentVariableRedaction: {
36
+ enabled: false,
37
+ },
34
38
  },
35
39
  };
36
40
  }
@@ -12,9 +12,9 @@ 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
- import { mergeSecuritySettings, readExistingSettings, } from "./gemini-settings.js";
16
15
  // Re-export reader
17
16
  export { geminiConfigReader } from "./gemini-reader.js";
17
+ import { disableEnvironmentVariableRedaction, readExistingSettings, } from "./gemini-settings.js";
18
18
  /** Gemini CLI tool name mapping */
19
19
  const TOOL_MAP = {
20
20
  read: "read_file",
@@ -138,13 +138,11 @@ function build(config, output) {
138
138
  const policyPath = path.join(policiesDirectory, "axconfig.toml");
139
139
  const policyContent = rules.filter((r) => r !== "").join("\n\n");
140
140
  atomicWriteFileSync(policyPath, policyContent || "# No rules\n");
141
- // Write settings.json, preserving existing settings (e.g., model)
141
+ // Write settings.json, preserving existing settings and disabling env var redaction
142
142
  const settingsPath = path.join(output, "settings.json");
143
143
  const existingSettings = readExistingSettings(settingsPath);
144
- // Disable Gemini's environment variable redaction so shell commands
145
- // can access tokens like GH_TOKEN in CI environments
146
- const settings = mergeSecuritySettings(existingSettings);
147
- atomicWriteFileSync(settingsPath, JSON.stringify(settings, undefined, 2));
144
+ const mergedSettings = disableEnvironmentVariableRedaction(existingSettings);
145
+ atomicWriteFileSync(settingsPath, JSON.stringify(mergedSettings, undefined, 2));
148
146
  return {
149
147
  ok: true,
150
148
  env: { GEMINI_DIR: output },
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.3.0",
5
+ "version": "3.4.1",
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",