[Feat] Gateway: add commands.list RPC method (#62656)

Merged via squash.

Co-authored-by: samzong <samzong.lu@gmail.com>
Co-authored-by: Frank Yang <frank.ekn@gmail.com>
Reviewed-by: @frankekn
This commit is contained in:
samzong
2026-04-10 14:28:47 +08:00
committed by GitHub
parent 4bf94aa0d6
commit 723dec0432
16 changed files with 855 additions and 1 deletions

View File

@@ -2883,6 +2883,92 @@ public struct ModelsListResult: Codable, Sendable {
}
}
public struct CommandEntry: Codable, Sendable {
public let name: String
public let nativename: String?
public let textaliases: [String]?
public let description: String
public let category: AnyCodable?
public let source: AnyCodable
public let scope: AnyCodable
public let acceptsargs: Bool
public let args: [[String: AnyCodable]]?
public init(
name: String,
nativename: String?,
textaliases: [String]?,
description: String,
category: AnyCodable?,
source: AnyCodable,
scope: AnyCodable,
acceptsargs: Bool,
args: [[String: AnyCodable]]?)
{
self.name = name
self.nativename = nativename
self.textaliases = textaliases
self.description = description
self.category = category
self.source = source
self.scope = scope
self.acceptsargs = acceptsargs
self.args = args
}
private enum CodingKeys: String, CodingKey {
case name
case nativename = "nativeName"
case textaliases = "textAliases"
case description
case category
case source
case scope
case acceptsargs = "acceptsArgs"
case args
}
}
public struct CommandsListParams: Codable, Sendable {
public let agentid: String?
public let provider: String?
public let scope: AnyCodable?
public let includeargs: Bool?
public init(
agentid: String?,
provider: String?,
scope: AnyCodable?,
includeargs: Bool?)
{
self.agentid = agentid
self.provider = provider
self.scope = scope
self.includeargs = includeargs
}
private enum CodingKeys: String, CodingKey {
case agentid = "agentId"
case provider
case scope
case includeargs = "includeArgs"
}
}
public struct CommandsListResult: Codable, Sendable {
public let commands: [CommandEntry]
public init(
commands: [CommandEntry])
{
self.commands = commands
}
private enum CodingKeys: String, CodingKey {
case commands
}
}
public struct SkillsStatusParams: Codable, Sendable {
public let agentid: String?

View File

@@ -2883,6 +2883,92 @@ public struct ModelsListResult: Codable, Sendable {
}
}
public struct CommandEntry: Codable, Sendable {
public let name: String
public let nativename: String?
public let textaliases: [String]?
public let description: String
public let category: AnyCodable?
public let source: AnyCodable
public let scope: AnyCodable
public let acceptsargs: Bool
public let args: [[String: AnyCodable]]?
public init(
name: String,
nativename: String?,
textaliases: [String]?,
description: String,
category: AnyCodable?,
source: AnyCodable,
scope: AnyCodable,
acceptsargs: Bool,
args: [[String: AnyCodable]]?)
{
self.name = name
self.nativename = nativename
self.textaliases = textaliases
self.description = description
self.category = category
self.source = source
self.scope = scope
self.acceptsargs = acceptsargs
self.args = args
}
private enum CodingKeys: String, CodingKey {
case name
case nativename = "nativeName"
case textaliases = "textAliases"
case description
case category
case source
case scope
case acceptsargs = "acceptsArgs"
case args
}
}
public struct CommandsListParams: Codable, Sendable {
public let agentid: String?
public let provider: String?
public let scope: AnyCodable?
public let includeargs: Bool?
public init(
agentid: String?,
provider: String?,
scope: AnyCodable?,
includeargs: Bool?)
{
self.agentid = agentid
self.provider = provider
self.scope = scope
self.includeargs = includeargs
}
private enum CodingKeys: String, CodingKey {
case agentid = "agentId"
case provider
case scope
case includeargs = "includeArgs"
}
}
public struct CommandsListResult: Codable, Sendable {
public let commands: [CommandEntry]
public init(
commands: [CommandEntry])
{
self.commands = commands
}
private enum CodingKeys: String, CodingKey {
case commands
}
}
public struct SkillsStatusParams: Codable, Sendable {
public let agentid: String?