@frostbridge/imdl 0.1.4 → 0.1.6

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 +7 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1085,6 +1085,7 @@ function capitalize(s) {
1085
1085
  // src/commands/init.ts
1086
1086
  import pc2 from "picocolors";
1087
1087
  import { existsSync as existsSync7, readFileSync as readFileSync4, writeFileSync as writeFileSync4, mkdirSync as mkdirSync2 } from "fs";
1088
+ import { execSync } from "child_process";
1088
1089
  import { join as join6 } from "path";
1089
1090
  import { homedir as homedir4 } from "os";
1090
1091
  import { randomUUID as randomUUID2 } from "crypto";
@@ -1484,10 +1485,9 @@ function installDaemon() {
1484
1485
  console.log(pc2.dim(" \u2022 Background daemon already installed"));
1485
1486
  return;
1486
1487
  }
1487
- const { execSync: execSync2 } = __require("child_process");
1488
1488
  let imdlBin = "";
1489
1489
  try {
1490
- imdlBin = execSync2("which imdl", { encoding: "utf-8" }).trim();
1490
+ imdlBin = execSync("which imdl", { encoding: "utf-8" }).trim();
1491
1491
  } catch {
1492
1492
  imdlBin = "/usr/local/bin/imdl";
1493
1493
  }
@@ -1520,7 +1520,7 @@ function installDaemon() {
1520
1520
  try {
1521
1521
  if (!existsSync7(plistDir)) mkdirSync2(plistDir, { recursive: true });
1522
1522
  writeFileSync4(plistPath, plist);
1523
- execSync2(`launchctl load ${plistPath}`, { stdio: "ignore" });
1523
+ execSync(`launchctl load ${plistPath}`, { stdio: "ignore" });
1524
1524
  console.log(pc2.green(" \u2713 Background daemon installed (auto-starts on login)"));
1525
1525
  } catch {
1526
1526
  console.log(pc2.yellow(" \u26A0 Could not install daemon service (run `imdl daemon` manually)"));
@@ -2784,11 +2784,12 @@ async function sendBatch(apiUrl, sessionId, events, developerId) {
2784
2784
  if (config.authToken) {
2785
2785
  headers["X-IMDL-Key"] = config.authToken;
2786
2786
  }
2787
+ const agentType = events.find((e) => e.agentType)?.agentType;
2787
2788
  try {
2788
2789
  const res = await fetch(`${apiUrl}/api/sessions/${sessionId}/events`, {
2789
2790
  method: "POST",
2790
2791
  headers,
2791
- body: JSON.stringify({ events, developerId }),
2792
+ body: JSON.stringify({ events, developerId, ...agentType && { agentType } }),
2792
2793
  signal: AbortSignal.timeout(FLUSH_TIMEOUT)
2793
2794
  });
2794
2795
  return res.ok;
@@ -4662,7 +4663,7 @@ import pc12 from "picocolors";
4662
4663
  import { existsSync as existsSync22, readFileSync as readFileSync16, writeFileSync as writeFileSync10, mkdirSync as mkdirSync3 } from "fs";
4663
4664
  import { join as join21 } from "path";
4664
4665
  import { homedir as homedir15 } from "os";
4665
- import { execSync, spawn } from "child_process";
4666
+ import { execSync as execSync2, spawn } from "child_process";
4666
4667
  var IMDL_DIR3 = join21(homedir15(), ".imdl");
4667
4668
  var GATEWAY_CONFIG = join21(IMDL_DIR3, "gateway.toml");
4668
4669
  var GATEWAY_PID_FILE = join21(IMDL_DIR3, "gateway.pid");
@@ -4943,7 +4944,7 @@ function findGatewayBinary() {
4943
4944
  if (existsSync22(path)) return path;
4944
4945
  }
4945
4946
  try {
4946
- const result = execSync("which imdl-gateway", { encoding: "utf-8" }).trim();
4947
+ const result = execSync2("which imdl-gateway", { encoding: "utf-8" }).trim();
4947
4948
  if (result) return result;
4948
4949
  } catch {
4949
4950
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "restricted"
5
5
  },
6
- "version": "0.1.4",
6
+ "version": "0.1.6",
7
7
  "description": "IMDL — Intelligent Mediation & Detection Layer. AI agent security CLI.",
8
8
  "files": [
9
9
  "dist"