@psnext/slingcli 2.5.20260615-1 → 2.5.20260615-2
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.
|
@@ -149,7 +149,7 @@ export const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
149
149
|
if (!apiKey) {
|
|
150
150
|
throw new Error(`No API key for provider: ${model.provider}`);
|
|
151
151
|
}
|
|
152
|
-
const accountId = extractAccountId(apiKey);
|
|
152
|
+
const accountId = extractAccountId(apiKey) || "";
|
|
153
153
|
let body = buildRequestBody(model, context, options);
|
|
154
154
|
const nextBody = await options?.onPayload?.(body, model);
|
|
155
155
|
if (nextBody !== undefined) {
|
|
@@ -321,7 +321,7 @@ function buildRequestBody(model, context, options) {
|
|
|
321
321
|
stream: true,
|
|
322
322
|
instructions: context.systemPrompt || "You are a helpful assistant.",
|
|
323
323
|
input: messages,
|
|
324
|
-
text: { verbosity: options?.textVerbosity || "
|
|
324
|
+
text: { verbosity: options?.textVerbosity || "medium" },
|
|
325
325
|
include: ["reasoning.encrypted_content"],
|
|
326
326
|
prompt_cache_key: clampOpenAIPromptCacheKey(options?.sessionId),
|
|
327
327
|
tool_choice: "auto",
|
|
@@ -378,11 +378,7 @@ function resolveCodexServiceTier(responseServiceTier, requestServiceTier) {
|
|
|
378
378
|
function resolveCodexUrl(baseUrl) {
|
|
379
379
|
const raw = baseUrl && baseUrl.trim().length > 0 ? baseUrl : DEFAULT_CODEX_BASE_URL;
|
|
380
380
|
const normalized = raw.replace(/\/+$/, "");
|
|
381
|
-
|
|
382
|
-
return normalized;
|
|
383
|
-
if (normalized.endsWith("/codex"))
|
|
384
|
-
return `${normalized}/responses`;
|
|
385
|
-
return `${normalized}/codex/responses`;
|
|
381
|
+
return `${normalized}/responses`;
|
|
386
382
|
}
|
|
387
383
|
function resolveCodexWebSocketUrl(baseUrl) {
|
|
388
384
|
const url = new URL(resolveCodexUrl(baseUrl));
|
|
@@ -1119,7 +1115,7 @@ function extractAccountId(token) {
|
|
|
1119
1115
|
try {
|
|
1120
1116
|
const parts = token.split(".");
|
|
1121
1117
|
if (parts.length !== 3)
|
|
1122
|
-
|
|
1118
|
+
return null;
|
|
1123
1119
|
const payload = JSON.parse(atob(parts[1]));
|
|
1124
1120
|
const accountId = payload?.[JWT_CLAIM_PATH]?.chatgpt_account_id;
|
|
1125
1121
|
if (!accountId)
|
|
@@ -1127,7 +1123,7 @@ function extractAccountId(token) {
|
|
|
1127
1123
|
return accountId;
|
|
1128
1124
|
}
|
|
1129
1125
|
catch {
|
|
1130
|
-
|
|
1126
|
+
return null;
|
|
1131
1127
|
}
|
|
1132
1128
|
}
|
|
1133
1129
|
function createCodexRequestId() {
|
|
@@ -1142,7 +1138,9 @@ function buildBaseCodexHeaders(initHeaders, additionalHeaders, accountId, token)
|
|
|
1142
1138
|
headers.set(key, value);
|
|
1143
1139
|
}
|
|
1144
1140
|
headers.set("Authorization", `Bearer ${token}`);
|
|
1145
|
-
|
|
1141
|
+
if (accountId) {
|
|
1142
|
+
headers.set("chatgpt-account-id", accountId);
|
|
1143
|
+
}
|
|
1146
1144
|
headers.set("originator", "sling");
|
|
1147
1145
|
const userAgent = _os ? `sling (${_os.platform()} ${_os.release()}; ${_os.arch()})` : "sling (browser)";
|
|
1148
1146
|
headers.set("User-Agent", userAgent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@psnext/slingcli",
|
|
3
|
-
"version": "2.5.20260615-
|
|
3
|
+
"version": "2.5.20260615-2",
|
|
4
4
|
"description": "Connects Sling CLI to Publicis Sapient Slingshot enterprise LLM gateway. Bundles the pi coding-agent runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"type": "git",
|
|
30
30
|
"url": "git+https://pscode.lioncloud.net/psaiproducts/slingcli.git"
|
|
31
31
|
},
|
|
32
|
-
"slingVersion": "2.5.20260615-
|
|
32
|
+
"slingVersion": "2.5.20260615-2",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.79.3.tgz",
|
|
35
35
|
"@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.79.3.tgz",
|