@nodeskai/genehub 2026.3.4-6 → 2026.3.5-1

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
@@ -825,14 +825,20 @@ ${geneBlock}
825
825
  await writeFile4(this.configPath, JSON.stringify(existing, null, 2), "utf-8");
826
826
  }
827
827
  async triggerLearning(prompt) {
828
- const { exec } = await import("child_process");
828
+ const { execFile, spawn } = await import("child_process");
829
829
  const { promisify } = await import("util");
830
- const execAsync = promisify(exec);
831
- const escaped = prompt.replace(/"/g, '\\"');
830
+ const { setTimeout: sleep } = await import("timers/promises");
831
+ const run = promisify(execFile);
832
832
  try {
833
- await execAsync(`openclaw agent --message "${escaped}"`, { timeout: 5e3 });
833
+ await run("openclaw", ["gateway", "restart"], { timeout: 15e3 });
834
834
  } catch {
835
835
  }
836
+ await sleep(5e3);
837
+ const child = spawn("openclaw", ["agent", "--agent", "main", "--message", prompt], {
838
+ detached: true,
839
+ stdio: "ignore"
840
+ });
841
+ child.unref();
836
842
  }
837
843
  async notifySkillChange(geneName, action) {
838
844
  await this.invalidateSkillSnapshots();
@@ -1215,7 +1221,7 @@ import { join as join5 } from "path";
1215
1221
  // ../sdk/typescript/src/learning/meta-gene.ts
1216
1222
  var SKILL_CONTENT = `---
1217
1223
  name: genehub-learner
1218
- version: 1.1.0
1224
+ version: 1.2.1
1219
1225
  description: GeneHub \u57FA\u56E0\u7BA1\u7406\u4E0E\u6DF1\u5EA6\u5B66\u4E60\u5F15\u64CE
1220
1226
  metadata:
1221
1227
  openclaw:
@@ -1320,6 +1326,8 @@ reason: "\u6211\u5DF2\u6DF1\u5165\u7406\u89E3\u4EE3\u7801\u5BA1\u67E5\u7684\u56D
1320
1326
  (\u4F60\u4E2A\u6027\u5316\u540E\u7684 SKILL.md \u5B8C\u6574\u5185\u5BB9\u653E\u5728\u8FD9\u91CC)
1321
1327
  \`\`\`
1322
1328
 
1329
+ **\u63D0\u4EA4\u7ED3\u679C\u540E\uFF0C\u5FC5\u987B\u7ACB\u5373\u5220\u9664 \`learning-tasks/\` \u76EE\u5F55\u4E0B\u5BF9\u5E94\u7684\u4EFB\u52A1\u6587\u4EF6\uFF0C\u4EE5\u9632\u91CD\u590D\u5904\u7406\u3002**
1330
+
1323
1331
  ### decision \u9009\u9879
1324
1332
 
1325
1333
  | \u503C | \u542B\u4E49 |
@@ -1350,7 +1358,7 @@ reason: "\u6211\u5DF2\u6DF1\u5165\u7406\u89E3\u4EE3\u7801\u5BA1\u67E5\u7684\u56D
1350
1358
  var META_LEARNER_MANIFEST = {
1351
1359
  slug: "genehub-learner",
1352
1360
  name: "GeneHub \u5B66\u4E60\u5F15\u64CE",
1353
- version: "1.1.0",
1361
+ version: "1.2.1",
1354
1362
  description: "GeneHub \u57FA\u56E0\u7BA1\u7406\u4E0E\u5B66\u4E60\u5F15\u64CE\u3002\u63D0\u4F9B\u4ECE GeneHub \u641C\u7D22\u3001\u5B89\u88C5\u3001\u6DF1\u5EA6\u5B66\u4E60\u57FA\u56E0\u7684\u5B8C\u6574\u80FD\u529B\u3002",
1355
1363
  short_description: "\u57FA\u56E0\u7BA1\u7406 + \u6DF1\u5EA6\u5B66\u4E60\u5F15\u64CE",
1356
1364
  category: "efficiency",
@@ -1430,11 +1438,14 @@ function generateLearningTaskMarkdown(task) {
1430
1438
  lines.push("");
1431
1439
  lines.push("## \u5B8C\u6210\u5B66\u4E60");
1432
1440
  lines.push("");
1433
- lines.push("\u5B66\u4E60\u5B8C\u6210\u540E\uFF0C\u8BF7\u6267\u884C\u4EE5\u4E0B\u64CD\u4F5C\uFF1A");
1441
+ lines.push("\u5B66\u4E60\u5B8C\u6210\u540E\uFF0C\u8BF7**\u4E25\u683C\u6309\u987A\u5E8F**\u6267\u884C\u4EE5\u4E0B\u64CD\u4F5C\uFF1A");
1434
1442
  lines.push("");
1435
1443
  lines.push(`1. \u5728 \`${task.callback_path}\` \u521B\u5EFA\u5B66\u4E60\u7ED3\u679C\u6587\u4EF6`);
1436
1444
  lines.push("2. \u5305\u542B YAML front matter\uFF08task_id, decision, self_eval\uFF09");
1437
1445
  lines.push("3. \u5982\u679C\u4F60\u4E2A\u6027\u5316\u4E86\u6280\u80FD\u5185\u5BB9\uFF0C\u5C06\u4FEE\u6539\u540E\u7684 SKILL.md \u5185\u5BB9\u653E\u5728\u6B63\u6587\u4E2D");
1446
+ lines.push(
1447
+ `4. **\u5220\u9664\u672C\u4EFB\u52A1\u6587\u4EF6** \u2014 \u786E\u8BA4\u7ED3\u679C\u6587\u4EF6\u5199\u5165\u6210\u529F\u540E\uFF0C\u7ACB\u5373\u5220\u9664 \`learning-tasks/${task.gene_slug}.md\`\uFF08\u5373\u672C\u6587\u4EF6\uFF09\uFF0C\u9632\u6B62\u4E0B\u6B21\u4F1A\u8BDD\u91CD\u590D\u5904\u7406`
1448
+ );
1438
1449
  lines.push("");
1439
1450
  lines.push("### \u7ED3\u679C\u6587\u4EF6\u6A21\u677F");
1440
1451
  lines.push("");
@@ -1476,7 +1487,9 @@ function generateForgetTaskMarkdown(slug, name, skillContent, callbackPath) {
1476
1487
  skillContent,
1477
1488
  "```",
1478
1489
  "",
1479
- `\u8BF7\u5C06\u9057\u5FD8\u7ED3\u679C\u5199\u5165 \`${callbackPath}\``
1490
+ `\u8BF7\u5C06\u9057\u5FD8\u7ED3\u679C\u5199\u5165 \`${callbackPath}\``,
1491
+ "",
1492
+ `**\u7ED3\u679C\u6587\u4EF6\u5199\u5165\u6210\u529F\u540E\uFF0C\u7ACB\u5373\u5220\u9664 \`learning-tasks/${slug}.md\`\uFF08\u5373\u672C\u6587\u4EF6\uFF09\uFF0C\u9632\u6B62\u4E0B\u6B21\u4F1A\u8BDD\u91CD\u590D\u5904\u7406\u3002**`
1480
1493
  ].join("\n");
1481
1494
  }
1482
1495
 
@@ -1532,7 +1545,8 @@ var LearningEngine = class {
1532
1545
  "1. Read `skills/genehub-learner/SKILL.md` for the full learning protocol",
1533
1546
  "2. Process each task file following those instructions",
1534
1547
  "3. Write results to `learning-results/`",
1535
- "4. Log what you learned in `memory/YYYY-MM-DD.md`",
1548
+ "4. **Delete the completed task file from `learning-tasks/`**",
1549
+ "5. Log what you learned in `memory/YYYY-MM-DD.md`",
1536
1550
  END
1537
1551
  ].join("\n");
1538
1552
  const everySession = content.indexOf("## Every Session");