agentlife 1.2.7 → 1.3.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.
Files changed (2) hide show
  1. package/dist/index.js +14 -24
  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: { allow: ["agentlife_push"] }
1489
+ tools: { profile: "full", alsoAllow: ["agentlife_push"] }
1490
1490
  },
1491
1491
  {
1492
1492
  id: "supervisor",
@@ -1679,7 +1679,7 @@ async function ensureVisionPosters(state, runtime, log, options = {}) {
1679
1679
  const now = Date.now();
1680
1680
  if (now - lastBootstrapSentAt < BOOTSTRAP_COOLDOWN_MS) {
1681
1681
  log(`[agentlife] ensureVisionPosters: skipped — bootstrap cooldown (${Math.round((BOOTSTRAP_COOLDOWN_MS - (now - lastBootstrapSentAt)) / 1000)}s remaining)`);
1682
- return { status: "skipped", reason: "thin_memory", details: `cooldown` };
1682
+ return { status: "skipped", reason: "cooldown", details: `${Math.round((BOOTSTRAP_COOLDOWN_MS - (now - lastBootstrapSentAt)) / 1000)}s remaining` };
1683
1683
  }
1684
1684
  const builderKey = buildAgentSessionKey("agentlife-builder");
1685
1685
  const bootstrapMsg = [
@@ -1850,13 +1850,12 @@ async function provisionAgents(state, cfg, runtime, log) {
1850
1850
  const existing = currentList.find((a) => a.id === agent.id);
1851
1851
  if (existing) {
1852
1852
  if (agent.tools) {
1853
- const currentAllow = existing.tools?.allow;
1854
- const wantAllow = agent.tools.allow;
1855
- const needsUpdate = !currentAllow || currentAllow.length !== wantAllow?.length || !wantAllow?.every((t) => currentAllow.includes(t));
1856
- if (needsUpdate) {
1853
+ const cur = JSON.stringify(existing.tools ?? {});
1854
+ const want = JSON.stringify(agent.tools);
1855
+ if (cur !== want) {
1857
1856
  existing.tools = agent.tools;
1858
1857
  configChanged = true;
1859
- log(`[agentlife] updated tool restrictions for ${agent.id}`);
1858
+ log(`[agentlife] updated tool config for ${agent.id}`);
1860
1859
  }
1861
1860
  }
1862
1861
  if (agent.subagents && !existing.subagents) {
@@ -1877,17 +1876,6 @@ async function provisionAgents(state, cfg, runtime, log) {
1877
1876
  log(`[agentlife] backfilled subagents for ${agent.id}`);
1878
1877
  }
1879
1878
  }
1880
- const rawCfgForTools = JSON.parse(readFileSync(path3.join(os.homedir(), ".openclaw", "openclaw.json"), "utf-8"));
1881
- const globalAllow = rawCfgForTools?.tools?.allow ?? [];
1882
- if (!globalAllow.includes("agentlife_push")) {
1883
- if (!rawCfgForTools.tools)
1884
- rawCfgForTools.tools = {};
1885
- rawCfgForTools.tools.allow = [...globalAllow, "agentlife_push"];
1886
- writeFileSync(path3.join(os.homedir(), ".openclaw", "openclaw.json"), JSON.stringify(rawCfgForTools, null, 2) + `
1887
- `, "utf-8");
1888
- configChanged = true;
1889
- log("[agentlife] added agentlife_push to global tools.allow");
1890
- }
1891
1879
  const rawCfgForVisibility = JSON.parse(readFileSync(path3.join(os.homedir(), ".openclaw", "openclaw.json"), "utf-8"));
1892
1880
  const currentVisibility = rawCfgForVisibility?.tools?.sessions?.visibility;
1893
1881
  if (currentVisibility !== "all") {
@@ -4302,9 +4290,10 @@ function extractCronTitle(meta) {
4302
4290
  const headingLine = meta.lines.find((l) => /^\s*text\s+"[^"]+"\s+h[1-4]/.test(l));
4303
4291
  if (headingLine)
4304
4292
  return headingLine.match(/text\s+"([^"]+)"/)?.[1] ?? null;
4305
- const goalLine = meta.lines.find((l) => /^\s*goal\s+"[^"]+"/.test(l));
4306
- if (goalLine)
4307
- return goalLine.match(/goal\s+"([^"]+)"/)?.[1] ?? null;
4293
+ const goalLine = meta.lines.find((l) => /^\s*goal:?\s+"[^"]+"/.test(l) || /^\s*goal:\s+\S/.test(l));
4294
+ if (goalLine) {
4295
+ return goalLine.match(/goal:?\s+"([^"]+)"/)?.[1] ?? goalLine.match(/goal:\s+(.+)/)?.[1]?.trim() ?? null;
4296
+ }
4308
4297
  const textLine = meta.lines.find((l) => /^\s*text\s+"[^"]+"/.test(l));
4309
4298
  if (textLine)
4310
4299
  return textLine.match(/text\s+"([^"]+)"/)?.[1] ?? null;
@@ -5820,9 +5809,10 @@ function extractWidgetText(meta) {
5820
5809
  const headingLine = meta.lines.find((l) => /^\s*text\s+"[^"]+"\s+h[1-4]/.test(l));
5821
5810
  if (headingLine)
5822
5811
  return headingLine.match(/text\s+"([^"]+)"/)?.[1] ?? null;
5823
- const goalLine = meta.lines.find((l) => /^\s*goal\s+"[^"]+"/.test(l));
5824
- if (goalLine)
5825
- return goalLine.match(/goal\s+"([^"]+)"/)?.[1] ?? null;
5812
+ const goalLine = meta.lines.find((l) => /^\s*goal:?\s+"[^"]+"/.test(l) || /^\s*goal:\s+\S/.test(l));
5813
+ if (goalLine) {
5814
+ return goalLine.match(/goal:?\s+"([^"]+)"/)?.[1] ?? goalLine.match(/goal:\s+(.+)/)?.[1]?.trim() ?? null;
5815
+ }
5826
5816
  const textLine = meta.lines.find((l) => /^\s*text\s+"[^"]+"/.test(l));
5827
5817
  if (textLine)
5828
5818
  return textLine.match(/text\s+"([^"]+)"/)?.[1] ?? null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlife",
3
- "version": "1.2.7",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "bun build index.ts --outfile dist/index.js --target node --external openclaw/plugin-sdk",