Files
openclaw/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayPush.swift
T
Peter Steinberger a6a0716486 feat(setup): rename Crestodian to OpenClaw system agent
User-facing name is now OpenClaw (the system speaks); internal code name is
system-agent. Gateway methods crestodian.* -> openclaw.chat/openclaw.setup.*,
agent tool -> openclaw, reserved agent ids openclaw + retired crestodian.
openclaw setup routes: onboarding flags -> onboard, -m/--yes -> system agent,
bare configured interactive -> OpenClaw chat, unconfigured -> onboarding.
Hidden crestodian CLI and /crestodian TUI aliases kept; docs moved to
docs/cli/openclaw.md with redirect stub. macOS/Android strings in lockstep.

Refs #107237
2026-07-14 11:03:02 -07:00

31 lines
1.1 KiB
Swift

import OpenClawProtocol
public enum GatewayServerCapability: String, CaseIterable, Sendable {
case chatSendRoutingContract = "chat-send-routing-contract"
case systemAgentSetupModelRef = "openclaw-setup-model-ref"
}
extension HelloOk {
func advertisedServerMethods() -> Set<String> {
let values = features["methods"]?.value as? [AnyCodable] ?? []
return Set(values.compactMap { $0.value as? String })
}
public func supportsServerCapability(_ capability: GatewayServerCapability) -> Bool {
let values = features["capabilities"]?.value as? [AnyCodable] ?? []
return values.contains { ($0.value as? String) == capability.rawValue }
}
}
/// Server-push messages from the gateway websocket.
///
/// This is the in-process replacement for the legacy `NotificationCenter` fan-out.
public enum GatewayPush: Sendable {
/// A full snapshot that arrives on connect (or reconnect).
case snapshot(HelloOk)
/// A server push event frame.
case event(EventFrame)
/// A detected sequence gap (`expected...received`) for event frames.
case seqGap(expected: Int, received: Int)
}