一键导入
schema-sync
// Synchronizes Swift types with the ACP protocol schema. Use when updating SDK types to match the latest protocol specification.
// Synchronizes Swift types with the ACP protocol schema. Use when updating SDK types to match the latest protocol specification.
| name | schema-sync |
| description | Synchronizes Swift types with the ACP protocol schema. Use when updating SDK types to match the latest protocol specification. |
Synchronizes Swift types with the ACP protocol schema.
User says: "/schema-sync" or "update schema" or "sync with ACP protocol"
Fetch latest schema files from the ACP protocol repository:
https://raw.githubusercontent.com/agentclientprotocol/agent-client-protocol/main/schema/schema.jsonhttps://raw.githubusercontent.com/agentclientprotocol/agent-client-protocol/main/schema/schema.unstable.jsonhttps://raw.githubusercontent.com/agentclientprotocol/agent-client-protocol/main/schema/meta.jsonCompare with current types in Sources/ACP/:
Client/Methods/Client/Methods/Notifications.swiftModels/Report changes:
Update Swift files:
@available(*, deprecated, message: "Draft RFD - API may change without notice")@available(*, deprecated, message: "Preview RFD - API may change")Update SCHEMA_VERSION.md with:
Run tests to verify changes:
swift test
| JSON Schema | Swift Type |
|---|---|
string | String |
integer | Int |
number | Double |
boolean | Bool |
object | struct or Value |
array | [T] |
null | nil or optional |
oneOf | enum |
snake_case → Swift camelCasesessionId → Swift sessionID (use ID suffix)tool_call_id → Swift toolCallIDWhen adding a new method like session/get_config:
/// Gets session configuration.
public enum SessionGetConfig: Method {
public static let name = "session/get_config"
public struct Parameters: Codable, Hashable, Sendable {
public var sessionID: String
private enum CodingKeys: String, CodingKey {
case sessionID = "sessionId"
}
public init(sessionID: String) {
self.sessionID = sessionID
}
}
public struct Result: Codable, Hashable, Sendable {
public var config: Value
public init(config: Value) {
self.config = config
}
}
}
ACP uses an RFD (Request for Dialog) process for new features:
| Stage | Location | SDK Treatment |
|---|---|---|
| Draft | docs/rfds/ with "Draft" group | @available(*, deprecated, message: "Draft RFD - API may change without notice") |
| Preview | docs/rfds/ with "Preview" group | @available(*, deprecated, message: "Preview RFD - API may change") |
| Completed | docs/protocol/ | No deprecation warning (stable) |
When syncing schema:
docs/docs.json for RFD status groupingsAdds a new ACP protocol method to the SDK with proper typing, documentation, and tests.
Tests the ACP Swift SDK against multiple ACP agents (qwen, gemini, claude-code-acp) to verify compatibility.
Updates golden test files from the Python SDK for cross-SDK compatibility verification.