agent-loft 0.2.105 → 0.2.106
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/package.json +1 -1
- package/src/agents/health.ts +3 -1
package/package.json
CHANGED
package/src/agents/health.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { spawn, spawnSync } from "node:child_process";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import path from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
8
9
|
import { agentEnvironment } from "../core/agent-env.js";
|
|
9
10
|
import { config } from "../core/config.js";
|
|
10
11
|
import { withProbe } from "./claude/probe.js";
|
|
@@ -210,7 +211,8 @@ async function piHealth(): Promise<AgentHealth> {
|
|
|
210
211
|
}
|
|
211
212
|
let version: string | undefined;
|
|
212
213
|
try {
|
|
213
|
-
|
|
214
|
+
// SDK 只有 import 导出,require.resolve 解不到,得走 import.meta.resolve
|
|
215
|
+
const v = (require(path.join(path.dirname(fileURLToPath(import.meta.resolve("@earendil-works/pi-coding-agent"))), "..", "package.json")) as { version?: string }).version;
|
|
214
216
|
version = v ? `SDK ${v}` : undefined;
|
|
215
217
|
} catch {
|
|
216
218
|
return {
|