@frostbridge/imdl 0.1.8 → 0.1.10
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/index.js +53 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1344,21 +1344,25 @@ async function initCommand(options) {
|
|
|
1344
1344
|
} else {
|
|
1345
1345
|
console.log(pc2.dim(` \u2022 Policies exist (${policies.length} active rules)`));
|
|
1346
1346
|
}
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1347
|
+
if (options.nonInteractive) {
|
|
1348
|
+
console.log(pc2.dim(" \u2022 Privacy notice auto-accepted (non-interactive mode)"));
|
|
1349
|
+
} else {
|
|
1350
|
+
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");
|
|
1351
|
+
console.log(" Privacy Notice");
|
|
1352
|
+
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");
|
|
1353
|
+
console.log(" Frostbridge monitors AI agent activity and reports to your");
|
|
1354
|
+
console.log(" organization's security dashboard. Data collected includes:\n");
|
|
1355
|
+
console.log(" \u2022 Tool calls (file edits, commands, MCP calls)");
|
|
1356
|
+
console.log(" \u2022 Session metadata (agent type, project path, timestamps)");
|
|
1357
|
+
console.log(" \u2022 Policy evaluation results\n");
|
|
1358
|
+
console.log(" Data NOT collected:");
|
|
1359
|
+
console.log(" \u2022 Full file contents");
|
|
1360
|
+
console.log(" \u2022 Prompt/response text (redacted)");
|
|
1361
|
+
console.log(" \u2022 Credentials (automatically scrubbed)\n");
|
|
1362
|
+
console.log(" Data is retained per your organization's retention policy.");
|
|
1363
|
+
console.log(" Contact your admin for the full privacy policy.\n");
|
|
1364
|
+
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");
|
|
1365
|
+
}
|
|
1362
1366
|
config.privacyNoticeAccepted = (/* @__PURE__ */ new Date()).toISOString();
|
|
1363
1367
|
saveConfig(config);
|
|
1364
1368
|
for (const agent of detectedAgents) {
|
|
@@ -3619,6 +3623,8 @@ var CursorAdapter = class _CursorAdapter {
|
|
|
3619
3623
|
const newLines = lines.slice(lastOffset);
|
|
3620
3624
|
newOffsets[jsonlPath] = lines.length;
|
|
3621
3625
|
const projectPath = "/" + proj.replace(/-/g, "/").replace(/^\//, "");
|
|
3626
|
+
const sid = `cursor-${sessionDir.slice(0, 8)}`;
|
|
3627
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3622
3628
|
for (const line of newLines) {
|
|
3623
3629
|
let entry;
|
|
3624
3630
|
try {
|
|
@@ -3626,24 +3632,39 @@ var CursorAdapter = class _CursorAdapter {
|
|
|
3626
3632
|
} catch {
|
|
3627
3633
|
continue;
|
|
3628
3634
|
}
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
if (
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3635
|
+
const content2 = entry.message?.content;
|
|
3636
|
+
if (!Array.isArray(content2)) continue;
|
|
3637
|
+
if (entry.role === "user") {
|
|
3638
|
+
let text = "";
|
|
3639
|
+
for (const block of content2) {
|
|
3640
|
+
if (block?.type === "text" && block.text) {
|
|
3641
|
+
text += block.text.replace(/<user_query>\n?/g, "").replace(/\n?<\/user_query>/g, "").trim();
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
if (!text || this.isNoisePrompt(text)) continue;
|
|
3645
|
+
events.push({
|
|
3646
|
+
sessionId: sid,
|
|
3647
|
+
type: "user_prompt",
|
|
3648
|
+
prompt: text.slice(0, 1e4),
|
|
3649
|
+
timestamp: now,
|
|
3650
|
+
cwd: projectPath,
|
|
3651
|
+
agentType: "cursor"
|
|
3652
|
+
});
|
|
3653
|
+
} else if (entry.role === "assistant") {
|
|
3654
|
+
for (const block of content2) {
|
|
3655
|
+
if (block?.type === "tool_use" && block.name) {
|
|
3656
|
+
events.push({
|
|
3657
|
+
sessionId: sid,
|
|
3658
|
+
type: "pre_tool_use",
|
|
3659
|
+
toolName: block.name,
|
|
3660
|
+
toolInput: block.input || void 0,
|
|
3661
|
+
timestamp: now,
|
|
3662
|
+
cwd: projectPath,
|
|
3663
|
+
agentType: "cursor"
|
|
3664
|
+
});
|
|
3665
|
+
}
|
|
3636
3666
|
}
|
|
3637
3667
|
}
|
|
3638
|
-
if (!text || this.isNoisePrompt(text)) continue;
|
|
3639
|
-
events.push({
|
|
3640
|
-
sessionId: `cursor-${sessionDir.slice(0, 8)}`,
|
|
3641
|
-
type: "user_prompt",
|
|
3642
|
-
prompt: text.slice(0, 1e4),
|
|
3643
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3644
|
-
cwd: projectPath,
|
|
3645
|
-
agentType: "cursor"
|
|
3646
|
-
});
|
|
3647
3668
|
}
|
|
3648
3669
|
} catch {
|
|
3649
3670
|
}
|
|
@@ -5992,7 +6013,7 @@ function getSafeAlternative(toolName, toolInput) {
|
|
|
5992
6013
|
var program = new Command();
|
|
5993
6014
|
program.name("imdl").description("IMDL \u2014 Intelligent Mediation & Detection Layer. AI agent security.").version("0.1.0");
|
|
5994
6015
|
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);
|
|
5995
|
-
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 }));
|
|
6016
|
+
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 }));
|
|
5996
6017
|
program.command("login").description("Authenticate to your IMDL team").action(loginCommand);
|
|
5997
6018
|
program.command("status").description("Show monitoring status and detected agents").action(statusCommand);
|
|
5998
6019
|
program.command("logout").description("Remove authentication credentials").action(logoutCommand);
|