@elizaos/cli 1.0.8 → 1.0.10
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/README.md +9 -16
- package/dist/assets/{index-CZAd5zm2.js → index-CmuPnu0u.js} +72 -89
- package/dist/assets/index-CmuPnu0u.js.br +0 -0
- package/dist/assets/index-CmuPnu0u.js.map +1 -0
- package/dist/assets/{index-CaEsCLCC.js → index-DDQnwxzL.js} +28798 -16391
- package/dist/assets/{index-CaEsCLCC.js.map → index-DDQnwxzL.js.map} +1 -1
- package/dist/assets/index-Df1AFSuJ.css +1 -0
- package/dist/assets/index-Df1AFSuJ.css.br +0 -0
- package/dist/assets/vendor-DSdxb8P-.js.map +1 -1
- package/dist/{chunk-REBZFQYE.js → chunk-7HYEGM5V.js} +967 -1597
- package/dist/{chunk-W3HS2NP6.js → chunk-B4KJXECB.js} +13 -18
- package/dist/{chunk-33BHGAF7.js → chunk-GWQB7PBK.js} +59 -32
- package/dist/{chunk-CVADLFW6.js → chunk-LQ6XHF53.js} +4543 -3043
- package/dist/{chunk-GYTAJJOD.js → chunk-RIAWNDYI.js} +16 -2
- package/dist/{chunk-IEKLJDUU.js → chunk-WS4DWCDZ.js} +54 -32
- package/dist/commands/agent/actions/index.d.ts +5 -1
- package/dist/commands/agent/actions/index.js +5 -4
- package/dist/commands/agent/index.js +3 -4
- package/dist/commands/create/actions/index.js +4 -5
- package/dist/commands/create/index.js +5 -6
- package/dist/{fileFromPath-DCRQMDLJ.js → fileFromPath-KB6XMTJ4.js} +1 -0
- package/dist/index.html +2 -2
- package/dist/index.js +9346 -102098
- package/dist/{migrator-KZLCVEIH.js → migrator-JREQPDN3.js} +42 -220
- package/dist/pglite.data +0 -0
- package/dist/pglite.wasm +0 -0
- package/dist/plugin-creator-T4K2673C.js +910 -0
- package/dist/{registry-XFOSZFU4.js → registry-CBMRMYCG.js} +3 -4
- package/dist/templates/plugin-starter/README.md +255 -0
- package/dist/templates/plugin-starter/bunfig.toml +6 -0
- package/dist/templates/plugin-starter/cypress.config.ts +18 -0
- package/dist/templates/plugin-starter/index.html +13 -0
- package/dist/templates/plugin-starter/package.json +95 -0
- package/dist/templates/plugin-starter/postcss.config.js +3 -0
- package/dist/templates/plugin-starter/scripts/test-e2e-manual.js +201 -0
- package/dist/templates/plugin-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +404 -0
- package/dist/templates/plugin-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +287 -0
- package/dist/templates/plugin-starter/src/__tests__/cypress/support/commands.ts +38 -0
- package/dist/templates/plugin-starter/src/__tests__/cypress/support/component-index.html +11 -0
- package/dist/templates/plugin-starter/src/__tests__/cypress/support/component.ts +33 -0
- package/dist/templates/plugin-starter/src/__tests__/cypress/support/e2e.ts +11 -0
- package/dist/templates/plugin-starter/src/__tests__/cypress/tsconfig.json +10 -0
- package/dist/templates/plugin-starter/src/__tests__/e2e/README.md +47 -0
- package/dist/templates/plugin-starter/src/__tests__/e2e/starter-plugin.ts +320 -0
- package/{templates/plugin-starter → dist/templates/plugin-starter/src}/__tests__/integration.test.ts +22 -17
- package/{templates/plugin-starter → dist/templates/plugin-starter/src}/__tests__/plugin.test.ts +8 -8
- package/{templates/plugin-starter → dist/templates/plugin-starter/src}/__tests__/test-utils.ts +17 -17
- package/dist/templates/plugin-starter/src/frontend/index.css +77 -0
- package/dist/templates/plugin-starter/src/frontend/index.tsx +164 -0
- package/dist/templates/plugin-starter/src/frontend/utils.ts +6 -0
- package/dist/templates/plugin-starter/src/index.ts +274 -0
- package/dist/templates/plugin-starter/src/tests.ts +6 -0
- package/dist/templates/plugin-starter/tailwind.config.js +62 -0
- package/dist/templates/plugin-starter/tsconfig.build.json +11 -0
- package/dist/templates/plugin-starter/tsconfig.json +28 -0
- package/dist/templates/plugin-starter/tsup.config.ts +20 -0
- package/dist/templates/plugin-starter/vite.config.ts +20 -0
- package/dist/templates/project-starter/.env.example +153 -0
- package/dist/templates/project-starter/README.md +109 -0
- package/dist/templates/project-starter/bunfig.toml +6 -0
- package/dist/templates/project-starter/cypress.config.ts +31 -0
- package/dist/templates/project-starter/index.html +13 -0
- package/dist/templates/project-starter/package.json +83 -0
- package/dist/templates/project-starter/postcss.config.js +3 -0
- package/dist/templates/project-starter/scripts/test-all.sh +101 -0
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/actions.test.ts +6 -6
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/character.test.ts +3 -3
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/config.test.ts +18 -18
- package/dist/templates/project-starter/src/__tests__/cypress/component/Accessibility.cy.tsx +271 -0
- package/dist/templates/project-starter/src/__tests__/cypress/component/ApiIntegration.cy.tsx +220 -0
- package/dist/templates/project-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +146 -0
- package/dist/templates/project-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +51 -0
- package/dist/templates/project-starter/src/__tests__/cypress/e2e/agent-chat.cy.ts +235 -0
- package/dist/templates/project-starter/src/__tests__/cypress/e2e/dashboard.cy.ts +146 -0
- package/dist/templates/project-starter/src/__tests__/cypress/e2e/user-workflow.cy.ts +257 -0
- package/dist/templates/project-starter/src/__tests__/cypress/support/commands.ts +44 -0
- package/dist/templates/project-starter/src/__tests__/cypress/support/component-index.html +11 -0
- package/dist/templates/project-starter/src/__tests__/cypress/support/component.ts +33 -0
- package/dist/templates/project-starter/src/__tests__/cypress/support/e2e.ts +179 -0
- package/dist/templates/project-starter/src/__tests__/e2e/index.ts +14 -0
- package/dist/templates/project-starter/src/__tests__/e2e/natural-language.test.ts +246 -0
- package/dist/templates/project-starter/src/__tests__/e2e/project.test.ts +155 -0
- package/dist/templates/project-starter/src/__tests__/e2e/starter-plugin.test.ts +421 -0
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/env.test.ts +2 -2
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/error-handling.test.ts +17 -17
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/events.test.ts +7 -7
- package/dist/templates/project-starter/src/__tests__/file-structure.test.ts +135 -0
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/integration.test.ts +25 -25
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/models.test.ts +6 -6
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/plugin.test.ts +9 -9
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/provider.test.ts +7 -7
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/routes.test.ts +3 -3
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/test-utils.ts +17 -17
- package/{templates/project-starter → dist/templates/project-starter/src}/__tests__/utils/core-test-utils.ts +3 -3
- package/dist/templates/project-starter/src/frontend/index.css +77 -0
- package/dist/templates/project-starter/src/frontend/index.html +19 -0
- package/dist/templates/project-starter/src/frontend/index.tsx +98 -0
- package/dist/templates/project-starter/src/frontend/utils.ts +6 -0
- package/dist/templates/project-starter/src/index.ts +153 -0
- package/dist/templates/project-starter/src/plugin.ts +255 -0
- package/dist/templates/project-starter/tailwind.config.js +62 -0
- package/dist/templates/project-starter/tsconfig.build.json +20 -0
- package/dist/templates/project-starter/tsconfig.json +39 -0
- package/dist/templates/project-starter/tsup.config.ts +19 -0
- package/dist/templates/project-starter/vite.config.ts +39 -0
- package/dist/templates/project-tee-starter/.dockerignore +20 -0
- package/dist/templates/project-tee-starter/.env.example +55 -0
- package/dist/templates/project-tee-starter/Dockerfile +66 -0
- package/dist/templates/project-tee-starter/GUIDE.md +235 -0
- package/dist/templates/project-tee-starter/README.md +173 -0
- package/dist/templates/project-tee-starter/__tests__/actions.test.ts +9 -0
- package/dist/templates/project-tee-starter/__tests__/character.test.ts +86 -0
- package/dist/templates/project-tee-starter/__tests__/config.test.ts +31 -0
- package/dist/templates/project-tee-starter/__tests__/env.test.ts +87 -0
- package/dist/templates/project-tee-starter/__tests__/error-handling.test.ts +30 -0
- package/dist/templates/project-tee-starter/__tests__/events.test.ts +21 -0
- package/{templates/project-starter → dist/templates/project-tee-starter}/__tests__/file-structure.test.ts +6 -6
- package/dist/templates/project-tee-starter/__tests__/integration.test.ts +205 -0
- package/dist/templates/project-tee-starter/__tests__/models.test.ts +22 -0
- package/dist/templates/project-tee-starter/__tests__/plugin.test.ts +38 -0
- package/dist/templates/project-tee-starter/__tests__/provider.test.ts +189 -0
- package/dist/templates/project-tee-starter/__tests__/routes.test.ts +21 -0
- package/dist/templates/project-tee-starter/__tests__/test-utils.ts +121 -0
- package/dist/templates/project-tee-starter/__tests__/utils/core-test-utils.ts +167 -0
- package/dist/templates/project-tee-starter/assets/mr-tee-portrait.jpg +0 -0
- package/dist/templates/project-tee-starter/bunfig.toml +6 -0
- package/dist/templates/project-tee-starter/docker-compose.yaml +57 -0
- package/dist/templates/project-tee-starter/e2e/project.test.ts +38 -0
- package/dist/templates/project-tee-starter/e2e/starter-plugin.test.ts +92 -0
- package/dist/templates/project-tee-starter/package.json +74 -0
- package/dist/templates/project-tee-starter/src/character.ts +257 -0
- package/dist/templates/project-tee-starter/src/index.ts +33 -0
- package/dist/templates/project-tee-starter/src/plugin.ts +169 -0
- package/dist/templates/project-tee-starter/tsconfig.build.json +13 -0
- package/dist/templates/project-tee-starter/tsconfig.json +30 -0
- package/dist/templates/project-tee-starter/tsup.config.ts +19 -0
- package/dist/{utils-DIZZ3HNZ.js → utils-TIALZU53.js} +9 -8
- package/package.json +29 -12
- package/templates/plugin-starter/README.md +38 -13
- package/templates/plugin-starter/bunfig.toml +6 -0
- package/templates/plugin-starter/cypress.config.ts +18 -0
- package/templates/plugin-starter/index.html +13 -0
- package/templates/plugin-starter/package.json +19 -7
- package/templates/plugin-starter/postcss.config.js +3 -0
- package/templates/plugin-starter/scripts/test-e2e-manual.js +201 -0
- package/templates/plugin-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +404 -0
- package/templates/plugin-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +287 -0
- package/templates/plugin-starter/src/__tests__/cypress/support/commands.ts +38 -0
- package/templates/plugin-starter/src/__tests__/cypress/support/component-index.html +11 -0
- package/templates/plugin-starter/src/__tests__/cypress/support/component.ts +33 -0
- package/templates/plugin-starter/src/__tests__/cypress/support/e2e.ts +11 -0
- package/templates/plugin-starter/src/__tests__/cypress/tsconfig.json +10 -0
- package/templates/plugin-starter/src/__tests__/e2e/README.md +47 -0
- package/templates/plugin-starter/src/__tests__/e2e/starter-plugin.ts +320 -0
- package/templates/plugin-starter/src/__tests__/integration.test.ts +138 -0
- package/templates/plugin-starter/src/__tests__/plugin.test.ts +182 -0
- package/templates/plugin-starter/src/__tests__/test-utils.ts +162 -0
- package/templates/plugin-starter/src/frontend/index.css +77 -0
- package/templates/plugin-starter/src/frontend/index.tsx +164 -0
- package/templates/plugin-starter/src/frontend/utils.ts +6 -0
- package/templates/plugin-starter/src/index.ts +31 -8
- package/templates/plugin-starter/src/tests.ts +6 -0
- package/templates/plugin-starter/tailwind.config.js +62 -0
- package/templates/plugin-starter/tsconfig.json +8 -8
- package/templates/plugin-starter/vite.config.ts +20 -0
- package/templates/project-starter/bunfig.toml +6 -0
- package/templates/project-starter/cypress.config.ts +31 -0
- package/templates/project-starter/index.html +13 -0
- package/templates/project-starter/package.json +37 -14
- package/templates/project-starter/postcss.config.js +3 -0
- package/templates/project-starter/scripts/test-all.sh +101 -0
- package/templates/project-starter/src/__tests__/actions.test.ts +155 -0
- package/templates/project-starter/src/__tests__/character.test.ts +86 -0
- package/templates/project-starter/src/__tests__/config.test.ts +193 -0
- package/templates/project-starter/src/__tests__/cypress/component/Accessibility.cy.tsx +271 -0
- package/templates/project-starter/src/__tests__/cypress/component/ApiIntegration.cy.tsx +220 -0
- package/templates/project-starter/src/__tests__/cypress/component/ExampleRoute.cy.tsx +146 -0
- package/templates/project-starter/src/__tests__/cypress/component/PanelComponent.cy.tsx +51 -0
- package/templates/project-starter/src/__tests__/cypress/e2e/agent-chat.cy.ts +235 -0
- package/templates/project-starter/src/__tests__/cypress/e2e/dashboard.cy.ts +146 -0
- package/templates/project-starter/src/__tests__/cypress/e2e/user-workflow.cy.ts +257 -0
- package/templates/project-starter/src/__tests__/cypress/support/commands.ts +44 -0
- package/templates/project-starter/src/__tests__/cypress/support/component-index.html +11 -0
- package/templates/project-starter/src/__tests__/cypress/support/component.ts +33 -0
- package/templates/project-starter/src/__tests__/cypress/support/e2e.ts +179 -0
- package/templates/project-starter/src/__tests__/e2e/index.ts +14 -0
- package/templates/project-starter/src/__tests__/e2e/natural-language.test.ts +246 -0
- package/templates/project-starter/src/__tests__/e2e/project.test.ts +155 -0
- package/templates/project-starter/src/__tests__/e2e/starter-plugin.test.ts +421 -0
- package/templates/project-starter/src/__tests__/env.test.ts +87 -0
- package/templates/project-starter/src/__tests__/error-handling.test.ts +177 -0
- package/templates/project-starter/src/__tests__/events.test.ts +144 -0
- package/templates/project-starter/src/__tests__/file-structure.test.ts +135 -0
- package/templates/project-starter/src/__tests__/integration.test.ts +209 -0
- package/templates/project-starter/src/__tests__/models.test.ts +152 -0
- package/templates/project-starter/src/__tests__/plugin.test.ts +393 -0
- package/templates/project-starter/src/__tests__/provider.test.ts +325 -0
- package/templates/project-starter/src/__tests__/routes.test.ts +79 -0
- package/templates/project-starter/src/__tests__/test-utils.ts +121 -0
- package/templates/project-starter/src/__tests__/utils/core-test-utils.ts +180 -0
- package/templates/project-starter/src/frontend/index.css +77 -0
- package/templates/project-starter/src/frontend/index.html +19 -0
- package/templates/project-starter/src/frontend/index.tsx +98 -0
- package/templates/project-starter/src/frontend/utils.ts +6 -0
- package/templates/project-starter/src/index.ts +9 -1
- package/templates/project-starter/tailwind.config.js +62 -0
- package/templates/project-starter/tsconfig.build.json +9 -2
- package/templates/project-starter/tsconfig.json +15 -6
- package/templates/project-starter/tsup.config.ts +1 -1
- package/templates/project-starter/vite.config.ts +39 -0
- package/templates/project-tee-starter/__tests__/actions.test.ts +1 -1
- package/templates/project-tee-starter/__tests__/character.test.ts +1 -1
- package/templates/project-tee-starter/__tests__/config.test.ts +1 -1
- package/templates/project-tee-starter/__tests__/env.test.ts +2 -2
- package/templates/project-tee-starter/__tests__/error-handling.test.ts +1 -1
- package/templates/project-tee-starter/__tests__/events.test.ts +1 -1
- package/templates/project-tee-starter/__tests__/file-structure.test.ts +5 -5
- package/templates/project-tee-starter/__tests__/integration.test.ts +22 -26
- package/templates/project-tee-starter/__tests__/models.test.ts +1 -1
- package/templates/project-tee-starter/__tests__/plugin.test.ts +6 -12
- package/templates/project-tee-starter/__tests__/provider.test.ts +6 -6
- package/templates/project-tee-starter/__tests__/routes.test.ts +1 -1
- package/templates/project-tee-starter/__tests__/test-utils.ts +15 -15
- package/templates/project-tee-starter/__tests__/utils/core-test-utils.ts +3 -3
- package/templates/project-tee-starter/bunfig.toml +6 -0
- package/templates/project-tee-starter/package.json +10 -12
- package/dist/assets/index-CZAd5zm2.js.br +0 -0
- package/dist/assets/index-CZAd5zm2.js.map +0 -1
- package/dist/assets/index-DyA-lndn.css +0 -1
- package/dist/assets/index-DyA-lndn.css.br +0 -0
- package/dist/chunk-CEE6RKN5.js +0 -2746
- package/dist/chunk-MA2ZXPG6.js +0 -260
- package/dist/chunk-TUAYJIF2.js +0 -3649
- package/dist/lib-NAGYZHVV.js +0 -9
- package/dist/plugin-creator-IC42XOHG.js +0 -29165
- package/templates/plugin-starter/e2e/starter-plugin.test.ts +0 -171
- package/templates/plugin-starter/images/README.md +0 -24
- package/templates/plugin-starter/vitest.config.ts +0 -16
- package/templates/project-starter/e2e/project.test.ts +0 -34
- package/templates/project-starter/e2e/starter-plugin.test.ts +0 -217
- package/templates/project-starter/vitest.config.ts +0 -16
- package/templates/project-tee-starter/vitest.config.ts +0 -19
|
@@ -11,21 +11,16 @@ import {
|
|
|
11
11
|
selectDatabase,
|
|
12
12
|
validateCreateOptions,
|
|
13
13
|
validateProjectName
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GWQB7PBK.js";
|
|
15
15
|
import {
|
|
16
16
|
Command,
|
|
17
|
-
Ie,
|
|
18
|
-
Se,
|
|
19
17
|
base_exports,
|
|
20
18
|
displayBanner,
|
|
21
|
-
handleError
|
|
22
|
-
|
|
23
|
-
pD,
|
|
24
|
-
ve,
|
|
25
|
-
xe
|
|
26
|
-
} from "./chunk-REBZFQYE.js";
|
|
19
|
+
handleError
|
|
20
|
+
} from "./chunk-7HYEGM5V.js";
|
|
27
21
|
|
|
28
22
|
// src/commands/create/index.ts
|
|
23
|
+
import * as clack from "@clack/prompts";
|
|
29
24
|
import { logger } from "@elizaos/core";
|
|
30
25
|
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) => {
|
|
31
26
|
try {
|
|
@@ -40,13 +35,13 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
40
35
|
const isNonInteractive = options.yes;
|
|
41
36
|
if (!isNonInteractive) {
|
|
42
37
|
await displayBanner();
|
|
43
|
-
|
|
38
|
+
clack.intro(base_exports.inverse(" Creating ElizaOS Project "));
|
|
44
39
|
}
|
|
45
40
|
let projectType = options.type;
|
|
46
41
|
let projectName = name;
|
|
47
42
|
if (!projectName) {
|
|
48
43
|
if (!isNonInteractive) {
|
|
49
|
-
const selectedType = await
|
|
44
|
+
const selectedType = await clack.select({
|
|
50
45
|
message: "What would you like to create?",
|
|
51
46
|
options: [
|
|
52
47
|
{
|
|
@@ -72,14 +67,14 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
72
67
|
],
|
|
73
68
|
initialValue: "project"
|
|
74
69
|
});
|
|
75
|
-
if (
|
|
76
|
-
|
|
70
|
+
if (clack.isCancel(selectedType)) {
|
|
71
|
+
clack.cancel("Operation cancelled.");
|
|
77
72
|
process.exit(0);
|
|
78
73
|
}
|
|
79
74
|
projectType = selectedType;
|
|
80
75
|
}
|
|
81
76
|
if (!isNonInteractive) {
|
|
82
|
-
const nameInput = await
|
|
77
|
+
const nameInput = await clack.text({
|
|
83
78
|
message: `What is the name of your ${projectType}?`,
|
|
84
79
|
placeholder: `my-${projectType}`,
|
|
85
80
|
validate: (value) => {
|
|
@@ -91,8 +86,8 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
91
86
|
return validation.isValid ? void 0 : validation.error;
|
|
92
87
|
}
|
|
93
88
|
});
|
|
94
|
-
if (
|
|
95
|
-
|
|
89
|
+
if (clack.isCancel(nameInput)) {
|
|
90
|
+
clack.cancel("Operation cancelled.");
|
|
96
91
|
process.exit(0);
|
|
97
92
|
}
|
|
98
93
|
projectName = nameInput;
|
|
@@ -137,11 +132,11 @@ var create = new Command("create").description("Create a new ElizaOS project, pl
|
|
|
137
132
|
}
|
|
138
133
|
}
|
|
139
134
|
if (!isNonInteractive) {
|
|
140
|
-
|
|
135
|
+
clack.outro(base_exports.green("Project created successfully! \u{1F389}"));
|
|
141
136
|
}
|
|
142
137
|
} catch (error) {
|
|
143
138
|
if (!opts?.yes) {
|
|
144
|
-
|
|
139
|
+
clack.cancel("Failed to create project.");
|
|
145
140
|
}
|
|
146
141
|
logger.error("Create command failed:", error);
|
|
147
142
|
handleError(error);
|
|
@@ -7,18 +7,15 @@ import {
|
|
|
7
7
|
buildProject,
|
|
8
8
|
copyTemplate,
|
|
9
9
|
ensureElizaDir,
|
|
10
|
-
pD,
|
|
11
10
|
promptAndStoreAnthropicKey,
|
|
11
|
+
promptAndStoreOllamaConfig,
|
|
12
12
|
promptAndStoreOpenAIKey,
|
|
13
13
|
promptAndStorePostgresUrl,
|
|
14
|
-
setupPgLite
|
|
15
|
-
|
|
16
|
-
xe,
|
|
17
|
-
ye
|
|
18
|
-
} from "./chunk-REBZFQYE.js";
|
|
14
|
+
setupPgLite
|
|
15
|
+
} from "./chunk-7HYEGM5V.js";
|
|
19
16
|
import {
|
|
20
17
|
runBunCommand
|
|
21
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RIAWNDYI.js";
|
|
22
19
|
|
|
23
20
|
// src/characters/eliza.ts
|
|
24
21
|
var baseCharacter = {
|
|
@@ -216,11 +213,11 @@ function getElizaCharacter() {
|
|
|
216
213
|
plugins
|
|
217
214
|
};
|
|
218
215
|
}
|
|
219
|
-
var character = baseCharacter;
|
|
220
216
|
|
|
221
217
|
// src/commands/create/actions/creators.ts
|
|
222
218
|
import { join } from "path";
|
|
223
219
|
import fs3 from "fs/promises";
|
|
220
|
+
import * as clack2 from "@clack/prompts";
|
|
224
221
|
|
|
225
222
|
// src/commands/create/utils/validation.ts
|
|
226
223
|
import { existsSync } from "fs";
|
|
@@ -325,6 +322,7 @@ async function validateTargetDirectory(targetDir) {
|
|
|
325
322
|
}
|
|
326
323
|
|
|
327
324
|
// src/commands/create/utils/selection.ts
|
|
325
|
+
import * as clack from "@clack/prompts";
|
|
328
326
|
function getAvailableAIModels() {
|
|
329
327
|
return [
|
|
330
328
|
{
|
|
@@ -341,6 +339,11 @@ function getAvailableAIModels() {
|
|
|
341
339
|
title: "Anthropic (Claude)",
|
|
342
340
|
value: "claude",
|
|
343
341
|
description: "Use Anthropic Claude models"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
title: "Ollama (self-hosted, free to use)",
|
|
345
|
+
value: "ollama",
|
|
346
|
+
description: "Use self-hosted Ollama models for complete privacy and control"
|
|
344
347
|
}
|
|
345
348
|
];
|
|
346
349
|
}
|
|
@@ -360,7 +363,7 @@ function getAvailableDatabases() {
|
|
|
360
363
|
}
|
|
361
364
|
async function selectDatabase() {
|
|
362
365
|
const availableDatabases = getAvailableDatabases();
|
|
363
|
-
const database = await
|
|
366
|
+
const database = await clack.select({
|
|
364
367
|
message: "Which database would you like to use?",
|
|
365
368
|
options: availableDatabases.map((db) => ({
|
|
366
369
|
label: db.title,
|
|
@@ -369,15 +372,15 @@ async function selectDatabase() {
|
|
|
369
372
|
})),
|
|
370
373
|
initialValue: "pglite"
|
|
371
374
|
});
|
|
372
|
-
if (
|
|
373
|
-
|
|
375
|
+
if (clack.isCancel(database)) {
|
|
376
|
+
clack.cancel("Operation cancelled.");
|
|
374
377
|
process.exit(0);
|
|
375
378
|
}
|
|
376
379
|
return database;
|
|
377
380
|
}
|
|
378
381
|
async function selectAIModel() {
|
|
379
382
|
const availableModels = getAvailableAIModels();
|
|
380
|
-
const aiModel = await
|
|
383
|
+
const aiModel = await clack.select({
|
|
381
384
|
message: "Which AI model would you like to use?",
|
|
382
385
|
options: availableModels.map((model) => ({
|
|
383
386
|
label: model.title,
|
|
@@ -386,8 +389,8 @@ async function selectAIModel() {
|
|
|
386
389
|
})),
|
|
387
390
|
initialValue: "local"
|
|
388
391
|
});
|
|
389
|
-
if (
|
|
390
|
-
|
|
392
|
+
if (clack.isCancel(aiModel)) {
|
|
393
|
+
clack.cancel("Operation cancelled.");
|
|
391
394
|
process.exit(0);
|
|
392
395
|
}
|
|
393
396
|
return aiModel;
|
|
@@ -446,6 +449,28 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
446
449
|
}
|
|
447
450
|
break;
|
|
448
451
|
}
|
|
452
|
+
case "ollama": {
|
|
453
|
+
if (isNonInteractive) {
|
|
454
|
+
let content = "";
|
|
455
|
+
if (existsSync2(envFilePath)) {
|
|
456
|
+
content = await fs2.readFile(envFilePath, "utf8");
|
|
457
|
+
}
|
|
458
|
+
if (content && !content.endsWith("\n")) {
|
|
459
|
+
content += "\n";
|
|
460
|
+
}
|
|
461
|
+
content += "\n# AI Model Configuration\n";
|
|
462
|
+
content += "# Ollama Configuration\n";
|
|
463
|
+
content += "OLLAMA_API_ENDPOINT=http://localhost:11434\n";
|
|
464
|
+
content += "OLLAMA_MODEL=llama2\n";
|
|
465
|
+
content += "USE_OLLAMA_TEXT_MODELS=true\n";
|
|
466
|
+
content += "# Make sure Ollama is installed and running: https://ollama.ai/\n";
|
|
467
|
+
await fs2.writeFile(envFilePath, content, "utf8");
|
|
468
|
+
console.info("[\u221A] Ollama placeholder configuration added to .env file");
|
|
469
|
+
} else {
|
|
470
|
+
await promptAndStoreOllamaConfig(envFilePath);
|
|
471
|
+
}
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
449
474
|
default:
|
|
450
475
|
console.warn(`Unknown AI model: ${aiModel}, skipping configuration`);
|
|
451
476
|
return;
|
|
@@ -456,6 +481,10 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
456
481
|
}
|
|
457
482
|
}
|
|
458
483
|
async function installDependencies(targetDir) {
|
|
484
|
+
if (process.env.CI === "true" || process.env.ELIZA_TEST_MODE === "true") {
|
|
485
|
+
console.info("Skipping dependency installation in CI/test environment...");
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
459
488
|
console.info("Installing dependencies...");
|
|
460
489
|
await runBunCommand(["install"], targetDir);
|
|
461
490
|
}
|
|
@@ -484,15 +513,15 @@ async function createPlugin(pluginName, targetDir, isNonInteractive = false) {
|
|
|
484
513
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
485
514
|
}
|
|
486
515
|
if (!isNonInteractive) {
|
|
487
|
-
const confirmCreate = await
|
|
516
|
+
const confirmCreate = await clack2.confirm({
|
|
488
517
|
message: `Create plugin "${pluginDirName}" in ${pluginTargetDir}?`
|
|
489
518
|
});
|
|
490
|
-
if (
|
|
491
|
-
|
|
519
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
520
|
+
clack2.cancel("Plugin creation cancelled.");
|
|
492
521
|
process.exit(0);
|
|
493
522
|
}
|
|
494
523
|
}
|
|
495
|
-
await copyTemplate("plugin", pluginTargetDir
|
|
524
|
+
await copyTemplate("plugin", pluginTargetDir);
|
|
496
525
|
await installDependencies(pluginTargetDir);
|
|
497
526
|
console.info(`
|
|
498
527
|
${base_exports.green("\u2713")} Plugin "${pluginDirName}" created successfully!`);
|
|
@@ -514,16 +543,16 @@ async function createAgent(agentName, targetDir, isNonInteractive = false) {
|
|
|
514
543
|
}
|
|
515
544
|
}
|
|
516
545
|
if (!isNonInteractive) {
|
|
517
|
-
const confirmCreate = await
|
|
546
|
+
const confirmCreate = await clack2.confirm({
|
|
518
547
|
message: `Create agent "${agentName}" at ${agentFilePath}?`
|
|
519
548
|
});
|
|
520
|
-
if (
|
|
521
|
-
|
|
549
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
550
|
+
clack2.cancel("Agent creation cancelled.");
|
|
522
551
|
process.exit(0);
|
|
523
552
|
}
|
|
524
553
|
}
|
|
525
554
|
const agentCharacter = {
|
|
526
|
-
...
|
|
555
|
+
...getElizaCharacter(),
|
|
527
556
|
name: agentName,
|
|
528
557
|
bio: [
|
|
529
558
|
`${agentName} is a helpful AI assistant created to provide assistance and engage in meaningful conversations.`,
|
|
@@ -548,15 +577,15 @@ async function createTEEProject(projectName, targetDir, database, aiModel, isNon
|
|
|
548
577
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
549
578
|
}
|
|
550
579
|
if (!isNonInteractive) {
|
|
551
|
-
const confirmCreate = await
|
|
580
|
+
const confirmCreate = await clack2.confirm({
|
|
552
581
|
message: `Create TEE project "${projectName}" in ${teeTargetDir}?`
|
|
553
582
|
});
|
|
554
|
-
if (
|
|
555
|
-
|
|
583
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
584
|
+
clack2.cancel("TEE project creation cancelled.");
|
|
556
585
|
process.exit(0);
|
|
557
586
|
}
|
|
558
587
|
}
|
|
559
|
-
await copyTemplate("project-tee-starter", teeTargetDir
|
|
588
|
+
await copyTemplate("project-tee-starter", teeTargetDir);
|
|
560
589
|
await setupProjectEnvironment(teeTargetDir, database, aiModel, isNonInteractive);
|
|
561
590
|
await installDependencies(teeTargetDir);
|
|
562
591
|
await buildProject(teeTargetDir);
|
|
@@ -575,16 +604,15 @@ async function createProject(projectName, targetDir, database, aiModel, isNonInt
|
|
|
575
604
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
576
605
|
}
|
|
577
606
|
if (!isNonInteractive) {
|
|
578
|
-
const confirmCreate = await
|
|
607
|
+
const confirmCreate = await clack2.confirm({
|
|
579
608
|
message: `Create project "${projectName}" in ${projectTargetDir}?`
|
|
580
609
|
});
|
|
581
|
-
if (
|
|
582
|
-
|
|
610
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
611
|
+
clack2.cancel("Project creation cancelled.");
|
|
583
612
|
process.exit(0);
|
|
584
613
|
}
|
|
585
614
|
}
|
|
586
|
-
|
|
587
|
-
await copyTemplate("project-starter", projectTargetDir, templateName);
|
|
615
|
+
await copyTemplate("project-starter", projectTargetDir);
|
|
588
616
|
await setupProjectEnvironment(projectTargetDir, database, aiModel, isNonInteractive);
|
|
589
617
|
await installDependencies(projectTargetDir);
|
|
590
618
|
await buildProject(projectTargetDir);
|
|
@@ -604,7 +632,6 @@ export {
|
|
|
604
632
|
selectDatabase,
|
|
605
633
|
selectAIModel,
|
|
606
634
|
getElizaCharacter,
|
|
607
|
-
character,
|
|
608
635
|
createProjectDirectories,
|
|
609
636
|
setupAIModelConfig,
|
|
610
637
|
installDependencies,
|