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
140 lines
4.6 KiB
JavaScript
140 lines
4.6 KiB
JavaScript
"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 };
|