@elizaos/cli 1.0.9 → 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-CCyz05Yl.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-Cxd2b7is.js → index-DDQnwxzL.js} +1318 -13721
- package/dist/assets/{index-Cxd2b7is.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-Y755OOSP.js → chunk-7HYEGM5V.js} +877 -1550
- package/dist/{chunk-HZQCHL3J.js → chunk-B4KJXECB.js} +13 -18
- package/dist/{chunk-Z6GVELRX.js → chunk-GWQB7PBK.js} +58 -29
- package/dist/{chunk-CVADLFW6.js → chunk-LQ6XHF53.js} +4543 -3043
- package/dist/{chunk-JWONHNLD.js → chunk-RIAWNDYI.js} +2 -9
- 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 -3
- package/dist/commands/agent/index.js +3 -3
- package/dist/commands/create/actions/index.js +4 -4
- package/dist/commands/create/index.js +5 -5
- package/dist/{fileFromPath-DCRQMDLJ.js → fileFromPath-KB6XMTJ4.js} +1 -0
- package/dist/index.html +2 -2
- package/dist/index.js +9351 -102236
- 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-W7CIK4O2.js → registry-CBMRMYCG.js} +3 -3
- 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-2G2QVMW3.js → utils-TIALZU53.js} +9 -7
- package/package.json +28 -9
- 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 +30 -7
- 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 +3 -0
- 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-CCyz05Yl.js.br +0 -0
- package/dist/assets/index-CCyz05Yl.js.map +0 -1
- package/dist/assets/index-DeXwJbtm.css +0 -1
- package/dist/assets/index-DeXwJbtm.css.br +0 -0
- package/dist/chunk-CEE6RKN5.js +0 -2746
- package/dist/chunk-TUAYJIF2.js +0 -3649
- package/dist/plugin-creator-IK6H4LVZ.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-Y755OOSP.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-Y755OOSP.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 = {
|
|
@@ -220,6 +217,7 @@ function getElizaCharacter() {
|
|
|
220
217
|
// src/commands/create/actions/creators.ts
|
|
221
218
|
import { join } from "path";
|
|
222
219
|
import fs3 from "fs/promises";
|
|
220
|
+
import * as clack2 from "@clack/prompts";
|
|
223
221
|
|
|
224
222
|
// src/commands/create/utils/validation.ts
|
|
225
223
|
import { existsSync } from "fs";
|
|
@@ -324,6 +322,7 @@ async function validateTargetDirectory(targetDir) {
|
|
|
324
322
|
}
|
|
325
323
|
|
|
326
324
|
// src/commands/create/utils/selection.ts
|
|
325
|
+
import * as clack from "@clack/prompts";
|
|
327
326
|
function getAvailableAIModels() {
|
|
328
327
|
return [
|
|
329
328
|
{
|
|
@@ -340,6 +339,11 @@ function getAvailableAIModels() {
|
|
|
340
339
|
title: "Anthropic (Claude)",
|
|
341
340
|
value: "claude",
|
|
342
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"
|
|
343
347
|
}
|
|
344
348
|
];
|
|
345
349
|
}
|
|
@@ -359,7 +363,7 @@ function getAvailableDatabases() {
|
|
|
359
363
|
}
|
|
360
364
|
async function selectDatabase() {
|
|
361
365
|
const availableDatabases = getAvailableDatabases();
|
|
362
|
-
const database = await
|
|
366
|
+
const database = await clack.select({
|
|
363
367
|
message: "Which database would you like to use?",
|
|
364
368
|
options: availableDatabases.map((db) => ({
|
|
365
369
|
label: db.title,
|
|
@@ -368,15 +372,15 @@ async function selectDatabase() {
|
|
|
368
372
|
})),
|
|
369
373
|
initialValue: "pglite"
|
|
370
374
|
});
|
|
371
|
-
if (
|
|
372
|
-
|
|
375
|
+
if (clack.isCancel(database)) {
|
|
376
|
+
clack.cancel("Operation cancelled.");
|
|
373
377
|
process.exit(0);
|
|
374
378
|
}
|
|
375
379
|
return database;
|
|
376
380
|
}
|
|
377
381
|
async function selectAIModel() {
|
|
378
382
|
const availableModels = getAvailableAIModels();
|
|
379
|
-
const aiModel = await
|
|
383
|
+
const aiModel = await clack.select({
|
|
380
384
|
message: "Which AI model would you like to use?",
|
|
381
385
|
options: availableModels.map((model) => ({
|
|
382
386
|
label: model.title,
|
|
@@ -385,8 +389,8 @@ async function selectAIModel() {
|
|
|
385
389
|
})),
|
|
386
390
|
initialValue: "local"
|
|
387
391
|
});
|
|
388
|
-
if (
|
|
389
|
-
|
|
392
|
+
if (clack.isCancel(aiModel)) {
|
|
393
|
+
clack.cancel("Operation cancelled.");
|
|
390
394
|
process.exit(0);
|
|
391
395
|
}
|
|
392
396
|
return aiModel;
|
|
@@ -445,6 +449,28 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
445
449
|
}
|
|
446
450
|
break;
|
|
447
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
|
+
}
|
|
448
474
|
default:
|
|
449
475
|
console.warn(`Unknown AI model: ${aiModel}, skipping configuration`);
|
|
450
476
|
return;
|
|
@@ -455,6 +481,10 @@ async function setupAIModelConfig(aiModel, envFilePath, isNonInteractive = false
|
|
|
455
481
|
}
|
|
456
482
|
}
|
|
457
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
|
+
}
|
|
458
488
|
console.info("Installing dependencies...");
|
|
459
489
|
await runBunCommand(["install"], targetDir);
|
|
460
490
|
}
|
|
@@ -483,15 +513,15 @@ async function createPlugin(pluginName, targetDir, isNonInteractive = false) {
|
|
|
483
513
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
484
514
|
}
|
|
485
515
|
if (!isNonInteractive) {
|
|
486
|
-
const confirmCreate = await
|
|
516
|
+
const confirmCreate = await clack2.confirm({
|
|
487
517
|
message: `Create plugin "${pluginDirName}" in ${pluginTargetDir}?`
|
|
488
518
|
});
|
|
489
|
-
if (
|
|
490
|
-
|
|
519
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
520
|
+
clack2.cancel("Plugin creation cancelled.");
|
|
491
521
|
process.exit(0);
|
|
492
522
|
}
|
|
493
523
|
}
|
|
494
|
-
await copyTemplate("plugin", pluginTargetDir
|
|
524
|
+
await copyTemplate("plugin", pluginTargetDir);
|
|
495
525
|
await installDependencies(pluginTargetDir);
|
|
496
526
|
console.info(`
|
|
497
527
|
${base_exports.green("\u2713")} Plugin "${pluginDirName}" created successfully!`);
|
|
@@ -513,11 +543,11 @@ async function createAgent(agentName, targetDir, isNonInteractive = false) {
|
|
|
513
543
|
}
|
|
514
544
|
}
|
|
515
545
|
if (!isNonInteractive) {
|
|
516
|
-
const confirmCreate = await
|
|
546
|
+
const confirmCreate = await clack2.confirm({
|
|
517
547
|
message: `Create agent "${agentName}" at ${agentFilePath}?`
|
|
518
548
|
});
|
|
519
|
-
if (
|
|
520
|
-
|
|
549
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
550
|
+
clack2.cancel("Agent creation cancelled.");
|
|
521
551
|
process.exit(0);
|
|
522
552
|
}
|
|
523
553
|
}
|
|
@@ -547,15 +577,15 @@ async function createTEEProject(projectName, targetDir, database, aiModel, isNon
|
|
|
547
577
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
548
578
|
}
|
|
549
579
|
if (!isNonInteractive) {
|
|
550
|
-
const confirmCreate = await
|
|
580
|
+
const confirmCreate = await clack2.confirm({
|
|
551
581
|
message: `Create TEE project "${projectName}" in ${teeTargetDir}?`
|
|
552
582
|
});
|
|
553
|
-
if (
|
|
554
|
-
|
|
583
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
584
|
+
clack2.cancel("TEE project creation cancelled.");
|
|
555
585
|
process.exit(0);
|
|
556
586
|
}
|
|
557
587
|
}
|
|
558
|
-
await copyTemplate("project-tee-starter", teeTargetDir
|
|
588
|
+
await copyTemplate("project-tee-starter", teeTargetDir);
|
|
559
589
|
await setupProjectEnvironment(teeTargetDir, database, aiModel, isNonInteractive);
|
|
560
590
|
await installDependencies(teeTargetDir);
|
|
561
591
|
await buildProject(teeTargetDir);
|
|
@@ -574,16 +604,15 @@ async function createProject(projectName, targetDir, database, aiModel, isNonInt
|
|
|
574
604
|
throw new Error(dirResult.error || "Invalid target directory");
|
|
575
605
|
}
|
|
576
606
|
if (!isNonInteractive) {
|
|
577
|
-
const confirmCreate = await
|
|
607
|
+
const confirmCreate = await clack2.confirm({
|
|
578
608
|
message: `Create project "${projectName}" in ${projectTargetDir}?`
|
|
579
609
|
});
|
|
580
|
-
if (
|
|
581
|
-
|
|
610
|
+
if (clack2.isCancel(confirmCreate) || !confirmCreate) {
|
|
611
|
+
clack2.cancel("Project creation cancelled.");
|
|
582
612
|
process.exit(0);
|
|
583
613
|
}
|
|
584
614
|
}
|
|
585
|
-
|
|
586
|
-
await copyTemplate("project-starter", projectTargetDir, templateName);
|
|
615
|
+
await copyTemplate("project-starter", projectTargetDir);
|
|
587
616
|
await setupProjectEnvironment(projectTargetDir, database, aiModel, isNonInteractive);
|
|
588
617
|
await installDependencies(projectTargetDir);
|
|
589
618
|
await buildProject(projectTargetDir);
|