@openape/nest 2.1.3 → 2.2.0

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.mjs +16 -0
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -658,6 +658,10 @@ var TroopWs = class {
658
658
  await this.handleSpawnIntent(frame);
659
659
  return;
660
660
  }
661
+ if (frame.type === "destroy-intent") {
662
+ await this.handleDestroyIntent(frame);
663
+ return;
664
+ }
661
665
  if (frame.type === "reload-bridge") {
662
666
  await this.handleReloadBridge(frame);
663
667
  }
@@ -688,6 +692,18 @@ var TroopWs = class {
688
692
  this.send({ type: "spawn-result", intent_id: frame.intent_id, ok: false, error });
689
693
  }
690
694
  }
695
+ async handleDestroyIntent(frame) {
696
+ this.opts.log(`troop-ws: destroy-intent ${frame.name} (intent ${frame.intent_id})`);
697
+ try {
698
+ await runWithCapture(this.opts.apesBin, ["agents", "destroy", frame.name, "--force"]);
699
+ this.opts.log(`troop-ws: destroy-result ${frame.name} ok`);
700
+ this.send({ type: "destroy-result", intent_id: frame.intent_id, ok: true, name: frame.name });
701
+ } catch (err) {
702
+ const error = err instanceof Error ? err.message : String(err);
703
+ this.opts.log(`troop-ws: destroy-result ${frame.name} FAIL: ${error}`);
704
+ this.send({ type: "destroy-result", intent_id: frame.intent_id, ok: false, name: frame.name, error });
705
+ }
706
+ }
691
707
  async handleReloadBridge(frame) {
692
708
  this.opts.log(`troop-ws: reload-bridge ${frame.name}`);
693
709
  await this.runApes(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openape/nest",
3
- "version": "2.1.3",
3
+ "version": "2.2.0",
4
4
  "description": "OpenApe Nest — local control-plane daemon that supervises agent processes on this computer. Talks to troop SP for ownership state, spawns/destroys agents via DDISA always-grants, supervises chat-bridge children (replacing per-agent launchd plists).",
5
5
  "type": "module",
6
6
  "license": "MIT",