@elizaos/cli 1.4.2 → 1.4.4

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 (35) hide show
  1. package/dist/{chunk-SMZBJQJR.js → chunk-HOC6B3QV.js} +1 -1
  2. package/dist/{chunk-D3QSET5H.js → chunk-N5G5XSGP.js} +29 -5
  3. package/dist/{chunk-FSSUAWXQ.js → chunk-NSNXXD3I.js} +2 -2
  4. package/dist/commands/agent/actions/index.js +1 -1
  5. package/dist/commands/agent/index.js +1 -1
  6. package/dist/commands/create/actions/index.js +2 -2
  7. package/dist/commands/create/index.js +3 -3
  8. package/dist/index.js +138 -128
  9. package/dist/{registry-RF6PW3EN.js → registry-ELONUC44.js} +1 -1
  10. package/dist/templates/plugin-quick-starter/package.json +2 -2
  11. package/dist/templates/plugin-quick-starter/src/__tests__/test-utils.ts +1 -0
  12. package/dist/templates/plugin-starter/package.json +2 -2
  13. package/dist/templates/plugin-starter/src/__tests__/test-utils.ts +1 -0
  14. package/dist/templates/project-starter/package.json +4 -4
  15. package/dist/templates/project-starter/src/__tests__/config.test.ts +6 -15
  16. package/dist/templates/project-starter/src/__tests__/error-handling.test.ts +4 -18
  17. package/dist/templates/project-starter/src/__tests__/events.test.ts +27 -23
  18. package/dist/templates/project-tee-starter/package.json +4 -4
  19. package/dist/templates/project-tee-starter/src/__tests__/config.test.ts +40 -0
  20. package/dist/templates/project-tee-starter/src/index.ts +1 -2
  21. package/dist/templates/project-tee-starter/src/plugin.ts +21 -19
  22. package/dist/{utils-5HPZSIF6.js → utils-X6UXPLKD.js} +1 -1
  23. package/package.json +6 -7
  24. package/templates/plugin-quick-starter/package.json +2 -2
  25. package/templates/plugin-quick-starter/src/__tests__/test-utils.ts +1 -0
  26. package/templates/plugin-starter/package.json +2 -2
  27. package/templates/plugin-starter/src/__tests__/test-utils.ts +1 -0
  28. package/templates/project-starter/package.json +4 -4
  29. package/templates/project-starter/src/__tests__/config.test.ts +6 -15
  30. package/templates/project-starter/src/__tests__/error-handling.test.ts +4 -18
  31. package/templates/project-starter/src/__tests__/events.test.ts +27 -23
  32. package/templates/project-tee-starter/package.json +4 -4
  33. package/templates/project-tee-starter/src/__tests__/config.test.ts +40 -0
  34. package/templates/project-tee-starter/src/index.ts +1 -2
  35. package/templates/project-tee-starter/src/plugin.ts +21 -19
@@ -15,7 +15,7 @@ import {
15
15
  promptAndStorePostgresUrl,
16
16
  runTasks,
17
17
  setupPgLite
18
- } from "./chunk-D3QSET5H.js";
18
+ } from "./chunk-N5G5XSGP.js";
19
19
 
20
20
  // src/characters/eliza.ts
21
21
  var baseCharacter = {
@@ -2757,7 +2757,7 @@ async function getGitHubCredentials() {
2757
2757
  }
2758
2758
  logger10.warn("Invalid GitHub token found in environment variables");
2759
2759
  }
2760
- const { getGitHubToken: getGitHubToken2 } = await import("./registry-RF6PW3EN.js");
2760
+ const { getGitHubToken: getGitHubToken2 } = await import("./registry-ELONUC44.js");
2761
2761
  const token = await getGitHubToken2() || void 0;
2762
2762
  if (token) {
2763
2763
  const isValid2 = await validateGitHubToken(token);
@@ -2863,10 +2863,16 @@ async function ensureDirectory(token, repo, path22, branch) {
2863
2863
  } catch (error) {
2864
2864
  logger10.info(`Directory ${path22} doesn't exist, creating it`);
2865
2865
  }
2866
+ const [owner, repoName] = repo.split("/");
2867
+ if (!owner || !repoName) {
2868
+ logger10.error(`Invalid repository format: ${repo}. Expected format: owner/repo`);
2869
+ return false;
2870
+ }
2866
2871
  const placeholderPath = `${path22}/.gitkeep`;
2867
2872
  const result = await updateFile(
2868
2873
  token,
2869
- repo,
2874
+ owner,
2875
+ repoName,
2870
2876
  placeholderPath,
2871
2877
  "",
2872
2878
  // Empty content for placeholder
@@ -4615,7 +4621,7 @@ async function testPublishToGitHub(packageJson, username) {
4615
4621
  logger20.info("[\u2713] Can create and update files");
4616
4622
  return true;
4617
4623
  } catch (error) {
4618
- logger20.error("Test failed:", error);
4624
+ logger20.error({ error }, "Test failed:");
4619
4625
  return false;
4620
4626
  }
4621
4627
  }
@@ -4756,7 +4762,7 @@ async function publishToGitHub(cwd, packageJson, username, skipRegistry = false,
4756
4762
  insertIndex = i;
4757
4763
  break;
4758
4764
  }
4759
- const match = line.match(/^\s*"(@[^"]+)"/);
4765
+ const match = line.match(/^\s*"([^"]+)"/);
4760
4766
  if (match) {
4761
4767
  const existingPackage = match[1];
4762
4768
  if (registryPackageName < existingPackage) {
@@ -4777,7 +4783,25 @@ async function publishToGitHub(cwd, packageJson, username, skipRegistry = false,
4777
4783
  logger20.error("Could not find insertion point in index.json");
4778
4784
  return false;
4779
4785
  }
4780
- lines.splice(insertIndex, 0, newEntry);
4786
+ const isLastEntry = lines[insertIndex].trim() === "}";
4787
+ if (isLastEntry) {
4788
+ let prevLineIndex = insertIndex - 1;
4789
+ while (prevLineIndex >= 0 && lines[prevLineIndex].trim() === "") {
4790
+ prevLineIndex--;
4791
+ }
4792
+ if (prevLineIndex >= 0) {
4793
+ const prevLine = lines[prevLineIndex];
4794
+ const prevTrim = prevLine.trim();
4795
+ const isEntryLine = /^"[^"]+"\s*:/.test(prevTrim);
4796
+ if (isEntryLine && !prevTrim.endsWith(",")) {
4797
+ lines[prevLineIndex] = prevLine.trimEnd() + ",";
4798
+ }
4799
+ }
4800
+ const newEntryWithoutComma = newEntry.replace(/,\s*$/, "");
4801
+ lines.splice(insertIndex, 0, newEntryWithoutComma);
4802
+ } else {
4803
+ lines.splice(insertIndex, 0, newEntry);
4804
+ }
4781
4805
  const updatedContent = lines.join("\n");
4782
4806
  const indexUpdated = await updateFile(
4783
4807
  token,
@@ -9,11 +9,11 @@ import {
9
9
  selectEmbeddingModel,
10
10
  validateCreateOptions,
11
11
  validateProjectName
12
- } from "./chunk-SMZBJQJR.js";
12
+ } from "./chunk-HOC6B3QV.js";
13
13
  import {
14
14
  displayBanner,
15
15
  handleError
16
- } from "./chunk-D3QSET5H.js";
16
+ } from "./chunk-N5G5XSGP.js";
17
17
 
18
18
  // src/commands/create/index.ts
19
19
  import { Command } from "commander";
@@ -5,7 +5,7 @@ import {
5
5
  setAgentConfig,
6
6
  startAgent,
7
7
  stopAgent
8
- } from "../../../chunk-D3QSET5H.js";
8
+ } from "../../../chunk-N5G5XSGP.js";
9
9
  import "../../../chunk-FQYWRHLX.js";
10
10
  import "../../../chunk-GXWWPFBO.js";
11
11
  import "../../../chunk-I4L4T7QX.js";
@@ -2,7 +2,7 @@ import {
2
2
  agent,
3
3
  getAgents,
4
4
  resolveAgentId
5
- } from "../../chunk-D3QSET5H.js";
5
+ } from "../../chunk-N5G5XSGP.js";
6
6
  import "../../chunk-FQYWRHLX.js";
7
7
  import {
8
8
  getAgentRuntimeUrl,
@@ -8,8 +8,8 @@ import {
8
8
  setupAIModelConfig,
9
9
  setupEmbeddingModelConfig,
10
10
  setupProjectEnvironment
11
- } from "../../../chunk-SMZBJQJR.js";
12
- import "../../../chunk-D3QSET5H.js";
11
+ } from "../../../chunk-HOC6B3QV.js";
12
+ import "../../../chunk-N5G5XSGP.js";
13
13
  import "../../../chunk-FQYWRHLX.js";
14
14
  import "../../../chunk-GXWWPFBO.js";
15
15
  import "../../../chunk-I4L4T7QX.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  create
3
- } from "../../chunk-FSSUAWXQ.js";
4
- import "../../chunk-SMZBJQJR.js";
5
- import "../../chunk-D3QSET5H.js";
3
+ } from "../../chunk-NSNXXD3I.js";
4
+ import "../../chunk-HOC6B3QV.js";
5
+ import "../../chunk-N5G5XSGP.js";
6
6
  import "../../chunk-FQYWRHLX.js";
7
7
  import "../../chunk-GXWWPFBO.js";
8
8
  import "../../chunk-I4L4T7QX.js";