mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
@MainActor
|
||||
@@ -16,7 +16,7 @@ struct AgentEventStoreTests {
|
||||
seq: 1,
|
||||
stream: "test",
|
||||
ts: 0,
|
||||
data: [:] as [String: ClawdbotProtocol.AnyCodable],
|
||||
data: [:] as [String: MoltbotProtocol.AnyCodable],
|
||||
summary: nil))
|
||||
#expect(store.events.count == 1)
|
||||
|
||||
@@ -33,7 +33,7 @@ struct AgentEventStoreTests {
|
||||
seq: i,
|
||||
stream: "test",
|
||||
ts: Double(i),
|
||||
data: [:] as [String: ClawdbotProtocol.AnyCodable],
|
||||
data: [:] as [String: MoltbotProtocol.AnyCodable],
|
||||
summary: nil))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct AgentWorkspaceTests {
|
||||
@@ -29,7 +29,7 @@ struct AgentWorkspaceTests {
|
||||
@Test
|
||||
func bootstrapCreatesAgentsFileWhenMissing() throws {
|
||||
let tmp = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
defer { try? FileManager().removeItem(at: tmp) }
|
||||
|
||||
let agentsURL = try AgentWorkspace.bootstrap(workspaceURL: tmp)
|
||||
@@ -52,7 +52,7 @@ struct AgentWorkspaceTests {
|
||||
@Test
|
||||
func bootstrapSafetyRejectsNonEmptyFolderWithoutAgents() throws {
|
||||
let tmp = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
defer { try? FileManager().removeItem(at: tmp) }
|
||||
try FileManager().createDirectory(at: tmp, withIntermediateDirectories: true)
|
||||
let marker = tmp.appendingPathComponent("notes.txt")
|
||||
@@ -70,7 +70,7 @@ struct AgentWorkspaceTests {
|
||||
@Test
|
||||
func bootstrapSafetyAllowsExistingAgentsFile() throws {
|
||||
let tmp = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
defer { try? FileManager().removeItem(at: tmp) }
|
||||
try FileManager().createDirectory(at: tmp, withIntermediateDirectories: true)
|
||||
let agents = tmp.appendingPathComponent(AgentWorkspace.agentsFilename)
|
||||
@@ -88,7 +88,7 @@ struct AgentWorkspaceTests {
|
||||
@Test
|
||||
func bootstrapSkipsBootstrapFileWhenWorkspaceHasContent() throws {
|
||||
let tmp = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
defer { try? FileManager().removeItem(at: tmp) }
|
||||
try FileManager().createDirectory(at: tmp, withIntermediateDirectories: true)
|
||||
let marker = tmp.appendingPathComponent("notes.txt")
|
||||
@@ -103,7 +103,7 @@ struct AgentWorkspaceTests {
|
||||
@Test
|
||||
func needsBootstrapFalseWhenIdentityAlreadySet() throws {
|
||||
let tmp = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-ws-\(UUID().uuidString)", isDirectory: true)
|
||||
defer { try? FileManager().removeItem(at: tmp) }
|
||||
try FileManager().createDirectory(at: tmp, withIntermediateDirectories: true)
|
||||
let identityURL = tmp.appendingPathComponent(AgentWorkspace.identityFilename)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct AnthropicAuthResolverTests {
|
||||
@Test
|
||||
func prefersOAuthFileOverEnv() throws {
|
||||
let dir = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-oauth-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-oauth-\(UUID().uuidString)", isDirectory: true)
|
||||
try FileManager().createDirectory(at: dir, withIntermediateDirectories: true)
|
||||
let oauthFile = dir.appendingPathComponent("oauth.json")
|
||||
let payload = [
|
||||
@@ -21,7 +21,7 @@ struct AnthropicAuthResolverTests {
|
||||
let data = try JSONSerialization.data(withJSONObject: payload, options: [.prettyPrinted, .sortedKeys])
|
||||
try data.write(to: oauthFile, options: [.atomic])
|
||||
|
||||
let status = ClawdbotOAuthStore.anthropicOAuthStatus(at: oauthFile)
|
||||
let status = MoltbotOAuthStore.anthropicOAuthStatus(at: oauthFile)
|
||||
let mode = AnthropicAuthResolver.resolve(environment: [
|
||||
"ANTHROPIC_API_KEY": "sk-ant-ignored",
|
||||
], oauthStatus: status)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct AnthropicOAuthCodeStateTests {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Foundation
|
||||
import Testing
|
||||
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct AnyCodableEncodingTests {
|
||||
@Test func encodesSwiftArrayAndDictionaryValues() throws {
|
||||
@@ -12,7 +12,7 @@ import Testing
|
||||
"null": NSNull(),
|
||||
]
|
||||
|
||||
let data = try JSONEncoder().encode(ClawdbotProtocol.AnyCodable(payload))
|
||||
let data = try JSONEncoder().encode(MoltbotProtocol.AnyCodable(payload))
|
||||
let obj = try #require(JSONSerialization.jsonObject(with: data) as? [String: Any])
|
||||
|
||||
#expect(obj["tags"] as? [String] == ["node", "ios"])
|
||||
@@ -25,7 +25,7 @@ import Testing
|
||||
"items": [1, "two", NSNull(), ["ok": true]],
|
||||
]
|
||||
|
||||
let data = try JSONEncoder().encode(ClawdbotProtocol.AnyCodable(payload))
|
||||
let data = try JSONEncoder().encode(MoltbotProtocol.AnyCodable(payload))
|
||||
let obj = try #require(JSONSerialization.jsonObject(with: data) as? [String: Any])
|
||||
|
||||
let items = try #require(obj["items"] as? [Any])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
@@ -8,12 +8,12 @@ struct CLIInstallerTests {
|
||||
@Test func installedLocationFindsExecutable() throws {
|
||||
let fm = FileManager()
|
||||
let root = fm.temporaryDirectory.appendingPathComponent(
|
||||
"clawdbot-cli-installer-\(UUID().uuidString)")
|
||||
"moltbot-cli-installer-\(UUID().uuidString)")
|
||||
defer { try? fm.removeItem(at: root) }
|
||||
|
||||
let binDir = root.appendingPathComponent("bin")
|
||||
try fm.createDirectory(at: binDir, withIntermediateDirectories: true)
|
||||
let cli = binDir.appendingPathComponent("clawdbot")
|
||||
let cli = binDir.appendingPathComponent("moltbot")
|
||||
fm.createFile(atPath: cli.path, contents: Data())
|
||||
try fm.setAttributes([.posixPermissions: 0o755], ofItemAtPath: cli.path)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Testing
|
||||
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct CameraCaptureServiceTests {
|
||||
@Test func normalizeSnapDefaults() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ClawdbotIPC
|
||||
import MoltbotIPC
|
||||
import Foundation
|
||||
import Testing
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import Foundation
|
||||
import os
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized) struct CanvasFileWatcherTests {
|
||||
private func makeTempDir() throws -> URL {
|
||||
let base = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
|
||||
let dir = base.appendingPathComponent("clawdbot-canvaswatch-\(UUID().uuidString)", isDirectory: true)
|
||||
let dir = base.appendingPathComponent("moltbot-canvaswatch-\(UUID().uuidString)", isDirectory: true)
|
||||
try FileManager().createDirectory(at: dir, withIntermediateDirectories: true)
|
||||
return dir
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ClawdbotIPC
|
||||
import MoltbotIPC
|
||||
import Foundation
|
||||
import Testing
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import AppKit
|
||||
import ClawdbotIPC
|
||||
import MoltbotIPC
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
struct CanvasWindowSmokeTests {
|
||||
@Test func panelControllerShowsAndHides() async throws {
|
||||
let root = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-canvas-test-\(UUID().uuidString)")
|
||||
.appendingPathComponent("moltbot-canvas-test-\(UUID().uuidString)")
|
||||
try FileManager().createDirectory(at: root, withIntermediateDirectories: true)
|
||||
defer { try? FileManager().removeItem(at: root) }
|
||||
|
||||
@@ -32,7 +32,7 @@ struct CanvasWindowSmokeTests {
|
||||
|
||||
@Test func windowControllerShowsAndCloses() async throws {
|
||||
let root = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-canvas-test-\(UUID().uuidString)")
|
||||
.appendingPathComponent("moltbot-canvas-test-\(UUID().uuidString)")
|
||||
try FileManager().createDirectory(at: root, withIntermediateDirectories: true)
|
||||
defer { try? FileManager().removeItem(at: root) }
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
private typealias SnapshotAnyCodable = Clawdbot.AnyCodable
|
||||
private typealias SnapshotAnyCodable = Moltbot.AnyCodable
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
@@ -52,7 +52,7 @@ struct ChannelsSettingsSmokeTests {
|
||||
"ok": true,
|
||||
"status": 200,
|
||||
"elapsedMs": 120,
|
||||
"bot": ["id": 123, "username": "clawdbotbot"],
|
||||
"bot": ["id": 123, "username": "moltbotbot"],
|
||||
"webhook": ["url": "https://example.com/hook", "hasCustomCert": false],
|
||||
],
|
||||
"lastProbeAt": 1_700_000_050_000,
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
struct ClawdbotConfigFileTests {
|
||||
struct MoltbotConfigFileTests {
|
||||
@Test
|
||||
func configPathRespectsEnvOverride() async {
|
||||
let override = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-config-\(UUID().uuidString)")
|
||||
.appendingPathComponent("clawdbot.json")
|
||||
.appendingPathComponent("moltbot-config-\(UUID().uuidString)")
|
||||
.appendingPathComponent("moltbot.json")
|
||||
.path
|
||||
|
||||
await TestIsolation.withEnvValues(["CLAWDBOT_CONFIG_PATH": override]) {
|
||||
#expect(ClawdbotConfigFile.url().path == override)
|
||||
#expect(MoltbotConfigFile.url().path == override)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,22 @@ struct ClawdbotConfigFileTests {
|
||||
@Test
|
||||
func remoteGatewayPortParsesAndMatchesHost() async {
|
||||
let override = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-config-\(UUID().uuidString)")
|
||||
.appendingPathComponent("clawdbot.json")
|
||||
.appendingPathComponent("moltbot-config-\(UUID().uuidString)")
|
||||
.appendingPathComponent("moltbot.json")
|
||||
.path
|
||||
|
||||
await TestIsolation.withEnvValues(["CLAWDBOT_CONFIG_PATH": override]) {
|
||||
ClawdbotConfigFile.saveDict([
|
||||
MoltbotConfigFile.saveDict([
|
||||
"gateway": [
|
||||
"remote": [
|
||||
"url": "ws://gateway.ts.net:19999",
|
||||
],
|
||||
],
|
||||
])
|
||||
#expect(ClawdbotConfigFile.remoteGatewayPort() == 19999)
|
||||
#expect(ClawdbotConfigFile.remoteGatewayPort(matchingHost: "gateway.ts.net") == 19999)
|
||||
#expect(ClawdbotConfigFile.remoteGatewayPort(matchingHost: "gateway") == 19999)
|
||||
#expect(ClawdbotConfigFile.remoteGatewayPort(matchingHost: "other.ts.net") == nil)
|
||||
#expect(MoltbotConfigFile.remoteGatewayPort() == 19999)
|
||||
#expect(MoltbotConfigFile.remoteGatewayPort(matchingHost: "gateway.ts.net") == 19999)
|
||||
#expect(MoltbotConfigFile.remoteGatewayPort(matchingHost: "gateway") == 19999)
|
||||
#expect(MoltbotConfigFile.remoteGatewayPort(matchingHost: "other.ts.net") == nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,20 +43,20 @@ struct ClawdbotConfigFileTests {
|
||||
@Test
|
||||
func setRemoteGatewayUrlPreservesScheme() async {
|
||||
let override = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-config-\(UUID().uuidString)")
|
||||
.appendingPathComponent("clawdbot.json")
|
||||
.appendingPathComponent("moltbot-config-\(UUID().uuidString)")
|
||||
.appendingPathComponent("moltbot.json")
|
||||
.path
|
||||
|
||||
await TestIsolation.withEnvValues(["CLAWDBOT_CONFIG_PATH": override]) {
|
||||
ClawdbotConfigFile.saveDict([
|
||||
MoltbotConfigFile.saveDict([
|
||||
"gateway": [
|
||||
"remote": [
|
||||
"url": "wss://old-host:111",
|
||||
],
|
||||
],
|
||||
])
|
||||
ClawdbotConfigFile.setRemoteGatewayUrl(host: "new-host", port: 2222)
|
||||
let root = ClawdbotConfigFile.loadDict()
|
||||
MoltbotConfigFile.setRemoteGatewayUrl(host: "new-host", port: 2222)
|
||||
let root = MoltbotConfigFile.loadDict()
|
||||
let url = ((root["gateway"] as? [String: Any])?["remote"] as? [String: Any])?["url"] as? String
|
||||
#expect(url == "wss://new-host:2222")
|
||||
}
|
||||
@@ -65,15 +65,15 @@ struct ClawdbotConfigFileTests {
|
||||
@Test
|
||||
func stateDirOverrideSetsConfigPath() async {
|
||||
let dir = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-state-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-state-\(UUID().uuidString)", isDirectory: true)
|
||||
.path
|
||||
|
||||
await TestIsolation.withEnvValues([
|
||||
"CLAWDBOT_CONFIG_PATH": nil,
|
||||
"CLAWDBOT_STATE_DIR": dir,
|
||||
]) {
|
||||
#expect(ClawdbotConfigFile.stateDirURL().path == dir)
|
||||
#expect(ClawdbotConfigFile.url().path == "\(dir)/clawdbot.json")
|
||||
#expect(MoltbotConfigFile.stateDirURL().path == dir)
|
||||
#expect(MoltbotConfigFile.url().path == "\(dir)/moltbot.json")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct ClawdbotOAuthStoreTests {
|
||||
struct MoltbotOAuthStoreTests {
|
||||
@Test
|
||||
func returnsMissingWhenFileAbsent() {
|
||||
let url = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-oauth-\(UUID().uuidString)")
|
||||
.appendingPathComponent("moltbot-oauth-\(UUID().uuidString)")
|
||||
.appendingPathComponent("oauth.json")
|
||||
#expect(ClawdbotOAuthStore.anthropicOAuthStatus(at: url) == .missingFile)
|
||||
#expect(MoltbotOAuthStore.anthropicOAuthStatus(at: url) == .missingFile)
|
||||
}
|
||||
|
||||
@Test
|
||||
func usesEnvOverrideForClawdbotOAuthDir() throws {
|
||||
func usesEnvOverrideForMoltbotOAuthDir() throws {
|
||||
let key = "CLAWDBOT_OAUTH_DIR"
|
||||
let previous = ProcessInfo.processInfo.environment[key]
|
||||
defer {
|
||||
@@ -25,10 +25,10 @@ struct ClawdbotOAuthStoreTests {
|
||||
}
|
||||
|
||||
let dir = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-oauth-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-oauth-\(UUID().uuidString)", isDirectory: true)
|
||||
setenv(key, dir.path, 1)
|
||||
|
||||
#expect(ClawdbotOAuthStore.oauthDir().standardizedFileURL == dir.standardizedFileURL)
|
||||
#expect(MoltbotOAuthStore.oauthDir().standardizedFileURL == dir.standardizedFileURL)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -42,7 +42,7 @@ struct ClawdbotOAuthStoreTests {
|
||||
],
|
||||
])
|
||||
|
||||
#expect(ClawdbotOAuthStore.anthropicOAuthStatus(at: url).isConnected)
|
||||
#expect(MoltbotOAuthStore.anthropicOAuthStatus(at: url).isConnected)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +55,7 @@ struct ClawdbotOAuthStoreTests {
|
||||
],
|
||||
])
|
||||
|
||||
#expect(ClawdbotOAuthStore.anthropicOAuthStatus(at: url).isConnected)
|
||||
#expect(MoltbotOAuthStore.anthropicOAuthStatus(at: url).isConnected)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -68,7 +68,7 @@ struct ClawdbotOAuthStoreTests {
|
||||
],
|
||||
])
|
||||
|
||||
#expect(ClawdbotOAuthStore.anthropicOAuthStatus(at: url) == .missingProviderEntry)
|
||||
#expect(MoltbotOAuthStore.anthropicOAuthStatus(at: url) == .missingProviderEntry)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -81,12 +81,12 @@ struct ClawdbotOAuthStoreTests {
|
||||
],
|
||||
])
|
||||
|
||||
#expect(ClawdbotOAuthStore.anthropicOAuthStatus(at: url) == .missingTokens)
|
||||
#expect(MoltbotOAuthStore.anthropicOAuthStatus(at: url) == .missingTokens)
|
||||
}
|
||||
|
||||
private func writeOAuthFile(_ json: [String: Any]) throws -> URL {
|
||||
let dir = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-oauth-\(UUID().uuidString)", isDirectory: true)
|
||||
.appendingPathComponent("moltbot-oauth-\(UUID().uuidString)", isDirectory: true)
|
||||
try FileManager().createDirectory(at: dir, withIntermediateDirectories: true)
|
||||
|
||||
let url = dir.appendingPathComponent("oauth.json")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Darwin
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized) struct CommandResolverTests {
|
||||
private func makeDefaults() -> UserDefaults {
|
||||
@@ -24,18 +24,18 @@ import Testing
|
||||
try FileManager().setAttributes([.posixPermissions: 0o755], ofItemAtPath: path.path)
|
||||
}
|
||||
|
||||
@Test func prefersClawdbotBinary() async throws {
|
||||
@Test func prefersMoltbotBinary() async throws {
|
||||
let defaults = self.makeDefaults()
|
||||
defaults.set(AppState.ConnectionMode.local.rawValue, forKey: connectionModeKey)
|
||||
|
||||
let tmp = try makeTempDir()
|
||||
CommandResolver.setProjectRoot(tmp.path)
|
||||
|
||||
let clawdbotPath = tmp.appendingPathComponent("node_modules/.bin/clawdbot")
|
||||
try self.makeExec(at: clawdbotPath)
|
||||
let moltbotPath = tmp.appendingPathComponent("node_modules/.bin/moltbot")
|
||||
try self.makeExec(at: moltbotPath)
|
||||
|
||||
let cmd = CommandResolver.clawdbotCommand(subcommand: "gateway", defaults: defaults, configRoot: [:])
|
||||
#expect(cmd.prefix(2).elementsEqual([clawdbotPath.path, "gateway"]))
|
||||
#expect(cmd.prefix(2).elementsEqual([moltbotPath.path, "gateway"]))
|
||||
}
|
||||
|
||||
@Test func fallsBackToNodeAndScript() async throws {
|
||||
@@ -46,7 +46,7 @@ import Testing
|
||||
CommandResolver.setProjectRoot(tmp.path)
|
||||
|
||||
let nodePath = tmp.appendingPathComponent("node_modules/.bin/node")
|
||||
let scriptPath = tmp.appendingPathComponent("bin/clawdbot.js")
|
||||
let scriptPath = tmp.appendingPathComponent("bin/moltbot.js")
|
||||
try self.makeExec(at: nodePath)
|
||||
try "#!/bin/sh\necho v22.0.0\n".write(to: nodePath, atomically: true, encoding: .utf8)
|
||||
try FileManager().setAttributes([.posixPermissions: 0o755], ofItemAtPath: nodePath.path)
|
||||
@@ -78,7 +78,7 @@ import Testing
|
||||
|
||||
let cmd = CommandResolver.clawdbotCommand(subcommand: "rpc", defaults: defaults, configRoot: [:])
|
||||
|
||||
#expect(cmd.prefix(4).elementsEqual([pnpmPath.path, "--silent", "clawdbot", "rpc"]))
|
||||
#expect(cmd.prefix(4).elementsEqual([pnpmPath.path, "--silent", "moltbot", "rpc"]))
|
||||
}
|
||||
|
||||
@Test func pnpmKeepsExtraArgsAfterSubcommand() async throws {
|
||||
@@ -97,7 +97,7 @@ import Testing
|
||||
defaults: defaults,
|
||||
configRoot: [:])
|
||||
|
||||
#expect(cmd.prefix(5).elementsEqual([pnpmPath.path, "--silent", "clawdbot", "health", "--json"]))
|
||||
#expect(cmd.prefix(5).elementsEqual([pnpmPath.path, "--silent", "moltbot", "health", "--json"]))
|
||||
#expect(cmd.suffix(2).elementsEqual(["--timeout", "5"]))
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ import Testing
|
||||
defaults.set(AppState.ConnectionMode.remote.rawValue, forKey: connectionModeKey)
|
||||
defaults.set("clawd@example.com:2222", forKey: remoteTargetKey)
|
||||
defaults.set("/tmp/id_ed25519", forKey: remoteIdentityKey)
|
||||
defaults.set("/srv/clawdbot", forKey: remoteProjectRootKey)
|
||||
defaults.set("/srv/moltbot", forKey: remoteProjectRootKey)
|
||||
|
||||
let cmd = CommandResolver.clawdbotCommand(
|
||||
subcommand: "status",
|
||||
@@ -131,9 +131,9 @@ import Testing
|
||||
#expect(cmd.contains("-i"))
|
||||
#expect(cmd.contains("/tmp/id_ed25519"))
|
||||
if let script = cmd.last {
|
||||
#expect(script.contains("PRJ='/srv/clawdbot'"))
|
||||
#expect(script.contains("PRJ='/srv/moltbot'"))
|
||||
#expect(script.contains("cd \"$PRJ\""))
|
||||
#expect(script.contains("clawdbot"))
|
||||
#expect(script.contains("moltbot"))
|
||||
#expect(script.contains("status"))
|
||||
#expect(script.contains("--json"))
|
||||
#expect(script.contains("CLI="))
|
||||
@@ -154,15 +154,15 @@ import Testing
|
||||
let tmp = try makeTempDir()
|
||||
CommandResolver.setProjectRoot(tmp.path)
|
||||
|
||||
let clawdbotPath = tmp.appendingPathComponent("node_modules/.bin/clawdbot")
|
||||
try self.makeExec(at: clawdbotPath)
|
||||
let moltbotPath = tmp.appendingPathComponent("node_modules/.bin/moltbot")
|
||||
try self.makeExec(at: moltbotPath)
|
||||
|
||||
let cmd = CommandResolver.clawdbotCommand(
|
||||
subcommand: "daemon",
|
||||
defaults: defaults,
|
||||
configRoot: ["gateway": ["mode": "local"]])
|
||||
|
||||
#expect(cmd.first == clawdbotPath.path)
|
||||
#expect(cmd.first == moltbotPath.path)
|
||||
#expect(cmd.count >= 2)
|
||||
if cmd.count >= 2 {
|
||||
#expect(cmd[1] == "daemon")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppKit
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct CronModelsTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct DeviceModelCatalogTests {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
struct ExecAllowlistTests {
|
||||
@Test func matchUsesResolvedPath() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct ExecApprovalHelpersTests {
|
||||
@Test func parseDecisionTrimsAndRejectsInvalid() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
@MainActor
|
||||
|
||||
@@ -5,7 +5,7 @@ import Testing
|
||||
@Test func sourcesAvoidLegacyNonThrowingFileHandleReadAPIs() throws {
|
||||
let testFile = URL(fileURLWithPath: #filePath)
|
||||
let packageRoot = testFile
|
||||
.deletingLastPathComponent() // ClawdbotIPCTests
|
||||
.deletingLastPathComponent() // MoltbotIPCTests
|
||||
.deletingLastPathComponent() // Tests
|
||||
.deletingLastPathComponent() // apps/macos
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct FileHandleSafeReadTests {
|
||||
@Test func readToEndSafelyReturnsEmptyForClosedHandle() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayAgentChannelTests {
|
||||
@Test func shouldDeliverBlocksWebChat() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
struct GatewayAutostartPolicyTests {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotKit
|
||||
import MoltbotKit
|
||||
import Foundation
|
||||
import os
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayConnectionTests {
|
||||
private final class FakeWebSocketTask: WebSocketTasking, @unchecked Sendable {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotKit
|
||||
import MoltbotKit
|
||||
import Foundation
|
||||
import os
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayChannelConnectTests {
|
||||
private enum FakeResponse {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotKit
|
||||
import MoltbotKit
|
||||
import Foundation
|
||||
import os
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayChannelRequestTests {
|
||||
private final class FakeWebSocketTask: WebSocketTasking, @unchecked Sendable {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotKit
|
||||
import MoltbotKit
|
||||
import Foundation
|
||||
import os
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayChannelShutdownTests {
|
||||
private final class FakeWebSocketTask: WebSocketTasking, @unchecked Sendable {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotKit
|
||||
import MoltbotKit
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import ClawdbotIPC
|
||||
@testable import Moltbot
|
||||
@testable import MoltbotIPC
|
||||
|
||||
private final class FakeWebSocketTask: WebSocketTasking, @unchecked Sendable {
|
||||
var state: URLSessionTask.State = .running
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ClawdbotDiscovery
|
||||
import MoltbotDiscovery
|
||||
import Testing
|
||||
|
||||
@Suite
|
||||
@@ -35,7 +35,7 @@ struct GatewayDiscoveryModelTests {
|
||||
#expect(GatewayDiscoveryModel.isLocalGateway(
|
||||
lanHost: nil,
|
||||
tailnetDns: nil,
|
||||
displayName: "Peter's Mac Studio (Clawdbot)",
|
||||
displayName: "Peter's Mac Studio (Moltbot)",
|
||||
serviceName: nil,
|
||||
local: local))
|
||||
}
|
||||
@@ -72,13 +72,13 @@ struct GatewayDiscoveryModelTests {
|
||||
lanHost: nil,
|
||||
tailnetDns: nil,
|
||||
displayName: nil,
|
||||
serviceName: "steipetacstudio (Clawdbot)",
|
||||
serviceName: "steipetacstudio (Moltbot)",
|
||||
local: local))
|
||||
#expect(GatewayDiscoveryModel.isLocalGateway(
|
||||
lanHost: nil,
|
||||
tailnetDns: nil,
|
||||
displayName: nil,
|
||||
serviceName: "steipete (Clawdbot)",
|
||||
serviceName: "steipete (Moltbot)",
|
||||
local: local))
|
||||
}
|
||||
|
||||
@@ -88,13 +88,13 @@ struct GatewayDiscoveryModelTests {
|
||||
"tailnetDns": " peters-mac-studio-1.ts.net ",
|
||||
"sshPort": " 2222 ",
|
||||
"gatewayPort": " 18799 ",
|
||||
"cliPath": " /opt/clawdbot ",
|
||||
"cliPath": " /opt/moltbot ",
|
||||
])
|
||||
#expect(parsed.lanHost == "studio.local")
|
||||
#expect(parsed.tailnetDns == "peters-mac-studio-1.ts.net")
|
||||
#expect(parsed.sshPort == 2222)
|
||||
#expect(parsed.gatewayPort == 18799)
|
||||
#expect(parsed.cliPath == "/opt/clawdbot")
|
||||
#expect(parsed.cliPath == "/opt/moltbot")
|
||||
}
|
||||
|
||||
@Test func parsesGatewayTXTDefaults() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayEndpointStoreTests {
|
||||
private func makeDefaults() -> UserDefaults {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayEnvironmentTests {
|
||||
@Test func semverParsesCommonForms() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Foundation
|
||||
import Testing
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct GatewayLaunchAgentManagerTests {
|
||||
@Test func launchAgentPlistSnapshotParsesArgsAndEnv() throws {
|
||||
let url = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-launchd-\(UUID().uuidString).plist")
|
||||
.appendingPathComponent("moltbot-launchd-\(UUID().uuidString).plist")
|
||||
let plist: [String: Any] = [
|
||||
"ProgramArguments": ["clawdbot", "gateway-daemon", "--port", "18789", "--bind", "loopback"],
|
||||
"ProgramArguments": ["moltbot", "gateway-daemon", "--port", "18789", "--bind", "loopback"],
|
||||
"EnvironmentVariables": [
|
||||
"CLAWDBOT_GATEWAY_TOKEN": " secret ",
|
||||
"CLAWDBOT_GATEWAY_PASSWORD": "pw",
|
||||
@@ -26,9 +26,9 @@ import Testing
|
||||
|
||||
@Test func launchAgentPlistSnapshotAllowsMissingBind() throws {
|
||||
let url = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-launchd-\(UUID().uuidString).plist")
|
||||
.appendingPathComponent("moltbot-launchd-\(UUID().uuidString).plist")
|
||||
let plist: [String: Any] = [
|
||||
"ProgramArguments": ["clawdbot", "gateway-daemon", "--port", "18789"],
|
||||
"ProgramArguments": ["moltbot", "gateway-daemon", "--port", "18789"],
|
||||
]
|
||||
let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0)
|
||||
try data.write(to: url, options: [.atomic])
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotKit
|
||||
import MoltbotKit
|
||||
import Foundation
|
||||
import os
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct HealthDecodeTests {
|
||||
private let sampleJSON: String = // minimal but complete payload
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct HealthStoreStateTests {
|
||||
@Test @MainActor func linkedChannelProbeFailureDegradesState() async throws {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppKit
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct InstancesStoreTests {
|
||||
@Test
|
||||
@@ -8,7 +8,7 @@ import Testing
|
||||
func presenceEventPayloadDecodesViaJSONEncoder() {
|
||||
// Build a payload that mirrors the gateway's presence event shape:
|
||||
// { "presence": [ PresenceEntry ] }
|
||||
let entry: [String: ClawdbotProtocol.AnyCodable] = [
|
||||
let entry: [String: MoltbotProtocol.AnyCodable] = [
|
||||
"host": .init("gw"),
|
||||
"ip": .init("10.0.0.1"),
|
||||
"version": .init("2.0.0"),
|
||||
@@ -18,10 +18,10 @@ import Testing
|
||||
"text": .init("Gateway node"),
|
||||
"ts": .init(1_730_000_000),
|
||||
]
|
||||
let payloadMap: [String: ClawdbotProtocol.AnyCodable] = [
|
||||
"presence": .init([ClawdbotProtocol.AnyCodable(entry)]),
|
||||
let payloadMap: [String: MoltbotProtocol.AnyCodable] = [
|
||||
"presence": .init([MoltbotProtocol.AnyCodable(entry)]),
|
||||
]
|
||||
let payload = ClawdbotProtocol.AnyCodable(payloadMap)
|
||||
let payload = MoltbotProtocol.AnyCodable(payloadMap)
|
||||
|
||||
let store = InstancesStore(isPreview: true)
|
||||
store.handlePresenceEventPayload(payload)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Darwin
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct LogLocatorTests {
|
||||
@Test func launchdGatewayLogPathEnsuresTmpDirExists() throws {
|
||||
let fm = FileManager()
|
||||
let baseDir = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
|
||||
let logDir = baseDir.appendingPathComponent("clawdbot-tests-\(UUID().uuidString)")
|
||||
let logDir = baseDir.appendingPathComponent("moltbot-tests-\(UUID().uuidString)")
|
||||
|
||||
setenv("CLAWDBOT_LOG_DIR", logDir.path, 1)
|
||||
defer {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import AppKit
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Foundation
|
||||
import Testing
|
||||
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
struct LowCoverageHelperTests {
|
||||
private typealias ProtoAnyCodable = ClawdbotProtocol.AnyCodable
|
||||
private typealias ProtoAnyCodable = MoltbotProtocol.AnyCodable
|
||||
|
||||
@Test func anyCodableHelperAccessors() throws {
|
||||
let payload: [String: ProtoAnyCodable] = [
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import AppKit
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import SwiftUI
|
||||
import Testing
|
||||
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import ClawdbotChatUI
|
||||
import ClawdbotProtocol
|
||||
import MoltbotChatUI
|
||||
import MoltbotProtocol
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct MacGatewayChatTransportMappingTests {
|
||||
@Test func snapshotMapsToHealth() {
|
||||
let snapshot = Snapshot(
|
||||
presence: [],
|
||||
health: ClawdbotProtocol.AnyCodable(["ok": ClawdbotProtocol.AnyCodable(false)]),
|
||||
health: MoltbotProtocol.AnyCodable(["ok": MoltbotProtocol.AnyCodable(false)]),
|
||||
stateversion: StateVersion(presence: 1, health: 1),
|
||||
uptimems: 123,
|
||||
configpath: nil,
|
||||
@@ -37,7 +37,7 @@ import Testing
|
||||
let frame = EventFrame(
|
||||
type: "event",
|
||||
event: "health",
|
||||
payload: ClawdbotProtocol.AnyCodable(["ok": ClawdbotProtocol.AnyCodable(true)]),
|
||||
payload: MoltbotProtocol.AnyCodable(["ok": MoltbotProtocol.AnyCodable(true)]),
|
||||
seq: 1,
|
||||
stateversion: nil)
|
||||
|
||||
@@ -60,10 +60,10 @@ import Testing
|
||||
}
|
||||
|
||||
@Test func chatEventMapsToChat() {
|
||||
let payload = ClawdbotProtocol.AnyCodable([
|
||||
"runId": ClawdbotProtocol.AnyCodable("run-1"),
|
||||
"sessionKey": ClawdbotProtocol.AnyCodable("main"),
|
||||
"state": ClawdbotProtocol.AnyCodable("final"),
|
||||
let payload = MoltbotProtocol.AnyCodable([
|
||||
"runId": MoltbotProtocol.AnyCodable("run-1"),
|
||||
"sessionKey": MoltbotProtocol.AnyCodable("main"),
|
||||
"state": MoltbotProtocol.AnyCodable("final"),
|
||||
])
|
||||
let frame = EventFrame(type: "event", event: "chat", payload: payload, seq: 1, stateversion: nil)
|
||||
let mapped = MacGatewayChatTransport.mapPushToTransportEvent(.event(frame))
|
||||
@@ -82,7 +82,7 @@ import Testing
|
||||
let frame = EventFrame(
|
||||
type: "event",
|
||||
event: "unknown",
|
||||
payload: ClawdbotProtocol.AnyCodable(["a": ClawdbotProtocol.AnyCodable(1)]),
|
||||
payload: MoltbotProtocol.AnyCodable(["a": MoltbotProtocol.AnyCodable(1)]),
|
||||
seq: 1,
|
||||
stateversion: nil)
|
||||
let mapped = MacGatewayChatTransport.mapPushToTransportEvent(.event(frame))
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import ClawdbotKit
|
||||
import MoltbotKit
|
||||
import CoreLocation
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
struct MacNodeRuntimeTests {
|
||||
@Test func handleInvokeRejectsUnknownCommand() async {
|
||||
@@ -14,28 +14,28 @@ struct MacNodeRuntimeTests {
|
||||
|
||||
@Test func handleInvokeRejectsEmptySystemRun() async throws {
|
||||
let runtime = MacNodeRuntime()
|
||||
let params = ClawdbotSystemRunParams(command: [])
|
||||
let params = MoltbotSystemRunParams(command: [])
|
||||
let json = try String(data: JSONEncoder().encode(params), encoding: .utf8)
|
||||
let response = await runtime.handleInvoke(
|
||||
BridgeInvokeRequest(id: "req-2", command: ClawdbotSystemCommand.run.rawValue, paramsJSON: json))
|
||||
BridgeInvokeRequest(id: "req-2", command: MoltbotSystemCommand.run.rawValue, paramsJSON: json))
|
||||
#expect(response.ok == false)
|
||||
}
|
||||
|
||||
@Test func handleInvokeRejectsEmptySystemWhich() async throws {
|
||||
let runtime = MacNodeRuntime()
|
||||
let params = ClawdbotSystemWhichParams(bins: [])
|
||||
let params = MoltbotSystemWhichParams(bins: [])
|
||||
let json = try String(data: JSONEncoder().encode(params), encoding: .utf8)
|
||||
let response = await runtime.handleInvoke(
|
||||
BridgeInvokeRequest(id: "req-2b", command: ClawdbotSystemCommand.which.rawValue, paramsJSON: json))
|
||||
BridgeInvokeRequest(id: "req-2b", command: MoltbotSystemCommand.which.rawValue, paramsJSON: json))
|
||||
#expect(response.ok == false)
|
||||
}
|
||||
|
||||
@Test func handleInvokeRejectsEmptyNotification() async throws {
|
||||
let runtime = MacNodeRuntime()
|
||||
let params = ClawdbotSystemNotifyParams(title: "", body: "")
|
||||
let params = MoltbotSystemNotifyParams(title: "", body: "")
|
||||
let json = try String(data: JSONEncoder().encode(params), encoding: .utf8)
|
||||
let response = await runtime.handleInvoke(
|
||||
BridgeInvokeRequest(id: "req-3", command: ClawdbotSystemCommand.notify.rawValue, paramsJSON: json))
|
||||
BridgeInvokeRequest(id: "req-3", command: MoltbotSystemCommand.notify.rawValue, paramsJSON: json))
|
||||
#expect(response.ok == false)
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ struct MacNodeRuntimeTests {
|
||||
await TestIsolation.withUserDefaultsValues([cameraEnabledKey: false]) {
|
||||
let runtime = MacNodeRuntime()
|
||||
let response = await runtime.handleInvoke(
|
||||
BridgeInvokeRequest(id: "req-4", command: ClawdbotCameraCommand.list.rawValue))
|
||||
BridgeInvokeRequest(id: "req-4", command: MoltbotCameraCommand.list.rawValue))
|
||||
#expect(response.ok == false)
|
||||
#expect(response.error?.message.contains("CAMERA_DISABLED") == true)
|
||||
}
|
||||
@@ -60,7 +60,7 @@ struct MacNodeRuntimeTests {
|
||||
outPath: String?) async throws -> (path: String, hasAudio: Bool)
|
||||
{
|
||||
let url = FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-test-screen-record-\(UUID().uuidString).mp4")
|
||||
.appendingPathComponent("moltbot-test-screen-record-\(UUID().uuidString).mp4")
|
||||
try Data("ok".utf8).write(to: url)
|
||||
return (path: url.path, hasAudio: false)
|
||||
}
|
||||
@@ -68,7 +68,7 @@ struct MacNodeRuntimeTests {
|
||||
func locationAuthorizationStatus() -> CLAuthorizationStatus { .authorizedAlways }
|
||||
func locationAccuracyAuthorization() -> CLAccuracyAuthorization { .fullAccuracy }
|
||||
func currentLocation(
|
||||
desiredAccuracy: ClawdbotLocationAccuracy,
|
||||
desiredAccuracy: MoltbotLocationAccuracy,
|
||||
maxAgeMs: Int?,
|
||||
timeoutMs: Int?) async throws -> CLLocation
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ClawdbotDiscovery
|
||||
import MoltbotDiscovery
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppKit
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct ModelCatalogLoaderTests {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct NodeManagerPathsTests {
|
||||
private func makeTempDir() throws -> URL {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct NodePairingReconcilePolicyTests {
|
||||
@Test func policyPollsOnlyWhenActive() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ClawdbotDiscovery
|
||||
import MoltbotDiscovery
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
private typealias ProtoAnyCodable = ClawdbotProtocol.AnyCodable
|
||||
private typealias ProtoAnyCodable = MoltbotProtocol.AnyCodable
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import CoreLocation
|
||||
import Testing
|
||||
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite("PermissionManager Location")
|
||||
struct PermissionManagerLocationTests {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ClawdbotIPC
|
||||
import MoltbotIPC
|
||||
import CoreLocation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
#if canImport(Darwin)
|
||||
import Darwin
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct RuntimeLocatorTests {
|
||||
private func makeTempExecutable(contents: String) throws -> URL {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct ScreenshotSizeTests {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct SemverTests {
|
||||
@Test func comparisonOrdersByMajorMinorPatch() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
struct SessionDataTests {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
struct SessionMenuPreviewTests {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
@@ -8,7 +8,7 @@ struct SettingsViewSmokeTests {
|
||||
@Test func cronSettingsBuildsBody() {
|
||||
let store = CronJobsStore(isPreview: true)
|
||||
store.schedulerEnabled = false
|
||||
store.schedulerStorePath = "/tmp/clawdbot-cron-store.json"
|
||||
store.schedulerStorePath = "/tmp/moltbot-cron-store.json"
|
||||
|
||||
let job1 = CronJob(
|
||||
id: "job-1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
@@ -12,7 +12,7 @@ struct SkillsSettingsSmokeTests {
|
||||
SkillStatus(
|
||||
name: "Needs Setup",
|
||||
description: "Missing bins and env",
|
||||
source: "clawdbot-managed",
|
||||
source: "moltbot-managed",
|
||||
filePath: "/tmp/skills/needs-setup",
|
||||
baseDir: "/tmp/skills",
|
||||
skillKey: "needs-setup",
|
||||
@@ -39,7 +39,7 @@ struct SkillsSettingsSmokeTests {
|
||||
SkillStatus(
|
||||
name: "Ready Skill",
|
||||
description: "All set",
|
||||
source: "clawdbot-bundled",
|
||||
source: "moltbot-bundled",
|
||||
filePath: "/tmp/skills/ready",
|
||||
baseDir: "/tmp/skills",
|
||||
skillKey: "ready",
|
||||
@@ -59,7 +59,7 @@ struct SkillsSettingsSmokeTests {
|
||||
SkillStatus(
|
||||
name: "Disabled Skill",
|
||||
description: "Disabled in config",
|
||||
source: "clawdbot-extra",
|
||||
source: "moltbot-extra",
|
||||
filePath: "/tmp/skills/disabled",
|
||||
baseDir: "/tmp/skills",
|
||||
skillKey: "disabled",
|
||||
@@ -90,7 +90,7 @@ struct SkillsSettingsSmokeTests {
|
||||
SkillStatus(
|
||||
name: "Local Skill",
|
||||
description: "Local ready",
|
||||
source: "clawdbot-workspace",
|
||||
source: "moltbot-workspace",
|
||||
filePath: "/tmp/skills/local",
|
||||
baseDir: "/tmp/skills",
|
||||
skillKey: "local",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
@@ -17,7 +17,7 @@ struct TailscaleIntegrationSectionTests {
|
||||
let service = TailscaleService(
|
||||
isInstalled: true,
|
||||
isRunning: true,
|
||||
tailscaleHostname: "clawdbot.tailnet.ts.net",
|
||||
tailscaleHostname: "moltbot.tailnet.ts.net",
|
||||
tailscaleIP: "100.64.0.1")
|
||||
var view = TailscaleIntegrationSection(connectionMode: .local, isPaused: false)
|
||||
view.setTestingService(service)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized) struct TalkAudioPlayerTests {
|
||||
@MainActor
|
||||
|
||||
@@ -110,7 +110,7 @@ enum TestIsolation {
|
||||
|
||||
nonisolated static func tempConfigPath() -> String {
|
||||
FileManager().temporaryDirectory
|
||||
.appendingPathComponent("clawdbot-test-config-\(UUID().uuidString).json")
|
||||
.appendingPathComponent("moltbot-test-config-\(UUID().uuidString).json")
|
||||
.path
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized) struct UtilitiesTests {
|
||||
@Test func ageStringsCoverCommonWindows() {
|
||||
@@ -46,7 +46,7 @@ import Testing
|
||||
let tmp = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
|
||||
.appendingPathComponent(UUID().uuidString, isDirectory: true)
|
||||
let dist = tmp.appendingPathComponent("dist/index.js")
|
||||
let bin = tmp.appendingPathComponent("bin/clawdbot.js")
|
||||
let bin = tmp.appendingPathComponent("bin/moltbot.js")
|
||||
try FileManager().createDirectory(at: dist.deletingLastPathComponent(), withIntermediateDirectories: true)
|
||||
try FileManager().createDirectory(at: bin.deletingLastPathComponent(), withIntermediateDirectories: true)
|
||||
FileManager().createFile(atPath: dist.path, contents: Data())
|
||||
@@ -58,11 +58,11 @@ import Testing
|
||||
|
||||
@Test func logLocatorPicksNewestLogFile() throws {
|
||||
let fm = FileManager()
|
||||
let dir = URL(fileURLWithPath: "/tmp/clawdbot", isDirectory: true)
|
||||
let dir = URL(fileURLWithPath: "/tmp/moltbot", isDirectory: true)
|
||||
try? fm.createDirectory(at: dir, withIntermediateDirectories: true)
|
||||
|
||||
let older = dir.appendingPathComponent("clawdbot-old-\(UUID().uuidString).log")
|
||||
let newer = dir.appendingPathComponent("clawdbot-new-\(UUID().uuidString).log")
|
||||
let older = dir.appendingPathComponent("moltbot-old-\(UUID().uuidString).log")
|
||||
let newer = dir.appendingPathComponent("moltbot-new-\(UUID().uuidString).log")
|
||||
fm.createFile(atPath: older.path, contents: Data("old".utf8))
|
||||
fm.createFile(atPath: newer.path, contents: Data("new".utf8))
|
||||
try fm.setAttributes([.modificationDate: Date(timeIntervalSinceNow: -100)], ofItemAtPath: older.path)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppKit
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized) struct VoicePushToTalkHotkeyTests {
|
||||
actor Counter {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct VoicePushToTalkTests {
|
||||
@Test func deltaTrimsCommittedPrefix() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized) struct VoiceWakeForwarderTests {
|
||||
@Test func prefixedTranscriptUsesMachineName() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized) struct VoiceWakeGlobalSettingsSyncTests {
|
||||
@Test func appliesVoiceWakeChangedEventToAppState() async {
|
||||
@@ -11,7 +11,7 @@ import Testing
|
||||
AppStateStore.shared.applyGlobalVoiceWakeTriggers(["before"])
|
||||
}
|
||||
|
||||
let payload = ClawdbotProtocol.AnyCodable(["triggers": ["clawd", "computer"]])
|
||||
let payload = MoltbotProtocol.AnyCodable(["triggers": ["clawd", "computer"]])
|
||||
let evt = EventFrame(
|
||||
type: "event",
|
||||
event: "voicewake.changed",
|
||||
@@ -36,7 +36,7 @@ import Testing
|
||||
AppStateStore.shared.applyGlobalVoiceWakeTriggers(["before"])
|
||||
}
|
||||
|
||||
let payload = ClawdbotProtocol.AnyCodable(["unexpected": 123])
|
||||
let payload = MoltbotProtocol.AnyCodable(["unexpected": 123])
|
||||
let evt = EventFrame(
|
||||
type: "event",
|
||||
event: "voicewake.changed",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
struct VoiceWakeHelpersTests {
|
||||
@Test func sanitizeTriggersTrimsAndDropsEmpty() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct VoiceWakeOverlayTests {
|
||||
@Test func guardTokenDropsWhenNoActive() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SwiftUI
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SwabbleKit
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct VoiceWakeRuntimeTests {
|
||||
@Test func trimsAfterTriggerKeepsPostSpeech() {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite struct WebChatMainSessionKeyTests {
|
||||
@Test func configGetSnapshotMainKeyFallsBackToMainWhenMissing() throws {
|
||||
let json = """
|
||||
{
|
||||
"path": "/Users/pete/.clawdbot/clawdbot.json",
|
||||
"path": "/Users/pete/.clawdbot/moltbot.json",
|
||||
"exists": true,
|
||||
"raw": null,
|
||||
"parsed": {},
|
||||
@@ -22,7 +22,7 @@ import Testing
|
||||
@Test func configGetSnapshotMainKeyTrimsAndUsesValue() throws {
|
||||
let json = """
|
||||
{
|
||||
"path": "/Users/pete/.clawdbot/clawdbot.json",
|
||||
"path": "/Users/pete/.clawdbot/moltbot.json",
|
||||
"exists": true,
|
||||
"raw": null,
|
||||
"parsed": {},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import AppKit
|
||||
import ClawdbotChatUI
|
||||
import MoltbotChatUI
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
struct WebChatSwiftUISmokeTests {
|
||||
private struct TestTransport: ClawdbotChatTransport, Sendable {
|
||||
func requestHistory(sessionKey: String) async throws -> ClawdbotChatHistoryPayload {
|
||||
private struct TestTransport: MoltbotChatTransport, Sendable {
|
||||
func requestHistory(sessionKey: String) async throws -> MoltbotChatHistoryPayload {
|
||||
let json = """
|
||||
{"sessionKey":"\(sessionKey)","sessionId":null,"messages":[],"thinkingLevel":"off"}
|
||||
"""
|
||||
return try JSONDecoder().decode(ClawdbotChatHistoryPayload.self, from: Data(json.utf8))
|
||||
return try JSONDecoder().decode(MoltbotChatHistoryPayload.self, from: Data(json.utf8))
|
||||
}
|
||||
|
||||
func sendMessage(
|
||||
@@ -20,17 +20,17 @@ struct WebChatSwiftUISmokeTests {
|
||||
message _: String,
|
||||
thinking _: String,
|
||||
idempotencyKey _: String,
|
||||
attachments _: [ClawdbotChatAttachmentPayload]) async throws -> ClawdbotChatSendResponse
|
||||
attachments _: [MoltbotChatAttachmentPayload]) async throws -> MoltbotChatSendResponse
|
||||
{
|
||||
let json = """
|
||||
{"runId":"\(UUID().uuidString)","status":"ok"}
|
||||
"""
|
||||
return try JSONDecoder().decode(ClawdbotChatSendResponse.self, from: Data(json.utf8))
|
||||
return try JSONDecoder().decode(MoltbotChatSendResponse.self, from: Data(json.utf8))
|
||||
}
|
||||
|
||||
func requestHealth(timeoutMs _: Int) async throws -> Bool { true }
|
||||
|
||||
func events() -> AsyncStream<ClawdbotChatTransportEvent> {
|
||||
func events() -> AsyncStream<MoltbotChatTransportEvent> {
|
||||
AsyncStream { continuation in
|
||||
continuation.finish()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Testing
|
||||
@testable import ClawdbotDiscovery
|
||||
@testable import MoltbotDiscovery
|
||||
|
||||
@Suite
|
||||
struct WideAreaGatewayDiscoveryTests {
|
||||
@@ -20,7 +20,7 @@ struct WideAreaGatewayDiscoveryTests {
|
||||
let nameserver = args.first(where: { $0.hasPrefix("@") }) ?? ""
|
||||
if recordType == "PTR" {
|
||||
if nameserver == "@100.123.224.76" {
|
||||
return "steipetacstudio-gateway._clawdbot-gw._tcp.clawdbot.internal.\n"
|
||||
return "steipetacstudio-gateway._moltbot-gw._tcp.clawdbot.internal.\n"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -28,7 +28,7 @@ struct WideAreaGatewayDiscoveryTests {
|
||||
return "0 0 18789 steipetacstudio.clawdbot.internal."
|
||||
}
|
||||
if recordType == "TXT" {
|
||||
return "\"displayName=Peter\\226\\128\\153s Mac Studio (Clawdbot)\" \"gatewayPort=18789\" \"tailnetDns=peters-mac-studio-1.sheep-coho.ts.net\" \"cliPath=/Users/steipete/clawdbot/src/entry.ts\""
|
||||
return "\"displayName=Peter\\226\\128\\153s Mac Studio (Moltbot)\" \"gatewayPort=18789\" \"tailnetDns=peters-mac-studio-1.sheep-coho.ts.net\" \"cliPath=/Users/steipete/moltbot/src/entry.ts\""
|
||||
}
|
||||
return ""
|
||||
})
|
||||
@@ -39,11 +39,11 @@ struct WideAreaGatewayDiscoveryTests {
|
||||
|
||||
#expect(beacons.count == 1)
|
||||
let beacon = beacons[0]
|
||||
let expectedDisplay = "Peter\u{2019}s Mac Studio (Clawdbot)"
|
||||
let expectedDisplay = "Peter\u{2019}s Mac Studio (Moltbot)"
|
||||
#expect(beacon.displayName == expectedDisplay)
|
||||
#expect(beacon.port == 18789)
|
||||
#expect(beacon.gatewayPort == 18789)
|
||||
#expect(beacon.tailnetDns == "peters-mac-studio-1.sheep-coho.ts.net")
|
||||
#expect(beacon.cliPath == "/Users/steipete/clawdbot/src/entry.ts")
|
||||
#expect(beacon.cliPath == "/Users/steipete/moltbot/src/entry.ts")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppKit
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
@MainActor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ClawdbotProtocol
|
||||
import MoltbotProtocol
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
@testable import Moltbot
|
||||
|
||||
@Suite
|
||||
@MainActor
|
||||
@@ -68,7 +68,7 @@ struct WorkActivityStoreTests {
|
||||
meta: nil,
|
||||
args: [
|
||||
"command": AnyCodable("echo hi\necho bye"),
|
||||
"path": AnyCodable("\(home)/Projects/clawdbot"),
|
||||
"path": AnyCodable("\(home)/Projects/moltbot"),
|
||||
])
|
||||
|
||||
#expect(store.current?.label == "bash: echo hi")
|
||||
|
||||
Reference in New Issue
Block a user