Skip to content

Commit cc2d539

Browse files
authored
Merge pull request #783 from CodinGame/lmn/fix-ai-chat-demo
Fix ai chat demo
2 parents 7f3bf1b + eb9619c commit cc2d539

5 files changed

Lines changed: 48 additions & 35 deletions

File tree

.github/workflows/check_build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: Lint commits
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v6
1313
with:
1414
# we actually need "github.event.pull_request.commits + 1" commit
1515
fetch-depth: 0
@@ -23,13 +23,13 @@ jobs:
2323

2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v6
2727
- name: Install build dependencies
2828
run: |
2929
sudo apt-get update
3030
sudo apt-get install libkrb5-dev libxkbfile-dev libx11-6
3131
- name: mise-en-place
32-
uses: jdx/mise-action@v2
32+
uses: jdx/mise-action@v3
3333
- name: Install dependencies
3434
run: npm ci
3535
- name: Build

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121
with:
2222
# get all tags for semantic release
2323
fetch-depth: 0
@@ -26,7 +26,7 @@ jobs:
2626
sudo apt-get update
2727
sudo apt-get install libkrb5-dev libxkbfile-dev libx11-6 pkg-config
2828
- name: mise-en-place
29-
uses: jdx/mise-action@v2
29+
uses: jdx/mise-action@v3
3030
- name: Install dependencies
3131
run: npm ci
3232
- name: Build

demo/src/features/ai.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ const { getApi } = registerExtension(
4848
fullName: 'Codingame AI',
4949
name: 'codingame-ai',
5050
isDefault: true,
51-
modes: ['agent']
51+
modes: ['agent'],
52+
locations: ['panel', 'terminal', 'editor']
5253
}
5354
],
5455
languageModelChatProviders: [
5556
{
56-
vendor: 'coddingame.aiDemo.modelProvider',
57+
vendor: 'copilot',
5758
displayName: 'Codingame provider'
5859
}
5960
],
@@ -85,7 +86,8 @@ const { getApi } = registerExtension(
8586
'defaultChatParticipant',
8687
'chatParticipantAdditions',
8788
'chatParticipantPrivate',
88-
'languageModelThinkingPart'
89+
'languageModelThinkingPart',
90+
'chatProvider'
8991
]
9092
},
9193
ExtensionHostKind.LocalProcess,
@@ -152,11 +154,11 @@ void getApi().then(async (vscodeApi) => {
152154

153155
const _onDidChangeLanguageModelChatInformation = new vscodeApi.EventEmitter<void>()
154156

155-
vscodeApi.lm.registerLanguageModelChatProvider('coddingame.aiDemo.modelProvider', {
157+
vscodeApi.lm.registerLanguageModelChatProvider('copilot', {
156158
provideLanguageModelChatInformation() {
157159
return [
158160
{
159-
id: 'codingame',
161+
id: 'auto',
160162
capabilities: {
161163
toolCalling: true
162164
},

src/service-override/policy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/stand
33
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'
44
import { AbstractPolicyService, type PolicyValue } from 'vs/platform/policy/common/policy'
55
import { IPolicyService } from 'vs/platform/policy/common/policy.service'
6-
6+
import { PolicyCategory } from 'vs/base/common/policy'
77
class PolicyService extends AbstractPolicyService {
88
constructor(defaultPolicies: Map<PolicyName, PolicyValue>) {
99
super()
@@ -33,4 +33,4 @@ export default function getServiceOverride(
3333
}
3434
}
3535

36-
export type { PolicyName, PolicyValue, PolicyService }
36+
export type { PolicyName, PolicyValue, PolicyService, PolicyCategory }

vscode-patches/0012-fix-improve-extension-contribution-types.patch

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Date: Mon, 11 Mar 2024 17:38:30 +0100
44
Subject: [PATCH] fix: improve extension contribution types
55

66
---
7-
.../platform/extensions/common/extensions.ts | 1448 ++++++++++++++++-
7+
.../platform/extensions/common/extensions.ts | 1457 ++++++++++++++++-
88
.../services/search/common/queryBuilder.ts | 8 +-
99
.../themes/common/colorExtensionPoint.ts | 2 +-
1010
.../tokenClassificationExtensionPoint.ts | 1 +
11-
4 files changed, 1389 insertions(+), 70 deletions(-)
11+
4 files changed, 1398 insertions(+), 70 deletions(-)
1212

1313
diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts
14-
index 3e5b309b826..6e099d27098 100644
14+
index 3e5b309b826..22328736cac 100644
1515
--- a/src/vs/platform/extensions/common/extensions.ts
1616
+++ b/src/vs/platform/extensions/common/extensions.ts
1717
@@ -3,6 +3,7 @@
@@ -369,10 +369,8 @@ index 3e5b309b826..6e099d27098 100644
369369
+ * Path of the tmTheme file. The path is relative to the extension folder and is typically './colorthemes/awesome-color-theme.json'.
370370
+ */
371371
+ readonly path: string;
372-
}
373-
374-
-export interface ITheme {
375-
- label: string;
372+
+}
373+
+
376374
+export interface IIconTheme {
377375
+ /**
378376
+ * Id of the file icon theme as used in the user settings.
@@ -386,8 +384,10 @@ index 3e5b309b826..6e099d27098 100644
386384
+ * Path of the file icon theme definition file. The path is relative to the extension folder and is typically './fileicons/awesome-icon-theme.json'.
387385
+ */
388386
+ readonly path: string;
389-
+}
390-
+
387+
}
388+
389+
-export interface ITheme {
390+
- label: string;
391391
+export interface IProductTheme {
392392
+ /**
393393
+ * Id of the product icon theme as used in the user settings.
@@ -642,11 +642,11 @@ index 3e5b309b826..6e099d27098 100644
642642
+ * Unique identifier of the notebook output renderer.
643643
+ */
644644
readonly id: string;
645+
- readonly displayName: string;
645646
+ /**
646647
+ * Human readable name of the notebook output renderer.
647648
+ */
648-
readonly displayName: string;
649-
- readonly mimeTypes: string[];
649+
+ readonly displayName: string;
650650
+ readonly dependencies?: string[];
651651
+ readonly optionalDependencies?: string[];
652652
+ /**
@@ -656,15 +656,15 @@ index 3e5b309b826..6e099d27098 100644
656656
+ /**
657657
+ * Set of globs that the notebook is for.
658658
+ */
659-
+ readonly mimeTypes: string[];
659+
readonly mimeTypes: string[];
660660
+ readonly entrypoint: string | {
661661
+ readonly extends: string;
662662
+ readonly path: string;
663663
+ };
664664
}
665665

666666
export interface IDebugVisualizationContribution {
667-
@@ -157,16 +625,706 @@ export interface IDebugVisualizationContribution {
667+
@@ -157,32 +625,735 @@ export interface IDebugVisualizationContribution {
668668
}
669669

670670
export interface ITranslation {
@@ -1377,31 +1377,42 @@ index 3e5b309b826..6e099d27098 100644
13771377
}
13781378

13791379
export interface IChatParticipantContribution {
1380-
@@ -176,6 +1334,7 @@ export interface IChatParticipantContribution {
1380+
id: string;
1381+
name: string;
1382+
fullName: string;
1383+
+ when?: string;
13811384
description?: string;
13821385
isDefault?: boolean;
1386+
+ isSticky?: boolean;
1387+
+ sampleRequest?: string;
13831388
commands?: { name: string }[];
1384-
+ modes: string[]
1389+
+ locations?: string[];
1390+
+ modes: string[];
1391+
+ disambiguation?: { category: string; categoryName?: string /** Deprecated */; description: string; examples: string[] }[];
13851392
}
13861393

13871394
export interface IToolContribution {
1388-
@@ -183,6 +1342,9 @@ export interface IToolContribution {
1395+
name: string;
13891396
displayName: string;
13901397
modelDescription: string;
1391-
userDescription?: string;
13921398
+ toolReferenceName?: string;
1393-
+ canBeReferencedInPrompt?: boolean
1394-
+ inputSchema?: object
1399+
+ legacyToolReferenceFullNames?: string[];
1400+
+ icon?: string | { light: string; dark: string };
1401+
+ when?: string;
1402+
+ tags?: string[];
1403+
userDescription?: string;
1404+
+ inputSchema?: IJSONSchema;
1405+
+ canBeReferencedInPrompt?: boolean;
13951406
}
13961407

13971408
export interface IToolSetContribution {
1398-
@@ -206,32 +1368,112 @@ export interface IChatFileContribution {
1409+
@@ -206,32 +1377,112 @@ export interface IChatFileContribution {
13991410
readonly when?: string;
14001411
}
14011412

14021413
+export interface ILanguageModelChatProvider {
1403-
+ vendor: string
1404-
+ displayName?: string
1414+
+ vendor: string;
1415+
+ displayName?: string;
14051416
+}
14061417
+
14071418
export interface IExtensionContributions {
@@ -1528,7 +1539,7 @@ index 3e5b309b826..6e099d27098 100644
15281539
readonly chatParticipants?: ReadonlyArray<IChatParticipantContribution>;
15291540
readonly chatPromptFiles?: ReadonlyArray<IChatFileContribution>;
15301541
readonly chatInstructions?: ReadonlyArray<IChatFileContribution>;
1531-
@@ -240,6 +1482,82 @@ export interface IExtensionContributions {
1542+
@@ -240,6 +1491,82 @@ export interface IExtensionContributions {
15321543
readonly languageModelTools?: ReadonlyArray<IToolContribution>;
15331544
readonly languageModelToolSets?: ReadonlyArray<IToolSetContribution>;
15341545
readonly mcpServerDefinitionProviders?: ReadonlyArray<IMcpCollectionContribution>;

0 commit comments

Comments
 (0)