@superatomai/sdk-node 0.0.91-dsp → 0.0.93-dsp
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 +12 -0
- package/dist/index.mjs +12 -0
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -24832,6 +24832,14 @@ function readCodexConfig(env) {
|
|
|
24832
24832
|
return "";
|
|
24833
24833
|
}
|
|
24834
24834
|
}
|
|
24835
|
+
var CODEX_PATH_ENV = "SA_CODEX_PATH";
|
|
24836
|
+
function codexPathOverride(env = process.env, exists = fs8.existsSync) {
|
|
24837
|
+
const p = env[CODEX_PATH_ENV]?.trim();
|
|
24838
|
+
if (!p) return void 0;
|
|
24839
|
+
if (exists(p)) return p;
|
|
24840
|
+
console.warn(`[codex] ${CODEX_PATH_ENV}=${p} does not exist; using the codex bundled with @openai/codex-sdk`);
|
|
24841
|
+
return void 0;
|
|
24842
|
+
}
|
|
24835
24843
|
function codexDefaultProvider(env = process.env, configToml) {
|
|
24836
24844
|
const choice = env.CODEX_MODEL_PROVIDER?.trim();
|
|
24837
24845
|
if (choice && choice !== "openrouter") return null;
|
|
@@ -24862,6 +24870,8 @@ function codexRunConfig(opts, provider = null) {
|
|
|
24862
24870
|
// the agent with no instructions at all. AGENTS.md still wins if present.
|
|
24863
24871
|
...opts.instructionsFile && opts.instructionsFile !== "AGENTS.md" ? { project_doc_fallback_filenames: [opts.instructionsFile] } : {},
|
|
24864
24872
|
project_doc_max_bytes: CODEX_DOC_MAX_BYTES,
|
|
24873
|
+
// Without it reasoning items arrive empty, so a run shows no thinking.
|
|
24874
|
+
model_reasoning_summary: "detailed",
|
|
24865
24875
|
...provider?.config ?? {},
|
|
24866
24876
|
// Last: a deployment's own value wins.
|
|
24867
24877
|
...opts.extraConfig ?? {}
|
|
@@ -24891,7 +24901,9 @@ function createCodexSession(opts) {
|
|
|
24891
24901
|
if (thread) return thread;
|
|
24892
24902
|
const { Codex } = await loadCodex();
|
|
24893
24903
|
const config2 = codexRunConfig(opts, provider);
|
|
24904
|
+
const codexPath = codexPathOverride();
|
|
24894
24905
|
const codex = new Codex({
|
|
24906
|
+
...codexPath ? { codexPathOverride: codexPath } : {},
|
|
24895
24907
|
...opts.apiKey ? { apiKey: opts.apiKey } : {},
|
|
24896
24908
|
...opts.baseUrl ? { baseUrl: opts.baseUrl } : {},
|
|
24897
24909
|
env: buildEnv(opts, provider),
|
package/dist/index.mjs
CHANGED
|
@@ -24714,6 +24714,14 @@ function readCodexConfig(env) {
|
|
|
24714
24714
|
return "";
|
|
24715
24715
|
}
|
|
24716
24716
|
}
|
|
24717
|
+
var CODEX_PATH_ENV = "SA_CODEX_PATH";
|
|
24718
|
+
function codexPathOverride(env = process.env, exists = fs8.existsSync) {
|
|
24719
|
+
const p = env[CODEX_PATH_ENV]?.trim();
|
|
24720
|
+
if (!p) return void 0;
|
|
24721
|
+
if (exists(p)) return p;
|
|
24722
|
+
console.warn(`[codex] ${CODEX_PATH_ENV}=${p} does not exist; using the codex bundled with @openai/codex-sdk`);
|
|
24723
|
+
return void 0;
|
|
24724
|
+
}
|
|
24717
24725
|
function codexDefaultProvider(env = process.env, configToml) {
|
|
24718
24726
|
const choice = env.CODEX_MODEL_PROVIDER?.trim();
|
|
24719
24727
|
if (choice && choice !== "openrouter") return null;
|
|
@@ -24744,6 +24752,8 @@ function codexRunConfig(opts, provider = null) {
|
|
|
24744
24752
|
// the agent with no instructions at all. AGENTS.md still wins if present.
|
|
24745
24753
|
...opts.instructionsFile && opts.instructionsFile !== "AGENTS.md" ? { project_doc_fallback_filenames: [opts.instructionsFile] } : {},
|
|
24746
24754
|
project_doc_max_bytes: CODEX_DOC_MAX_BYTES,
|
|
24755
|
+
// Without it reasoning items arrive empty, so a run shows no thinking.
|
|
24756
|
+
model_reasoning_summary: "detailed",
|
|
24747
24757
|
...provider?.config ?? {},
|
|
24748
24758
|
// Last: a deployment's own value wins.
|
|
24749
24759
|
...opts.extraConfig ?? {}
|
|
@@ -24773,7 +24783,9 @@ function createCodexSession(opts) {
|
|
|
24773
24783
|
if (thread) return thread;
|
|
24774
24784
|
const { Codex } = await loadCodex();
|
|
24775
24785
|
const config2 = codexRunConfig(opts, provider);
|
|
24786
|
+
const codexPath = codexPathOverride();
|
|
24776
24787
|
const codex = new Codex({
|
|
24788
|
+
...codexPath ? { codexPathOverride: codexPath } : {},
|
|
24777
24789
|
...opts.apiKey ? { apiKey: opts.apiKey } : {},
|
|
24778
24790
|
...opts.baseUrl ? { baseUrl: opts.baseUrl } : {},
|
|
24779
24791
|
env: buildEnv(opts, provider),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superatomai/sdk-node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93-dsp",
|
|
4
4
|
"description": "Node.js TypeScript SDK for Superatom",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
"dist",
|
|
17
17
|
"!dist/**/*.map"
|
|
18
18
|
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc --noEmit && tsup",
|
|
21
|
+
"dev": "tsup --watch",
|
|
22
|
+
"test": "tsx test-sdk.ts",
|
|
23
|
+
"test:unit": "node --import tsx --test tests/unit/*.test.ts",
|
|
24
|
+
"prepublishOnly": "pnpm run build",
|
|
25
|
+
"type-check": "tsc --noEmit"
|
|
26
|
+
},
|
|
19
27
|
"keywords": [
|
|
20
28
|
"superatom",
|
|
21
29
|
"sdk",
|
|
@@ -45,12 +53,5 @@
|
|
|
45
53
|
},
|
|
46
54
|
"optionalDependencies": {
|
|
47
55
|
"@openai/codex-sdk": "0.156.1"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "tsc --noEmit && tsup",
|
|
51
|
-
"dev": "tsup --watch",
|
|
52
|
-
"test": "tsx test-sdk.ts",
|
|
53
|
-
"test:unit": "node --import tsx --test tests/unit/*.test.ts",
|
|
54
|
-
"type-check": "tsc --noEmit"
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
+
}
|