@agentistics/mcp 2.113.0 → 2.114.0
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/agentistics-mcp.js +47 -3
- package/package.json +1 -1
package/dist/agentistics-mcp.js
CHANGED
|
@@ -920,6 +920,7 @@ var PROVENANCE = {
|
|
|
920
920
|
"harness-session-file": "recovered",
|
|
921
921
|
"process-log": "recovered",
|
|
922
922
|
"first-sighting": "recovered",
|
|
923
|
+
"protocol-stated": "spawn",
|
|
923
924
|
"no-id-route": "unrecoverable",
|
|
924
925
|
"platform-unsupported": "unrecoverable",
|
|
925
926
|
"external-process": "unrecoverable"
|
|
@@ -1029,6 +1030,8 @@ var AGENT_TOOL_POLICY = {
|
|
|
1029
1030
|
agentistics_tags: { ...DATA, risk: "R", routes: ["GET /api/tags"], reason: "reads aggregate-only tag cards" },
|
|
1030
1031
|
agentistics_tag_detail: { ...DATA, risk: "R", routes: ["GET /api/tags", "GET /api/tags/:id"], reason: "reads one tag aggregate (counts and sums only)" }
|
|
1031
1032
|
};
|
|
1033
|
+
// ../core/src/dataPatch.ts
|
|
1034
|
+
var blocked = new Set(["__proto__", "constructor", "prototype"]);
|
|
1032
1035
|
// session-tokens.ts
|
|
1033
1036
|
function sessionHarness(s) {
|
|
1034
1037
|
return s.harness ?? "claude";
|
|
@@ -1362,11 +1365,48 @@ import { join as join2 } from "node:path";
|
|
|
1362
1365
|
function sessionProofToken(key, id) {
|
|
1363
1366
|
return createHmac("sha256", key).update(`agentop-session:${id}`).digest("hex");
|
|
1364
1367
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1368
|
+
var defaultReadProc = (path) => {
|
|
1369
|
+
try {
|
|
1370
|
+
return readFileSync(path, "utf8");
|
|
1371
|
+
} catch {
|
|
1372
|
+
return;
|
|
1373
|
+
}
|
|
1374
|
+
};
|
|
1375
|
+
var MAX_ANCESTORS = 16;
|
|
1376
|
+
function environValue(environ, name) {
|
|
1377
|
+
const prefix = `${name}=`;
|
|
1378
|
+
for (const entry of environ.split("\x00")) {
|
|
1379
|
+
if (entry.startsWith(prefix))
|
|
1380
|
+
return entry.slice(prefix.length) || undefined;
|
|
1381
|
+
}
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
function ancestorSession(readProc = defaultReadProc, startPid = process.ppid) {
|
|
1385
|
+
const seen = new Set;
|
|
1386
|
+
let pid = startPid;
|
|
1387
|
+
for (let depth = 0;depth < MAX_ANCESTORS && pid > 1 && !seen.has(pid); depth++) {
|
|
1388
|
+
seen.add(pid);
|
|
1389
|
+
const environ = readProc(`/proc/${pid}/environ`);
|
|
1390
|
+
const id = environ ? environValue(environ, "AGENTOP_MANAGED_ID") : undefined;
|
|
1391
|
+
if (id) {
|
|
1392
|
+
const dir = environValue(environ, "AGENTISTICS_DIR");
|
|
1393
|
+
return { id, ...dir ? { dir } : {} };
|
|
1394
|
+
}
|
|
1395
|
+
const status = readProc(`/proc/${pid}/status`);
|
|
1396
|
+
const next = status ? Number(/^PPid:\s*(\d+)/m.exec(status)?.[1]) : NaN;
|
|
1397
|
+
if (!Number.isInteger(next))
|
|
1398
|
+
return;
|
|
1399
|
+
pid = next;
|
|
1400
|
+
}
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
function sessionProof(env, readKey = (p) => readFileSync(p, "utf8"), readProc = defaultReadProc, startPid = process.ppid) {
|
|
1404
|
+
const fromEnv = env.AGENTOP_MANAGED_ID;
|
|
1405
|
+
const ancestor = fromEnv ? undefined : ancestorSession(readProc, startPid);
|
|
1406
|
+
const id = fromEnv || ancestor?.id;
|
|
1367
1407
|
if (!id)
|
|
1368
1408
|
return;
|
|
1369
|
-
const dir = env.AGENTISTICS_DIR || join2(env.HOME || homedir2(), ".agentistics");
|
|
1409
|
+
const dir = env.AGENTISTICS_DIR || ancestor?.dir || join2(env.HOME || homedir2(), ".agentistics");
|
|
1370
1410
|
try {
|
|
1371
1411
|
const key = Buffer.from(readKey(join2(dir, "session-identity.key")).trim(), "hex");
|
|
1372
1412
|
if (key.length !== 32)
|
|
@@ -2366,6 +2406,7 @@ var TOOLS = [
|
|
|
2366
2406
|
inputSchema: { type: "object", properties: { harness: HARNESS_PARAM }, required: [] }
|
|
2367
2407
|
}
|
|
2368
2408
|
];
|
|
2409
|
+
var MCP_TOOL_NAMES = TOOLS.map((tool) => tool.name);
|
|
2369
2410
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: toolsForGate(TOOLS, await nativeVisibleNow()) }));
|
|
2370
2411
|
var audit = createAgentAuditSink();
|
|
2371
2412
|
process.on("exit", () => audit.flush());
|
|
@@ -2907,3 +2948,6 @@ async function callTool(req) {
|
|
|
2907
2948
|
}
|
|
2908
2949
|
var transport = new StdioServerTransport;
|
|
2909
2950
|
await server.connect(transport);
|
|
2951
|
+
export {
|
|
2952
|
+
MCP_TOOL_NAMES
|
|
2953
|
+
};
|
package/package.json
CHANGED