Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreadman committed Oct 13, 2023
2 parents 71d47af + 648dbbe commit a948c5c
Show file tree
Hide file tree
Showing 100 changed files with 1,464 additions and 795 deletions.
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@types/byline": "^4.2.32",
"@types/cssnano": "^4.0.0",
"@types/debounce": "^1.0.0",
"@types/debug": "4.1.5",
"@types/debug": "^4.1.5",
"@types/fancy-log": "^1.3.0",
"@types/fs-extra": "^9.0.12",
"@types/glob": "^7.1.1",
Expand Down
36 changes: 18 additions & 18 deletions build/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,12 @@
resolved "https://registry.yarnpkg.com/@types/debounce/-/debounce-1.0.0.tgz#417560200331e1bb84d72da85391102c2fcd61b7"
integrity sha1-QXVgIAMx4buE1y2oU5EQLC/NYbc=

"@types/[email protected]":
version "4.1.5"
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd"
integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==
"@types/debug@^4.1.5":
version "4.1.9"
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.9.tgz#906996938bc672aaf2fb8c0d3733ae1dda05b005"
integrity sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==
dependencies:
"@types/ms" "*"

"@types/events@*":
version "1.2.0"
Expand Down Expand Up @@ -533,6 +535,11 @@
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4"
integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==

"@types/ms@*":
version "0.7.32"
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.32.tgz#f6cd08939ae3ad886fcc92ef7f0109dacddf61ab"
integrity sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==

"@types/node-fetch@^2.5.0":
version "2.5.8"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb"
Expand Down Expand Up @@ -1116,10 +1123,10 @@ css-what@^6.1.0:
resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4"
integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==

debug@4, debug@^4.1.0, debug@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"

Expand All @@ -1130,13 +1137,6 @@ debug@^2.6.8:
dependencies:
ms "2.0.0"

debug@^4.1.1, debug@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
dependencies:
ms "2.1.2"

decompress-response@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
Expand Down Expand Up @@ -1657,9 +1657,9 @@ http-proxy-agent@^4.0.1:
debug "4"

https-proxy-agent@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2"
integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==
version "5.0.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6"
integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==
dependencies:
agent-base "6"
debug "4"
Expand Down
9 changes: 9 additions & 0 deletions extensions/vscode-api-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"license": "MIT",
"enabledApiProposals": [
"authSession",
"chatAgents2",
"chatVariables",
"contribViewsRemote",
"contribStatusBarItems",
"createFileSystemWatcher",
Expand All @@ -20,6 +22,7 @@
"fileSearchProvider",
"findTextInFiles",
"fsChunks",
"interactive",
"mappedEditsProvider",
"notebookCellExecutionState",
"notebookDeprecated",
Expand Down Expand Up @@ -165,6 +168,12 @@
]
}
],
"interactiveSession": [
{
"id": "provider",
"label": "Provider"
}
],
"notebooks": [
{
"type": "notebookCoreTest",
Expand Down
80 changes: 80 additions & 0 deletions extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as assert from 'assert';
import 'mocha';
import { CancellationToken, chat, ChatAgentRequest, ChatVariableLevel, CompletionItemKind, Disposable, interactive, InteractiveProgress, InteractiveRequest, InteractiveResponseForProgress, InteractiveSession, InteractiveSessionState, Progress, ProviderResult } from 'vscode';
import { assertNoRpc, closeAllEditors, DeferredPromise, disposeAll } from '../utils';

suite('chat', () => {
let disposables: Disposable[] = [];
setup(() => {
disposables = [];
});

teardown(async function () {
assertNoRpc();
await closeAllEditors();
disposeAll(disposables);
});

function getDeferredForRequest(): DeferredPromise<ChatAgentRequest> {
disposables.push(interactive.registerInteractiveSessionProvider('provider', {
prepareSession: (_initialState: InteractiveSessionState | undefined, _token: CancellationToken): ProviderResult<InteractiveSession> => {
return {
requester: { name: 'test' },
responder: { name: 'test' },
};
},

provideResponseWithProgress: (_request: InteractiveRequest, _progress: Progress<InteractiveProgress>, _token: CancellationToken): ProviderResult<InteractiveResponseForProgress> => {
return null;
},

provideSlashCommands: (_session, _token) => {
return [{ command: 'hello', title: 'Hello', kind: CompletionItemKind.Text }];
},

removeRequest: (_session: InteractiveSession, _requestId: string): void => {
throw new Error('Function not implemented.');
}
}));

const deferred = new DeferredPromise<ChatAgentRequest>();
const agent = chat.createChatAgent('agent', (request, _context, _progress, _token) => {
deferred.complete(request);
return null;
});
agent.slashCommandProvider = {
provideSlashCommands: (_token) => {
return [{ name: 'hello', description: 'Hello' }];
}
};
disposables.push(agent);
return deferred;
}

test('agent and slash command', async () => {
const deferred = getDeferredForRequest();
interactive.sendInteractiveRequestToProvider('provider', { message: '@agent /hello friend' });
const lastResult = await deferred.p;
assert.deepStrictEqual(lastResult.slashCommand, { name: 'hello', description: 'Hello' });
assert.strictEqual(lastResult.prompt, 'friend');
});

test('agent and variable', async () => {
disposables.push(chat.registerVariable('myVar', 'My variable', {
resolve(_name, _context, _token) {
return [{ level: ChatVariableLevel.Full, value: 'myValue' }];
}
}));

const deferred = getDeferredForRequest();
interactive.sendInteractiveRequestToProvider('provider', { message: '@agent hi #myVar' });
const lastResult = await deferred.p;
assert.strictEqual(lastResult.prompt, 'hi [#myVar](values:myVar)');
assert.strictEqual(lastResult.variables['myVar'][0].value, 'myValue');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as assert from 'assert';
import 'mocha';
import { CancellationToken, CompletionItemKind, Disposable, interactive, InteractiveProgress, InteractiveRequest, InteractiveResponseForProgress, InteractiveSession, InteractiveSessionState, Progress, ProviderResult } from 'vscode';
import { assertNoRpc, closeAllEditors, DeferredPromise, disposeAll } from '../utils';

suite('InteractiveSessionProvider', () => {
let disposables: Disposable[] = [];
setup(async () => {
disposables = [];
});

teardown(async function () {
assertNoRpc();
await closeAllEditors();
disposeAll(disposables);
});

function getDeferredForRequest(): DeferredPromise<InteractiveRequest> {
const deferred = new DeferredPromise<InteractiveRequest>();
disposables.push(interactive.registerInteractiveSessionProvider('provider', {
prepareSession: (_initialState: InteractiveSessionState | undefined, _token: CancellationToken): ProviderResult<InteractiveSession> => {
return {
requester: { name: 'test' },
responder: { name: 'test' },
};
},

provideResponseWithProgress: (request: InteractiveRequest, _progress: Progress<InteractiveProgress>, _token: CancellationToken): ProviderResult<InteractiveResponseForProgress> => {
deferred.complete(request);
return null;
},

provideSlashCommands: (_session, _token) => {
return [{ command: 'hello', title: 'Hello', kind: CompletionItemKind.Text }];
},

removeRequest: (_session: InteractiveSession, _requestId: string): void => {
throw new Error('Function not implemented.');
}
}));
return deferred;
}

test('plain text query', async () => {
const deferred = getDeferredForRequest();
interactive.sendInteractiveRequestToProvider('provider', { message: 'hello' });
const lastResult = await deferred.p;
assert.strictEqual(lastResult.message, 'hello');
});

test('slash command', async () => {
const deferred = getDeferredForRequest();
interactive.sendInteractiveRequestToProvider('provider', { message: '/hello' });
const lastResult = await deferred.p;
assert.strictEqual(lastResult.message, '/hello');
});
});
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.84.0",
"distro": "23fd0c979db23b5d166dea2195bfb3aa5fe1f390",
"distro": "ca54f82b1adb64bbf5601501cc4edef8043f045c",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -70,8 +70,8 @@
"@parcel/watcher": "2.1.0",
"@vscode/iconv-lite-umd": "0.7.0",
"@vscode/policy-watcher": "^1.1.4",
"@vscode/proxy-agent": "^0.17.4",
"@vscode/ripgrep": "^1.15.5",
"@vscode/proxy-agent": "^0.17.5",
"@vscode/ripgrep": "^1.15.6",
"@vscode/spdlog": "^0.13.11",
"@vscode/sqlite3": "5.1.6-vscode",
"@vscode/sudo-prompt": "9.3.1",
Expand All @@ -80,8 +80,8 @@
"@vscode/windows-process-tree": "^0.5.0",
"@vscode/windows-registry": "^1.1.0",
"graceful-fs": "4.2.11",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^2.2.3",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"jschardet": "3.0.0",
"kerberos": "^2.0.1",
"minimist": "^1.2.6",
Expand Down Expand Up @@ -111,7 +111,7 @@
"@swc/core": "1.3.62",
"@types/cookie": "^0.3.3",
"@types/cssnano": "^4.0.0",
"@types/debug": "4.1.5",
"@types/debug": "^4.1.5",
"@types/graceful-fs": "4.1.2",
"@types/gulp-postcss": "^8.0.0",
"@types/gulp-svgmin": "^1.2.1",
Expand All @@ -135,8 +135,8 @@
"@typescript-eslint/parser": "^5.57.0",
"@vscode/gulp-electron": "^1.36.0",
"@vscode/l10n-dev": "0.0.21",
"@vscode/telemetry-extractor": "^1.9.9",
"@vscode/test-web": "^0.0.41",
"@vscode/telemetry-extractor": "^1.9.10",
"@vscode/test-web": "^0.0.42",
"@vscode/vscode-perf": "^0.0.14",
"ansi-colors": "^3.2.3",
"asar": "^3.0.3",
Expand Down Expand Up @@ -187,8 +187,8 @@
"minimatch": "^3.0.4",
"minimist": "^1.2.6",
"mkdirp": "^1.0.4",
"mocha": "^9.2.2",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.2.0",
"mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1",
"npm-run-all": "^4.1.5",
"opn": "^6.0.0",
Expand Down
8 changes: 4 additions & 4 deletions remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"@microsoft/1ds-post-js": "^3.2.13",
"@parcel/watcher": "2.1.0",
"@vscode/iconv-lite-umd": "0.7.0",
"@vscode/proxy-agent": "^0.17.4",
"@vscode/ripgrep": "^1.15.5",
"@vscode/proxy-agent": "^0.17.5",
"@vscode/ripgrep": "^1.15.6",
"@vscode/spdlog": "^0.13.11",
"@vscode/vscode-languagedetection": "1.0.21",
"@vscode/windows-process-tree": "^0.5.0",
"@vscode/windows-registry": "^1.1.0",
"cookie": "^0.4.0",
"graceful-fs": "4.2.11",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^2.2.3",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"jschardet": "3.0.0",
"kerberos": "^2.0.1",
"minimist": "^1.2.6",
Expand Down
Loading

0 comments on commit a948c5c

Please sign in to comment.