@todoforai/edge 0.13.6 → 0.13.7

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 +32 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -48187,6 +48187,12 @@ class ApiClient {
48187
48187
  updateAgentSettings(agentId, agentSettingsId, updates) {
48188
48188
  return this.request("PUT", `/api/v1/agents/${agentId}/settings`, { agentSettingsId, updates });
48189
48189
  }
48190
+ getGlobalAgentSettings() {
48191
+ return this.request("GET", "/api/v1/agents/global");
48192
+ }
48193
+ updateGlobalAgentSettings(updates) {
48194
+ return this.request("PUT", "/api/v1/agents/global", updates);
48195
+ }
48190
48196
  setAgentEdgeMcpConfig(agentId, agentSettingsId, edgeId, mcpName, config) {
48191
48197
  return this.request("PUT", `/api/v1/agents/${agentId}/edge-mcp-config`, { agentSettingsId, edgeId, mcpName, config });
48192
48198
  }
@@ -49308,11 +49314,17 @@ function toolPathEntries() {
49308
49314
  }
49309
49315
  function buildEnvWithTools() {
49310
49316
  const env = { ...process.env };
49311
- env.PATH = toolPathEntries().join(path3.delimiter) + path3.delimiter + (env.PATH || "");
49317
+ const existingPath = env.PATH ?? env.Path ?? env.path ?? "";
49318
+ if (os3.platform() === "win32") {
49319
+ delete env.Path;
49320
+ delete env.path;
49321
+ }
49322
+ env.PATH = toolPathEntries().join(path3.delimiter) + path3.delimiter + existingPath;
49312
49323
  return env;
49313
49324
  }
49314
49325
  function whichWithTools(name) {
49315
- const dirs = [...toolPathEntries(), ...(process.env.PATH || "").split(path3.delimiter)];
49326
+ const rawPath = process.env.PATH ?? process.env.Path ?? process.env.path ?? "";
49327
+ const dirs = [...toolPathEntries(), ...rawPath.split(path3.delimiter)];
49316
49328
  const exts = os3.platform() === "win32" ? [".exe", ".cmd", ".bat", ""] : [""];
49317
49329
  for (const dir of dirs) {
49318
49330
  for (const ext of exts) {
@@ -51219,15 +51231,11 @@ class LinuxSyscallDetector {
51219
51231
  return;
51220
51232
  const fgPid = await getForegroundPid(pid);
51221
51233
  const sc2 = fgPid != null ? await readSyscall(fgPid) : null;
51222
- if (sc2 && sc2.nr === READ_NR && sc2.fd === 0 && fgPid != null && rootStdin) {
51223
- const leafStdin = await readFdTarget(fgPid, 0);
51224
- if (leafStdin === rootStdin) {
51225
- if (!signalled && ++pausedTicks >= GRACE_TICKS) {
51226
- signalled = true;
51227
- onPaused();
51228
- }
51229
- } else {
51230
- pausedTicks = 0;
51234
+ const leafTarget = sc2 && sc2.nr === READ_NR && sc2.fd >= 0 && fgPid != null ? await readFdTarget(fgPid, sc2.fd) : null;
51235
+ if (isTerminalReadPause(sc2, leafTarget, rootStdin)) {
51236
+ if (!signalled && ++pausedTicks >= GRACE_TICKS) {
51237
+ signalled = true;
51238
+ onPaused();
51231
51239
  }
51232
51240
  } else {
51233
51241
  pausedTicks = 0;
@@ -51246,6 +51254,17 @@ class LinuxSyscallDetector {
51246
51254
  };
51247
51255
  }
51248
51256
  }
51257
+ function isTerminalReadPause(sc2, leafTarget, rootStdin) {
51258
+ if (!sc2 || sc2.nr !== READ_NR || sc2.fd < 0)
51259
+ return false;
51260
+ if (!leafTarget || !rootStdin)
51261
+ return false;
51262
+ if (leafTarget === rootStdin)
51263
+ return true;
51264
+ if (leafTarget === "/dev/tty" && rootStdin.startsWith("/dev/pts/"))
51265
+ return true;
51266
+ return false;
51267
+ }
51249
51268
  async function readSyscall(pid) {
51250
51269
  try {
51251
51270
  const raw = (await readFile(`/proc/${pid}/syscall`, "utf-8")).trim();
@@ -51291,7 +51310,8 @@ var IS_WIN = os6.platform() === "win32";
51291
51310
  var HAS_BUN = typeof globalThis.Bun !== "undefined";
51292
51311
  var HAS_BUN_TERMINAL = HAS_BUN && typeof Bun.Terminal === "function";
51293
51312
  function whichSync(name) {
51294
- const dirs = (process.env.PATH || "").split(path5.delimiter);
51313
+ const rawPath = process.env.PATH ?? process.env.Path ?? process.env.path ?? "";
51314
+ const dirs = rawPath.split(path5.delimiter);
51295
51315
  const exts = IS_WIN ? ["", ".exe", ".cmd", ".bat"] : [""];
51296
51316
  for (const dir of dirs) {
51297
51317
  for (const ext of exts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoforai/edge",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "todoforai-edge": "dist/index.js"