@nextclaw/nextclaw-ncp-runtime-codex-sdk 0.1.4 → 0.1.6
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/index.js +2 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
mapCodexItemEvent
|
|
7
7
|
} from "./codex-sdk-ncp-event-mapper.js";
|
|
8
|
+
import { buildCodexCliEnv } from "./codex-cli-env.js";
|
|
8
9
|
const require2 = createRequire(import.meta.url);
|
|
9
10
|
const codexLoader = require2("../codex-sdk-loader.cjs");
|
|
10
11
|
function createId(prefix) {
|
|
@@ -32,18 +33,6 @@ function toAbortError(reason) {
|
|
|
32
33
|
error.name = "AbortError";
|
|
33
34
|
return error;
|
|
34
35
|
}
|
|
35
|
-
function buildCliEnv(config) {
|
|
36
|
-
const env = {
|
|
37
|
-
...config.env ?? {}
|
|
38
|
-
};
|
|
39
|
-
if (config.apiKey.trim()) {
|
|
40
|
-
env.OPENAI_API_KEY = config.apiKey;
|
|
41
|
-
}
|
|
42
|
-
if (config.apiBase?.trim()) {
|
|
43
|
-
env.OPENAI_BASE_URL = config.apiBase.trim();
|
|
44
|
-
}
|
|
45
|
-
return Object.keys(env).length > 0 ? env : void 0;
|
|
46
|
-
}
|
|
47
36
|
function normalizeThreadOptions(options, model) {
|
|
48
37
|
return {
|
|
49
38
|
...options,
|
|
@@ -199,7 +188,7 @@ class CodexSdkNcpAgentRuntime {
|
|
|
199
188
|
}
|
|
200
189
|
async getCodex() {
|
|
201
190
|
if (!this.codexPromise) {
|
|
202
|
-
const env =
|
|
191
|
+
const env = buildCodexCliEnv(this.config);
|
|
203
192
|
this.codexPromise = codexLoader.loadCodexConstructor().then(
|
|
204
193
|
(Ctor) => new Ctor({
|
|
205
194
|
apiKey: this.config.apiKey,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/nextclaw-ncp-runtime-codex-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Optional NCP runtime adapter backed by OpenAI Codex SDK.",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@openai/codex-sdk": "^0.107.0",
|
|
20
|
-
"@nextclaw/ncp": "0.
|
|
20
|
+
"@nextclaw/ncp": "0.4.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^20.17.6",
|