* Pass model to tools
When tools make requests, they should use the right model. So we
- save the model id on the request
- look it up when the tool is invoked
- resolve it to a LanguageModelChat in the EH
* Fix build
* first pass language model image
* add language model 2 instead
* more languagemodel2
* change api shape
* add back original languagemodelchatmessage
* fix imports
* allow old languageModelChatMessage to also b used
* handle vsbuffer case
* make sure to resize images before sending the chat request
* remove detail
* remove whitespace
* rename to languageModelDataPart
* Add proposed API for trusted domains and for web page extraction
I don't love the shape of this API but I'm going with this for now to play with it.
This will help Chat provide contents of web pages as context but also allow it full control of the tool.
ref https://github.com/microsoft/vscode/issues/243615
* use a different url
* delete the test until we have a good way to mock
* add `ChatRequest#tools`
* make select tools for all tools, not just MCP tools
* make the select tools work with all tools, group by MCP server, extension, and rest
* fill in the new ChatRequest#selectTools API with selected tools
* have the MCP server command be its own command with its own custom rendering
* remove old comment
This is some basic work to get MCP hooked up. It's enough to discover
and establish connections to MCP servers on the machine with very very
basic commands to manage them:

Refs #242864
The McpRegistry registers both collections of servers (from various
config files) and 'delegates', which is currently _only_ the node
extension host but is pretty generic and so could point at other
processes in the future. SSE could even be served from the renderer when
we aren't on a remote.
It wraps into IMcpServerConnection's, which do some basic connection
management and expose the McpServerRequestHandler which speaks JSON-RPC
to the MCP server. This is wrapped into the IMcpServer which is the
complete, stateful representation of the server. It does stuff like
caching discovered tools such that they can be viewed and controlled
even when the MCP server isn't running.
The IMcpService is the 'public' entry for other VS Code features. Its
API is very simple right now, exposing an observable of the available
servers, which should be easy for chat to consume.
Still need to get some good tests going, add proper and more discovery,
and excercise currently-untested API. SSE is also a stub right now.
chat: allow referencing and dragging in diagnostics
- There is a new proposal which adds `ChatReferenceDiagnostic` as a
prompt reference type
- You can now pick "Problems..." as part of the chat attachment context
- You can drag and drop files and individual diagnostics from the
Problems view into chat. Previously trying to do this would just
attach the file.
* copy everything from #237624
* try to better word notes in proposed.d.ts
* why is test being so flaky
* try sending one more text
* strictEqual only on isInteractedWith always fails
* update the name as recommended
* embed to make sure we are selecting event we are interested in as recommended
* add node as part of TerminalShellType
* getting type ..extHostTypes.TerminalShellType.Bash is not comparable to type ..vscode.TerminalShellType.Bash
* just use one enum?
* figured out how to get from extHostTypes
* clean up
Fixes#30066
This finalizes the documentPaste api. This api allows extensions to attach metadata on text copy and change how content is pasted. Some examples:
- Updating imports for pasted code
- Inserting an image as an attachment in notebooks
- Pasting files converts them to relative text paths
* Add an edit tool (doesn't work)
* More
* Properly wait on text edits to be done applying
* Better editFile tool
* Fixes
* Be more insistent with editFile instructions
* Add "agent mode" UI
* Fix error thrown when calling tools sometimes
* Persist chat agent mode state
* Hide editing tools from other extensions for now
* Fix test build issues
* Allow disabling tools agent mode
* Remove comment
* Fix codeblock index properly
* Cleanup
* Cleanup
* Remove ccreq check
* Rename for clarity
* put copilot fix and explain in status bar
* fix up actions
* watch for execution error within the viewmodel
* make observable publicly readonly
* remove unused service
* fix tests
* remove unused import