easyresearch 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hdu-ailab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # easyresearch
2
+
3
+ Automated academic paper writing CLI with a local web panel.
4
+
5
+ ```sh
6
+ npm install -g easyresearch
7
+ easyresearch
8
+ ```
9
+
10
+ Self-contained binary per platform (no Bun/Node required). On first run it
11
+ creates a local Python venv (`markitdown`, `arxiv`) and extracts bundled
12
+ agents/skills — watch the terminal for progress. Requires Python 3 on PATH
13
+ for PDF conversion and arXiv SDK features; everything else works without it.
14
+
15
+ ```sh
16
+ easyresearch # start the web panel at http://127.0.0.1:3000
17
+ easyresearch exit # stop the background service
18
+ easyresearch --version
19
+ ```
20
+
21
+ Skip first-run setup with `EASYRESEARCH_SKIP_SETUP=1`.
22
+
23
+ ## Supported platforms
24
+
25
+ linux-x64, darwin-arm64, windows-x64. On other platforms the install fails
26
+ with a clear message — build from source instead:
27
+
28
+ ```sh
29
+ git clone https://github.com/hdu-ailab/EasyResearch.git
30
+ cd EasyResearch
31
+ bun install
32
+ bun run build:release -- --only <target> # e.g. linux-arm64
33
+ # binary at release/easyresearch-<target>/bin/easyresearch
34
+ ```
35
+
36
+ See `scripts/build.ts` `TARGETS` for valid <target> names.
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Placeholder replaced by postinstall.mjs with the platform binary.
3
+ echo "easyresearch: platform binary not installed. Run: npm rebuild easyresearch" >&2
4
+ exit 1
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "easyresearch",
3
+ "version": "0.0.1",
4
+ "description": "Automated academic paper writing CLI built on the Pi agent harness",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/hdu-ailab/EasyResearch.git"
9
+ },
10
+ "keywords": [
11
+ "research",
12
+ "paper-writing",
13
+ "cli",
14
+ "ai",
15
+ "latex"
16
+ ],
17
+ "bin": {
18
+ "easyresearch": "./bin/easyresearch.exe"
19
+ },
20
+ "scripts": {
21
+ "postinstall": "node ./postinstall.mjs"
22
+ },
23
+ "optionalDependencies": {
24
+ "easyresearch-linux-x64": "0.0.1",
25
+ "easyresearch-darwin-arm64": "0.0.1",
26
+ "easyresearch-windows-x64": "0.0.1"
27
+ }
28
+ }
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+ // postinstall for the `easyresearch` meta package.
3
+ // Resolves the platform-specific binary package (easyresearch-<os>-<arch>),
4
+ // copies the executable into ./bin/easyresearch.exe, and verifies it with
5
+ // `--version`.
6
+ //
7
+ // Adapted from opencode-ai (https://github.com/sst/opencode, MIT licensed)
8
+ // which ships a platform meta package in the same way.
9
+
10
+ import childProcess from "child_process";
11
+ import fs from "fs";
12
+ import os from "os";
13
+ import path from "path";
14
+ import { createRequire } from "module";
15
+ import { fileURLToPath } from "url";
16
+
17
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
18
+ const require = createRequire(import.meta.url);
19
+ const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8"));
20
+
21
+ const platformMap = {
22
+ darwin: "darwin",
23
+ linux: "linux",
24
+ win32: "windows",
25
+ };
26
+ const archMap = {
27
+ x64: "x64",
28
+ arm64: "arm64",
29
+ };
30
+
31
+ const platform = platformMap[os.platform()] ?? os.platform();
32
+ const arch = archMap[os.arch()] ?? os.arch();
33
+ const base = `easyresearch-${platform}-${arch}`;
34
+ const sourceBinary = platform === "windows" ? "easyresearch.exe" : "easyresearch";
35
+ const targetBinary = path.join(__dirname, "bin", "easyresearch.exe");
36
+
37
+ function packageName() {
38
+ // Shipped platforms (see scripts/build.ts TARGETS):
39
+ // linux-x64, darwin-arm64, windows-x64
40
+ return base;
41
+ }
42
+
43
+ function resolveBinary(name) {
44
+ const packageJsonPath = require.resolve(`${name}/package.json`);
45
+ const binaryPath = path.join(path.dirname(packageJsonPath), "bin", sourceBinary);
46
+ if (!fs.existsSync(binaryPath)) throw new Error(`Binary not found at ${binaryPath}`);
47
+ return binaryPath;
48
+ }
49
+
50
+ function installPackage(name) {
51
+ const version = packageJson.optionalDependencies?.[name];
52
+ if (!version) return;
53
+
54
+ const temp = fs.mkdtempSync(path.join(os.tmpdir(), "easyresearch-install-"));
55
+ try {
56
+ const result = childProcess.spawnSync(
57
+ "npm",
58
+ ["install", "--ignore-scripts", "--no-save", "--loglevel=error", "--prefix", temp, `${name}@${version}`],
59
+ { stdio: "inherit", windowsHide: true },
60
+ );
61
+ if (result.status !== 0) return;
62
+ const packageDir = path.join(temp, "node_modules", name);
63
+ copyBinary(path.join(packageDir, "bin", sourceBinary), targetBinary);
64
+ return true;
65
+ } finally {
66
+ fs.rmSync(temp, { recursive: true, force: true });
67
+ }
68
+ }
69
+
70
+ function copyBinary(source, target) {
71
+ if (!fs.existsSync(source)) throw new Error(`Binary not found at ${source}`);
72
+ fs.mkdirSync(path.dirname(target), { recursive: true });
73
+ if (fs.existsSync(target)) fs.unlinkSync(target);
74
+ try {
75
+ fs.linkSync(source, target);
76
+ } catch {
77
+ fs.copyFileSync(source, target);
78
+ }
79
+ fs.chmodSync(target, 0o755);
80
+ }
81
+
82
+ function verifyBinary() {
83
+ const result = childProcess.spawnSync(targetBinary, ["--version"], {
84
+ encoding: "utf8",
85
+ stdio: "ignore",
86
+ windowsHide: true,
87
+ });
88
+ return result.status === 0;
89
+ }
90
+
91
+ function main() {
92
+ const name = packageName();
93
+ if (!packageJson.optionalDependencies?.[name]) {
94
+ throw new Error(
95
+ `easyresearch does not ship a binary for ${platform}-${arch}. Supported platforms: linux-x64, darwin-arm64, windows-x64.`,
96
+ );
97
+ }
98
+ try {
99
+ copyBinary(resolveBinary(name), targetBinary);
100
+ if (verifyBinary()) return;
101
+ } catch {
102
+ if (installPackage(name) && verifyBinary()) return;
103
+ }
104
+
105
+ throw new Error(
106
+ `It seems your package manager failed to install the right easyresearch binary package. Try manually installing ${JSON.stringify(
107
+ name,
108
+ )}.`,
109
+ );
110
+ }
111
+
112
+ try {
113
+ main();
114
+ } catch (error) {
115
+ console.error(error.message);
116
+ process.exit(1);
117
+ }