@askexenow/exe-os 0.9.172 → 0.9.173

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.
package/dist/bin/cli.js CHANGED
@@ -107,7 +107,7 @@ if (args.includes("--global")) {
107
107
  process.exit(1);
108
108
  }
109
109
  } else if (args[0] === "key") {
110
- const { main: runKey } = await import("../exe-key-67XRL4GL.js");
110
+ const { main: runKey } = await import("../exe-key-NBM3H7VT.js");
111
111
  await runKey(args.slice(1));
112
112
  } else if (args[0] === "link") {
113
113
  console.error("`exe-os link` has been removed from the customer command surface.");
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- requestDeployRestart
4
- } from "./chunk-PWMMIGVQ.js";
5
2
  import {
6
3
  disposeDatabase,
7
4
  ensureSchema,
@@ -83,15 +80,12 @@ async function stopDaemonIfAlive() {
83
80
  throw new Error("Refusing to signal PID 1. Stop the exed Docker container manually, then retry.");
84
81
  }
85
82
  }
86
- const result = requestDeployRestart("key-rotation");
87
- if (!result.ok) {
88
- throw new Error(`Daemon stop failed: ${result.skipped}`);
89
- }
90
- for (let i = 0; i < 10; i++) {
83
+ process.kill(Number(daemon.pid), "SIGTERM");
84
+ for (let i = 0; i < 30; i++) {
91
85
  await new Promise((resolve) => setTimeout(resolve, 500));
92
86
  if (!daemonStatus().alive) return;
93
87
  }
94
- throw new Error(`Daemon pid ${daemon.pid} did not stop after orchestrated kill; refusing to rotate`);
88
+ throw new Error(`Daemon pid ${daemon.pid} did not stop after SIGTERM; refusing to rotate`);
95
89
  }
96
90
  async function keyStatus() {
97
91
  const key = await getMasterKey();
@@ -184,6 +184,27 @@ If MCP is down, tell the user: "MCP disconnected. Run /mcp to reconnect."`
184
184
  }
185
185
  }
186
186
  }
187
+ if (/^(Write|Edit)$/.test(data.tool_name)) {
188
+ const filePath = data.tool_input?.file_path ?? "";
189
+ const cwd = process.cwd();
190
+ const worktreeMatch = cwd.match(/\.worktrees\/([^/]+)/);
191
+ if (worktreeMatch && filePath) {
192
+ const worktreeRoot = cwd.slice(0, cwd.indexOf(".worktrees/") + ".worktrees/".length + worktreeMatch[1].length);
193
+ const repoRoot = cwd.slice(0, cwd.indexOf(".worktrees") - 1);
194
+ if (filePath.startsWith(repoRoot + "/") && !filePath.startsWith(worktreeRoot + "/") && !filePath.startsWith(worktreeRoot)) {
195
+ const output = JSON.stringify({
196
+ hookSpecificOutput: { permissionDecision: "deny" },
197
+ systemMessage: `ACTION BLOCKED: You are in worktree "${worktreeMatch[1]}" but tried to edit a file in the main repo root.
198
+ DENIED path: ${filePath}
199
+ Your worktree root is: ${worktreeRoot}/
200
+ Edit the file at: ${filePath.replace(repoRoot, worktreeRoot)} instead.
201
+ NEVER edit files outside your worktree. The main repo belongs to the coordinator.`
202
+ });
203
+ process.stdout.write(output);
204
+ process.exit(0);
205
+ }
206
+ }
207
+ }
187
208
  if (/^(Write|Edit)$/.test(data.tool_name) && !canCoordinate(agent.agentId, agent.agentRole)) {
188
209
  const filePath = data.tool_input?.file_path ?? "";
189
210
  const exeMatch = filePath.match(/exe\/([^/]+)\//);
@@ -3235,7 +3235,6 @@ process.on("uncaughtException", (err) => {
3235
3235
  function killOrphanDaemons() {
3236
3236
  try {
3237
3237
  const pids = execSyncNode("pgrep -f 'exe-daemon\\.js' 2>/dev/null || true", { encoding: "utf8", timeout: 3e3 }).trim().split("\n").filter(Boolean).map(Number).filter((n) => !isNaN(n) && n !== process.pid);
3238
- if (pids.length === 0) return;
3239
3238
  for (const pid of pids) {
3240
3239
  try {
3241
3240
  process.kill(pid, 0);
@@ -3245,17 +3244,6 @@ function killOrphanDaemons() {
3245
3244
  } catch {
3246
3245
  }
3247
3246
  }
3248
- setTimeout(() => {
3249
- for (const pid of pids) {
3250
- try {
3251
- process.kill(pid, 0);
3252
- process.stderr.write(`[exed] Orphan PID ${pid} survived SIGTERM \u2014 escalating to SIGKILL
3253
- `);
3254
- process.kill(pid, "SIGKILL");
3255
- } catch {
3256
- }
3257
- }
3258
- }, 2e3).unref();
3259
3247
  } catch {
3260
3248
  }
3261
3249
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.172",
3
+ "version": "0.9.173",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",