@innominatum/agentforge-cli 1.0.7 → 1.0.9

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/dist/index.js CHANGED
@@ -175,7 +175,7 @@ newCmd
175
175
  const agentJson = {
176
176
  agent_key: slug,
177
177
  display_name: name,
178
- agent_type: "custom",
178
+ agent_type: "predefined",
179
179
  status: "active",
180
180
  emoji: "🔥",
181
181
  context_window: 200000,
@@ -198,7 +198,7 @@ newCmd
198
198
  const agentJson = {
199
199
  agent_key: slug,
200
200
  display_name: name,
201
- agent_type: "custom",
201
+ agent_type: "predefined",
202
202
  provider: config.goclaw?.default_provider || "ollama cloud",
203
203
  model: config.goclaw?.default_model || "deepseek-v4-pro",
204
204
  other_config: {
@@ -619,6 +619,39 @@ pullCmd
619
619
  }
620
620
  await fs_extra_1.default.remove(contextDir);
621
621
  }
622
+ // Reconstruir ficheiros de memória a partir de JSONL
623
+ const memoryDir = path_1.default.join(agentPath, "memory");
624
+ if (await fs_extra_1.default.pathExists(memoryDir)) {
625
+ const processJsonl = async (filePath) => {
626
+ if (!(await fs_extra_1.default.pathExists(filePath)))
627
+ return;
628
+ const content = await fs_extra_1.default.readFile(filePath, 'utf8');
629
+ const lines = content.split('\n').filter(l => l.trim());
630
+ for (const line of lines) {
631
+ try {
632
+ const entry = JSON.parse(line);
633
+ if (entry.path && entry.content) {
634
+ const targetPath = path_1.default.join(agentPath, entry.path);
635
+ await fs_extra_1.default.ensureDir(path_1.default.dirname(targetPath));
636
+ await fs_extra_1.default.writeFile(targetPath, entry.content);
637
+ }
638
+ }
639
+ catch (e) { }
640
+ }
641
+ await fs_extra_1.default.remove(filePath);
642
+ };
643
+ await processJsonl(path_1.default.join(memoryDir, "global.jsonl"));
644
+ const usersDir = path_1.default.join(memoryDir, "users");
645
+ if (await fs_extra_1.default.pathExists(usersDir)) {
646
+ const userFiles = await fs_extra_1.default.readdir(usersDir);
647
+ for (const uf of userFiles) {
648
+ if (uf.endsWith(".jsonl")) {
649
+ await processJsonl(path_1.default.join(usersDir, uf));
650
+ }
651
+ }
652
+ await fs_extra_1.default.remove(usersDir);
653
+ }
654
+ }
622
655
  }
623
656
  finally {
624
657
  if (await fs_extra_1.default.pathExists(tempTarPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innominatum/agentforge-cli",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A powerful command-line interface to scaffold, manage, build, and deploy AI Agents and Skills for the GoClaw platform.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -163,7 +163,7 @@ newCmd
163
163
  const agentJson = {
164
164
  agent_key: slug,
165
165
  display_name: name,
166
- agent_type: "custom",
166
+ agent_type: "predefined",
167
167
  status: "active",
168
168
  emoji: "🔥",
169
169
  context_window: 200000,
@@ -186,7 +186,7 @@ newCmd
186
186
  const agentJson = {
187
187
  agent_key: slug,
188
188
  display_name: name,
189
- agent_type: "custom",
189
+ agent_type: "predefined",
190
190
  provider: config.goclaw?.default_provider || "ollama cloud",
191
191
  model: config.goclaw?.default_model || "deepseek-v4-pro",
192
192
  other_config: {
@@ -677,6 +677,39 @@ pullCmd
677
677
  }
678
678
  await fs.remove(contextDir);
679
679
  }
680
+
681
+ // Reconstruir ficheiros de memória a partir de JSONL
682
+ const memoryDir = path.join(agentPath, "memory");
683
+ if (await fs.pathExists(memoryDir)) {
684
+ const processJsonl = async (filePath: string) => {
685
+ if (!(await fs.pathExists(filePath))) return;
686
+ const content = await fs.readFile(filePath, 'utf8');
687
+ const lines = content.split('\n').filter(l => l.trim());
688
+ for (const line of lines) {
689
+ try {
690
+ const entry = JSON.parse(line);
691
+ if (entry.path && entry.content) {
692
+ const targetPath = path.join(agentPath, entry.path);
693
+ await fs.ensureDir(path.dirname(targetPath));
694
+ await fs.writeFile(targetPath, entry.content);
695
+ }
696
+ } catch (e) {}
697
+ }
698
+ await fs.remove(filePath);
699
+ };
700
+
701
+ await processJsonl(path.join(memoryDir, "global.jsonl"));
702
+ const usersDir = path.join(memoryDir, "users");
703
+ if (await fs.pathExists(usersDir)) {
704
+ const userFiles = await fs.readdir(usersDir);
705
+ for (const uf of userFiles) {
706
+ if (uf.endsWith(".jsonl")) {
707
+ await processJsonl(path.join(usersDir, uf));
708
+ }
709
+ }
710
+ await fs.remove(usersDir);
711
+ }
712
+ }
680
713
  } finally {
681
714
  if (await fs.pathExists(tempTarPath)) {
682
715
  await fs.remove(tempTarPath);