axconfig 3.0.0 → 3.0.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.
- package/dist/agents/opencode.js +10 -8
- package/package.json +2 -2
package/dist/agents/opencode.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
|
-
import {
|
|
13
|
+
import { buildAgentRuntimeEnvironment } from "axshared";
|
|
14
14
|
import { atomicWriteFileSync } from "../atomic-write.js";
|
|
15
15
|
import { registerConfigBuilder } from "../builder.js";
|
|
16
16
|
// Re-export reader
|
|
@@ -62,11 +62,9 @@ function build(config, output) {
|
|
|
62
62
|
if (errors.length > 0) {
|
|
63
63
|
return { ok: false, errors };
|
|
64
64
|
}
|
|
65
|
-
// OpenCode
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
mkdirSync(openCodeDirectory, { recursive: true });
|
|
69
|
-
const configPath = path.join(openCodeDirectory, "opencode.json");
|
|
65
|
+
// OpenCode config is at {configDir}/opencode.json
|
|
66
|
+
// The output directory is used directly as the config directory.
|
|
67
|
+
const configPath = path.join(output, "opencode.json");
|
|
70
68
|
// Build permission config
|
|
71
69
|
const permissionConfig = {};
|
|
72
70
|
if (permissions) {
|
|
@@ -156,11 +154,15 @@ function build(config, output) {
|
|
|
156
154
|
permission: permissionConfig,
|
|
157
155
|
};
|
|
158
156
|
atomicWriteFileSync(configPath, JSON.stringify(openCodeConfig, undefined, 2));
|
|
157
|
+
// Build environment variables:
|
|
158
|
+
// - OPENCODE_CONFIG_DIR: axpoint convention for config directory
|
|
159
|
+
// - XDG_DATA_HOME/XDG_CONFIG_HOME: OpenCode uses these for auth and other XDG-based paths
|
|
160
|
+
const runtimeEnvironment = buildAgentRuntimeEnvironment("opencode", output);
|
|
159
161
|
return {
|
|
160
162
|
ok: true,
|
|
161
163
|
env: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
OPENCODE_CONFIG_DIR: output,
|
|
165
|
+
...runtimeEnvironment,
|
|
164
166
|
},
|
|
165
167
|
warnings,
|
|
166
168
|
};
|
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.0.
|
|
5
|
+
"version": "3.0.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",
|
|
@@ -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.
|
|
71
|
+
"axshared": "^1.3.0",
|
|
72
72
|
"commander": "^14.0.2"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|