@elizaos/cli 1.2.3 → 1.2.5

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 (56) hide show
  1. package/dist/bun-exec-4BOHUSSZ.js +21 -0
  2. package/dist/chunk-6ZB77OJK.js +154 -0
  3. package/dist/chunk-AQ6OMR2A.js +14 -0
  4. package/dist/{chunk-JZG5QBNT.js → chunk-ECH6TQ7M.js} +2 -2
  5. package/dist/chunk-EVE5GO74.js +183 -0
  6. package/dist/{chunk-2XI6N7KN.js → chunk-JR4V32X7.js} +348 -67
  7. package/dist/{chunk-PSSTO76B.js → chunk-X5K7QYAH.js} +79 -97
  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 +5 -1
  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.d.ts +1 -1
  15. package/dist/index.js +17 -27
  16. package/dist/{plugin-creator-5CER524N.js → plugin-creator-UBYADX3B.js} +16 -15
  17. package/dist/{registry-SN5V2VXR.js → registry-U2ZGKGSS.js} +4 -3
  18. package/dist/templates/plugin-starter/dist/assets/index-CgkejLs_.css +1 -0
  19. package/dist/templates/plugin-starter/dist/assets/index-DUtsQhKX.js +49 -0
  20. package/dist/templates/plugin-starter/dist/index.html +14 -0
  21. package/dist/templates/plugin-starter/package.json +1 -1
  22. package/dist/templates/plugin-starter/src/__tests__/build-order.test.ts +51 -0
  23. package/dist/templates/plugin-starter/src/__tests__/vite-config-utils.ts +33 -0
  24. package/dist/templates/plugin-starter/tsup.config.ts +1 -1
  25. package/dist/templates/plugin-starter/vite.config.ts +1 -1
  26. package/dist/templates/project-starter/package.json +4 -4
  27. package/dist/templates/project-starter/src/__tests__/build-order.test.ts +59 -0
  28. package/dist/templates/project-starter/src/__tests__/character-plugin-ordering.test.ts +11 -110
  29. package/dist/templates/project-starter/src/__tests__/vite-config-utils.ts +33 -0
  30. package/dist/templates/project-starter/src/character.ts +14 -17
  31. package/dist/templates/project-starter/tsup.config.ts +1 -1
  32. package/dist/templates/project-tee-starter/package.json +3 -3
  33. package/dist/templates/project-tee-starter/src/character.ts +3 -0
  34. package/dist/{utils-DTW3XU6O.js → utils-7XPDALF7.js} +4 -3
  35. package/package.json +6 -6
  36. package/templates/plugin-starter/dist/.vite/manifest.json +2 -2
  37. package/templates/plugin-starter/dist/assets/index-CgkejLs_.css +1 -0
  38. package/templates/plugin-starter/dist/assets/index-DUtsQhKX.js +49 -0
  39. package/templates/plugin-starter/dist/index.html +14 -0
  40. package/templates/plugin-starter/package.json +1 -1
  41. package/templates/plugin-starter/src/__tests__/build-order.test.ts +51 -0
  42. package/templates/plugin-starter/src/__tests__/vite-config-utils.ts +33 -0
  43. package/templates/plugin-starter/tsup.config.ts +1 -1
  44. package/templates/plugin-starter/vite.config.ts +1 -1
  45. package/templates/project-starter/package.json +4 -4
  46. package/templates/project-starter/src/__tests__/build-order.test.ts +59 -0
  47. package/templates/project-starter/src/__tests__/character-plugin-ordering.test.ts +11 -110
  48. package/templates/project-starter/src/__tests__/vite-config-utils.ts +33 -0
  49. package/templates/project-starter/src/character.ts +14 -17
  50. package/templates/project-starter/tsup.config.ts +1 -1
  51. package/templates/project-tee-starter/package.json +3 -3
  52. package/templates/project-tee-starter/src/character.ts +3 -0
  53. package/dist/chunk-5DYKNYEY.js +0 -2262
  54. package/dist/chunk-XB5JBFO6.js +0 -41
  55. package/dist/chunk-ZWDXDKSA.js +0 -281
  56. package/dist/setup-UQOWDHFN.js +0 -20
@@ -0,0 +1,21 @@
1
+
2
+ import { createRequire } from 'module';
3
+ const require = createRequire(import.meta.url);
4
+
5
+ import {
6
+ ProcessExecutionError,
7
+ ProcessTimeoutError,
8
+ bunExec,
9
+ bunExecInherit,
10
+ bunExecSimple,
11
+ commandExists
12
+ } from "./chunk-EVE5GO74.js";
13
+ import "./chunk-AQ6OMR2A.js";
14
+ export {
15
+ ProcessExecutionError,
16
+ ProcessTimeoutError,
17
+ bunExec,
18
+ bunExecInherit,
19
+ bunExecSimple,
20
+ commandExists
21
+ };
@@ -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-EVE5GO74.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
+ };
@@ -0,0 +1,14 @@
1
+
2
+ import { createRequire } from 'module';
3
+ const require = createRequire(import.meta.url);
4
+
5
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
6
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
7
+ }) : x)(function(x) {
8
+ if (typeof require !== "undefined") return require.apply(this, arguments);
9
+ throw Error('Dynamic require of "' + x + '" is not supported');
10
+ });
11
+
12
+ export {
13
+ __require
14
+ };
@@ -12,11 +12,11 @@ import {
12
12
  selectEmbeddingModel,
13
13
  validateCreateOptions,
14
14
  validateProjectName
15
- } from "./chunk-2XI6N7KN.js";
15
+ } from "./chunk-JR4V32X7.js";
16
16
  import {
17
17
  displayBanner,
18
18
  handleError
19
- } from "./chunk-PSSTO76B.js";
19
+ } from "./chunk-X5K7QYAH.js";
20
20
 
21
21
  // src/commands/create/index.ts
22
22
  import { Command } from "commander";
@@ -0,0 +1,183 @@
1
+
2
+ import { createRequire } from 'module';
3
+ const require = createRequire(import.meta.url);
4
+
5
+
6
+ // src/utils/bun-exec.ts
7
+ import { logger } from "@elizaos/core";
8
+ var COMMAND_EXISTS_TIMEOUT_MS = 5e3;
9
+ var ProcessExecutionError = class extends Error {
10
+ constructor(message, exitCode, stderr, command) {
11
+ super(message);
12
+ this.exitCode = exitCode;
13
+ this.stderr = stderr;
14
+ this.command = command;
15
+ this.name = "ProcessExecutionError";
16
+ }
17
+ };
18
+ var ProcessTimeoutError = class extends Error {
19
+ constructor(message, command, timeout) {
20
+ super(message);
21
+ this.command = command;
22
+ this.timeout = timeout;
23
+ this.name = "ProcessTimeoutError";
24
+ }
25
+ };
26
+ function escapeShellArg(arg) {
27
+ if (arg === "") {
28
+ return '""';
29
+ }
30
+ const escaped = JSON.stringify(arg);
31
+ return escaped;
32
+ }
33
+ async function readStreamSafe(stream, streamName) {
34
+ if (!stream || typeof stream === "number") {
35
+ return "";
36
+ }
37
+ try {
38
+ const text = await new Response(stream).text();
39
+ return text;
40
+ } catch (error) {
41
+ logger.debug(`[bunExec] Error reading ${streamName}:`, error);
42
+ return "";
43
+ }
44
+ }
45
+ async function bunExec(command, args = [], options = {}) {
46
+ let proc = null;
47
+ let timeoutId = null;
48
+ try {
49
+ const escapedArgs = args.map(escapeShellArg);
50
+ const fullCommand = [command, ...escapedArgs].join(" ");
51
+ logger.debug(`[bunExec] Executing: ${fullCommand}`);
52
+ proc = Bun.spawn([command, ...args], {
53
+ cwd: options.cwd,
54
+ env: { ...process.env, ...options.env },
55
+ stdout: options.stdout || options.stdio || "pipe",
56
+ stderr: options.stderr || options.stdio || "pipe"
57
+ });
58
+ if (options.signal) {
59
+ options.signal.addEventListener("abort", () => {
60
+ if (proc && proc.exitCode === null) {
61
+ proc.kill();
62
+ }
63
+ });
64
+ }
65
+ const timeoutPromise = new Promise((_, reject) => {
66
+ if (options.timeout && options.timeout > 0) {
67
+ const timeoutMs = options.timeout;
68
+ timeoutId = setTimeout(() => {
69
+ if (proc && proc.exitCode === null) {
70
+ proc.kill();
71
+ }
72
+ reject(
73
+ new ProcessTimeoutError(
74
+ `Command timed out after ${timeoutMs}ms`,
75
+ fullCommand,
76
+ timeoutMs
77
+ )
78
+ );
79
+ }, timeoutMs);
80
+ }
81
+ });
82
+ const [stdout, stderr, exitCode] = await Promise.race([
83
+ // Normal execution path - all operations run concurrently
84
+ Promise.all([
85
+ readStreamSafe(proc.stdout, "stdout"),
86
+ readStreamSafe(proc.stderr, "stderr"),
87
+ proc.exited
88
+ ]),
89
+ // Timeout path
90
+ timeoutPromise
91
+ ]);
92
+ if (timeoutId) {
93
+ clearTimeout(timeoutId);
94
+ }
95
+ const success = exitCode === 0;
96
+ if (!success && options.stdio !== "ignore") {
97
+ logger.debug(`[bunExec] Command failed with exit code ${exitCode}`);
98
+ if (stderr) {
99
+ logger.debug(`[bunExec] stderr: ${stderr}`);
100
+ }
101
+ }
102
+ return {
103
+ stdout: stdout.trim(),
104
+ stderr: stderr.trim(),
105
+ exitCode,
106
+ success
107
+ };
108
+ } catch (error) {
109
+ if (timeoutId) {
110
+ clearTimeout(timeoutId);
111
+ }
112
+ if (error instanceof ProcessTimeoutError) {
113
+ throw error;
114
+ }
115
+ if (error instanceof Error) {
116
+ throw new ProcessExecutionError(
117
+ `Command execution failed: ${error.message}`,
118
+ null,
119
+ "",
120
+ command
121
+ );
122
+ }
123
+ throw error;
124
+ } finally {
125
+ if (proc && proc.exitCode === null) {
126
+ try {
127
+ proc.kill();
128
+ logger.debug("[bunExec] Killed still-running process in cleanup");
129
+ } catch (cleanupError) {
130
+ logger.debug(
131
+ "[bunExec] Process cleanup error (process may have already exited):",
132
+ cleanupError
133
+ );
134
+ }
135
+ }
136
+ }
137
+ }
138
+ async function bunExecSimple(command, args = [], options = {}) {
139
+ const result = await bunExec(command, args, options);
140
+ if (!result.success && options.stdio !== "ignore") {
141
+ throw new ProcessExecutionError(
142
+ `Command failed: ${command} ${args.map(escapeShellArg).join(" ")}`,
143
+ result.exitCode,
144
+ result.stderr,
145
+ command
146
+ );
147
+ }
148
+ return { stdout: result.stdout };
149
+ }
150
+ async function bunExecInherit(command, args = [], options = {}) {
151
+ return bunExec(command, args, {
152
+ ...options,
153
+ stdio: "inherit"
154
+ });
155
+ }
156
+ async function commandExists(command) {
157
+ try {
158
+ if (process.platform === "win32") {
159
+ const result = await bunExec("where", [command], {
160
+ stdio: "ignore",
161
+ timeout: COMMAND_EXISTS_TIMEOUT_MS
162
+ });
163
+ return result.success;
164
+ } else {
165
+ const result = await bunExec("which", [command], {
166
+ stdio: "ignore",
167
+ timeout: COMMAND_EXISTS_TIMEOUT_MS
168
+ });
169
+ return result.success;
170
+ }
171
+ } catch {
172
+ return false;
173
+ }
174
+ }
175
+
176
+ export {
177
+ ProcessExecutionError,
178
+ ProcessTimeoutError,
179
+ bunExec,
180
+ bunExecSimple,
181
+ bunExecInherit,
182
+ commandExists
183
+ };