srpllm 1.2.4 → 1.2.5
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/cli.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { i as init, u as uninstall,
|
|
5
|
-
import 'node:child_process';
|
|
4
|
+
import { i as init, u as uninstall, O as version } from './shared/srpllm.CsoL3qR-.mjs';
|
|
6
5
|
import 'node:fs';
|
|
7
6
|
import 'node:os';
|
|
8
7
|
import 'node:process';
|
package/dist/index.d.mts
CHANGED
|
@@ -29,7 +29,6 @@ interface CodexApiConfig {
|
|
|
29
29
|
}
|
|
30
30
|
declare function getExistingCodexConfig(): CodexApiConfig | null;
|
|
31
31
|
declare function writeCodexApiConfig(config: CodexApiConfig): void;
|
|
32
|
-
declare function disableCodexWindowsSandbox(): void;
|
|
33
32
|
declare function clearCodexApiConfig(): void;
|
|
34
33
|
declare function displayCodexConfig(config: CodexApiConfig): void;
|
|
35
34
|
|
|
@@ -130,5 +129,5 @@ declare function getPlatform(): Platform;
|
|
|
130
129
|
declare function isWindows(): boolean;
|
|
131
130
|
declare function commandExists(command: string): Promise<boolean>;
|
|
132
131
|
|
|
133
|
-
export { CLAUDE_DIR, CLAUDE_SETTINGS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODE_TOOL_ALIASES, CODE_TOOL_LABELS, CODE_TOOL_TYPES, DEFAULT_CODE_TOOL_TYPE, MODEL_PREFIX, RELAY_PROVIDER_ID, RELAY_TOOL_TYPES, buildModelsChoices, clearClaudeApiConfig, clearCodexApiConfig, commandExists, detectInstalledVersion,
|
|
132
|
+
export { CLAUDE_DIR, CLAUDE_SETTINGS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODE_TOOL_ALIASES, CODE_TOOL_LABELS, CODE_TOOL_TYPES, DEFAULT_CODE_TOOL_TYPE, MODEL_PREFIX, RELAY_PROVIDER_ID, RELAY_TOOL_TYPES, buildModelsChoices, clearClaudeApiConfig, clearCodexApiConfig, commandExists, detectInstalledVersion, displayClaudeConfig, displayCodexConfig, ensureClaudeDir, fetchModels, filterByPrefix, getExistingClaudeApiConfig, getExistingCodexConfig, getPlatform, init, installTool, isCliTool, isCodeToolType, isToolInstalled, isWindows, readClaudeSettings, readLocalConfig, resolveCodeToolType, selectInstallMethod, uninstall, uninstallTool, updateLocalConfig, writeClaudeApiConfig, writeCodexApiConfig, writeLocalConfig };
|
|
134
133
|
export type { ClaudeApiConfig, CodeToolType, CodexApiConfig, InstallMethod, LocalConfig, RelayToolType, RemoteModel };
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ interface CodexApiConfig {
|
|
|
29
29
|
}
|
|
30
30
|
declare function getExistingCodexConfig(): CodexApiConfig | null;
|
|
31
31
|
declare function writeCodexApiConfig(config: CodexApiConfig): void;
|
|
32
|
-
declare function disableCodexWindowsSandbox(): void;
|
|
33
32
|
declare function clearCodexApiConfig(): void;
|
|
34
33
|
declare function displayCodexConfig(config: CodexApiConfig): void;
|
|
35
34
|
|
|
@@ -130,5 +129,5 @@ declare function getPlatform(): Platform;
|
|
|
130
129
|
declare function isWindows(): boolean;
|
|
131
130
|
declare function commandExists(command: string): Promise<boolean>;
|
|
132
131
|
|
|
133
|
-
export { CLAUDE_DIR, CLAUDE_SETTINGS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODE_TOOL_ALIASES, CODE_TOOL_LABELS, CODE_TOOL_TYPES, DEFAULT_CODE_TOOL_TYPE, MODEL_PREFIX, RELAY_PROVIDER_ID, RELAY_TOOL_TYPES, buildModelsChoices, clearClaudeApiConfig, clearCodexApiConfig, commandExists, detectInstalledVersion,
|
|
132
|
+
export { CLAUDE_DIR, CLAUDE_SETTINGS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODE_TOOL_ALIASES, CODE_TOOL_LABELS, CODE_TOOL_TYPES, DEFAULT_CODE_TOOL_TYPE, MODEL_PREFIX, RELAY_PROVIDER_ID, RELAY_TOOL_TYPES, buildModelsChoices, clearClaudeApiConfig, clearCodexApiConfig, commandExists, detectInstalledVersion, displayClaudeConfig, displayCodexConfig, ensureClaudeDir, fetchModels, filterByPrefix, getExistingClaudeApiConfig, getExistingCodexConfig, getPlatform, init, installTool, isCliTool, isCodeToolType, isToolInstalled, isWindows, readClaudeSettings, readLocalConfig, resolveCodeToolType, selectInstallMethod, uninstall, uninstallTool, updateLocalConfig, writeClaudeApiConfig, writeCodexApiConfig, writeLocalConfig };
|
|
134
133
|
export type { ClaudeApiConfig, CodeToolType, CodexApiConfig, InstallMethod, LocalConfig, RelayToolType, RemoteModel };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { C as CLAUDE_DIR, b as CLAUDE_SETTINGS_FILE, f as CODEX_AUTH_FILE, e as CODEX_CONFIG_FILE, d as CODEX_DIR, j as CODE_TOOL_ALIASES, k as CODE_TOOL_LABELS, h as CODE_TOOL_TYPES, D as DEFAULT_CODE_TOOL_TYPE, M as MODEL_PREFIX, n as RELAY_PROVIDER_ID, R as RELAY_TOOL_TYPES,
|
|
2
|
-
import 'node:child_process';
|
|
1
|
+
export { C as CLAUDE_DIR, b as CLAUDE_SETTINGS_FILE, f as CODEX_AUTH_FILE, e as CODEX_CONFIG_FILE, d as CODEX_DIR, j as CODE_TOOL_ALIASES, k as CODE_TOOL_LABELS, h as CODE_TOOL_TYPES, D as DEFAULT_CODE_TOOL_TYPE, M as MODEL_PREFIX, n as RELAY_PROVIDER_ID, R as RELAY_TOOL_TYPES, L as buildModelsChoices, s as clearClaudeApiConfig, y as clearCodexApiConfig, c as commandExists, B as detectInstalledVersion, t as displayClaudeConfig, z as displayCodexConfig, o as ensureClaudeDir, K as fetchModels, N as filterByPrefix, q as getExistingClaudeApiConfig, v as getExistingCodexConfig, g as getPlatform, i as init, F as installTool, m as isCliTool, l as isCodeToolType, A as isToolInstalled, a as isWindows, p as readClaudeSettings, H as readLocalConfig, r as resolveCodeToolType, E as selectInstallMethod, u as uninstall, G as uninstallTool, J as updateLocalConfig, w as writeClaudeApiConfig, x as writeCodexApiConfig, I as writeLocalConfig } from './shared/srpllm.CsoL3qR-.mjs';
|
|
3
2
|
import 'node:fs';
|
|
4
3
|
import 'node:os';
|
|
5
4
|
import 'node:process';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { execSync } from 'node:child_process';
|
|
2
1
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync, unlinkSync } from 'node:fs';
|
|
3
2
|
import { homedir, platform } from 'node:os';
|
|
4
3
|
import process from 'node:process';
|
|
@@ -285,19 +284,6 @@ function writeCodexApiConfig(config) {
|
|
|
285
284
|
auth.OPENAI_API_KEY = config.token;
|
|
286
285
|
writeJson(CODEX_AUTH_FILE, auth);
|
|
287
286
|
}
|
|
288
|
-
function disableCodexWindowsSandbox() {
|
|
289
|
-
if (!exists(CODEX_CONFIG_FILE))
|
|
290
|
-
return;
|
|
291
|
-
let content = readFileRaw(CODEX_CONFIG_FILE);
|
|
292
|
-
if (content.includes('sandbox = "disabled"'))
|
|
293
|
-
return;
|
|
294
|
-
if (content.match(/^\[windows\]/m)) {
|
|
295
|
-
content = content.replace(/^\[windows\]/m, '[windows]\nsandbox = "disabled"');
|
|
296
|
-
} else {
|
|
297
|
-
content += '\n[windows]\nsandbox = "disabled"\n';
|
|
298
|
-
}
|
|
299
|
-
writeFile(CODEX_CONFIG_FILE, content);
|
|
300
|
-
}
|
|
301
287
|
function clearCodexApiConfig() {
|
|
302
288
|
if (exists(CODEX_CONFIG_FILE)) {
|
|
303
289
|
const backup = `${CODEX_CONFIG_FILE}.backup_${timestamp()}`;
|
|
@@ -332,15 +318,6 @@ function maskToken$1(token) {
|
|
|
332
318
|
return `${token.slice(0, 4)}***${token.slice(-4)}`;
|
|
333
319
|
}
|
|
334
320
|
|
|
335
|
-
const codexConfig = {
|
|
336
|
-
__proto__: null,
|
|
337
|
-
clearCodexApiConfig: clearCodexApiConfig,
|
|
338
|
-
disableCodexWindowsSandbox: disableCodexWindowsSandbox,
|
|
339
|
-
displayCodexConfig: displayCodexConfig,
|
|
340
|
-
getExistingCodexConfig: getExistingCodexConfig,
|
|
341
|
-
writeCodexApiConfig: writeCodexApiConfig
|
|
342
|
-
};
|
|
343
|
-
|
|
344
321
|
function getPlatform() {
|
|
345
322
|
const p = platform();
|
|
346
323
|
if (p === "win32")
|
|
@@ -591,7 +568,7 @@ function filterByPrefix(models, prefix) {
|
|
|
591
568
|
return models.filter((m) => m.id.toLowerCase().startsWith(p));
|
|
592
569
|
}
|
|
593
570
|
|
|
594
|
-
const version = "1.2.
|
|
571
|
+
const version = "1.2.5";
|
|
595
572
|
|
|
596
573
|
function displayBanner(codeTool) {
|
|
597
574
|
const tool = codeTool ? ` ${ansis.gray(`\xB7 ${CODE_TOOL_LABELS[codeTool]}`)}` : "";
|
|
@@ -764,24 +741,6 @@ async function configureCodex(options, baseUrl, token, memory) {
|
|
|
764
741
|
writeCodexApiConfig(config);
|
|
765
742
|
console.log(ansis.green("\n\u2714 Codex \u914D\u7F6E\u5B8C\u6210"));
|
|
766
743
|
displayCodexConfig(config);
|
|
767
|
-
if (process.platform === "win32") {
|
|
768
|
-
try {
|
|
769
|
-
const output = execSync('pwsh -NoProfile -Command "(Get-Command pwsh).Source"', { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] }).trim();
|
|
770
|
-
if (output.includes("WindowsApps")) {
|
|
771
|
-
console.log(ansis.yellow("\n\u26A0 \u68C0\u6D4B\u5230\u4F60\u4F7F\u7528\u7684\u662F\u5FAE\u8F6F\u5546\u5E97\u7248\u7684 PowerShell (pwsh)"));
|
|
772
|
-
console.log(ansis.gray(" \u8FD9\u4F1A\u5BFC\u81F4 Codex \u7684 Windows \u6C99\u76D2\u529F\u80FD\u51FA\u73B0 CreateProcessAsUserW failed: 5 \u6743\u9650\u9519\u8BEF\u3002"));
|
|
773
|
-
const shouldDisable = options.skipPrompt ? true : await confirm("\u662F\u5426\u81EA\u52A8\u5728 Codex \u914D\u7F6E\u4E2D\u5173\u95ED\u6C99\u76D2\u529F\u80FD\u4EE5\u907F\u514D\u62A5\u9519\uFF1F", true);
|
|
774
|
-
if (shouldDisable) {
|
|
775
|
-
const { disableCodexWindowsSandbox } = await Promise.resolve().then(function () { return codexConfig; });
|
|
776
|
-
disableCodexWindowsSandbox();
|
|
777
|
-
console.log(ansis.green("\u2714 \u5DF2\u5728 Codex \u914D\u7F6E\u4E2D\u5173\u95ED\u6C99\u76D2\u529F\u80FD"));
|
|
778
|
-
} else {
|
|
779
|
-
console.log(ansis.yellow("\u2139 \u5DF2\u8DF3\u8FC7\uFF0C\u5982\u679C\u540E\u7EED\u8FD0\u884C\u62A5\u9519\uFF0C\u8BF7\u67E5\u9605\u6587\u6863\u6216\u624B\u52A8\u5173\u95ED\u6C99\u76D2"));
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
} catch {
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
744
|
updateLocalConfig({ codex: { model } });
|
|
786
745
|
}
|
|
787
746
|
function getDownloadsDir() {
|
|
@@ -946,4 +905,4 @@ ${ansis.cyan("\u{1F389} \u6E05\u7406\u5B8C\u6210")}`);
|
|
|
946
905
|
}
|
|
947
906
|
}
|
|
948
907
|
|
|
949
|
-
export {
|
|
908
|
+
export { isToolInstalled as A, detectInstalledVersion as B, CLAUDE_DIR as C, DEFAULT_CODE_TOOL_TYPE as D, selectInstallMethod as E, installTool as F, uninstallTool as G, readLocalConfig as H, writeLocalConfig as I, updateLocalConfig as J, fetchModels as K, buildModelsChoices as L, MODEL_PREFIX as M, filterByPrefix as N, version as O, RELAY_TOOL_TYPES as R, isWindows as a, CLAUDE_SETTINGS_FILE as b, commandExists as c, CODEX_DIR as d, CODEX_CONFIG_FILE as e, CODEX_AUTH_FILE as f, getPlatform as g, CODE_TOOL_TYPES as h, init as i, CODE_TOOL_ALIASES as j, CODE_TOOL_LABELS as k, isCodeToolType as l, isCliTool as m, RELAY_PROVIDER_ID as n, ensureClaudeDir as o, readClaudeSettings as p, getExistingClaudeApiConfig as q, resolveCodeToolType as r, clearClaudeApiConfig as s, displayClaudeConfig as t, uninstall as u, getExistingCodexConfig as v, writeClaudeApiConfig as w, writeCodexApiConfig as x, clearCodexApiConfig as y, displayCodexConfig as z };
|