@elizaos/cli 1.0.15 → 1.0.16
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/assets/{index-CYy-fwbh.js → index-BBiLesJT.js} +3 -3
- package/dist/assets/index-BBiLesJT.js.br +0 -0
- package/dist/assets/{index-CYy-fwbh.js.map → index-BBiLesJT.js.map} +1 -1
- package/dist/assets/index-DxW_jg81.css +1 -0
- package/dist/assets/index-DxW_jg81.css.br +0 -0
- package/dist/assets/{index-TE3LspKB.js → index-EfDd1Y35.js} +2103 -1818
- package/dist/assets/index-EfDd1Y35.js.br +0 -0
- package/dist/assets/{index-TE3LspKB.js.map → index-EfDd1Y35.js.map} +1 -1
- package/dist/assets/{vendor-DSdxb8P-.js → vendor-DS2z8upE.js} +2 -2
- package/dist/assets/vendor-DS2z8upE.js.br +0 -0
- package/dist/assets/{vendor-DSdxb8P-.js.map → vendor-DS2z8upE.js.map} +1 -1
- package/dist/{chunk-AZUBN22B.js → chunk-OK5O2MHJ.js} +503 -705
- package/dist/{chunk-OXZUNMVC.js → chunk-PRO6QOLZ.js} +175 -48
- package/dist/{chunk-BRDZOULQ.js → chunk-UVBNT4WP.js} +19 -6
- package/dist/{chunk-KB3JDWUI.js → chunk-W4NJVJQV.js} +43 -1
- package/dist/commands/agent/actions/index.js +2 -3
- package/dist/commands/agent/index.js +2 -3
- package/dist/commands/create/actions/index.d.ts +3 -0
- package/dist/commands/create/actions/index.js +3 -4
- package/dist/commands/create/index.js +4 -5
- package/dist/elizaos-avatar.png +0 -0
- package/dist/index.html +3 -3
- package/dist/index.js +1462 -381
- package/dist/migration-guides/advanced-migration-guide.md +459 -0
- package/dist/migration-guides/completion-requirements.md +379 -0
- package/dist/migration-guides/integrated-migration-loop.md +392 -0
- package/dist/migration-guides/migration-guide.md +712 -0
- package/dist/migration-guides/prompt-and-generation-guide.md +702 -0
- package/dist/migration-guides/state-and-providers-guide.md +544 -0
- package/dist/migration-guides/testing-guide.md +1021 -0
- package/dist/{plugin-creator-TLQLTQIB.js → plugin-creator-ZCOZ3UCT.js} +1 -2
- package/dist/{registry-BQSPZS3F.js → registry-FBPEGL2T.js} +2 -3
- package/dist/templates/project-starter/package.json +4 -4
- package/dist/templates/project-tee-starter/package.json +3 -3
- package/dist/{utils-BROS5JZQ.js → utils-I3EA43DE.js} +6 -19
- package/package.json +8 -6
- package/templates/project-starter/package.json +4 -4
- package/templates/project-tee-starter/package.json +3 -3
- package/dist/assets/index-CYy-fwbh.js.br +0 -0
- package/dist/assets/index-DzLbKTxV.css +0 -1
- package/dist/assets/index-DzLbKTxV.css.br +0 -0
- package/dist/assets/index-TE3LspKB.js.br +0 -0
- package/dist/assets/vendor-DSdxb8P-.js.br +0 -0
- package/dist/chunk-RIAWNDYI.js +0 -49
- package/dist/migrator-UQ4XFYE5.js +0 -744
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
buildProject,
|
|
7
7
|
copyTemplate,
|
|
8
8
|
ensureElizaDir,
|
|
9
|
+
getDisplayDirectory,
|
|
10
|
+
installPlugin,
|
|
9
11
|
promptAndStoreAnthropicKey,
|
|
10
12
|
promptAndStoreGoogleKey,
|
|
11
13
|
promptAndStoreOllamaConfig,
|
|
@@ -14,16 +16,23 @@ import {
|
|
|
14
16
|
promptAndStoreOpenRouterKey,
|
|
15
17
|
promptAndStorePostgresUrl,
|
|
16
18
|
setupPgLite
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
runBunCommand
|
|
20
|
-
} from "./chunk-RIAWNDYI.js";
|
|
19
|
+
} from "./chunk-OK5O2MHJ.js";
|
|
21
20
|
|
|
22
21
|
// src/characters/eliza.ts
|
|
22
|
+
import { existsSync, readFileSync } from "fs";
|
|
23
|
+
import { resolve, dirname } from "path";
|
|
24
|
+
import { fileURLToPath } from "url";
|
|
25
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
26
|
+
var __dirname = dirname(__filename);
|
|
27
|
+
var imagePath = resolve(__dirname, "./elizaos-avatar.png");
|
|
28
|
+
var avatar = existsSync(imagePath) ? `data:image/png;base64,${readFileSync(imagePath).toString("base64")}` : "";
|
|
23
29
|
var baseCharacter = {
|
|
24
30
|
name: "Eliza",
|
|
25
31
|
plugins: ["@elizaos/plugin-sql", "@elizaos/plugin-bootstrap"],
|
|
26
32
|
secrets: {},
|
|
33
|
+
settings: {
|
|
34
|
+
avatar
|
|
35
|
+
},
|
|
27
36
|
system: "Respond to all messages in a helpful, conversational manner. Provide assistance on a wide range of topics, using knowledge when needed. Be concise but thorough, friendly but professional. Use humor when appropriate and be empathetic to user needs. Provide valuable information and insights when questions are asked.",
|
|
28
37
|
bio: [
|
|
29
38
|
"Engages with all types of questions and conversations",
|
|
@@ -228,7 +237,7 @@ import * as clack2 from "@clack/prompts";
|
|
|
228
237
|
import colors from "yoctocolors";
|
|
229
238
|
|
|
230
239
|
// src/commands/create/utils/validation.ts
|
|
231
|
-
import { existsSync } from "fs";
|
|
240
|
+
import { existsSync as existsSync2 } from "fs";
|
|
232
241
|
import fs from "fs/promises";
|
|
233
242
|
import { z as z2 } from "zod";
|
|
234
243
|
|
|
@@ -310,7 +319,7 @@ function processPluginName(name) {
|
|
|
310
319
|
}
|
|
311
320
|
async function validateTargetDirectory(targetDir) {
|
|
312
321
|
try {
|
|
313
|
-
if (!
|
|
322
|
+
if (!existsSync2(targetDir)) {
|
|
314
323
|
return { isValid: true };
|
|
315
324
|
}
|
|
316
325
|
const entries = await fs.readdir(targetDir);
|
|
@@ -456,8 +465,9 @@ async function selectEmbeddingModel() {
|
|
|
456
465
|
}
|
|
457
466
|
|
|
458
467
|
// src/commands/create/actions/setup.ts
|
|
459
|
-
import { existsSync as
|
|
468
|
+
import { existsSync as existsSync3 } from "fs";
|
|
460
469
|
import fs2 from "fs/promises";
|
|
470
|
+
import { execa } from "execa";
|
|
461
471
|
async function createProjectDirectories(targetDir) {
|
|
462
472
|
await ensureElizaDir(targetDir);
|
|
463
473
|
}
|
|
@@ -471,7 +481,7 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
471
481
|
case "openai": {
|
|
472
482
|
if (isNonInteractive) {
|
|
473
483
|
let content = "";
|
|
474
|
-
if (
|
|
484
|
+
if (existsSync3(envFilePath)) {
|
|
475
485
|
content = await fs2.readFile(envFilePath, "utf8");
|
|
476
486
|
}
|
|
477
487
|
if (content && !content.endsWith("\n")) {
|
|
@@ -491,7 +501,7 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
491
501
|
case "claude": {
|
|
492
502
|
if (isNonInteractive) {
|
|
493
503
|
let content = "";
|
|
494
|
-
if (
|
|
504
|
+
if (existsSync3(envFilePath)) {
|
|
495
505
|
content = await fs2.readFile(envFilePath, "utf8");
|
|
496
506
|
}
|
|
497
507
|
if (content && !content.endsWith("\n")) {
|
|
@@ -511,7 +521,7 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
511
521
|
case "openrouter": {
|
|
512
522
|
if (isNonInteractive) {
|
|
513
523
|
let content = "";
|
|
514
|
-
if (
|
|
524
|
+
if (existsSync3(envFilePath)) {
|
|
515
525
|
content = await fs2.readFile(envFilePath, "utf8");
|
|
516
526
|
}
|
|
517
527
|
if (content && !content.endsWith("\n")) {
|
|
@@ -531,7 +541,7 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
531
541
|
case "ollama": {
|
|
532
542
|
if (isNonInteractive) {
|
|
533
543
|
let content = "";
|
|
534
|
-
if (
|
|
544
|
+
if (existsSync3(envFilePath)) {
|
|
535
545
|
content = await fs2.readFile(envFilePath, "utf8");
|
|
536
546
|
}
|
|
537
547
|
if (content && !content.endsWith("\n")) {
|
|
@@ -553,7 +563,7 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
553
563
|
case "google": {
|
|
554
564
|
if (isNonInteractive) {
|
|
555
565
|
let content = "";
|
|
556
|
-
if (
|
|
566
|
+
if (existsSync3(envFilePath)) {
|
|
557
567
|
content = await fs2.readFile(envFilePath, "utf8");
|
|
558
568
|
}
|
|
559
569
|
if (content && !content.endsWith("\n")) {
|
|
@@ -589,7 +599,7 @@ function hasValidApiKey(content, keyName) {
|
|
|
589
599
|
async function setupEmbeddingModelConfig(embeddingModel, envFilePath, isNonInteractive = false) {
|
|
590
600
|
try {
|
|
591
601
|
let content = "";
|
|
592
|
-
if (
|
|
602
|
+
if (existsSync3(envFilePath)) {
|
|
593
603
|
content = await fs2.readFile(envFilePath, "utf8");
|
|
594
604
|
}
|
|
595
605
|
if (content && !content.endsWith("\n")) {
|
|
@@ -686,13 +696,52 @@ async function setupEmbeddingModelConfig(embeddingModel, envFilePath, isNonInter
|
|
|
686
696
|
console.error(`Failed to set up embedding model configuration: ${errorMessage}`);
|
|
687
697
|
}
|
|
688
698
|
}
|
|
699
|
+
function resolveModelToPlugin(modelName) {
|
|
700
|
+
const modelToPlugin = {
|
|
701
|
+
openai: "openai",
|
|
702
|
+
claude: "anthropic",
|
|
703
|
+
anthropic: "anthropic",
|
|
704
|
+
openrouter: "openrouter",
|
|
705
|
+
ollama: "ollama",
|
|
706
|
+
google: "google"
|
|
707
|
+
};
|
|
708
|
+
return modelToPlugin[modelName] || null;
|
|
709
|
+
}
|
|
710
|
+
async function installModelPlugin(modelName, targetDir, purpose = "") {
|
|
711
|
+
const pluginName = resolveModelToPlugin(modelName);
|
|
712
|
+
if (!pluginName) {
|
|
713
|
+
console.warn(`\u26A0\uFE0F Unknown model: ${modelName}, skipping plugin installation`);
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const purposeText = purpose ? ` ${purpose}` : "";
|
|
717
|
+
try {
|
|
718
|
+
console.info(`
|
|
719
|
+
\u{1F4E6} Installing ${pluginName} plugin${purposeText}...`);
|
|
720
|
+
await installPlugin(pluginName, targetDir);
|
|
721
|
+
console.info(`\u2705 Installed plugin successfully!`);
|
|
722
|
+
} catch (error) {
|
|
723
|
+
console.warn(
|
|
724
|
+
`\u26A0\uFE0F Could not install plugin automatically: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
725
|
+
);
|
|
726
|
+
console.info(`\u{1F4A1} You can install it manually with: elizaos plugins add ${pluginName}`);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
689
729
|
async function installDependencies(targetDir) {
|
|
690
730
|
if (process.env.CI === "true" || process.env.ELIZA_TEST_MODE === "true") {
|
|
691
731
|
console.info("Skipping dependency installation in CI/test environment...");
|
|
692
732
|
return;
|
|
693
733
|
}
|
|
694
734
|
console.info("Installing dependencies...");
|
|
695
|
-
await
|
|
735
|
+
const subprocess = await execa("bun", ["install"], {
|
|
736
|
+
cwd: targetDir,
|
|
737
|
+
stdio: "inherit",
|
|
738
|
+
reject: false
|
|
739
|
+
});
|
|
740
|
+
const exitCode = subprocess.exitCode;
|
|
741
|
+
const isSignalTermination = exitCode == null || exitCode >= 128;
|
|
742
|
+
if (exitCode !== 0 && !isSignalTermination) {
|
|
743
|
+
throw new Error(`Dependency installation failed with exit code ${exitCode}`);
|
|
744
|
+
}
|
|
696
745
|
}
|
|
697
746
|
async function setupProjectEnvironment(targetDir, database, aiModel, embeddingModel, isNonInteractive = false) {
|
|
698
747
|
await createProjectDirectories(targetDir);
|
|
@@ -706,9 +755,65 @@ async function setupProjectEnvironment(targetDir, database, aiModel, embeddingMo
|
|
|
706
755
|
if (embeddingModel) {
|
|
707
756
|
await setupEmbeddingModelConfig(embeddingModel, envFilePath, isNonInteractive);
|
|
708
757
|
}
|
|
758
|
+
if (aiModel !== "local") {
|
|
759
|
+
await installModelPlugin(aiModel, targetDir);
|
|
760
|
+
}
|
|
761
|
+
if (embeddingModel && embeddingModel !== "local") {
|
|
762
|
+
const aiPluginName = resolveModelToPlugin(aiModel);
|
|
763
|
+
const embeddingPluginName = resolveModelToPlugin(embeddingModel);
|
|
764
|
+
if (embeddingPluginName && embeddingPluginName !== aiPluginName) {
|
|
765
|
+
await installModelPlugin(embeddingModel, targetDir, "for embeddings");
|
|
766
|
+
}
|
|
767
|
+
}
|
|
709
768
|
}
|
|
710
769
|
|
|
711
770
|
// src/commands/create/actions/creators.ts
|
|
771
|
+
import { existsSync as existsSync4, rmSync } from "fs";
|
|
772
|
+
async function withCleanupOnInterrupt(targetDir, displayName, fn) {
|
|
773
|
+
const directoryExistedBefore = existsSync4(targetDir);
|
|
774
|
+
const cleanup = () => {
|
|
775
|
+
if (!directoryExistedBefore && existsSync4(targetDir)) {
|
|
776
|
+
console.info(colors.red(`
|
|
777
|
+
|
|
778
|
+
Interrupted! Cleaning up ${displayName}...`));
|
|
779
|
+
try {
|
|
780
|
+
rmSync(targetDir, { recursive: true, force: true });
|
|
781
|
+
console.info("Cleanup completed.");
|
|
782
|
+
} catch (error) {
|
|
783
|
+
console.error(colors.red("Error during cleanup:"), error);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
const sigintHandler = () => {
|
|
788
|
+
process.exit(130);
|
|
789
|
+
};
|
|
790
|
+
const sigtermHandler = () => {
|
|
791
|
+
process.exit(143);
|
|
792
|
+
};
|
|
793
|
+
process.on("exit", cleanup);
|
|
794
|
+
process.on("SIGINT", sigintHandler);
|
|
795
|
+
process.on("SIGTERM", sigtermHandler);
|
|
796
|
+
try {
|
|
797
|
+
const result = await fn();
|
|
798
|
+
process.removeListener("exit", cleanup);
|
|
799
|
+
process.removeListener("SIGINT", sigintHandler);
|
|
800
|
+
process.removeListener("SIGTERM", sigtermHandler);
|
|
801
|
+
return result;
|
|
802
|
+
} catch (error) {
|
|
803
|
+
process.removeListener("exit", cleanup);
|
|
804
|
+
process.removeListener("SIGINT", sigintHandler);
|
|
805
|
+
process.removeListener("SIGTERM", sigtermHandler);
|
|
806
|
+
if (!directoryExistedBefore && existsSync4(targetDir)) {
|
|
807
|
+
try {
|
|
808
|
+
console.info(colors.red(`
|
|
809
|
+
Cleaning up due to error...`));
|
|
810
|
+
rmSync(targetDir, { recursive: true, force: true });
|
|
811
|
+
} catch (cleanupError) {
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
throw error;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
712
817
|
async function createPlugin(pluginName, targetDir, isNonInteractive = false) {
|
|
713
818
|
const nameResult = processPluginName(pluginName);
|
|
714
819
|
if (!nameResult.isValid) {
|
|
@@ -722,24 +827,27 @@ async function createPlugin(pluginName, targetDir, isNonInteractive = false) {
|
|
|
722
827
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
723
828
|
}
|
|
724
829
|
if (!isNonInteractive) {
|
|
830
|
+
const displayDir = getDisplayDirectory(targetDir);
|
|
725
831
|
const confirmCreate = await clack2.confirm({
|
|
726
|
-
message: `Create plugin "${pluginDirName}" in ${
|
|
832
|
+
message: `Create plugin "${pluginDirName}" in ${displayDir}?`
|
|
727
833
|
});
|
|
728
834
|
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
729
835
|
clack2.cancel("Plugin creation cancelled.");
|
|
730
836
|
process.exit(0);
|
|
731
837
|
}
|
|
732
838
|
}
|
|
733
|
-
await
|
|
734
|
-
|
|
735
|
-
|
|
839
|
+
await withCleanupOnInterrupt(pluginTargetDir, pluginDirName, async () => {
|
|
840
|
+
await copyTemplate("plugin", pluginTargetDir);
|
|
841
|
+
await installDependencies(pluginTargetDir);
|
|
842
|
+
console.info(`
|
|
736
843
|
${colors.green("\u2713")} Plugin "${pluginDirName}" created successfully!`);
|
|
737
|
-
|
|
844
|
+
console.info(`
|
|
738
845
|
Next steps:`);
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
846
|
+
console.info(` cd ${pluginDirName}`);
|
|
847
|
+
console.info(` bun run build`);
|
|
848
|
+
console.info(` bun run test
|
|
742
849
|
`);
|
|
850
|
+
});
|
|
743
851
|
}
|
|
744
852
|
async function createAgent(agentName, targetDir, isNonInteractive = false) {
|
|
745
853
|
const agentFilePath = join(targetDir, `${agentName}.json`);
|
|
@@ -752,8 +860,9 @@ async function createAgent(agentName, targetDir, isNonInteractive = false) {
|
|
|
752
860
|
}
|
|
753
861
|
}
|
|
754
862
|
if (!isNonInteractive) {
|
|
863
|
+
const displayDir = getDisplayDirectory(targetDir);
|
|
755
864
|
const confirmCreate = await clack2.confirm({
|
|
756
|
-
message: `Create agent "${agentName}"
|
|
865
|
+
message: `Create agent "${agentName}" in ${displayDir}?`
|
|
757
866
|
});
|
|
758
867
|
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
759
868
|
clack2.cancel("Agent creation cancelled.");
|
|
@@ -786,25 +895,34 @@ async function createTEEProject(projectName, targetDir, database, aiModel, embed
|
|
|
786
895
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
787
896
|
}
|
|
788
897
|
if (!isNonInteractive) {
|
|
898
|
+
const displayDir = getDisplayDirectory(targetDir);
|
|
789
899
|
const confirmCreate = await clack2.confirm({
|
|
790
|
-
message: `Create TEE project "${projectName}" in ${
|
|
900
|
+
message: `Create TEE project "${projectName}" in ${displayDir}?`
|
|
791
901
|
});
|
|
792
902
|
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
793
903
|
clack2.cancel("TEE project creation cancelled.");
|
|
794
904
|
process.exit(0);
|
|
795
905
|
}
|
|
796
906
|
}
|
|
797
|
-
await
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
907
|
+
await withCleanupOnInterrupt(teeTargetDir, projectName, async () => {
|
|
908
|
+
await copyTemplate("project-tee-starter", teeTargetDir);
|
|
909
|
+
await setupProjectEnvironment(
|
|
910
|
+
teeTargetDir,
|
|
911
|
+
database,
|
|
912
|
+
aiModel,
|
|
913
|
+
embeddingModel,
|
|
914
|
+
isNonInteractive
|
|
915
|
+
);
|
|
916
|
+
await installDependencies(teeTargetDir);
|
|
917
|
+
await buildProject(teeTargetDir, false);
|
|
918
|
+
console.info(`
|
|
802
919
|
${colors.green("\u2713")} TEE project "${projectName}" created successfully!`);
|
|
803
|
-
|
|
920
|
+
console.info(`
|
|
804
921
|
Next steps:`);
|
|
805
|
-
|
|
806
|
-
|
|
922
|
+
console.info(` cd ${projectName}`);
|
|
923
|
+
console.info(` bun run dev
|
|
807
924
|
`);
|
|
925
|
+
});
|
|
808
926
|
}
|
|
809
927
|
async function createProject(projectName, targetDir, database, aiModel, embeddingModel, isNonInteractive = false) {
|
|
810
928
|
const projectTargetDir = projectName === "." ? targetDir : join(targetDir, projectName);
|
|
@@ -813,32 +931,41 @@ async function createProject(projectName, targetDir, database, aiModel, embeddin
|
|
|
813
931
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
814
932
|
}
|
|
815
933
|
if (!isNonInteractive) {
|
|
934
|
+
const displayDir = getDisplayDirectory(targetDir);
|
|
935
|
+
const displayProjectName = projectName === "." ? "project" : `project "${projectName}"`;
|
|
816
936
|
const confirmCreate = await clack2.confirm({
|
|
817
|
-
message: `Create
|
|
937
|
+
message: `Create ${displayProjectName} in ${displayDir}?`
|
|
818
938
|
});
|
|
819
939
|
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
820
940
|
clack2.cancel("Project creation cancelled.");
|
|
821
941
|
process.exit(0);
|
|
822
942
|
}
|
|
823
943
|
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
944
|
+
const createFn = async () => {
|
|
945
|
+
await copyTemplate("project-starter", projectTargetDir);
|
|
946
|
+
await setupProjectEnvironment(
|
|
947
|
+
projectTargetDir,
|
|
948
|
+
database,
|
|
949
|
+
aiModel,
|
|
950
|
+
embeddingModel,
|
|
951
|
+
isNonInteractive
|
|
952
|
+
);
|
|
953
|
+
await installDependencies(projectTargetDir);
|
|
954
|
+
await buildProject(projectTargetDir, false);
|
|
955
|
+
const displayName = projectName === "." ? "Project" : `Project "${projectName}"`;
|
|
956
|
+
console.info(`
|
|
836
957
|
${colors.green("\u2713")} ${displayName} initialized successfully!`);
|
|
837
|
-
|
|
958
|
+
console.info(`
|
|
838
959
|
Next steps:`);
|
|
839
|
-
|
|
840
|
-
|
|
960
|
+
console.info(` cd ${projectName}`);
|
|
961
|
+
console.info(` bun run dev
|
|
841
962
|
`);
|
|
963
|
+
};
|
|
964
|
+
if (projectName === ".") {
|
|
965
|
+
await createFn();
|
|
966
|
+
} else {
|
|
967
|
+
await withCleanupOnInterrupt(projectTargetDir, projectName, createFn);
|
|
968
|
+
}
|
|
842
969
|
}
|
|
843
970
|
|
|
844
971
|
export {
|
|
@@ -12,18 +12,22 @@ import {
|
|
|
12
12
|
selectEmbeddingModel,
|
|
13
13
|
validateCreateOptions,
|
|
14
14
|
validateProjectName
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PRO6QOLZ.js";
|
|
16
16
|
import {
|
|
17
17
|
displayBanner,
|
|
18
18
|
handleError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OK5O2MHJ.js";
|
|
20
20
|
|
|
21
21
|
// src/commands/create/index.ts
|
|
22
22
|
import { Command } from "commander";
|
|
23
23
|
import * as clack from "@clack/prompts";
|
|
24
24
|
import colors from "yoctocolors";
|
|
25
25
|
import { logger } from "@elizaos/core";
|
|
26
|
+
function formatProjectType(type) {
|
|
27
|
+
return type === "tee" ? "TEE Project" : type.charAt(0).toUpperCase() + type.slice(1);
|
|
28
|
+
}
|
|
26
29
|
var create = new Command("create").description("Create a new ElizaOS project, plugin, agent, or TEE project").argument("[name]", "name of the project/plugin/agent to create").option("--dir <dir>", "directory to create the project in", ".").option("--yes, -y", "skip prompts and use defaults").option("--type <type>", "type of project to create (project, plugin, agent, tee)", "project").action(async (name, opts) => {
|
|
30
|
+
let projectType;
|
|
27
31
|
try {
|
|
28
32
|
if (process.env.ELIZA_NONINTERACTIVE === "1" || process.env.ELIZA_NONINTERACTIVE === "true" || process.argv.includes("-y") || process.argv.includes("--yes")) {
|
|
29
33
|
if (opts) {
|
|
@@ -36,9 +40,8 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
36
40
|
const isNonInteractive = options.yes;
|
|
37
41
|
if (!isNonInteractive) {
|
|
38
42
|
await displayBanner();
|
|
39
|
-
clack.intro(colors.inverse(" Creating ElizaOS Project "));
|
|
40
43
|
}
|
|
41
|
-
|
|
44
|
+
projectType = options.type;
|
|
42
45
|
let projectName = name;
|
|
43
46
|
if (!projectName) {
|
|
44
47
|
if (!isNonInteractive) {
|
|
@@ -74,6 +77,10 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
74
77
|
}
|
|
75
78
|
projectType = selectedType;
|
|
76
79
|
}
|
|
80
|
+
if (!isNonInteractive) {
|
|
81
|
+
const introType = formatProjectType(projectType);
|
|
82
|
+
clack.intro(colors.inverse(` Creating ElizaOS ${introType} `));
|
|
83
|
+
}
|
|
77
84
|
if (!isNonInteractive) {
|
|
78
85
|
const nameInput = await clack.text({
|
|
79
86
|
message: `What is the name of your ${projectType}?`,
|
|
@@ -102,6 +109,10 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
102
109
|
throw new Error(nameValidation.error);
|
|
103
110
|
}
|
|
104
111
|
}
|
|
112
|
+
if (!isNonInteractive && name) {
|
|
113
|
+
const introType = formatProjectType(projectType);
|
|
114
|
+
clack.intro(colors.inverse(` Creating ElizaOS ${introType} `));
|
|
115
|
+
}
|
|
105
116
|
const targetDir = options.dir;
|
|
106
117
|
switch (projectType) {
|
|
107
118
|
case "plugin":
|
|
@@ -155,11 +166,13 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
155
166
|
}
|
|
156
167
|
}
|
|
157
168
|
if (!isNonInteractive) {
|
|
158
|
-
|
|
169
|
+
const typeLabel = formatProjectType(projectType);
|
|
170
|
+
clack.outro(colors.green(`${typeLabel} created successfully! \u{1F389}`));
|
|
159
171
|
}
|
|
160
172
|
} catch (error) {
|
|
161
173
|
if (!opts?.yes) {
|
|
162
|
-
|
|
174
|
+
const errorType = formatProjectType(projectType || "project");
|
|
175
|
+
clack.cancel(`Failed to create ${errorType}.`);
|
|
163
176
|
}
|
|
164
177
|
logger.error("Create command failed:", error);
|
|
165
178
|
handleError(error);
|
|
@@ -100,7 +100,49 @@ function initializeEmojiSupport() {
|
|
|
100
100
|
}
|
|
101
101
|
initializeEmojiSupport();
|
|
102
102
|
|
|
103
|
+
// src/utils/run-bun.ts
|
|
104
|
+
import { execa } from "execa";
|
|
105
|
+
|
|
106
|
+
// src/utils/bun-installation-helper.ts
|
|
107
|
+
import { logger as logger2 } from "@elizaos/core";
|
|
108
|
+
function displayBunInstallationTipCompact() {
|
|
109
|
+
const platform = process.platform;
|
|
110
|
+
if (platform === "win32") {
|
|
111
|
+
return 'Install bun: powershell -c "irm bun.sh/install.ps1 | iex" (see https://bun.sh/docs/installation)';
|
|
112
|
+
} else {
|
|
113
|
+
return "Install bun: curl -fsSL https://bun.sh/install | bash (see https://bun.sh/docs/installation)";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/utils/run-bun.ts
|
|
118
|
+
async function runBunCommand(args, cwd) {
|
|
119
|
+
const finalArgs = [...args];
|
|
120
|
+
const isInstallCommand = args[0] === "install";
|
|
121
|
+
const isCI = process.env.CI || process.env.ELIZA_TEST_MODE === "true";
|
|
122
|
+
if (isCI && isInstallCommand) {
|
|
123
|
+
if (!finalArgs.includes("--frozen-lockfile")) {
|
|
124
|
+
finalArgs.push("--frozen-lockfile");
|
|
125
|
+
}
|
|
126
|
+
console.info("\u2705 Using CI-optimized flags for faster installation...");
|
|
127
|
+
}
|
|
128
|
+
try {
|
|
129
|
+
await execa("bun", finalArgs, { cwd, stdio: "inherit" });
|
|
130
|
+
} catch (error) {
|
|
131
|
+
if (error.code === "ENOENT" || error.message?.includes("bun: command not found")) {
|
|
132
|
+
throw new Error(`Bun command not found. ${displayBunInstallationTipCompact()}`);
|
|
133
|
+
}
|
|
134
|
+
if (isCI && isInstallCommand && (error.message?.includes("frozen-lockfile") || error.message?.includes("install"))) {
|
|
135
|
+
console.warn("CI-optimized install failed, retrying with basic args...");
|
|
136
|
+
await execa("bun", args, { cwd, stdio: "inherit" });
|
|
137
|
+
} else {
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
103
143
|
export {
|
|
104
144
|
configureEmojis,
|
|
105
|
-
emoji
|
|
145
|
+
emoji,
|
|
146
|
+
displayBunInstallationTipCompact,
|
|
147
|
+
runBunCommand
|
|
106
148
|
};
|
|
@@ -9,9 +9,8 @@ import {
|
|
|
9
9
|
setAgentConfig,
|
|
10
10
|
startAgent,
|
|
11
11
|
stopAgent
|
|
12
|
-
} from "../../../chunk-
|
|
13
|
-
import "../../../chunk-
|
|
14
|
-
import "../../../chunk-KB3JDWUI.js";
|
|
12
|
+
} from "../../../chunk-OK5O2MHJ.js";
|
|
13
|
+
import "../../../chunk-W4NJVJQV.js";
|
|
15
14
|
import "../../../chunk-F24MS2YR.js";
|
|
16
15
|
import "../../../chunk-AQ6OMR2A.js";
|
|
17
16
|
export {
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
agent,
|
|
7
7
|
getAgents,
|
|
8
8
|
resolveAgentId
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-KB3JDWUI.js";
|
|
9
|
+
} from "../../chunk-OK5O2MHJ.js";
|
|
10
|
+
import "../../chunk-W4NJVJQV.js";
|
|
12
11
|
import {
|
|
13
12
|
getAgentRuntimeUrl,
|
|
14
13
|
getAgentsBaseUrl
|
|
@@ -29,6 +29,9 @@ declare function setupAIModelConfig(aiModel: string, envFilePath: string, isNonI
|
|
|
29
29
|
declare function setupEmbeddingModelConfig(embeddingModel: string, envFilePath: string, isNonInteractive?: boolean): Promise<void>;
|
|
30
30
|
/**
|
|
31
31
|
* Installs dependencies for the specified target directory.
|
|
32
|
+
*
|
|
33
|
+
* note: cleanup on ctrl-c is handled by the calling function (creators.ts)
|
|
34
|
+
* we use stdio: 'inherit' here so the user sees the install progress in real-time
|
|
32
35
|
*/
|
|
33
36
|
declare function installDependencies(targetDir: string): Promise<void>;
|
|
34
37
|
/**
|
|
@@ -12,10 +12,9 @@ import {
|
|
|
12
12
|
setupAIModelConfig,
|
|
13
13
|
setupEmbeddingModelConfig,
|
|
14
14
|
setupProjectEnvironment
|
|
15
|
-
} from "../../../chunk-
|
|
16
|
-
import "../../../chunk-
|
|
17
|
-
import "../../../chunk-
|
|
18
|
-
import "../../../chunk-KB3JDWUI.js";
|
|
15
|
+
} from "../../../chunk-PRO6QOLZ.js";
|
|
16
|
+
import "../../../chunk-OK5O2MHJ.js";
|
|
17
|
+
import "../../../chunk-W4NJVJQV.js";
|
|
19
18
|
import "../../../chunk-F24MS2YR.js";
|
|
20
19
|
import "../../../chunk-AQ6OMR2A.js";
|
|
21
20
|
export {
|
|
@@ -4,11 +4,10 @@ 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-KB3JDWUI.js";
|
|
7
|
+
} from "../../chunk-UVBNT4WP.js";
|
|
8
|
+
import "../../chunk-PRO6QOLZ.js";
|
|
9
|
+
import "../../chunk-OK5O2MHJ.js";
|
|
10
|
+
import "../../chunk-W4NJVJQV.js";
|
|
12
11
|
import "../../chunk-F24MS2YR.js";
|
|
13
12
|
import "../../chunk-AQ6OMR2A.js";
|
|
14
13
|
export {
|
|
Binary file
|
package/dist/index.html
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
7
7
|
<title>ElizaOS - Client</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-EfDd1Y35.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-DS2z8upE.js">
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DxW_jg81.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|