@ailuntz/minilink 0.9.9 → 0.9.10
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/README.md +2 -0
- package/package.json +1 -1
- package/src/config.mjs +3 -3
- package/src/proxy.mjs +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,8 @@ minilink on
|
|
|
26
26
|
|
|
27
27
|
`npm install` 只安装命令;`minilink on` 才接入 Desktop。更新包后再次运行 `minilink on`。
|
|
28
28
|
|
|
29
|
+
MiniLink 始终调用 Desktop 自带的 Codex,不调用先前单独安装的 `codex` 命令。配置和会话仍使用官方的 `CODEX_HOME`(默认 `~/.codex`);MiniLink 自己的启动文件放在 `~/.local/share/minilink`。
|
|
30
|
+
|
|
29
31
|
## 命令
|
|
30
32
|
|
|
31
33
|
| 命令 | 用途 |
|
package/package.json
CHANGED
package/src/config.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, readdirSync, mkdirSync, writeFileSync, renameSync, rmSync, existsSync, realpathSync, accessSync, constants, statSync, copyFileSync, mkdtempSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
|
-
import { resolve, join, dirname
|
|
3
|
+
import { resolve, join, dirname } from 'node:path';
|
|
4
4
|
import { randomUUID, createHash } from 'node:crypto';
|
|
5
5
|
import { execFileSync } from 'node:child_process';
|
|
6
6
|
import { parseEnv } from 'node:util';
|
|
@@ -104,8 +104,8 @@ export function findApp() {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
export function resolveRealCodex(selfPath) {
|
|
107
|
-
const candidate =
|
|
108
|
-
if (!candidate
|
|
107
|
+
const candidate = officialCodex();
|
|
108
|
+
if (!candidate) throw new Error('找不到 ChatGPT 内置 Codex。');
|
|
109
109
|
let actual;
|
|
110
110
|
try { actual = realpathSync(candidate); accessSync(actual, constants.X_OK); } catch { throw new Error('真正的 Codex 不存在或不可执行。'); }
|
|
111
111
|
if (actual === realpathSync(selfPath) || actual === realpathSync(process.execPath)) throw new Error('检测到路由递归调用。');
|
package/src/proxy.mjs
CHANGED
|
@@ -32,7 +32,7 @@ export function isStdioServer(args) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export async function runProxy(args, selfPath) {
|
|
35
|
-
if ((Number.parseInt(setting('ACTIVE'), 10) || 0) >= 8) throw new Error('检测到 minilink
|
|
35
|
+
if ((Number.parseInt(setting('ACTIVE'), 10) || 0) >= 8) throw new Error('检测到 minilink 递归调用。');
|
|
36
36
|
const path = configPath();
|
|
37
37
|
const enabled = readConfig(path).enabled;
|
|
38
38
|
const hadConfig = existsSync(path);
|