agent-enderun 0.0.1 → 0.0.3
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/CHANGELOG.md +10 -0
- package/README.md +4 -2
- package/bin/cli.js +49 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.0.3] - 2026-05-09
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Updated the package to `0.0.3` for npm republish and workspace-compatible CLI install behavior.
|
|
9
|
+
|
|
10
|
+
## [0.0.2] - 2026-05-09
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Resolved CLI initialization crash in `npx agent-enderun init` when published package metadata omitted `devDependencies`.
|
|
14
|
+
|
|
5
15
|
## [0.0.1] - 2026-05-09
|
|
6
16
|
|
|
7
17
|
### Added
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Agent Enderun (v0.0.
|
|
1
|
+
# Agent Enderun (v0.0.3)
|
|
2
2
|
|
|
3
3
|
[English](#english) | [Türkçe](#türkçe)
|
|
4
4
|
|
|
@@ -94,10 +94,12 @@ AGENT_ENDERUN_PACKAGE_MANAGER=pnpm npx agent-enderun init gemini
|
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
96
|
npx agent-enderun init gemini
|
|
97
|
-
|
|
97
|
+
pnpm install && pnpm run enderun:build
|
|
98
98
|
agent-enderun check
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
>If your repository uses workspace dependencies, Agent Enderun will prefer `pnpm` automatically. If `pnpm` is not installed, the CLI will try to enable it via Corepack or fall back to `npx pnpm`.
|
|
102
|
+
|
|
101
103
|
If you already use `pnpm` or `yarn`, the CLI will prefer the correct lockfile and runtime environment.
|
|
102
104
|
|
|
103
105
|
## CLI Quick Reference
|
package/bin/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ import fs from "fs";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
import crypto from "crypto";
|
|
8
|
+
import { execSync } from "child_process";
|
|
8
9
|
|
|
9
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
11
|
const __dirname = path.dirname(__filename);
|
|
@@ -139,14 +140,15 @@ function mergePackageJson(targetPath, sourcePath) {
|
|
|
139
140
|
"enderun:build": "npm run build --prefix packages/shared-types && npm run build --prefix packages/framework-mcp",
|
|
140
141
|
};
|
|
141
142
|
|
|
143
|
+
const sourceDevDeps = sourcePkg.devDependencies || {};
|
|
142
144
|
targetPkg.devDependencies = sanitizeDeps({
|
|
143
145
|
...targetPkg.devDependencies,
|
|
144
|
-
"@modelcontextprotocol/sdk":
|
|
145
|
-
"zod":
|
|
146
|
-
"ts-morph":
|
|
147
|
-
"typescript":
|
|
148
|
-
"@types/node":
|
|
149
|
-
"tsx":
|
|
146
|
+
...(sourceDevDeps["@modelcontextprotocol/sdk"] ? {"@modelcontextprotocol/sdk": sourceDevDeps["@modelcontextprotocol/sdk"]} : {}),
|
|
147
|
+
...(sourceDevDeps["zod"] ? {"zod": sourceDevDeps["zod"]} : {}),
|
|
148
|
+
...(sourceDevDeps["ts-morph"] ? {"ts-morph": sourceDevDeps["ts-morph"]} : {}),
|
|
149
|
+
...(sourceDevDeps["typescript"] ? {"typescript": sourceDevDeps["typescript"]} : {}),
|
|
150
|
+
...(sourceDevDeps["@types/node"] ? {"@types/node": sourceDevDeps["@types/node"]} : {}),
|
|
151
|
+
...(sourceDevDeps["tsx"] ? {"tsx": sourceDevDeps["tsx"]} : {})
|
|
150
152
|
});
|
|
151
153
|
|
|
152
154
|
if (targetPkg.peerDependencies) targetPkg.peerDependencies = sanitizeDeps(targetPkg.peerDependencies);
|
|
@@ -286,20 +288,47 @@ function getPackageManager() {
|
|
|
286
288
|
if (override) return override.toLowerCase();
|
|
287
289
|
|
|
288
290
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
289
|
-
if (userAgent.includes("pnpm")) return "pnpm";
|
|
290
|
-
if (userAgent.includes("yarn")) return "yarn";
|
|
291
|
-
if (userAgent.includes("npm")) return "npm";
|
|
292
|
-
|
|
293
291
|
const npmExecPath = process.env.npm_execpath || "";
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
if (
|
|
299
|
-
if (
|
|
292
|
+
const hasPnpmLock = fs.existsSync(path.join(process.cwd(), "pnpm-lock.yaml"));
|
|
293
|
+
const hasPnpmWorkspace = fs.existsSync(path.join(process.cwd(), "pnpm-workspace.yaml"));
|
|
294
|
+
const hasYarnLock = fs.existsSync(path.join(process.cwd(), "yarn.lock")) || fs.existsSync(path.join(process.cwd(), "yarn.lock.json"));
|
|
295
|
+
|
|
296
|
+
if (userAgent.includes("pnpm") || npmExecPath.includes("pnpm")) return "pnpm";
|
|
297
|
+
if (userAgent.includes("yarn") || npmExecPath.includes("yarn")) return "yarn";
|
|
298
|
+
if (userAgent.includes("npm") || npmExecPath.includes("npm")) return "npm";
|
|
299
|
+
if (hasPnpmLock || hasPnpmWorkspace || usesWorkspaceProtocol()) return "pnpm";
|
|
300
|
+
if (hasYarnLock) return "yarn";
|
|
300
301
|
return "npm";
|
|
301
302
|
}
|
|
302
303
|
|
|
304
|
+
function usesWorkspaceProtocol() {
|
|
305
|
+
try {
|
|
306
|
+
const rootPkgPath = path.join(process.cwd(), "package.json");
|
|
307
|
+
if (!fs.existsSync(rootPkgPath)) return false;
|
|
308
|
+
const data = JSON.parse(fs.readFileSync(rootPkgPath, "utf8"));
|
|
309
|
+
if (data.workspaces || String(data.packageManager || "").includes("pnpm")) return true;
|
|
310
|
+
const checkDeps = (deps) => deps && Object.values(deps).some(v => typeof v === "string" && v.startsWith("workspace:"));
|
|
311
|
+
return checkDeps(data.dependencies) || checkDeps(data.devDependencies) || checkDeps(data.peerDependencies) || checkDeps(data.optionalDependencies);
|
|
312
|
+
} catch {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function ensurePackageManagerAvailable(manager) {
|
|
318
|
+
if (manager !== "pnpm") return manager;
|
|
319
|
+
try {
|
|
320
|
+
execSync("pnpm --version", { stdio: "ignore" });
|
|
321
|
+
return "pnpm";
|
|
322
|
+
} catch {
|
|
323
|
+
try {
|
|
324
|
+
execSync("corepack enable pnpm", { stdio: "ignore" });
|
|
325
|
+
return "pnpm";
|
|
326
|
+
} catch {
|
|
327
|
+
return "npx pnpm";
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
303
332
|
/**
|
|
304
333
|
* Scaffold the framework into the target project.
|
|
305
334
|
*/
|
|
@@ -460,9 +489,10 @@ async function initCommand(selectedAdapter) {
|
|
|
460
489
|
}
|
|
461
490
|
|
|
462
491
|
const pkgMgr = getPackageManager();
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
const
|
|
492
|
+
const resolvedPkgMgr = ensurePackageManagerAvailable(pkgMgr);
|
|
493
|
+
console.log(`\nℹ️ Detected package manager: ${resolvedPkgMgr}`);
|
|
494
|
+
const installCmd = `${resolvedPkgMgr} install`;
|
|
495
|
+
const buildCmd = `${resolvedPkgMgr} run enderun:build`;
|
|
466
496
|
|
|
467
497
|
console.log("\n✨ Framework scaffolded! (v" + FRAMEWORK_VERSION + ")");
|
|
468
498
|
|