ai-jue-adapter-codex 0.2.0 → 0.3.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/capabilities/layout.d.ts +1 -1
- package/dist/capabilities/layout.js +6 -3
- package/dist/capabilities/layout.js.map +1 -1
- package/dist/capabilities/mcp.d.ts +10 -24
- package/dist/capabilities/mcp.js +43 -41
- package/dist/capabilities/mcp.js.map +1 -1
- package/dist/capabilities/skills.d.ts +6 -8
- package/dist/capabilities/skills.js +8 -9
- package/dist/capabilities/skills.js.map +1 -1
- package/dist/confirm.d.ts +2 -3
- package/dist/confirm.js +1 -1
- package/dist/confirm.js.map +1 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.js +2 -22
- package/dist/index.js.map +1 -1
- package/dist/read.d.ts +3 -5
- package/dist/read.js +6 -4
- package/dist/read.js.map +1 -1
- package/dist/write.d.ts +5 -23
- package/dist/write.js +29 -25
- package/dist/write.js.map +1 -1
- package/package.json +13 -6
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export type CodexArtifactKind = "project" | "plugin";
|
|
11
11
|
export declare function isProjectLayout(root: string): boolean;
|
|
12
|
-
export declare function detectArtifactKind(root: string): CodexArtifactKind;
|
|
12
|
+
export declare function detectArtifactKind(root: string): CodexArtifactKind | undefined;
|
|
@@ -13,8 +13,11 @@ function isProjectLayout(root) {
|
|
|
13
13
|
fs_1.default.existsSync(path_1.default.join(root, "AGENTS.md")));
|
|
14
14
|
}
|
|
15
15
|
function detectArtifactKind(root) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (fs_1.default.existsSync(path_1.default.join(root, ".codex-plugin", "plugin.json"))) {
|
|
17
|
+
return "plugin";
|
|
18
|
+
}
|
|
19
|
+
if (isProjectLayout(root))
|
|
20
|
+
return "project";
|
|
21
|
+
return undefined;
|
|
19
22
|
}
|
|
20
23
|
//# sourceMappingURL=layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/capabilities/layout.ts"],"names":[],"mappings":";;;;;AAcA,0CAMC;AAED,
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/capabilities/layout.ts"],"names":[],"mappings":";;;;;AAcA,0CAMC;AAED,gDAMC;AA5BD,4CAAoB;AACpB,gDAAwB;AAaxB,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,CACL,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACxC,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;QACvD,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAC5C,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAAC,IAAY;IAC7C,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC;QACnE,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,eAAe,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
import type { CapabilityMapping } from "ai-jue-core";
|
|
2
|
+
import type { CodexArtifactKind } from "./layout";
|
|
3
|
+
export interface CanonicalMcp {
|
|
4
|
+
servers: Record<string, any>;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
|
-
* Codex MCP
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* toNative boundary: we treat the file as a "JSON-ish document" with our
|
|
9
|
-
* own conversion. In practice this is best-effort — for the contract
|
|
10
|
-
* suite's narrow use, the input is JSON-shaped and we wrap it.
|
|
11
|
-
*
|
|
12
|
-
* Per JUE-104/105, verified live fields: `command`, `args`, `cwd`, `url`,
|
|
13
|
-
* `env` (map), `env_vars` (allow-list of names to pass through, NOT a
|
|
14
|
-
* list of key=value pairs), `bearer_token_env_var`, `enabled`,
|
|
15
|
-
* `enabled_tools`, `disabled_tools`, `startup_timeout_sec`, `tool_timeout_sec`.
|
|
16
|
-
*
|
|
17
|
-
* NOTE: This mapping treats the file as JSON for round-trip simplicity,
|
|
18
|
-
* not TOML. Project config (approval_policy, model, sandbox_mode) lives in
|
|
19
|
-
* the same file under flat keys — those are handled by the project-config
|
|
20
|
-
* mapping elsewhere, not here. The current round-trip of `[mcp_servers]`
|
|
21
|
-
* is therefore a no-op for now; the Adapter reports `unsupported`-equivalent
|
|
22
|
-
* for MCP servers at the on-disk file level (Codex's real MCP config shape
|
|
23
|
-
* is TOML, and the JUE-301 honest "lack of a tighter native validator"
|
|
24
|
-
* stance applies here too — we acknowledge the gap rather than fabricate a
|
|
25
|
-
* TOML parser inside a JSON-shaped abstraction).
|
|
7
|
+
* Codex MCP:
|
|
8
|
+
* - project → still degraded (TOML `[mcp_servers.*]` in `.codex/config.toml`;
|
|
9
|
+
* no TOML writer — honest no-op, JUE-301)
|
|
10
|
+
* - plugin → root `.mcp.json` (same portable shape as Claude plugins / OpenClaw
|
|
11
|
+
* compatible bundles; RFC-0002)
|
|
26
12
|
*/
|
|
27
|
-
export declare function mcp(): CapabilityMapping<Record<string, unknown>>;
|
|
13
|
+
export declare function mcp(artifactKind?: CodexArtifactKind): CapabilityMapping<CanonicalMcp | Record<string, unknown>>;
|
package/dist/capabilities/mcp.js
CHANGED
|
@@ -7,43 +7,43 @@ exports.mcp = mcp;
|
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const ai_jue_core_1 = require("ai-jue-core");
|
|
10
|
+
function toCanonicalMcp(native) {
|
|
11
|
+
const servers = native.mcpServers && typeof native.mcpServers === "object" ? native.mcpServers : native;
|
|
12
|
+
for (const [name, server] of Object.entries(servers)) {
|
|
13
|
+
(0, ai_jue_core_1.assertNoLiteralCredentials)(server, `Codex MCP server "${name}"`);
|
|
14
|
+
}
|
|
15
|
+
return { servers };
|
|
16
|
+
}
|
|
17
|
+
function toNativeMcp(canonical) {
|
|
18
|
+
const projectScoped = {};
|
|
19
|
+
for (const [name, server] of Object.entries(canonical.servers ?? {})) {
|
|
20
|
+
const scope = server.scope ?? "project";
|
|
21
|
+
if (scope !== "project") {
|
|
22
|
+
throw new Error(`Codex Plugin MCP server "${name}" uses scope "${scope}". ` +
|
|
23
|
+
'Plugin Artifacts only support "project" scope; refusing to drop the server silently.');
|
|
24
|
+
}
|
|
25
|
+
const { scope: _scope, ...rest } = server;
|
|
26
|
+
projectScoped[name] = rest;
|
|
27
|
+
}
|
|
28
|
+
return Object.keys(projectScoped).length > 0 ? { mcpServers: projectScoped } : undefined;
|
|
29
|
+
}
|
|
10
30
|
/**
|
|
11
|
-
* Codex MCP
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* toNative boundary: we treat the file as a "JSON-ish document" with our
|
|
17
|
-
* own conversion. In practice this is best-effort — for the contract
|
|
18
|
-
* suite's narrow use, the input is JSON-shaped and we wrap it.
|
|
19
|
-
*
|
|
20
|
-
* Per JUE-104/105, verified live fields: `command`, `args`, `cwd`, `url`,
|
|
21
|
-
* `env` (map), `env_vars` (allow-list of names to pass through, NOT a
|
|
22
|
-
* list of key=value pairs), `bearer_token_env_var`, `enabled`,
|
|
23
|
-
* `enabled_tools`, `disabled_tools`, `startup_timeout_sec`, `tool_timeout_sec`.
|
|
24
|
-
*
|
|
25
|
-
* NOTE: This mapping treats the file as JSON for round-trip simplicity,
|
|
26
|
-
* not TOML. Project config (approval_policy, model, sandbox_mode) lives in
|
|
27
|
-
* the same file under flat keys — those are handled by the project-config
|
|
28
|
-
* mapping elsewhere, not here. The current round-trip of `[mcp_servers]`
|
|
29
|
-
* is therefore a no-op for now; the Adapter reports `unsupported`-equivalent
|
|
30
|
-
* for MCP servers at the on-disk file level (Codex's real MCP config shape
|
|
31
|
-
* is TOML, and the JUE-301 honest "lack of a tighter native validator"
|
|
32
|
-
* stance applies here too — we acknowledge the gap rather than fabricate a
|
|
33
|
-
* TOML parser inside a JSON-shaped abstraction).
|
|
31
|
+
* Codex MCP:
|
|
32
|
+
* - project → still degraded (TOML `[mcp_servers.*]` in `.codex/config.toml`;
|
|
33
|
+
* no TOML writer — honest no-op, JUE-301)
|
|
34
|
+
* - plugin → root `.mcp.json` (same portable shape as Claude plugins / OpenClaw
|
|
35
|
+
* compatible bundles; RFC-0002)
|
|
34
36
|
*/
|
|
35
|
-
function mcp() {
|
|
37
|
+
function mcp(artifactKind = "project") {
|
|
38
|
+
if (artifactKind === "plugin") {
|
|
39
|
+
return (0, ai_jue_core_1.mergedJsonFile)({
|
|
40
|
+
filePath: (root) => path_1.default.join(root, ".mcp.json"),
|
|
41
|
+
toCanonical: toCanonicalMcp,
|
|
42
|
+
toNative: toNativeMcp,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
36
45
|
return {
|
|
37
46
|
read(root) {
|
|
38
|
-
// Codex's MCP config lives in the same TOML file as project settings;
|
|
39
|
-
// a real TOML-aware mapping is out of scope per the JUE-301 honest
|
|
40
|
-
// unsupported stance. The shared `mergedJsonFile` factory would try
|
|
41
|
-
// to JSON.parse a TOML file and throw — handle both missing-file
|
|
42
|
-
// and non-JSON-content cases by returning undefined. The sensitive-
|
|
43
|
-
// reference fixture is JSON-shaped on purpose so the security
|
|
44
|
-
// check (literal-credential detection) can fire here, matching the
|
|
45
|
-
// same `assertNoLiteralCredentials` contract every other Adapter
|
|
46
|
-
// uses.
|
|
47
47
|
const filePath = path_1.default.join(root, ".codex", "config.toml");
|
|
48
48
|
if (!fs_1.default.existsSync(filePath))
|
|
49
49
|
return undefined;
|
|
@@ -53,7 +53,7 @@ function mcp() {
|
|
|
53
53
|
parsed = JSON.parse(raw);
|
|
54
54
|
}
|
|
55
55
|
catch {
|
|
56
|
-
return undefined;
|
|
56
|
+
return undefined;
|
|
57
57
|
}
|
|
58
58
|
const servers = parsed.mcpServers;
|
|
59
59
|
if (servers) {
|
|
@@ -61,16 +61,18 @@ function mcp() {
|
|
|
61
61
|
(0, ai_jue_core_1.assertNoLiteralCredentials)(server, `codex-mcp-server-${name}`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return servers;
|
|
64
|
+
return servers ? { servers } : undefined;
|
|
65
65
|
},
|
|
66
66
|
write(_root, value, _target) {
|
|
67
|
-
if (!value ||
|
|
67
|
+
if (!value || typeof value !== "object")
|
|
68
|
+
return [];
|
|
69
|
+
const servers = "servers" in value && value.servers && typeof value.servers === "object"
|
|
70
|
+
? value.servers
|
|
71
|
+
: value;
|
|
72
|
+
if (!servers || Object.keys(servers).length === 0)
|
|
68
73
|
return [];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(0, ai_jue_core_1.assertNoLiteralCredentials)(json, "codex-mcp");
|
|
72
|
-
// Don't actually write — TOML format is out of scope. Returning []
|
|
73
|
-
// keeps the contract trivially satisfied.
|
|
74
|
+
(0, ai_jue_core_1.assertNoLiteralCredentials)(JSON.stringify(servers), "codex-mcp");
|
|
75
|
+
// Project TOML write remains out of scope.
|
|
74
76
|
return [];
|
|
75
77
|
},
|
|
76
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/capabilities/mcp.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/capabilities/mcp.ts"],"names":[],"mappings":";;;;;AA0CA,kBAwCC;AAlFD,4CAAoB;AACpB,gDAAwB;AACxB,6CAAyE;AAQzE,SAAS,cAAc,CAAC,MAAW;IACjC,MAAM,OAAO,G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KAAsB,CAAC,OAAO;gBACjC,CAAC,CAAE,KAAiC,CAAC;YACzC,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,EAAE,CAAC;YAC7D,IAAA,wCAA0B,EAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;YACjE,2CAA2C;YAC3C,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { CapabilityMapping } from "ai-jue-core";
|
|
2
|
+
import type { CodexArtifactKind } from "./layout";
|
|
2
3
|
/**
|
|
3
|
-
* Codex Skills
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* matching JUE-301's documented carry-over warning). `directoryPerItem`
|
|
8
|
-
* matches the exact shape; bundleKeys enables the same attachments Claude
|
|
9
|
-
* supports.
|
|
4
|
+
* Codex Skills:
|
|
5
|
+
* - project → `.agents/skills/<name>/SKILL.md` (JUE-301)
|
|
6
|
+
* - plugin → root `skills/<name>/SKILL.md` (marketplace / OpenClaw bundle shape;
|
|
7
|
+
* matches fixtures/plugin and RFC-0002)
|
|
10
8
|
*/
|
|
11
|
-
export declare function skills(): CapabilityMapping<Record<string, unknown>>;
|
|
9
|
+
export declare function skills(artifactKind?: CodexArtifactKind): CapabilityMapping<Record<string, unknown>>;
|
|
@@ -7,17 +7,16 @@ exports.skills = skills;
|
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const ai_jue_core_1 = require("ai-jue-core");
|
|
9
9
|
/**
|
|
10
|
-
* Codex Skills
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* matching JUE-301's documented carry-over warning). `directoryPerItem`
|
|
15
|
-
* matches the exact shape; bundleKeys enables the same attachments Claude
|
|
16
|
-
* supports.
|
|
10
|
+
* Codex Skills:
|
|
11
|
+
* - project → `.agents/skills/<name>/SKILL.md` (JUE-301)
|
|
12
|
+
* - plugin → root `skills/<name>/SKILL.md` (marketplace / OpenClaw bundle shape;
|
|
13
|
+
* matches fixtures/plugin and RFC-0002)
|
|
17
14
|
*/
|
|
18
|
-
function skills() {
|
|
15
|
+
function skills(artifactKind = "project") {
|
|
19
16
|
return (0, ai_jue_core_1.directoryPerItem)({
|
|
20
|
-
dirPath: (root) =>
|
|
17
|
+
dirPath: (root) => artifactKind === "plugin"
|
|
18
|
+
? path_1.default.join(root, "skills")
|
|
19
|
+
: path_1.default.join(root, ".agents", "skills"),
|
|
21
20
|
mainFileName: "SKILL.md",
|
|
22
21
|
bundleKeys: ["references", "scripts", "assets"],
|
|
23
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/capabilities/skills.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/capabilities/skills.ts"],"names":[],"mappings":";;;;;AAWA,wBAWC;AAtBD,gDAAwB;AACxB,6CAA+C;AAI/C;;;;;GAKG;AACH,SAAgB,MAAM,CACpB,eAAkC,SAAS;IAE3C,OAAO,IAAA,8BAAgB,EAAC;QACtB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,YAAY,KAAK,QAAQ;YACvB,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;YAC3B,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC;QAC1C,YAAY,EAAE,UAAU;QACxB,UAAU,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC;KAChD,CAAC,CAAC;AACL,CAAC"}
|
package/dist/confirm.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ArtifactResult, Confirmation } from "ai-jue-core";
|
|
2
|
-
export interface ConfirmContext {
|
|
3
|
-
projectRoot: string;
|
|
1
|
+
import type { ArtifactResult, Confirmation, ConfirmContext as CoreConfirmContext } from "ai-jue-core";
|
|
2
|
+
export interface ConfirmContext extends CoreConfirmContext {
|
|
4
3
|
artifactKind?: "project" | "plugin";
|
|
5
4
|
}
|
|
6
5
|
/**
|
package/dist/confirm.js
CHANGED
|
@@ -26,7 +26,7 @@ async function confirm(_results, context) {
|
|
|
26
26
|
if ((context.artifactKind ?? "project") !== "plugin") {
|
|
27
27
|
return { target: TARGET, status: "unconfirmed" };
|
|
28
28
|
}
|
|
29
|
-
if (!fs_1.default.existsSync(path_1.default.join(context.
|
|
29
|
+
if (!fs_1.default.existsSync(path_1.default.join(context.artifactRoot, ".codex-plugin", "plugin.json"))) {
|
|
30
30
|
return { target: TARGET, status: "failed", evidence: "no .codex-plugin/plugin.json in fixture root" };
|
|
31
31
|
}
|
|
32
32
|
// Build a throwaway marketplace whose only entry points at the generated
|
package/dist/confirm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../src/confirm.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../src/confirm.ts"],"names":[],"mappings":";;;;;AAyBA,0BA2EC;AApGD,iDAA6C;AAC7C,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AAOxB,MAAM,MAAM,GAAG,OAAO,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,OAAO,CAC3B,QAA0B,EAC1B,OAAuB;IAEvB,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,SAAS,CAAC,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IACnD,CAAC;IAED,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,OA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B,QAAQ,EAAE,SAAS,KAAK,CAAC,OAAO,8FAA8F;SAC/H,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAC/E,CAAC;YAAS,CAAC;QACT,YAAE,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
export { read } from "./read";
|
|
2
|
-
export type { ReadContext } from "./read";
|
|
3
|
-
export { write } from "./write";
|
|
4
|
-
export type { WriteContext } from "./write";
|
|
5
|
-
export { confirm } from "./confirm";
|
|
6
|
-
export type { ConfirmContext } from "./confirm";
|
|
7
|
-
/**
|
|
8
|
-
* `jue apply`'s Codex entry point: converts a resolved config into
|
|
9
|
-
* `CanonicalDocument`, computes the Artifact via `write()`, and applies the
|
|
10
|
-
* result to `outputDir`. `tools.codex` (target-private passthrough
|
|
11
|
-
* settings, never part of Canonical) flows through separately as
|
|
12
|
-
* `WriteContext` extensions in the future; for now it's read-side
|
|
13
|
-
* (config.toml passthrough via `agents` and the project-config keys).
|
|
14
|
-
*/
|
|
15
|
-
export declare function generate(config: any, outputDir: string): Promise<void>;
|
|
16
1
|
declare const _default: import("ai-jue-core").ExtensionDefinition;
|
|
17
2
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.confirm = exports.write = exports.read = void 0;
|
|
4
|
-
exports.generate = generate;
|
|
5
3
|
const ai_jue_core_1 = require("ai-jue-core");
|
|
6
4
|
const confirm_1 = require("./confirm");
|
|
7
5
|
const read_1 = require("./read");
|
|
8
6
|
const write_1 = require("./write");
|
|
9
|
-
var read_2 = require("./read");
|
|
10
|
-
Object.defineProperty(exports, "read", { enumerable: true, get: function () { return read_2.read; } });
|
|
11
|
-
var write_2 = require("./write");
|
|
12
|
-
Object.defineProperty(exports, "write", { enumerable: true, get: function () { return write_2.write; } });
|
|
13
|
-
var confirm_2 = require("./confirm");
|
|
14
|
-
Object.defineProperty(exports, "confirm", { enumerable: true, get: function () { return confirm_2.confirm; } });
|
|
15
|
-
/**
|
|
16
|
-
* `jue apply`'s Codex entry point: converts a resolved config into
|
|
17
|
-
* `CanonicalDocument`, computes the Artifact via `write()`, and applies the
|
|
18
|
-
* result to `outputDir`. `tools.codex` (target-private passthrough
|
|
19
|
-
* settings, never part of Canonical) flows through separately as
|
|
20
|
-
* `WriteContext` extensions in the future; for now it's read-side
|
|
21
|
-
* (config.toml passthrough via `agents` and the project-config keys).
|
|
22
|
-
*/
|
|
23
|
-
async function generate(config, outputDir) {
|
|
24
|
-
const canonical = (0, ai_jue_core_1.toCanonicalDocument)(config);
|
|
25
|
-
const changes = await (0, write_1.write)(canonical, { projectRoot: outputDir, artifactKind: "project" });
|
|
26
|
-
(0, ai_jue_core_1.applyChangesOrThrow)(outputDir, changes);
|
|
27
|
-
}
|
|
28
7
|
const codexAdapter = {
|
|
29
8
|
id: "codex",
|
|
30
9
|
capabilities: {
|
|
@@ -33,7 +12,8 @@ const codexAdapter = {
|
|
|
33
12
|
skills: "supported",
|
|
34
13
|
agents: "supported",
|
|
35
14
|
hooks: "supported",
|
|
36
|
-
|
|
15
|
+
// Project MCP stays TOML-degraded; Plugin Artifacts write portable `.mcp.json`.
|
|
16
|
+
mcp: "degraded",
|
|
37
17
|
},
|
|
38
18
|
read: read_1.read,
|
|
39
19
|
write: write_1.write,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,6CAA8C;AAE9C,uCAAoC;AACpC,iCAA8B;AAC9B,mCAAgC;AAEhC,MAAM,YAAY,GAAY;IAC5B,EAAE,EAAE,OAAO;IACX,YAAY,EAAE;QACZ,KAAK,EAAE,UAAU,EAAE,+EAA+E;QAClG,QAAQ,EAAE,UAAU,EAAE,sEAAsE;QAC5F,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,WAAW;QAClB,gFAAgF;QAChF,GAAG,EAAE,UAAU;KAChB;IACD,IAAI,EAAJ,WAAI;IACJ,KAAK,EAAL,aAAK;IACL,OAAO,EAAP,iBAAO;CACR,CAAC;AAEF,kBAAe,IAAA,6BAAe,EAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/read.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { CanonicalDocument } from "ai-jue-core";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare function read({ projectRoot }: ReadContext): Promise<CanonicalDocument>;
|
|
1
|
+
import type { CanonicalDocument, ReadContext as CoreReadContext } from "ai-jue-core";
|
|
2
|
+
export type ReadContext = CoreReadContext;
|
|
3
|
+
export declare function read({ artifactRoot }: ReadContext): Promise<CanonicalDocument>;
|
package/dist/read.js
CHANGED
|
@@ -5,18 +5,20 @@ const ai_jue_core_1 = require("ai-jue-core");
|
|
|
5
5
|
const agents_1 = require("./capabilities/agents");
|
|
6
6
|
const commands_1 = require("./capabilities/commands");
|
|
7
7
|
const context_1 = require("./capabilities/context");
|
|
8
|
+
const layout_1 = require("./capabilities/layout");
|
|
8
9
|
const hooks_1 = require("./capabilities/hooks");
|
|
9
10
|
const mcp_1 = require("./capabilities/mcp");
|
|
10
11
|
const skills_1 = require("./capabilities/skills");
|
|
11
|
-
async function read({
|
|
12
|
+
async function read({ artifactRoot }) {
|
|
13
|
+
const artifactKind = (0, layout_1.detectArtifactKind)(artifactRoot) ?? "project";
|
|
12
14
|
const canonical = (0, ai_jue_core_1.readCapabilities)({
|
|
13
15
|
context: (0, context_1.context)(),
|
|
14
16
|
commands: (0, commands_1.commands)(),
|
|
15
17
|
agents: (0, agents_1.agents)(),
|
|
16
|
-
skills: (0, skills_1.skills)(),
|
|
18
|
+
skills: (0, skills_1.skills)(artifactKind),
|
|
17
19
|
hooks: (0, hooks_1.hooks)(),
|
|
18
|
-
mcp: (0, mcp_1.mcp)(),
|
|
19
|
-
},
|
|
20
|
+
mcp: (0, mcp_1.mcp)(artifactKind),
|
|
21
|
+
}, artifactRoot);
|
|
20
22
|
return (0, ai_jue_core_1.toCanonicalDocument)(canonical);
|
|
21
23
|
}
|
|
22
24
|
//# sourceMappingURL=read.js.map
|
package/dist/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":";;AAYA,oBAcC;AA1BD,6CAAoE;AAEpE,kDAA+C;AAC/C,sDAAmD;AACnD,oDAAiD;AACjD,kDAA2D;AAC3D,gDAA6C;AAC7C,4CAAyC;AACzC,kDAA+C;AAIxC,KAAK,UAAU,IAAI,CAAC,EAAE,YAAY,EAAe;IACtD,MAAM,YAAY,GAAG,IAAA,2BAAkB,EAAC,YAAY,CAAC,IAAI,SAAS,CAAC;IACnE,MAAM,SAAS,GAAG,IAAA,8BAAgB,EAChC;QACE,OAAO,EAAE,IAAA,iBAAO,GAAE;QAClB,QAAQ,EAAE,IAAA,mBAAQ,GAAE;QACpB,MAAM,EAAE,IAAA,eAAM,GAAE;QAChB,MAAM,EAAE,IAAA,eAAM,EAAC,YAAY,CAAC;QAC5B,KAAK,EAAE,IAAA,aAAK,GAAE;QACd,GAAG,EAAE,IAAA,SAAG,EAAC,YAAY,CAAC;KACvB,EACD,YAAY,CACb,CAAC;IACF,OAAO,IAAA,iCAAmB,EAAC,SAA+C,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/write.d.ts
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
import type { ArtifactChange, CanonicalDocument } from "ai-jue-core";
|
|
2
|
-
|
|
3
|
-
export interface WriteContext {
|
|
4
|
-
projectRoot: string;
|
|
5
|
-
artifactKind?: "project" | "plugin";
|
|
6
|
-
pluginManifest?: CodexPluginManifest;
|
|
7
|
-
}
|
|
1
|
+
import type { ArtifactChange, CanonicalDocument, WriteContext as CoreWriteContext } from "ai-jue-core";
|
|
2
|
+
export type WriteContext = CoreWriteContext;
|
|
8
3
|
/**
|
|
9
4
|
* Computes the `ArtifactChange[]` needed to make a Codex project or Plugin
|
|
10
5
|
* directory match `canonical`, without performing I/O itself — Core
|
|
11
6
|
* executes approved changes (per the Adapter/Core split frozen in JUE-103's
|
|
12
|
-
* Extension Host).
|
|
13
|
-
* `./capabilities/*` and driven through the shared capability-mapping
|
|
14
|
-
* engine; the hand-written `agents` mapping exists because Codex agents
|
|
15
|
-
* are TOML, not the Markdown+frontmatter shape any factory produces.
|
|
7
|
+
* Extension Host).
|
|
16
8
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `mcp` is similarly a no-op (Codex MCP lives in the same TOML file as
|
|
20
|
-
* project settings; a real TOML parser is out of scope per the JUE-301
|
|
21
|
-
* honest-unsupported stance).
|
|
22
|
-
*
|
|
23
|
-
* For Plugin Artifacts, if `pluginManifest` is not explicitly provided we
|
|
24
|
-
* try to copy the existing on-disk manifest (e.g. a fixture's
|
|
25
|
-
* `.codex-plugin/plugin.json`) — this lets the contract test round-trip
|
|
26
|
-
* a Plugin fixture's manifest without forcing every caller to re-supply it.
|
|
27
|
-
* If neither is present, the manifest is left untouched (a manifest-less
|
|
28
|
-
* Plugin is Codex's documented `--plugin-dir` auto-discovery mode).
|
|
9
|
+
* Plugin mode writes portable `skills/` + `.mcp.json` (RFC-0002 / OpenClaw
|
|
10
|
+
* compatible-bundle). Project mode keeps MCP as an honest TOML no-op.
|
|
29
11
|
*/
|
|
30
12
|
export declare function write(canonical: CanonicalDocument, writeContext: WriteContext): Promise<ArtifactChange[]>;
|
package/dist/write.js
CHANGED
|
@@ -20,53 +20,57 @@ const TARGET = "codex";
|
|
|
20
20
|
* Computes the `ArtifactChange[]` needed to make a Codex project or Plugin
|
|
21
21
|
* directory match `canonical`, without performing I/O itself — Core
|
|
22
22
|
* executes approved changes (per the Adapter/Core split frozen in JUE-103's
|
|
23
|
-
* Extension Host).
|
|
24
|
-
* `./capabilities/*` and driven through the shared capability-mapping
|
|
25
|
-
* engine; the hand-written `agents` mapping exists because Codex agents
|
|
26
|
-
* are TOML, not the Markdown+frontmatter shape any factory produces.
|
|
23
|
+
* Extension Host).
|
|
27
24
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* `mcp` is similarly a no-op (Codex MCP lives in the same TOML file as
|
|
31
|
-
* project settings; a real TOML parser is out of scope per the JUE-301
|
|
32
|
-
* honest-unsupported stance).
|
|
33
|
-
*
|
|
34
|
-
* For Plugin Artifacts, if `pluginManifest` is not explicitly provided we
|
|
35
|
-
* try to copy the existing on-disk manifest (e.g. a fixture's
|
|
36
|
-
* `.codex-plugin/plugin.json`) — this lets the contract test round-trip
|
|
37
|
-
* a Plugin fixture's manifest without forcing every caller to re-supply it.
|
|
38
|
-
* If neither is present, the manifest is left untouched (a manifest-less
|
|
39
|
-
* Plugin is Codex's documented `--plugin-dir` auto-discovery mode).
|
|
25
|
+
* Plugin mode writes portable `skills/` + `.mcp.json` (RFC-0002 / OpenClaw
|
|
26
|
+
* compatible-bundle). Project mode keeps MCP as an honest TOML no-op.
|
|
40
27
|
*/
|
|
41
28
|
async function write(canonical, writeContext) {
|
|
42
|
-
const artifactKind = writeContext.artifactKind ?? ((0, layout_1.isProjectLayout)(writeContext.
|
|
29
|
+
const artifactKind = (writeContext.artifactKind ?? ((0, layout_1.isProjectLayout)(writeContext.artifactRoot) ? "project" : "project"));
|
|
43
30
|
let changes = (0, ai_jue_core_1.writeCapabilities)({
|
|
44
31
|
commands: (0, commands_1.commands)(),
|
|
45
32
|
agents: (0, agents_1.agents)(),
|
|
46
|
-
skills: (0, skills_1.skills)(),
|
|
33
|
+
skills: (0, skills_1.skills)(artifactKind),
|
|
47
34
|
hooks: (0, hooks_1.hooks)(),
|
|
48
|
-
mcp: (0, mcp_1.mcp)(),
|
|
49
|
-
}, canonical, writeContext.
|
|
35
|
+
mcp: (0, mcp_1.mcp)(artifactKind),
|
|
36
|
+
}, canonical, writeContext.artifactRoot, TARGET);
|
|
50
37
|
if (artifactKind === "project" && canonical.context?.global) {
|
|
51
|
-
changes.push(...(0, context_1.context)().write(writeContext.
|
|
38
|
+
changes.push(...(0, context_1.context)().write(writeContext.artifactRoot, { global: canonical.context.global }, TARGET));
|
|
52
39
|
}
|
|
53
40
|
if (artifactKind === "plugin") {
|
|
54
41
|
let manifest = writeContext.pluginManifest;
|
|
55
42
|
if (!manifest) {
|
|
56
43
|
// Try to read an existing on-disk manifest (a fixture's own).
|
|
57
|
-
const existingManifestPath = path_1.default.join(writeContext.
|
|
44
|
+
const existingManifestPath = path_1.default.join(writeContext.artifactRoot, ".codex-plugin", "plugin.json");
|
|
58
45
|
if (fs_1.default.existsSync(existingManifestPath)) {
|
|
59
46
|
try {
|
|
60
47
|
manifest = JSON.parse(fs_1.default.readFileSync(existingManifestPath, "utf8"));
|
|
61
48
|
}
|
|
62
49
|
catch {
|
|
63
|
-
|
|
50
|
+
throw new Error(`Codex Plugin manifest at ${existingManifestPath} is not valid JSON; refusing to replace it implicitly.`);
|
|
64
51
|
}
|
|
65
52
|
}
|
|
66
53
|
}
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
const candidate = manifest ?? {
|
|
55
|
+
name: "jue-plugin",
|
|
56
|
+
version: "0.1.0",
|
|
57
|
+
description: "Generated by ai-jue",
|
|
58
|
+
};
|
|
59
|
+
if (typeof candidate.name !== "string" ||
|
|
60
|
+
!candidate.name.trim() ||
|
|
61
|
+
typeof candidate.version !== "string" ||
|
|
62
|
+
!candidate.version.trim()) {
|
|
63
|
+
throw new Error(`Codex Plugin manifest at ${path_1.default.join(writeContext.artifactRoot, ".codex-plugin", "plugin.json")} must contain non-empty name and version fields.`);
|
|
69
64
|
}
|
|
65
|
+
manifest = {
|
|
66
|
+
...candidate,
|
|
67
|
+
name: candidate.name.trim(),
|
|
68
|
+
version: candidate.version.trim(),
|
|
69
|
+
description: typeof candidate.description === "string" && candidate.description.trim()
|
|
70
|
+
? candidate.description.trim()
|
|
71
|
+
: "Generated by ai-jue",
|
|
72
|
+
};
|
|
73
|
+
changes.push(...(0, manifest_1.writeCodexPluginManifest)(writeContext.artifactRoot, manifest, TARGET));
|
|
70
74
|
}
|
|
71
75
|
return changes;
|
|
72
76
|
}
|
package/dist/write.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":";;;;;AA8BA,sBAsEC;AApGD,4CAAoB;AACpB,gDAAwB;AACxB,6CAAgD;AAMhD,kDAA+C;AAC/C,sDAAmD;AACnD,oDAAiD;AACjD,kDAAgF;AAChF,gDAA6C;AAC7C,4CAAyC;AACzC,sDAA6F;AAC7F,kDAA+C;AAI/C,MAAM,MAAM,GAAG,OAAO,CAAC;AAEvB;;;;;;;;GAQG;AACI,KAAK,UAAU,KAAK,CACzB,SAA4B,E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4
|
"description": "Adapter for generating project-scoped Codex configurations.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
7
14
|
"scripts": {
|
|
8
15
|
"build": "tsc"
|
|
9
16
|
},
|
|
10
17
|
"dependencies": {
|
|
11
|
-
"
|
|
12
|
-
},
|
|
13
|
-
"peerDependencies": {
|
|
14
|
-
"ai-jue-core": "*"
|
|
18
|
+
"@iarna/toml": "^2.2.5"
|
|
15
19
|
},
|
|
16
20
|
"devDependencies": {
|
|
17
|
-
"
|
|
21
|
+
"ai-jue-core": "^2.0.0"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"ai-jue-core": "^2.0.0"
|
|
18
25
|
},
|
|
19
26
|
"author": "AI-Jue Team <contact@ai-jue.dev>",
|
|
20
27
|
"license": "MIT",
|