@fro.bot/systematic 1.9.0 → 1.10.0
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/cli.js +1 -1
- package/dist/{index-yxbcy3s7.js → index-we4f9de3.js} +17 -11
- package/dist/index.js +1 -1
- package/dist/lib/config.d.ts +2 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33,31 +33,37 @@ function mergeArraysUnique(arr1, arr2) {
|
|
|
33
33
|
return Array.from(set);
|
|
34
34
|
}
|
|
35
35
|
function loadConfig(projectDir) {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const projectConfig = loadJsoncFile(projectConfigPath);
|
|
36
|
+
const paths = getConfigPaths(projectDir);
|
|
37
|
+
const userConfig = loadJsoncFile(paths.userConfig);
|
|
38
|
+
const projectConfig = loadJsoncFile(paths.projectConfig);
|
|
39
|
+
const customConfig = paths.customConfig ? loadJsoncFile(paths.customConfig) : null;
|
|
41
40
|
const result = {
|
|
42
|
-
disabled_skills: mergeArraysUnique(mergeArraysUnique(DEFAULT_CONFIG.disabled_skills, userConfig?.disabled_skills), projectConfig?.disabled_skills),
|
|
43
|
-
disabled_agents: mergeArraysUnique(mergeArraysUnique(DEFAULT_CONFIG.disabled_agents, userConfig?.disabled_agents), projectConfig?.disabled_agents),
|
|
44
|
-
disabled_commands: mergeArraysUnique(mergeArraysUnique(DEFAULT_CONFIG.disabled_commands, userConfig?.disabled_commands), projectConfig?.disabled_commands),
|
|
41
|
+
disabled_skills: mergeArraysUnique(mergeArraysUnique(mergeArraysUnique(DEFAULT_CONFIG.disabled_skills, userConfig?.disabled_skills), projectConfig?.disabled_skills), customConfig?.disabled_skills),
|
|
42
|
+
disabled_agents: mergeArraysUnique(mergeArraysUnique(mergeArraysUnique(DEFAULT_CONFIG.disabled_agents, userConfig?.disabled_agents), projectConfig?.disabled_agents), customConfig?.disabled_agents),
|
|
43
|
+
disabled_commands: mergeArraysUnique(mergeArraysUnique(mergeArraysUnique(DEFAULT_CONFIG.disabled_commands, userConfig?.disabled_commands), projectConfig?.disabled_commands), customConfig?.disabled_commands),
|
|
45
44
|
bootstrap: {
|
|
46
45
|
...DEFAULT_CONFIG.bootstrap,
|
|
47
46
|
...userConfig?.bootstrap,
|
|
48
|
-
...projectConfig?.bootstrap
|
|
47
|
+
...projectConfig?.bootstrap,
|
|
48
|
+
...customConfig?.bootstrap
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
return result;
|
|
52
52
|
}
|
|
53
53
|
function getConfigPaths(projectDir) {
|
|
54
54
|
const homeDir = os.homedir();
|
|
55
|
-
|
|
55
|
+
const customConfigDir = process.env.OPENCODE_CONFIG_DIR?.trim();
|
|
56
|
+
const result = {
|
|
56
57
|
userConfig: path.join(homeDir, ".config/opencode/systematic.json"),
|
|
57
58
|
projectConfig: path.join(projectDir, ".opencode/systematic.json"),
|
|
58
59
|
userDir: path.join(homeDir, ".config/opencode/systematic"),
|
|
59
|
-
projectDir: path.join(projectDir, ".opencode/systematic")
|
|
60
|
+
projectDir: path.join(projectDir, ".opencode/systematic"),
|
|
61
|
+
...customConfigDir && {
|
|
62
|
+
customConfig: path.join(customConfigDir, "systematic.json"),
|
|
63
|
+
customDir: path.join(customConfigDir, "systematic")
|
|
64
|
+
}
|
|
60
65
|
};
|
|
66
|
+
return result;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
// src/lib/frontmatter.ts
|
package/dist/index.js
CHANGED
package/dist/lib/config.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export interface SystematicConfig {
|
|
|
11
11
|
export declare const DEFAULT_CONFIG: SystematicConfig;
|
|
12
12
|
export declare function loadConfig(projectDir: string): SystematicConfig;
|
|
13
13
|
export declare function getConfigPaths(projectDir: string): {
|
|
14
|
+
customConfig?: string | undefined;
|
|
15
|
+
customDir?: string | undefined;
|
|
14
16
|
userConfig: string;
|
|
15
17
|
projectConfig: string;
|
|
16
18
|
userDir: string;
|