opencode-idea 0.0.22 → 0.0.24
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/README.md +331 -290
- package/package.json +1 -1
- package/skills/idea-run-config-manager/SKILL.md +69 -44
- package/skills/idea-run-config-manager/assets/AGENTS.template.md +97 -43
- package/skills/idea-run-config-manager/assets/types/go-build.md +7 -6
- package/skills/idea-run-config-manager/assets/types/gradle.md +6 -6
- package/skills/idea-run-config-manager/assets/types/maven.md +7 -6
- package/skills/idea-run-config-manager/assets/types/node.md +10 -7
- package/skills/idea-run-config-manager/assets/types/npm.md +29 -27
- package/skills/idea-run-config-manager/assets/types/python.md +39 -31
- package/skills/idea-run-config-manager/assets/types/shell.md +84 -51
- package/skills/idea-standalone/SKILL.md +30 -19
- package/skills/idea-standalone/assets/AGENTS.template.md +94 -41
- package/src/ide-guidance.js +3 -0
- package/src/ide-guidance.template.md +141 -121
- package/src/mcp/enhance.js +13 -3
- package/src/mcp/idea.js +1 -1
- package/src/plugin.js +1226 -1289
- package/src/skill/loader.js +14 -27
package/src/skill/loader.js
CHANGED
|
@@ -22,11 +22,14 @@
|
|
|
22
22
|
// The frontmatter reader below handles only the flat `key: value` form this
|
|
23
23
|
// package writes. It is not a YAML engine and must not grow into one.
|
|
24
24
|
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
25
|
+
// The skills used to carry a `requires:` key (the tools each one is written
|
|
26
|
+
// around), and the plugin registered a skill only when those tools were being
|
|
27
|
+
// served. That gate is gone, together with the key: skills are registered once,
|
|
28
|
+
// when the plugin loads (see `plugin.js`), and a missing tool is handled inside
|
|
29
|
+
// the skill text. Registering only after the tools appeared made the skill
|
|
30
|
+
// invisible until the client reloaded the page. A key left behind would look
|
|
31
|
+
// like it still decided something — it does not: OpenCode never reads it, and
|
|
32
|
+
// nothing in this package does either.
|
|
30
33
|
//
|
|
31
34
|
// The other key is OpenCode's own, written in the portable frontmatter spelling
|
|
32
35
|
// OpenCode documents: a nested `metadata:` block holding
|
|
@@ -80,20 +83,6 @@ export function parseSkillFrontmatter(text, source) {
|
|
|
80
83
|
return fields;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
|
-
/**
|
|
84
|
-
* Split a frontmatter list value: `a, b` -> `['a', 'b']`.
|
|
85
|
-
*
|
|
86
|
-
* @param {string | undefined} value
|
|
87
|
-
* @returns {string[]}
|
|
88
|
-
*/
|
|
89
|
-
function splitList(value) {
|
|
90
|
-
if (!value) return [];
|
|
91
|
-
return value
|
|
92
|
-
.split(',')
|
|
93
|
-
.map((entry) => entry.trim())
|
|
94
|
-
.filter((entry) => entry !== '');
|
|
95
|
-
}
|
|
96
|
-
|
|
97
86
|
/**
|
|
98
87
|
* Read `opencode/autoinvoke` out of the frontmatter, or `undefined` when absent.
|
|
99
88
|
*
|
|
@@ -131,11 +120,10 @@ export function readSkill(id) {
|
|
|
131
120
|
}
|
|
132
121
|
|
|
133
122
|
/**
|
|
134
|
-
*
|
|
123
|
+
* One skill package.
|
|
135
124
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* it is what the caller filters on.
|
|
125
|
+
* `skill` must satisfy `Skill.Info` exactly — nothing of this package's own
|
|
126
|
+
* metadata rides along into the definition OpenCode validates.
|
|
139
127
|
*
|
|
140
128
|
* `autoinvoke` is OpenCode's, so it goes the other way: it ships in the
|
|
141
129
|
* frontmatter as `opencode/autoinvoke` and is translated onto the definition,
|
|
@@ -143,7 +131,7 @@ export function readSkill(id) {
|
|
|
143
131
|
* frontmatter asks for it, so a skill that says nothing keeps the plain shape.
|
|
144
132
|
*
|
|
145
133
|
* @param {string} id Directory name, used as the skill id.
|
|
146
|
-
* @returns {{ skill: { id: string, name: string, description: string, autoinvoke?: boolean, path: string, content: string }
|
|
134
|
+
* @returns {{ skill: { id: string, name: string, description: string, autoinvoke?: boolean, path: string, content: string } }}
|
|
147
135
|
*/
|
|
148
136
|
export function readSkillPackage(id) {
|
|
149
137
|
const file = new URL(`${id}/${SKILL_FILE_NAME}`, SKILLS_DIR);
|
|
@@ -164,14 +152,13 @@ export function readSkillPackage(id) {
|
|
|
164
152
|
path: fileURLToPath(file),
|
|
165
153
|
content: text.replace(FRONTMATTER, '').replace(/^\s+/, '').trimEnd(),
|
|
166
154
|
},
|
|
167
|
-
requires: splitList(fields.requires),
|
|
168
155
|
};
|
|
169
156
|
}
|
|
170
157
|
|
|
171
158
|
/**
|
|
172
|
-
* Every shipped skill, sorted by id
|
|
159
|
+
* Every shipped skill, sorted by id.
|
|
173
160
|
*
|
|
174
|
-
* @returns {Array<{ skill: { id: string, name: string, description: string, autoinvoke?: boolean, path: string, content: string }
|
|
161
|
+
* @returns {Array<{ skill: { id: string, name: string, description: string, autoinvoke?: boolean, path: string, content: string } }>}
|
|
175
162
|
*/
|
|
176
163
|
export function readSkills() {
|
|
177
164
|
return readdirSync(SKILLS_DIR, { withFileTypes: true })
|