mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
60 lines
2.5 KiB
Swift
60 lines
2.5 KiB
Swift
//
|
|
// Tool.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Tool: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Activated is filled by the registry from the activation store for the requesting (org,project); providers leave it zero. An unactivated tool is discoverable but refused 403 at dispatch. */
|
|
public var activated: Bool?
|
|
/** Description is the prose a model reads to decide whether to call the tool. */
|
|
public var description: String?
|
|
/** Dispatchable is whether the tool can be CALLED. False for a listing-only entry: a skill is activated and attached to an agent, never called. */
|
|
public var dispatchable: Bool?
|
|
public var inputSchema: JSONValue?
|
|
/** Name is the tool's id in the flat, fleet-wide tool namespace — the value a tools/call passes. Unique across sources: a collision is resolved by source precedence before the caller ever sees it. */
|
|
public var name: String?
|
|
/** Price is what a call costs and who is paid, absent for a free tool. Enforcement is the x402 settlement client; this is the declaration. */
|
|
public var price: Price?
|
|
/** Source is where the tool comes from: connector, function, zap-service, agent, skill or mcp. */
|
|
public var source: String?
|
|
|
|
public init(activated: Bool? = nil, description: String? = nil, dispatchable: Bool? = nil, inputSchema: JSONValue? = nil, name: String? = nil, price: Price? = nil, source: String? = nil) {
|
|
self.activated = activated
|
|
self.description = description
|
|
self.dispatchable = dispatchable
|
|
self.inputSchema = inputSchema
|
|
self.name = name
|
|
self.price = price
|
|
self.source = source
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case activated
|
|
case description
|
|
case dispatchable
|
|
case inputSchema
|
|
case name
|
|
case price
|
|
case source
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(activated, forKey: .activated)
|
|
try container.encodeIfPresent(description, forKey: .description)
|
|
try container.encodeIfPresent(dispatchable, forKey: .dispatchable)
|
|
try container.encodeIfPresent(inputSchema, forKey: .inputSchema)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(price, forKey: .price)
|
|
try container.encodeIfPresent(source, forKey: .source)
|
|
}
|
|
}
|
|
|