@fro.bot/systematic 1.9.0 → 1.11.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 +15 -4
- package/dist/lib/config-handler.d.ts +2 -0
- 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
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
findSkillsInDir,
|
|
9
9
|
loadConfig,
|
|
10
10
|
parseFrontmatter
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-we4f9de3.js";
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
14
|
import fs3 from "fs";
|
|
@@ -70,7 +70,7 @@ ${toolMapping}
|
|
|
70
70
|
// src/lib/skill-loader.ts
|
|
71
71
|
import path2 from "path";
|
|
72
72
|
var SKILL_PREFIX = "systematic:";
|
|
73
|
-
var SKILL_DESCRIPTION_PREFIX = "(
|
|
73
|
+
var SKILL_DESCRIPTION_PREFIX = "(Systematic - Skill) ";
|
|
74
74
|
function formatSkillCommandName(name) {
|
|
75
75
|
if (name.startsWith(SKILL_PREFIX)) {
|
|
76
76
|
return name;
|
|
@@ -128,6 +128,17 @@ function loadSkill(skillInfo) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// src/lib/config-handler.ts
|
|
131
|
+
function toTitleCase(name) {
|
|
132
|
+
return name.split("-").map((segment) => segment.length > 0 ? segment.charAt(0).toUpperCase() + segment.slice(1) : segment).join("-");
|
|
133
|
+
}
|
|
134
|
+
function formatAgentDescription(name, description) {
|
|
135
|
+
const baseDescription = description || `${name} agent`;
|
|
136
|
+
const suffix = `(${toTitleCase(name)} - Systematic)`;
|
|
137
|
+
if (baseDescription.endsWith(suffix)) {
|
|
138
|
+
return baseDescription;
|
|
139
|
+
}
|
|
140
|
+
return `${baseDescription} ${suffix}`;
|
|
141
|
+
}
|
|
131
142
|
function loadAgentAsConfig(agentInfo) {
|
|
132
143
|
try {
|
|
133
144
|
const converted = convertFileWithCache(agentInfo.file, "agent", {
|
|
@@ -148,7 +159,7 @@ function loadAgentAsConfig(agentInfo) {
|
|
|
148
159
|
permission
|
|
149
160
|
} = extractAgentFrontmatter(converted);
|
|
150
161
|
const config = {
|
|
151
|
-
description:
|
|
162
|
+
description: formatAgentDescription(agentInfo.name, description),
|
|
152
163
|
prompt
|
|
153
164
|
};
|
|
154
165
|
if (model !== undefined)
|
|
@@ -185,7 +196,7 @@ function loadCommandAsConfig(commandInfo) {
|
|
|
185
196
|
const baseDescription = description || `${name || cleanName} command`;
|
|
186
197
|
const config = {
|
|
187
198
|
template: body.trim(),
|
|
188
|
-
description: `(
|
|
199
|
+
description: `(Systematic) ${baseDescription}`
|
|
189
200
|
};
|
|
190
201
|
if (agent !== undefined)
|
|
191
202
|
config.agent = agent;
|
|
@@ -5,6 +5,8 @@ export interface ConfigHandlerDeps {
|
|
|
5
5
|
bundledAgentsDir: string;
|
|
6
6
|
bundledCommandsDir: string;
|
|
7
7
|
}
|
|
8
|
+
export declare function toTitleCase(name: string): string;
|
|
9
|
+
export declare function formatAgentDescription(name: string, description: string | undefined): string;
|
|
8
10
|
/**
|
|
9
11
|
* Create the config hook handler for the Systematic plugin.
|
|
10
12
|
*
|
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;
|