Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
77b2c02
Pre-release 0.34.118
actions-user May 16, 2025
82d3232
Release 0.35.0
actions-user May 19, 2025
f04ddbe
Pre-release 0.35.120
actions-user Jun 3, 2025
041a898
Pre-release 0.35.121
actions-user Jun 4, 2025
2e8e989
Release 0.36.0
actions-user Jun 4, 2025
d3cd006
Pre-release 0.36.123
actions-user Jun 13, 2025
fabc66e
Pre-release 0.36.124
actions-user Jun 17, 2025
64a0691
Release 0.37.0
actions-user Jun 18, 2025
81fc588
Pre-release 0.37.126
actions-user Jun 24, 2025
9788b5c
Pre-release 0.37.127
actions-user Jun 27, 2025
d1f7de3
Release 0.38.0
actions-user Jun 30, 2025
e7fd64d
Pre-release 0.38.129
actions-user Jul 9, 2025
c862f92
Create swift.yml
smoku8282 Jul 22, 2025
afbbdad
Release 0.39.0
actions-user Jul 23, 2025
9d1d42f
Release 0.40.0
actions-user Jul 24, 2025
0517f3b
Pre-release 0.40.132
actions-user Aug 1, 2025
c6e9a07
Pre-release 0.40.133
actions-user Aug 12, 2025
3a67130
Release 0.41.0
actions-user Aug 14, 2025
1339ef7
Pre-release 0.41.135
actions-user Aug 27, 2025
65dc134
Pre-release 0.41.136
actions-user Sep 2, 2025
be64a90
Release 0.42.0
actions-user Sep 3, 2025
b3fe4dd
Release 0.43.0
actions-user Sep 4, 2025
4381034
Pre-release 0.43.139
actions-user Sep 15, 2025
079132f
Create launch.json
smoku8282 Sep 19, 2025
aa450c1
Merge branch 'main' of https://github.com/smoku8282/CopilotForXcode
smoku8282 Sep 19, 2025
dee1fd1
Create copilot-instructions.md
smoku8282 Sep 19, 2025
75aa71a
Pre-release 0.43.140
actions-user Sep 19, 2025
1978c49
Merge branch 'github:main' into main
smoku8282 Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pre-release 0.40.132
  • Loading branch information
actions-user committed Aug 1, 2025
commit 0517f3b580fa57aadafcd79312b89732a4071e16
74 changes: 46 additions & 28 deletions Copilot for Xcode.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 32 additions & 5 deletions Copilot for Xcode/Credits.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ SOFTWARE.\
\
\
Dependency: github.com/apple/swift-syntax\
Version: 509.0.2\
Version: 510.0.3\
License Content:\
Apache License\
Version 2.0, January 2004\
Expand Down Expand Up @@ -1761,7 +1761,7 @@ License Content:\
\
\
Dependency: github.com/ChimeHQ/JSONRPC\
Version: 0.6.0\
Version: 0.9.0\
License Content:\
BSD 3-Clause License\
\
Expand Down Expand Up @@ -1795,7 +1795,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\
\
\
Dependency: github.com/ChimeHQ/LanguageServerProtocol\
Version: 0.8.0\
Version: 0.13.3\
License Content:\
BSD 3-Clause License\
\
Expand Down Expand Up @@ -2611,7 +2611,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
\
\
Dependency: github.com/ChimeHQ/LanguageClient\
Version: 0.3.1\
Version: 0.8.2\
License Content:\
BSD 3-Clause License\
\
Expand Down Expand Up @@ -2645,7 +2645,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\
\
\
Dependency: github.com/ChimeHQ/ProcessEnv\
Version: 0.3.1\
Version: 1.0.1\
License Content:\
BSD 3-Clause License\
\
Expand Down Expand Up @@ -3322,4 +3322,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\
THE SOFTWARE.\
\
\
Dependency: https://github.com/scinfu/SwiftSoup\
Version: 2.9.6\
License Content:\
The MIT License\
\
Copyright (c) 2009-2025 Jonathan Hedley <https://jsoup.org/>\
Swift port copyright (c) 2016-2025 Nabil Chatbi\
\
Permission is hereby granted, free of charge, to any person obtaining a copy\
of this software and associated documentation files (the "Software"), to deal\
in the Software without restriction, including without limitation the rights\
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\
copies of the Software, and to permit persons to whom the Software is\
furnished to do so, subject to the following conditions:\
\
The above copyright notice and this permission notice shall be included in all\
copies or substantial portions of the Software.\
\
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\
SOFTWARE.\
\
\
}
9 changes: 4 additions & 5 deletions Core/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ let package = Package(
.package(url: "https://github.com/devm33/KeyboardShortcuts", branch: "main"),
.package(url: "https://github.com/devm33/CGEventOverride", branch: "devm33/fix-stale-AXIsProcessTrusted"),
.package(url: "https://github.com/devm33/Highlightr", branch: "master"),
.package(url: "https://github.com/globulus/swiftui-flow-layout",
from: "1.0.5")
.package(url: "https://github.com/globulus/swiftui-flow-layout", from: "1.0.5")
],
targets: [
// MARK: - Main
Expand Down Expand Up @@ -182,7 +181,8 @@ let package = Package(
.product(name: "Workspace", package: "Tool"),
.product(name: "Terminal", package: "Tool"),
.product(name: "SystemUtils", package: "Tool"),
.product(name: "AppKitExtension", package: "Tool")
.product(name: "AppKitExtension", package: "Tool"),
.product(name: "WebContentExtractor", package: "Tool")
]),
.testTarget(
name: "ChatServiceTests",
Expand All @@ -202,8 +202,7 @@ let package = Package(
.product(name: "MarkdownUI", package: "swift-markdown-ui"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
.product(name: "SwiftUIFlowLayout", package: "swiftui-flow-layout"),
.product(name: "Persist", package: "Tool"),
.product(name: "Terminal", package: "Tool")
.product(name: "Persist", package: "Tool")
]
),

Expand Down
4 changes: 4 additions & 0 deletions Core/Sources/ChatService/ChatService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ public final class ChatService: ChatServiceType, ObservableObject {
}
}

public func notifyChangeTextDocument(fileURL: URL, content: String, version: Int) async throws {
try await conversationProvider?.notifyChangeTextDocument(fileURL: fileURL, content: content, version: version, workspaceURL: getWorkspaceURL())
}

public static func service(for chatTabInfo: ChatTabInfo) -> ChatService {
let provider = BuiltinExtensionConversationServiceProvider(
extension: GitHubCopilotExtension.self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class CopilotToolRegistry {
tools[ToolName.getErrors.rawValue] = GetErrorsTool()
tools[ToolName.insertEditIntoFile.rawValue] = InsertEditIntoFileTool()
tools[ToolName.createFile.rawValue] = CreateFileTool()
tools[ToolName.fetchWebPage.rawValue] = FetchWebPageTool()
}

public func getTool(name: String) -> ICopilotTool? {
Expand Down
46 changes: 46 additions & 0 deletions Core/Sources/ChatService/ToolCalls/FetchWebPageTool.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import AppKit
import AXExtension
import AXHelper
import ConversationServiceProvider
import Foundation
import JSONRPC
import Logger
import WebKit
import WebContentExtractor

public class FetchWebPageTool: ICopilotTool {
public static let name = ToolName.fetchWebPage

public func invokeTool(
_ request: InvokeClientToolRequest,
completion: @escaping (AnyJSONRPCResponse) -> Void,
chatHistoryUpdater: ChatHistoryUpdater?,
contextProvider: (any ToolContextProvider)?
) -> Bool {
guard let params = request.params,
let input = params.input,
let urls = input["urls"]?.value as? [String]
else {
completeResponse(request, status: .error, response: "Invalid parameters", completion: completion)
return true
}

guard !urls.isEmpty else {
completeResponse(request, status: .error, response: "No valid URLs provided", completion: completion)
return true
}

// Use the improved WebContentFetcher to fetch content from all URLs
Task {
let results = await WebContentFetcher.fetchMultipleContentAsync(from: urls)

completeResponses(
request,
responses: results,
completion: completion
)
}

return true
}
}
52 changes: 39 additions & 13 deletions Core/Sources/ChatService/ToolCalls/ICopilotTool.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import ChatTab
import ConversationServiceProvider
import Foundation
import JSONRPC
import ChatTab

enum ToolInvocationStatus: String {
case success, error, cancelled
}

public protocol ToolContextProvider {
// MARK: insert_edit_into_file
var chatTabInfo: ChatTabInfo { get }
func updateFileEdits(by fileEdit: FileEdit) -> Void
func notifyChangeTextDocument(fileURL: URL, content: String, version: Int) async throws
}

public typealias ChatHistoryUpdater = (String, [AgentRound]) -> Void
Expand Down Expand Up @@ -48,14 +46,42 @@ extension ICopilotTool {
response: String = "",
completion: @escaping (AnyJSONRPCResponse) -> Void
) {
let result: JSONValue = .array([
.hash([
"status": .string(status.rawValue),
"content": .array([.hash(["value": .string(response)])])
]),
.null
])
completion(AnyJSONRPCResponse(id: request.id, result: result))
completeResponses(
request,
status: status,
responses: [response],
completion: completion
)
}

///
/// Completes a tool response with multiple data entries.
/// - Parameters:
/// - request: The original tool invocation request.
/// - status: The completion status of the tool execution (success, error, or cancelled).
/// - responses: Array of string values to include in the response content.
/// - completion: The completion handler to call with the response.
///
func completeResponses(
_ request: InvokeClientToolRequest,
status: ToolInvocationStatus = .success,
responses: [String],
completion: @escaping (AnyJSONRPCResponse) -> Void
) {
let toolResult = LanguageModelToolResult(status: status, content: responses.map { response in
LanguageModelToolResult.Content(value: response)
})
let jsonResult = try? JSONEncoder().encode(toolResult)
let jsonValue = (try? JSONDecoder().decode(JSONValue.self, from: jsonResult ?? Data())) ?? JSONValue.null
completion(
AnyJSONRPCResponse(
id: request.id,
result: JSONValue.array([
jsonValue,
JSONValue.null,
])
)
)
}
}

Expand Down
Loading