Commit Graph

994 Commits

Author SHA1 Message Date
Rob Lourens
6148e1487a lmTools API polish (#230847)
* Simplify lmTools part names

* Remove unneeded isError

* Remove text/plain requirement for tools

* One more

* Bump API version

* Fix build
2024-10-09 13:28:01 +09:00
Joyce Er
3709bf2387 feat: instrument accepting and rejecting chat edits (#230748)
* feat: instrument accepting and rejecting chat edits

* eslint

* Fix compile
2024-10-08 09:29:59 +02:00
Rob Lourens
de557e7b66 lmTools docs, tweaks (#230351)
* Tools API updates

* Add tool tags

* lmtools docs and tweaks

* Update src/vscode-dts/vscode.proposed.lmTools.d.ts

Co-authored-by: Joyce Er <joyce.er@microsoft.com>

* Update src/vscode-dts/vscode.proposed.lmTools.d.ts

Co-authored-by: Joyce Er <joyce.er@microsoft.com>

* Fix build

---------

Co-authored-by: Joyce Er <joyce.er@microsoft.com>
2024-10-02 19:02:38 -07:00
Justin Chen
7bbd14551f properly convert/send image type to extension (#230166)
* properly convert and send type to ext

* switch to new type that includes mimeType

* add new type

* use thenable

* change to proposed

* fix whitespace
2024-10-01 16:02:01 -07:00
Matt Bierner
d3596df9eb More type assertion fixes (#230181)
For #211878

Also adds a few suppressions
2024-09-30 16:21:12 -07:00
Rob Lourens
ef69ffe1cb Correctly pass user selected LM for intent detection (#230014) (#230028)
Fix #229616
2024-09-28 01:18:40 +02:00
Rob Lourens
6aadaf13bd Use a full LanguageModelChat for the user selection (#228905)
* Use a full LanguageModelChat for the user selection

* Move proposal check
2024-09-18 20:27:31 +02:00
Tyler James Leonhardt
7241eea610 Move to new account preference concept (#228897)
* Move to new account preference concept

Previously, session preference was at a per-"set of scopes" bases. This means that an extension could ask for scopes A,B,C and get account 1... but then ask for scopes E,F and get account 2.

Thinking on this more, it really doesn't make sense. An extension should have a preference wholistically since we also don't surface scopes to the user.

This PR:
* changes that model (while keeping the old model for migration purposes for now)
* allows the user to change that value via the gear icon in the Trusted Extensions quick pick
* hooks up the extension event for when the user changes that
* lastly introduces a product.json entry that allows an extension to be a "child" of another extension's preference. This will be useful for GitHub Copilot & GitHub Copilot Chat sharing the same preference.

Out of scope:
* Adding entries to the extension editor to get to this quick pick (it'll come later, but I wanted to get these changes in now)

* placeholder
2024-09-17 18:20:53 -07:00
Alexandru Dima
c4efe1dc9e Merge pull request #228683 from microsoft/aeschli/respectable-sailfish-565
registerMappedEditsProvider2
2024-09-17 00:11:25 +02:00
Joyce Er
6a81a01ead WIP 2024-09-16 18:08:43 +02:00
Benjamin Pasero
e00035b4dc watcher - massage requests in the extension host instead of window (#228712) 2024-09-16 16:22:20 +02:00
Martin Aeschlimann
8732ffbe89 registerMappedEditsProvider2 2024-09-15 22:09:46 +02:00
Joyce Er
e7ca87c15d feat: associate URIs with markdown code blocks for codemapper consumption (#228145) 2024-09-10 23:16:42 +02:00
Andrea Mah
747880f051 add tests for search api from extHost (#227636)
* add tests for search api from extHost

* wait for completion
2024-09-04 15:56:20 -07:00
Benjamin Pasero
6b924c5152 ESM merge to main (#227184)
Co-authored-by: Johannes Rieken <jrieken@microsoft.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
2024-08-30 10:31:46 +02:00
Rob Lourens
ed4db37c58 Tools API updates (#226493)
* Tools API updates
Support toolCallId, tool call parts in content2

* Fix
2024-08-23 15:48:14 -07:00
Connor Peet
aca1518b48 api: some slight lmtools polish (#226371)
- Have `countTokens` only take a string for now, since that's all that
  tool elements in tsx should currently omit (not chat messages with
	roles.) String counting is a much easier interface to satisfy.
- Joyce pointed out that it's "invocation" not "invokation", for reasons
  unfathomable to me. I will open an issue with the English language.
2024-08-23 07:16:02 +02:00
andreamah
afde5137a2 properly connect search providers and handle undefined includes in findtextinfilesnew 2024-08-22 15:41:33 -07:00
Connor Peet
2bf25ee2fd lm: a second rendition of returning data from LM tools (#225634)
* lm: a second rendition of returning data from LM tools

This is an alternative to #225454. It allows the tool caller to pass
through token budget and counting information to the tool, and the
tool can then 'do its thing.'

Most of the actual implementation is in prompt-tsx with a new method to
render elements into a JSON-serializable form, and then splice them back
into the tree by the consumer. The implementation can be found here:

https://github.com/microsoft/vscode-prompt-tsx/tree/connor4312/tools-api-v2

On the tool side, this looks like:

```ts
vscode.lm.registerTool('myTestTool', {
	async invoke(context, token): Promise<vscode.LanguageModelToolResult> {
		return {
			// context includes the token info:
			'mytype': await renderElementJSON(MyCustomPrompt, {}, context, token),
			toString() {
				return 'hello world!'
			}
		};
	},
});
```

I didn't make any nice wrappers yet, but the MVP consumer side looks like:

```
export class TestPrompt extends PromptElement {
    async render(_state: void, sizing: PromptSizing) {
        const result = await vscode.lm.invokeTool('myTestTool', {
			parameters: {},
			tokenBudget: sizing.tokenBudget,
            countTokens: (v, token) => tokenizer.countTokens(v, token),
		}, new vscode.CancellationTokenSource().token);

        return (
            <>
                <elementJSON data={result.mytype} />
            </>
        );
    }
}
```

I like this approach better. It avoids bleeding knowledge of TSX into
the extension host and comparatively simple.

* address comments

* address comments
2024-08-22 09:41:31 -07:00
Andrea Mah
c2aa3c4625 let findfiles2new use an array of includes/excludes (#226103)
* let findfiles2new use an array of includes/excludes
2024-08-21 19:14:01 -07:00
Andrea Mah
c3dca4e740 support multiple findTextInFiles filesToInclude (#225821) 2024-08-19 11:50:53 -07:00
Andrea Mah
c5ef039cd8 Adopt new internal Search query shapes for new API shape (#214041)
Creating `New` versions of all Search APIs (ie: `TextSearchProviderNew`) to support the new API shape.

Since this new shape requires a new internal query shape, this is quite a big change.
2024-08-16 09:26:43 -07:00
Ulugbek Abdullaev
60cfd4ddec WIP: move-able inline chat 2024-08-15 11:00:08 +02:00
Rob Lourens
a9046c89b4 Remove obsolete api _version number (#225541) 2024-08-13 16:19:58 -07:00
Connor Peet
ef72141fd1 testing: finalize test message stack trace API (#225517)
Closes #214488
2024-08-13 13:56:29 -07:00
Daniel Imms
cf347edc08 Merge pull request #224744 from microsoft/tyriar/145234_2
Finalize shellIntegration API
2024-08-07 06:55:30 -07:00
Alex Ross
775e1e9bdf Trace log openTextDocument (#224962)
Part of #6109
2024-08-06 09:58:32 -07:00
Tyler James Leonhardt
02b638ae27 Finalize getAccounts API (#224877)
Fixes https://github.com/microsoft/vscode/issues/152399
2024-08-05 11:59:33 -07:00
Daniel Imms
929eba4808 Finalize shellIntegration API
Fixes #145234
2024-08-04 09:27:32 -07:00
Joyce Er
d4c164e7b8 feat: chat participation detection api (#224651)
* feat: chat participation detection api
2024-08-02 16:35:14 -07:00
Andrea Mah
00374b8a5d feedback from search api finder TPI (#223950)
* add documentation for includes and excludes as arrays.
Fixes https://github.com/microsoft/vscode/issues/223286

* Tweaks to ExcludeSettingOptions
Fixes https://github.com/microsoft/vscode/issues/223384
Fixes https://github.com/microsoft/vscode/issues/223385
Fixes https://github.com/microsoft/vscode/issues/223387

* `UseIgnoreFiles` cleanup and other tweaks
Fixes https://github.com/microsoft/vscode/issues/223396
Fixes https://github.com/microsoft/vscode/issues/223394
Fixes https://github.com/microsoft/vscode/issues/223391

* document default value of maxResults
Fixes https://github.com/microsoft/vscode/issues/223395

* clarify matchLines
Fixes https://github.com/microsoft/vscode/issues/223324
2024-07-26 11:35:47 -07:00
Matt Bierner
d4bb523d43 Fix a few more type assertions (#223138)
For #211878
2024-07-23 12:19:43 -07:00
Andrea Mah
3931440c47 connections for findTextInFilesNew and FindFiles2New to function (#223151)
* connections for findTextInFilesNew and FindFiles2New to function

* remove log and fix typos
2024-07-22 18:03:32 -07:00
Joyce Er
1c7fa5ef1e feat: render warnings for partial or omitted references (#222292)
* feat: render warnings for partial or omitted references

* feat: apply warning foreground color to label for omitted reference

* feat: render omitted warning in request attachment widget

* feat: allow clicking to open chat attachment
2024-07-20 13:39:05 -07:00
Andrea Mah
61b242c67f add new versions of search APIs (#222231)
* add new versions of search APIs in separate proposed files
2024-07-19 14:28:10 -07:00
Rob Lourens
65a6a2f783 Support "code citations" in chat API (#221996)
* Support "code citations" in chat API

* Update tests
2024-07-17 18:24:27 -07:00
Tyler James Leonhardt
b07596a8aa Polish QuickInputButtonLocation (#221403)
* Fix a bug where the buttons would show up when they shouldn't by clearing them on show like the other ActionBars
* Introduce Proposed API (changed the core shape to reflect)
* Adopted in Git extension

ref https://github.com/microsoft/vscode/issues/221397
2024-07-10 11:39:24 -07:00
Alex Ross
065459e6e6 API feedback for comment thread reveal/hide (#221338)
Part of #167253
2024-07-10 12:15:20 +02:00
Connor Peet
b2af4e7d34 testing: add stack trace proposal and split out test results view
The test results view was 2k+ lines, time to split it up a bit.
2024-07-08 15:27:24 -07:00
Johannes Rieken
ea03089bee fixup ChatRequestNotebookData (#219331)
re https://github.com/microsoft/vscode/issues/218363
2024-07-01 10:29:54 +02:00
Johannes Rieken
dd7d9376fb remove dead types from old proposal versions (#219120) 2024-06-28 17:03:26 +02:00
Johannes Rieken
ecf818849d add location specific data along when making chat request (#219114)
with this PR the implicit variables tricks aren't needed anymore
2024-06-28 16:27:08 +02:00
Tyler James Leonhardt
6e345d4606 Remove getSessions API in favor of getAccounts (#218238)
Azure folks (the only ones using this proposed API) have not depended on getSessions yet so it's safe to delete.
2024-06-26 07:34:31 +02:00
Rob Lourens
125f3581c3 Unleash the chat API (#216850)
* Unleash the chat API

* Fix

* Fix
2024-06-21 16:16:04 -07:00
Rob Lourens
ee173b0e65 Tools API tweaks, merge into lmTools (#216750)
* Tools API tweaks, merge into lmTools

* Rename more id -> name

* Fix

* Add lmTools API version
2024-06-20 18:54:00 -07:00
Rob Lourens
88b4dc75bd Chat Tools API (#213273)
* Implement a chat skills API

* Move around

* Rename to 'tools' and make variables part of it

* Updates

* value

* Differentiate 'tool invocation' and 'reference'

* Just one interface, ChatReference

* dts updates

* Rename "skills" to "tools"

* Fix up

* Add static registration of tools

* string

* Updates

* Fix

* Rename 'chat' in API

* Rename "chatTool"
2024-06-18 16:38:20 -07:00
Tyler James Leonhardt
5d7157cb03 Implement getAccounts API over getSessions (#215874)
And plumb that through to the Microsoft auth provider
2024-06-16 18:12:37 -07:00
Connor Peet
e2bf3453f5 debug: correlate debug sessions to testing, delegate restarts (#214537)
Implements #214486
2024-06-07 06:15:59 +02:00
Johannes Rieken
ab9a1286f2 sketch up lm-extention that allows for function calling (#214334) 2024-06-05 16:32:08 +02:00
Joyce Er
438ea79aa1 refactor: move Add Context... actions to core (#214167) 2024-06-03 20:36:49 +02:00