@nextclaw/nextclaw-ncp-runtime-codex-sdk 0.1.6 → 0.1.7
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/codex-cli-env.d.ts +7 -0
- package/dist/codex-cli-env.js +36 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
function readString(value) {
|
|
2
|
+
if (typeof value !== "string") {
|
|
3
|
+
return void 0;
|
|
4
|
+
}
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
function copyProcessEnv() {
|
|
8
|
+
const env = {};
|
|
9
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
10
|
+
const normalized = readString(value);
|
|
11
|
+
if (normalized === void 0) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
env[key] = normalized;
|
|
15
|
+
}
|
|
16
|
+
return env;
|
|
17
|
+
}
|
|
18
|
+
function buildCodexCliEnv(config) {
|
|
19
|
+
const env = copyProcessEnv();
|
|
20
|
+
for (const [key, value] of Object.entries(config.env ?? {})) {
|
|
21
|
+
if (typeof value !== "string") {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
env[key] = value;
|
|
25
|
+
}
|
|
26
|
+
if (config.apiKey.trim()) {
|
|
27
|
+
env.OPENAI_API_KEY = config.apiKey;
|
|
28
|
+
}
|
|
29
|
+
if (config.apiBase?.trim()) {
|
|
30
|
+
env.OPENAI_BASE_URL = config.apiBase.trim();
|
|
31
|
+
}
|
|
32
|
+
return Object.keys(env).length > 0 ? env : void 0;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
buildCodexCliEnv
|
|
36
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CodexOptions, ThreadOptions } from '@openai/codex-sdk';
|
|
2
|
-
import {
|
|
2
|
+
import { NcpAgentRunInput, NcpAgentConversationStateManager, NcpAgentRuntime, NcpAgentRunOptions, NcpEndpointEvent } from '@nextclaw/ncp';
|
|
3
3
|
|
|
4
4
|
type CodexSdkNcpAgentRuntimeConfig = {
|
|
5
5
|
sessionId: string;
|