@elizaos/cli 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/index-BLUE6ehn.css +1 -0
  3. package/dist/assets/index-BLUE6ehn.css.br +0 -0
  4. package/dist/assets/{index-DLCBfFYd.js → index-BaWElBml.js} +1789 -1788
  5. package/dist/assets/{index-DLCBfFYd.js.map → index-BaWElBml.js.map} +1 -1
  6. package/dist/assets/{index-DNxLn4OZ.js → index-Bs4IloEa.js} +2 -2
  7. package/dist/assets/index-Bs4IloEa.js.br +0 -0
  8. package/dist/assets/{index-DNxLn4OZ.js.map → index-Bs4IloEa.js.map} +1 -1
  9. package/dist/assets/vendor-CFQmvqmR.js.br +0 -0
  10. package/dist/{chunk-QC5MM66L.js → chunk-246Q3Y5O.js} +3 -3
  11. package/dist/chunk-2GXSCVA2.js +2057 -0
  12. package/dist/chunk-67L4I5S7.js +80 -0
  13. package/dist/chunk-7HDCC22V.js +771 -0
  14. package/dist/{chunk-F3WZNGHX.js → chunk-BZIUA2KE.js} +6 -0
  15. package/dist/{chunk-QU55ROKN.js → chunk-GE5HMHU5.js} +12 -6
  16. package/dist/{chunk-UMDJUAZA.js → chunk-JT3O6PBU.js} +3908 -377
  17. package/dist/{chunk-5R4LDP3N.js → chunk-KNZMV4HH.js} +4 -4
  18. package/dist/{chunk-QPXAVEMR.js → chunk-NQ5HAYUQ.js} +40 -2
  19. package/dist/{chunk-XF2FQZM2.js → chunk-OF5WHPTG.js} +105 -798
  20. package/dist/{chunk-ENUVIKE2.js → chunk-OG4OJUNA.js} +2 -2
  21. package/dist/{chunk-SOL3WRAY.js → chunk-OJMVYUOU.js} +1 -1
  22. package/dist/{chunk-XLCI6Y5F.js → chunk-QGZZVGE5.js} +2 -2
  23. package/dist/{chunk-PJJS5DFB.js → chunk-WAJ5RHPK.js} +1 -1
  24. package/dist/commands/agent.js +2 -1
  25. package/dist/commands/create.js +4 -3
  26. package/dist/commands/dev.js +4 -3
  27. package/dist/commands/env.js +3 -2
  28. package/dist/commands/plugins.js +4 -3
  29. package/dist/commands/publish.js +5 -4
  30. package/dist/commands/setup-monorepo.js +3 -2
  31. package/dist/commands/start.js +7 -5
  32. package/dist/commands/test.js +8 -6
  33. package/dist/commands/update.js +4 -3
  34. package/dist/fileFromPath-DCRQMDLJ.js +132 -0
  35. package/dist/index.html +2 -2
  36. package/dist/index.js +14 -12
  37. package/dist/migrator-7EYGXTDW.js +29035 -0
  38. package/dist/{registry-YU4WBPLU.js → registry-RGSXW4LO.js} +2 -1
  39. package/package.json +10 -4
  40. package/templates/plugin-starter/package.json +1 -1
  41. package/templates/project-starter/.env.example +1 -0
  42. package/templates/project-starter/package.json +4 -4
  43. package/templates/project-starter/src/index.ts +1 -1
  44. package/templates/project-tee-starter/.dockerignore +20 -0
  45. package/templates/project-tee-starter/.env.example +55 -0
  46. package/templates/project-tee-starter/Dockerfile +66 -0
  47. package/templates/project-tee-starter/GUIDE.md +235 -0
  48. package/templates/project-tee-starter/README.md +173 -0
  49. package/templates/project-tee-starter/__tests__/actions.test.ts +9 -0
  50. package/templates/project-tee-starter/__tests__/character.test.ts +86 -0
  51. package/templates/project-tee-starter/__tests__/config.test.ts +31 -0
  52. package/templates/project-tee-starter/__tests__/env.test.ts +87 -0
  53. package/templates/project-tee-starter/__tests__/error-handling.test.ts +30 -0
  54. package/templates/project-tee-starter/__tests__/events.test.ts +21 -0
  55. package/templates/project-tee-starter/__tests__/file-structure.test.ts +135 -0
  56. package/templates/project-tee-starter/__tests__/integration.test.ts +209 -0
  57. package/templates/project-tee-starter/__tests__/models.test.ts +22 -0
  58. package/templates/project-tee-starter/__tests__/plugin.test.ts +44 -0
  59. package/templates/project-tee-starter/__tests__/provider.test.ts +189 -0
  60. package/templates/project-tee-starter/__tests__/routes.test.ts +21 -0
  61. package/templates/project-tee-starter/__tests__/test-utils.ts +121 -0
  62. package/templates/project-tee-starter/__tests__/utils/core-test-utils.ts +167 -0
  63. package/templates/project-tee-starter/assets/mr-tee-portrait.jpg +0 -0
  64. package/templates/project-tee-starter/docker-compose.yaml +57 -0
  65. package/templates/project-tee-starter/e2e/project.test.ts +38 -0
  66. package/templates/project-tee-starter/e2e/starter-plugin.test.ts +92 -0
  67. package/templates/project-tee-starter/package.json +76 -0
  68. package/templates/project-tee-starter/src/character.ts +257 -0
  69. package/templates/project-tee-starter/src/index.ts +33 -0
  70. package/templates/project-tee-starter/src/plugin.ts +169 -0
  71. package/templates/project-tee-starter/tsconfig.build.json +13 -0
  72. package/templates/project-tee-starter/tsconfig.json +30 -0
  73. package/templates/project-tee-starter/tsup.config.ts +19 -0
  74. package/templates/project-tee-starter/vitest.config.ts +19 -0
  75. package/dist/assets/index-ljsW7JJO.css +0 -1
  76. package/dist/eliza-J3ANDQXN.js +0 -13
  77. /package/dist/{chunk-YX7JHUJ5.js → chunk-BDPGXNHU.js} +0 -0
@@ -8,6 +8,9 @@ import {
8
8
  import {
9
9
  require_prompts
10
10
  } from "./chunk-LRSU7IN6.js";
11
+ import {
12
+ require_src
13
+ } from "./chunk-7HDCC22V.js";
11
14
  import {
12
15
  __commonJS,
13
16
  __esm,
@@ -2368,763 +2371,6 @@ var require_lib = __commonJS({
2368
2371
  }
2369
2372
  });
2370
2373
 
2371
- // ../../node_modules/ms/index.js
2372
- var require_ms = __commonJS({
2373
- "../../node_modules/ms/index.js"(exports, module) {
2374
- var s = 1e3;
2375
- var m = s * 60;
2376
- var h = m * 60;
2377
- var d = h * 24;
2378
- var w = d * 7;
2379
- var y = d * 365.25;
2380
- module.exports = function(val, options) {
2381
- options = options || {};
2382
- var type = typeof val;
2383
- if (type === "string" && val.length > 0) {
2384
- return parse3(val);
2385
- } else if (type === "number" && isFinite(val)) {
2386
- return options.long ? fmtLong(val) : fmtShort(val);
2387
- }
2388
- throw new Error(
2389
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
2390
- );
2391
- };
2392
- function parse3(str) {
2393
- str = String(str);
2394
- if (str.length > 100) {
2395
- return;
2396
- }
2397
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
2398
- str
2399
- );
2400
- if (!match) {
2401
- return;
2402
- }
2403
- var n = parseFloat(match[1]);
2404
- var type = (match[2] || "ms").toLowerCase();
2405
- switch (type) {
2406
- case "years":
2407
- case "year":
2408
- case "yrs":
2409
- case "yr":
2410
- case "y":
2411
- return n * y;
2412
- case "weeks":
2413
- case "week":
2414
- case "w":
2415
- return n * w;
2416
- case "days":
2417
- case "day":
2418
- case "d":
2419
- return n * d;
2420
- case "hours":
2421
- case "hour":
2422
- case "hrs":
2423
- case "hr":
2424
- case "h":
2425
- return n * h;
2426
- case "minutes":
2427
- case "minute":
2428
- case "mins":
2429
- case "min":
2430
- case "m":
2431
- return n * m;
2432
- case "seconds":
2433
- case "second":
2434
- case "secs":
2435
- case "sec":
2436
- case "s":
2437
- return n * s;
2438
- case "milliseconds":
2439
- case "millisecond":
2440
- case "msecs":
2441
- case "msec":
2442
- case "ms":
2443
- return n;
2444
- default:
2445
- return void 0;
2446
- }
2447
- }
2448
- function fmtShort(ms) {
2449
- var msAbs = Math.abs(ms);
2450
- if (msAbs >= d) {
2451
- return Math.round(ms / d) + "d";
2452
- }
2453
- if (msAbs >= h) {
2454
- return Math.round(ms / h) + "h";
2455
- }
2456
- if (msAbs >= m) {
2457
- return Math.round(ms / m) + "m";
2458
- }
2459
- if (msAbs >= s) {
2460
- return Math.round(ms / s) + "s";
2461
- }
2462
- return ms + "ms";
2463
- }
2464
- function fmtLong(ms) {
2465
- var msAbs = Math.abs(ms);
2466
- if (msAbs >= d) {
2467
- return plural(ms, msAbs, d, "day");
2468
- }
2469
- if (msAbs >= h) {
2470
- return plural(ms, msAbs, h, "hour");
2471
- }
2472
- if (msAbs >= m) {
2473
- return plural(ms, msAbs, m, "minute");
2474
- }
2475
- if (msAbs >= s) {
2476
- return plural(ms, msAbs, s, "second");
2477
- }
2478
- return ms + " ms";
2479
- }
2480
- function plural(ms, msAbs, n, name) {
2481
- var isPlural = msAbs >= n * 1.5;
2482
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
2483
- }
2484
- }
2485
- });
2486
-
2487
- // ../../node_modules/debug/src/common.js
2488
- var require_common = __commonJS({
2489
- "../../node_modules/debug/src/common.js"(exports, module) {
2490
- function setup(env) {
2491
- createDebug.debug = createDebug;
2492
- createDebug.default = createDebug;
2493
- createDebug.coerce = coerce;
2494
- createDebug.disable = disable;
2495
- createDebug.enable = enable;
2496
- createDebug.enabled = enabled;
2497
- createDebug.humanize = require_ms();
2498
- createDebug.destroy = destroy;
2499
- Object.keys(env).forEach((key2) => {
2500
- createDebug[key2] = env[key2];
2501
- });
2502
- createDebug.names = [];
2503
- createDebug.skips = [];
2504
- createDebug.formatters = {};
2505
- function selectColor(namespace) {
2506
- let hash = 0;
2507
- for (let i = 0; i < namespace.length; i++) {
2508
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
2509
- hash |= 0;
2510
- }
2511
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
2512
- }
2513
- createDebug.selectColor = selectColor;
2514
- function createDebug(namespace) {
2515
- let prevTime;
2516
- let enableOverride = null;
2517
- let namespacesCache;
2518
- let enabledCache;
2519
- function debug(...args) {
2520
- if (!debug.enabled) {
2521
- return;
2522
- }
2523
- const self = debug;
2524
- const curr = Number(/* @__PURE__ */ new Date());
2525
- const ms = curr - (prevTime || curr);
2526
- self.diff = ms;
2527
- self.prev = prevTime;
2528
- self.curr = curr;
2529
- prevTime = curr;
2530
- args[0] = createDebug.coerce(args[0]);
2531
- if (typeof args[0] !== "string") {
2532
- args.unshift("%O");
2533
- }
2534
- let index = 0;
2535
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
2536
- if (match === "%%") {
2537
- return "%";
2538
- }
2539
- index++;
2540
- const formatter = createDebug.formatters[format2];
2541
- if (typeof formatter === "function") {
2542
- const val = args[index];
2543
- match = formatter.call(self, val);
2544
- args.splice(index, 1);
2545
- index--;
2546
- }
2547
- return match;
2548
- });
2549
- createDebug.formatArgs.call(self, args);
2550
- const logFn = self.log || createDebug.log;
2551
- logFn.apply(self, args);
2552
- }
2553
- debug.namespace = namespace;
2554
- debug.useColors = createDebug.useColors();
2555
- debug.color = createDebug.selectColor(namespace);
2556
- debug.extend = extend;
2557
- debug.destroy = createDebug.destroy;
2558
- Object.defineProperty(debug, "enabled", {
2559
- enumerable: true,
2560
- configurable: false,
2561
- get: () => {
2562
- if (enableOverride !== null) {
2563
- return enableOverride;
2564
- }
2565
- if (namespacesCache !== createDebug.namespaces) {
2566
- namespacesCache = createDebug.namespaces;
2567
- enabledCache = createDebug.enabled(namespace);
2568
- }
2569
- return enabledCache;
2570
- },
2571
- set: (v) => {
2572
- enableOverride = v;
2573
- }
2574
- });
2575
- if (typeof createDebug.init === "function") {
2576
- createDebug.init(debug);
2577
- }
2578
- return debug;
2579
- }
2580
- function extend(namespace, delimiter) {
2581
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
2582
- newDebug.log = this.log;
2583
- return newDebug;
2584
- }
2585
- function enable(namespaces) {
2586
- createDebug.save(namespaces);
2587
- createDebug.namespaces = namespaces;
2588
- createDebug.names = [];
2589
- createDebug.skips = [];
2590
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
2591
- for (const ns of split) {
2592
- if (ns[0] === "-") {
2593
- createDebug.skips.push(ns.slice(1));
2594
- } else {
2595
- createDebug.names.push(ns);
2596
- }
2597
- }
2598
- }
2599
- function matchesTemplate(search, template) {
2600
- let searchIndex = 0;
2601
- let templateIndex = 0;
2602
- let starIndex = -1;
2603
- let matchIndex = 0;
2604
- while (searchIndex < search.length) {
2605
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
2606
- if (template[templateIndex] === "*") {
2607
- starIndex = templateIndex;
2608
- matchIndex = searchIndex;
2609
- templateIndex++;
2610
- } else {
2611
- searchIndex++;
2612
- templateIndex++;
2613
- }
2614
- } else if (starIndex !== -1) {
2615
- templateIndex = starIndex + 1;
2616
- matchIndex++;
2617
- searchIndex = matchIndex;
2618
- } else {
2619
- return false;
2620
- }
2621
- }
2622
- while (templateIndex < template.length && template[templateIndex] === "*") {
2623
- templateIndex++;
2624
- }
2625
- return templateIndex === template.length;
2626
- }
2627
- function disable() {
2628
- const namespaces = [
2629
- ...createDebug.names,
2630
- ...createDebug.skips.map((namespace) => "-" + namespace)
2631
- ].join(",");
2632
- createDebug.enable("");
2633
- return namespaces;
2634
- }
2635
- function enabled(name) {
2636
- for (const skip of createDebug.skips) {
2637
- if (matchesTemplate(name, skip)) {
2638
- return false;
2639
- }
2640
- }
2641
- for (const ns of createDebug.names) {
2642
- if (matchesTemplate(name, ns)) {
2643
- return true;
2644
- }
2645
- }
2646
- return false;
2647
- }
2648
- function coerce(val) {
2649
- if (val instanceof Error) {
2650
- return val.stack || val.message;
2651
- }
2652
- return val;
2653
- }
2654
- function destroy() {
2655
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
2656
- }
2657
- createDebug.enable(createDebug.load());
2658
- return createDebug;
2659
- }
2660
- module.exports = setup;
2661
- }
2662
- });
2663
-
2664
- // ../../node_modules/debug/src/browser.js
2665
- var require_browser = __commonJS({
2666
- "../../node_modules/debug/src/browser.js"(exports, module) {
2667
- exports.formatArgs = formatArgs;
2668
- exports.save = save;
2669
- exports.load = load;
2670
- exports.useColors = useColors;
2671
- exports.storage = localstorage();
2672
- exports.destroy = /* @__PURE__ */ (() => {
2673
- let warned = false;
2674
- return () => {
2675
- if (!warned) {
2676
- warned = true;
2677
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
2678
- }
2679
- };
2680
- })();
2681
- exports.colors = [
2682
- "#0000CC",
2683
- "#0000FF",
2684
- "#0033CC",
2685
- "#0033FF",
2686
- "#0066CC",
2687
- "#0066FF",
2688
- "#0099CC",
2689
- "#0099FF",
2690
- "#00CC00",
2691
- "#00CC33",
2692
- "#00CC66",
2693
- "#00CC99",
2694
- "#00CCCC",
2695
- "#00CCFF",
2696
- "#3300CC",
2697
- "#3300FF",
2698
- "#3333CC",
2699
- "#3333FF",
2700
- "#3366CC",
2701
- "#3366FF",
2702
- "#3399CC",
2703
- "#3399FF",
2704
- "#33CC00",
2705
- "#33CC33",
2706
- "#33CC66",
2707
- "#33CC99",
2708
- "#33CCCC",
2709
- "#33CCFF",
2710
- "#6600CC",
2711
- "#6600FF",
2712
- "#6633CC",
2713
- "#6633FF",
2714
- "#66CC00",
2715
- "#66CC33",
2716
- "#9900CC",
2717
- "#9900FF",
2718
- "#9933CC",
2719
- "#9933FF",
2720
- "#99CC00",
2721
- "#99CC33",
2722
- "#CC0000",
2723
- "#CC0033",
2724
- "#CC0066",
2725
- "#CC0099",
2726
- "#CC00CC",
2727
- "#CC00FF",
2728
- "#CC3300",
2729
- "#CC3333",
2730
- "#CC3366",
2731
- "#CC3399",
2732
- "#CC33CC",
2733
- "#CC33FF",
2734
- "#CC6600",
2735
- "#CC6633",
2736
- "#CC9900",
2737
- "#CC9933",
2738
- "#CCCC00",
2739
- "#CCCC33",
2740
- "#FF0000",
2741
- "#FF0033",
2742
- "#FF0066",
2743
- "#FF0099",
2744
- "#FF00CC",
2745
- "#FF00FF",
2746
- "#FF3300",
2747
- "#FF3333",
2748
- "#FF3366",
2749
- "#FF3399",
2750
- "#FF33CC",
2751
- "#FF33FF",
2752
- "#FF6600",
2753
- "#FF6633",
2754
- "#FF9900",
2755
- "#FF9933",
2756
- "#FFCC00",
2757
- "#FFCC33"
2758
- ];
2759
- function useColors() {
2760
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
2761
- return true;
2762
- }
2763
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
2764
- return false;
2765
- }
2766
- let m;
2767
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
2768
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
2769
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
2770
- typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
2771
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
2772
- }
2773
- function formatArgs(args) {
2774
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
2775
- if (!this.useColors) {
2776
- return;
2777
- }
2778
- const c2 = "color: " + this.color;
2779
- args.splice(1, 0, c2, "color: inherit");
2780
- let index = 0;
2781
- let lastC = 0;
2782
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
2783
- if (match === "%%") {
2784
- return;
2785
- }
2786
- index++;
2787
- if (match === "%c") {
2788
- lastC = index;
2789
- }
2790
- });
2791
- args.splice(lastC, 0, c2);
2792
- }
2793
- exports.log = console.debug || console.log || (() => {
2794
- });
2795
- function save(namespaces) {
2796
- try {
2797
- if (namespaces) {
2798
- exports.storage.setItem("debug", namespaces);
2799
- } else {
2800
- exports.storage.removeItem("debug");
2801
- }
2802
- } catch (error) {
2803
- }
2804
- }
2805
- function load() {
2806
- let r;
2807
- try {
2808
- r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
2809
- } catch (error) {
2810
- }
2811
- if (!r && typeof process !== "undefined" && "env" in process) {
2812
- r = process.env.DEBUG;
2813
- }
2814
- return r;
2815
- }
2816
- function localstorage() {
2817
- try {
2818
- return localStorage;
2819
- } catch (error) {
2820
- }
2821
- }
2822
- module.exports = require_common()(exports);
2823
- var { formatters } = module.exports;
2824
- formatters.j = function(v) {
2825
- try {
2826
- return JSON.stringify(v);
2827
- } catch (error) {
2828
- return "[UnexpectedJSONParseError]: " + error.message;
2829
- }
2830
- };
2831
- }
2832
- });
2833
-
2834
- // ../../node_modules/has-flag/index.js
2835
- var require_has_flag = __commonJS({
2836
- "../../node_modules/has-flag/index.js"(exports, module) {
2837
- "use strict";
2838
- module.exports = (flag, argv) => {
2839
- argv = argv || process.argv;
2840
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
2841
- const pos2 = argv.indexOf(prefix + flag);
2842
- const terminatorPos = argv.indexOf("--");
2843
- return pos2 !== -1 && (terminatorPos === -1 ? true : pos2 < terminatorPos);
2844
- };
2845
- }
2846
- });
2847
-
2848
- // ../../node_modules/supports-color/index.js
2849
- var require_supports_color = __commonJS({
2850
- "../../node_modules/supports-color/index.js"(exports, module) {
2851
- "use strict";
2852
- var os2 = __require("os");
2853
- var hasFlag = require_has_flag();
2854
- var env = process.env;
2855
- var forceColor;
2856
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
2857
- forceColor = false;
2858
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
2859
- forceColor = true;
2860
- }
2861
- if ("FORCE_COLOR" in env) {
2862
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
2863
- }
2864
- function translateLevel(level) {
2865
- if (level === 0) {
2866
- return false;
2867
- }
2868
- return {
2869
- level,
2870
- hasBasic: true,
2871
- has256: level >= 2,
2872
- has16m: level >= 3
2873
- };
2874
- }
2875
- function supportsColor(stream) {
2876
- if (forceColor === false) {
2877
- return 0;
2878
- }
2879
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
2880
- return 3;
2881
- }
2882
- if (hasFlag("color=256")) {
2883
- return 2;
2884
- }
2885
- if (stream && !stream.isTTY && forceColor !== true) {
2886
- return 0;
2887
- }
2888
- const min = forceColor ? 1 : 0;
2889
- if (process.platform === "win32") {
2890
- const osRelease = os2.release().split(".");
2891
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
2892
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
2893
- }
2894
- return 1;
2895
- }
2896
- if ("CI" in env) {
2897
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign2) => sign2 in env) || env.CI_NAME === "codeship") {
2898
- return 1;
2899
- }
2900
- return min;
2901
- }
2902
- if ("TEAMCITY_VERSION" in env) {
2903
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
2904
- }
2905
- if (env.COLORTERM === "truecolor") {
2906
- return 3;
2907
- }
2908
- if ("TERM_PROGRAM" in env) {
2909
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
2910
- switch (env.TERM_PROGRAM) {
2911
- case "iTerm.app":
2912
- return version >= 3 ? 3 : 2;
2913
- case "Apple_Terminal":
2914
- return 2;
2915
- }
2916
- }
2917
- if (/-256(color)?$/i.test(env.TERM)) {
2918
- return 2;
2919
- }
2920
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
2921
- return 1;
2922
- }
2923
- if ("COLORTERM" in env) {
2924
- return 1;
2925
- }
2926
- if (env.TERM === "dumb") {
2927
- return min;
2928
- }
2929
- return min;
2930
- }
2931
- function getSupportLevel(stream) {
2932
- const level = supportsColor(stream);
2933
- return translateLevel(level);
2934
- }
2935
- module.exports = {
2936
- supportsColor: getSupportLevel,
2937
- stdout: getSupportLevel(process.stdout),
2938
- stderr: getSupportLevel(process.stderr)
2939
- };
2940
- }
2941
- });
2942
-
2943
- // ../../node_modules/debug/src/node.js
2944
- var require_node = __commonJS({
2945
- "../../node_modules/debug/src/node.js"(exports, module) {
2946
- var tty2 = __require("tty");
2947
- var util2 = __require("util");
2948
- exports.init = init;
2949
- exports.log = log;
2950
- exports.formatArgs = formatArgs;
2951
- exports.save = save;
2952
- exports.load = load;
2953
- exports.useColors = useColors;
2954
- exports.destroy = util2.deprecate(
2955
- () => {
2956
- },
2957
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
2958
- );
2959
- exports.colors = [6, 2, 3, 4, 5, 1];
2960
- try {
2961
- const supportsColor = require_supports_color();
2962
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
2963
- exports.colors = [
2964
- 20,
2965
- 21,
2966
- 26,
2967
- 27,
2968
- 32,
2969
- 33,
2970
- 38,
2971
- 39,
2972
- 40,
2973
- 41,
2974
- 42,
2975
- 43,
2976
- 44,
2977
- 45,
2978
- 56,
2979
- 57,
2980
- 62,
2981
- 63,
2982
- 68,
2983
- 69,
2984
- 74,
2985
- 75,
2986
- 76,
2987
- 77,
2988
- 78,
2989
- 79,
2990
- 80,
2991
- 81,
2992
- 92,
2993
- 93,
2994
- 98,
2995
- 99,
2996
- 112,
2997
- 113,
2998
- 128,
2999
- 129,
3000
- 134,
3001
- 135,
3002
- 148,
3003
- 149,
3004
- 160,
3005
- 161,
3006
- 162,
3007
- 163,
3008
- 164,
3009
- 165,
3010
- 166,
3011
- 167,
3012
- 168,
3013
- 169,
3014
- 170,
3015
- 171,
3016
- 172,
3017
- 173,
3018
- 178,
3019
- 179,
3020
- 184,
3021
- 185,
3022
- 196,
3023
- 197,
3024
- 198,
3025
- 199,
3026
- 200,
3027
- 201,
3028
- 202,
3029
- 203,
3030
- 204,
3031
- 205,
3032
- 206,
3033
- 207,
3034
- 208,
3035
- 209,
3036
- 214,
3037
- 215,
3038
- 220,
3039
- 221
3040
- ];
3041
- }
3042
- } catch (error) {
3043
- }
3044
- exports.inspectOpts = Object.keys(process.env).filter((key2) => {
3045
- return /^debug_/i.test(key2);
3046
- }).reduce((obj, key2) => {
3047
- const prop = key2.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
3048
- return k.toUpperCase();
3049
- });
3050
- let val = process.env[key2];
3051
- if (/^(yes|on|true|enabled)$/i.test(val)) {
3052
- val = true;
3053
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
3054
- val = false;
3055
- } else if (val === "null") {
3056
- val = null;
3057
- } else {
3058
- val = Number(val);
3059
- }
3060
- obj[prop] = val;
3061
- return obj;
3062
- }, {});
3063
- function useColors() {
3064
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty2.isatty(process.stderr.fd);
3065
- }
3066
- function formatArgs(args) {
3067
- const { namespace: name, useColors: useColors2 } = this;
3068
- if (useColors2) {
3069
- const c2 = this.color;
3070
- const colorCode = "\x1B[3" + (c2 < 8 ? c2 : "8;5;" + c2);
3071
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
3072
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
3073
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
3074
- } else {
3075
- args[0] = getDate() + name + " " + args[0];
3076
- }
3077
- }
3078
- function getDate() {
3079
- if (exports.inspectOpts.hideDate) {
3080
- return "";
3081
- }
3082
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
3083
- }
3084
- function log(...args) {
3085
- return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args) + "\n");
3086
- }
3087
- function save(namespaces) {
3088
- if (namespaces) {
3089
- process.env.DEBUG = namespaces;
3090
- } else {
3091
- delete process.env.DEBUG;
3092
- }
3093
- }
3094
- function load() {
3095
- return process.env.DEBUG;
3096
- }
3097
- function init(debug) {
3098
- debug.inspectOpts = {};
3099
- const keys = Object.keys(exports.inspectOpts);
3100
- for (let i = 0; i < keys.length; i++) {
3101
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
3102
- }
3103
- }
3104
- module.exports = require_common()(exports);
3105
- var { formatters } = module.exports;
3106
- formatters.o = function(v) {
3107
- this.inspectOpts.colors = this.useColors;
3108
- return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
3109
- };
3110
- formatters.O = function(v) {
3111
- this.inspectOpts.colors = this.useColors;
3112
- return util2.inspect(v, this.inspectOpts);
3113
- };
3114
- }
3115
- });
3116
-
3117
- // ../../node_modules/debug/src/index.js
3118
- var require_src = __commonJS({
3119
- "../../node_modules/debug/src/index.js"(exports, module) {
3120
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
3121
- module.exports = require_browser();
3122
- } else {
3123
- module.exports = require_node();
3124
- }
3125
- }
3126
- });
3127
-
3128
2374
  // ../../node_modules/agent-base/dist/helpers.js
3129
2375
  var require_helpers = __commonJS({
3130
2376
  "../../node_modules/agent-base/dist/helpers.js"(exports) {
@@ -4495,33 +3741,38 @@ async function copyDir(src, dest, exclude = []) {
4495
3741
  }
4496
3742
  }
4497
3743
  }
3744
+ function getPackageName(templateType) {
3745
+ switch (templateType) {
3746
+ case "project-tee-starter":
3747
+ return "project-tee-starter";
3748
+ case "plugin":
3749
+ return "plugin-starter";
3750
+ case "project":
3751
+ case "project-starter":
3752
+ default:
3753
+ return "project-starter";
3754
+ }
3755
+ }
4498
3756
  async function copyTemplate(templateType, targetDir, name) {
4499
- let templateDir;
3757
+ const packageName = getPackageName(templateType);
4500
3758
  const userEnv = UserEnvironment.getInstance();
4501
3759
  const pathsInfo = await userEnv.getPathInfo();
3760
+ let templateDir;
4502
3761
  if (process.env.NODE_ENV === "development" && pathsInfo.monorepoRoot) {
4503
3762
  logger6.debug(
4504
3763
  `Development mode: Using monorepo root at ${pathsInfo.monorepoRoot} to find templates.`
4505
3764
  );
4506
- templateDir = path6.resolve(
4507
- pathsInfo.monorepoRoot,
4508
- "packages",
4509
- templateType === "project" ? "project-starter" : "plugin-starter"
4510
- );
3765
+ templateDir = path6.resolve(pathsInfo.monorepoRoot, "packages", packageName);
4511
3766
  } else if (process.env.NODE_ENV === "development") {
4512
3767
  logger6.warn(
4513
3768
  "Development mode: monorepoRoot not found. Falling back to process.cwd() for template path. This might be unreliable."
4514
3769
  );
4515
- templateDir = path6.resolve(
4516
- process.cwd(),
4517
- "packages",
4518
- templateType === "project" ? "project-starter" : "plugin-starter"
4519
- );
3770
+ templateDir = path6.resolve(process.cwd(), "packages", packageName);
4520
3771
  } else {
4521
3772
  templateDir = path6.resolve(
4522
3773
  path6.dirname(__require.resolve("@elizaos/cli/package.json")),
4523
3774
  "templates",
4524
- templateType === "project" ? "project-starter" : "plugin-starter"
3775
+ packageName
4525
3776
  );
4526
3777
  }
4527
3778
  logger6.debug(`Copying ${templateType} template from ${templateDir} to ${targetDir}`);
@@ -5636,7 +4887,7 @@ async function getGitHubCredentials() {
5636
4887
  }
5637
4888
  logger8.warn("Invalid GitHub token found in environment variables");
5638
4889
  }
5639
- const { getGitHubToken: getGitHubToken3 } = await import("./registry-YU4WBPLU.js");
4890
+ const { getGitHubToken: getGitHubToken3 } = await import("./registry-RGSXW4LO.js");
5640
4891
  const token2 = await getGitHubToken3() || void 0;
5641
4892
  if (token2) {
5642
4893
  const isValid2 = await validateGitHubToken(token2);
@@ -6066,7 +5317,16 @@ Required configuration:
6066
5317
  headers,
6067
5318
  body: JSON.stringify(payload2)
6068
5319
  });
5320
+ if (!response2.ok) {
5321
+ const errorText = await response2.text();
5322
+ logger9.error(`Server returned ${response2.status}: ${errorText}`);
5323
+ return null;
5324
+ }
6069
5325
  const data2 = await response2.json();
5326
+ if (!data2?.data?.character?.name) {
5327
+ logger9.error(`Unexpected response format:`, data2);
5328
+ return null;
5329
+ }
6070
5330
  return data2.data.character.name;
6071
5331
  }
6072
5332
  if (options.path) {
@@ -6078,6 +5338,9 @@ Required configuration:
6078
5338
  const fileContent = fs9.readFileSync(filePath, "utf8");
6079
5339
  payload.characterJson = JSON.parse(fileContent);
6080
5340
  characterName = await createCharacter(payload);
5341
+ if (!characterName) {
5342
+ logger9.error("Failed to create character from file. Check server logs for details.");
5343
+ }
6081
5344
  } catch (error) {
6082
5345
  console.error("Error reading or parsing local JSON file:", error);
6083
5346
  throw new Error(`Failed to read or parse local JSON file: ${error.message}`);
@@ -6087,6 +5350,9 @@ Required configuration:
6087
5350
  try {
6088
5351
  payload.characterJson = JSON.parse(options.json);
6089
5352
  characterName = await createCharacter(payload);
5353
+ if (!characterName) {
5354
+ logger9.error("Failed to create character from JSON. Check server logs for details.");
5355
+ }
6090
5356
  } catch (error) {
6091
5357
  console.error("Error parsing JSON string:", error);
6092
5358
  throw new Error(`Failed to parse JSON string: ${error.message}`);
@@ -6099,6 +5365,11 @@ Required configuration:
6099
5365
  }
6100
5366
  payload.characterPath = options.remoteCharacter;
6101
5367
  characterName = await createCharacter(payload);
5368
+ if (!characterName) {
5369
+ logger9.error(
5370
+ "Failed to create character from remote URL. Check server logs for details."
5371
+ );
5372
+ }
6102
5373
  }
6103
5374
  if (options.name) {
6104
5375
  characterName = options.name;
@@ -6382,38 +5653,20 @@ async function readPackageJson(repository) {
6382
5653
  }
6383
5654
  return null;
6384
5655
  }
6385
- async function tryImporting(importPath, strategy, repository) {
5656
+ async function tryImporting(importPath, strategy, repository, silentFailure = false) {
6386
5657
  try {
6387
5658
  const module = await import(importPath);
6388
5659
  logger11.success(`Successfully loaded plugin '${repository}' using ${strategy} (${importPath})`);
6389
5660
  return module;
6390
5661
  } catch (error) {
6391
- logger11.debug(`Import failed using ${strategy} ('${importPath}'):`, error);
5662
+ if (!silentFailure) {
5663
+ logger11.debug(`Import failed using ${strategy} ('${importPath}'):`, error);
5664
+ }
6392
5665
  return null;
6393
5666
  }
6394
5667
  }
6395
5668
  var importStrategies = [
6396
- {
6397
- name: "direct path",
6398
- tryImport: async (repository) => tryImporting(repository, "direct path", repository)
6399
- },
6400
- {
6401
- name: "local node_modules",
6402
- tryImport: async (repository) => tryImporting(resolveNodeModulesPath(repository), "local node_modules", repository)
6403
- },
6404
- {
6405
- name: "global node_modules",
6406
- tryImport: async (repository) => {
6407
- const globalPath = path11.resolve(getGlobalNodeModulesPath(), repository);
6408
- if (!fs10.existsSync(path11.dirname(globalPath))) {
6409
- logger11.debug(
6410
- `Global node_modules directory not found at ${path11.dirname(globalPath)}, skipping for ${repository}`
6411
- );
6412
- return null;
6413
- }
6414
- return tryImporting(globalPath, "global node_modules", repository);
6415
- }
6416
- },
5669
+ // Most likely to succeed for installed packages - check package.json entry first
6417
5670
  {
6418
5671
  name: "package.json entry",
6419
5672
  tryImport: async (repository) => {
@@ -6423,10 +5676,12 @@ var importStrategies = [
6423
5676
  return tryImporting(
6424
5677
  resolveNodeModulesPath(repository, entryPoint),
6425
5678
  `package.json entry (${entryPoint})`,
6426
- repository
5679
+ repository,
5680
+ true
6427
5681
  );
6428
5682
  }
6429
5683
  },
5684
+ // Second most common - standard dist/index.js pattern
6430
5685
  {
6431
5686
  name: "common dist pattern",
6432
5687
  tryImport: async (repository) => {
@@ -6435,12 +5690,67 @@ var importStrategies = [
6435
5690
  return tryImporting(
6436
5691
  resolveNodeModulesPath(repository, DEFAULT_ENTRY_POINT),
6437
5692
  "common dist pattern",
6438
- repository
5693
+ repository,
5694
+ true
6439
5695
  );
6440
5696
  }
5697
+ },
5698
+ // Try local node_modules directory import (for packages without explicit entry)
5699
+ {
5700
+ name: "local node_modules",
5701
+ tryImport: async (repository) => tryImporting(resolveNodeModulesPath(repository), "local node_modules", repository, true)
5702
+ },
5703
+ // Direct path import (for relative/absolute paths)
5704
+ {
5705
+ name: "direct path",
5706
+ tryImport: async (repository) => tryImporting(repository, "direct path", repository, true)
5707
+ },
5708
+ // Least likely - global node_modules (usually for globally installed packages)
5709
+ {
5710
+ name: "global node_modules",
5711
+ tryImport: async (repository) => {
5712
+ const globalPath = path11.resolve(getGlobalNodeModulesPath(), repository);
5713
+ if (!fs10.existsSync(path11.dirname(globalPath))) {
5714
+ return null;
5715
+ }
5716
+ return tryImporting(globalPath, "global node_modules", repository, true);
5717
+ }
6441
5718
  }
6442
5719
  ];
5720
+ async function getOptimalStrategy(repository) {
5721
+ const packageJson = await readPackageJson(repository);
5722
+ if (packageJson) {
5723
+ const entryPoint = packageJson.module || packageJson.main || DEFAULT_ENTRY_POINT;
5724
+ const entryPath = resolveNodeModulesPath(repository, entryPoint);
5725
+ if (fs10.existsSync(entryPath)) {
5726
+ return {
5727
+ name: `package.json entry (${entryPoint})`,
5728
+ tryImport: async () => tryImporting(entryPath, `package.json entry (${entryPoint})`, repository)
5729
+ };
5730
+ }
5731
+ }
5732
+ const commonDistPath = resolveNodeModulesPath(repository, DEFAULT_ENTRY_POINT);
5733
+ if (fs10.existsSync(commonDistPath)) {
5734
+ return {
5735
+ name: "common dist pattern",
5736
+ tryImport: async () => tryImporting(commonDistPath, "common dist pattern", repository)
5737
+ };
5738
+ }
5739
+ const localNodeModulesPath = resolveNodeModulesPath(repository);
5740
+ if (fs10.existsSync(localNodeModulesPath)) {
5741
+ return {
5742
+ name: "local node_modules",
5743
+ tryImport: async () => tryImporting(localNodeModulesPath, "local node_modules", repository)
5744
+ };
5745
+ }
5746
+ return null;
5747
+ }
6443
5748
  async function loadPluginModule(repository) {
5749
+ const optimalStrategy = await getOptimalStrategy(repository);
5750
+ if (optimalStrategy) {
5751
+ const result = await optimalStrategy.tryImport(repository);
5752
+ if (result) return result;
5753
+ }
6444
5754
  for (const strategy of importStrategies) {
6445
5755
  const result = await strategy.tryImport(repository);
6446
5756
  if (result) return result;
@@ -7763,9 +7073,6 @@ export {
7763
7073
  promptAndStoreOpenAIKey,
7764
7074
  promptAndStoreAnthropicKey,
7765
7075
  configureDatabaseSettings,
7766
- require_ms,
7767
- require_supports_color,
7768
- require_src,
7769
7076
  REGISTRY_GITHUB_URL,
7770
7077
  ensureElizaDir2,
7771
7078
  getRegistrySettings,