@elizaos/cli 1.3.0 → 1.3.2

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 (148) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-2CUIHNPL.js → chunk-5GUS4CFO.js} +7 -2
  3. package/dist/{chunk-2ALAPQLV.js → chunk-E6XYTE3A.js} +296 -311
  4. package/dist/chunk-GXWWPFBO.js +39 -0
  5. package/dist/{chunk-I77ZRNYO.js → chunk-T2QDIXGU.js} +2 -2
  6. package/dist/commands/agent/actions/index.d.ts +5 -0
  7. package/dist/commands/agent/actions/index.js +2 -2
  8. package/dist/commands/agent/index.d.ts +2 -2
  9. package/dist/commands/agent/index.js +2 -2
  10. package/dist/commands/create/actions/index.js +3 -3
  11. package/dist/commands/create/index.js +4 -4
  12. package/dist/commands/shared/index.d.ts +11 -28
  13. package/dist/commands/shared/index.js +7 -3
  14. package/dist/index.js +541 -450
  15. package/dist/{registry-N626N4VG.js → registry-433S5F3Y.js} +2 -2
  16. package/dist/templates/plugin-quick-starter/.gitignore +66 -0
  17. package/dist/templates/plugin-quick-starter/.npmignore +5 -0
  18. package/dist/templates/plugin-quick-starter/package.json +11 -3
  19. package/dist/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
  20. package/dist/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
  21. package/dist/templates/plugin-quick-starter/src/plugin.ts +7 -13
  22. package/dist/templates/plugin-starter/.gitignore +66 -0
  23. package/dist/templates/plugin-starter/.npmignore +5 -0
  24. package/dist/templates/plugin-starter/README.md +1 -1
  25. package/dist/templates/plugin-starter/package.json +11 -3
  26. package/dist/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
  27. package/dist/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
  28. package/dist/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
  29. package/dist/templates/plugin-starter/src/plugin.ts +18 -22
  30. package/dist/templates/project-starter/.gitignore +57 -0
  31. package/dist/templates/project-starter/.npmignore +11 -0
  32. package/dist/templates/project-starter/README.md +1 -1
  33. package/dist/templates/project-starter/package.json +4 -4
  34. package/dist/templates/project-starter/src/__tests__/env.test.ts +3 -1
  35. package/dist/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
  36. package/dist/templates/project-starter/src/__tests__/integration.test.ts +1 -1
  37. package/dist/templates/project-starter/tsup.config.ts +2 -1
  38. package/dist/templates/project-tee-starter/.dockerignore +64 -14
  39. package/dist/templates/project-tee-starter/.gitignore +57 -0
  40. package/dist/templates/project-tee-starter/.npmignore +6 -0
  41. package/dist/templates/project-tee-starter/Dockerfile +9 -5
  42. package/dist/templates/project-tee-starter/GUIDE.md +103 -42
  43. package/dist/templates/project-tee-starter/README.md +39 -19
  44. package/dist/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
  45. package/dist/templates/project-tee-starter/__tests__/character.test.ts +19 -17
  46. package/dist/templates/project-tee-starter/__tests__/config.test.ts +10 -3
  47. package/dist/templates/project-tee-starter/__tests__/env.test.ts +2 -1
  48. package/dist/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
  49. package/dist/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
  50. package/dist/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
  51. package/dist/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
  52. package/dist/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
  53. package/dist/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
  54. package/dist/templates/project-tee-starter/docker-compose.yaml +5 -2
  55. package/dist/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
  56. package/dist/templates/project-tee-starter/package.json +34 -14
  57. package/dist/templates/project-tee-starter/postcss.config.js +3 -0
  58. package/dist/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
  59. package/dist/templates/project-tee-starter/scripts/test-all.sh +82 -0
  60. package/dist/templates/project-tee-starter/src/frontend/index.css +106 -0
  61. package/dist/templates/project-tee-starter/src/frontend/index.html +20 -0
  62. package/dist/templates/project-tee-starter/src/frontend/index.tsx +370 -0
  63. package/dist/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
  64. package/dist/templates/project-tee-starter/src/frontend/utils.ts +6 -0
  65. package/dist/templates/project-tee-starter/src/index.ts +6 -6
  66. package/dist/templates/project-tee-starter/src/plugin.ts +209 -59
  67. package/dist/templates/project-tee-starter/tailwind.config.js +62 -0
  68. package/dist/templates/project-tee-starter/tsconfig.build.json +2 -2
  69. package/dist/templates/project-tee-starter/tsconfig.json +8 -5
  70. package/dist/templates/project-tee-starter/tsup.config.ts +3 -2
  71. package/dist/templates/project-tee-starter/vite.config.ts +39 -0
  72. package/dist/url-utils-CKc_Ebt_.d.ts +35 -0
  73. package/dist/{utils-H66532NB.js → utils-DBLSDYBF.js} +2 -2
  74. package/package.json +12 -7
  75. package/templates/plugin-quick-starter/.gitignore +66 -0
  76. package/templates/plugin-quick-starter/.npmignore +5 -0
  77. package/templates/plugin-quick-starter/package.json +11 -3
  78. package/templates/plugin-quick-starter/src/__tests__/plugin.test.ts +499 -146
  79. package/templates/plugin-quick-starter/src/__tests__/test-utils.ts +316 -115
  80. package/templates/plugin-quick-starter/src/plugin.ts +7 -13
  81. package/templates/plugin-starter/.gitignore +66 -0
  82. package/templates/plugin-starter/.npmignore +5 -0
  83. package/templates/plugin-starter/README.md +1 -1
  84. package/templates/plugin-starter/package.json +11 -3
  85. package/templates/plugin-starter/src/__tests__/integration.test.ts +13 -13
  86. package/templates/plugin-starter/src/__tests__/plugin.test.ts +556 -129
  87. package/templates/plugin-starter/src/__tests__/test-utils.ts +347 -115
  88. package/templates/plugin-starter/src/plugin.ts +18 -22
  89. package/templates/project-starter/.gitignore +57 -0
  90. package/templates/project-starter/.npmignore +11 -0
  91. package/templates/project-starter/README.md +1 -1
  92. package/templates/project-starter/package.json +4 -4
  93. package/templates/project-starter/src/__tests__/env.test.ts +3 -1
  94. package/templates/project-starter/src/__tests__/file-structure.test.ts +3 -2
  95. package/templates/project-starter/src/__tests__/integration.test.ts +1 -1
  96. package/templates/project-starter/tsup.config.ts +2 -1
  97. package/templates/project-tee-starter/.dockerignore +64 -14
  98. package/templates/project-tee-starter/.gitignore +57 -0
  99. package/templates/project-tee-starter/.npmignore +6 -0
  100. package/templates/project-tee-starter/Dockerfile +9 -5
  101. package/templates/project-tee-starter/GUIDE.md +103 -42
  102. package/templates/project-tee-starter/README.md +39 -19
  103. package/templates/project-tee-starter/__tests__/build-order.test.ts +62 -0
  104. package/templates/project-tee-starter/__tests__/character.test.ts +19 -17
  105. package/templates/project-tee-starter/__tests__/config.test.ts +10 -3
  106. package/templates/project-tee-starter/__tests__/env.test.ts +2 -1
  107. package/templates/project-tee-starter/__tests__/file-structure.test.ts +14 -3
  108. package/templates/project-tee-starter/__tests__/frontend.test.ts +459 -0
  109. package/templates/project-tee-starter/__tests__/plugin.test.ts +4 -2
  110. package/templates/project-tee-starter/__tests__/routes.test.ts +15 -6
  111. package/templates/project-tee-starter/__tests__/tee-validation.test.ts +295 -0
  112. package/templates/project-tee-starter/__tests__/vite-config-utils.ts +39 -0
  113. package/templates/project-tee-starter/docker-compose.yaml +5 -2
  114. package/templates/{plugin-starter/dist → project-tee-starter}/index.html +3 -3
  115. package/templates/project-tee-starter/package.json +34 -14
  116. package/templates/project-tee-starter/postcss.config.js +3 -0
  117. package/templates/project-tee-starter/scripts/install-test-deps.js +52 -0
  118. package/templates/project-tee-starter/scripts/test-all.sh +82 -0
  119. package/templates/project-tee-starter/src/frontend/index.css +106 -0
  120. package/templates/project-tee-starter/src/frontend/index.html +20 -0
  121. package/templates/project-tee-starter/src/frontend/index.tsx +370 -0
  122. package/templates/project-tee-starter/src/frontend/panels.tsx +17 -0
  123. package/templates/project-tee-starter/src/frontend/utils.ts +6 -0
  124. package/templates/project-tee-starter/src/index.ts +6 -6
  125. package/templates/project-tee-starter/src/plugin.ts +209 -59
  126. package/templates/project-tee-starter/tailwind.config.js +62 -0
  127. package/templates/project-tee-starter/tsconfig.build.json +2 -2
  128. package/templates/project-tee-starter/tsconfig.json +8 -5
  129. package/templates/project-tee-starter/tsup.config.ts +3 -2
  130. package/templates/project-tee-starter/vite.config.ts +39 -0
  131. package/dist/chunk-4O6EZU37.js +0 -14
  132. package/dist/migration-guides/advanced-migration-guide.md +0 -459
  133. package/dist/migration-guides/completion-requirements.md +0 -379
  134. package/dist/migration-guides/integrated-migration-loop.md +0 -392
  135. package/dist/migration-guides/migration-guide.md +0 -712
  136. package/dist/migration-guides/prompt-and-generation-guide.md +0 -702
  137. package/dist/migration-guides/state-and-providers-guide.md +0 -544
  138. package/dist/migration-guides/testing-guide.md +0 -1021
  139. package/dist/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
  140. package/dist/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
  141. package/dist/templates/plugin-starter/dist/index.js +0 -387
  142. package/dist/templates/plugin-starter/dist/index.js.map +0 -1
  143. package/templates/plugin-starter/dist/.vite/manifest.json +0 -11
  144. package/templates/plugin-starter/dist/assets/index-CgkejLs_.css +0 -1
  145. package/templates/plugin-starter/dist/assets/index-D1cHX53P.js +0 -49
  146. package/templates/plugin-starter/dist/index.d.ts +0 -14
  147. package/templates/plugin-starter/dist/index.js +0 -387
  148. package/templates/plugin-starter/dist/index.js.map +0 -1
@@ -0,0 +1,39 @@
1
+ // src/commands/shared/url-utils.ts
2
+ function getAgentRuntimeUrl(opts) {
3
+ return opts.remoteUrl?.replace(/\/$/, "") || // Use the flag if provided
4
+ process.env.AGENT_RUNTIME_URL?.replace(/\/$/, "") || // Fallback to env var
5
+ `http://localhost:${opts.port || process.env.SERVER_PORT || "3000"}`;
6
+ }
7
+ function getAgentsBaseUrl(opts) {
8
+ return `${getAgentRuntimeUrl(opts)}/api/agents`;
9
+ }
10
+
11
+ // src/commands/shared/auth-utils.ts
12
+ function getAuthHeaders(opts) {
13
+ const authToken = opts.authToken || process.env.ELIZA_SERVER_AUTH_TOKEN;
14
+ if (authToken) {
15
+ return {
16
+ "X-API-KEY": authToken
17
+ };
18
+ }
19
+ return {};
20
+ }
21
+ function createApiClientConfig(opts) {
22
+ const authToken = opts.authToken || process.env.ELIZA_SERVER_AUTH_TOKEN;
23
+ return {
24
+ baseUrl: getAgentRuntimeUrl(opts),
25
+ apiKey: authToken,
26
+ timeout: 3e4,
27
+ // 30 seconds default
28
+ headers: {
29
+ "Content-Type": "application/json"
30
+ }
31
+ };
32
+ }
33
+
34
+ export {
35
+ getAgentRuntimeUrl,
36
+ getAgentsBaseUrl,
37
+ getAuthHeaders,
38
+ createApiClientConfig
39
+ };
@@ -9,11 +9,11 @@ import {
9
9
  selectEmbeddingModel,
10
10
  validateCreateOptions,
11
11
  validateProjectName
12
- } from "./chunk-2CUIHNPL.js";
12
+ } from "./chunk-5GUS4CFO.js";
13
13
  import {
14
14
  displayBanner,
15
15
  handleError
16
- } from "./chunk-2ALAPQLV.js";
16
+ } from "./chunk-E6XYTE3A.js";
17
17
 
18
18
  // src/commands/create/index.ts
19
19
  import { Command } from "commander";
@@ -1,5 +1,10 @@
1
1
  import { OptionValues } from 'commander';
2
2
 
3
+ /**
4
+ * Parse error response and throw appropriate error
5
+ * @param response - The fetch Response object
6
+ * @param defaultMessage - Default error message if JSON parsing fails
7
+ */
3
8
  /**
4
9
  * Get command implementation - retrieves and displays agent details
5
10
  */
@@ -5,9 +5,9 @@ import {
5
5
  setAgentConfig,
6
6
  startAgent,
7
7
  stopAgent
8
- } from "../../../chunk-2ALAPQLV.js";
8
+ } from "../../../chunk-E6XYTE3A.js";
9
9
  import "../../../chunk-FDEDLANP.js";
10
- import "../../../chunk-4O6EZU37.js";
10
+ import "../../../chunk-GXWWPFBO.js";
11
11
  import "../../../chunk-D3Q2UZLZ.js";
12
12
  import "../../../chunk-3RG5ZIWI.js";
13
13
  export {
@@ -1,6 +1,6 @@
1
1
  import { OptionValues, Command } from 'commander';
2
- import { AgentBasic } from '../shared/index.js';
3
- export { getAgentRuntimeUrl, getAgentsBaseUrl } from '../shared/index.js';
2
+ import { a as AgentBasic } from '../../url-utils-CKc_Ebt_.js';
3
+ export { g as getAgentRuntimeUrl, b as getAgentsBaseUrl } from '../../url-utils-CKc_Ebt_.js';
4
4
 
5
5
  /**
6
6
  * Asynchronously fetches a list of basic agent information from the server.
@@ -2,12 +2,12 @@ import {
2
2
  agent,
3
3
  getAgents,
4
4
  resolveAgentId
5
- } from "../../chunk-2ALAPQLV.js";
5
+ } from "../../chunk-E6XYTE3A.js";
6
6
  import "../../chunk-FDEDLANP.js";
7
7
  import {
8
8
  getAgentRuntimeUrl,
9
9
  getAgentsBaseUrl
10
- } from "../../chunk-4O6EZU37.js";
10
+ } from "../../chunk-GXWWPFBO.js";
11
11
  import "../../chunk-D3Q2UZLZ.js";
12
12
  import "../../chunk-3RG5ZIWI.js";
13
13
  export {
@@ -8,10 +8,10 @@ import {
8
8
  setupAIModelConfig,
9
9
  setupEmbeddingModelConfig,
10
10
  setupProjectEnvironment
11
- } from "../../../chunk-2CUIHNPL.js";
12
- import "../../../chunk-2ALAPQLV.js";
11
+ } from "../../../chunk-5GUS4CFO.js";
12
+ import "../../../chunk-E6XYTE3A.js";
13
13
  import "../../../chunk-FDEDLANP.js";
14
- import "../../../chunk-4O6EZU37.js";
14
+ import "../../../chunk-GXWWPFBO.js";
15
15
  import "../../../chunk-D3Q2UZLZ.js";
16
16
  import "../../../chunk-3RG5ZIWI.js";
17
17
  export {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  create
3
- } from "../../chunk-I77ZRNYO.js";
4
- import "../../chunk-2CUIHNPL.js";
5
- import "../../chunk-2ALAPQLV.js";
3
+ } from "../../chunk-T2QDIXGU.js";
4
+ import "../../chunk-5GUS4CFO.js";
5
+ import "../../chunk-E6XYTE3A.js";
6
6
  import "../../chunk-FDEDLANP.js";
7
- import "../../chunk-4O6EZU37.js";
7
+ import "../../chunk-GXWWPFBO.js";
8
8
  import "../../chunk-D3Q2UZLZ.js";
9
9
  import "../../chunk-3RG5ZIWI.js";
10
10
  export {
@@ -1,35 +1,18 @@
1
+ export { a as AgentBasic, A as ApiResponse, g as getAgentRuntimeUrl, b as getAgentsBaseUrl } from '../../url-utils-CKc_Ebt_.js';
1
2
  import { OptionValues } from 'commander';
3
+ import { ApiClientConfig } from '@elizaos/api-client';
2
4
 
3
5
  /**
4
- * Interface for defining the structure of an API response.
5
- * @template T - The type of data included in the response.
6
+ * Get authentication headers for API requests
7
+ * @param opts - Command options that may contain auth information
8
+ * @returns Headers object with authentication if token is available
6
9
  */
7
- interface ApiResponse<T> {
8
- success: boolean;
9
- data?: T;
10
- error?: {
11
- code: string;
12
- message: string;
13
- details?: unknown;
14
- };
15
- }
10
+ declare function getAuthHeaders(opts: OptionValues): Record<string, string>;
16
11
  /**
17
- * Defines the structure of AgentBasic interface.
12
+ * Create ApiClientConfig from CLI options
13
+ * @param opts - Command options that may contain auth and connection information
14
+ * @returns ApiClientConfig for use with @elizaos/api-client
18
15
  */
19
- interface AgentBasic {
20
- id: string;
21
- name: string;
22
- status?: string;
23
- [key: string]: unknown;
24
- }
16
+ declare function createApiClientConfig(opts: OptionValues): ApiClientConfig;
25
17
 
26
- /**
27
- * Helper function to determine the agent runtime URL
28
- */
29
- declare function getAgentRuntimeUrl(opts: OptionValues): string;
30
- /**
31
- * Helper function to get the agents base API URL
32
- */
33
- declare function getAgentsBaseUrl(opts: OptionValues): string;
34
-
35
- export { type AgentBasic, type ApiResponse, getAgentRuntimeUrl, getAgentsBaseUrl };
18
+ export { createApiClientConfig, getAuthHeaders };
@@ -1,9 +1,13 @@
1
1
  import {
2
+ createApiClientConfig,
2
3
  getAgentRuntimeUrl,
3
- getAgentsBaseUrl
4
- } from "../../chunk-4O6EZU37.js";
4
+ getAgentsBaseUrl,
5
+ getAuthHeaders
6
+ } from "../../chunk-GXWWPFBO.js";
5
7
  import "../../chunk-3RG5ZIWI.js";
6
8
  export {
9
+ createApiClientConfig,
7
10
  getAgentRuntimeUrl,
8
- getAgentsBaseUrl
11
+ getAgentsBaseUrl,
12
+ getAuthHeaders
9
13
  };