@elizaos/cli 1.2.11-beta.3 → 1.2.11-beta.4
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/index.js +107 -91
- package/dist/templates/plugin-quick-starter/package.json +1 -1
- package/dist/templates/plugin-starter/package.json +1 -1
- package/dist/templates/project-starter/package.json +4 -4
- package/dist/templates/project-tee-starter/package.json +3 -3
- package/package.json +5 -5
- package/templates/plugin-quick-starter/package.json +1 -1
- package/templates/plugin-starter/package.json +1 -1
- package/templates/project-starter/package.json +4 -4
- package/templates/project-tee-starter/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -56,6 +56,9 @@ import {
|
|
|
56
56
|
} from "./chunk-D3Q2UZLZ.js";
|
|
57
57
|
import "./chunk-3RG5ZIWI.js";
|
|
58
58
|
|
|
59
|
+
// src/index.ts
|
|
60
|
+
import * as path30 from "path";
|
|
61
|
+
|
|
59
62
|
// src/commands/dev/index.ts
|
|
60
63
|
import { Command, Option } from "commander";
|
|
61
64
|
|
|
@@ -150,18 +153,18 @@ async function performInitialBuild(context) {
|
|
|
150
153
|
);
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
|
-
function createDevContext(
|
|
154
|
-
const directoryType = detectDirectoryType(
|
|
156
|
+
function createDevContext(cwd2) {
|
|
157
|
+
const directoryType = detectDirectoryType(cwd2);
|
|
155
158
|
if (!directoryType) {
|
|
156
159
|
throw new Error(
|
|
157
160
|
"Cannot start development mode in this directory. Directory is not accessible or does not exist."
|
|
158
161
|
);
|
|
159
162
|
}
|
|
160
|
-
const srcDir = path.join(
|
|
163
|
+
const srcDir = path.join(cwd2, "src");
|
|
161
164
|
return {
|
|
162
|
-
directory:
|
|
165
|
+
directory: cwd2,
|
|
163
166
|
directoryType,
|
|
164
|
-
watchDirectory: existsSync(srcDir) ? srcDir :
|
|
167
|
+
watchDirectory: existsSync(srcDir) ? srcDir : cwd2,
|
|
165
168
|
buildRequired: directoryType.type !== "elizaos-monorepo"
|
|
166
169
|
};
|
|
167
170
|
}
|
|
@@ -286,17 +289,17 @@ var DevServerManager = class {
|
|
|
286
289
|
scriptPath = process.argv[1];
|
|
287
290
|
}
|
|
288
291
|
const env2 = { ...process.env };
|
|
289
|
-
const
|
|
292
|
+
const localModulesPath2 = path3.join(process.cwd(), "node_modules");
|
|
290
293
|
if (env2.NODE_PATH) {
|
|
291
|
-
env2.NODE_PATH = `${
|
|
294
|
+
env2.NODE_PATH = `${localModulesPath2}${path3.delimiter}${env2.NODE_PATH}`;
|
|
292
295
|
} else {
|
|
293
|
-
env2.NODE_PATH =
|
|
296
|
+
env2.NODE_PATH = localModulesPath2;
|
|
294
297
|
}
|
|
295
|
-
const
|
|
298
|
+
const localBinPath2 = path3.join(process.cwd(), "node_modules", ".bin");
|
|
296
299
|
if (env2.PATH) {
|
|
297
|
-
env2.PATH = `${
|
|
300
|
+
env2.PATH = `${localBinPath2}${path3.delimiter}${env2.PATH}`;
|
|
298
301
|
} else {
|
|
299
|
-
env2.PATH =
|
|
302
|
+
env2.PATH = localBinPath2;
|
|
300
303
|
}
|
|
301
304
|
env2.FORCE_COLOR = "1";
|
|
302
305
|
this.process = spawn(nodeExecutable, [scriptPath, "start", ...args], {
|
|
@@ -347,8 +350,8 @@ async function stopServer() {
|
|
|
347
350
|
// src/commands/dev/actions/dev-server.ts
|
|
348
351
|
import { logger } from "@elizaos/core";
|
|
349
352
|
async function startDevMode(options) {
|
|
350
|
-
const
|
|
351
|
-
const context = createDevContext(
|
|
353
|
+
const cwd2 = process.cwd();
|
|
354
|
+
const context = createDevContext(cwd2);
|
|
352
355
|
const serverManager = getServerManager();
|
|
353
356
|
const { directoryType } = context;
|
|
354
357
|
const isProject = directoryType.type === "elizaos-project";
|
|
@@ -1029,21 +1032,21 @@ import { logger as logger2 } from "@elizaos/core";
|
|
|
1029
1032
|
import { existsSync as existsSync8, readFileSync, readdirSync as readdirSync2 } from "fs";
|
|
1030
1033
|
import path8 from "path";
|
|
1031
1034
|
import * as clack4 from "@clack/prompts";
|
|
1032
|
-
var extractPluginEnvRequirements = async (packageName,
|
|
1035
|
+
var extractPluginEnvRequirements = async (packageName, cwd2) => {
|
|
1033
1036
|
try {
|
|
1034
1037
|
const possiblePaths = [
|
|
1035
1038
|
// Direct path
|
|
1036
|
-
path8.join(
|
|
1039
|
+
path8.join(cwd2, "node_modules", packageName, "package.json"),
|
|
1037
1040
|
// Scoped package path (e.g., @elizaos/plugin-discord)
|
|
1038
|
-
path8.join(
|
|
1041
|
+
path8.join(cwd2, "node_modules", packageName.replace("/", path8.sep), "package.json")
|
|
1039
1042
|
];
|
|
1040
1043
|
if (!packageName.startsWith("@elizaos/")) {
|
|
1041
1044
|
possiblePaths.push(
|
|
1042
|
-
path8.join(
|
|
1043
|
-
path8.join(
|
|
1045
|
+
path8.join(cwd2, "node_modules", "@elizaos", packageName, "package.json"),
|
|
1046
|
+
path8.join(cwd2, "node_modules", "@elizaos", `plugin-${packageName}`, "package.json")
|
|
1044
1047
|
);
|
|
1045
1048
|
}
|
|
1046
|
-
let currentDir =
|
|
1049
|
+
let currentDir = cwd2;
|
|
1047
1050
|
for (let i = 0; i < 5; i++) {
|
|
1048
1051
|
const parentNodeModules = path8.join(currentDir, "node_modules");
|
|
1049
1052
|
if (existsSync8(parentNodeModules)) {
|
|
@@ -1065,7 +1068,7 @@ var extractPluginEnvRequirements = async (packageName, cwd) => {
|
|
|
1065
1068
|
}
|
|
1066
1069
|
}
|
|
1067
1070
|
if (!packageJsonPath) {
|
|
1068
|
-
const nodeModulesPath = path8.join(
|
|
1071
|
+
const nodeModulesPath = path8.join(cwd2, "node_modules");
|
|
1069
1072
|
if (existsSync8(nodeModulesPath)) {
|
|
1070
1073
|
const packages = readdirSync2(nodeModulesPath);
|
|
1071
1074
|
for (const pkg of packages) {
|
|
@@ -1103,8 +1106,8 @@ var extractPluginEnvRequirements = async (packageName, cwd) => {
|
|
|
1103
1106
|
return {};
|
|
1104
1107
|
}
|
|
1105
1108
|
};
|
|
1106
|
-
var readEnvFile = async (
|
|
1107
|
-
const envPath = path8.join(
|
|
1109
|
+
var readEnvFile = async (cwd2) => {
|
|
1110
|
+
const envPath = path8.join(cwd2, ".env");
|
|
1108
1111
|
const envService = createEnvFileService(envPath);
|
|
1109
1112
|
return envService.read();
|
|
1110
1113
|
};
|
|
@@ -1290,26 +1293,26 @@ var promptForEnvVar = async (varName, config2) => {
|
|
|
1290
1293
|
const finalValue = response && response.trim() || defaultValue || "";
|
|
1291
1294
|
return finalValue.trim();
|
|
1292
1295
|
};
|
|
1293
|
-
var updateEnvFile = async (
|
|
1294
|
-
const envPath = path8.join(
|
|
1296
|
+
var updateEnvFile = async (cwd2, varName, value) => {
|
|
1297
|
+
const envPath = path8.join(cwd2, ".env");
|
|
1295
1298
|
const envService = createEnvFileService(envPath);
|
|
1296
1299
|
await envService.update(varName, value, {
|
|
1297
1300
|
preserveComments: true,
|
|
1298
1301
|
updateProcessEnv: true
|
|
1299
1302
|
});
|
|
1300
1303
|
};
|
|
1301
|
-
var promptForPluginEnvVars = async (packageName,
|
|
1302
|
-
let envRequirements = await extractPluginEnvRequirements(packageName,
|
|
1304
|
+
var promptForPluginEnvVars = async (packageName, cwd2) => {
|
|
1305
|
+
let envRequirements = await extractPluginEnvRequirements(packageName, cwd2);
|
|
1303
1306
|
if (Object.keys(envRequirements).length === 0 && !packageName.startsWith("@elizaos/")) {
|
|
1304
1307
|
const elizaosPackageName = `@elizaos/${packageName.replace("plugin-", "")}`;
|
|
1305
|
-
envRequirements = await extractPluginEnvRequirements(elizaosPackageName,
|
|
1308
|
+
envRequirements = await extractPluginEnvRequirements(elizaosPackageName, cwd2);
|
|
1306
1309
|
if (Object.keys(envRequirements).length === 0) {
|
|
1307
1310
|
const elizaosPluginPackageName = `@elizaos/plugin-${packageName.replace("plugin-", "")}`;
|
|
1308
|
-
envRequirements = await extractPluginEnvRequirements(elizaosPluginPackageName,
|
|
1311
|
+
envRequirements = await extractPluginEnvRequirements(elizaosPluginPackageName, cwd2);
|
|
1309
1312
|
}
|
|
1310
1313
|
}
|
|
1311
1314
|
if (Object.keys(envRequirements).length === 0) {
|
|
1312
|
-
const nodeModulesPath = path8.join(
|
|
1315
|
+
const nodeModulesPath = path8.join(cwd2, "node_modules");
|
|
1313
1316
|
const possiblePackages = [
|
|
1314
1317
|
packageName,
|
|
1315
1318
|
`@elizaos/${packageName.replace("plugin-", "")}`,
|
|
@@ -1336,7 +1339,7 @@ var promptForPluginEnvVars = async (packageName, cwd) => {
|
|
|
1336
1339
|
}
|
|
1337
1340
|
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
|
1338
1341
|
clack4.intro(`Setting up ${packageName} Plugin`);
|
|
1339
|
-
const envVars = await readEnvFile(
|
|
1342
|
+
const envVars = await readEnvFile(cwd2);
|
|
1340
1343
|
const existingVars = envVars;
|
|
1341
1344
|
const missingVars = [];
|
|
1342
1345
|
const existingConfigured = [];
|
|
@@ -1390,7 +1393,7 @@ ${optionalVars.map(([name]) => ` - ${name}`).join("\n")}
|
|
|
1390
1393
|
const value = await promptForEnvVar(varName, config2);
|
|
1391
1394
|
if (value) {
|
|
1392
1395
|
spinner2.start(`Saving ${varName} to .env file...`);
|
|
1393
|
-
await updateEnvFile(
|
|
1396
|
+
await updateEnvFile(cwd2, varName, value);
|
|
1394
1397
|
spinner2.stop(`${varName} configured successfully`);
|
|
1395
1398
|
newlyConfigured++;
|
|
1396
1399
|
configuredCount++;
|
|
@@ -1471,13 +1474,13 @@ Restart your application after adding the variables.`
|
|
|
1471
1474
|
import { logger as logger3 } from "@elizaos/core";
|
|
1472
1475
|
import { readFileSync as readFileSync2 } from "fs";
|
|
1473
1476
|
import path9 from "path";
|
|
1474
|
-
var getDependenciesFromDirectory = (
|
|
1475
|
-
const directoryInfo = detectDirectoryType(
|
|
1477
|
+
var getDependenciesFromDirectory = (cwd2) => {
|
|
1478
|
+
const directoryInfo = detectDirectoryType(cwd2);
|
|
1476
1479
|
if (!directoryInfo.hasPackageJson) {
|
|
1477
1480
|
return null;
|
|
1478
1481
|
}
|
|
1479
1482
|
try {
|
|
1480
|
-
const packageJsonPath = path9.join(
|
|
1483
|
+
const packageJsonPath = path9.join(cwd2, "package.json");
|
|
1481
1484
|
const packageJsonContent = readFileSync2(packageJsonPath, "utf-8");
|
|
1482
1485
|
const packageJson = JSON.parse(packageJsonContent);
|
|
1483
1486
|
const dependencies = packageJson.dependencies || {};
|
|
@@ -1511,7 +1514,7 @@ ${colors4.bold("Next steps:")}
|
|
|
1511
1514
|
4. Check the plugin documentation for additional setup`;
|
|
1512
1515
|
clack5.outro(message);
|
|
1513
1516
|
}
|
|
1514
|
-
async function installPluginFromGitHub(plugin,
|
|
1517
|
+
async function installPluginFromGitHub(plugin, cwd2, opts) {
|
|
1515
1518
|
const githubRegex = /^(?:github:)?([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)(?:#([a-zA-Z0-9_.-]+))?$/;
|
|
1516
1519
|
const githubMatch = plugin.match(githubRegex);
|
|
1517
1520
|
if (!githubMatch) {
|
|
@@ -1520,7 +1523,7 @@ async function installPluginFromGitHub(plugin, cwd, opts) {
|
|
|
1520
1523
|
const [, owner, repo, ref] = githubMatch;
|
|
1521
1524
|
const githubSpecifier = `github:${owner}/${repo}${ref ? `#${ref}` : ""}`;
|
|
1522
1525
|
const pluginNameForPostInstall = repo;
|
|
1523
|
-
const success = await installPlugin(githubSpecifier,
|
|
1526
|
+
const success = await installPlugin(githubSpecifier, cwd2, void 0, opts.skipVerification);
|
|
1524
1527
|
if (success) {
|
|
1525
1528
|
logger4.info(`Successfully installed ${pluginNameForPostInstall} from ${githubSpecifier}.`);
|
|
1526
1529
|
const packageName = extractPackageName(plugin);
|
|
@@ -1529,7 +1532,7 @@ async function installPluginFromGitHub(plugin, cwd, opts) {
|
|
|
1529
1532
|
console.log(`
|
|
1530
1533
|
\u{1F527} Checking environment variables for ${packageName}...`);
|
|
1531
1534
|
try {
|
|
1532
|
-
await promptForPluginEnvVars(packageName,
|
|
1535
|
+
await promptForPluginEnvVars(packageName, cwd2);
|
|
1533
1536
|
} catch (error) {
|
|
1534
1537
|
logger4.warn(
|
|
1535
1538
|
`Warning: Could not prompt for environment variables: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -1546,7 +1549,7 @@ async function installPluginFromGitHub(plugin, cwd, opts) {
|
|
|
1546
1549
|
process.exit(1);
|
|
1547
1550
|
}
|
|
1548
1551
|
}
|
|
1549
|
-
async function installPluginFromRegistry(plugin,
|
|
1552
|
+
async function installPluginFromRegistry(plugin, cwd2, opts) {
|
|
1550
1553
|
const cachedRegistry = await fetchPluginRegistry();
|
|
1551
1554
|
if (!cachedRegistry || !cachedRegistry.registry) {
|
|
1552
1555
|
logger4.error('Plugin registry cache not found. Please run "elizaos plugins update" first.');
|
|
@@ -1557,20 +1560,20 @@ async function installPluginFromRegistry(plugin, cwd, opts) {
|
|
|
1557
1560
|
const targetName = pluginKey || plugin;
|
|
1558
1561
|
const registryInstallResult = await installPlugin(
|
|
1559
1562
|
targetName,
|
|
1560
|
-
|
|
1563
|
+
cwd2,
|
|
1561
1564
|
opts.tag,
|
|
1562
1565
|
opts.skipVerification
|
|
1563
1566
|
);
|
|
1564
1567
|
if (registryInstallResult) {
|
|
1565
1568
|
console.log(`Successfully installed ${targetName}`);
|
|
1566
|
-
const updatedDependencies = getDependenciesFromDirectory(
|
|
1569
|
+
const updatedDependencies = getDependenciesFromDirectory(cwd2);
|
|
1567
1570
|
const actualPackageName = findPluginPackageName(targetName, updatedDependencies || {}) || targetName;
|
|
1568
1571
|
if (!opts.skipEnvPrompt) {
|
|
1569
1572
|
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
1570
1573
|
console.log(`
|
|
1571
1574
|
\u{1F527} Checking environment variables for ${actualPackageName}...`);
|
|
1572
1575
|
try {
|
|
1573
|
-
await promptForPluginEnvVars(actualPackageName,
|
|
1576
|
+
await promptForPluginEnvVars(actualPackageName, cwd2);
|
|
1574
1577
|
} catch (error) {
|
|
1575
1578
|
logger4.warn(
|
|
1576
1579
|
`Warning: Could not prompt for environment variables: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -1594,15 +1597,15 @@ async function addPlugin(pluginArg, opts) {
|
|
|
1594
1597
|
);
|
|
1595
1598
|
process.exit(1);
|
|
1596
1599
|
}
|
|
1597
|
-
const
|
|
1598
|
-
const directoryInfo = detectDirectoryType(
|
|
1600
|
+
const cwd2 = process.cwd();
|
|
1601
|
+
const directoryInfo = detectDirectoryType(cwd2);
|
|
1599
1602
|
if (!directoryInfo || !directoryInfo.hasPackageJson) {
|
|
1600
1603
|
logger4.error(
|
|
1601
1604
|
`Command must be run inside an ElizaOS project directory. This directory is: ${directoryInfo?.type || "invalid or inaccessible"}`
|
|
1602
1605
|
);
|
|
1603
1606
|
process.exit(1);
|
|
1604
1607
|
}
|
|
1605
|
-
const allDependencies = getDependenciesFromDirectory(
|
|
1608
|
+
const allDependencies = getDependenciesFromDirectory(cwd2);
|
|
1606
1609
|
if (!allDependencies) {
|
|
1607
1610
|
logger4.error("Could not read dependencies from package.json");
|
|
1608
1611
|
process.exit(1);
|
|
@@ -1624,9 +1627,9 @@ async function addPlugin(pluginArg, opts) {
|
|
|
1624
1627
|
}
|
|
1625
1628
|
const githubRegex = /^(?:github:)?([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)(?:#([a-zA-Z0-9_.-]+))?$/;
|
|
1626
1629
|
if (githubRegex.test(plugin)) {
|
|
1627
|
-
await installPluginFromGitHub(plugin,
|
|
1630
|
+
await installPluginFromGitHub(plugin, cwd2, opts);
|
|
1628
1631
|
} else {
|
|
1629
|
-
await installPluginFromRegistry(plugin,
|
|
1632
|
+
await installPluginFromRegistry(plugin, cwd2, opts);
|
|
1630
1633
|
}
|
|
1631
1634
|
}
|
|
1632
1635
|
|
|
@@ -1635,15 +1638,15 @@ import { logger as logger5 } from "@elizaos/core";
|
|
|
1635
1638
|
import { existsSync as existsSync9, rmSync } from "fs";
|
|
1636
1639
|
import path10 from "path";
|
|
1637
1640
|
async function removePlugin(plugin) {
|
|
1638
|
-
const
|
|
1639
|
-
const directoryInfo = detectDirectoryType(
|
|
1641
|
+
const cwd2 = process.cwd();
|
|
1642
|
+
const directoryInfo = detectDirectoryType(cwd2);
|
|
1640
1643
|
if (!directoryInfo || !directoryInfo.hasPackageJson) {
|
|
1641
1644
|
console.error(
|
|
1642
1645
|
`Could not read or parse package.json. This directory is: ${directoryInfo?.type || "invalid or inaccessible"}`
|
|
1643
1646
|
);
|
|
1644
1647
|
process.exit(1);
|
|
1645
1648
|
}
|
|
1646
|
-
const allDependencies = getDependenciesFromDirectory(
|
|
1649
|
+
const allDependencies = getDependenciesFromDirectory(cwd2);
|
|
1647
1650
|
if (!allDependencies) {
|
|
1648
1651
|
console.error(
|
|
1649
1652
|
"Could not read dependencies from package.json. Cannot determine which package to remove."
|
|
@@ -1659,7 +1662,7 @@ async function removePlugin(plugin) {
|
|
|
1659
1662
|
console.info(`Removing ${packageNameToRemove}...`);
|
|
1660
1663
|
try {
|
|
1661
1664
|
await bunExecInherit("bun", ["remove", packageNameToRemove], {
|
|
1662
|
-
cwd
|
|
1665
|
+
cwd: cwd2
|
|
1663
1666
|
});
|
|
1664
1667
|
} catch (execError) {
|
|
1665
1668
|
logger5.error(
|
|
@@ -1681,7 +1684,7 @@ async function removePlugin(plugin) {
|
|
|
1681
1684
|
}
|
|
1682
1685
|
baseName = baseName.replace(/^plugin-/, "");
|
|
1683
1686
|
const dirNameToRemove = `plugin-${baseName}`;
|
|
1684
|
-
const pluginDir = path10.join(
|
|
1687
|
+
const pluginDir = path10.join(cwd2, dirNameToRemove);
|
|
1685
1688
|
if (existsSync9(pluginDir)) {
|
|
1686
1689
|
try {
|
|
1687
1690
|
rmSync(pluginDir, { recursive: true, force: true });
|
|
@@ -1691,7 +1694,7 @@ async function removePlugin(plugin) {
|
|
|
1691
1694
|
);
|
|
1692
1695
|
}
|
|
1693
1696
|
} else {
|
|
1694
|
-
const nonPrefixedDir = path10.join(
|
|
1697
|
+
const nonPrefixedDir = path10.join(cwd2, baseName);
|
|
1695
1698
|
if (existsSync9(nonPrefixedDir)) {
|
|
1696
1699
|
try {
|
|
1697
1700
|
rmSync(nonPrefixedDir, { recursive: true, force: true });
|
|
@@ -1759,8 +1762,8 @@ Plugin: ${name}`);
|
|
|
1759
1762
|
console.log("");
|
|
1760
1763
|
}
|
|
1761
1764
|
async function listInstalledPlugins() {
|
|
1762
|
-
const
|
|
1763
|
-
const directoryInfo = detectDirectoryType(
|
|
1765
|
+
const cwd2 = process.cwd();
|
|
1766
|
+
const directoryInfo = detectDirectoryType(cwd2);
|
|
1764
1767
|
if (!directoryInfo || !directoryInfo.hasPackageJson) {
|
|
1765
1768
|
console.error(
|
|
1766
1769
|
`Could not read or parse package.json. This directory is: ${directoryInfo?.type || "invalid or inaccessible"}`
|
|
@@ -1768,7 +1771,7 @@ async function listInstalledPlugins() {
|
|
|
1768
1771
|
console.info("Please run this command from the root of an ElizaOS project.");
|
|
1769
1772
|
process.exit(1);
|
|
1770
1773
|
}
|
|
1771
|
-
const allDependencies = getDependenciesFromDirectory(
|
|
1774
|
+
const allDependencies = getDependenciesFromDirectory(cwd2);
|
|
1772
1775
|
if (!allDependencies) {
|
|
1773
1776
|
console.error("Could not read dependencies from package.json.");
|
|
1774
1777
|
process.exit(1);
|
|
@@ -3152,26 +3155,26 @@ import * as clack10 from "@clack/prompts";
|
|
|
3152
3155
|
// src/commands/publish/actions/npm-publish.ts
|
|
3153
3156
|
import { promises as fs2 } from "fs";
|
|
3154
3157
|
import path14 from "path";
|
|
3155
|
-
async function publishToNpm(
|
|
3158
|
+
async function publishToNpm(cwd2, packageJson, npmUsername) {
|
|
3156
3159
|
console.info(`Publishing as npm user: ${npmUsername}`);
|
|
3157
3160
|
if (!packageJson.npmPackage || packageJson.npmPackage === "${NPM_PACKAGE}") {
|
|
3158
3161
|
packageJson.npmPackage = packageJson.name;
|
|
3159
3162
|
console.info(`Set npmPackage to: ${packageJson.npmPackage}`);
|
|
3160
|
-
const packageJsonPath = path14.join(
|
|
3163
|
+
const packageJsonPath = path14.join(cwd2, "package.json");
|
|
3161
3164
|
await fs2.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf-8");
|
|
3162
3165
|
}
|
|
3163
3166
|
console.info("Building package...");
|
|
3164
|
-
await bunExecInherit("npm", ["run", "build"], { cwd });
|
|
3167
|
+
await bunExecInherit("npm", ["run", "build"], { cwd: cwd2 });
|
|
3165
3168
|
console.info("Publishing to npm...");
|
|
3166
|
-
await bunExecInherit("npm", ["publish", "--ignore-scripts"], { cwd });
|
|
3169
|
+
await bunExecInherit("npm", ["publish", "--ignore-scripts"], { cwd: cwd2 });
|
|
3167
3170
|
console.log(`[\u221A] Successfully published ${packageJson.name}@${packageJson.version} to npm`);
|
|
3168
3171
|
}
|
|
3169
3172
|
|
|
3170
3173
|
// src/commands/publish/actions/github-publish.ts
|
|
3171
|
-
async function publishToGitHubAction(
|
|
3174
|
+
async function publishToGitHubAction(cwd2, packageJson, credentials, skipRegistry = false, dryRun = false) {
|
|
3172
3175
|
console.info("Publishing to GitHub and registry...");
|
|
3173
3176
|
const result = await publishToGitHub(
|
|
3174
|
-
|
|
3177
|
+
cwd2,
|
|
3175
3178
|
packageJson,
|
|
3176
3179
|
credentials.username,
|
|
3177
3180
|
skipRegistry,
|
|
@@ -3281,7 +3284,7 @@ async function savePackageToRegistry(packageMetadata, dryRun = false) {
|
|
|
3281
3284
|
import { promises as fs4 } from "fs";
|
|
3282
3285
|
import path16 from "path";
|
|
3283
3286
|
import * as clack6 from "@clack/prompts";
|
|
3284
|
-
async function validatePluginRequirements(
|
|
3287
|
+
async function validatePluginRequirements(cwd2, packageJson) {
|
|
3285
3288
|
const errors = [];
|
|
3286
3289
|
const warnings = [];
|
|
3287
3290
|
const packageName = packageJson.name.split("/").pop() || packageJson.name;
|
|
@@ -3290,14 +3293,14 @@ async function validatePluginRequirements(cwd, packageJson) {
|
|
|
3290
3293
|
'Plugin name must start with "plugin-". Please update your package name and try again.'
|
|
3291
3294
|
);
|
|
3292
3295
|
}
|
|
3293
|
-
const pluginDirName = path16.basename(
|
|
3296
|
+
const pluginDirName = path16.basename(cwd2);
|
|
3294
3297
|
const expectedDefaultDesc = `ElizaOS plugin for ${pluginDirName.replace("plugin-", "")}`;
|
|
3295
3298
|
if (packageJson.description === expectedDefaultDesc || packageJson.description === "${PLUGINDESCRIPTION}") {
|
|
3296
3299
|
warnings.push(
|
|
3297
3300
|
"Description appears to be the default generated description. Consider writing a custom description."
|
|
3298
3301
|
);
|
|
3299
3302
|
}
|
|
3300
|
-
const imagesDir = path16.join(
|
|
3303
|
+
const imagesDir = path16.join(cwd2, "images");
|
|
3301
3304
|
const logoPath = path16.join(imagesDir, "logo.jpg");
|
|
3302
3305
|
const bannerPath = path16.join(imagesDir, "banner.jpg");
|
|
3303
3306
|
try {
|
|
@@ -3632,11 +3635,11 @@ async function updatePackageJson(packageJsonPath, updates) {
|
|
|
3632
3635
|
console.log("Updated package.json with new versions");
|
|
3633
3636
|
}
|
|
3634
3637
|
}
|
|
3635
|
-
async function installDependencies(
|
|
3638
|
+
async function installDependencies(cwd2) {
|
|
3636
3639
|
console.log("\nInstalling updated packages...");
|
|
3637
3640
|
try {
|
|
3638
3641
|
const packageManager = await getPackageManager();
|
|
3639
|
-
await bunExecInherit(packageManager, ["install"], { cwd });
|
|
3642
|
+
await bunExecInherit(packageManager, ["install"], { cwd: cwd2 });
|
|
3640
3643
|
console.log("Dependencies installed successfully [\u2713]");
|
|
3641
3644
|
} catch (error) {
|
|
3642
3645
|
throw new Error(
|
|
@@ -3646,9 +3649,9 @@ async function installDependencies(cwd) {
|
|
|
3646
3649
|
}
|
|
3647
3650
|
|
|
3648
3651
|
// src/commands/update/actions/dependency-update.ts
|
|
3649
|
-
async function updateDependencies(
|
|
3652
|
+
async function updateDependencies(cwd2, isPlugin2, options = {}) {
|
|
3650
3653
|
const { dryRun = false, skipBuild = false } = options;
|
|
3651
|
-
const packageJsonPath = path17.join(
|
|
3654
|
+
const packageJsonPath = path17.join(cwd2, "package.json");
|
|
3652
3655
|
const content = await fs6.readFile(packageJsonPath, "utf8");
|
|
3653
3656
|
const packageJson = JSON.parse(content);
|
|
3654
3657
|
const allDependencies = {
|
|
@@ -3683,10 +3686,10 @@ async function updateDependencies(cwd, isPlugin2, options = {}) {
|
|
|
3683
3686
|
}
|
|
3684
3687
|
}
|
|
3685
3688
|
await updatePackageJson(packageJsonPath, updates);
|
|
3686
|
-
await installDependencies(
|
|
3689
|
+
await installDependencies(cwd2);
|
|
3687
3690
|
if (!skipBuild) {
|
|
3688
3691
|
console.log("\nBuilding project...");
|
|
3689
|
-
await buildProject(
|
|
3692
|
+
await buildProject(cwd2, isPlugin2);
|
|
3690
3693
|
console.log("Build completed successfully [\u2713]");
|
|
3691
3694
|
}
|
|
3692
3695
|
}
|
|
@@ -3723,8 +3726,8 @@ var update = new Command4().name("update").description("Update ElizaOS CLI and p
|
|
|
3723
3726
|
}
|
|
3724
3727
|
}).action(async (options) => {
|
|
3725
3728
|
try {
|
|
3726
|
-
const
|
|
3727
|
-
const directoryInfo = detectDirectoryType(
|
|
3729
|
+
const cwd2 = process.cwd();
|
|
3730
|
+
const directoryInfo = detectDirectoryType(cwd2);
|
|
3728
3731
|
const isInProject = directoryInfo && isValidForUpdates(directoryInfo);
|
|
3729
3732
|
const updateCli = options.cli || !options.cli && !options.packages;
|
|
3730
3733
|
const updatePackages = options.packages || !options.cli && !options.packages && isInProject;
|
|
@@ -3772,7 +3775,7 @@ var update = new Command4().name("update").description("Update ElizaOS CLI and p
|
|
|
3772
3775
|
dryRun: options.check,
|
|
3773
3776
|
skipBuild: options.skipBuild
|
|
3774
3777
|
};
|
|
3775
|
-
await updateDependencies(
|
|
3778
|
+
await updateDependencies(cwd2, isPlugin2, updateOptions);
|
|
3776
3779
|
if (options.check) {
|
|
3777
3780
|
console.log(`Version: ${await getVersion2()}`);
|
|
3778
3781
|
} else {
|
|
@@ -3841,8 +3844,8 @@ var publish = new Command5().name("publish").description("Publish a plugin to np
|
|
|
3841
3844
|
await displayBanner();
|
|
3842
3845
|
}).action(async (opts) => {
|
|
3843
3846
|
try {
|
|
3844
|
-
const
|
|
3845
|
-
const directoryInfo = detectDirectoryType(
|
|
3847
|
+
const cwd2 = process.cwd();
|
|
3848
|
+
const directoryInfo = detectDirectoryType(cwd2);
|
|
3846
3849
|
if (!directoryInfo || !directoryInfo.hasPackageJson) {
|
|
3847
3850
|
console.error(
|
|
3848
3851
|
`No package.json found in current directory. This directory is: ${directoryInfo?.type || "invalid or inaccessible"}`
|
|
@@ -3876,7 +3879,7 @@ var publish = new Command5().name("publish").description("Publish a plugin to np
|
|
|
3876
3879
|
}
|
|
3877
3880
|
}
|
|
3878
3881
|
}
|
|
3879
|
-
const packageJsonPath = path19.join(
|
|
3882
|
+
const packageJsonPath = path19.join(cwd2, "package.json");
|
|
3880
3883
|
const packageJsonContent = await fs8.readFile(packageJsonPath, "utf-8");
|
|
3881
3884
|
const packageJson = JSON.parse(packageJsonContent);
|
|
3882
3885
|
if (!packageJson.name || !packageJson.version) {
|
|
@@ -4019,7 +4022,7 @@ var publish = new Command5().name("publish").description("Publish a plugin to np
|
|
|
4019
4022
|
});
|
|
4020
4023
|
const finalPluginName = packageJson.name.startsWith("@") ? packageJson.name.split("/")[1] : packageJson.name;
|
|
4021
4024
|
await fs8.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf-8");
|
|
4022
|
-
await validatePluginRequirements(
|
|
4025
|
+
await validatePluginRequirements(cwd2, packageJson);
|
|
4023
4026
|
const settings = await getRegistrySettings();
|
|
4024
4027
|
const publishUsername = credentials ? credentials.username : npmUsername;
|
|
4025
4028
|
settings.publishConfig = {
|
|
@@ -4057,7 +4060,7 @@ var publish = new Command5().name("publish").description("Publish a plugin to np
|
|
|
4057
4060
|
console.info(`Running plugin publish tests...`);
|
|
4058
4061
|
if (opts.npm) {
|
|
4059
4062
|
console.info("\nTesting npm publishing:");
|
|
4060
|
-
const npmTestSuccess = await testPublishToNpm(
|
|
4063
|
+
const npmTestSuccess = await testPublishToNpm(cwd2);
|
|
4061
4064
|
if (!npmTestSuccess) {
|
|
4062
4065
|
console.error("npm publishing test failed");
|
|
4063
4066
|
process.exit(1);
|
|
@@ -4091,12 +4094,12 @@ var publish = new Command5().name("publish").description("Publish a plugin to np
|
|
|
4091
4094
|
let publishedToGitHub = false;
|
|
4092
4095
|
let registryPrUrl = null;
|
|
4093
4096
|
console.info(`Publishing plugin to npm...`);
|
|
4094
|
-
await publishToNpm(
|
|
4097
|
+
await publishToNpm(cwd2, packageJson, npmUsername);
|
|
4095
4098
|
packageMetadata.npmPackage = packageJson.name;
|
|
4096
4099
|
if (!opts.npm && credentials) {
|
|
4097
4100
|
try {
|
|
4098
4101
|
publishResult = await publishToGitHubAction(
|
|
4099
|
-
|
|
4102
|
+
cwd2,
|
|
4100
4103
|
packageJson,
|
|
4101
4104
|
credentials,
|
|
4102
4105
|
opts.skipRegistry,
|
|
@@ -4751,12 +4754,12 @@ var start = new Command7().name("start").description("Build and start the Eliza
|
|
|
4751
4754
|
}).action(async (options) => {
|
|
4752
4755
|
try {
|
|
4753
4756
|
await loadEnvConfig();
|
|
4754
|
-
const
|
|
4755
|
-
const dirInfo = detectDirectoryType(
|
|
4757
|
+
const cwd2 = process.cwd();
|
|
4758
|
+
const dirInfo = detectDirectoryType(cwd2);
|
|
4756
4759
|
const isMonorepo = dirInfo.type === "elizaos-monorepo";
|
|
4757
4760
|
if (!isMonorepo && !process.env.ELIZA_TEST_MODE) {
|
|
4758
4761
|
try {
|
|
4759
|
-
await buildProject(
|
|
4762
|
+
await buildProject(cwd2, false);
|
|
4760
4763
|
} catch (error) {
|
|
4761
4764
|
logger20.error(`Build error: ${error instanceof Error ? error.message : String(error)}`);
|
|
4762
4765
|
logger20.warn(
|
|
@@ -4794,11 +4797,11 @@ var start = new Command7().name("start").description("Build and start the Eliza
|
|
|
4794
4797
|
}
|
|
4795
4798
|
} else {
|
|
4796
4799
|
try {
|
|
4797
|
-
const
|
|
4798
|
-
const dirInfo2 = detectDirectoryType(
|
|
4800
|
+
const cwd3 = process.cwd();
|
|
4801
|
+
const dirInfo2 = detectDirectoryType(cwd3);
|
|
4799
4802
|
if (dirInfo2.hasPackageJson && dirInfo2.type !== "non-elizaos-dir") {
|
|
4800
4803
|
logger20.info("No character files specified, attempting to load project agents...");
|
|
4801
|
-
const project = await loadProject(
|
|
4804
|
+
const project = await loadProject(cwd3);
|
|
4802
4805
|
if (project.agents && project.agents.length > 0) {
|
|
4803
4806
|
logger20.info(`Found ${project.agents.length} agent(s) in project configuration`);
|
|
4804
4807
|
projectAgents = project.agents;
|
|
@@ -4995,11 +4998,11 @@ async function runTypeCheck(projectPath, strict = true) {
|
|
|
4995
4998
|
|
|
4996
4999
|
// src/commands/test/actions/component-tests.ts
|
|
4997
5000
|
async function runComponentTests(testPath, options, projectInfo) {
|
|
4998
|
-
const
|
|
5001
|
+
const cwd2 = process.cwd();
|
|
4999
5002
|
const isPlugin2 = projectInfo.type === "elizaos-plugin";
|
|
5000
5003
|
if (!options.skipTypeCheck) {
|
|
5001
5004
|
logger23.info("Running TypeScript validation...");
|
|
5002
|
-
const typeCheckResult = await runTypeCheck(
|
|
5005
|
+
const typeCheckResult = await runTypeCheck(cwd2, true);
|
|
5003
5006
|
if (!typeCheckResult.success) {
|
|
5004
5007
|
logger23.error("TypeScript validation failed:");
|
|
5005
5008
|
typeCheckResult.errors.forEach((error) => logger23.error(error));
|
|
@@ -5010,7 +5013,7 @@ async function runComponentTests(testPath, options, projectInfo) {
|
|
|
5010
5013
|
if (!options.skipBuild) {
|
|
5011
5014
|
try {
|
|
5012
5015
|
logger23.info(`Building ${isPlugin2 ? "plugin" : "project"}...`);
|
|
5013
|
-
await buildProject(
|
|
5016
|
+
await buildProject(cwd2, isPlugin2);
|
|
5014
5017
|
logger23.success(`Build completed successfully`);
|
|
5015
5018
|
} catch (buildError) {
|
|
5016
5019
|
logger23.error(`Build failed: ${buildError}`);
|
|
@@ -5062,10 +5065,10 @@ import path28 from "path";
|
|
|
5062
5065
|
async function runE2eTests(testPath, options, projectInfo) {
|
|
5063
5066
|
if (!options.skipBuild) {
|
|
5064
5067
|
try {
|
|
5065
|
-
const
|
|
5068
|
+
const cwd2 = process.cwd();
|
|
5066
5069
|
const isPlugin2 = projectInfo.type === "elizaos-plugin";
|
|
5067
5070
|
logger24.info(`Building ${isPlugin2 ? "plugin" : "project"}...`);
|
|
5068
|
-
await buildProject(
|
|
5071
|
+
await buildProject(cwd2, isPlugin2);
|
|
5069
5072
|
logger24.info(`Build completed successfully`);
|
|
5070
5073
|
} catch (buildError) {
|
|
5071
5074
|
logger24.error(`Build error: ${buildError}`);
|
|
@@ -5399,6 +5402,19 @@ import { Command as Command11 } from "commander";
|
|
|
5399
5402
|
process.env.NODE_OPTIONS = "--no-deprecation";
|
|
5400
5403
|
process.env.NODE_NO_WARNINGS = "1";
|
|
5401
5404
|
process.env.QUIET_MODE = process.env.QUIET_MODE || "true";
|
|
5405
|
+
var cwd = process.cwd();
|
|
5406
|
+
var localModulesPath = path30.join(cwd, "node_modules");
|
|
5407
|
+
if (process.env.NODE_PATH) {
|
|
5408
|
+
process.env.NODE_PATH = `${localModulesPath}${path30.delimiter}${process.env.NODE_PATH}`;
|
|
5409
|
+
} else {
|
|
5410
|
+
process.env.NODE_PATH = localModulesPath;
|
|
5411
|
+
}
|
|
5412
|
+
var localBinPath = path30.join(cwd, "node_modules", ".bin");
|
|
5413
|
+
if (process.env.PATH) {
|
|
5414
|
+
process.env.PATH = `${localBinPath}${path30.delimiter}${process.env.PATH}`;
|
|
5415
|
+
} else {
|
|
5416
|
+
process.env.PATH = localBinPath;
|
|
5417
|
+
}
|
|
5402
5418
|
var shutdownState = {
|
|
5403
5419
|
isShuttingDown: false,
|
|
5404
5420
|
/**
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@elizaos/cli": "1.2.11-beta.
|
|
32
|
-
"@elizaos/core": "1.2.11-beta.
|
|
33
|
-
"@elizaos/plugin-bootstrap": "1.2.11-beta.
|
|
34
|
-
"@elizaos/plugin-sql": "1.2.11-beta.
|
|
31
|
+
"@elizaos/cli": "1.2.11-beta.3",
|
|
32
|
+
"@elizaos/core": "1.2.11-beta.3",
|
|
33
|
+
"@elizaos/plugin-bootstrap": "1.2.11-beta.3",
|
|
34
|
+
"@elizaos/plugin-sql": "1.2.11-beta.3",
|
|
35
35
|
"@tanstack/react-query": "^5.29.0",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"react": "^18.3.1",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"GUIDE.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elizaos/cli": "1.2.11-beta.
|
|
37
|
-
"@elizaos/core": "1.2.11-beta.
|
|
36
|
+
"@elizaos/cli": "1.2.11-beta.3",
|
|
37
|
+
"@elizaos/core": "1.2.11-beta.3",
|
|
38
38
|
"@elizaos/plugin-redpill": "1.0.3",
|
|
39
|
-
"@elizaos/plugin-sql": "1.2.11-beta.
|
|
39
|
+
"@elizaos/plugin-sql": "1.2.11-beta.3",
|
|
40
40
|
"@phala/dstack-sdk": "0.1.11",
|
|
41
41
|
"@solana/web3.js": "1.98.2",
|
|
42
42
|
"viem": "2.30.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/cli",
|
|
3
|
-
"version": "1.2.11-beta.
|
|
3
|
+
"version": "1.2.11-beta.4",
|
|
4
4
|
"description": "elizaOS CLI - Manage your AI agents and plugins",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"typescript": "5.8.3",
|
|
70
70
|
"vite": "^6.3.5"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "a10044d0d3f0daa66daca3e6b078a91c31c7eb1b",
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@anthropic-ai/claude-code": "^1.0.35",
|
|
75
75
|
"@anthropic-ai/sdk": "^0.54.0",
|
|
76
76
|
"@clack/prompts": "^0.11.0",
|
|
77
|
-
"@elizaos/core": "1.2.11-beta.
|
|
78
|
-
"@elizaos/plugin-sql": "1.2.11-beta.
|
|
79
|
-
"@elizaos/server": "1.2.11-beta.
|
|
77
|
+
"@elizaos/core": "1.2.11-beta.4",
|
|
78
|
+
"@elizaos/plugin-sql": "1.2.11-beta.4",
|
|
79
|
+
"@elizaos/server": "1.2.11-beta.4",
|
|
80
80
|
"bun": "^1.2.17",
|
|
81
81
|
"chalk": "^5.3.0",
|
|
82
82
|
"chokidar": "^4.0.3",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@elizaos/cli": "1.2.11-beta.
|
|
32
|
-
"@elizaos/core": "1.2.11-beta.
|
|
33
|
-
"@elizaos/plugin-bootstrap": "1.2.11-beta.
|
|
34
|
-
"@elizaos/plugin-sql": "1.2.11-beta.
|
|
31
|
+
"@elizaos/cli": "1.2.11-beta.3",
|
|
32
|
+
"@elizaos/core": "1.2.11-beta.3",
|
|
33
|
+
"@elizaos/plugin-bootstrap": "1.2.11-beta.3",
|
|
34
|
+
"@elizaos/plugin-sql": "1.2.11-beta.3",
|
|
35
35
|
"@tanstack/react-query": "^5.29.0",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"react": "^18.3.1",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"GUIDE.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elizaos/cli": "1.2.11-beta.
|
|
37
|
-
"@elizaos/core": "1.2.11-beta.
|
|
36
|
+
"@elizaos/cli": "1.2.11-beta.3",
|
|
37
|
+
"@elizaos/core": "1.2.11-beta.3",
|
|
38
38
|
"@elizaos/plugin-redpill": "1.0.3",
|
|
39
|
-
"@elizaos/plugin-sql": "1.2.11-beta.
|
|
39
|
+
"@elizaos/plugin-sql": "1.2.11-beta.3",
|
|
40
40
|
"@phala/dstack-sdk": "0.1.11",
|
|
41
41
|
"@solana/web3.js": "1.98.2",
|
|
42
42
|
"viem": "2.30.1",
|