@elizaos/cli 1.2.4 → 1.2.7

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.
Files changed (82) hide show
  1. package/dist/bun-exec-KJOLGZOL.js +21 -0
  2. package/dist/{chunk-2XI6N7KN.js → chunk-2ZF5OAMV.js} +322 -69
  3. package/dist/chunk-3YTIOEFK.js +202 -0
  4. package/dist/chunk-AQ6OMR2A.js +14 -0
  5. package/dist/{chunk-JZG5QBNT.js → chunk-E54G6FI7.js} +32 -6
  6. package/dist/{chunk-PSSTO76B.js → chunk-KKAK7OQA.js} +100 -104
  7. package/dist/chunk-Y5IA2UZ2.js +154 -0
  8. package/dist/commands/agent/actions/index.js +4 -3
  9. package/dist/commands/agent/index.js +4 -3
  10. package/dist/commands/create/actions/index.d.ts +6 -2
  11. package/dist/commands/create/actions/index.js +8 -7
  12. package/dist/commands/create/index.js +6 -6
  13. package/dist/commands/shared/index.js +1 -1
  14. package/dist/index.js +323 -258
  15. package/dist/{plugin-creator-5CER524N.js → plugin-creator-Y2NWASXI.js} +16 -15
  16. package/dist/{registry-SN5V2VXR.js → registry-K2OCCRXO.js} +4 -3
  17. package/dist/templates/plugin-quick-starter/README.md +214 -0
  18. package/dist/templates/plugin-quick-starter/bunfig.toml +10 -0
  19. package/dist/templates/plugin-quick-starter/package.json +76 -0
  20. package/dist/templates/plugin-quick-starter/scripts/install-test-deps.js +53 -0
  21. package/dist/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +209 -0
  22. package/dist/templates/plugin-quick-starter/src/__tests__/test-utils.ts +162 -0
  23. package/dist/templates/plugin-quick-starter/src/index.ts +4 -0
  24. package/dist/templates/plugin-quick-starter/src/plugin.ts +272 -0
  25. package/dist/templates/plugin-quick-starter/tsconfig.build.json +11 -0
  26. package/dist/templates/plugin-quick-starter/tsconfig.json +28 -0
  27. package/dist/templates/plugin-quick-starter/tsup.config.ts +20 -0
  28. package/dist/templates/plugin-starter/package.json +2 -2
  29. package/dist/templates/plugin-starter/scripts/install-test-deps.js +7 -3
  30. package/dist/templates/plugin-starter/src/__tests__/build-order.test.ts +51 -0
  31. package/dist/templates/plugin-starter/src/__tests__/vite-config-utils.ts +33 -0
  32. package/dist/templates/plugin-starter/src/plugin.ts +13 -15
  33. package/dist/templates/plugin-starter/tsup.config.ts +1 -1
  34. package/dist/templates/plugin-starter/vite.config.ts +1 -1
  35. package/dist/templates/project-starter/package.json +4 -4
  36. package/dist/templates/project-starter/scripts/install-test-deps.js +7 -3
  37. package/dist/templates/project-starter/src/__tests__/build-order.test.ts +59 -0
  38. package/dist/templates/project-starter/src/__tests__/character-plugin-ordering.test.ts +11 -110
  39. package/dist/templates/project-starter/src/__tests__/vite-config-utils.ts +33 -0
  40. package/dist/templates/project-starter/src/character.ts +14 -17
  41. package/dist/templates/project-starter/tsup.config.ts +1 -1
  42. package/dist/templates/project-tee-starter/package.json +3 -3
  43. package/dist/templates/project-tee-starter/src/character.ts +3 -0
  44. package/dist/{utils-DTW3XU6O.js → utils-QSRUVLAT.js} +4 -3
  45. package/package.json +6 -6
  46. package/templates/plugin-quick-starter/README.md +214 -0
  47. package/templates/plugin-quick-starter/bunfig.toml +10 -0
  48. package/templates/plugin-quick-starter/package.json +76 -0
  49. package/templates/plugin-quick-starter/scripts/install-test-deps.js +53 -0
  50. package/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +209 -0
  51. package/templates/plugin-quick-starter/src/__tests__/test-utils.ts +162 -0
  52. package/templates/plugin-quick-starter/src/index.ts +4 -0
  53. package/templates/plugin-quick-starter/src/plugin.ts +272 -0
  54. package/templates/plugin-quick-starter/tsconfig.build.json +11 -0
  55. package/templates/plugin-quick-starter/tsconfig.json +28 -0
  56. package/templates/plugin-quick-starter/tsup.config.ts +20 -0
  57. package/templates/plugin-starter/package.json +2 -2
  58. package/templates/plugin-starter/scripts/install-test-deps.js +7 -3
  59. package/templates/plugin-starter/src/__tests__/build-order.test.ts +51 -0
  60. package/templates/plugin-starter/src/__tests__/vite-config-utils.ts +33 -0
  61. package/templates/plugin-starter/src/plugin.ts +13 -15
  62. package/templates/plugin-starter/tsup.config.ts +1 -1
  63. package/templates/plugin-starter/vite.config.ts +1 -1
  64. package/templates/project-starter/package.json +4 -4
  65. package/templates/project-starter/scripts/install-test-deps.js +7 -3
  66. package/templates/project-starter/src/__tests__/build-order.test.ts +59 -0
  67. package/templates/project-starter/src/__tests__/character-plugin-ordering.test.ts +11 -110
  68. package/templates/project-starter/src/__tests__/vite-config-utils.ts +33 -0
  69. package/templates/project-starter/src/character.ts +14 -17
  70. package/templates/project-starter/tsup.config.ts +1 -1
  71. package/templates/project-tee-starter/package.json +3 -3
  72. package/templates/project-tee-starter/src/character.ts +3 -0
  73. package/dist/chunk-5DYKNYEY.js +0 -2262
  74. package/dist/chunk-XB5JBFO6.js +0 -41
  75. package/dist/chunk-ZWDXDKSA.js +0 -281
  76. package/dist/setup-UQOWDHFN.js +0 -20
  77. package/dist/templates/plugin-starter/dist/index.js +0 -391
  78. package/dist/templates/plugin-starter/dist/index.js.map +0 -1
  79. package/templates/plugin-starter/dist/.vite/manifest.json +0 -11
  80. package/templates/plugin-starter/dist/index.d.ts +0 -14
  81. package/templates/plugin-starter/dist/index.js +0 -391
  82. package/templates/plugin-starter/dist/index.js.map +0 -1
@@ -3,23 +3,23 @@ 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,
10
6
  displayBunInstallationTipCompact,
11
7
  emoji,
12
- require_execa,
13
8
  runBunCommand
14
- } from "./chunk-5DYKNYEY.js";
9
+ } from "./chunk-Y5IA2UZ2.js";
15
10
  import {
16
11
  getAgentRuntimeUrl,
17
12
  getAgentsBaseUrl
18
13
  } from "./chunk-F24MS2YR.js";
19
14
  import {
20
- __require,
21
- __toESM
22
- } from "./chunk-XB5JBFO6.js";
15
+ bunExec,
16
+ bunExecInherit,
17
+ bunExecSimple,
18
+ commandExists
19
+ } from "./chunk-3YTIOEFK.js";
20
+ import {
21
+ __require
22
+ } from "./chunk-AQ6OMR2A.js";
23
23
 
24
24
  // src/utils/build-project.ts
25
25
  import * as fs3 from "fs";
@@ -37,7 +37,6 @@ import * as semver from "semver";
37
37
  import { fileURLToPath } from "url";
38
38
  import { logger as logger2 } from "@elizaos/core";
39
39
  import { existsSync as existsSync2, statSync, readFileSync } from "fs";
40
- import { execSync } from "child_process";
41
40
 
42
41
  // src/utils/resolve-utils.ts
43
42
  import dotenv from "dotenv";
@@ -230,67 +229,82 @@ var UserEnvironment = class _UserEnvironment {
230
229
  async getPackageManagerInfo() {
231
230
  logger2.debug("[UserEnvironment] Using bun as the package manager for ElizaOS CLI");
232
231
  const isNpx = process.env.npm_execpath?.includes("npx");
233
- const isBunx = process.argv[0]?.includes("bun");
232
+ const scriptPath = process.argv[1] || "";
233
+ const isBunx = scriptPath.includes(".bun/install/cache/") || scriptPath.includes("bunx") || process.env.BUN_INSTALL_CACHE_DIR !== void 0;
234
234
  let version = null;
235
- try {
236
- const { stdout } = await bunExecSimple("bun", ["--version"]);
237
- version = stdout.trim();
238
- logger2.debug(`[UserEnvironment] Bun version: ${version}`);
239
- } catch (e) {
240
- logger2.debug(
241
- `[UserEnvironment] Could not get bun version: ${e instanceof Error ? e.message : String(e)}`
242
- );
243
- if (shouldAutoInstall()) {
244
- logger2.info(`${emoji.info("Attempting to automatically install Bun...")}`);
245
- const installSuccess = await autoInstallBun();
246
- if (installSuccess) {
247
- try {
248
- const { stdout } = await bunExecSimple("bun", ["--version"]);
249
- version = stdout.trim();
250
- logger2.debug(`[UserEnvironment] Bun version after auto-install: ${version}`);
251
- } catch (retryError) {
252
- logger2.error(
253
- `Failed to verify Bun installation after auto-install: ${retryError instanceof Error ? retryError.message : String(retryError)}`
254
- );
235
+ if (typeof Bun !== "undefined" && Bun.version) {
236
+ version = Bun.version;
237
+ logger2.debug(`[UserEnvironment] Running under Bun runtime, version: ${version}`);
238
+ } else {
239
+ try {
240
+ const { stdout } = await bunExecSimple("bun", ["--version"]);
241
+ version = stdout.trim();
242
+ logger2.debug(`[UserEnvironment] Bun version: ${version}`);
243
+ } catch (e) {
244
+ logger2.debug(
245
+ `[UserEnvironment] Could not get bun version: ${e instanceof Error ? e.message : String(e)}`
246
+ );
247
+ if (shouldAutoInstall()) {
248
+ logger2.info(`${emoji.info("Attempting to automatically install Bun...")}`);
249
+ const installSuccess = await autoInstallBun();
250
+ if (installSuccess) {
251
+ try {
252
+ const { stdout } = await bunExecSimple("bun", ["--version"]);
253
+ version = stdout.trim();
254
+ logger2.debug(`[UserEnvironment] Bun version after auto-install: ${version}`);
255
+ } catch (retryError) {
256
+ logger2.error(
257
+ `Failed to verify Bun installation after auto-install: ${retryError instanceof Error ? retryError.message : String(retryError)}`
258
+ );
259
+ }
255
260
  }
256
261
  }
257
- }
258
- if (!version) {
259
- const platform = process.platform;
260
- logger2.error(
261
- `${emoji.error("Bun is required for ElizaOS CLI but is not installed or not found in PATH.")}`
262
- );
263
- logger2.error("");
264
- logger2.error(
265
- `${emoji.rocket("Install Bun using the appropriate command for your system:")}`
266
- );
267
- logger2.error("");
268
- if (platform === "win32") {
269
- logger2.error(' Windows: powershell -c "irm bun.sh/install.ps1 | iex"');
270
- } else {
271
- logger2.error(" Linux/macOS: curl -fsSL https://bun.sh/install | bash");
272
- if (platform === "darwin") {
273
- logger2.error(" macOS (Homebrew): brew install bun");
262
+ if (!version) {
263
+ const platform = process.platform;
264
+ logger2.error(
265
+ `${emoji.error("Bun is required for ElizaOS CLI but is not installed or not found in PATH.")}`
266
+ );
267
+ logger2.error("");
268
+ logger2.error(
269
+ `${emoji.rocket("Install Bun using the appropriate command for your system:")}`
270
+ );
271
+ logger2.error("");
272
+ if (platform === "win32") {
273
+ logger2.error(' Windows: powershell -c "irm bun.sh/install.ps1 | iex"');
274
+ } else {
275
+ logger2.error(" Linux/macOS: curl -fsSL https://bun.sh/install | bash");
276
+ if (platform === "darwin") {
277
+ logger2.error(" macOS (Homebrew): brew install bun");
278
+ }
274
279
  }
280
+ logger2.error("");
281
+ logger2.error(" More options: https://bun.sh/docs/installation");
282
+ logger2.error(" After installation, restart your terminal or source your shell profile");
283
+ logger2.error("");
284
+ logger2.error("\u{1F534} Exiting: Bun installation is required to continue.");
285
+ process.exit(1);
275
286
  }
276
- logger2.error("");
277
- logger2.error(" More options: https://bun.sh/docs/installation");
278
- logger2.error(" After installation, restart your terminal or source your shell profile");
279
- logger2.error("");
280
- logger2.error("\u{1F534} Exiting: Bun installation is required to continue.");
281
- process.exit(1);
282
287
  }
283
288
  }
284
289
  const packageName = "@elizaos/cli";
285
290
  let isGlobalCheck = false;
291
+ const cliPath = process.argv[1] || "";
292
+ const isInGlobalPath = cliPath.includes("/.bun/install/global/") || cliPath.includes("/npm/global/") || process.platform === "win32" && cliPath.includes("\\npm\\");
286
293
  try {
287
294
  if (!isNpx && !isBunx) {
288
- const command = process.platform === "win32" ? `bun pm ls -g | findstr "${packageName}"` : `bun pm ls -g | grep -q "${packageName}"`;
289
- execSync(command, { stdio: "ignore" });
290
- isGlobalCheck = true;
295
+ if (isInGlobalPath) {
296
+ isGlobalCheck = true;
297
+ } else {
298
+ const args = process.platform === "win32" ? ["cmd", "/c", `bun pm ls -g | findstr "${packageName}"`] : ["sh", "-c", `bun pm ls -g | grep -q "${packageName}"`];
299
+ const proc = Bun.spawnSync(args, {
300
+ stdout: "ignore",
301
+ stderr: "ignore"
302
+ });
303
+ isGlobalCheck = proc.exitCode === 0;
304
+ }
291
305
  }
292
306
  } catch (error) {
293
- isGlobalCheck = false;
307
+ isGlobalCheck = isInGlobalPath;
294
308
  }
295
309
  const isGlobal = isGlobalCheck || process.env.NODE_ENV === "global";
296
310
  return {
@@ -811,11 +825,10 @@ async function buildProject(cwd = process.cwd(), isPlugin = false) {
811
825
  }
812
826
 
813
827
  // src/utils/cli-bun-migration.ts
814
- var import_execa = __toESM(require_execa(), 1);
815
828
  import { logger as logger4 } from "@elizaos/core";
816
829
  async function isBunAvailable() {
817
830
  try {
818
- await (0, import_execa.execa)("bun", ["--version"], { stdio: "ignore" });
831
+ await bunExec("bun", ["--version"], { stdio: "ignore" });
819
832
  return true;
820
833
  } catch (error) {
821
834
  return false;
@@ -823,13 +836,11 @@ async function isBunAvailable() {
823
836
  }
824
837
  async function isCliInstalledViaNpm() {
825
838
  try {
826
- const { stdout } = await (0, import_execa.execa)("npm", ["list", "-g", "@elizaos/cli", "--depth=0"], {
827
- stdio: "pipe"
828
- });
839
+ const { stdout } = await bunExecSimple("npm", ["list", "-g", "@elizaos/cli", "--depth=0"]);
829
840
  return stdout.includes("@elizaos/cli");
830
841
  } catch (error) {
831
842
  try {
832
- const { stdout: whichOutput } = await (0, import_execa.execa)("which", ["elizaos"], { stdio: "pipe" });
843
+ const { stdout: whichOutput } = await bunExecSimple("which", ["elizaos"]);
833
844
  return whichOutput.includes("node_modules") || whichOutput.includes(".nvm");
834
845
  } catch {
835
846
  return false;
@@ -838,15 +849,15 @@ async function isCliInstalledViaNpm() {
838
849
  }
839
850
  async function removeNpmInstallation() {
840
851
  logger4.info("Removing npm installation of @elizaos/cli...");
841
- await (0, import_execa.execa)("npm", ["uninstall", "-g", "@elizaos/cli"], { stdio: "inherit" });
852
+ await bunExecInherit("npm", ["uninstall", "-g", "@elizaos/cli"]);
842
853
  }
843
854
  async function installCliWithBun(version) {
844
855
  logger4.info("Installing CLI with bun...");
845
- await (0, import_execa.execa)("bun", ["add", "-g", `@elizaos/cli@${version}`], { stdio: "inherit" });
856
+ await bunExecInherit("bun", ["add", "-g", `@elizaos/cli@${version}`]);
846
857
  }
847
858
  async function verifyCliInstallation(expectedVersion) {
848
859
  try {
849
- const { stdout } = await (0, import_execa.execa)("elizaos", ["-v"], { stdio: "pipe" });
860
+ const { stdout } = await bunExecSimple("elizaos", ["-v"]);
850
861
  const output = stdout.trim();
851
862
  const versionMatch = output.match(/(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?)/);
852
863
  if (!versionMatch) {
@@ -881,7 +892,7 @@ async function migrateCliToBun(targetVersion) {
881
892
  logger4.error("Your original npm installation is still intact.");
882
893
  try {
883
894
  logger4.info("Cleaning up failed bun installation...");
884
- await (0, import_execa.execa)("bun", ["remove", "-g", "@elizaos/cli"], { stdio: "ignore" });
895
+ await bunExec("bun", ["remove", "-g", "@elizaos/cli"], { stdio: "ignore" });
885
896
  } catch {
886
897
  }
887
898
  throw error;
@@ -1056,6 +1067,8 @@ function getPackageName(templateType) {
1056
1067
  return "project-tee-starter";
1057
1068
  case "plugin":
1058
1069
  return "plugin-starter";
1070
+ case "plugin-quick":
1071
+ return "plugin-quick-starter";
1059
1072
  case "project":
1060
1073
  case "project-starter":
1061
1074
  default:
@@ -1100,7 +1113,7 @@ ${possibleTemplatePaths.join("\n")}`
1100
1113
  }
1101
1114
  logger7.debug(`Copying ${templateType} template from ${templateDir} to ${targetDir}`);
1102
1115
  await copyDir(templateDir, targetDir);
1103
- if (templateType === "plugin") {
1116
+ if (templateType === "plugin" || templateType === "plugin-quick") {
1104
1117
  const pluginNameFromPath = path6.basename(targetDir);
1105
1118
  await replacePluginNameInFiles(targetDir, pluginNameFromPath);
1106
1119
  }
@@ -1154,6 +1167,8 @@ ${possibleTemplatePaths.join("\n")}`
1154
1167
  async function replacePluginNameInFiles(targetDir, pluginName) {
1155
1168
  const filesToProcess = [
1156
1169
  "src/index.ts",
1170
+ "src/plugin.ts",
1171
+ "src/__tests__/plugin.test.ts",
1157
1172
  "__tests__/plugin.test.ts",
1158
1173
  "e2e/starter-plugin.test.ts",
1159
1174
  "README.md"
@@ -1165,6 +1180,7 @@ async function replacePluginNameInFiles(targetDir, pluginName) {
1165
1180
  if (await fs5.access(fullPath).then(() => true).catch(() => false)) {
1166
1181
  let content = await fs5.readFile(fullPath, "utf8");
1167
1182
  content = content.replace(/plugin-starter/g, pluginName);
1183
+ content = content.replace(/plugin-quick-starter/g, pluginName);
1168
1184
  await fs5.writeFile(fullPath, content, "utf8");
1169
1185
  logger7.debug(`Updated plugin name in ${filePath}`);
1170
1186
  }
@@ -1653,7 +1669,7 @@ var SAMPLE_ENV_TEMPLATE = `### elizaOS Environment Variables ###
1653
1669
  # Please read the comments for each of the configurations
1654
1670
 
1655
1671
  ## The only thing you ABSOLUTELY NEED to get up and running is one of the model provider keys,
1656
- ## i.e. OPENAI_API_KEY or ANTHROPIC_API_KEY, or setup the local-ai or ollama plugin
1672
+ ## i.e. OPENAI_API_KEY or ANTHROPIC_API_KEY, or setup the ollama plugin
1657
1673
  ## Everything else is optional, and most settings and secrets can be configured in your agent or through the GUI
1658
1674
  ## For multi-agent, each agent will need keys for the various services it is connected to
1659
1675
  -------------------------------
@@ -1665,7 +1681,7 @@ var SAMPLE_ENV_TEMPLATE = `### elizaOS Environment Variables ###
1665
1681
  ## and you can use them by overriding the base URL
1666
1682
 
1667
1683
  ## NOTE: You will need a provider that provides embeddings. So even if you use Claude, you will
1668
- ## need to get embeddings using another provider, for example openai or our local-ai plugin
1684
+ ## need to get embeddings using another provider, for example openai or ollama
1669
1685
 
1670
1686
  # OpenAI Configuration
1671
1687
  OPENAI_API_KEY=
@@ -1700,16 +1716,6 @@ ANTHROPIC_API_KEY=
1700
1716
  # OLLAMA_LARGE_MODEL=gemma3:latest
1701
1717
 
1702
1718
 
1703
- # Local AI Configuration
1704
- ## REMEMBER A GOOD AMOUNT OF VRAM IS NEEDED FOR THE LARGE LOCAL MODELS
1705
- --------------------------------
1706
- # LOCAL_SMALL_MODEL=DeepHermes-3-Llama-3-3B-Preview-q4.gguf
1707
- # LOCAL_LARGE_MODEL=DeepHermes-3-Llama-3-70B-Preview-q4.gguf
1708
- # LOCAL_EMBEDDING_MODEL=bge-small-en-v1.5.Q4_K_M.gguf
1709
-
1710
-
1711
-
1712
-
1713
1719
  # Highly recommended to use nomic-embed-text for embeddings
1714
1720
  # OLLAMA_EMBEDDING_MODEL=nomic-embed-text
1715
1721
 
@@ -2080,15 +2086,13 @@ async function storeOllamaConfig(config, envFilePath) {
2080
2086
  content = await fs7.readFile(envFilePath, "utf8");
2081
2087
  }
2082
2088
  const lines = content.split("\n").filter(
2083
- (line) => !line.startsWith("OLLAMA_API_ENDPOINT=") && !line.startsWith("OLLAMA_MODEL=") && !line.startsWith("USE_OLLAMA_TEXT_MODELS=")
2089
+ (line) => !line.startsWith("OLLAMA_API_ENDPOINT=") && !line.startsWith("OLLAMA_MODEL=")
2084
2090
  );
2085
2091
  lines.push(`OLLAMA_API_ENDPOINT=${config.endpoint}`);
2086
2092
  lines.push(`OLLAMA_MODEL=${config.model}`);
2087
- lines.push("USE_OLLAMA_TEXT_MODELS=true");
2088
2093
  await fs7.writeFile(envFilePath, lines.join("\n"), "utf8");
2089
2094
  process.env.OLLAMA_API_ENDPOINT = config.endpoint;
2090
2095
  process.env.OLLAMA_MODEL = config.model;
2091
- process.env.USE_OLLAMA_TEXT_MODELS = "true";
2092
2096
  logger9.success("Ollama configuration saved to configuration");
2093
2097
  } catch (error) {
2094
2098
  logger9.error("Error saving Ollama configuration:", error);
@@ -2133,9 +2137,7 @@ async function promptAndStoreOllamaEmbeddingConfig(envFilePath) {
2133
2137
  if (existsSync8(envPath)) {
2134
2138
  content = await fs7.readFile(envPath, "utf8");
2135
2139
  }
2136
- const lines = content.split("\n").filter(
2137
- (line) => !line.startsWith("OLLAMA_EMBEDDING_MODEL=") && !line.startsWith("USE_OLLAMA_EMBEDDINGS=")
2138
- );
2140
+ const lines = content.split("\n").filter((line) => !line.startsWith("OLLAMA_EMBEDDING_MODEL="));
2139
2141
  const endpointPattern = /^OLLAMA_API_ENDPOINT=(.*)$/m;
2140
2142
  const existingEndpointMatch = content.match(endpointPattern);
2141
2143
  if (existingEndpointMatch) {
@@ -2153,11 +2155,9 @@ async function promptAndStoreOllamaEmbeddingConfig(envFilePath) {
2153
2155
  lines.push(`OLLAMA_API_ENDPOINT=${results.endpoint}`);
2154
2156
  }
2155
2157
  lines.push(`OLLAMA_EMBEDDING_MODEL=${results.embeddingModel}`);
2156
- lines.push("USE_OLLAMA_EMBEDDINGS=true");
2157
2158
  await fs7.writeFile(envPath, lines.join("\n"), "utf8");
2158
2159
  process.env.OLLAMA_API_ENDPOINT = results.endpoint;
2159
2160
  process.env.OLLAMA_EMBEDDING_MODEL = results.embeddingModel;
2160
- process.env.USE_OLLAMA_EMBEDDINGS = "true";
2161
2161
  logger9.success("Ollama embedding configuration saved");
2162
2162
  } catch (error) {
2163
2163
  logger9.error("Error saving Ollama embedding configuration:", error);
@@ -2765,7 +2765,7 @@ async function getGitHubCredentials() {
2765
2765
  }
2766
2766
  logger10.warn("Invalid GitHub token found in environment variables");
2767
2767
  }
2768
- const { getGitHubToken: getGitHubToken2 } = await import("./registry-SN5V2VXR.js");
2768
+ const { getGitHubToken: getGitHubToken2 } = await import("./registry-K2OCCRXO.js");
2769
2769
  const token = await getGitHubToken2() || void 0;
2770
2770
  if (token) {
2771
2771
  const isValid2 = await validateGitHubToken(token);
@@ -3446,9 +3446,7 @@ async function stopAgent(opts) {
3446
3446
  process.exit(1);
3447
3447
  }
3448
3448
  try {
3449
- const { exec } = await import("child_process");
3450
- const { promisify } = await import("util");
3451
- const execAsync = promisify(exec);
3449
+ const { bunExec: bunExec2 } = await import("./bun-exec-KJOLGZOL.js");
3452
3450
  const patterns = [
3453
3451
  "(node|bun).*elizaos",
3454
3452
  "(node|bun).*eliza.*start",
@@ -3456,10 +3454,10 @@ async function stopAgent(opts) {
3456
3454
  ];
3457
3455
  for (const pattern of patterns) {
3458
3456
  try {
3459
- const { stdout } = await execAsync(`pgrep -f "${pattern}"`);
3460
- const pids = stdout.trim().split("\n").filter((pid) => pid && pid !== process.pid.toString());
3457
+ const result = await bunExec2("sh", ["-c", `pgrep -f "${pattern}"`]);
3458
+ const pids = result.stdout.trim().split("\n").filter((pid) => pid && pid !== process.pid.toString());
3461
3459
  if (pids.length > 0) {
3462
- await execAsync(`echo "${pids.join(" ")}" | xargs -r kill`);
3460
+ await bunExec2("sh", ["-c", `echo "${pids.join(" ")}" | xargs -r kill`]);
3463
3461
  }
3464
3462
  } catch (pgrepError) {
3465
3463
  }
@@ -4205,16 +4203,15 @@ async function findNextAvailablePort(startPort) {
4205
4203
  }
4206
4204
 
4207
4205
  // src/utils/publisher.ts
4208
- var import_execa2 = __toESM(require_execa(), 1);
4209
4206
  import { logger as logger19 } from "@elizaos/core";
4210
4207
  async function testPublishToNpm(cwd) {
4211
4208
  try {
4212
- await (0, import_execa2.execa)("npm", ["whoami"]);
4209
+ await bunExec("npm", ["whoami"]);
4213
4210
  logger19.info("[\u2713] Logged in to npm");
4214
4211
  logger19.info("Testing build...");
4215
- await (0, import_execa2.execa)("npm", ["run", "build", "--dry-run"], { cwd });
4212
+ await bunExec("npm", ["run", "build", "--dry-run"], { cwd });
4216
4213
  logger19.info("[\u2713] Build test successful");
4217
- await (0, import_execa2.execa)("npm", ["access", "ls-packages"], { cwd });
4214
+ await bunExec("npm", ["access", "ls-packages"], { cwd });
4218
4215
  logger19.info("[\u2713] Have publish permissions");
4219
4216
  return true;
4220
4217
  } catch (error) {
@@ -4309,11 +4306,11 @@ async function testPublishToGitHub(packageJson, username) {
4309
4306
  }
4310
4307
  async function publishToNpm(cwd) {
4311
4308
  try {
4312
- await (0, import_execa2.execa)("npm", ["whoami"]);
4309
+ await bunExec("npm", ["whoami"]);
4313
4310
  logger19.info("Building package...");
4314
- await (0, import_execa2.execa)("npm", ["run", "build"], { cwd, stdio: "inherit" });
4311
+ await bunExecInherit("npm", ["run", "build"], { cwd });
4315
4312
  logger19.info("Publishing to npm...");
4316
- await (0, import_execa2.execa)("npm", ["publish"], { cwd, stdio: "inherit" });
4313
+ await bunExecInherit("npm", ["publish"], { cwd });
4317
4314
  return true;
4318
4315
  } catch (error) {
4319
4316
  logger19.error("Failed to publish to npm:", error);
@@ -4947,7 +4944,6 @@ var DEFAULT_REGISTRY = {
4947
4944
  "@elizaos/plugin-evm": "github:elizaos-plugins/plugin-evm",
4948
4945
  "@elizaos/plugin-farcaster": "github:elizaos-plugins/plugin-farcaster",
4949
4946
  "@elizaos/plugin-groq": "github:elizaos-plugins/plugin-groq",
4950
- "@elizaos/plugin-local-ai": "github:elizaos-plugins/plugin-local-ai",
4951
4947
  "@elizaos/plugin-mcp": "github:elizaos-plugins/plugin-mcp",
4952
4948
  "@elizaos/plugin-messari-ai-toolkit": "github:messari/plugin-messari-ai-toolkit",
4953
4949
  "@elizaos/plugin-morpheus": "github:bowtiedbluefin/plugin-morpheus",
@@ -0,0 +1,154 @@
1
+
2
+ import { createRequire } from 'module';
3
+ const require = createRequire(import.meta.url);
4
+
5
+ import {
6
+ bunExec,
7
+ bunExecInherit
8
+ } from "./chunk-3YTIOEFK.js";
9
+
10
+ // src/utils/emoji-handler.ts
11
+ import { logger } from "@elizaos/core";
12
+ var config = {
13
+ enabled: true,
14
+ forceDisable: false
15
+ };
16
+ var EMOJIS = {
17
+ // Status indicators
18
+ success: { emoji: "\u2705", fallback: "[OK]" },
19
+ error: { emoji: "\u274C", fallback: "[ERROR]" },
20
+ warning: { emoji: "\u26A0\uFE0F", fallback: "[WARNING]" },
21
+ info: { emoji: "\u2139\uFE0F", fallback: "[INFO]" },
22
+ // Actions
23
+ rocket: { emoji: "\u{1F680}", fallback: ">>" },
24
+ sparkles: { emoji: "\u2728", fallback: "*" },
25
+ party: { emoji: "\u{1F389}", fallback: "[DONE]" },
26
+ // Objects/Tools
27
+ package: { emoji: "\u{1F4E6}", fallback: "[PKG]" },
28
+ link: { emoji: "\u{1F517}", fallback: "[LINK]" },
29
+ lightbulb: { emoji: "\u{1F4A1}", fallback: "[TIP]" },
30
+ clipboard: { emoji: "\u{1F4CB}", fallback: "[LIST]" },
31
+ // Platforms
32
+ penguin: { emoji: "\u{1F427}", fallback: "[LINUX]" },
33
+ globe: { emoji: "\u{1F310}", fallback: "[WEB]" },
34
+ // Arrows and pointers
35
+ rightArrow: { emoji: "\u2192", fallback: "->" },
36
+ bullet: { emoji: "\u2022", fallback: "*" }
37
+ };
38
+ function detectEmojiSupport() {
39
+ if (config.forceDisable) {
40
+ return false;
41
+ }
42
+ const term = process.env.TERM || "";
43
+ const termProgram = process.env.TERM_PROGRAM || "";
44
+ const colorTerm = process.env.COLORTERM;
45
+ const ciEnv = process.env.CI;
46
+ if (ciEnv === "true" || process.env.GITHUB_ACTIONS) {
47
+ return false;
48
+ }
49
+ if (process.platform === "win32") {
50
+ if (termProgram === "vscode" || process.env.WT_SESSION || process.env.WT_PROFILE_ID || termProgram === "Windows Terminal") {
51
+ return true;
52
+ }
53
+ if (process.env.PSModulePath && process.env.POWERSHELL_TELEMETRY_OPTOUT !== void 0) {
54
+ return true;
55
+ }
56
+ return false;
57
+ }
58
+ if (process.platform === "darwin" || process.platform === "linux") {
59
+ if (termProgram === "vscode" || termProgram === "iTerm.app" || termProgram === "Apple_Terminal" || term.includes("xterm") || term.includes("screen") || colorTerm) {
60
+ return true;
61
+ }
62
+ }
63
+ if (term.includes("256color") || term.includes("truecolor")) {
64
+ return true;
65
+ }
66
+ return false;
67
+ }
68
+ function getEmoji(key) {
69
+ const emojiDef = EMOJIS[key];
70
+ if (!emojiDef) {
71
+ logger.warn(`Unknown emoji key: ${key}`);
72
+ return "";
73
+ }
74
+ return config.enabled && detectEmojiSupport() ? emojiDef.emoji : emojiDef.fallback;
75
+ }
76
+ function configureEmojis(newConfig) {
77
+ config = { ...config, ...newConfig };
78
+ }
79
+ function withEmoji(key, message, spacing = true) {
80
+ const emoji2 = getEmoji(key);
81
+ const space = spacing && emoji2 ? " " : "";
82
+ return `${emoji2}${space}${message}`;
83
+ }
84
+ var emoji = {
85
+ success: (msg) => withEmoji("success", msg),
86
+ error: (msg) => withEmoji("error", msg),
87
+ warning: (msg) => withEmoji("warning", msg),
88
+ info: (msg) => withEmoji("info", msg),
89
+ rocket: (msg) => withEmoji("rocket", msg),
90
+ package: (msg) => withEmoji("package", msg),
91
+ link: (msg) => withEmoji("link", msg),
92
+ tip: (msg) => withEmoji("lightbulb", msg),
93
+ list: (msg) => withEmoji("clipboard", msg),
94
+ penguin: (msg) => withEmoji("penguin", msg),
95
+ bullet: (msg) => withEmoji("bullet", msg)
96
+ };
97
+ function initializeEmojiSupport() {
98
+ const supported = detectEmojiSupport();
99
+ if (process.env.DEBUG || process.env.ELIZA_DEBUG) {
100
+ logger.debug(
101
+ `Emoji support: ${supported ? "enabled" : "disabled"} (platform: ${process.platform}, term: ${process.env.TERM || "unknown"})`
102
+ );
103
+ }
104
+ }
105
+ initializeEmojiSupport();
106
+
107
+ // src/utils/bun-installation-helper.ts
108
+ import { logger as logger2 } from "@elizaos/core";
109
+ function displayBunInstallationTipCompact() {
110
+ return "Please install Bun from https://bun.sh";
111
+ }
112
+
113
+ // src/utils/run-bun.ts
114
+ async function runBunCommand(args, cwd, silent = false) {
115
+ const finalArgs = [...args];
116
+ const isInstallCommand = args[0] === "install";
117
+ const isCI = process.env.CI || process.env.ELIZA_TEST_MODE === "true";
118
+ if (isCI && isInstallCommand) {
119
+ if (!finalArgs.includes("--frozen-lockfile")) {
120
+ finalArgs.push("--frozen-lockfile");
121
+ }
122
+ console.info("\u2705 Using CI-optimized flags for faster installation...");
123
+ }
124
+ try {
125
+ const result = silent ? await bunExec("bun", finalArgs, { cwd }) : await bunExecInherit("bun", finalArgs, { cwd });
126
+ if (silent && !result.success) {
127
+ throw new Error(
128
+ `Bun command failed with exit code ${result.exitCode}: ${result.stderr || result.stdout}`
129
+ );
130
+ }
131
+ } catch (error) {
132
+ if (error.code === "ENOENT" || error.message?.includes("bun: command not found")) {
133
+ throw new Error(`Bun command not found. ${displayBunInstallationTipCompact()}`);
134
+ }
135
+ if (isCI && isInstallCommand && (error.message?.includes("frozen-lockfile") || error.message?.includes("install"))) {
136
+ console.warn("CI-optimized install failed, retrying with basic args...");
137
+ const retryResult = silent ? await bunExec("bun", args, { cwd }) : await bunExecInherit("bun", args, { cwd });
138
+ if (silent && !retryResult.success) {
139
+ throw new Error(
140
+ `Bun command failed with exit code ${retryResult.exitCode}: ${retryResult.stderr || retryResult.stdout}`
141
+ );
142
+ }
143
+ } else {
144
+ throw error;
145
+ }
146
+ }
147
+ }
148
+
149
+ export {
150
+ configureEmojis,
151
+ emoji,
152
+ displayBunInstallationTipCompact,
153
+ runBunCommand
154
+ };
@@ -9,10 +9,11 @@ import {
9
9
  setAgentConfig,
10
10
  startAgent,
11
11
  stopAgent
12
- } from "../../../chunk-PSSTO76B.js";
13
- import "../../../chunk-5DYKNYEY.js";
12
+ } from "../../../chunk-KKAK7OQA.js";
13
+ import "../../../chunk-Y5IA2UZ2.js";
14
14
  import "../../../chunk-F24MS2YR.js";
15
- import "../../../chunk-XB5JBFO6.js";
15
+ import "../../../chunk-3YTIOEFK.js";
16
+ import "../../../chunk-AQ6OMR2A.js";
16
17
  export {
17
18
  clearAgentMemories,
18
19
  getAgent,
@@ -6,13 +6,14 @@ import {
6
6
  agent,
7
7
  getAgents,
8
8
  resolveAgentId
9
- } from "../../chunk-PSSTO76B.js";
10
- import "../../chunk-5DYKNYEY.js";
9
+ } from "../../chunk-KKAK7OQA.js";
10
+ import "../../chunk-Y5IA2UZ2.js";
11
11
  import {
12
12
  getAgentRuntimeUrl,
13
13
  getAgentsBaseUrl
14
14
  } from "../../chunk-F24MS2YR.js";
15
- import "../../chunk-XB5JBFO6.js";
15
+ import "../../chunk-3YTIOEFK.js";
16
+ import "../../chunk-AQ6OMR2A.js";
16
17
  export {
17
18
  agent,
18
19
  getAgentRuntimeUrl,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Creates a new plugin with the specified name and configuration.
3
3
  */
4
- declare function createPlugin(pluginName: string, targetDir: string, isNonInteractive?: boolean): Promise<void>;
4
+ declare function createPlugin(pluginName: string, targetDir: string, pluginType?: string, isNonInteractive?: boolean): Promise<void>;
5
5
  /**
6
6
  * Creates a new agent character file with the specified name.
7
7
  */
@@ -23,6 +23,10 @@ declare function createProjectDirectories(targetDir: string): Promise<void>;
23
23
  * Sets up AI model configuration in the project's .env file based on user selection.
24
24
  */
25
25
  declare function setupAIModelConfig(aiModel: string, envFilePath: string, isNonInteractive?: boolean): Promise<void>;
26
+ /**
27
+ * Checks if an environment variable has a real value (not a placeholder) in the content
28
+ */
29
+ declare function hasValidApiKey(content: string, keyName: string): boolean;
26
30
  /**
27
31
  * Sets up embedding model configuration when the primary AI model doesn't support embeddings.
28
32
  */
@@ -32,4 +36,4 @@ declare function setupEmbeddingModelConfig(embeddingModel: string, envFilePath:
32
36
  */
33
37
  declare function setupProjectEnvironment(targetDir: string, database: string, aiModel: string, embeddingModel?: string, isNonInteractive?: boolean): Promise<void>;
34
38
 
35
- export { createAgent, createPlugin, createProject, createProjectDirectories, createTEEProject, setupAIModelConfig, setupEmbeddingModelConfig, setupProjectEnvironment };
39
+ export { createAgent, createPlugin, createProject, createProjectDirectories, createTEEProject, hasValidApiKey, setupAIModelConfig, setupEmbeddingModelConfig, setupProjectEnvironment };
@@ -6,24 +6,25 @@ import {
6
6
  createAgent,
7
7
  createPlugin,
8
8
  createProject,
9
- createTEEProject
10
- } from "../../../chunk-2XI6N7KN.js";
11
- import {
12
9
  createProjectDirectories,
10
+ createTEEProject,
11
+ hasValidApiKey,
13
12
  setupAIModelConfig,
14
13
  setupEmbeddingModelConfig,
15
14
  setupProjectEnvironment
16
- } from "../../../chunk-ZWDXDKSA.js";
17
- import "../../../chunk-PSSTO76B.js";
18
- import "../../../chunk-5DYKNYEY.js";
15
+ } from "../../../chunk-2ZF5OAMV.js";
16
+ import "../../../chunk-KKAK7OQA.js";
17
+ import "../../../chunk-Y5IA2UZ2.js";
19
18
  import "../../../chunk-F24MS2YR.js";
20
- import "../../../chunk-XB5JBFO6.js";
19
+ import "../../../chunk-3YTIOEFK.js";
20
+ import "../../../chunk-AQ6OMR2A.js";
21
21
  export {
22
22
  createAgent,
23
23
  createPlugin,
24
24
  createProject,
25
25
  createProjectDirectories,
26
26
  createTEEProject,
27
+ hasValidApiKey,
27
28
  setupAIModelConfig,
28
29
  setupEmbeddingModelConfig,
29
30
  setupProjectEnvironment