mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-22 16:10:50 +00:00
* 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>
25 lines
1021 B
JavaScript
25 lines
1021 B
JavaScript
"use strict";
|
|
|
|
const test = require("node:test");
|
|
const assert = require("node:assert/strict");
|
|
|
|
const { getCliRpcMethod, listCliCapabilities } = require("./cliAdapter.cjs");
|
|
const { CAPABILITY_STATUS } = require("../constants.cjs");
|
|
|
|
test("getCliRpcMethod resolves implemented cli commands to builtin rpc methods", () => {
|
|
assert.equal(getCliRpcMethod(["exec"]), "netcatty/exec");
|
|
assert.equal(getCliRpcMethod(["sftp", "list"]), "netcatty/sftp/list");
|
|
assert.equal(getCliRpcMethod(["capabilities"]), null);
|
|
});
|
|
|
|
test("listCliCapabilities returns implemented commands by default", () => {
|
|
const entries = listCliCapabilities();
|
|
assert.ok(entries.some((entry) => entry.id === "terminal.execute"));
|
|
assert.ok(entries.every((entry) => entry.status === CAPABILITY_STATUS.IMPLEMENTED));
|
|
});
|
|
|
|
test("listCliCapabilities can include planned commands", () => {
|
|
const entries = listCliCapabilities({ status: CAPABILITY_STATUS.PLANNED });
|
|
assert.ok(entries.some((entry) => entry.id === "vault.host.notes.get"));
|
|
});
|