@ai-setting/roy-agent-cli 1.6.2 → 1.6.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/dist/bin/roy-agent.js +16 -8
- package/dist/index.js +16 -8
- package/dist/roy-agent-linux-x64/bin/roy-agent +0 -0
- package/package.json +1 -1
package/dist/bin/roy-agent.js
CHANGED
|
@@ -7407,7 +7407,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
7407
7407
|
var require_package = __commonJS((exports, module) => {
|
|
7408
7408
|
module.exports = {
|
|
7409
7409
|
name: "@ai-setting/roy-agent-cli",
|
|
7410
|
-
version: "1.6.
|
|
7410
|
+
version: "1.6.3",
|
|
7411
7411
|
type: "module",
|
|
7412
7412
|
description: "CLI for roy-agent - Non-interactive command execution",
|
|
7413
7413
|
main: "./dist/index.js",
|
|
@@ -21620,7 +21620,15 @@ function savePlugins(plugins, scope) {
|
|
|
21620
21620
|
const config = { plugins };
|
|
21621
21621
|
writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
21622
21622
|
}
|
|
21623
|
+
function stripVersionSpec(packageName) {
|
|
21624
|
+
const atIdx = packageName.lastIndexOf("@");
|
|
21625
|
+
if (atIdx > 0) {
|
|
21626
|
+
return packageName.substring(0, atIdx);
|
|
21627
|
+
}
|
|
21628
|
+
return packageName;
|
|
21629
|
+
}
|
|
21623
21630
|
function readPackageInfo(packageName) {
|
|
21631
|
+
const bareName = packageName.startsWith("/") || packageName.startsWith(".") ? packageName : stripVersionSpec(packageName);
|
|
21624
21632
|
if (packageName.startsWith("/") || packageName.startsWith(".")) {
|
|
21625
21633
|
const localPkgPath = join4(packageName, "package.json");
|
|
21626
21634
|
if (existsSync3(localPkgPath)) {
|
|
@@ -21637,13 +21645,13 @@ function readPackageInfo(packageName) {
|
|
|
21637
21645
|
}
|
|
21638
21646
|
}
|
|
21639
21647
|
const searchPaths = [
|
|
21640
|
-
join4(process.cwd(), "node_modules",
|
|
21641
|
-
resolve(process.cwd(), "..", "node_modules",
|
|
21642
|
-
join4(process.cwd(), ".roy", "plugins",
|
|
21643
|
-
join4(homedir3(), ".roy-agent", "node_modules",
|
|
21648
|
+
join4(process.cwd(), "node_modules", bareName, "package.json"),
|
|
21649
|
+
resolve(process.cwd(), "..", "node_modules", bareName, "package.json"),
|
|
21650
|
+
join4(process.cwd(), ".roy", "plugins", bareName, "package.json"),
|
|
21651
|
+
join4(homedir3(), ".roy-agent", "node_modules", bareName, "package.json"),
|
|
21644
21652
|
...(() => {
|
|
21645
21653
|
const globalRoot = getNpmGlobalRoot();
|
|
21646
|
-
return globalRoot ? [join4(globalRoot,
|
|
21654
|
+
return globalRoot ? [join4(globalRoot, bareName, "package.json")] : [];
|
|
21647
21655
|
})()
|
|
21648
21656
|
];
|
|
21649
21657
|
for (const pkgPath of searchPaths) {
|
|
@@ -21652,7 +21660,7 @@ function readPackageInfo(packageName) {
|
|
|
21652
21660
|
const pkg = JSON.parse(readFileSync2(pkgPath, "utf-8"));
|
|
21653
21661
|
return {
|
|
21654
21662
|
version: pkg.version ?? "0.0.0",
|
|
21655
|
-
name: pkg.name ??
|
|
21663
|
+
name: pkg.name ?? bareName,
|
|
21656
21664
|
description: pkg.description
|
|
21657
21665
|
};
|
|
21658
21666
|
}
|
|
@@ -21785,7 +21793,7 @@ var InstallPackageCommand = {
|
|
|
21785
21793
|
}
|
|
21786
21794
|
resolvedGlobalName = info2.name;
|
|
21787
21795
|
} else {
|
|
21788
|
-
resolvedGlobalName = packageName;
|
|
21796
|
+
resolvedGlobalName = stripVersionSpec(packageName);
|
|
21789
21797
|
}
|
|
21790
21798
|
const result = spawnSync("npm", ["install", "-g", packageName], {
|
|
21791
21799
|
stdio: "inherit",
|
package/dist/index.js
CHANGED
|
@@ -7406,7 +7406,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
7406
7406
|
var require_package = __commonJS((exports, module) => {
|
|
7407
7407
|
module.exports = {
|
|
7408
7408
|
name: "@ai-setting/roy-agent-cli",
|
|
7409
|
-
version: "1.6.
|
|
7409
|
+
version: "1.6.3",
|
|
7410
7410
|
type: "module",
|
|
7411
7411
|
description: "CLI for roy-agent - Non-interactive command execution",
|
|
7412
7412
|
main: "./dist/index.js",
|
|
@@ -21619,7 +21619,15 @@ function savePlugins(plugins, scope) {
|
|
|
21619
21619
|
const config = { plugins };
|
|
21620
21620
|
writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
21621
21621
|
}
|
|
21622
|
+
function stripVersionSpec(packageName) {
|
|
21623
|
+
const atIdx = packageName.lastIndexOf("@");
|
|
21624
|
+
if (atIdx > 0) {
|
|
21625
|
+
return packageName.substring(0, atIdx);
|
|
21626
|
+
}
|
|
21627
|
+
return packageName;
|
|
21628
|
+
}
|
|
21622
21629
|
function readPackageInfo(packageName) {
|
|
21630
|
+
const bareName = packageName.startsWith("/") || packageName.startsWith(".") ? packageName : stripVersionSpec(packageName);
|
|
21623
21631
|
if (packageName.startsWith("/") || packageName.startsWith(".")) {
|
|
21624
21632
|
const localPkgPath = join4(packageName, "package.json");
|
|
21625
21633
|
if (existsSync3(localPkgPath)) {
|
|
@@ -21636,13 +21644,13 @@ function readPackageInfo(packageName) {
|
|
|
21636
21644
|
}
|
|
21637
21645
|
}
|
|
21638
21646
|
const searchPaths = [
|
|
21639
|
-
join4(process.cwd(), "node_modules",
|
|
21640
|
-
resolve(process.cwd(), "..", "node_modules",
|
|
21641
|
-
join4(process.cwd(), ".roy", "plugins",
|
|
21642
|
-
join4(homedir3(), ".roy-agent", "node_modules",
|
|
21647
|
+
join4(process.cwd(), "node_modules", bareName, "package.json"),
|
|
21648
|
+
resolve(process.cwd(), "..", "node_modules", bareName, "package.json"),
|
|
21649
|
+
join4(process.cwd(), ".roy", "plugins", bareName, "package.json"),
|
|
21650
|
+
join4(homedir3(), ".roy-agent", "node_modules", bareName, "package.json"),
|
|
21643
21651
|
...(() => {
|
|
21644
21652
|
const globalRoot = getNpmGlobalRoot();
|
|
21645
|
-
return globalRoot ? [join4(globalRoot,
|
|
21653
|
+
return globalRoot ? [join4(globalRoot, bareName, "package.json")] : [];
|
|
21646
21654
|
})()
|
|
21647
21655
|
];
|
|
21648
21656
|
for (const pkgPath of searchPaths) {
|
|
@@ -21651,7 +21659,7 @@ function readPackageInfo(packageName) {
|
|
|
21651
21659
|
const pkg = JSON.parse(readFileSync2(pkgPath, "utf-8"));
|
|
21652
21660
|
return {
|
|
21653
21661
|
version: pkg.version ?? "0.0.0",
|
|
21654
|
-
name: pkg.name ??
|
|
21662
|
+
name: pkg.name ?? bareName,
|
|
21655
21663
|
description: pkg.description
|
|
21656
21664
|
};
|
|
21657
21665
|
}
|
|
@@ -21784,7 +21792,7 @@ var InstallPackageCommand = {
|
|
|
21784
21792
|
}
|
|
21785
21793
|
resolvedGlobalName = info2.name;
|
|
21786
21794
|
} else {
|
|
21787
|
-
resolvedGlobalName = packageName;
|
|
21795
|
+
resolvedGlobalName = stripVersionSpec(packageName);
|
|
21788
21796
|
}
|
|
21789
21797
|
const result = spawnSync("npm", ["install", "-g", packageName], {
|
|
21790
21798
|
stdio: "inherit",
|
|
Binary file
|