owlmem 0.9.36 → 0.9.37

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/owlmem.mjs +29 -1
  2. package/package.json +1 -1
package/owlmem.mjs CHANGED
@@ -44,7 +44,7 @@ import { fileURLToPath } from "node:url";
44
44
  import { spawn, spawnSync } from "node:child_process";
45
45
  import { createConnection } from "node:net";
46
46
 
47
- export const VERSION = "0.9.36";
47
+ export const VERSION = "0.9.37";
48
48
  const BASE = (process.env.OWLMEM_URL || "https://owlmem.com").replace(/\/$/, "");
49
49
  const DIR = process.env.OWLMEM_HOME || join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "owlmem");
50
50
  const enc = new TextEncoder(), dec = new TextDecoder();
@@ -1469,9 +1469,37 @@ export function foregroundFirst(task) {
1469
1469
  `;
1470
1470
  }
1471
1471
 
1472
+ // A task handed out again after a clean exit while still "doing": the previous session probably started
1473
+ // background tests and its turn ended while waiting. Check whether the work is finished and mark it done,
1474
+ // or finish it — and run tests in the foreground, not the background, because nobody is watching.
1475
+ export function resumePrompt(task, place, o = {}) {
1476
+ const id = task.id, mins = o.timeout_min || WAKE_DEFAULTS.timeout_min;
1477
+ const where = place.worktree
1478
+ ? `Work in ${place.cwd}. It is a separate git worktree of ${place.repo} on the branch ${place.branch}, made for this task so it doesn't collide with other work. Commit your changes on this branch only. Don't merge, rebase or push other branches, and don't touch ${place.repo} itself. Put the branch name in your result so a person can review and merge it.`
1479
+ : place.scratch ? `There is no project directory for this task: you are in an empty folder (${place.cwd}). Use the OwlMem tools.`
1480
+ : `Work in ${place.cwd}. Other tasks wait until you finish here.`;
1481
+ return `${limitedNote(task)}OwlMem auto-wake started you on ${o.machine || "this computer"} to resume a task that is already in doing. A previous session left it in doing and ended cleanly, so check first whether the work is already finished.
1482
+
1483
+ Task #${id}, for ${task.agent}${task.broadcast ? " (sent to every agent; it is yours once you take it)" : ""}, from ${task.from}:
1484
+ Title: ${task.title}
1485
+
1486
+ ${task.body || "(no details)"}
1487
+
1488
+ Rules:
1489
+ 1. The task is already in doing — don't take it again with kb_task_update. First check whether the work is finished: look for the pull request, the branch, and the task thread. If it is finished, call kb_task_update with id=${id}, status="done" and note = the result, then end.
1490
+ 2. If it isn't finished, finish it: ${where}
1491
+ 3. Run tests in the foreground, not in the background: nobody is watching this session, and a background test run ends your turn while the work is still unfinished. Wait for the tests to finish before you end.
1492
+ 4. When you're finished, call kb_task_update with id=${id}, status="done" and note = the result (what you did, where it is).
1493
+ 5. If you can't do it — including anything that needs a person to approve, sign in, enter a code or confirm — call kb_task_update with id=${id}, status="declined" and note = what a person needs to do. Don't try to get around a permission you don't have.
1494
+ 6. Never put passwords, tokens, keys or other secrets in the note or in any message.
1495
+ 7. You have ${mins} minutes. After that this session is stopped and the task is handed to a person.
1496
+ `;
1497
+ }
1498
+
1472
1499
  export function wakePrompt(task, place, o = {}) {
1473
1500
  if (isReply(task)) return limitedNote(task) + foregroundFirst(task) + replyPrompt(task, o);
1474
1501
  if (isNote(task)) return limitedNote(task) + foregroundFirst(task) + notePrompt(task, place, o);
1502
+ if (task.resume) return resumePrompt(task, place, o);
1475
1503
  const id = task.id, mins = o.timeout_min || WAKE_DEFAULTS.timeout_min;
1476
1504
  const where = place.worktree
1477
1505
  ? `Work in ${place.cwd}. It is a separate git worktree of ${place.repo} on the branch ${place.branch}, made for this task so it doesn't collide with other work. Commit your changes on this branch only. Don't merge, rebase or push other branches, and don't touch ${place.repo} itself. Put the branch name in your result so a person can review and merge it.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owlmem",
3
- "version": "0.9.36",
3
+ "version": "0.9.37",
4
4
  "description": "OwlMem command line: connect your AI apps to OwlMem in one command (npx -y owlmem install), an end-to-end encrypted vault for your AI agents, and a local MCP server.",
5
5
  "type": "module",
6
6
  "bin": { "owlmem": "owlmem.mjs" },