Skip to content

Commit 8876528

Browse files
authored
feat: clone GitHub projects from session picker (#121818)
* feat(projects): add managed GitHub clones * feat(ui): clone GitHub projects from session picker * fix(projects): integrate current gateway owners * fix(protocol): derive Swift error detail accessors * fix(ui): gate project cloning by scope * test(gateway): isolate session prewarm probes * revert: drop duplicate session prewarm repair
1 parent 7c83fc1 commit 8876528

54 files changed

Lines changed: 2173 additions & 92 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayProtocol.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,8 @@ enum class GatewayMethod(
539539
SecretsStoreDelete("secrets.store.delete"),
540540
UsersPrefsGet("users.prefs.get"),
541541
UsersPrefsSet("users.prefs.set"),
542+
ProjectsAdd("projects.add"),
543+
ProjectsSearchRemote("projects.searchRemote"),
542544
}
543545

544546
enum class GatewayEvent(

‎apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift‎

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,24 @@ public struct WizardNotFoundErrorDetails: Codable, Sendable {
15831583
}
15841584
}
15851585

1586+
public struct ProjectCloneErrorDetails: Codable, Sendable {
1587+
public let code: String
1588+
public let cause: String
1589+
1590+
public init(
1591+
code: String,
1592+
cause: String)
1593+
{
1594+
self.code = code
1595+
self.cause = cause
1596+
}
1597+
1598+
private enum CodingKeys: String, CodingKey {
1599+
case code
1600+
case cause
1601+
}
1602+
}
1603+
15861604
public struct GatewaySuspendTaskBlocker: Codable, Sendable {
15871605
public let taskid: String
15881606
public let status: String
@@ -3150,11 +3168,11 @@ public struct ProjectRecentProject: Codable, Sendable {
31503168
public struct ProjectsListParams: Codable, Sendable {}
31513169

31523170
public struct ProjectsListResult: Codable, Sendable {
3153-
public let projects: [ProjectsRegisterResult]
3171+
public let projects: [ProjectsAddResult]
31543172
public let recents: [ProjectRecent]?
31553173

31563174
public init(
3157-
projects: [ProjectsRegisterResult],
3175+
projects: [ProjectsAddResult],
31583176
recents: [ProjectRecent]? = nil)
31593177
{
31603178
self.projects = projects
@@ -3219,17 +3237,139 @@ public struct ProjectsRegisterResult: Codable, Sendable {
32193237
}
32203238
}
32213239

3240+
public struct ProjectsAddParams: Codable, Sendable {
3241+
public let giturl: String
3242+
public let name: String?
3243+
3244+
public init(
3245+
giturl: String,
3246+
name: String? = nil)
3247+
{
3248+
self.giturl = giturl
3249+
self.name = name
3250+
}
3251+
3252+
private enum CodingKeys: String, CodingKey {
3253+
case giturl = "gitUrl"
3254+
case name
3255+
}
3256+
}
3257+
3258+
public struct ProjectsAddResult: Codable, Sendable {
3259+
public let id: String
3260+
public let displayname: String
3261+
public let reporoot: String?
3262+
public let originurl: String?
3263+
public let source: String
3264+
public let agentid: String?
3265+
3266+
public init(
3267+
id: String,
3268+
displayname: String,
3269+
reporoot: String? = nil,
3270+
originurl: String? = nil,
3271+
source: String,
3272+
agentid: String? = nil)
3273+
{
3274+
self.id = id
3275+
self.displayname = displayname
3276+
self.reporoot = reporoot
3277+
self.originurl = originurl
3278+
self.source = source
3279+
self.agentid = agentid
3280+
}
3281+
3282+
private enum CodingKeys: String, CodingKey {
3283+
case id
3284+
case displayname = "displayName"
3285+
case reporoot = "repoRoot"
3286+
case originurl = "originUrl"
3287+
case source
3288+
case agentid = "agentId"
3289+
}
3290+
}
3291+
3292+
public struct RemoteProject: Codable, Sendable {
3293+
public let name: String
3294+
public let fullname: String
3295+
public let description: String?
3296+
public let cloneurl: String
3297+
public let weburl: String
3298+
public let _private: Bool
3299+
3300+
public init(
3301+
name: String,
3302+
fullname: String,
3303+
description: String? = nil,
3304+
cloneurl: String,
3305+
weburl: String,
3306+
_private: Bool)
3307+
{
3308+
self.name = name
3309+
self.fullname = fullname
3310+
self.description = description
3311+
self.cloneurl = cloneurl
3312+
self.weburl = weburl
3313+
self._private = _private
3314+
}
3315+
3316+
private enum CodingKeys: String, CodingKey {
3317+
case name
3318+
case fullname = "fullName"
3319+
case description
3320+
case cloneurl = "cloneUrl"
3321+
case weburl = "webUrl"
3322+
case _private = "private"
3323+
}
3324+
}
3325+
3326+
public struct ProjectsSearchRemoteParams: Codable, Sendable {
3327+
public let query: String
3328+
3329+
public init(
3330+
query: String)
3331+
{
3332+
self.query = query
3333+
}
3334+
3335+
private enum CodingKeys: String, CodingKey {
3336+
case query
3337+
}
3338+
}
3339+
3340+
public struct ProjectsSearchRemoteResult: Codable, Sendable {
3341+
public let credential: AnyCodable
3342+
public let projects: [RemoteProject]
3343+
3344+
public init(
3345+
credential: AnyCodable,
3346+
projects: [RemoteProject])
3347+
{
3348+
self.credential = credential
3349+
self.projects = projects
3350+
}
3351+
3352+
private enum CodingKeys: String, CodingKey {
3353+
case credential
3354+
case projects
3355+
}
3356+
}
3357+
32223358
public struct ProjectsRemoveParams: Codable, Sendable {
32233359
public let id: String
3360+
public let deletecheckout: Bool?
32243361

32253362
public init(
3226-
id: String)
3363+
id: String,
3364+
deletecheckout: Bool? = nil)
32273365
{
32283366
self.id = id
3367+
self.deletecheckout = deletecheckout
32293368
}
32303369

32313370
private enum CodingKeys: String, CodingKey {
32323371
case id
3372+
case deletecheckout = "deleteCheckout"
32333373
}
32343374
}
32353375

@@ -18764,6 +18904,7 @@ public enum GatewayErrorDetails: Codable, Sendable {
1876418904
case missingScope(MissingScopeErrorDetails)
1876518905
case mcpAppViewExpired(McpAppViewExpiredErrorDetails)
1876618906
case userPrefsLimitExceeded(UserPrefsLimitExceededErrorDetails)
18907+
case projectCloneFailed(ProjectCloneErrorDetails)
1876718908
case unknownAgentId(UnknownAgentIdErrorDetails)
1876818909
case wizardNotFound(WizardNotFoundErrorDetails)
1876918910

@@ -18782,6 +18923,7 @@ public enum GatewayErrorDetails: Codable, Sendable {
1878218923
case .missingScope(let value): value.code
1878318924
case .mcpAppViewExpired(let value): value.code
1878418925
case .userPrefsLimitExceeded(let value): value.code
18926+
case .projectCloneFailed(let value): value.code
1878518927
case .unknownAgentId(let value): value.code
1878618928
case .wizardNotFound(let value): value.code
1878718929
}
@@ -18808,6 +18950,7 @@ public enum GatewayErrorDetails: Codable, Sendable {
1880818950
case "MISSING_SCOPE": self = try .missingScope(MissingScopeErrorDetails(from: decoder))
1880918951
case "MCP_APP_VIEW_EXPIRED": self = try .mcpAppViewExpired(McpAppViewExpiredErrorDetails(from: decoder))
1881018952
case "USER_PREFS_LIMIT_EXCEEDED": self = try .userPrefsLimitExceeded(UserPrefsLimitExceededErrorDetails(from: decoder))
18953+
case "PROJECT_CLONE_FAILED": self = try .projectCloneFailed(ProjectCloneErrorDetails(from: decoder))
1881118954
case "UNKNOWN_AGENT_ID": self = try .unknownAgentId(UnknownAgentIdErrorDetails(from: decoder))
1881218955
case "WIZARD_NOT_FOUND": self = try .wizardNotFound(WizardNotFoundErrorDetails(from: decoder))
1881318956
default:
@@ -18824,6 +18967,7 @@ public enum GatewayErrorDetails: Codable, Sendable {
1882418967
case .missingScope(let value): try value.encode(to: encoder)
1882518968
case .mcpAppViewExpired(let value): try value.encode(to: encoder)
1882618969
case .userPrefsLimitExceeded(let value): try value.encode(to: encoder)
18970+
case .projectCloneFailed(let value): try value.encode(to: encoder)
1882718971
case .unknownAgentId(let value): try value.encode(to: encoder)
1882818972
case .wizardNotFound(let value): try value.encode(to: encoder)
1882918973
}

‎docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.generated/plugin-sdk-api-baseline/agent-harness.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.generated/plugin-sdk-api-baseline/channel-core.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.generated/plugin-sdk-api-baseline/channel-message.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.generated/plugin-sdk-api-baseline/channel-outbound.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.generated/plugin-sdk-api-baseline/core.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)