@elizaos/cli 1.2.1 → 1.2.2
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/{chunk-RIKSF2AY.js → chunk-5RHJRZKW.js} +6 -6
- package/dist/chunk-GRPGGUED.js +2262 -0
- package/dist/{chunk-NZGCZTGS.js → chunk-J5E77VTL.js} +2 -2
- package/dist/{chunk-GISU7XYL.js → chunk-PMV25BM7.js} +1 -1
- package/dist/chunk-XB5JBFO6.js +41 -0
- package/dist/{chunk-UM35ZDGG.js → chunk-YKFBLIQD.js} +121 -104
- package/dist/commands/agent/actions/index.js +3 -3
- package/dist/commands/agent/index.js +3 -3
- package/dist/commands/create/actions/index.js +5 -5
- package/dist/commands/create/index.js +6 -6
- package/dist/commands/shared/index.js +1 -1
- package/dist/index.js +35 -32
- package/dist/{plugin-creator-35CAJF4O.js → plugin-creator-KFTUVFYX.js} +10 -7
- package/dist/{registry-TGHIHTXG.js → registry-WOGFPQNY.js} +3 -3
- package/dist/{setup-USNJOJDX.js → setup-KAJWYH6P.js} +4 -4
- 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/dist/{utils-JZFPT3VW.js → utils-Q5OUIPQH.js} +3 -3
- package/package.json +5 -6
- package/templates/plugin-starter/dist/.vite/manifest.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/chunk-7PPBVSWE.js +0 -166
- package/dist/chunk-AQ6OMR2A.js +0 -14
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
selectEmbeddingModel,
|
|
13
13
|
validateCreateOptions,
|
|
14
14
|
validateProjectName
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5RHJRZKW.js";
|
|
16
16
|
import {
|
|
17
17
|
displayBanner,
|
|
18
18
|
handleError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YKFBLIQD.js";
|
|
20
20
|
|
|
21
21
|
// src/commands/create/index.ts
|
|
22
22
|
import { Command } from "commander";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
var __create = Object.create;
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
12
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
13
|
+
}) : x)(function(x) {
|
|
14
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
15
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
16
|
+
});
|
|
17
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
__require,
|
|
39
|
+
__commonJS,
|
|
40
|
+
__toESM
|
|
41
|
+
};
|
|
@@ -3,22 +3,27 @@ import { createRequire } from 'module';
|
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
bunExec,
|
|
7
|
+
bunExecInherit,
|
|
8
|
+
bunExecSimple,
|
|
9
|
+
commandExists,
|
|
6
10
|
displayBunInstallationTipCompact,
|
|
7
11
|
emoji,
|
|
12
|
+
require_execa,
|
|
8
13
|
runBunCommand
|
|
9
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GRPGGUED.js";
|
|
10
15
|
import {
|
|
11
16
|
getAgentRuntimeUrl,
|
|
12
17
|
getAgentsBaseUrl
|
|
13
18
|
} from "./chunk-F24MS2YR.js";
|
|
14
19
|
import {
|
|
15
|
-
__require
|
|
16
|
-
|
|
20
|
+
__require,
|
|
21
|
+
__toESM
|
|
22
|
+
} from "./chunk-XB5JBFO6.js";
|
|
17
23
|
|
|
18
24
|
// src/utils/build-project.ts
|
|
19
25
|
import * as fs3 from "fs";
|
|
20
26
|
import * as path4 from "path";
|
|
21
|
-
import { execa as execa3 } from "execa";
|
|
22
27
|
|
|
23
28
|
// src/utils/directory-detection.ts
|
|
24
29
|
import * as fs2 from "fs";
|
|
@@ -88,64 +93,79 @@ async function resolvePgliteDir(dir, fallbackDir, targetProjectDir) {
|
|
|
88
93
|
|
|
89
94
|
// src/utils/auto-install-bun.ts
|
|
90
95
|
import { logger } from "@elizaos/core";
|
|
91
|
-
import {
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
import { homedir } from "os";
|
|
97
|
+
import { join } from "path";
|
|
98
|
+
var INSTALLATION_VERIFICATION_DELAY_MS = 2e3;
|
|
99
|
+
function updatePathForBun() {
|
|
100
|
+
const home = homedir();
|
|
101
|
+
const bunBinPath = join(home, ".bun", "bin");
|
|
102
|
+
const currentPath = process.env.PATH || "";
|
|
103
|
+
const pathSeparator = process.platform === "win32" ? ";" : ":";
|
|
104
|
+
const pathDirs = currentPath.split(pathSeparator);
|
|
105
|
+
const bunBinPathNormalized = bunBinPath.replace(/[/\\]+$/, "");
|
|
106
|
+
const isInPath = pathDirs.some((dir) => {
|
|
107
|
+
const dirNormalized = dir.replace(/[/\\]+$/, "");
|
|
108
|
+
return dirNormalized === bunBinPathNormalized;
|
|
109
|
+
});
|
|
110
|
+
if (!isInPath) {
|
|
111
|
+
process.env.PATH = `${bunBinPath}${pathSeparator}${currentPath}`;
|
|
112
|
+
logger.debug(`Added ${bunBinPath} to PATH for current process`);
|
|
113
|
+
} else {
|
|
114
|
+
logger.debug(`${bunBinPath} is already in PATH`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async function isBunInstalled() {
|
|
94
118
|
try {
|
|
95
|
-
await
|
|
119
|
+
const exists = await commandExists("bun");
|
|
120
|
+
if (!exists) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const result = await bunExec("bun", ["--version"], { stdio: "ignore" });
|
|
124
|
+
return result.success;
|
|
125
|
+
} catch (error) {
|
|
126
|
+
logger.debug("Error checking if Bun is installed:", error);
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async function autoInstallBun() {
|
|
131
|
+
if (await isBunInstalled()) {
|
|
132
|
+
logger.info("Bun is already installed.");
|
|
96
133
|
return true;
|
|
97
|
-
} catch {
|
|
98
134
|
}
|
|
99
|
-
|
|
135
|
+
const platform = process.platform;
|
|
100
136
|
try {
|
|
101
137
|
if (platform === "win32") {
|
|
102
|
-
|
|
103
|
-
await execa("powershell", ["-c", "irm bun.sh/install.ps1 | iex"], {
|
|
104
|
-
stdio: "inherit"
|
|
105
|
-
});
|
|
138
|
+
await bunExecInherit("powershell", ["-c", "irm bun.sh/install.ps1 | iex"]);
|
|
106
139
|
} else {
|
|
107
|
-
|
|
108
|
-
await execa("sh", ["-c", "curl -fsSL https://bun.sh/install | bash"], {
|
|
109
|
-
stdio: "inherit"
|
|
110
|
-
});
|
|
140
|
+
await bunExecInherit("sh", ["-c", "curl -fsSL https://bun.sh/install | bash"]);
|
|
111
141
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return true;
|
|
119
|
-
} catch (error) {
|
|
120
|
-
logger.error(`${emoji.error("Failed to automatically install Bun:")}`);
|
|
121
|
-
logger.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
122
|
-
logger.info(`
|
|
123
|
-
${emoji.info("Please install Bun manually:")}`);
|
|
124
|
-
if (platform === "win32") {
|
|
125
|
-
logger.info(' Windows: powershell -c "irm bun.sh/install.ps1 | iex"');
|
|
142
|
+
logger.info("Bun installation script executed successfully.");
|
|
143
|
+
updatePathForBun();
|
|
144
|
+
await new Promise((resolve2) => setTimeout(resolve2, INSTALLATION_VERIFICATION_DELAY_MS));
|
|
145
|
+
if (await isBunInstalled()) {
|
|
146
|
+
logger.success("Bun has been successfully installed!");
|
|
147
|
+
return true;
|
|
126
148
|
} else {
|
|
127
|
-
logger.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
149
|
+
logger.error("Bun installation completed but the command is not available in PATH.");
|
|
150
|
+
logger.error("Please restart your terminal or source your shell profile.");
|
|
151
|
+
return false;
|
|
131
152
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
`
|
|
136
|
-
${emoji.tip("After installation, restart your terminal or source your shell profile")}`
|
|
153
|
+
} catch (error) {
|
|
154
|
+
logger.error(
|
|
155
|
+
`Failed to auto-install Bun: ${error instanceof Error ? error.message : String(error)}`
|
|
137
156
|
);
|
|
138
157
|
return false;
|
|
139
158
|
}
|
|
140
159
|
}
|
|
141
160
|
function shouldAutoInstall() {
|
|
142
|
-
|
|
161
|
+
const autoInstallEnv = process.env.ELIZA_AUTO_INSTALL_BUN;
|
|
162
|
+
if (autoInstallEnv === "false" || autoInstallEnv === "0") {
|
|
143
163
|
return false;
|
|
144
164
|
}
|
|
145
|
-
if (process.env.
|
|
165
|
+
if (process.env.CI || process.env.CONTINUOUS_INTEGRATION) {
|
|
146
166
|
return false;
|
|
147
167
|
}
|
|
148
|
-
if (process.
|
|
168
|
+
if (process.env.CONTAINER || process.env.DOCKER_CONTAINER) {
|
|
149
169
|
return false;
|
|
150
170
|
}
|
|
151
171
|
return true;
|
|
@@ -213,7 +233,7 @@ var UserEnvironment = class _UserEnvironment {
|
|
|
213
233
|
const isBunx = process.argv[0]?.includes("bun");
|
|
214
234
|
let version = null;
|
|
215
235
|
try {
|
|
216
|
-
const { stdout } = await
|
|
236
|
+
const { stdout } = await bunExecSimple("bun", ["--version"]);
|
|
217
237
|
version = stdout.trim();
|
|
218
238
|
logger2.debug(`[UserEnvironment] Bun version: ${version}`);
|
|
219
239
|
} catch (e) {
|
|
@@ -225,9 +245,7 @@ var UserEnvironment = class _UserEnvironment {
|
|
|
225
245
|
const installSuccess = await autoInstallBun();
|
|
226
246
|
if (installSuccess) {
|
|
227
247
|
try {
|
|
228
|
-
const { stdout } = await
|
|
229
|
-
({ execa: execa10 }) => execa10("bun", ["--version"])
|
|
230
|
-
);
|
|
248
|
+
const { stdout } = await bunExecSimple("bun", ["--version"]);
|
|
231
249
|
version = stdout.trim();
|
|
232
250
|
logger2.debug(`[UserEnvironment] Bun version after auto-install: ${version}`);
|
|
233
251
|
} catch (retryError) {
|
|
@@ -406,8 +424,7 @@ var UserEnvironment = class _UserEnvironment {
|
|
|
406
424
|
}
|
|
407
425
|
}
|
|
408
426
|
try {
|
|
409
|
-
const {
|
|
410
|
-
const { stdout } = await execa10("npm", ["view", packageName, "version"]);
|
|
427
|
+
const { stdout } = await bunExecSimple("npm", ["view", packageName, "version"]);
|
|
411
428
|
if (stdout?.trim()) {
|
|
412
429
|
logger2.info(`Found latest version of ${packageName} from npm: ${stdout.trim()}`);
|
|
413
430
|
return stdout.trim();
|
|
@@ -613,7 +630,7 @@ function isValidForUpdates(info) {
|
|
|
613
630
|
}
|
|
614
631
|
|
|
615
632
|
// src/utils/spinner-utils.ts
|
|
616
|
-
|
|
633
|
+
var import_execa = __toESM(require_execa(), 1);
|
|
617
634
|
import * as clack from "@clack/prompts";
|
|
618
635
|
import colors from "yoctocolors";
|
|
619
636
|
import { parseBooleanFromText, logger as logger3 } from "@elizaos/core";
|
|
@@ -624,7 +641,7 @@ async function runCommandWithSpinner(command, args, options) {
|
|
|
624
641
|
const spinner3 = clack.spinner();
|
|
625
642
|
try {
|
|
626
643
|
spinner3.start(options.spinnerText);
|
|
627
|
-
const result = await
|
|
644
|
+
const result = await (0, import_execa.execa)(command, args, {
|
|
628
645
|
cwd: options.cwd || process.cwd(),
|
|
629
646
|
stdio: "pipe",
|
|
630
647
|
reject: false
|
|
@@ -710,7 +727,7 @@ async function installPluginWithSpinner(pluginName, targetDir, purpose = "") {
|
|
|
710
727
|
const spinner3 = clack.spinner();
|
|
711
728
|
spinner3.start(`Installing ${packageName}${purposeText}...`);
|
|
712
729
|
try {
|
|
713
|
-
const result = await
|
|
730
|
+
const result = await (0, import_execa.execa)("bun", ["add", packageName], {
|
|
714
731
|
cwd: targetDir,
|
|
715
732
|
stdio: "pipe",
|
|
716
733
|
reject: false
|
|
@@ -780,12 +797,10 @@ async function buildProject(cwd = process.cwd(), isPlugin = false) {
|
|
|
780
797
|
const tsconfigPath = path4.join(cwd, "tsconfig.json");
|
|
781
798
|
if (fs3.existsSync(tsconfigPath)) {
|
|
782
799
|
try {
|
|
783
|
-
const result = await
|
|
784
|
-
cwd
|
|
785
|
-
stdio: "pipe",
|
|
786
|
-
reject: false
|
|
800
|
+
const result = await bunExec("bunx", ["tsc", "--build"], {
|
|
801
|
+
cwd
|
|
787
802
|
});
|
|
788
|
-
if (result.
|
|
803
|
+
if (result.success) {
|
|
789
804
|
return;
|
|
790
805
|
} else {
|
|
791
806
|
throw new Error(`bunx tsc build failed: ${result.stderr || result.stdout}`);
|
|
@@ -801,11 +816,11 @@ async function buildProject(cwd = process.cwd(), isPlugin = false) {
|
|
|
801
816
|
}
|
|
802
817
|
|
|
803
818
|
// src/utils/cli-bun-migration.ts
|
|
819
|
+
var import_execa2 = __toESM(require_execa(), 1);
|
|
804
820
|
import { logger as logger4 } from "@elizaos/core";
|
|
805
|
-
import { execa as execa4 } from "execa";
|
|
806
821
|
async function isBunAvailable() {
|
|
807
822
|
try {
|
|
808
|
-
await
|
|
823
|
+
await (0, import_execa2.execa)("bun", ["--version"], { stdio: "ignore" });
|
|
809
824
|
return true;
|
|
810
825
|
} catch (error) {
|
|
811
826
|
return false;
|
|
@@ -813,13 +828,13 @@ async function isBunAvailable() {
|
|
|
813
828
|
}
|
|
814
829
|
async function isCliInstalledViaNpm() {
|
|
815
830
|
try {
|
|
816
|
-
const { stdout } = await
|
|
831
|
+
const { stdout } = await (0, import_execa2.execa)("npm", ["list", "-g", "@elizaos/cli", "--depth=0"], {
|
|
817
832
|
stdio: "pipe"
|
|
818
833
|
});
|
|
819
834
|
return stdout.includes("@elizaos/cli");
|
|
820
835
|
} catch (error) {
|
|
821
836
|
try {
|
|
822
|
-
const { stdout: whichOutput } = await
|
|
837
|
+
const { stdout: whichOutput } = await (0, import_execa2.execa)("which", ["elizaos"], { stdio: "pipe" });
|
|
823
838
|
return whichOutput.includes("node_modules") || whichOutput.includes(".nvm");
|
|
824
839
|
} catch {
|
|
825
840
|
return false;
|
|
@@ -828,15 +843,15 @@ async function isCliInstalledViaNpm() {
|
|
|
828
843
|
}
|
|
829
844
|
async function removeNpmInstallation() {
|
|
830
845
|
logger4.info("Removing npm installation of @elizaos/cli...");
|
|
831
|
-
await
|
|
846
|
+
await (0, import_execa2.execa)("npm", ["uninstall", "-g", "@elizaos/cli"], { stdio: "inherit" });
|
|
832
847
|
}
|
|
833
848
|
async function installCliWithBun(version) {
|
|
834
849
|
logger4.info("Installing CLI with bun...");
|
|
835
|
-
await
|
|
850
|
+
await (0, import_execa2.execa)("bun", ["add", "-g", `@elizaos/cli@${version}`], { stdio: "inherit" });
|
|
836
851
|
}
|
|
837
852
|
async function verifyCliInstallation(expectedVersion) {
|
|
838
853
|
try {
|
|
839
|
-
const { stdout } = await
|
|
854
|
+
const { stdout } = await (0, import_execa2.execa)("elizaos", ["-v"], { stdio: "pipe" });
|
|
840
855
|
const output = stdout.trim();
|
|
841
856
|
const versionMatch = output.match(/(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?)/);
|
|
842
857
|
if (!versionMatch) {
|
|
@@ -871,7 +886,7 @@ async function migrateCliToBun(targetVersion) {
|
|
|
871
886
|
logger4.error("Your original npm installation is still intact.");
|
|
872
887
|
try {
|
|
873
888
|
logger4.info("Cleaning up failed bun installation...");
|
|
874
|
-
await
|
|
889
|
+
await (0, import_execa2.execa)("bun", ["remove", "-g", "@elizaos/cli"], { stdio: "ignore" });
|
|
875
890
|
} catch {
|
|
876
891
|
}
|
|
877
892
|
throw error;
|
|
@@ -1171,7 +1186,6 @@ async function replacePluginNameInFiles(targetDir, pluginName) {
|
|
|
1171
1186
|
import { existsSync as existsSync6, readFileSync as readFileSync4 } from "fs";
|
|
1172
1187
|
import path7, { dirname } from "path";
|
|
1173
1188
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
1174
|
-
import { execa as execa5 } from "execa";
|
|
1175
1189
|
function isRunningFromNodeModules() {
|
|
1176
1190
|
const __filename2 = fileURLToPath3(import.meta.url);
|
|
1177
1191
|
return __filename2.includes("node_modules");
|
|
@@ -1229,7 +1243,7 @@ async function getLatestCliVersion(currentVersion) {
|
|
|
1229
1243
|
if (versionCheckCache && Date.now() - versionCheckCache.timestamp < CACHE_DURATION) {
|
|
1230
1244
|
return versionCheckCache.latestVersion;
|
|
1231
1245
|
}
|
|
1232
|
-
const { stdout } = await
|
|
1246
|
+
const { stdout } = await bunExecSimple("npm", ["view", "@elizaos/cli", "time", "--json"]);
|
|
1233
1247
|
const timeData = JSON.parse(stdout);
|
|
1234
1248
|
delete timeData.created;
|
|
1235
1249
|
delete timeData.modified;
|
|
@@ -2377,11 +2391,11 @@ async function getPackageInfo() {
|
|
|
2377
2391
|
}
|
|
2378
2392
|
|
|
2379
2393
|
// src/utils/github.ts
|
|
2394
|
+
var import_execa3 = __toESM(require_execa(), 1);
|
|
2380
2395
|
import { promises as fs8 } from "fs";
|
|
2381
2396
|
import path10 from "path";
|
|
2382
2397
|
import { logger as logger10 } from "@elizaos/core";
|
|
2383
2398
|
import { existsSync as existsSync9 } from "fs";
|
|
2384
|
-
import { execa as execa6 } from "execa";
|
|
2385
2399
|
import * as clack4 from "@clack/prompts";
|
|
2386
2400
|
var GITHUB_API_URL = "https://api.github.com";
|
|
2387
2401
|
async function validateGitHubToken(token) {
|
|
@@ -2757,7 +2771,7 @@ async function getGitHubCredentials() {
|
|
|
2757
2771
|
}
|
|
2758
2772
|
logger10.warn("Invalid GitHub token found in environment variables");
|
|
2759
2773
|
}
|
|
2760
|
-
const { getGitHubToken: getGitHubToken2 } = await import("./registry-
|
|
2774
|
+
const { getGitHubToken: getGitHubToken2 } = await import("./registry-WOGFPQNY.js");
|
|
2761
2775
|
const token = await getGitHubToken2() || void 0;
|
|
2762
2776
|
if (token) {
|
|
2763
2777
|
const isValid2 = await validateGitHubToken(token);
|
|
@@ -2976,7 +2990,7 @@ async function pushToGitHub(cwd, repoUrl, branch = "main") {
|
|
|
2976
2990
|
let hasCorrectRemote = false;
|
|
2977
2991
|
if (gitDirExists) {
|
|
2978
2992
|
try {
|
|
2979
|
-
const { stdout: remoteUrl } = await
|
|
2993
|
+
const { stdout: remoteUrl } = await (0, import_execa3.execa)("git", ["remote", "get-url", "origin"], { cwd });
|
|
2980
2994
|
const sanitizedRepoUrl = repoUrl.replace(/https:\/\/.*?@/, "https://");
|
|
2981
2995
|
const sanitizedRemoteUrl = remoteUrl.replace(/https:\/\/.*?@/, "https://");
|
|
2982
2996
|
hasCorrectRemote = sanitizedRemoteUrl.includes(
|
|
@@ -2989,39 +3003,39 @@ async function pushToGitHub(cwd, repoUrl, branch = "main") {
|
|
|
2989
3003
|
if (!gitDirExists || !hasCorrectRemote) {
|
|
2990
3004
|
if (gitDirExists) {
|
|
2991
3005
|
logger10.info("Existing git repository has incorrect remote, reinitializing...");
|
|
2992
|
-
await
|
|
3006
|
+
await (0, import_execa3.execa)("rm", ["-rf", ".git"], { cwd });
|
|
2993
3007
|
}
|
|
2994
|
-
await
|
|
2995
|
-
await
|
|
3008
|
+
await (0, import_execa3.execa)("git", ["init"], { cwd });
|
|
3009
|
+
await (0, import_execa3.execa)("git", ["checkout", "-b", "main"], { cwd });
|
|
2996
3010
|
logger10.info("Git repository initialized with main branch");
|
|
2997
|
-
await
|
|
3011
|
+
await (0, import_execa3.execa)("git", ["remote", "add", "origin", repoUrl], { cwd });
|
|
2998
3012
|
logger10.info(`Added remote: ${repoUrl.replace(/\/\/.*?@/, "//***@")}`);
|
|
2999
3013
|
} else {
|
|
3000
3014
|
try {
|
|
3001
|
-
await
|
|
3002
|
-
await
|
|
3015
|
+
await (0, import_execa3.execa)("git", ["rev-parse", "--verify", branch], { cwd });
|
|
3016
|
+
await (0, import_execa3.execa)("git", ["checkout", branch], { cwd });
|
|
3003
3017
|
} catch (error) {
|
|
3004
|
-
await
|
|
3018
|
+
await (0, import_execa3.execa)("git", ["checkout", "-b", branch], { cwd });
|
|
3005
3019
|
logger10.info(`Created and switched to ${branch} branch`);
|
|
3006
3020
|
}
|
|
3007
3021
|
}
|
|
3008
|
-
await
|
|
3022
|
+
await (0, import_execa3.execa)("git", ["add", "."], { cwd });
|
|
3009
3023
|
logger10.info("Added files to git");
|
|
3010
3024
|
try {
|
|
3011
|
-
await
|
|
3025
|
+
await (0, import_execa3.execa)("git", ["config", "user.email"], { cwd });
|
|
3012
3026
|
} catch (error) {
|
|
3013
|
-
await
|
|
3014
|
-
await
|
|
3027
|
+
await (0, import_execa3.execa)("git", ["config", "user.email", "plugindev@elizaos.com"], { cwd });
|
|
3028
|
+
await (0, import_execa3.execa)("git", ["config", "user.name", "ElizaOS Plugin Dev"], { cwd });
|
|
3015
3029
|
logger10.info("Set git user info for commit");
|
|
3016
3030
|
}
|
|
3017
3031
|
try {
|
|
3018
|
-
await
|
|
3032
|
+
await (0, import_execa3.execa)("git", ["commit", "-m", "Initial commit from ElizaOS CLI"], { cwd });
|
|
3019
3033
|
logger10.info("Committed changes");
|
|
3020
3034
|
} catch (error) {
|
|
3021
3035
|
logger10.info("No changes to commit");
|
|
3022
3036
|
}
|
|
3023
3037
|
try {
|
|
3024
|
-
await
|
|
3038
|
+
await (0, import_execa3.execa)("git", ["push", "-u", "origin", branch], { cwd });
|
|
3025
3039
|
logger10.success(`Pushed to GitHub repository: ${repoUrl}`);
|
|
3026
3040
|
return true;
|
|
3027
3041
|
} catch (error) {
|
|
@@ -3030,7 +3044,7 @@ async function pushToGitHub(cwd, repoUrl, branch = "main") {
|
|
|
3030
3044
|
);
|
|
3031
3045
|
try {
|
|
3032
3046
|
logger10.info("Attempting force push...");
|
|
3033
|
-
await
|
|
3047
|
+
await (0, import_execa3.execa)("git", ["push", "-u", "origin", "main", "--force-with-lease"], {
|
|
3034
3048
|
cwd,
|
|
3035
3049
|
stdio: "pipe"
|
|
3036
3050
|
});
|
|
@@ -3919,7 +3933,6 @@ async function loadPluginModule(repository) {
|
|
|
3919
3933
|
import { logger as logger16 } from "@elizaos/core";
|
|
3920
3934
|
import { existsSync as existsSync13 } from "fs";
|
|
3921
3935
|
import path16 from "path";
|
|
3922
|
-
import { execa as execa7 } from "execa";
|
|
3923
3936
|
async function getPackageManager() {
|
|
3924
3937
|
logger16.debug("[PackageManager] Using bun as the package manager for ElizaOS CLI");
|
|
3925
3938
|
return "bun";
|
|
@@ -3946,18 +3959,22 @@ async function removeFromBunLock(packageName, directory) {
|
|
|
3946
3959
|
return;
|
|
3947
3960
|
}
|
|
3948
3961
|
try {
|
|
3949
|
-
await
|
|
3950
|
-
cwd: directory
|
|
3951
|
-
stdio: "pipe"
|
|
3952
|
-
// Don't show output for cleanup operation
|
|
3962
|
+
const result = await bunExec("bun", ["remove", packageName], {
|
|
3963
|
+
cwd: directory
|
|
3953
3964
|
});
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
if (error.message?.includes("not found") || error.message?.includes("No such package")) {
|
|
3957
|
-
logger16.debug(`Package ${packageName} not found in lockfile (expected for cleanup)`);
|
|
3965
|
+
if (result.success) {
|
|
3966
|
+
logger16.debug(`Successfully removed ${packageName} from bun.lock`);
|
|
3958
3967
|
} else {
|
|
3959
|
-
|
|
3968
|
+
if (result.stderr?.includes("not found") || result.stderr?.includes("No such package")) {
|
|
3969
|
+
logger16.debug(`Package ${packageName} not found in lockfile (expected for cleanup)`);
|
|
3970
|
+
} else {
|
|
3971
|
+
logger16.warn(
|
|
3972
|
+
`Failed to remove ${packageName} from bun.lock: ${result.stderr || "Unknown error"}`
|
|
3973
|
+
);
|
|
3974
|
+
}
|
|
3960
3975
|
}
|
|
3976
|
+
} catch (error) {
|
|
3977
|
+
logger16.warn(`Unexpected error removing ${packageName} from bun.lock: ${error.message}`);
|
|
3961
3978
|
}
|
|
3962
3979
|
}
|
|
3963
3980
|
async function executeInstallation(packageName, versionOrTag = "", directory = process.cwd()) {
|
|
@@ -4193,16 +4210,16 @@ async function findNextAvailablePort(startPort) {
|
|
|
4193
4210
|
}
|
|
4194
4211
|
|
|
4195
4212
|
// src/utils/publisher.ts
|
|
4196
|
-
|
|
4213
|
+
var import_execa4 = __toESM(require_execa(), 1);
|
|
4197
4214
|
import { logger as logger19 } from "@elizaos/core";
|
|
4198
4215
|
async function testPublishToNpm(cwd) {
|
|
4199
4216
|
try {
|
|
4200
|
-
await
|
|
4217
|
+
await (0, import_execa4.execa)("npm", ["whoami"]);
|
|
4201
4218
|
logger19.info("[\u2713] Logged in to npm");
|
|
4202
4219
|
logger19.info("Testing build...");
|
|
4203
|
-
await
|
|
4220
|
+
await (0, import_execa4.execa)("npm", ["run", "build", "--dry-run"], { cwd });
|
|
4204
4221
|
logger19.info("[\u2713] Build test successful");
|
|
4205
|
-
await
|
|
4222
|
+
await (0, import_execa4.execa)("npm", ["access", "ls-packages"], { cwd });
|
|
4206
4223
|
logger19.info("[\u2713] Have publish permissions");
|
|
4207
4224
|
return true;
|
|
4208
4225
|
} catch (error) {
|
|
@@ -4297,11 +4314,11 @@ async function testPublishToGitHub(packageJson, username) {
|
|
|
4297
4314
|
}
|
|
4298
4315
|
async function publishToNpm(cwd) {
|
|
4299
4316
|
try {
|
|
4300
|
-
await
|
|
4317
|
+
await (0, import_execa4.execa)("npm", ["whoami"]);
|
|
4301
4318
|
logger19.info("Building package...");
|
|
4302
|
-
await
|
|
4319
|
+
await (0, import_execa4.execa)("npm", ["run", "build"], { cwd, stdio: "inherit" });
|
|
4303
4320
|
logger19.info("Publishing to npm...");
|
|
4304
|
-
await
|
|
4321
|
+
await (0, import_execa4.execa)("npm", ["publish"], { cwd, stdio: "inherit" });
|
|
4305
4322
|
return true;
|
|
4306
4323
|
} catch (error) {
|
|
4307
4324
|
logger19.error("Failed to publish to npm:", error);
|
|
@@ -4807,9 +4824,9 @@ Test Summary: ${this.stats.passed} passed, ${this.stats.failed} failed, ${this.s
|
|
|
4807
4824
|
};
|
|
4808
4825
|
|
|
4809
4826
|
// src/utils/registry/index.ts
|
|
4827
|
+
var import_execa5 = __toESM(require_execa(), 1);
|
|
4810
4828
|
import { logger as logger21 } from "@elizaos/core";
|
|
4811
4829
|
import dotenv3 from "dotenv";
|
|
4812
|
-
import { execa as execa9 } from "execa";
|
|
4813
4830
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
4814
4831
|
import { existsSync as existsSync16, promises as fs10 } from "fs";
|
|
4815
4832
|
import path19 from "path";
|
|
@@ -5102,7 +5119,7 @@ async function getPluginRepository(pluginName) {
|
|
|
5102
5119
|
}
|
|
5103
5120
|
async function repoHasBranch(repoUrl, branchName) {
|
|
5104
5121
|
try {
|
|
5105
|
-
const { stdout } = await
|
|
5122
|
+
const { stdout } = await (0, import_execa5.execa)("git", ["ls-remote", "--heads", repoUrl, branchName]);
|
|
5106
5123
|
return stdout.includes(branchName);
|
|
5107
5124
|
} catch (error) {
|
|
5108
5125
|
logger21.warn(
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
setAgentConfig,
|
|
10
10
|
startAgent,
|
|
11
11
|
stopAgent
|
|
12
|
-
} from "../../../chunk-
|
|
13
|
-
import "../../../chunk-
|
|
12
|
+
} from "../../../chunk-YKFBLIQD.js";
|
|
13
|
+
import "../../../chunk-GRPGGUED.js";
|
|
14
14
|
import "../../../chunk-F24MS2YR.js";
|
|
15
|
-
import "../../../chunk-
|
|
15
|
+
import "../../../chunk-XB5JBFO6.js";
|
|
16
16
|
export {
|
|
17
17
|
clearAgentMemories,
|
|
18
18
|
getAgent,
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
agent,
|
|
7
7
|
getAgents,
|
|
8
8
|
resolveAgentId
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-YKFBLIQD.js";
|
|
10
|
+
import "../../chunk-GRPGGUED.js";
|
|
11
11
|
import {
|
|
12
12
|
getAgentRuntimeUrl,
|
|
13
13
|
getAgentsBaseUrl
|
|
14
14
|
} from "../../chunk-F24MS2YR.js";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-XB5JBFO6.js";
|
|
16
16
|
export {
|
|
17
17
|
agent,
|
|
18
18
|
getAgentRuntimeUrl,
|
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
createPlugin,
|
|
8
8
|
createProject,
|
|
9
9
|
createTEEProject
|
|
10
|
-
} from "../../../chunk-
|
|
10
|
+
} from "../../../chunk-5RHJRZKW.js";
|
|
11
11
|
import {
|
|
12
12
|
createProjectDirectories,
|
|
13
13
|
setupAIModelConfig,
|
|
14
14
|
setupEmbeddingModelConfig,
|
|
15
15
|
setupProjectEnvironment
|
|
16
|
-
} from "../../../chunk-
|
|
17
|
-
import "../../../chunk-
|
|
18
|
-
import "../../../chunk-
|
|
16
|
+
} from "../../../chunk-PMV25BM7.js";
|
|
17
|
+
import "../../../chunk-YKFBLIQD.js";
|
|
18
|
+
import "../../../chunk-GRPGGUED.js";
|
|
19
19
|
import "../../../chunk-F24MS2YR.js";
|
|
20
|
-
import "../../../chunk-
|
|
20
|
+
import "../../../chunk-XB5JBFO6.js";
|
|
21
21
|
export {
|
|
22
22
|
createAgent,
|
|
23
23
|
createPlugin,
|
|
@@ -4,13 +4,13 @@ const require = createRequire(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
create
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-J5E77VTL.js";
|
|
8
|
+
import "../../chunk-5RHJRZKW.js";
|
|
9
|
+
import "../../chunk-PMV25BM7.js";
|
|
10
|
+
import "../../chunk-YKFBLIQD.js";
|
|
11
|
+
import "../../chunk-GRPGGUED.js";
|
|
12
12
|
import "../../chunk-F24MS2YR.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-XB5JBFO6.js";
|
|
14
14
|
export {
|
|
15
15
|
create
|
|
16
16
|
};
|