irises 1.0.8 → 1.0.9

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.
Files changed (2) hide show
  1. package/bin/iris +9 -4
  2. package/package.json +6 -6
package/bin/iris CHANGED
@@ -18,9 +18,17 @@ const fs = require("fs")
18
18
  const path = require("path")
19
19
  const os = require("os")
20
20
 
21
+ const scriptPath = fs.realpathSync(__filename)
22
+ const scriptDir = path.dirname(scriptPath)
23
+
24
+ // npm 包装器根目录(bin/ 的上级),通过环境变量传给编译后二进制,
25
+ // 解决 PRoot/容器/L2S 等环境下 process.execPath 被虚拟化的问题
26
+ const wrapperRoot = path.resolve(scriptDir, "..")
27
+
21
28
  function run(target) {
22
29
  const result = childProcess.spawnSync(target, process.argv.slice(2), {
23
30
  stdio: "inherit",
31
+ env: Object.assign({}, process.env, { __IRIS_PKG_DIR: wrapperRoot }),
24
32
  })
25
33
  if (result.error) {
26
34
  console.error(result.error.message)
@@ -36,9 +44,6 @@ if (envPath) {
36
44
  run(envPath)
37
45
  }
38
46
 
39
- const scriptPath = fs.realpathSync(__filename)
40
- const scriptDir = path.dirname(scriptPath)
41
-
42
47
  // 2. postinstall 缓存
43
48
  const cached = path.join(scriptDir, ".iris")
44
49
  if (fs.existsSync(cached)) {
@@ -85,7 +90,7 @@ function findBinary(startDir) {
85
90
  }
86
91
  }
87
92
 
88
- const resolved = findBinary(scriptDir)
93
+ const resolved = findBinary(path.resolve(scriptDir, ".."))
89
94
  if (!resolved) {
90
95
  console.error(
91
96
  "未找到当前平台的 Iris 二进制。" +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "irises",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "模块化、可解耦的 AI 聊天框架,支持多平台、多 LLM、工具调用",
5
5
  "license": "GPL-3.0-only",
6
6
  "bin": {
@@ -10,10 +10,10 @@
10
10
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
11
11
  },
12
12
  "optionalDependencies": {
13
- "irises-darwin-x64": "1.0.8",
14
- "irises-linux-x64": "1.0.8",
15
- "irises-darwin-arm64": "1.0.8",
16
- "irises-windows-x64": "1.0.8",
17
- "irises-linux-arm64": "1.0.8"
13
+ "irises-darwin-x64": "1.0.9",
14
+ "irises-linux-x64": "1.0.9",
15
+ "irises-darwin-arm64": "1.0.9",
16
+ "irises-windows-x64": "1.0.9",
17
+ "irises-linux-arm64": "1.0.9"
18
18
  }
19
19
  }