@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
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"outDir": "dist",
|
|
4
|
-
"rootDir": "
|
|
3
|
+
"outDir": "./dist",
|
|
4
|
+
"rootDir": ".",
|
|
5
5
|
"lib": ["ESNext"],
|
|
6
6
|
"target": "ESNext",
|
|
7
7
|
"module": "Preserve",
|
|
8
8
|
"moduleResolution": "Bundler",
|
|
9
|
-
"strict":
|
|
9
|
+
"strict": true,
|
|
10
10
|
"esModuleInterop": true,
|
|
11
11
|
"skipLibCheck": true,
|
|
12
|
-
"forceConsistentCasingInFileNames":
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"strictFunctionTypes": false,
|
|
14
|
+
"useUnknownInCatchVariables": false,
|
|
13
15
|
"allowImportingTsExtensions": true,
|
|
14
16
|
"declaration": true,
|
|
15
17
|
"emitDeclarationOnly": true,
|
|
16
18
|
"resolveJsonModule": true,
|
|
17
|
-
"noImplicitAny": false,
|
|
18
19
|
"allowJs": true,
|
|
19
20
|
"checkJs": false,
|
|
20
21
|
"noEmitOnError": false,
|
|
@@ -26,5 +27,13 @@
|
|
|
26
27
|
"@elizaos/core/*": ["../../core/src/*"]
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
|
-
"include": ["src/**/*.ts"]
|
|
30
|
+
"include": ["src/**/*.ts"],
|
|
31
|
+
"exclude": [
|
|
32
|
+
"dist",
|
|
33
|
+
"node_modules",
|
|
34
|
+
"src/__tests__/**/*",
|
|
35
|
+
"src/**/cypress/**/*",
|
|
36
|
+
"**/*.test.ts",
|
|
37
|
+
"**/*.spec.ts"
|
|
38
|
+
]
|
|
30
39
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
// https://vite.dev/config/
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
plugins: [react()],
|
|
11
|
+
root: 'src/frontend',
|
|
12
|
+
build: {
|
|
13
|
+
outDir: '../../dist/frontend',
|
|
14
|
+
emptyOutDir: true,
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
input: {
|
|
17
|
+
main: path.resolve(__dirname, 'src/frontend/index.html'),
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
optimizeDeps: {
|
|
22
|
+
include: ['react', 'react-dom', '@tanstack/react-query'],
|
|
23
|
+
},
|
|
24
|
+
resolve: {
|
|
25
|
+
alias: {
|
|
26
|
+
'@': path.resolve(__dirname, './src'),
|
|
27
|
+
'@elizaos/core': path.resolve(__dirname, '../../core/src'),
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
server: {
|
|
31
|
+
port: 5173,
|
|
32
|
+
proxy: {
|
|
33
|
+
'/api': {
|
|
34
|
+
target: 'http://localhost:3000',
|
|
35
|
+
changeOrigin: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { describe, expect, it } from '
|
|
3
|
+
import { describe, expect, it } from 'bun:test';
|
|
4
4
|
|
|
5
5
|
describe('Environment Setup', () => {
|
|
6
6
|
it('should verify configuration files exist', () => {
|
|
@@ -9,7 +9,7 @@ describe('Environment Setup', () => {
|
|
|
9
9
|
'tsconfig.json',
|
|
10
10
|
'tsconfig.build.json',
|
|
11
11
|
'tsup.config.ts',
|
|
12
|
-
'
|
|
12
|
+
'bunfig.toml',
|
|
13
13
|
];
|
|
14
14
|
|
|
15
15
|
for (const file of requiredFiles) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { describe, expect, it } from '
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
4
|
import { logger } from '@elizaos/core';
|
|
5
5
|
|
|
6
6
|
// Helper function to check if a file exists
|
|
@@ -53,7 +53,7 @@ describe('Project Structure Validation', () => {
|
|
|
53
53
|
expect(fileExists(path.join(rootDir, 'tsconfig.json'))).toBe(true);
|
|
54
54
|
expect(fileExists(path.join(rootDir, 'tsconfig.build.json'))).toBe(true);
|
|
55
55
|
expect(fileExists(path.join(rootDir, 'tsup.config.ts'))).toBe(true);
|
|
56
|
-
expect(fileExists(path.join(rootDir, '
|
|
56
|
+
expect(fileExists(path.join(rootDir, 'bunfig.toml'))).toBe(true);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it('should have the correct package.json configuration', () => {
|
|
@@ -72,7 +72,7 @@ describe('Project Structure Validation', () => {
|
|
|
72
72
|
|
|
73
73
|
// Check dev dependencies - adjusted for actual dev dependencies
|
|
74
74
|
expect(packageJson.devDependencies).toBeTruthy();
|
|
75
|
-
|
|
75
|
+
// bun test is built-in, no external test framework dependency needed
|
|
76
76
|
expect(packageJson.devDependencies).toHaveProperty('tsup');
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { describe, expect, it,
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import * as path from 'path';
|
|
1
|
+
import { describe, expect, it, spyOn, beforeAll, afterAll } from 'bun:test';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
4
|
import { logger, IAgentRuntime, Plugin } from '@elizaos/core';
|
|
5
5
|
import { character } from '../src/index';
|
|
6
6
|
import plugin from '../src/plugin';
|
|
7
7
|
import { createMockRuntime } from './test-utils';
|
|
8
|
-
import * as os from 'os';
|
|
8
|
+
import * as os from 'node:os';
|
|
9
9
|
|
|
10
10
|
// Set up spies on logger
|
|
11
11
|
beforeAll(() => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
spyOn(logger, 'info');
|
|
13
|
+
spyOn(logger, 'error');
|
|
14
|
+
spyOn(logger, 'warn');
|
|
15
|
+
spyOn(logger, 'debug');
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
afterAll(() => {
|
|
19
|
-
|
|
19
|
+
// No global restore needed in bun:test;
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
// Skip in CI environments or when running automated tests without interaction
|
|
@@ -92,27 +92,23 @@ describe('Integration: Runtime Initialization', () => {
|
|
|
92
92
|
const customMockRuntime = {
|
|
93
93
|
character: { ...character },
|
|
94
94
|
plugins: [],
|
|
95
|
-
registerPlugin:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
useModel: vi.fn().mockResolvedValue('Test model response'),
|
|
104
|
-
getProviderResults: vi.fn().mockResolvedValue([]),
|
|
105
|
-
evaluateProviders: vi.fn().mockResolvedValue([]),
|
|
106
|
-
evaluate: vi.fn().mockResolvedValue([]),
|
|
95
|
+
registerPlugin: () => Promise.resolve(),
|
|
96
|
+
initialize: () => {},
|
|
97
|
+
getService: () => null,
|
|
98
|
+
getSetting: () => null,
|
|
99
|
+
useModel: () => Promise.resolve('Test model response'),
|
|
100
|
+
getProviderResults: () => Promise.resolve([]),
|
|
101
|
+
evaluateProviders: () => Promise.resolve([]),
|
|
102
|
+
evaluate: () => Promise.resolve([]),
|
|
107
103
|
} as unknown as IAgentRuntime;
|
|
108
104
|
|
|
109
105
|
// Ensure we're testing safely - to avoid parallel test race conditions
|
|
110
106
|
const originalInit = plugin.init;
|
|
111
107
|
let initCalled = false;
|
|
112
108
|
|
|
113
|
-
// Mock the plugin.init method
|
|
109
|
+
// Mock the plugin.init method
|
|
114
110
|
if (plugin.init) {
|
|
115
|
-
plugin.init =
|
|
111
|
+
plugin.init = async (config, runtime) => {
|
|
116
112
|
// Set flag to indicate our wrapper was called
|
|
117
113
|
initCalled = true;
|
|
118
114
|
|
|
@@ -123,7 +119,7 @@ describe('Integration: Runtime Initialization', () => {
|
|
|
123
119
|
|
|
124
120
|
// Register plugin
|
|
125
121
|
await runtime.registerPlugin(plugin);
|
|
126
|
-
}
|
|
122
|
+
};
|
|
127
123
|
}
|
|
128
124
|
|
|
129
125
|
try {
|
|
@@ -135,8 +131,8 @@ describe('Integration: Runtime Initialization', () => {
|
|
|
135
131
|
// Verify our wrapper was called
|
|
136
132
|
expect(initCalled).toBe(true);
|
|
137
133
|
|
|
138
|
-
// Check if registerPlugin was called
|
|
139
|
-
|
|
134
|
+
// Check if registerPlugin was called (can't use toHaveBeenCalled with mock functions in bun:test)
|
|
135
|
+
// We'll rely on the initCalled flag to verify the flow
|
|
140
136
|
} catch (error) {
|
|
141
137
|
console.error('Error initializing plugin:', error);
|
|
142
138
|
throw error;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import { describe, it, expect,
|
|
1
|
+
import { describe, it, expect, spyOn, mock } from 'bun:test';
|
|
2
2
|
import teeStarterPlugin from '../src/plugin';
|
|
3
3
|
import { logger } from '@elizaos/core';
|
|
4
4
|
|
|
5
5
|
// Spy on logger to capture logs
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
vi.mock('../src/character', () => ({
|
|
12
|
-
mrTeeCharacter: {
|
|
13
|
-
name: 'Mr. TEE',
|
|
14
|
-
plugins: ['@elizaos/plugin-tee'],
|
|
15
|
-
},
|
|
16
|
-
}));
|
|
6
|
+
spyOn(logger, 'info');
|
|
7
|
+
spyOn(logger, 'error');
|
|
8
|
+
spyOn(logger, 'warn');
|
|
9
|
+
|
|
10
|
+
// Note: Character import handled by individual tests as needed
|
|
17
11
|
|
|
18
12
|
describe('TEE Starter Plugin', () => {
|
|
19
13
|
it('should have the correct name', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, expect, it,
|
|
1
|
+
import { describe, expect, it, spyOn, beforeAll, afterAll } from 'bun:test';
|
|
2
2
|
import plugin from '../src/plugin';
|
|
3
3
|
import type { IAgentRuntime, Memory, State, Provider } from '@elizaos/core';
|
|
4
4
|
import { logger } from '@elizaos/core';
|
|
@@ -11,14 +11,14 @@ dotenv.config();
|
|
|
11
11
|
|
|
12
12
|
// Set up logging to capture issues
|
|
13
13
|
beforeAll(() => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
spyOn(logger, 'info');
|
|
15
|
+
spyOn(logger, 'error');
|
|
16
|
+
spyOn(logger, 'warn');
|
|
17
|
+
spyOn(logger, 'debug');
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
afterAll(() => {
|
|
21
|
-
|
|
21
|
+
// No global restore needed in bun:test;
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
// Helper function to document test results
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mock, spyOn } from 'bun:test';
|
|
2
2
|
import { type Content, type IAgentRuntime, type Memory, type State, logger } from '@elizaos/core';
|
|
3
3
|
import {
|
|
4
4
|
createMockRuntime as createCoreMockRuntime,
|
|
@@ -26,14 +26,14 @@ export function createMockRuntime(overrides: Partial<IAgentRuntime> = {}): IAgen
|
|
|
26
26
|
...baseRuntime,
|
|
27
27
|
character: mrTeeCharacter,
|
|
28
28
|
plugins: [plugin],
|
|
29
|
-
registerPlugin:
|
|
30
|
-
initialize:
|
|
31
|
-
getService:
|
|
32
|
-
getSetting:
|
|
33
|
-
useModel:
|
|
34
|
-
getProviderResults:
|
|
35
|
-
evaluateProviders:
|
|
36
|
-
evaluate:
|
|
29
|
+
registerPlugin: mock(),
|
|
30
|
+
initialize: mock(),
|
|
31
|
+
getService: mock(),
|
|
32
|
+
getSetting: mock().mockReturnValue(null),
|
|
33
|
+
useModel: mock().mockResolvedValue('Test model response'),
|
|
34
|
+
getProviderResults: mock().mockResolvedValue([]),
|
|
35
|
+
evaluateProviders: mock().mockResolvedValue([]),
|
|
36
|
+
evaluate: mock().mockResolvedValue([]),
|
|
37
37
|
...overrides,
|
|
38
38
|
} as unknown as IAgentRuntime;
|
|
39
39
|
|
|
@@ -84,7 +84,7 @@ export function setupTest(
|
|
|
84
84
|
} = {}
|
|
85
85
|
) {
|
|
86
86
|
// Create mock callback function
|
|
87
|
-
const callbackFn =
|
|
87
|
+
const callbackFn = mock();
|
|
88
88
|
|
|
89
89
|
// Create a message
|
|
90
90
|
const mockMessage = createMockMessage(
|
|
@@ -111,11 +111,11 @@ export { documentTestResult, runCoreActionTests };
|
|
|
111
111
|
|
|
112
112
|
// Add spy on logger for common usage in tests
|
|
113
113
|
export function setupLoggerSpies() {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
spyOn(logger, 'info').mockImplementation(() => {});
|
|
115
|
+
spyOn(logger, 'error').mockImplementation(() => {});
|
|
116
|
+
spyOn(logger, 'warn').mockImplementation(() => {});
|
|
117
|
+
spyOn(logger, 'debug').mockImplementation(() => {});
|
|
118
118
|
|
|
119
119
|
// allow tests to restore originals
|
|
120
|
-
return () =>
|
|
120
|
+
return () => mock.restore();
|
|
121
121
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mock } from 'bun:test';
|
|
2
2
|
import { composeActionExamples, formatActionNames, formatActions } from '@elizaos/core';
|
|
3
3
|
import type { Action, Content, IAgentRuntime, Memory, State } from '@elizaos/core';
|
|
4
4
|
import { logger } from '@elizaos/core';
|
|
@@ -112,8 +112,8 @@ export const createMockRuntime = (): IAgentRuntime => {
|
|
|
112
112
|
},
|
|
113
113
|
actions: [],
|
|
114
114
|
providers: [],
|
|
115
|
-
getService:
|
|
116
|
-
processActions:
|
|
115
|
+
getService: mock(),
|
|
116
|
+
processActions: mock(),
|
|
117
117
|
} as any as IAgentRuntime;
|
|
118
118
|
};
|
|
119
119
|
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"GUIDE.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elizaos/cli": "1.0.
|
|
37
|
-
"@elizaos/core": "1.0.
|
|
38
|
-
"@elizaos/plugin-redpill": "1.0.
|
|
39
|
-
"@elizaos/plugin-sql": "1.0.
|
|
36
|
+
"@elizaos/cli": "1.0.9",
|
|
37
|
+
"@elizaos/core": "1.0.9",
|
|
38
|
+
"@elizaos/plugin-redpill": "1.0.3",
|
|
39
|
+
"@elizaos/plugin-sql": "1.0.9",
|
|
40
40
|
"@phala/dstack-sdk": "0.1.11",
|
|
41
41
|
"@solana/web3.js": "1.98.2",
|
|
42
42
|
"viem": "2.30.1",
|
|
@@ -44,20 +44,18 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "8.5.0",
|
|
47
|
-
"prettier": "3.5.3"
|
|
48
|
-
"vitest": "3.1.4",
|
|
49
|
-
"@vitest/coverage-v8": "3.1.4"
|
|
47
|
+
"prettier": "3.5.3"
|
|
50
48
|
},
|
|
51
49
|
"scripts": {
|
|
52
50
|
"start": "elizaos start",
|
|
53
51
|
"dev": "elizaos dev",
|
|
54
52
|
"build": "tsup",
|
|
55
53
|
"lint": "prettier --write ./src ./__tests__",
|
|
56
|
-
"test:component": "
|
|
57
|
-
"test:e2e": "
|
|
58
|
-
"test": "
|
|
59
|
-
"test:coverage": "
|
|
60
|
-
"test:watch": "
|
|
54
|
+
"test:component": "bun test",
|
|
55
|
+
"test:e2e": "bun test --port 3001",
|
|
56
|
+
"test": "bun run test:component && bun run test:e2e",
|
|
57
|
+
"test:coverage": "bun test --coverage",
|
|
58
|
+
"test:watch": "bun test --watch",
|
|
61
59
|
"format": "prettier --write ./src ./__tests__",
|
|
62
60
|
"format:check": "prettier --check ./src ./__tests__"
|
|
63
61
|
},
|
|
Binary file
|