@psnext/slingcli 2.5.20260602-2 → 2.5.20260602-3

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.
@@ -9304,9 +9304,9 @@ export const MODELS = {
9304
9304
  reasoning: true,
9305
9305
  input: ["text"],
9306
9306
  cost: {
9307
- input: 0.3,
9308
- output: 2.5,
9309
- cacheRead: 0.06,
9307
+ input: 0.075,
9308
+ output: 0.625,
9309
+ cacheRead: 0.015,
9310
9310
  cacheWrite: 0,
9311
9311
  },
9312
9312
  contextWindow: 262144,
@@ -147,7 +147,7 @@ export const streamOpenAICodexResponses = (model, context, options) => {
147
147
  if (!apiKey) {
148
148
  throw new Error(`No API key for provider: ${model.provider}`);
149
149
  }
150
- const accountId = extractAccountId(apiKey);
150
+ const accountId = extractAccountId(apiKey) || "";
151
151
  let body = buildRequestBody(model, context, options);
152
152
  const nextBody = await options?.onPayload?.(body, model);
153
153
  if (nextBody !== undefined) {
@@ -319,7 +319,7 @@ function buildRequestBody(model, context, options) {
319
319
  stream: true,
320
320
  instructions: context.systemPrompt || "You are a helpful assistant.",
321
321
  input: messages,
322
- text: { verbosity: options?.textVerbosity || "low" },
322
+ text: { verbosity: options?.textVerbosity || "medium" },
323
323
  include: ["reasoning.encrypted_content"],
324
324
  prompt_cache_key: clampOpenAIPromptCacheKey(options?.sessionId),
325
325
  tool_choice: "auto",
@@ -376,11 +376,7 @@ function resolveCodexServiceTier(responseServiceTier, requestServiceTier) {
376
376
  function resolveCodexUrl(baseUrl) {
377
377
  const raw = baseUrl && baseUrl.trim().length > 0 ? baseUrl : DEFAULT_CODEX_BASE_URL;
378
378
  const normalized = raw.replace(/\/+$/, "");
379
- if (normalized.endsWith("/codex/responses"))
380
- return normalized;
381
- if (normalized.endsWith("/codex"))
382
- return `${normalized}/responses`;
383
- return `${normalized}/codex/responses`;
379
+ return `${normalized}/responses`;
384
380
  }
385
381
  function resolveCodexWebSocketUrl(baseUrl) {
386
382
  const url = new URL(resolveCodexUrl(baseUrl));
@@ -1117,15 +1113,13 @@ function extractAccountId(token) {
1117
1113
  try {
1118
1114
  const parts = token.split(".");
1119
1115
  if (parts.length !== 3)
1120
- throw new Error("Invalid token");
1116
+ return null;
1121
1117
  const payload = JSON.parse(atob(parts[1]));
1122
1118
  const accountId = payload?.[JWT_CLAIM_PATH]?.chatgpt_account_id;
1123
- if (!accountId)
1124
- throw new Error("No account ID in token");
1125
- return accountId;
1119
+ return accountId || null;
1126
1120
  }
1127
1121
  catch {
1128
- throw new Error("Failed to extract accountId from token");
1122
+ return null;
1129
1123
  }
1130
1124
  }
1131
1125
  function createCodexRequestId() {
@@ -1140,7 +1134,9 @@ function buildBaseCodexHeaders(initHeaders, additionalHeaders, accountId, token)
1140
1134
  headers.set(key, value);
1141
1135
  }
1142
1136
  headers.set("Authorization", `Bearer ${token}`);
1143
- headers.set("chatgpt-account-id", accountId);
1137
+ if (accountId) {
1138
+ headers.set("chatgpt-account-id", accountId);
1139
+ }
1144
1140
  headers.set("originator", "pi");
1145
1141
  const userAgent = _os ? `pi (${_os.platform()} ${_os.release()}; ${_os.arch()})` : "pi (browser)";
1146
1142
  headers.set("User-Agent", userAgent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psnext/slingcli",
3
- "version": "2.5.20260602-2",
3
+ "version": "2.5.20260602-3",
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.20260602-2",
32
+ "slingVersion": "2.5.20260602-3",
33
33
  "dependencies": {
34
34
  "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.78.0.tgz",
35
35
  "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.78.0.tgz",