@elizaos/cli 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/{index-DDQnwxzL.js → index-CtxA4ev_.js} +32568 -31589
  3. package/dist/assets/{index-DDQnwxzL.js.map → index-CtxA4ev_.js.map} +1 -1
  4. package/dist/assets/{index-CmuPnu0u.js → index-xhCgCbS4.js} +2 -2
  5. package/dist/assets/index-xhCgCbS4.js.br +0 -0
  6. package/dist/assets/{index-CmuPnu0u.js.map → index-xhCgCbS4.js.map} +1 -1
  7. package/dist/assets/vendor-DSdxb8P-.js.map +1 -1
  8. package/dist/chunk-AQ6OMR2A.js +14 -0
  9. package/dist/chunk-KB3JDWUI.js +106 -0
  10. package/dist/{chunk-GWQB7PBK.js → chunk-PYMK3ECE.js} +44 -18
  11. package/dist/chunk-Y76S7TNK.js +5372 -0
  12. package/dist/{chunk-B4KJXECB.js → chunk-YDVNTQX3.js} +6 -6
  13. package/dist/commands/agent/actions/index.js +3 -3
  14. package/dist/commands/agent/index.js +3 -3
  15. package/dist/commands/create/actions/index.js +4 -4
  16. package/dist/commands/create/index.js +5 -5
  17. package/dist/commands/shared/index.js +1 -1
  18. package/dist/index.html +1 -1
  19. package/dist/index.js +344 -7703
  20. package/dist/migrator-UQ4XFYE5.js +744 -0
  21. package/dist/{plugin-creator-T4K2673C.js → plugin-creator-TLQLTQIB.js} +8 -11
  22. package/dist/{registry-CBMRMYCG.js → registry-7PBDJL64.js} +3 -3
  23. package/dist/templates/plugin-starter/bunfig.toml +5 -1
  24. package/dist/templates/plugin-starter/package.json +6 -8
  25. package/dist/templates/plugin-starter/scripts/install-test-deps.js +50 -0
  26. package/dist/templates/plugin-starter/src/index.ts +1 -1
  27. package/dist/templates/project-starter/bunfig.toml +13 -1
  28. package/dist/templates/project-starter/package.json +16 -20
  29. package/dist/templates/project-starter/scripts/install-test-deps.js +51 -0
  30. package/dist/templates/project-starter/src/__tests__/config.test.ts +9 -9
  31. package/dist/templates/project-starter/src/__tests__/error-handling.test.ts +11 -11
  32. package/dist/templates/project-starter/src/__tests__/events.test.ts +6 -6
  33. package/dist/templates/project-starter/src/__tests__/integration.test.ts +11 -11
  34. package/dist/templates/project-starter/src/__tests__/routes.test.ts +2 -2
  35. package/dist/templates/project-tee-starter/__tests__/env.test.ts +10 -6
  36. package/dist/templates/project-tee-starter/bunfig.toml +13 -1
  37. package/dist/templates/project-tee-starter/e2e/project.test.ts +1 -1
  38. package/dist/templates/project-tee-starter/e2e/starter-plugin.test.ts +1 -1
  39. package/dist/templates/project-tee-starter/package.json +3 -3
  40. package/dist/{utils-TIALZU53.js → utils-WRGBZBAJ.js} +9 -3
  41. package/package.json +28 -56
  42. package/templates/plugin-starter/bunfig.toml +5 -1
  43. package/templates/plugin-starter/package.json +6 -8
  44. package/templates/plugin-starter/scripts/install-test-deps.js +50 -0
  45. package/templates/plugin-starter/src/index.ts +1 -1
  46. package/templates/project-starter/bunfig.toml +13 -1
  47. package/templates/project-starter/package.json +16 -20
  48. package/templates/project-starter/scripts/install-test-deps.js +51 -0
  49. package/templates/project-starter/src/__tests__/config.test.ts +9 -9
  50. package/templates/project-starter/src/__tests__/error-handling.test.ts +11 -11
  51. package/templates/project-starter/src/__tests__/events.test.ts +6 -6
  52. package/templates/project-starter/src/__tests__/integration.test.ts +11 -11
  53. package/templates/project-starter/src/__tests__/routes.test.ts +2 -2
  54. package/templates/project-tee-starter/__tests__/env.test.ts +10 -6
  55. package/templates/project-tee-starter/bunfig.toml +13 -1
  56. package/templates/project-tee-starter/e2e/project.test.ts +1 -1
  57. package/templates/project-tee-starter/e2e/starter-plugin.test.ts +1 -1
  58. package/templates/project-tee-starter/package.json +3 -3
  59. package/dist/assets/index-CmuPnu0u.js.br +0 -0
  60. package/dist/chunk-2GXSCVA2.js +0 -2057
  61. package/dist/chunk-567UPUC7.js +0 -52
  62. package/dist/chunk-7HYEGM5V.js +0 -11098
  63. package/dist/chunk-LQ6XHF53.js +0 -19487
  64. package/dist/chunk-WS4DWCDZ.js +0 -892
  65. package/dist/fileFromPath-KB6XMTJ4.js +0 -133
  66. package/dist/migrator-JREQPDN3.js +0 -7523
  67. package/dist/pglite.data +0 -0
  68. package/dist/pglite.wasm +0 -0
@@ -2,24 +2,21 @@
2
2
  import { createRequire } from 'module';
3
3
  const require = createRequire(import.meta.url);
4
4
 
5
- import {
6
- esm_default,
7
- ora,
8
- sdk_default
9
- } from "./chunk-LQ6XHF53.js";
10
- import "./chunk-2GXSCVA2.js";
11
5
  import {
12
6
  runBunCommand
13
7
  } from "./chunk-RIAWNDYI.js";
14
- import "./chunk-WS4DWCDZ.js";
15
- import "./chunk-567UPUC7.js";
8
+ import "./chunk-KB3JDWUI.js";
9
+ import "./chunk-AQ6OMR2A.js";
16
10
 
17
11
  // src/utils/plugin-creator.ts
12
+ import Anthropic from "@anthropic-ai/sdk";
18
13
  import { logger } from "@elizaos/core";
19
14
  import { execa } from "execa";
20
15
  import * as fs from "fs-extra";
21
16
  import inquirer from "inquirer";
17
+ import ora from "ora";
22
18
  import * as path from "path";
19
+ import simpleGit from "simple-git";
23
20
  import * as os from "os";
24
21
  var MAX_BUILD_ITERATIONS = 5;
25
22
  var MAX_TEST_ITERATIONS = 5;
@@ -33,7 +30,7 @@ var PluginCreator = class {
33
30
  activeClaudeProcess = null;
34
31
  options;
35
32
  constructor(options = {}) {
36
- this.git = esm_default();
33
+ this.git = simpleGit();
37
34
  this.options = options;
38
35
  this.registerCleanupHandlers();
39
36
  }
@@ -63,7 +60,7 @@ var PluginCreator = class {
63
60
  logger.error("ANTHROPIC_API_KEY not found in environment.");
64
61
  throw new Error("ANTHROPIC_API_KEY is required for plugin generation");
65
62
  }
66
- this.anthropic = new sdk_default({ apiKey });
63
+ this.anthropic = new Anthropic({ apiKey });
67
64
  }
68
65
  async create(pluginSpec) {
69
66
  const spinner = ora("Initializing plugin creator...").start();
@@ -232,7 +229,7 @@ var PluginCreator = class {
232
229
  logger.warn("Failed to use elizaos create, creating structure manually");
233
230
  await this.createPluginStructureManually(pluginName);
234
231
  }
235
- this.git = esm_default(this.pluginPath);
232
+ this.git = simpleGit(this.pluginPath);
236
233
  await this.git.init();
237
234
  await this.git.add(".");
238
235
  await this.git.commit("Initial commit from plugin-starter template");
@@ -28,11 +28,11 @@ import {
28
28
  setEnvVar,
29
29
  setGitHubToken,
30
30
  validateDataDir
31
- } from "./chunk-7HYEGM5V.js";
31
+ } from "./chunk-Y76S7TNK.js";
32
32
  import "./chunk-RIAWNDYI.js";
33
- import "./chunk-WS4DWCDZ.js";
33
+ import "./chunk-KB3JDWUI.js";
34
34
  import "./chunk-F24MS2YR.js";
35
- import "./chunk-567UPUC7.js";
35
+ import "./chunk-AQ6OMR2A.js";
36
36
  export {
37
37
  checkDataDir,
38
38
  ensureElizaDir,
@@ -3,4 +3,8 @@ timeout = 60000
3
3
  coverage = true
4
4
 
5
5
  [test.env]
6
- NODE_ENV = "test"
6
+ NODE_ENV = "test"
7
+
8
+ coverage-exclude = [
9
+ "**/dist/**",
10
+ ]
@@ -50,12 +50,9 @@
50
50
  },
51
51
  "peerDependencies": {},
52
52
  "devDependencies": {
53
- "@cypress/react": "^9.0.1",
54
53
  "@elizaos/cli": "^1.0.0",
55
54
  "@tailwindcss/vite": "^4.1.10",
56
- "@testing-library/cypress": "^10.0.3",
57
55
  "@vitejs/plugin-react-swc": "^3.10.2",
58
- "cypress": "^14.4.1",
59
56
  "dotenv": "16.4.5",
60
57
  "prettier": "3.5.3",
61
58
  "tailwindcss-animate": "^1.0.7",
@@ -67,11 +64,12 @@
67
64
  "dev": "elizaos dev",
68
65
  "build": "tsc --noEmit && vite build && tsup",
69
66
  "lint": "prettier --write ./src",
70
- "test:component": "bun test",
71
- "test:e2e": "bun test",
72
- "test:e2e:manual": "node scripts/test-e2e-manual.js",
73
- "test:cypress": "cypress run --component",
74
- "test": "bun run test:component && bun run test:e2e",
67
+ "test:component": "bun run test:install && bun test",
68
+ "test:e2e": "bun run test:install && bun test",
69
+ "test:e2e:manual": "bun run test:install && node scripts/test-e2e-manual.js",
70
+ "test:cypress": "bun run test:install && cypress run --component",
71
+ "test": "bun run test:install && bun run test:component && bun run test:e2e",
72
+ "test:install": "node scripts/install-test-deps.js",
75
73
  "publish": "elizaos publish",
76
74
  "format": "prettier --write ./src",
77
75
  "format:check": "prettier --check ./src"
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, readFileSync } from 'fs';
4
+ import { execSync } from 'child_process';
5
+ import { join } from 'path';
6
+
7
+ const testDependencies = {
8
+ '@cypress/react': '^9.0.1',
9
+ '@testing-library/cypress': '^10.0.3',
10
+ cypress: '^14.4.1',
11
+ };
12
+
13
+ function isInstalled(packageName) {
14
+ try {
15
+ const packageJsonPath = join(process.cwd(), 'package.json');
16
+ if (existsSync(packageJsonPath)) {
17
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
18
+ const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
19
+ return packageName in deps;
20
+ }
21
+ } catch (error) {
22
+ // Silent fail, will install if error
23
+ }
24
+ return false;
25
+ }
26
+
27
+ function installTestDependencies() {
28
+ const missingDeps = Object.entries(testDependencies)
29
+ .filter(([name]) => !isInstalled(name))
30
+ .map(([name, version]) => `${name}@${version}`);
31
+
32
+ if (missingDeps.length === 0) {
33
+ console.log('✓ Test dependencies already installed');
34
+ return;
35
+ }
36
+
37
+ console.log('Installing test dependencies...');
38
+ try {
39
+ execSync(`bun add -d ${missingDeps.join(' ')}`, {
40
+ stdio: 'inherit',
41
+ cwd: process.cwd(),
42
+ });
43
+ console.log('✓ Test dependencies installed successfully');
44
+ } catch (error) {
45
+ console.error('Failed to install test dependencies:', error.message);
46
+ process.exit(1);
47
+ }
48
+ }
49
+
50
+ installTestDependencies();
@@ -268,7 +268,7 @@ export const starterPlugin: Plugin = {
268
268
  actions: [helloWorldAction],
269
269
  providers: [helloWorldProvider],
270
270
  tests: [StarterPluginTestSuite],
271
- // dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependecies go here (if requires another plugin)
271
+ // dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependencies go here (if requires another plugin)
272
272
  };
273
273
 
274
274
  export default starterPlugin;
@@ -3,4 +3,16 @@ timeout = 60000
3
3
  coverage = true
4
4
 
5
5
  [test.env]
6
- NODE_ENV = "test"
6
+ NODE_ENV = "test"
7
+
8
+ coverage-exclude = [
9
+ "**/dist/**",
10
+ "**/build/**",
11
+ "**/chunk-*.js",
12
+ "**/*.chunk.js",
13
+ "**/node_modules/**",
14
+ "**/*.min.js",
15
+ "**/*.bundle.js",
16
+ "**/coverage/**",
17
+ "**/.turbo/**",
18
+ ]
@@ -28,11 +28,10 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@elizaos/cli": "1.0.9",
32
- "@elizaos/core": "1.0.9",
33
- "@elizaos/plugin-bootstrap": "1.0.9",
34
- "@elizaos/plugin-discord": "1.0.10",
35
- "@elizaos/plugin-sql": "1.0.9",
31
+ "@elizaos/cli": "1.0.12",
32
+ "@elizaos/core": "1.0.12",
33
+ "@elizaos/plugin-bootstrap": "1.0.12",
34
+ "@elizaos/plugin-sql": "1.0.12",
36
35
  "@tanstack/react-query": "^5.29.0",
37
36
  "clsx": "^2.1.1",
38
37
  "react": "^18.3.1",
@@ -42,13 +41,9 @@
42
41
  "zod": "3.24.2"
43
42
  },
44
43
  "devDependencies": {
45
- "@cypress/react": "^9.0.1",
46
- "@cypress/vite-dev-server": "^6.0.3",
47
- "@testing-library/cypress": "^10.0.3",
48
44
  "@types/react": "^18.3.3",
49
45
  "@types/react-dom": "^18.3.0",
50
46
  "@vitejs/plugin-react": "^4.3.1",
51
- "cypress": "^14.4.1",
52
47
  "prettier": "3.5.3",
53
48
  "tsup": "8.5.0",
54
49
  "typescript": "^5.6.3",
@@ -61,20 +56,21 @@
61
56
  "lint": "prettier --write ./src",
62
57
  "type-check": "tsc --noEmit",
63
58
  "type-check:watch": "tsc --noEmit --watch",
64
- "test:component": "bun test",
65
- "test:e2e": "bun test",
66
- "test": "bun run test:component && bun run test:e2e",
67
- "test:coverage": "bun test --coverage",
68
- "test:watch": "bun test --watch",
59
+ "test:component": "bun run test:install && bun test",
60
+ "test:e2e": "bun run test:install && bun test",
61
+ "test": "bun run test:install && bun run test:component && bun run test:e2e",
62
+ "test:coverage": "bun run test:install && bun test --coverage",
63
+ "test:watch": "bun run test:install && bun test --watch",
64
+ "test:install": "node scripts/install-test-deps.js",
69
65
  "format": "prettier --write ./src",
70
66
  "format:check": "prettier --check ./src",
71
67
  "check-all": "bun run type-check && bun run format:check && bun run test",
72
- "cy:open": "cypress open",
73
- "cy:run": "cypress run --component",
74
- "cy:test": "cypress run --component --reporter spec",
75
- "cypress:component": "cypress run --component",
76
- "cypress:e2e": "cypress run --e2e",
77
- "cypress:open": "cypress open"
68
+ "cy:open": "bun run test:install && cypress open",
69
+ "cy:run": "bun run test:install && cypress run --component",
70
+ "cy:test": "bun run test:install && cypress run --component --reporter spec",
71
+ "cypress:component": "bun run test:install && cypress run --component",
72
+ "cypress:e2e": "bun run test:install && cypress run --e2e",
73
+ "cypress:open": "bun run test:install && cypress open"
78
74
  },
79
75
  "publishConfig": {
80
76
  "access": "public"
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, readFileSync } from 'fs';
4
+ import { execSync } from 'child_process';
5
+ import { join } from 'path';
6
+
7
+ const testDependencies = {
8
+ '@cypress/react': '^9.0.1',
9
+ '@cypress/vite-dev-server': '^6.0.3',
10
+ '@testing-library/cypress': '^10.0.3',
11
+ cypress: '^14.4.1',
12
+ };
13
+
14
+ function isInstalled(packageName) {
15
+ try {
16
+ const packageJsonPath = join(process.cwd(), 'package.json');
17
+ if (existsSync(packageJsonPath)) {
18
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
19
+ const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
20
+ return packageName in deps;
21
+ }
22
+ } catch (error) {
23
+ // Silent fail, will install if error
24
+ }
25
+ return false;
26
+ }
27
+
28
+ function installTestDependencies() {
29
+ const missingDeps = Object.entries(testDependencies)
30
+ .filter(([name]) => !isInstalled(name))
31
+ .map(([name, version]) => `${name}@${version}`);
32
+
33
+ if (missingDeps.length === 0) {
34
+ console.log('✓ Test dependencies already installed');
35
+ return;
36
+ }
37
+
38
+ console.log('Installing test dependencies...');
39
+ try {
40
+ execSync(`bun add -d ${missingDeps.join(' ')}`, {
41
+ stdio: 'inherit',
42
+ cwd: process.cwd(),
43
+ });
44
+ console.log('✓ Test dependencies installed successfully');
45
+ } catch (error) {
46
+ console.error('Failed to install test dependencies:', error.message);
47
+ process.exit(1);
48
+ }
49
+ }
50
+
51
+ installTestDependencies();
@@ -1,17 +1,17 @@
1
- import { describe, expect, it, spyOn, beforeEach, afterEach } from 'bun:test';
1
+ import { describe, expect, it, beforeEach, afterEach, mock } from 'bun:test';
2
2
  import plugin from '../plugin';
3
3
  import { z } from 'zod';
4
4
  import { createMockRuntime } from './utils/core-test-utils';
5
5
 
6
6
  // Mock logger
7
- spyOnmock('@elizaos/core', async () => {
8
- const actual = await spyOnimportActual('@elizaos/core');
7
+ mock.module('@elizaos/core', () => {
8
+ const actual = require('@elizaos/core');
9
9
  return {
10
10
  ...actual,
11
11
  logger: {
12
- info: spyOnfn(),
13
- error: spyOnfn(),
14
- warn: spyOnfn(),
12
+ info: mock(),
13
+ error: mock(),
14
+ warn: mock(),
15
15
  },
16
16
  };
17
17
  });
@@ -24,7 +24,7 @@ describe('Plugin Configuration Schema', () => {
24
24
  const originalEnv = { ...process.env };
25
25
 
26
26
  beforeEach(() => {
27
- spyOnclearAllMocks();
27
+ mock.restore();
28
28
  // Reset environment variables before each test
29
29
  process.env = { ...originalEnv };
30
30
  });
@@ -150,7 +150,7 @@ describe('Plugin Configuration Schema', () => {
150
150
 
151
151
  // Mock the parseAsync function
152
152
  const originalParseAsync = schema.parseAsync;
153
- schema.parseAsync = spyOnfn().mockRejectedValue(mockZodError);
153
+ schema.parseAsync = mock().mockRejectedValue(mockZodError);
154
154
 
155
155
  try {
156
156
  // Use the mocked schema directly to avoid TypeScript errors
@@ -176,7 +176,7 @@ describe('Plugin Configuration Schema', () => {
176
176
 
177
177
  // Mock the parseAsync function
178
178
  const originalParseAsync = schema.parseAsync;
179
- schema.parseAsync = spyOnfn().mockRejectedValue(genericError);
179
+ schema.parseAsync = mock().mockRejectedValue(genericError);
180
180
 
181
181
  try {
182
182
  // Use the mocked schema directly to avoid TypeScript errors
@@ -1,4 +1,4 @@
1
- import { describe, expect, it, spyOn, beforeEach, afterEach } from 'bun:test';
1
+ import { describe, expect, it, beforeEach, afterEach, mock, spyOn } from 'bun:test';
2
2
  import plugin from '../plugin';
3
3
  import { StarterService } from '../plugin';
4
4
  import { logger } from '@elizaos/core';
@@ -6,21 +6,21 @@ import type { IAgentRuntime, Memory, State } from '@elizaos/core';
6
6
  import { v4 as uuidv4 } from 'uuid';
7
7
 
8
8
  // Mock logger
9
- spyOnmock('@elizaos/core', async () => {
10
- const actual = await spyOnimportActual('@elizaos/core');
9
+ mock.module('@elizaos/core', () => {
10
+ const actual = require('@elizaos/core');
11
11
  return {
12
12
  ...actual,
13
13
  logger: {
14
- info: spyOnfn(),
15
- error: spyOnfn(),
16
- warn: spyOnfn(),
14
+ info: mock(),
15
+ error: mock(),
16
+ warn: mock(),
17
17
  },
18
18
  };
19
19
  });
20
20
 
21
21
  describe('Error Handling', () => {
22
22
  beforeEach(() => {
23
- spyOnclearAllMocks();
23
+ mock.restore();
24
24
  });
25
25
 
26
26
  afterEach(() => {
@@ -57,7 +57,7 @@ describe('Error Handling', () => {
57
57
  text: '',
58
58
  } as State;
59
59
 
60
- const mockCallback = spyOnfn();
60
+ const mockCallback = mock();
61
61
 
62
62
  // Mock the logger.error to verify it's called
63
63
  spyOn(logger, 'error');
@@ -80,7 +80,7 @@ describe('Error Handling', () => {
80
80
  describe('Service Error Handling', () => {
81
81
  it('should throw an error when stopping non-existent service', async () => {
82
82
  const mockRuntime = {
83
- getService: spyOnfn().mockReturnValue(null),
83
+ getService: mock().mockReturnValue(null),
84
84
  } as unknown as IAgentRuntime;
85
85
 
86
86
  let caughtError = null;
@@ -97,13 +97,13 @@ describe('Error Handling', () => {
97
97
 
98
98
  it('should handle service stop errors gracefully', async () => {
99
99
  const mockServiceWithError = {
100
- stop: spyOnfn().mockImplementation(() => {
100
+ stop: mock().mockImplementation(() => {
101
101
  throw new Error('Error stopping service');
102
102
  }),
103
103
  };
104
104
 
105
105
  const mockRuntime = {
106
- getService: spyOnfn().mockReturnValue(mockServiceWithError),
106
+ getService: mock().mockReturnValue(mockServiceWithError),
107
107
  } as unknown as IAgentRuntime;
108
108
 
109
109
  // The error should be propagated
@@ -1,22 +1,22 @@
1
- import { describe, expect, it, spyOn, beforeEach } from 'bun:test';
1
+ import { describe, expect, it, beforeEach, mock } from 'bun:test';
2
2
  import plugin from '../plugin';
3
3
  import { logger } from '@elizaos/core';
4
4
 
5
5
  // Mock logger
6
- spyOnmock('@elizaos/core', async () => {
7
- const actual = await spyOnimportActual('@elizaos/core');
6
+ mock.module('@elizaos/core', () => {
7
+ const actual = require('@elizaos/core');
8
8
  return {
9
9
  ...actual,
10
10
  logger: {
11
- info: spyOnfn(),
12
- error: spyOnfn(),
11
+ info: mock(),
12
+ error: mock(),
13
13
  },
14
14
  };
15
15
  });
16
16
 
17
17
  describe('Plugin Events', () => {
18
18
  beforeEach(() => {
19
- spyOnclearAllMocks();
19
+ mock.restore();
20
20
  });
21
21
 
22
22
  it('should have events defined', () => {
@@ -2,7 +2,7 @@ import { IAgentRuntime, logger, Plugin } from '@elizaos/core';
2
2
  import * as fs from 'node:fs';
3
3
  import * as os from 'node:os';
4
4
  import * as path from 'node:path';
5
- import { afterAll, beforeAll, describe, expect, it } from 'bun:test';
5
+ import { afterAll, beforeAll, describe, expect, it, mock, spyOn } from 'bun:test';
6
6
  import { character } from '../index';
7
7
  import plugin from '../plugin';
8
8
 
@@ -92,27 +92,27 @@ describe('Integration: Runtime Initialization', () => {
92
92
  const customMockRuntime = {
93
93
  character: { ...character },
94
94
  plugins: [],
95
- registerPlugin: spyOnfn().mockImplementation((plugin: Plugin) => {
95
+ registerPlugin: mock().mockImplementation((plugin: Plugin) => {
96
96
  // In a real runtime, registering the plugin would call its init method,
97
97
  // but since we're testing init itself, we just need to record the call
98
98
  return Promise.resolve();
99
99
  }),
100
- initialize: spyOnfn(),
101
- getService: spyOnfn(),
102
- getSetting: spyOnfn().mockReturnValue(null),
103
- useModel: spyOnfn().mockResolvedValue('Test model response'),
104
- getProviderResults: spyOnfn().mockResolvedValue([]),
105
- evaluateProviders: spyOnfn().mockResolvedValue([]),
106
- evaluate: spyOnfn().mockResolvedValue([]),
100
+ initialize: mock(),
101
+ getService: mock(),
102
+ getSetting: mock().mockReturnValue(null),
103
+ useModel: mock().mockResolvedValue('Test model response'),
104
+ getProviderResults: mock().mockResolvedValue([]),
105
+ evaluateProviders: mock().mockResolvedValue([]),
106
+ evaluate: mock().mockResolvedValue([]),
107
107
  } as unknown as IAgentRuntime;
108
108
 
109
109
  // Ensure we're testing safely - to avoid parallel test race conditions
110
110
  const originalInit = plugin.init;
111
111
  let initCalled = false;
112
112
 
113
- // Mock the plugin.init method using spyOnfn instead of direct assignment
113
+ // Mock the plugin.init method using mock instead of direct assignment
114
114
  if (plugin.init) {
115
- plugin.init = spyOnfn(async (config, runtime) => {
115
+ plugin.init = mock(async (config, runtime) => {
116
116
  // Set flag to indicate our wrapper was called
117
117
  initCalled = true;
118
118
 
@@ -1,4 +1,4 @@
1
- import { describe, expect, it } from 'bun:test';
1
+ import { describe, expect, it, mock } from 'bun:test';
2
2
  import plugin from '../plugin';
3
3
 
4
4
  describe('Plugin Routes', () => {
@@ -30,7 +30,7 @@ describe('Plugin Routes', () => {
30
30
  // Create mock request and response objects
31
31
  const mockReq = {};
32
32
  const mockRes = {
33
- json: spyOnfn(),
33
+ json: mock(),
34
34
  };
35
35
 
36
36
  // Mock runtime object as third parameter
@@ -1,6 +1,10 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { describe, expect, it } from 'bun:test';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ const projectRoot = path.resolve(__dirname, '..');
4
8
 
5
9
  describe('Environment Setup', () => {
6
10
  it('should verify configuration files exist', () => {
@@ -13,13 +17,13 @@ describe('Environment Setup', () => {
13
17
  ];
14
18
 
15
19
  for (const file of requiredFiles) {
16
- const filePath = path.join(process.cwd(), file);
20
+ const filePath = path.join(projectRoot, file);
17
21
  expect(fs.existsSync(filePath)).toBe(true);
18
22
  }
19
23
  });
20
24
 
21
25
  it('should have proper src directory structure', () => {
22
- const srcDir = path.join(process.cwd(), 'src');
26
+ const srcDir = path.join(projectRoot, 'src');
23
27
  expect(fs.existsSync(srcDir)).toBe(true);
24
28
 
25
29
  const requiredSrcFiles = ['index.ts', 'plugin.ts'];
@@ -31,7 +35,7 @@ describe('Environment Setup', () => {
31
35
  });
32
36
 
33
37
  it('should have a valid package.json with required fields', () => {
34
- const packageJsonPath = path.join(process.cwd(), 'package.json');
38
+ const packageJsonPath = path.join(projectRoot, 'package.json');
35
39
  expect(fs.existsSync(packageJsonPath)).toBe(true);
36
40
 
37
41
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
@@ -54,7 +58,7 @@ describe('Environment Setup', () => {
54
58
  });
55
59
 
56
60
  it('should have a valid tsconfig.json with required configuration', () => {
57
- const tsconfigPath = path.join(process.cwd(), 'tsconfig.json');
61
+ const tsconfigPath = path.join(projectRoot, 'tsconfig.json');
58
62
  expect(fs.existsSync(tsconfigPath)).toBe(true);
59
63
 
60
64
  const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, 'utf8'));
@@ -68,7 +72,7 @@ describe('Environment Setup', () => {
68
72
  });
69
73
 
70
74
  it('should have a valid tsup.config.ts for building', () => {
71
- const tsupConfigPath = path.join(process.cwd(), 'tsup.config.ts');
75
+ const tsupConfigPath = path.join(projectRoot, 'tsup.config.ts');
72
76
  expect(fs.existsSync(tsupConfigPath)).toBe(true);
73
77
 
74
78
  const tsupConfig = fs.readFileSync(tsupConfigPath, 'utf8');
@@ -78,7 +82,7 @@ describe('Environment Setup', () => {
78
82
  });
79
83
 
80
84
  it('should have a valid README.md file', () => {
81
- const readmePath = path.join(process.cwd(), 'README.md');
85
+ const readmePath = path.join(projectRoot, 'README.md');
82
86
  expect(fs.existsSync(readmePath)).toBe(true);
83
87
 
84
88
  const readme = fs.readFileSync(readmePath, 'utf8');
@@ -3,4 +3,16 @@ timeout = 60000
3
3
  coverage = true
4
4
 
5
5
  [test.env]
6
- NODE_ENV = "test"
6
+ NODE_ENV = "test"
7
+
8
+ coverage-exclude = [
9
+ "**/dist/**",
10
+ "**/build/**",
11
+ "**/chunk-*.js",
12
+ "**/*.chunk.js",
13
+ "**/node_modules/**",
14
+ "**/*.min.js",
15
+ "**/*.bundle.js",
16
+ "**/coverage/**",
17
+ "**/.turbo/**",
18
+ ]
@@ -1,5 +1,5 @@
1
1
  import type { TestSuite, IAgentRuntime } from '@elizaos/core';
2
- import { character as mrTeeCharacter } from '../dist/index.js';
2
+ import { character as mrTeeCharacter } from '../src/index';
3
3
 
4
4
  export class MrTeeProjectTestSuite implements TestSuite {
5
5
  name = 'mr-tee-project';
@@ -1,4 +1,4 @@
1
- import { character } from '../dist/index.js';
1
+ import { character } from '../src/index';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
 
4
4
  // Define a minimal TestSuite interface that matches what's needed
@@ -33,10 +33,10 @@
33
33
  "GUIDE.md"
34
34
  ],
35
35
  "dependencies": {
36
- "@elizaos/cli": "1.0.9",
37
- "@elizaos/core": "1.0.9",
36
+ "@elizaos/cli": "1.0.12",
37
+ "@elizaos/core": "1.0.12",
38
38
  "@elizaos/plugin-redpill": "1.0.3",
39
- "@elizaos/plugin-sql": "1.0.9",
39
+ "@elizaos/plugin-sql": "1.0.12",
40
40
  "@phala/dstack-sdk": "0.1.11",
41
41
  "@solana/web3.js": "1.98.2",
42
42
  "viem": "2.30.1",