class Riffer::Rig::Mcp::Declaration
Attributes
args
[R]
Array[String]
auth
[R]
Hash[Symbol, Array[String]]
command
[R]
String?
env
[R]
Hash[String, String]
headers
[R]
Hash[String, String]
url
[R]
String?
@dynamic url, headers, auth, command, args, env
Public Class Methods
(?url: String?, ?headers: Hash[String, String], ?auth: Hash[Symbol, Array[String]], ?command: String?, ?args: Array[String], ?env: Hash[String, String]) → void
Source
# File lib/riffer/rig/mcp/declaration.rb, line 21 def initialize(url: nil, headers: {}, auth: {}, command: nil, args: [], env: {}) # Raised inside the extension's rig.mcp call, so a declaration without # exactly one transport fails that extension alone and never reaches the # Runtime. raise ArgumentError, 'a declaration takes a url or a command, not both' if url && command raise ArgumentError, 'a declaration takes a url or a command' unless url || command @url = url @headers = headers @auth = auth @command = command @args = args @env = env freeze end
Public Instance Methods
() → Hash[Symbol, untyped]
Source
# File lib/riffer/rig/mcp/declaration.rb, line 44 def to_h { url: url, headers: headers, auth: auth, command: command, args: args, env: env } end
@rbs return: Hash[Symbol, untyped]
(Hash[String, String] headers) → Riffer::Rig::Mcp::Declaration
Source
# File lib/riffer/rig/mcp/declaration.rb, line 39 def with_headers(headers) self.class.new(url: url, headers: headers, auth: auth, command: command, args: args, env: env) end
@rbs headers: Hash[String, String] @rbs return: Riffer::Rig::Mcp::Declaration