[Init] Initial commit - NetMesh terminal manager
Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled

This commit is contained in:
2026-09-13 18:24:01 +08:00
commit 3c72efcb7f
3255 changed files with 907009 additions and 0 deletions

View File

@@ -0,0 +1,136 @@
"use strict";
const { CAPABILITY_STATUS } = require("../constants.cjs");
/** Catty-only harness tools (sidebar agent; renderer-local; not MCP/CLI). */
/** @type {import("../types.cjs").CapabilityDefinition[]} */
const HARNESS_CAPABILITIES = [
{
id: "harness.tool_output.read",
domain: "harness",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Read stored tool output by handle id when a prior tool result was truncated.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
catty: { toolName: "tool_output_read" },
},
},
{
id: "harness.workspace.get_info",
domain: "harness",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Get information about the current workspace, including all terminal sessions and their connection status.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
catty: { toolName: "workspace_get_info" },
},
},
{
id: "harness.workspace.get_session_info",
domain: "harness",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Get detailed information about a specific terminal or SFTP session.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
catty: { toolName: "workspace_get_session_info" },
},
},
{
id: "harness.terminal.read_context",
domain: "harness",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Read a bounded slice of the current terminal screen or scrollback from the active AI scope.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
catty: { toolName: "terminal_read_context" },
},
},
{
id: "harness.web.search",
domain: "harness",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Search the web for current information when configured in AI settings.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
catty: { toolName: "web_search" },
},
},
{
id: "harness.url.fetch",
domain: "harness",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Fetch and read the content of an HTTPS URL.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
catty: { toolName: "url_fetch" },
},
},
{
id: "harness.skill.run",
domain: "harness",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Run a built-in diagnostic skill that executes a pre-crafted sequence of shell commands on a target session and returns a structured report.",
policy: {
write: false,
sensitiveRead: false,
longRunning: true,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
catty: { toolName: "skill_run" },
},
},
];
module.exports = { HARNESS_CAPABILITIES };

View File

@@ -0,0 +1,27 @@
"use strict";
const { META_CAPABILITIES } = require("./meta.cjs");
const { TERMINAL_CAPABILITIES } = require("./terminal.cjs");
const { SFTP_CAPABILITIES } = require("./sftp.cjs");
const { VAULT_CAPABILITIES } = require("./vault.cjs");
const { PORT_FORWARD_CAPABILITIES } = require("./portforward.cjs");
const { HARNESS_CAPABILITIES } = require("./harness.cjs");
const ALL_CAPABILITIES = Object.freeze([
...META_CAPABILITIES,
...TERMINAL_CAPABILITIES,
...SFTP_CAPABILITIES,
...VAULT_CAPABILITIES,
...PORT_FORWARD_CAPABILITIES,
...HARNESS_CAPABILITIES,
]);
module.exports = {
META_CAPABILITIES,
TERMINAL_CAPABILITIES,
SFTP_CAPABILITIES,
VAULT_CAPABILITIES,
PORT_FORWARD_CAPABILITIES,
HARNESS_CAPABILITIES,
ALL_CAPABILITIES,
};

View File

@@ -0,0 +1,86 @@
"use strict";
const test = require("node:test");
const assert = require("node:assert/strict");
const { ALL_CAPABILITIES } = require("../index.cjs");
const { CAPABILITY_STATUS, CAPABILITY_SURFACES } = require("../constants.cjs");
const { getCliRpcMethod } = require("../adapters/cliAdapter.cjs");
const IMPLEMENTED_CLI_COMMANDS = [
["status"],
["env"],
["session"],
["exec"],
["job-start"],
["job-poll"],
["job-stop"],
["sftp", "list"],
["sftp", "read"],
["sftp", "write"],
["sftp", "download"],
["sftp", "upload"],
["sftp", "mkdir"],
["sftp", "delete"],
["sftp", "rename"],
["sftp", "stat"],
["sftp", "chmod"],
["sftp", "home"],
["cancel"],
["resume"],
["vault", "host", "get"],
["vault", "host", "open"],
["vault", "host-notes", "get"],
["vault", "host-notes", "set"],
["snippets", "list"],
["snippets", "get"],
["snippets", "run"],
["snippets", "create"],
["snippets", "update"],
["snippets", "delete"],
["scripts", "list"],
["scripts", "get"],
["scripts", "run"],
["scripts", "create"],
["scripts", "update"],
["scripts", "delete"],
["scripts", "reference"],
["scripts", "runs", "list"],
["scripts", "run", "stop"],
["scripts", "run", "pause"],
["scripts", "run", "resume"],
["scripts", "targets", "set"],
["vault", "host", "connect-scripts", "list"],
["vault", "host", "connect-scripts", "set"],
["portforward", "rules", "list"],
["portforward", "tunnels", "list"],
["portforward", "start"],
["portforward", "stop"],
];
test("every implemented cli command maps to an rpc method", () => {
for (const command of IMPLEMENTED_CLI_COMMANDS) {
const rpcMethod = getCliRpcMethod(command);
assert.ok(rpcMethod, `missing rpc mapping for ${command.join(" ")}`);
}
});
test("implemented capabilities expose at least one surface binding", () => {
for (const capability of ALL_CAPABILITIES) {
if (capability.status !== CAPABILITY_STATUS.IMPLEMENTED) continue;
const surfaces = Object.keys(capability.surfaces || {});
assert.ok(surfaces.length > 0, `${capability.id} has no surfaces`);
const hasRpc = surfaces.some((surface) => capability.surfaces[surface]?.rpcMethod);
const hasCli = surfaces.some((surface) => capability.surfaces[surface]?.command);
const hasCatty = Boolean(capability.surfaces[CAPABILITY_SURFACES.CATTY]?.toolName);
assert.ok(
hasRpc || hasCli || hasCatty || capability.surfaces[CAPABILITY_SURFACES.BUILTIN]?.mcpTool,
`${capability.id} has no rpc/cli/catty/mcp binding`,
);
}
});
test("capability ids are unique", () => {
const ids = ALL_CAPABILITIES.map((capability) => capability.id);
assert.equal(new Set(ids).size, ids.length);
});

View File

@@ -0,0 +1,163 @@
"use strict";
const { CAPABILITY_STATUS } = require("../constants.cjs");
/** @type {import("../types.cjs").CapabilityDefinition[]} */
const META_CAPABILITIES = [
{
id: "session.environment",
domain: "session",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List scoped terminal sessions available to the agent.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/getContext", mcpTool: "get_environment" },
public: { rpcMethod: "public/getEnvironment", mcpTool: "get_environment" },
cli: { command: ["env"] },
},
},
{
id: "meta.status",
domain: "meta",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Return bridge runtime status and policy configuration.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/getStatus" },
public: { rpcMethod: "public/getStatus" },
cli: { command: ["status"] },
},
},
{
id: "attachment.list",
domain: "attachment",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List user-attached files in the current AI chat scope.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/listAttachments", mcpTool: "list_attachments" },
cli: { command: ["attachment", "list"] },
},
},
{
id: "attachment.read",
domain: "attachment",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Read a user-attached file from the current AI chat scope.",
policy: {
write: false,
sensitiveRead: true,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/readAttachment", mcpTool: "read_attachment" },
cli: { command: ["attachment", "read"] },
},
},
{
id: "session.cancel",
domain: "session",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Cancel in-flight operations for a chat session.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/setCancelled" },
cli: { command: ["cancel"] },
},
},
{
id: "session.resume",
domain: "session",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Resume write operations for a cancelled chat session.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/setCancelled" },
cli: { command: ["resume"] },
},
},
{
id: "session.get",
domain: "session",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Get metadata for a single scoped session.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/getContext" },
cli: { command: ["session"] },
},
},
{
id: "session.close",
domain: "session",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Close a terminal session previously opened by host_open in the current AI scope.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: true,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
global: { rpcMethod: "session/close" },
public: { rpcMethod: "public/session/close", mcpTool: "session_close" },
},
},
];
module.exports = { META_CAPABILITIES };

View File

@@ -0,0 +1,113 @@
"use strict";
const { CAPABILITY_STATUS } = require("../constants.cjs");
/** @type {import("../types.cjs").CapabilityDefinition[]} */
const PORT_FORWARD_CAPABILITIES = [
{
id: "portforward.rules.list",
domain: "portforward",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List persisted port forwarding rules.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["portforward", "rules", "list"] },
global: { rpcMethod: "portforward/rules/list" },
public: { rpcMethod: "public/portforward/rules/list", mcpTool: "portforward_rules_list" },
},
},
{
id: "portforward.tunnels.list",
domain: "portforward",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List active port forwarding tunnels.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["portforward", "tunnels", "list"] },
global: { rpcMethod: "portforward/tunnels/list" },
public: { rpcMethod: "public/portforward/tunnels/list", mcpTool: "portforward_tunnels_list" },
},
},
...[
["portforward.rules.create", "Create a persisted port forwarding rule.", "create", "portforward_rules_create"],
["portforward.rules.update", "Update a persisted port forwarding rule.", "update", "portforward_rules_update"],
["portforward.rules.duplicate", "Duplicate a persisted port forwarding rule.", "duplicate", "portforward_rules_duplicate"],
["portforward.rules.delete", "Delete a persisted port forwarding rule.", "delete", "portforward_rules_delete"],
].map(([id, description, action, mcpTool]) => ({
id,
domain: "portforward",
status: CAPABILITY_STATUS.IMPLEMENTED,
description,
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
global: { rpcMethod: `portforward/rules/${action}` },
public: { rpcMethod: `public/portforward/rules/${action}`, mcpTool },
},
})),
{
id: "portforward.start",
domain: "portforward",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Start a port forwarding tunnel for a rule.",
policy: {
write: true,
sensitiveRead: false,
longRunning: true,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["portforward", "start"] },
global: { rpcMethod: "portforward/start" },
public: { rpcMethod: "public/portforward/start", mcpTool: "portforward_start" },
},
},
{
id: "portforward.stop",
domain: "portforward",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Stop an active port forwarding tunnel.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["portforward", "stop"] },
global: { rpcMethod: "portforward/stop" },
public: { rpcMethod: "public/portforward/stop", mcpTool: "portforward_stop" },
},
},
];
module.exports = { PORT_FORWARD_CAPABILITIES };

View File

@@ -0,0 +1,139 @@
"use strict";
const { CAPABILITY_STATUS } = require("../constants.cjs");
function sftpCapability(id, description, policyOverrides, surfaces) {
return {
id,
domain: "sftp",
status: CAPABILITY_STATUS.IMPLEMENTED,
description,
policy: {
write: false,
sensitiveRead: false,
longRunning: true,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
...policyOverrides,
},
surfaces,
};
}
/** @type {import("../types.cjs").CapabilityDefinition[]} */
const SFTP_CAPABILITIES = [
sftpCapability(
"sftp.list",
"List a remote directory over the session file backend (SFTP or SCP-mode).",
{ sensitiveRead: true },
{
builtin: { rpcMethod: "netcatty/sftp/list" },
public: { rpcMethod: "public/sftp/list", mcpTool: "sftp_list", confirmInConfirmMode: true },
cli: { command: ["sftp", "list"] },
},
),
sftpCapability(
"sftp.read",
"Read a remote file over the session file backend (SFTP or SCP-mode).",
{ sensitiveRead: true },
{
builtin: { rpcMethod: "netcatty/sftp/read" },
public: { rpcMethod: "public/sftp/readFile", mcpTool: "sftp_read_file", confirmInConfirmMode: true },
cli: { command: ["sftp", "read"] },
},
),
sftpCapability(
"sftp.write",
"Write a remote file over the session file backend (SFTP or SCP-mode).",
{ write: true, bypassesApproval: false, bypassesChatCancel: false },
{
builtin: { rpcMethod: "netcatty/sftp/write" },
public: { rpcMethod: "public/sftp/writeFile", mcpTool: "sftp_write_file" },
cli: { command: ["sftp", "write"] },
},
),
sftpCapability(
"sftp.download",
"Download a remote file to a local path.",
{ write: true, bypassesApproval: false, bypassesChatCancel: false },
{
builtin: { rpcMethod: "netcatty/sftp/download" },
public: { rpcMethod: "public/sftp/download", mcpTool: "sftp_download" },
cli: { command: ["sftp", "download"] },
},
),
sftpCapability(
"sftp.upload",
"Upload a local file to a remote path.",
{ write: true, bypassesApproval: false, bypassesChatCancel: false },
{
builtin: { rpcMethod: "netcatty/sftp/upload" },
public: { rpcMethod: "public/sftp/upload", mcpTool: "sftp_upload" },
cli: { command: ["sftp", "upload"] },
},
),
sftpCapability(
"sftp.stat",
"Get remote file metadata over the session file backend (SFTP or SCP-mode).",
{ sensitiveRead: true },
{
builtin: { rpcMethod: "netcatty/sftp/stat" },
public: { rpcMethod: "public/sftp/stat", mcpTool: "sftp_stat", confirmInConfirmMode: true },
cli: { command: ["sftp", "stat"] },
},
),
sftpCapability(
"sftp.home",
"Get the remote home directory for a session.",
{ sensitiveRead: true },
{
builtin: { rpcMethod: "netcatty/sftp/home" },
public: { rpcMethod: "public/sftp/home", mcpTool: "sftp_home", confirmInConfirmMode: true },
cli: { command: ["sftp", "home"] },
},
),
sftpCapability(
"sftp.mkdir",
"Create a remote directory over the session file backend (SFTP or SCP-mode).",
{ write: true, bypassesApproval: false, bypassesChatCancel: false },
{
builtin: { rpcMethod: "netcatty/sftp/mkdir" },
public: { rpcMethod: "public/sftp/mkdir", mcpTool: "sftp_mkdir" },
cli: { command: ["sftp", "mkdir"] },
},
),
sftpCapability(
"sftp.delete",
"Delete a remote file or directory over the session file backend (SFTP or SCP-mode).",
{ write: true, bypassesApproval: false, bypassesChatCancel: false },
{
builtin: { rpcMethod: "netcatty/sftp/delete" },
public: { rpcMethod: "public/sftp/delete", mcpTool: "sftp_delete" },
cli: { command: ["sftp", "delete"] },
},
),
sftpCapability(
"sftp.rename",
"Rename a remote file or directory over the session file backend (SFTP or SCP-mode).",
{ write: true, bypassesApproval: false, bypassesChatCancel: false },
{
builtin: { rpcMethod: "netcatty/sftp/rename" },
public: { rpcMethod: "public/sftp/rename", mcpTool: "sftp_rename" },
cli: { command: ["sftp", "rename"] },
},
),
sftpCapability(
"sftp.chmod",
"Change remote file permissions over the session file backend (SFTP or SCP-mode).",
{ write: true, bypassesApproval: false, bypassesChatCancel: false },
{
builtin: { rpcMethod: "netcatty/sftp/chmod" },
public: { rpcMethod: "public/sftp/chmod", mcpTool: "sftp_chmod" },
cli: { command: ["sftp", "chmod"] },
},
),
];
module.exports = { SFTP_CAPABILITIES };

View File

@@ -0,0 +1,89 @@
"use strict";
const { CAPABILITY_STATUS } = require("../constants.cjs");
/** @type {import("../types.cjs").CapabilityDefinition[]} */
const TERMINAL_CAPABILITIES = [
{
id: "terminal.execute",
domain: "terminal",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Execute a short command in a terminal session and wait for completion.",
policy: {
write: true,
sensitiveRead: false,
longRunning: true,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
builtin: { rpcMethod: "netcatty/exec", mcpTool: "terminal_execute" },
public: { rpcMethod: "public/terminalExecute", mcpTool: "terminal_execute" },
cli: { command: ["exec"] },
},
},
{
id: "terminal.start",
domain: "terminal",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Start a long-running command in a terminal session.",
policy: {
write: true,
sensitiveRead: false,
longRunning: true,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
builtin: { rpcMethod: "netcatty/jobStart", mcpTool: "terminal_start" },
public: { rpcMethod: "public/terminalStart", mcpTool: "terminal_start" },
cli: { command: ["job-start"] },
},
},
{
id: "terminal.poll",
domain: "terminal",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Poll incremental output from a long-running terminal job.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/jobPoll", mcpTool: "terminal_poll" },
public: { rpcMethod: "public/terminalPoll", mcpTool: "terminal_poll" },
cli: { command: ["job-poll"] },
},
},
{
id: "terminal.stop",
domain: "terminal",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Stop a long-running terminal job.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: true,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
builtin: { rpcMethod: "netcatty/jobStop", mcpTool: "terminal_stop" },
public: { rpcMethod: "public/terminalStop", mcpTool: "terminal_stop" },
cli: { command: ["job-stop"] },
},
},
];
module.exports = { TERMINAL_CAPABILITIES };

View File

@@ -0,0 +1,713 @@
"use strict";
const { AGENT_KINDS, CAPABILITY_STATUS } = require("../constants.cjs");
/** @type {import("../types.cjs").CapabilityDefinition[]} */
const VAULT_CAPABILITIES = [
{
id: "vault.host.get",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Get host metadata from the vault.",
policy: {
write: false,
sensitiveRead: true,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["vault", "host", "get"] },
global: { rpcMethod: "vault/host/get" },
public: { rpcMethod: "public/vault/host/get", mcpTool: "host_get" },
},
},
{
id: "vault.host.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List saved hosts in the vault (metadata only — no passwords or keys).",
policy: {
write: false,
sensitiveRead: true,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
global: { rpcMethod: "vault/hosts/list" },
public: { rpcMethod: "public/vault/hosts/list", mcpTool: "vault_hosts_list" },
},
},
{
id: "vault.host.open",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description:
"Open a vault host by creating a new terminal tab and starting the connection. Returns the new sessionId so you can run terminal/SFTP tools against it. Use vault_hosts_list first when you only know the label or hostname.",
// Sidebar Catty is scoped to already-open terminals/workspaces and must not
// expand that scope mid-turn. Keep host_open for MCP / CLI / global agent.
agentKinds: [AGENT_KINDS.GLOBAL],
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["vault", "host", "open"] },
global: { rpcMethod: "vault/hosts/open" },
public: { rpcMethod: "public/vault/hosts/open", mcpTool: "host_open" },
},
},
{
id: "vault.hosts.create",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Create vault hosts from structured host objects. Use when the user wants to add/create a host (Vault → Hosts). NOT for Vault → Notes sidebar documentation.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
global: { rpcMethod: "vault/hosts/create" },
public: { rpcMethod: "public/vault/hosts/create", mcpTool: "vault_hosts_create" },
},
},
{
id: "vault.host.update",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Update selected fields on an existing vault host. Use vault_hosts_list first to resolve the hostId.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
global: { rpcMethod: "vault/hosts/update" },
public: { rpcMethod: "public/vault/hosts/update", mcpTool: "vault_hosts_update" },
},
},
{
id: "vault.host.delete",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Delete a saved vault host by id. Use vault_hosts_list first to resolve the hostId.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
global: { rpcMethod: "vault/hosts/delete" },
public: { rpcMethod: "public/vault/hosts/delete", mcpTool: "vault_hosts_delete" },
},
},
{
id: "vault.host.import",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Parse known host export file formats (PuTTY, MobaXterm, CSV, SecureCRT, ssh_config) into vault hosts. For arbitrary unstructured text, map to host objects and use vault_hosts_create instead.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
global: { rpcMethod: "vault/hosts/import" },
public: { rpcMethod: "public/vault/hosts/import", mcpTool: "vault_hosts_import" },
},
},
{
id: "vault.host.notes.get",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Read host metadata notes attached to a saved host (Host Details panel — not Vault sidebar Notes).",
policy: {
write: false,
sensitiveRead: true,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["vault", "host-notes", "get"] },
global: { rpcMethod: "vault/host/notes/get" },
public: { rpcMethod: "public/vault/hostNotes/get", mcpTool: "host_notes_get" },
},
},
{
id: "vault.host.notes.set",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Update host metadata notes on a saved host (Host Details panel — not Vault sidebar Notes).",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["vault", "host-notes", "set"] },
global: { rpcMethod: "vault/host/notes/set" },
public: { rpcMethod: "public/vault/hostNotes/set", mcpTool: "host_notes_set" },
},
},
{
id: "vault.note.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List notes in Vault → Notes (markdown notes visible in the vault sidebar).",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
global: { rpcMethod: "vault/notes/list" },
public: { rpcMethod: "public/vault/notes/list", mcpTool: "vault_notes_list" },
},
},
{
id: "vault.note.get",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Read or search a Vault → Notes entry by exact id, at most 6000 characters per call. Content is only the returned range, not necessarily the whole note. Follow nextOffset with expectedUpdatedAt until null for a complete read; query searches only return matching excerpts. Read every range without query before summarizing the whole note or replacing its content; never treat unread text as absent. For long notes, retain section summaries rather than repeatedly loading all ranges. If the note changed, restart.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
global: { rpcMethod: "vault/notes/get" },
public: { rpcMethod: "public/vault/notes/get", mcpTool: "vault_notes_get" },
},
},
{
id: "vault.note.create",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Create a note in Vault → Notes sidebar (markdown documentation). NOT for adding SSH hosts — use vault_hosts_create for that.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
global: { rpcMethod: "vault/notes/create" },
public: { rpcMethod: "public/vault/notes/create", mcpTool: "vault_notes_create" },
},
},
{
id: "vault.note.update",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Update an existing Vault → Notes entry by id.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
global: { rpcMethod: "vault/notes/update" },
public: { rpcMethod: "public/vault/notes/update", mcpTool: "vault_notes_update" },
},
},
{
id: "vault.note.delete",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Delete a Vault → Notes entry by id.",
policy: { write: true, sensitiveRead: false, longRunning: false, requiresChatSession: false, bypassesObserverBlock: false, bypassesApproval: false, bypassesChatCancel: false },
surfaces: {
global: { rpcMethod: "vault/notes/delete" },
public: { rpcMethod: "public/vault/notes/delete", mcpTool: "vault_notes_delete" },
},
},
{
id: "vault.identity.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List reusable vault identities without passwords, private keys, or passphrases.",
policy: { write: false, sensitiveRead: true, longRunning: false, requiresChatSession: false, bypassesObserverBlock: false, bypassesApproval: true, bypassesChatCancel: true },
surfaces: {
global: { rpcMethod: "vault/identities/list" },
public: { rpcMethod: "public/vault/identities/list", mcpTool: "vault_identities_list" },
},
},
{
id: "vault.proxyProfile.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List reusable proxy profiles without credentials.",
policy: { write: false, sensitiveRead: true, longRunning: false, requiresChatSession: false, bypassesObserverBlock: false, bypassesApproval: true, bypassesChatCancel: true },
surfaces: {
global: { rpcMethod: "vault/proxyProfiles/list" },
public: { rpcMethod: "public/vault/proxyProfiles/list", mcpTool: "vault_proxy_profiles_list" },
},
},
...[
["vault.group.list", "List vault groups and their safe default settings.", "list", "vault_groups_list", false],
["vault.group.create", "Create a vault group with optional default connection settings.", "create", "vault_groups_create", true],
["vault.group.update", "Update or rename a vault group and its default connection settings.", "update", "vault_groups_update", true],
["vault.group.delete", "Delete a vault group, moving its hosts to the root unless deleteHosts is true.", "delete", "vault_groups_delete", true],
].map(([id, description, action, mcpTool, write]) => ({
id,
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description,
policy: { write, sensitiveRead: false, longRunning: false, requiresChatSession: false, bypassesObserverBlock: false, bypassesApproval: !write, bypassesChatCancel: !write },
surfaces: {
global: { rpcMethod: `vault/groups/${action}` },
public: { rpcMethod: `public/vault/groups/${action}`, mcpTool },
},
})),
{
id: "vault.snippets.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List code snippets stored in the vault.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["snippets", "list"] },
global: { rpcMethod: "vault/snippets/list" },
public: { rpcMethod: "public/vault/snippets/list", mcpTool: "snippets_list" },
},
},
{
id: "vault.snippets.get",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Get a single code snippet from the vault.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["snippets", "get"] },
global: { rpcMethod: "vault/snippets/get" },
public: { rpcMethod: "public/vault/snippets/get", mcpTool: "snippets_get" },
},
},
{
id: "vault.snippets.run",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Run a vault snippet or automation script in a terminal session. Text snippets paste shell commands; scripts (kind=script) run via the nct JavaScript runtime.",
policy: {
write: true,
sensitiveRead: false,
longRunning: true,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["snippets", "run"] },
global: { rpcMethod: "vault/snippets/run" },
public: { rpcMethod: "public/vault/snippets/run", mcpTool: "snippets_run" },
},
},
{
id: "vault.snippets.create",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Create a vault snippet or automation script (set kind=script for nct automation).",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["snippets", "create"] },
global: { rpcMethod: "vault/snippets/create" },
public: { rpcMethod: "public/vault/snippets/create", mcpTool: "snippets_create" },
},
},
{
id: "vault.snippets.update",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Update an existing vault snippet or automation script by id.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["snippets", "update"] },
global: { rpcMethod: "vault/snippets/update" },
public: { rpcMethod: "public/vault/snippets/update", mcpTool: "snippets_update" },
},
},
{
id: "vault.snippets.delete",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Delete a vault snippet or automation script by id.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["snippets", "delete"] },
global: { rpcMethod: "vault/snippets/delete" },
public: { rpcMethod: "public/vault/snippets/delete", mcpTool: "snippets_delete" },
},
},
{
id: "vault.scripts.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List automation scripts (kind=script) in the vault.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["scripts", "list"] },
global: { rpcMethod: "vault/scripts/list" },
public: { rpcMethod: "public/vault/scripts/list", mcpTool: "scripts_list" },
},
},
{
id: "vault.scripts.get",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Get a single automation script including JavaScript source.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["scripts", "get"] },
global: { rpcMethod: "vault/scripts/get" },
public: { rpcMethod: "public/vault/scripts/get", mcpTool: "scripts_get" },
},
},
{
id: "vault.scripts.create",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Create an automation script using the nct JavaScript API. Call scripts_reference first when authoring nct automation.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "create"] },
global: { rpcMethod: "vault/scripts/create" },
public: { rpcMethod: "public/vault/scripts/create", mcpTool: "scripts_create" },
},
},
{
id: "vault.scripts.update",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Update an automation script by id (partial fields).",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "update"] },
global: { rpcMethod: "vault/scripts/update" },
public: { rpcMethod: "public/vault/scripts/update", mcpTool: "scripts_update" },
},
},
{
id: "vault.scripts.delete",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Delete an automation script and remove host connect bindings.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "delete"] },
global: { rpcMethod: "vault/scripts/delete" },
public: { rpcMethod: "public/vault/scripts/delete", mcpTool: "scripts_delete" },
},
},
{
id: "vault.scripts.run",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Run an automation script in a terminal session via the nct runtime. Set wait=true to block until completion.",
policy: {
write: true,
sensitiveRead: false,
longRunning: true,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "run"] },
global: { rpcMethod: "vault/scripts/run" },
public: { rpcMethod: "public/vault/scripts/run", mcpTool: "scripts_run" },
},
},
{
id: "vault.scripts.reference",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Return Netcatty automation script syntax: nct API, triggers, host targeting, and source wrapping rules.",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["scripts", "reference"] },
global: { rpcMethod: "vault/scripts/reference" },
public: { rpcMethod: "public/vault/scripts/reference", mcpTool: "scripts_reference" },
},
},
{
id: "vault.scripts.runs.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List automation script runs (optionally filter by sessionId).",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["scripts", "runs", "list"] },
global: { rpcMethod: "vault/scripts/runs/list" },
public: { rpcMethod: "public/vault/scripts/runs/list", mcpTool: "scripts_runs_list" },
},
},
{
id: "vault.scripts.run.stop",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Stop a running automation script by runId.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "run", "stop"] },
global: { rpcMethod: "vault/scripts/run/stop" },
public: { rpcMethod: "public/vault/scripts/run/stop", mcpTool: "scripts_run_stop" },
},
},
{
id: "vault.scripts.run.pause",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Pause a running automation script by runId.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "run", "pause"] },
global: { rpcMethod: "vault/scripts/run/pause" },
public: { rpcMethod: "public/vault/scripts/run/pause", mcpTool: "scripts_run_pause" },
},
},
{
id: "vault.scripts.run.resume",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Resume a paused automation script by runId.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: true,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "run", "resume"] },
global: { rpcMethod: "vault/scripts/run/resume" },
public: { rpcMethod: "public/vault/scripts/run/resume", mcpTool: "scripts_run_resume" },
},
},
{
id: "vault.scripts.targets.set",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Set host IDs, dynamic group paths, or targetsAllHosts for an automation script. onConnect host IDs sync host connect queues.",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["scripts", "targets", "set"] },
global: { rpcMethod: "vault/scripts/targets/set" },
public: { rpcMethod: "public/vault/scripts/targets/set", mcpTool: "scripts_targets_set" },
},
},
{
id: "vault.host.connectScripts.list",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "List resolved onConnect automation scripts for a host (global, dynamic group, then host queue).",
policy: {
write: false,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: true,
bypassesChatCancel: true,
},
surfaces: {
cli: { command: ["vault", "host", "connect-scripts", "list"] },
global: { rpcMethod: "vault/host/connectScripts/list" },
public: { rpcMethod: "public/vault/hostConnectScripts/list", mcpTool: "host_connect_scripts_list" },
},
},
{
id: "vault.host.connectScripts.set",
domain: "vault",
status: CAPABILITY_STATUS.IMPLEMENTED,
description: "Set ordered onConnect script IDs for a host (host-specific queue; globals run separately).",
policy: {
write: true,
sensitiveRead: false,
longRunning: false,
requiresChatSession: false,
bypassesObserverBlock: false,
bypassesApproval: false,
bypassesChatCancel: false,
},
surfaces: {
cli: { command: ["vault", "host", "connect-scripts", "set"] },
global: { rpcMethod: "vault/host/connectScripts/set" },
public: { rpcMethod: "public/vault/hostConnectScripts/set", mcpTool: "host_connect_scripts_set" },
},
},
];
module.exports = { VAULT_CAPABILITIES };