mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
61a2473a7c
* feat(capabilities): add shared agent capability layer for MCP and CLI Introduce a registry-driven capability foundation so terminal, SFTP, vault, and port-forward tools can be extended from one policy and surface definition. Wire mcpServerBridge permission checks and the Skills CLI RPC client through the shared layer without changing existing AI runtime behavior. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(capabilities): restore SFTP cancel gating and home RPC timeout Match legacy mcpServerBridge behavior by blocking SFTP write RPCs after chat cancel and treating sftp/home as a long-running operation for timeout budget calculation. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
557 B
JavaScript
20 lines
557 B
JavaScript
"use strict";
|
|
|
|
const test = require("node:test");
|
|
const assert = require("node:assert/strict");
|
|
|
|
const { validateSessionInList, intersectSessionIds } = require("./scope.cjs");
|
|
|
|
test("validateSessionInList rejects unknown sessions", () => {
|
|
const result = validateSessionInList("sess-2", ["sess-1"]);
|
|
assert.equal(result.ok, false);
|
|
assert.equal(result.code, "SESSION_NOT_IN_SCOPE");
|
|
});
|
|
|
|
test("intersectSessionIds narrows explicit scope", () => {
|
|
assert.deepEqual(
|
|
intersectSessionIds(["a", "b", "c"], ["b", "c", "d"]),
|
|
["b", "c"],
|
|
);
|
|
});
|