agentlife 1.1.7 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.js +6 -30
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1265,6 +1265,10 @@ Do NOT call agentlife.createAgent. Do NOT write workspace files. Do NOT spawn su
1265
1265
 
1266
1266
  When you receive \`[system:dismiss-requested] surfaceId=vision-{slug}\` — this is vision-specific dismiss handling. It is a third mode, distinct from agent creation and from dashboard bootstrap, and it OVERRIDES the general dismiss-alt protocol described elsewhere.
1267
1267
 
1268
+ **CRITICAL — session scope:** this section applies ONLY on your DIRECT session (where the user is live and can see widgets). The platform also notifies your INTERNAL session with the same \`[system:dismiss-requested]\` message as a cleanup hook AFTER the widget is already deleted. If you see this message on an internal session, do NOT push a dismiss-alt, do NOT run the steps below — the widget is gone and pushing a questionnaire creates a ghost surface that nobody can interact with. On internal sessions, output "done" and stop.
1269
+
1270
+ Direct session vs internal session: internal sessions receive the "Internal Session — Self-Improvement Protocol" preamble at the top of their system prompt. If you see that preamble in your context, you are on an internal session; this Vision Dismiss section does NOT apply to you, output "done".
1271
+
1268
1272
  The general dismiss-alt rule says "craft 2-3 contextual alternatives from the widget's goal." For vision posters that rule does NOT apply. Vision posters are aspirational content with a closed ontology of failure modes — the user is rejecting either the dream itself, its framing, its timing, or its dashboard placement. Improvising alternatives per dismiss would produce inconsistent wording across dismissals, which reads as broken UX. Use the fixed wording below verbatim.
1269
1273
 
1270
1274
  ### Step 1 — Push the dismiss-alt input surface
@@ -1508,20 +1512,6 @@ async function readAgentMemory(workspace) {
1508
1512
  if (!workspace)
1509
1513
  return "";
1510
1514
  const parts = [];
1511
- const rootFiles = [
1512
- ["SOUL.md", 600],
1513
- ["AGENTS.md", 1200],
1514
- ["USER.md", 1200]
1515
- ];
1516
- for (const [name, cap] of rootFiles) {
1517
- try {
1518
- const content = await fs2.readFile(path3.join(workspace, name), "utf-8");
1519
- const trimmed = content.trim();
1520
- if (trimmed)
1521
- parts.push(`### ${name}
1522
- ${trimmed.slice(0, cap)}`);
1523
- } catch {}
1524
- }
1525
1515
  const memoryDir = path3.join(workspace, "memory");
1526
1516
  try {
1527
1517
  const index = await fs2.readFile(path3.join(memoryDir, "MEMORY.md"), "utf-8");
@@ -1531,7 +1521,7 @@ ${index.trim()}`);
1531
1521
  } catch {}
1532
1522
  try {
1533
1523
  const files = await fs2.readdir(memoryDir);
1534
- const mdFiles = files.filter((f) => f.endsWith(".md") && f !== "MEMORY.md").sort().reverse().slice(0, 8);
1524
+ const mdFiles = files.filter((f) => f.endsWith(".md") && f !== "MEMORY.md").sort().reverse().slice(0, 20);
1535
1525
  for (const file of mdFiles) {
1536
1526
  try {
1537
1527
  const content = await fs2.readFile(path3.join(memoryDir, file), "utf-8");
@@ -6393,21 +6383,7 @@ function registerSurfacesGateway(api, state2) {
6393
6383
  const db = getOrCreateHistoryDb(state2);
6394
6384
  automations = db.prepare("SELECT id, type, name, path FROM automations WHERE surfaceId = ? AND status != 'removed'").all(surfaceId);
6395
6385
  } catch {}
6396
- const alreadyNotified = guidedDismissSent.delete(surfaceId);
6397
- if (agentId && state2.runCommand && !alreadyNotified) {
6398
- const goalSnippet = meta.goal ? ` goal="${meta.goal}"` : "";
6399
- const reasonSnippet = reason ? ` reason="${reason}"` : "";
6400
- const sessionKey = buildInternalSessionKey(agentId);
6401
- const message = `[system:dismiss-requested] surfaceId=${surfaceId}${goalSnippet}${reasonSnippet}`;
6402
- state2.runCommand([
6403
- "openclaw",
6404
- "gateway",
6405
- "call",
6406
- "chat.send",
6407
- "--params",
6408
- JSON.stringify({ sessionKey, message, idempotencyKey: `dismiss-req-${surfaceId}-${Date.now()}` })
6409
- ], { timeoutMs: 30000 }).catch((e) => console.warn("[agentlife] dismiss-requested notify failed for %s: %s", surfaceId, e?.message));
6410
- }
6386
+ guidedDismissSent.delete(surfaceId);
6411
6387
  state2.surfaceDb.delete(surfaceId);
6412
6388
  broadcastDelete(surfaceId);
6413
6389
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlife",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "bun build index.ts --outfile dist/index.js --target node --external openclaw/plugin-sdk",