@rbbtsn0w/adg 0.1.0 → 0.1.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/src/adapters/openai.js +18 -6
- package/package.json +1 -1
|
@@ -4,16 +4,28 @@ import { isExposed } from "../components.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Generate a Codex (.codex-plugin/plugin.json) manifest from an ADG manifest.
|
|
6
6
|
*
|
|
7
|
-
* Codex's minimal manifest requires name, version, description and skills.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Codex's minimal manifest requires name, version, description and skills.
|
|
8
|
+
* In the default strict case a declared skills *root* string (e.g. `"./skills/"`)
|
|
9
|
+
* is passed through — Codex consumes the directory form natively, so it
|
|
10
|
+
* discovers new skills without the manifest enumerating them. Every other case
|
|
11
|
+
* (an explicit `skills` array, a partial install `selection`, or `strict: false`)
|
|
12
|
+
* emits the bare skill-id array Codex expects: `manifest.skills` arrays are
|
|
13
|
+
* declared as *paths* (`./skills/foo`), so they are resolved to identifiers
|
|
14
|
+
* rather than passed through. Codex only consumes skills.
|
|
10
15
|
*/
|
|
11
16
|
export function toCodexManifest(pluginDir, manifest, selection) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
let skills;
|
|
18
|
+
if (selection) {
|
|
19
|
+
skills = isExposed(selection, "skills")
|
|
15
20
|
? selection.skills ?? resolveSkills(pluginDir, manifest)
|
|
16
21
|
: [];
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const strict = manifest.strict !== false;
|
|
25
|
+
skills = strict && typeof manifest.skills === "string"
|
|
26
|
+
? manifest.skills
|
|
27
|
+
: resolveSkills(pluginDir, manifest);
|
|
28
|
+
}
|
|
17
29
|
const out = {
|
|
18
30
|
name: manifest.name,
|
|
19
31
|
version: manifest.version,
|