even-pf 0.2.5 → 0.2.7
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/even-pf.js +58 -0
- package/package.json +20 -7
- package/src/{index.ts → cli.ts} +2 -2
- package/src/version.ts +5 -0
package/bin/even-pf.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
5
|
+
const { chmodSync, statSync } = require("fs");
|
|
6
|
+
|
|
7
|
+
// Map process.platform + process.arch to the sub-package name and binary filename
|
|
8
|
+
const PLATFORM_MAP = {
|
|
9
|
+
"linux-x64": { pkg: "even-pf-linux-x64", bin: "even-pf" },
|
|
10
|
+
"linux-arm64": { pkg: "even-pf-linux-arm64", bin: "even-pf" },
|
|
11
|
+
"win32-x64": { pkg: "even-pf-windows-x64", bin: "even-pf.exe" },
|
|
12
|
+
"darwin-x64": { pkg: "even-pf-darwin-x64", bin: "even-pf" },
|
|
13
|
+
"darwin-arm64":{ pkg: "even-pf-darwin-arm64", bin: "even-pf" },
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const key = `${process.platform}-${process.arch}`;
|
|
17
|
+
const entry = PLATFORM_MAP[key];
|
|
18
|
+
|
|
19
|
+
if (!entry) {
|
|
20
|
+
console.error(
|
|
21
|
+
`even-pf: Unsupported platform/architecture: ${key}\n` +
|
|
22
|
+
`Supported: ${Object.keys(PLATFORM_MAP).join(", ")}`
|
|
23
|
+
);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let binaryPath;
|
|
28
|
+
try {
|
|
29
|
+
binaryPath = require.resolve(`${entry.pkg}/bin/${entry.bin}`);
|
|
30
|
+
} catch {
|
|
31
|
+
console.error(
|
|
32
|
+
`even-pf: Could not find the platform binary package "${entry.pkg}".\n` +
|
|
33
|
+
`Try reinstalling even-pf, or install the package manually:\n` +
|
|
34
|
+
` npm install ${entry.pkg}`
|
|
35
|
+
);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Ensure the binary is executable — some environments strip the exec bit on install
|
|
40
|
+
if (process.platform !== "win32") {
|
|
41
|
+
try {
|
|
42
|
+
const mode = statSync(binaryPath).mode;
|
|
43
|
+
if (!(mode & 0o111)) {
|
|
44
|
+
chmodSync(binaryPath, mode | 0o755);
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
// best-effort; if chmod fails, let the spawn attempt proceed and fail naturally
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
52
|
+
|
|
53
|
+
if (result.error) {
|
|
54
|
+
console.error(`even-pf: Failed to launch binary: ${result.error.message}`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
process.exit(result.status ?? 0);
|
package/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "even-pf",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"description": "AI-assisted responsible grading tool for programming assignments",
|
|
5
|
+
"module": "src/cli.ts",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"license": "UNLICENSED",
|
|
7
8
|
"scripts": {
|
|
8
|
-
"start": "bun run src/
|
|
9
|
-
"build": "bun build src/
|
|
9
|
+
"start": "bun run src/cli.ts",
|
|
10
|
+
"build-dev": "bun build src/cli.ts --compile --outfile build/epf",
|
|
11
|
+
"build:all": "bun scripts/build-all.ts",
|
|
12
|
+
"publish:all": "bun scripts/publish-all.ts",
|
|
13
|
+
"publish:dry": "bun scripts/publish-all.ts --dry-run",
|
|
14
|
+
"bump": "bun scripts/bump-version.ts",
|
|
10
15
|
"config-gen": "bun run --console-depth 6 src/generate-config.ts"
|
|
11
16
|
},
|
|
12
17
|
"bin": {
|
|
13
|
-
"even-pf": "
|
|
18
|
+
"even-pf": "bin/even-pf.js"
|
|
14
19
|
},
|
|
15
20
|
"devDependencies": {
|
|
16
21
|
"@types/bun": "latest"
|
|
@@ -24,14 +29,22 @@
|
|
|
24
29
|
"smol-toml": "^1.6.0",
|
|
25
30
|
"zod-defaults": "^0.2.3"
|
|
26
31
|
},
|
|
32
|
+
"optionalDependencies": {
|
|
33
|
+
"even-pf-linux-x64": "0.2.7",
|
|
34
|
+
"even-pf-linux-arm64": "0.2.7",
|
|
35
|
+
"even-pf-windows-x64": "0.2.7",
|
|
36
|
+
"even-pf-darwin-x64": "0.2.7",
|
|
37
|
+
"even-pf-darwin-arm64": "0.2.7"
|
|
38
|
+
},
|
|
27
39
|
"files": [
|
|
40
|
+
"bin/even-pf.js",
|
|
41
|
+
"package.json",
|
|
42
|
+
"README.md",
|
|
28
43
|
".gitignore",
|
|
29
44
|
"src",
|
|
30
45
|
"bun.lock",
|
|
31
46
|
"bunfig.toml",
|
|
32
47
|
"epf.example.toml",
|
|
33
|
-
"package.json",
|
|
34
|
-
"README.md",
|
|
35
48
|
"tsconfig.json"
|
|
36
49
|
]
|
|
37
50
|
}
|
package/src/{index.ts → cli.ts}
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
+
import "./version.ts";
|
|
4
|
+
|
|
3
5
|
import {OpenRouter} from "@openrouter/sdk";
|
|
4
6
|
|
|
5
7
|
import {CONFIG} from "./util/config.ts";
|
|
@@ -9,8 +11,6 @@ import type {WorkflowDependencies} from "./workflow";
|
|
|
9
11
|
import {OutputViewer} from "./util/output-viewer.ts";
|
|
10
12
|
|
|
11
13
|
|
|
12
|
-
console.log("EPF index.ts");
|
|
13
|
-
|
|
14
14
|
const workflowDependencies: WorkflowDependencies = {
|
|
15
15
|
seed: Math.floor(Date.now() / 1000),
|
|
16
16
|
openRouter: new OpenRouter({
|