agentlife 2.6.20 → 2.6.22

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 +10 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7590,6 +7590,16 @@ function registerAdminGateway(api, state2) {
7590
7590
  const version = await fetchNpmLatestVersion(force);
7591
7591
  respond(true, { version });
7592
7592
  }, { scope: "operator.read" });
7593
+ api.registerGatewayMethod("agentlife.update", async ({ respond }) => {
7594
+ try {
7595
+ const { spawn: spawn2 } = __require("node:child_process");
7596
+ const child = spawn2("openclaw", ["plugins", "install", "agentlife", "--dangerously-force-unsafe-install", "--force"], { detached: true, stdio: "ignore" });
7597
+ child.unref();
7598
+ respond(true, { started: true });
7599
+ } catch (err) {
7600
+ respond(false, undefined, { code: "UPDATE_FAILED", message: err?.message ?? "failed to spawn install" });
7601
+ }
7602
+ }, { scope: "operator.admin" });
7593
7603
  api.registerGatewayMethod("agentlife.quality", ({ respond }) => {
7594
7604
  try {
7595
7605
  const db = getOrCreateHistoryDb(state2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlife",
3
- "version": "2.6.20",
3
+ "version": "2.6.22",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "bun build index.ts --outfile dist/index.js --target node --external openclaw/plugin-sdk",