agentlife 1.2.2 → 1.2.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 (2) hide show
  1. package/dist/index.js +14 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1486,7 +1486,7 @@ var PROVISIONED_AGENTS = [
1486
1486
  id: "agentlife-builder",
1487
1487
  name: "AgentLife Builder",
1488
1488
  agentsMd: BUILDER_AGENTS_MD,
1489
- tools: { profile: "full" }
1489
+ tools: { profile: "full", allow: ["agentlife_push"] }
1490
1490
  },
1491
1491
  {
1492
1492
  id: "supervisor",
@@ -1632,18 +1632,21 @@ async function ensureVisionPosters(state, runtime, log, options = {}) {
1632
1632
  }
1633
1633
  const { totalChars, sections } = await gatherAllAgentMemory(state, finalList, SKIP_IDS);
1634
1634
  if (totalChars < VISION_MIN_MEMORY_CHARS) {
1635
- const homeDir2 = options.homedirOverride ?? os.homedir();
1636
- const warmupMarker = path3.join(homeDir2, ".openclaw", "agentlife", "warmup-sent.json");
1637
- let warmupAlreadySent = false;
1638
- try {
1639
- const marker = JSON.parse(readFileSync(warmupMarker, "utf-8"));
1640
- warmupAlreadySent = marker?.sent === true;
1641
- } catch {}
1642
- if (!warmupAlreadySent && state.runCommand) {
1635
+ if (state.runCommand) {
1643
1636
  const specialistId = [...state.agentRegistry.keys()].find((id) => !SKIP_IDS.has(id));
1644
1637
  if (specialistId) {
1645
1638
  const warmupKey = buildAgentSessionKey(specialistId);
1646
- const warmupMsg = `[system:warmup] You were just created. The user chose your domain but you have no data yet. Push a guided input widget (input surface with action=choice buttons) asking the user for the most important baseline info for your domain. One question at a time, 2-3 questions max. After collecting the answers, push a dashboard widget (NOT input) summarizing what you learned. Use the user's language.`;
1639
+ const warmupMsg = [
1640
+ `[system:warmup] You were just created and have no user data yet.`,
1641
+ ``,
1642
+ `1. Push a guided input widget (input surface, action=choice buttons) asking the user for the most important baseline info for your domain. One question at a time, 2-3 questions max.`,
1643
+ `2. After each answer, WRITE the data to your memory directory: exec mkdir -p ~/.openclaw/workspace-${specialistId}/memory && write the answer to a file there (e.g., memory/baseline.md). This is critical — your memory directory is what the platform reads to generate the user's vision dashboard. If you only store data in widget context, it's lost when the widget is dismissed.`,
1644
+ `3. After collecting all answers, push a DASHBOARD widget (NOT input) summarizing what you learned. This widget must NOT have the "input" keyword — it renders on the main dashboard, not the input bar.`,
1645
+ `4. Use the user's language.`,
1646
+ ``,
1647
+ `If you already collected baseline data in a previous session, check your memory directory. If it has content, push a dashboard summary widget and respond "done". Do NOT re-ask questions you already have answers for.`
1648
+ ].join(`
1649
+ `);
1647
1650
  const warmupParams = JSON.stringify({
1648
1651
  sessionKey: warmupKey,
1649
1652
  message: warmupMsg,
@@ -1654,19 +1657,9 @@ async function ensureVisionPosters(state, runtime, log, options = {}) {
1654
1657
  }).catch((e) => {
1655
1658
  log(`[agentlife] ensureVisionPosters: warmup failed for ${specialistId}: ${e?.message}`);
1656
1659
  });
1657
- try {
1658
- const dir = path3.dirname(warmupMarker);
1659
- try {
1660
- fs2.mkdir(dir, { recursive: true });
1661
- } catch {}
1662
- writeFileSync(warmupMarker, JSON.stringify({ sent: true, agentId: specialistId, at: Date.now() }) + `
1663
- `, "utf-8");
1664
- } catch {}
1665
- log(`[agentlife] ensureVisionPosters: skipped — totalChars=${totalChars} below threshold ${VISION_MIN_MEMORY_CHARS} (warmup triggered for ${specialistId})`);
1666
- return { status: "skipped", reason: "thin_memory", details: `totalChars=${totalChars}, warmup=${specialistId}` };
1667
1660
  }
1668
1661
  }
1669
- log(`[agentlife] ensureVisionPosters: skipped — totalChars=${totalChars} below threshold ${VISION_MIN_MEMORY_CHARS} (memory too thin${warmupAlreadySent ? ", warmup already sent" : ""})`);
1662
+ log(`[agentlife] ensureVisionPosters: skipped — totalChars=${totalChars} below threshold ${VISION_MIN_MEMORY_CHARS} (memory too thin)`);
1670
1663
  return { status: "skipped", reason: "thin_memory", details: `totalChars=${totalChars}` };
1671
1664
  }
1672
1665
  const homeDir = options.homedirOverride ?? os.homedir();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlife",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "bun build index.ts --outfile dist/index.js --target node --external openclaw/plugin-sdk",