priorcase 0.3.0 → 0.5.2
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/bin/prior.js +27 -3
- package/package.json +5 -5
package/bin/prior.js
CHANGED
|
@@ -17,7 +17,10 @@ const { spawnSync } = require("child_process");
|
|
|
17
17
|
const { existsSync } = require("fs");
|
|
18
18
|
const path = require("path");
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// **npm 의 플랫폼 이름과 Go 의 GOOS 가 다르다.** node 는 win32, Go 는 windows 다
|
|
21
|
+
// (그리고 64비트에서도 win32 다 — 역사적 이름이라 안 바뀐다). 패키지 이름은 node 가
|
|
22
|
+
// 보는 쪽을 따른다: 이 표를 잘못 적으면 윈도우 사용자가 "no binary" 로 튕긴다.
|
|
23
|
+
const PKG = { darwin: "darwin", linux: "linux", win32: "win32" };
|
|
21
24
|
const ARCH = { arm64: "arm64", x64: "x64" };
|
|
22
25
|
|
|
23
26
|
function binaryPath() {
|
|
@@ -33,19 +36,40 @@ function binaryPath() {
|
|
|
33
36
|
// require.resolve 가 node_modules 해석을 대신한다 — 경로를 직접 짜면
|
|
34
37
|
// pnpm·yarn PnP 같은 배치에서 깨진다.
|
|
35
38
|
const entry = require.resolve(`${pkg}/package.json`);
|
|
36
|
-
|
|
39
|
+
// 윈도우 실행파일에는 확장자가 붙는다. 없으면 spawnSync 가 못 찾는다.
|
|
40
|
+
const exe = process.platform === "win32" ? "prior.exe" : "prior";
|
|
41
|
+
const p = path.join(path.dirname(entry), "bin", exe);
|
|
37
42
|
return existsSync(p) ? p : null;
|
|
38
43
|
} catch {
|
|
39
44
|
return null;
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
|
48
|
+
// **지원 목록을 손으로 적지 않는다.** 이 목록은 `optionalDependencies` 와 같아야
|
|
49
|
+
// 하는데, 손으로 적으면 갈린다 — 실제로 v0.5.0 에서 win32 를 게시하지 못한 채
|
|
50
|
+
// 목록에는 남아 있어서, 윈도우 사용자에게 "지원한다, `--include=optional` 로 다시
|
|
51
|
+
// 받아라" 라고 **없는 패키지를 가리키는** 안내가 나갈 뻔했다.
|
|
52
|
+
//
|
|
53
|
+
// 포장 스크립트가 실제로 게시한 것만 optionalDependencies 에 넣으므로(npm-pack.sh 의 §),
|
|
54
|
+
// 여기서 그것을 읽으면 안내가 언제나 사실이다.
|
|
55
|
+
function supportedTargets() {
|
|
56
|
+
try {
|
|
57
|
+
const deps = require("../package.json").optionalDependencies || {};
|
|
58
|
+
return Object.keys(deps)
|
|
59
|
+
.map((n) => n.replace(/^priorcase-/, ""))
|
|
60
|
+
.sort();
|
|
61
|
+
} catch {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
43
66
|
const bin = binaryPath();
|
|
44
67
|
if (!bin) {
|
|
45
68
|
const target = `${process.platform}-${process.arch}`;
|
|
69
|
+
const supported = supportedTargets();
|
|
46
70
|
process.stderr.write(
|
|
47
71
|
`priorcase: no binary for ${target}.\n` +
|
|
48
|
-
` Supported:
|
|
72
|
+
(supported.length ? ` Supported: ${supported.join(", ")}.\n` : "") +
|
|
49
73
|
` If your platform is listed, the optional dependency did not install —\n` +
|
|
50
74
|
` try: npm install --include=optional priorcase\n`
|
|
51
75
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "priorcase",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Record your agent's decisions and surface them at the next judgment point",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"node": ">=18"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"priorcase-darwin-arm64": "0.
|
|
28
|
-
"priorcase-darwin-x64": "0.
|
|
29
|
-
"priorcase-linux-arm64": "0.
|
|
30
|
-
"priorcase-linux-x64": "0.
|
|
27
|
+
"priorcase-darwin-arm64": "0.5.2",
|
|
28
|
+
"priorcase-darwin-x64": "0.5.2",
|
|
29
|
+
"priorcase-linux-arm64": "0.5.2",
|
|
30
|
+
"priorcase-linux-x64": "0.5.2"
|
|
31
31
|
}
|
|
32
32
|
}
|