@frostbridge/imdl 0.1.9 → 0.1.11

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 +41 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1228,11 +1228,10 @@ var AGENTS = [
1228
1228
  name: "Claude Code",
1229
1229
  dir: join6(homedir4(), ".claude"),
1230
1230
  mode: "hooks",
1231
- hooksFile: join6(homedir4(), ".claude", "hooks.json"),
1231
+ hooksFile: join6(homedir4(), ".claude", "settings.json"),
1232
1232
  hooks: {
1233
- user_prompt_submit: [{ command: "imdl hook prompt", timeout: 2e3 }],
1234
- pre_tool_use: [{ command: "imdl hook pre-tool", timeout: 2e3 }],
1235
- post_tool_use: [{ command: "imdl hook post-tool", timeout: 1e3 }]
1233
+ PreToolUse: [{ matcher: "*", hooks: [{ type: "command", command: "imdl hook pre-tool", timeout: 5 }] }],
1234
+ PostToolUse: [{ matcher: "*", hooks: [{ type: "command", command: "imdl hook post-tool", timeout: 5 }] }]
1236
1235
  }
1237
1236
  },
1238
1237
  {
@@ -1344,21 +1343,25 @@ async function initCommand(options) {
1344
1343
  } else {
1345
1344
  console.log(pc2.dim(` \u2022 Policies exist (${policies.length} active rules)`));
1346
1345
  }
1347
- console.log("\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
1348
- console.log(" Privacy Notice");
1349
- console.log("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n");
1350
- console.log(" Frostbridge monitors AI agent activity and reports to your");
1351
- console.log(" organization's security dashboard. Data collected includes:\n");
1352
- console.log(" \u2022 Tool calls (file edits, commands, MCP calls)");
1353
- console.log(" \u2022 Session metadata (agent type, project path, timestamps)");
1354
- console.log(" \u2022 Policy evaluation results\n");
1355
- console.log(" Data NOT collected:");
1356
- console.log(" \u2022 Full file contents");
1357
- console.log(" \u2022 Prompt/response text (redacted)");
1358
- console.log(" \u2022 Credentials (automatically scrubbed)\n");
1359
- console.log(" Data is retained per your organization's retention policy.");
1360
- console.log(" Contact your admin for the full privacy policy.\n");
1361
- console.log("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n");
1346
+ if (options.nonInteractive) {
1347
+ console.log(pc2.dim(" \u2022 Privacy notice auto-accepted (non-interactive mode)"));
1348
+ } else {
1349
+ console.log("\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
1350
+ console.log(" Privacy Notice");
1351
+ console.log("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n");
1352
+ console.log(" Frostbridge monitors AI agent activity and reports to your");
1353
+ console.log(" organization's security dashboard. Data collected includes:\n");
1354
+ console.log(" \u2022 Tool calls (file edits, commands, MCP calls)");
1355
+ console.log(" \u2022 Session metadata (agent type, project path, timestamps)");
1356
+ console.log(" \u2022 Policy evaluation results\n");
1357
+ console.log(" Data NOT collected:");
1358
+ console.log(" \u2022 Full file contents");
1359
+ console.log(" \u2022 Prompt/response text (redacted)");
1360
+ console.log(" \u2022 Credentials (automatically scrubbed)\n");
1361
+ console.log(" Data is retained per your organization's retention policy.");
1362
+ console.log(" Contact your admin for the full privacy policy.\n");
1363
+ console.log("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n");
1364
+ }
1362
1365
  config.privacyNoticeAccepted = (/* @__PURE__ */ new Date()).toISOString();
1363
1366
  saveConfig(config);
1364
1367
  for (const agent of detectedAgents) {
@@ -1432,10 +1435,24 @@ function mergeHooks(existing, imdl) {
1432
1435
  if (!result.hooks[event]) {
1433
1436
  result.hooks[event] = imdlHooks;
1434
1437
  } else {
1435
- const existingCommands = result.hooks[event].map((h) => h.command);
1436
- for (const hook of imdlHooks) {
1437
- if (!existingCommands.includes(hook.command)) {
1438
- result.hooks[event].push(hook);
1438
+ for (const newEntry of imdlHooks) {
1439
+ if (newEntry.matcher && newEntry.hooks) {
1440
+ const existingEntry = result.hooks[event].find((e) => e.matcher === newEntry.matcher);
1441
+ if (existingEntry && existingEntry.hooks) {
1442
+ const existingCommands = existingEntry.hooks.map((h) => h.command);
1443
+ for (const hook of newEntry.hooks) {
1444
+ if (!existingCommands.includes(hook.command)) {
1445
+ existingEntry.hooks.push(hook);
1446
+ }
1447
+ }
1448
+ } else {
1449
+ result.hooks[event].push(newEntry);
1450
+ }
1451
+ } else {
1452
+ const existingCommands = result.hooks[event].map((h) => h.command);
1453
+ if (!existingCommands.includes(newEntry.command)) {
1454
+ result.hooks[event].push(newEntry);
1455
+ }
1439
1456
  }
1440
1457
  }
1441
1458
  }
@@ -6009,7 +6026,7 @@ function getSafeAlternative(toolName, toolInput) {
6009
6026
  var program = new Command();
6010
6027
  program.name("imdl").description("IMDL \u2014 Intelligent Mediation & Detection Layer. AI agent security.").version("0.1.0");
6011
6028
  program.command("scan").description("Scan MCP server configs for security risks").option("-p, --path <path>", "Path to MCP config file").option("-u, --url <url>", "GitHub URL or org/repo to scan").option("--json", "Output as JSON").option("--no-color", "Disable colored output").option("-q, --quiet", "Only show warnings and errors").option("-d, --deep", "Deep scan: static code analysis + GitHub issue scanning").action(scanCommand);
6012
- program.command("init").description("Detect AI agents and install monitoring hooks").option("-t, --token <token>", "Invite token to join a team").option("--team-token <token>", "Alias for --token").option("--api <url>", "API URL to connect to").action((opts) => initCommand({ teamToken: opts.token || opts.teamToken, apiUrl: opts.api }));
6029
+ program.command("init").description("Detect AI agents and install monitoring hooks").option("-t, --token <token>", "Invite token to join a team").option("--team-token <token>", "Alias for --token").option("--api <url>", "API URL to connect to").option("--non-interactive", "Skip all prompts and use defaults").action((opts) => initCommand({ teamToken: opts.token || opts.teamToken, apiUrl: opts.api, nonInteractive: opts.nonInteractive }));
6013
6030
  program.command("login").description("Authenticate to your IMDL team").action(loginCommand);
6014
6031
  program.command("status").description("Show monitoring status and detected agents").action(statusCommand);
6015
6032
  program.command("logout").description("Remove authentication credentials").action(logoutCommand);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "restricted"
5
5
  },
6
- "version": "0.1.9",
6
+ "version": "0.1.11",
7
7
  "description": "IMDL — Intelligent Mediation & Detection Layer. AI agent security CLI.",
8
8
  "files": [
9
9
  "dist"