@omagents/omagents-codex 0.14.2 → 0.16.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/package.json +2 -2
- package/src/setup.js +22 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omagents/omagents-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Codex agent toolkit: bundled skills, MCP servers, native subagents, and superpowers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/setup.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://github.com/omagents/omagents"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@omagents/core": "0.
|
|
28
|
+
"@omagents/core": "0.16.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"test": "node --test test/*.test.js"
|
package/src/setup.js
CHANGED
|
@@ -61,9 +61,14 @@ function copyDir(src, dest) {
|
|
|
61
61
|
|
|
62
62
|
// ─── .mcp.json generation ───────────────────────────────────────────────────
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
const BEARER_TOKEN_ENV_VARS = {
|
|
65
|
+
github: "GITHUB_TOKEN",
|
|
66
|
+
youdotcom: "YDC_API_KEY",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function generateMcpJson(env, { searchProxyEntry } = {}) {
|
|
65
70
|
const servers = {}
|
|
66
|
-
for (const [name, definition] of Object.entries(resolveMcpServers({ env }))) {
|
|
71
|
+
for (const [name, definition] of Object.entries(resolveMcpServers({ env, searchProxyEntry }))) {
|
|
67
72
|
if (definition.command) {
|
|
68
73
|
servers[name] = {
|
|
69
74
|
command: definition.command[0],
|
|
@@ -72,8 +77,9 @@ function generateMcpJson(env) {
|
|
|
72
77
|
}
|
|
73
78
|
} else {
|
|
74
79
|
servers[name] = { url: definition.url }
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
const bearerTokenEnvVar = BEARER_TOKEN_ENV_VARS[name]
|
|
81
|
+
if (definition.headers?.Authorization && bearerTokenEnvVar) {
|
|
82
|
+
servers[name].bearer_token_env_var = bearerTokenEnvVar
|
|
77
83
|
} else if (definition.headers) {
|
|
78
84
|
servers[name].headers = definition.headers
|
|
79
85
|
}
|
|
@@ -198,11 +204,14 @@ export async function installCodex(options = {}) {
|
|
|
198
204
|
}
|
|
199
205
|
|
|
200
206
|
const pkg = readJson(fileURLToPath(new URL("../package.json", import.meta.url)))
|
|
201
|
-
const mcpJson = generateMcpJson(env)
|
|
202
207
|
|
|
203
208
|
// Use "local" as version dir - Codex always prefers it over semver versions
|
|
204
209
|
const cacheDir = path.join(codexHome, "plugins", "cache", "omagents", "omagents", "local")
|
|
205
210
|
const marketplaceRoot = path.join(codexHome, "plugins", "cache", "omagents")
|
|
211
|
+
const searchProxyDest = path.join(cacheDir, "mcp-servers", "search-proxy")
|
|
212
|
+
const mcpJson = generateMcpJson(env, {
|
|
213
|
+
searchProxyEntry: path.join(searchProxyDest, "index.mjs"),
|
|
214
|
+
})
|
|
206
215
|
|
|
207
216
|
console.log(`[omagents] Installing to ${cacheDir}`)
|
|
208
217
|
|
|
@@ -233,7 +242,10 @@ export async function installCodex(options = {}) {
|
|
|
233
242
|
})
|
|
234
243
|
fs.chmodSync(mcpPath, 0o600)
|
|
235
244
|
|
|
236
|
-
// 3.
|
|
245
|
+
// 3. Self-contained Search MCP Proxy runtime
|
|
246
|
+
copyDir(corePaths.searchProxyDir, searchProxyDest)
|
|
247
|
+
|
|
248
|
+
// 4. hooks
|
|
237
249
|
const hooksDir = path.join(cacheDir, "hooks")
|
|
238
250
|
mkdirp(hooksDir)
|
|
239
251
|
fs.writeFileSync(path.join(hooksDir, "hooks.json"), JSON.stringify(HOOKS_CONFIG, null, 2) + "\n")
|
|
@@ -244,7 +256,7 @@ export async function installCodex(options = {}) {
|
|
|
244
256
|
}
|
|
245
257
|
}
|
|
246
258
|
|
|
247
|
-
//
|
|
259
|
+
// 5. Render every discovered skill through Core for Codex.
|
|
248
260
|
const skillsSrc = corePaths.skillsDir
|
|
249
261
|
const skillsDest = path.join(cacheDir, "skills")
|
|
250
262
|
mkdirp(skillsDest)
|
|
@@ -270,7 +282,7 @@ export async function installCodex(options = {}) {
|
|
|
270
282
|
fs.writeFileSync(path.join(skillDestDir, "SKILL.md"), rendered.content)
|
|
271
283
|
}
|
|
272
284
|
|
|
273
|
-
//
|
|
285
|
+
// 6. Copy _shared scripts
|
|
274
286
|
const sharedSrc = path.join(skillsSrc, "_shared")
|
|
275
287
|
if (fs.existsSync(sharedSrc)) {
|
|
276
288
|
copyDir(sharedSrc, path.join(skillsDest, "_shared"))
|
|
@@ -280,7 +292,7 @@ export async function installCodex(options = {}) {
|
|
|
280
292
|
console.warn("[omagents] warning: superpowers skills not found, skipping")
|
|
281
293
|
}
|
|
282
294
|
|
|
283
|
-
//
|
|
295
|
+
// 7. Update config.toml (marketplace registration + plugin enable)
|
|
284
296
|
const configPath = path.join(codexHome, "config.toml")
|
|
285
297
|
const pluginSection = [
|
|
286
298
|
`[marketplaces.omagents]`,
|
|
@@ -293,7 +305,7 @@ export async function installCodex(options = {}) {
|
|
|
293
305
|
updateConfigToml(configPath, pluginSection)
|
|
294
306
|
console.log(`[omagents] Updated ${configPath}`)
|
|
295
307
|
|
|
296
|
-
//
|
|
308
|
+
// 8. Done
|
|
297
309
|
console.log("")
|
|
298
310
|
console.log("[omagents] Installation complete!")
|
|
299
311
|
console.log(`[omagents] Plugin: ${cacheDir}`)
|