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.
- package/dist/index.js +14 -21
- 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
|
-
|
|
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 =
|
|
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
|
|
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();
|