@frostbridge/imdl 0.1.0 → 0.1.2
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 +14 -8
- package/package.json +14 -4
package/dist/index.js
CHANGED
|
@@ -1271,6 +1271,9 @@ async function initCommand(options) {
|
|
|
1271
1271
|
if (isNewConfig) {
|
|
1272
1272
|
config.developerId = `dev_${randomUUID2().slice(0, 8)}`;
|
|
1273
1273
|
}
|
|
1274
|
+
if (options.apiUrl) {
|
|
1275
|
+
config.apiUrl = options.apiUrl;
|
|
1276
|
+
}
|
|
1274
1277
|
if (options.teamToken) {
|
|
1275
1278
|
try {
|
|
1276
1279
|
const joinRes = await fetch(`${config.apiUrl}/api/teams/join`, {
|
|
@@ -1282,6 +1285,8 @@ async function initCommand(options) {
|
|
|
1282
1285
|
const joinData = await joinRes.json();
|
|
1283
1286
|
config.teamId = joinData.teamId;
|
|
1284
1287
|
if (joinData.teamName) config.teamName = joinData.teamName;
|
|
1288
|
+
if (joinData.apiKey) config.authToken = joinData.apiKey;
|
|
1289
|
+
if (joinData.developerId) config.developerId = joinData.developerId;
|
|
1285
1290
|
console.log(pc2.green(` \u2713 Joined team: ${config.teamName || config.teamId}`));
|
|
1286
1291
|
} else {
|
|
1287
1292
|
console.log(pc2.yellow(` \u26A0 Could not validate team token (API returned ${joinRes.status})`));
|
|
@@ -2719,7 +2724,7 @@ async function sendBatch(apiUrl, sessionId, events, developerId) {
|
|
|
2719
2724
|
const config = loadConfig();
|
|
2720
2725
|
const headers = { "Content-Type": "application/json" };
|
|
2721
2726
|
if (config.authToken) {
|
|
2722
|
-
headers["
|
|
2727
|
+
headers["X-IMDL-Key"] = config.authToken;
|
|
2723
2728
|
}
|
|
2724
2729
|
try {
|
|
2725
2730
|
const res = await fetch(`${apiUrl}/api/sessions/${sessionId}/events`, {
|
|
@@ -3532,7 +3537,7 @@ async function collectPrompts() {
|
|
|
3532
3537
|
collected++;
|
|
3533
3538
|
}
|
|
3534
3539
|
const usageHeaders = { "Content-Type": "application/json" };
|
|
3535
|
-
if (config.authToken) usageHeaders["
|
|
3540
|
+
if (config.authToken) usageHeaders["X-IMDL-Key"] = config.authToken;
|
|
3536
3541
|
for (const [sessionId, usage] of usageBySession) {
|
|
3537
3542
|
try {
|
|
3538
3543
|
await fetch(`${config.apiUrl}/api/sessions/${sessionId}/usage`, {
|
|
@@ -3611,7 +3616,7 @@ async function requestCommand(options) {
|
|
|
3611
3616
|
method: "POST",
|
|
3612
3617
|
headers: {
|
|
3613
3618
|
"Content-Type": "application/json",
|
|
3614
|
-
...config.authToken ? { "
|
|
3619
|
+
...config.authToken ? { "X-IMDL-Key": config.authToken } : {}
|
|
3615
3620
|
},
|
|
3616
3621
|
body: JSON.stringify({
|
|
3617
3622
|
serverName: options.server,
|
|
@@ -4128,7 +4133,7 @@ async function reportPermissions(report) {
|
|
|
4128
4133
|
method: "POST",
|
|
4129
4134
|
headers: {
|
|
4130
4135
|
"Content-Type": "application/json",
|
|
4131
|
-
"
|
|
4136
|
+
"X-IMDL-Key": config.authToken
|
|
4132
4137
|
},
|
|
4133
4138
|
body: JSON.stringify(report)
|
|
4134
4139
|
});
|
|
@@ -4146,7 +4151,7 @@ async function checkCompliance(developerId) {
|
|
|
4146
4151
|
try {
|
|
4147
4152
|
const res = await fetch(`${config.apiUrl}/api/permissions/check?developerId=${encodeURIComponent(developerId)}`, {
|
|
4148
4153
|
headers: {
|
|
4149
|
-
"
|
|
4154
|
+
"X-IMDL-Key": config.authToken
|
|
4150
4155
|
}
|
|
4151
4156
|
});
|
|
4152
4157
|
if (!res.ok) return { ok: false };
|
|
@@ -4328,6 +4333,7 @@ var CATEGORY_LABELS = {
|
|
|
4328
4333
|
shell: "Shell",
|
|
4329
4334
|
network: "Network",
|
|
4330
4335
|
mcp_tools: "MCP Tools",
|
|
4336
|
+
code_execution: "Code Execution",
|
|
4331
4337
|
agentic_mode: "Agentic Mode"
|
|
4332
4338
|
};
|
|
4333
4339
|
var AGENT_LABELS = {
|
|
@@ -4436,7 +4442,7 @@ async function permissionsToggleCommand(enable) {
|
|
|
4436
4442
|
method: "POST",
|
|
4437
4443
|
headers: {
|
|
4438
4444
|
"Content-Type": "application/json",
|
|
4439
|
-
"
|
|
4445
|
+
"X-IMDL-Key": config.authToken
|
|
4440
4446
|
},
|
|
4441
4447
|
body: JSON.stringify({
|
|
4442
4448
|
developerId: config.developerId,
|
|
@@ -5248,7 +5254,7 @@ async function trySyncPolicies() {
|
|
|
5248
5254
|
const config = loadConfig();
|
|
5249
5255
|
const authHeaders = {};
|
|
5250
5256
|
if (config.authToken) {
|
|
5251
|
-
authHeaders["
|
|
5257
|
+
authHeaders["X-IMDL-Key"] = config.authToken;
|
|
5252
5258
|
}
|
|
5253
5259
|
try {
|
|
5254
5260
|
const controller = new AbortController();
|
|
@@ -5639,7 +5645,7 @@ function getSafeAlternative(toolName, toolInput) {
|
|
|
5639
5645
|
var program = new Command();
|
|
5640
5646
|
program.name("imdl").description("IMDL \u2014 Intelligent Mediation & Detection Layer. AI agent security.").version("0.1.0");
|
|
5641
5647
|
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);
|
|
5642
|
-
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").action((opts) => initCommand({ teamToken: opts.token || opts.teamToken }));
|
|
5648
|
+
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 }));
|
|
5643
5649
|
program.command("login").description("Authenticate to your IMDL team").action(loginCommand);
|
|
5644
5650
|
program.command("status").description("Show monitoring status and detected agents").action(statusCommand);
|
|
5645
5651
|
program.command("logout").description("Remove authentication credentials").action(logoutCommand);
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frostbridge/imdl",
|
|
3
|
-
"publishConfig": {
|
|
4
|
-
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "restricted"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.1.2",
|
|
5
7
|
"description": "IMDL — Intelligent Mediation & Detection Layer. AI agent security CLI.",
|
|
6
|
-
"files": [
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
7
11
|
"type": "module",
|
|
8
12
|
"bin": {
|
|
9
13
|
"imdl": "./dist/index.js"
|
|
@@ -28,6 +32,12 @@
|
|
|
28
32
|
"vitest": "^4.1.0",
|
|
29
33
|
"@types/node": "^22.15.0"
|
|
30
34
|
},
|
|
31
|
-
"keywords": [
|
|
35
|
+
"keywords": [
|
|
36
|
+
"security",
|
|
37
|
+
"ai",
|
|
38
|
+
"mcp",
|
|
39
|
+
"agent",
|
|
40
|
+
"governance"
|
|
41
|
+
],
|
|
32
42
|
"license": "MIT"
|
|
33
43
|
}
|