@theia/ai-code-completion 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +30 -0
  2. package/lib/browser/ai-code-completion-frontend-module.d.ts +4 -0
  3. package/lib/browser/ai-code-completion-frontend-module.d.ts.map +1 -0
  4. package/lib/browser/ai-code-completion-frontend-module.js +38 -0
  5. package/lib/browser/ai-code-completion-frontend-module.js.map +1 -0
  6. package/lib/browser/ai-code-completion-preference.d.ts +4 -0
  7. package/lib/browser/ai-code-completion-preference.d.ts.map +1 -0
  8. package/lib/browser/ai-code-completion-preference.js +32 -0
  9. package/lib/browser/ai-code-completion-preference.js.map +1 -0
  10. package/lib/browser/ai-code-frontend-application-contribution.d.ts +13 -0
  11. package/lib/browser/ai-code-frontend-application-contribution.d.ts.map +1 -0
  12. package/lib/browser/ai-code-frontend-application-contribution.js +72 -0
  13. package/lib/browser/ai-code-frontend-application-contribution.js.map +1 -0
  14. package/lib/browser/ai-code-inline-completion-provider.d.ts +9 -0
  15. package/lib/browser/ai-code-inline-completion-provider.d.ts.map +1 -0
  16. package/lib/browser/ai-code-inline-completion-provider.js +46 -0
  17. package/lib/browser/ai-code-inline-completion-provider.js.map +1 -0
  18. package/lib/common/code-completion-agent.d.ts +24 -0
  19. package/lib/common/code-completion-agent.d.ts.map +1 -0
  20. package/lib/common/code-completion-agent.js +150 -0
  21. package/lib/common/code-completion-agent.js.map +1 -0
  22. package/lib/package.spec.d.ts +1 -0
  23. package/lib/package.spec.d.ts.map +1 -0
  24. package/lib/package.spec.js +26 -0
  25. package/lib/package.spec.js.map +1 -0
  26. package/package.json +55 -0
  27. package/src/browser/ai-code-completion-frontend-module.ts +37 -0
  28. package/src/browser/ai-code-completion-preference.ts +32 -0
  29. package/src/browser/ai-code-frontend-application-contribution.ts +64 -0
  30. package/src/browser/ai-code-inline-completion-provider.ts +53 -0
  31. package/src/common/code-completion-agent.ts +164 -0
  32. package/src/package.spec.ts +28 -0
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - AI Code Completion</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/ai-code-completion` extension contributes Ai based code completion.
16
+ The user can separately enable code completion items as well as inline code completion.
17
+
18
+ ## Additional Information
19
+
20
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
+ - [Theia - Website](https://theia-ide.org/)
22
+
23
+ ## License
24
+
25
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
+
28
+ ## Trademark
29
+ "Theia" is a trademark of the Eclipse Foundation
30
+ https://www.eclipse.org/theia
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=ai-code-completion-frontend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/ai-code-completion-frontend-module.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAQ/D,wBAWG"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const core_1 = require("@theia/core");
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const code_completion_agent_1 = require("../common/code-completion-agent");
21
+ const ai_code_frontend_application_contribution_1 = require("./ai-code-frontend-application-contribution");
22
+ const browser_1 = require("@theia/core/lib/browser");
23
+ const ai_core_1 = require("@theia/ai-core");
24
+ const ai_code_completion_preference_1 = require("./ai-code-completion-preference");
25
+ const ai_code_inline_completion_provider_1 = require("./ai-code-inline-completion-provider");
26
+ exports.default = new inversify_1.ContainerModule(bind => {
27
+ bind(core_1.ILogger).toDynamicValue(ctx => {
28
+ const parentLogger = ctx.container.get(core_1.ILogger);
29
+ return parentLogger.child('code-completion-agent');
30
+ }).inSingletonScope().whenTargetNamed('code-completion-agent');
31
+ bind(code_completion_agent_1.CodeCompletionAgentImpl).toSelf().inSingletonScope();
32
+ bind(code_completion_agent_1.CodeCompletionAgent).toService(code_completion_agent_1.CodeCompletionAgentImpl);
33
+ bind(ai_core_1.Agent).toService(code_completion_agent_1.CodeCompletionAgentImpl);
34
+ bind(ai_code_inline_completion_provider_1.AICodeInlineCompletionsProvider).toSelf().inSingletonScope();
35
+ bind(browser_1.FrontendApplicationContribution).to(ai_code_frontend_application_contribution_1.AIFrontendApplicationContribution).inSingletonScope();
36
+ bind(browser_1.PreferenceContribution).toConstantValue({ schema: ai_code_completion_preference_1.AICodeCompletionPreferencesSchema });
37
+ });
38
+ //# sourceMappingURL=ai-code-completion-frontend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-frontend-module.js","sourceRoot":"","sources":["../../src/browser/ai-code-completion-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAA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2
+ export declare const PREF_AI_INLINE_COMPLETION_ENABLE = "ai-features.codeCompletion.enableCodeCompletion";
3
+ export declare const AICodeCompletionPreferencesSchema: PreferenceSchema;
4
+ //# sourceMappingURL=ai-code-completion-preference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-preference.d.ts","sourceRoot":"","sources":["../../src/browser/ai-code-completion-preference.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAG/F,eAAO,MAAM,gCAAgC,oDAAoD,CAAC;AAElG,eAAO,MAAM,iCAAiC,EAAE,gBAU/C,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AICodeCompletionPreferencesSchema = exports.PREF_AI_INLINE_COMPLETION_ENABLE = void 0;
19
+ const ai_core_preferences_1 = require("@theia/ai-core/lib/browser/ai-core-preferences");
20
+ exports.PREF_AI_INLINE_COMPLETION_ENABLE = 'ai-features.codeCompletion.enableCodeCompletion';
21
+ exports.AICodeCompletionPreferencesSchema = {
22
+ type: 'object',
23
+ properties: {
24
+ [exports.PREF_AI_INLINE_COMPLETION_ENABLE]: {
25
+ title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
26
+ type: 'boolean',
27
+ description: 'Enable AI completions inline within any (Monaco) editor.',
28
+ default: false
29
+ }
30
+ }
31
+ };
32
+ //# sourceMappingURL=ai-code-completion-preference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-preference.js","sourceRoot":"","sources":["../../src/browser/ai-code-completion-preference.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAGhF,wFAA2F;AAE9E,QAAA,gCAAgC,GAAG,iDAAiD,CAAC;AAErF,QAAA,iCAAiC,GAAqB;IAC/D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,CAAC,wCAAgC,CAAC,EAAE;YAChC,KAAK,EAAE,+CAAyB;YAChC,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,0DAA0D;YACvE,OAAO,EAAE,KAAK;SACjB;KACJ;CACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { FrontendApplicationContribution, PreferenceService } from '@theia/core/lib/browser';
2
+ import { AIActivationService } from '@theia/ai-core/lib/browser';
3
+ import { Disposable } from '@theia/core';
4
+ export declare class AIFrontendApplicationContribution implements FrontendApplicationContribution {
5
+ private inlineCodeCompletionProvider;
6
+ protected readonly preferenceService: PreferenceService;
7
+ protected readonly activationService: AIActivationService;
8
+ private toDispose;
9
+ onDidInitializeLayout(): void;
10
+ protected handlePreference(name: string, handler: (enable: boolean) => Disposable): void;
11
+ protected handleInlineCompletions(enable: boolean): Disposable;
12
+ }
13
+ //# sourceMappingURL=ai-code-frontend-application-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/ai-code-frontend-application-contribution.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,qBACa,iCAAkC,YAAW,+BAA+B;IAErF,OAAO,CAAC,4BAA4B,CAAkC;IAGtE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;IAE1D,OAAO,CAAC,SAAS,CAAiC;IAElD,qBAAqB,IAAI,IAAI;IAM7B,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,UAAU,GAAG,IAAI;IAgBxF,SAAS,CAAC,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU;CAGjE"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AIFrontendApplicationContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const monaco = require("@theia/monaco-editor-core");
21
+ const browser_1 = require("@theia/core/lib/browser");
22
+ const inversify_1 = require("@theia/core/shared/inversify");
23
+ const browser_2 = require("@theia/ai-core/lib/browser");
24
+ const core_1 = require("@theia/core");
25
+ const ai_code_inline_completion_provider_1 = require("./ai-code-inline-completion-provider");
26
+ const ai_code_completion_preference_1 = require("./ai-code-completion-preference");
27
+ let AIFrontendApplicationContribution = class AIFrontendApplicationContribution {
28
+ constructor() {
29
+ this.toDispose = new Map();
30
+ }
31
+ onDidInitializeLayout() {
32
+ this.preferenceService.ready.then(() => {
33
+ this.handlePreference(ai_code_completion_preference_1.PREF_AI_INLINE_COMPLETION_ENABLE, enable => this.handleInlineCompletions(enable));
34
+ });
35
+ }
36
+ handlePreference(name, handler) {
37
+ const enable = this.preferenceService.get(name, false) && this.activationService.isActive;
38
+ this.toDispose.set(name, handler(enable));
39
+ this.preferenceService.onPreferenceChanged(event => {
40
+ var _a;
41
+ if (event.preferenceName === name) {
42
+ (_a = this.toDispose.get(name)) === null || _a === void 0 ? void 0 : _a.dispose();
43
+ this.toDispose.set(name, handler(event.newValue && this.activationService.isActive));
44
+ }
45
+ });
46
+ this.activationService.onDidChangeActiveStatus(change => {
47
+ var _a;
48
+ (_a = this.toDispose.get(name)) === null || _a === void 0 ? void 0 : _a.dispose();
49
+ this.toDispose.set(name, handler(this.preferenceService.get(name, false) && change));
50
+ });
51
+ }
52
+ handleInlineCompletions(enable) {
53
+ return enable ? monaco.languages.registerInlineCompletionsProvider({ scheme: 'file' }, this.inlineCodeCompletionProvider) : core_1.Disposable.NULL;
54
+ }
55
+ };
56
+ exports.AIFrontendApplicationContribution = AIFrontendApplicationContribution;
57
+ tslib_1.__decorate([
58
+ (0, inversify_1.inject)(ai_code_inline_completion_provider_1.AICodeInlineCompletionsProvider),
59
+ tslib_1.__metadata("design:type", ai_code_inline_completion_provider_1.AICodeInlineCompletionsProvider)
60
+ ], AIFrontendApplicationContribution.prototype, "inlineCodeCompletionProvider", void 0);
61
+ tslib_1.__decorate([
62
+ (0, inversify_1.inject)(browser_1.PreferenceService),
63
+ tslib_1.__metadata("design:type", Object)
64
+ ], AIFrontendApplicationContribution.prototype, "preferenceService", void 0);
65
+ tslib_1.__decorate([
66
+ (0, inversify_1.inject)(browser_2.AIActivationService),
67
+ tslib_1.__metadata("design:type", browser_2.AIActivationService)
68
+ ], AIFrontendApplicationContribution.prototype, "activationService", void 0);
69
+ exports.AIFrontendApplicationContribution = AIFrontendApplicationContribution = tslib_1.__decorate([
70
+ (0, inversify_1.injectable)()
71
+ ], AIFrontendApplicationContribution);
72
+ //# sourceMappingURL=ai-code-frontend-application-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/ai-code-frontend-application-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,oDAAoD;AAEpD,qDAA6F;AAC7F,4DAAkE;AAClE,wDAAiE;AACjE,sCAAyC;AACzC,6FAAuF;AACvF,mFAAmF;AAG5E,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAAvC;QAUK,cAAS,GAAG,IAAI,GAAG,EAAsB,CAAC;IA2BtD,CAAC;IAzBG,qBAAqB;QACjB,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACnC,IAAI,CAAC,gBAAgB,CAAC,gEAAgC,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5G,CAAC,CAAC,CAAC;IACP,CAAC;IAES,gBAAgB,CAAC,IAAY,EAAE,OAAwC;QAC7E,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAU,IAAI,EAAE,KAAK,CAAC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EAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,6BAAmB,CAAC;sCACU,6BAAmB;4EAAC;4CARjD,iCAAiC;IAD7C,IAAA,sBAAU,GAAE;GACA,iCAAiC,CAqC7C"}
@@ -0,0 +1,9 @@
1
+ import * as monaco from '@theia/monaco-editor-core';
2
+ import { CodeCompletionAgent } from '../common/code-completion-agent';
3
+ export declare class AICodeInlineCompletionsProvider implements monaco.languages.InlineCompletionsProvider {
4
+ protected readonly agent: CodeCompletionAgent;
5
+ private readonly agentService;
6
+ provideInlineCompletions(model: monaco.editor.ITextModel, position: monaco.Position, context: monaco.languages.InlineCompletionContext, token: monaco.CancellationToken): Promise<monaco.languages.InlineCompletions | undefined>;
7
+ freeInlineCompletions(completions: monaco.languages.InlineCompletions<monaco.languages.InlineCompletion>): void;
8
+ }
9
+ //# sourceMappingURL=ai-code-inline-completion-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-inline-completion-provider.d.ts","sourceRoot":"","sources":["../../src/browser/ai-code-inline-completion-provider.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGtE,qBACa,+BACT,YAAW,MAAM,CAAC,SAAS,CAAC,yBAAyB;IAErD,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IAE9C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAEtC,wBAAwB,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,EAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,uBAAuB,EACjD,KAAK,EAAE,MAAM,CAAC,iBAAiB,GAChC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAY1D,qBAAqB,CACjB,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,GACnF,IAAI;CAGV"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AICodeInlineCompletionsProvider = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const code_completion_agent_1 = require("../common/code-completion-agent");
22
+ const ai_core_1 = require("@theia/ai-core");
23
+ let AICodeInlineCompletionsProvider = class AICodeInlineCompletionsProvider {
24
+ async provideInlineCompletions(model, position, context, token) {
25
+ if (!this.agentService.isEnabled(this.agent.id)) {
26
+ return undefined;
27
+ }
28
+ return this.agent.provideInlineCompletions(model, position, context, token);
29
+ }
30
+ freeInlineCompletions(completions) {
31
+ // nothing to do
32
+ }
33
+ };
34
+ exports.AICodeInlineCompletionsProvider = AICodeInlineCompletionsProvider;
35
+ tslib_1.__decorate([
36
+ (0, inversify_1.inject)(code_completion_agent_1.CodeCompletionAgent),
37
+ tslib_1.__metadata("design:type", Object)
38
+ ], AICodeInlineCompletionsProvider.prototype, "agent", void 0);
39
+ tslib_1.__decorate([
40
+ (0, inversify_1.inject)(ai_core_1.AgentService),
41
+ tslib_1.__metadata("design:type", Object)
42
+ ], AICodeInlineCompletionsProvider.prototype, "agentService", void 0);
43
+ exports.AICodeInlineCompletionsProvider = AICodeInlineCompletionsProvider = tslib_1.__decorate([
44
+ (0, inversify_1.injectable)()
45
+ ], AICodeInlineCompletionsProvider);
46
+ //# sourceMappingURL=ai-code-inline-completion-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-inline-completion-provider.js","sourceRoot":"","sources":["../../src/browser/ai-code-inline-completion-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAIhF,4DAAkE;AAClE,2EAAsE;AACtE,4CAA8C;AAGvC,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAOxC,KAAK,CAAC,wBAAwB,CAC1B,KAA+B,EAC/B,QAAyB,EACzB,OAAiD,EACjD,KAA+B;QAE/B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,wBAAwB,CACtC,KAAK,EACL,QAAQ,EACR,OAAO,EACP,KAAK,CACR,CAAC;IACN,CAAC;IAED,qBAAqB,CACjB,WAAkF;QAElF,gBAAgB;IACpB,CAAC;CACJ,CAAA;AA7BY,0EAA+B;AAGrB;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;;8DACkB;AAE7B;IADhB,IAAA,kBAAM,EAAC,sBAAY,CAAC;;qEACuB;0CALnC,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CA6B3C"}
@@ -0,0 +1,24 @@
1
+ import { Agent, AgentSpecificVariables, CommunicationRecordingService, LanguageModelRegistry, LanguageModelRequirement, PromptService, PromptTemplate } from '@theia/ai-core/lib/common';
2
+ import { ILogger } from '@theia/core';
3
+ import * as monaco from '@theia/monaco-editor-core';
4
+ export declare const CodeCompletionAgent: unique symbol;
5
+ export interface CodeCompletionAgent extends Agent {
6
+ provideInlineCompletions(model: monaco.editor.ITextModel, position: monaco.Position, context: monaco.languages.InlineCompletionContext, token: monaco.CancellationToken): Promise<monaco.languages.InlineCompletions | undefined>;
7
+ }
8
+ export declare class CodeCompletionAgentImpl implements CodeCompletionAgent {
9
+ provideInlineCompletions(model: monaco.editor.ITextModel, position: monaco.Position, context: monaco.languages.InlineCompletionContext, token: monaco.CancellationToken): Promise<monaco.languages.InlineCompletions | undefined>;
10
+ protected logger: ILogger;
11
+ protected languageModelRegistry: LanguageModelRegistry;
12
+ protected promptService: PromptService;
13
+ protected recordingService: CommunicationRecordingService;
14
+ id: string;
15
+ name: string;
16
+ description: string;
17
+ promptTemplates: PromptTemplate[];
18
+ languageModelRequirements: LanguageModelRequirement[];
19
+ readonly variables: string[];
20
+ readonly functions: string[];
21
+ readonly agentSpecificVariables: AgentSpecificVariables[];
22
+ readonly tags?: String[] | undefined;
23
+ }
24
+ //# sourceMappingURL=code-completion-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-completion-agent.d.ts","sourceRoot":"","sources":["../../src/common/code-completion-agent.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,KAAK,EAAE,sBAAsB,EAA6B,6BAA6B,EACvF,qBAAqB,EAAwB,wBAAwB,EAAE,aAAa,EAAE,cAAc,EACvG,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAEpD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,MAAM,WAAW,mBAAoB,SAAQ,KAAK;IAC9C,wBAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAC/E,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,uBAAuB,EAAE,KAAK,EAAE,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;CACnJ;AAED,qBACa,uBAAwB,YAAW,mBAAmB;IACzD,wBAAwB,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,EAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,uBAAuB,EACjD,KAAK,EAAE,MAAM,CAAC,iBAAiB,GAChC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAoF1D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAG1B,SAAS,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAGvD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAGvC,SAAS,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;IAE1D,EAAE,SAAqB;IACvB,IAAI,SAAqB;IACzB,WAAW,SAC2E;IACtF,eAAe,EAAE,cAAc,EAAE,CAW/B;IACF,yBAAyB,EAAE,wBAAwB,EAAE,CAKnD;IACF,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAM;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAM;IAClC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,CAKvD;IACF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC"}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CodeCompletionAgentImpl = exports.CodeCompletionAgent = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const common_1 = require("@theia/ai-core/lib/common");
21
+ const core_1 = require("@theia/core");
22
+ const inversify_1 = require("@theia/core/shared/inversify");
23
+ exports.CodeCompletionAgent = Symbol('CodeCompletionAgent');
24
+ let CodeCompletionAgentImpl = class CodeCompletionAgentImpl {
25
+ constructor() {
26
+ this.id = 'Code Completion';
27
+ this.name = 'Code Completion';
28
+ this.description = 'This agent provides inline code completion in the code editor in the Theia IDE.';
29
+ this.promptTemplates = [
30
+ {
31
+ id: 'code-completion-prompt',
32
+ template: `You are a code completion agent. The current file you have to complete is named {{file}}.
33
+ The language of the file is {{language}}. Return your result as plain text without markdown formatting.
34
+ Finish the following code snippet.
35
+
36
+ {{textUntilCurrentPosition}}[[MARKER]]{{textAfterCurrentPosition}}
37
+
38
+ Only return the exact replacement for [[MARKER]] to complete the snippet.`,
39
+ },
40
+ ];
41
+ this.languageModelRequirements = [
42
+ {
43
+ purpose: 'code-completion',
44
+ identifier: 'openai/gpt-4o',
45
+ },
46
+ ];
47
+ this.variables = [];
48
+ this.functions = [];
49
+ this.agentSpecificVariables = [
50
+ { name: 'file', usedInPrompt: true, description: 'The uri of the file being edited.' },
51
+ { name: 'language', usedInPrompt: true, description: 'The languageId of the file being edited.' },
52
+ { name: 'textUntilCurrentPosition', usedInPrompt: true, description: 'The code before the current position of the cursor.' },
53
+ { name: 'textAfterCurrentPosition', usedInPrompt: true, description: 'The code after the current position of the cursor.' }
54
+ ];
55
+ }
56
+ async provideInlineCompletions(model, position, context, token) {
57
+ const languageModel = await this.languageModelRegistry.selectLanguageModel({
58
+ agent: this.id,
59
+ ...this.languageModelRequirements[0],
60
+ });
61
+ if (!languageModel) {
62
+ this.logger.error('No language model found for code-completion-agent');
63
+ return undefined;
64
+ }
65
+ // Get text until the given position
66
+ const textUntilCurrentPosition = model.getValueInRange({
67
+ startLineNumber: 1,
68
+ startColumn: 1,
69
+ endLineNumber: position.lineNumber,
70
+ endColumn: position.column,
71
+ });
72
+ // Get text after the given position
73
+ const textAfterCurrentPosition = model.getValueInRange({
74
+ startLineNumber: position.lineNumber,
75
+ startColumn: position.column,
76
+ endLineNumber: model.getLineCount(),
77
+ endColumn: model.getLineMaxColumn(model.getLineCount()),
78
+ });
79
+ const file = model.uri.toString(false);
80
+ const language = model.getLanguageId();
81
+ if (token.isCancellationRequested) {
82
+ return undefined;
83
+ }
84
+ const prompt = await this.promptService
85
+ .getPrompt('code-completion-prompt', { textUntilCurrentPosition, textAfterCurrentPosition, file, language })
86
+ .then(p => p === null || p === void 0 ? void 0 : p.text);
87
+ if (!prompt) {
88
+ this.logger.error('No prompt found for code-completion-agent');
89
+ return undefined;
90
+ }
91
+ // since we do not actually hold complete conversions, the request/response pair is considered a session
92
+ const sessionId = (0, core_1.generateUuid)();
93
+ const requestId = (0, core_1.generateUuid)();
94
+ const request = {
95
+ messages: [{ type: 'text', actor: 'user', query: prompt }],
96
+ };
97
+ const requestEntry = {
98
+ agentId: this.id,
99
+ sessionId,
100
+ timestamp: Date.now(),
101
+ requestId,
102
+ request: prompt,
103
+ };
104
+ if (token.isCancellationRequested) {
105
+ return undefined;
106
+ }
107
+ this.recordingService.recordRequest(requestEntry);
108
+ const response = await languageModel.request(request, token);
109
+ if (token.isCancellationRequested) {
110
+ return undefined;
111
+ }
112
+ const completionText = await (0, common_1.getTextOfResponse)(response);
113
+ if (token.isCancellationRequested) {
114
+ return undefined;
115
+ }
116
+ this.recordingService.recordResponse({
117
+ agentId: this.id,
118
+ sessionId,
119
+ timestamp: Date.now(),
120
+ requestId,
121
+ response: completionText,
122
+ });
123
+ return {
124
+ items: [{ insertText: completionText }],
125
+ enableForwardStability: true,
126
+ };
127
+ }
128
+ };
129
+ exports.CodeCompletionAgentImpl = CodeCompletionAgentImpl;
130
+ tslib_1.__decorate([
131
+ (0, inversify_1.inject)(core_1.ILogger),
132
+ (0, inversify_1.named)('code-completion-agent'),
133
+ tslib_1.__metadata("design:type", Object)
134
+ ], CodeCompletionAgentImpl.prototype, "logger", void 0);
135
+ tslib_1.__decorate([
136
+ (0, inversify_1.inject)(common_1.LanguageModelRegistry),
137
+ tslib_1.__metadata("design:type", Object)
138
+ ], CodeCompletionAgentImpl.prototype, "languageModelRegistry", void 0);
139
+ tslib_1.__decorate([
140
+ (0, inversify_1.inject)(common_1.PromptService),
141
+ tslib_1.__metadata("design:type", Object)
142
+ ], CodeCompletionAgentImpl.prototype, "promptService", void 0);
143
+ tslib_1.__decorate([
144
+ (0, inversify_1.inject)(common_1.CommunicationRecordingService),
145
+ tslib_1.__metadata("design:type", Object)
146
+ ], CodeCompletionAgentImpl.prototype, "recordingService", void 0);
147
+ exports.CodeCompletionAgentImpl = CodeCompletionAgentImpl = tslib_1.__decorate([
148
+ (0, inversify_1.injectable)()
149
+ ], CodeCompletionAgentImpl);
150
+ //# sourceMappingURL=code-completion-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-completion-agent.js","sourceRoot":"","sources":["../../src/common/code-completion-agent.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,sDAGmC;AACnC,sCA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,8BAAqB,CAAC;;sEACyB;AAG7C;IADT,IAAA,kBAAM,EAAC,sBAAa,CAAC;;8DACiB;AAG7B;IADT,IAAA,kBAAM,EAAC,sCAA6B,CAAC;;iEACoB;kCAnGjD,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAoInC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=package.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+ /* note: this bogus test file is required so that
17
+ we are able to run mocha unit tests on this
18
+ package, without having any actual unit tests in it.
19
+ This way a coverage report will be generated,
20
+ showing 0% coverage, instead of no report.
21
+ This file can be removed once we have real unit
22
+ tests in place. */
23
+ describe('ai-code-completion package', () => {
24
+ it('support code coverage statistics', () => true);
25
+ });
26
+ //# sourceMappingURL=package.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;;;qBAMqB;AAErB,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAExC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@theia/ai-code-completion",
3
+ "version": "1.54.0",
4
+ "description": "Theia - AI Core",
5
+ "dependencies": {
6
+ "@theia/ai-core": "1.54.0",
7
+ "@theia/core": "1.54.0",
8
+ "@theia/filesystem": "1.54.0",
9
+ "@theia/monaco-editor-core": "1.83.101",
10
+ "@theia/output": "1.54.0",
11
+ "@theia/workspace": "1.54.0",
12
+ "minimatch": "^5.1.0",
13
+ "tslib": "^2.6.2"
14
+ },
15
+ "main": "lib/common",
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "theiaExtensions": [
20
+ {
21
+ "frontend": "lib/browser/ai-code-completion-frontend-module"
22
+ }
23
+ ],
24
+ "keywords": [
25
+ "theia-extension"
26
+ ],
27
+ "license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/eclipse-theia/theia.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/eclipse-theia/theia/issues"
34
+ },
35
+ "homepage": "https://github.com/eclipse-theia/theia",
36
+ "files": [
37
+ "lib",
38
+ "src"
39
+ ],
40
+ "scripts": {
41
+ "build": "theiaext build",
42
+ "clean": "theiaext clean",
43
+ "compile": "theiaext compile",
44
+ "lint": "theiaext lint",
45
+ "test": "theiaext test",
46
+ "watch": "theiaext watch"
47
+ },
48
+ "devDependencies": {
49
+ "@theia/ext-scripts": "1.54.0"
50
+ },
51
+ "nyc": {
52
+ "extends": "../../configs/nyc.json"
53
+ },
54
+ "gitHead": "8fb36a237db744cff6e78eaff1481e1f36bb7a69"
55
+ }
@@ -0,0 +1,37 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { ILogger } from '@theia/core';
18
+ import { ContainerModule } from '@theia/core/shared/inversify';
19
+ import { CodeCompletionAgent, CodeCompletionAgentImpl } from '../common/code-completion-agent';
20
+ import { AIFrontendApplicationContribution } from './ai-code-frontend-application-contribution';
21
+ import { FrontendApplicationContribution, PreferenceContribution } from '@theia/core/lib/browser';
22
+ import { Agent } from '@theia/ai-core';
23
+ import { AICodeCompletionPreferencesSchema } from './ai-code-completion-preference';
24
+ import { AICodeInlineCompletionsProvider } from './ai-code-inline-completion-provider';
25
+
26
+ export default new ContainerModule(bind => {
27
+ bind(ILogger).toDynamicValue(ctx => {
28
+ const parentLogger = ctx.container.get<ILogger>(ILogger);
29
+ return parentLogger.child('code-completion-agent');
30
+ }).inSingletonScope().whenTargetNamed('code-completion-agent');
31
+ bind(CodeCompletionAgentImpl).toSelf().inSingletonScope();
32
+ bind(CodeCompletionAgent).toService(CodeCompletionAgentImpl);
33
+ bind(Agent).toService(CodeCompletionAgentImpl);
34
+ bind(AICodeInlineCompletionsProvider).toSelf().inSingletonScope();
35
+ bind(FrontendApplicationContribution).to(AIFrontendApplicationContribution).inSingletonScope();
36
+ bind(PreferenceContribution).toConstantValue({ schema: AICodeCompletionPreferencesSchema });
37
+ });
@@ -0,0 +1,32 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { PreferenceSchema } from '@theia/core/lib/browser/preferences/preference-contribution';
18
+ import { AI_CORE_PREFERENCES_TITLE } from '@theia/ai-core/lib/browser/ai-core-preferences';
19
+
20
+ export const PREF_AI_INLINE_COMPLETION_ENABLE = 'ai-features.codeCompletion.enableCodeCompletion';
21
+
22
+ export const AICodeCompletionPreferencesSchema: PreferenceSchema = {
23
+ type: 'object',
24
+ properties: {
25
+ [PREF_AI_INLINE_COMPLETION_ENABLE]: {
26
+ title: AI_CORE_PREFERENCES_TITLE,
27
+ type: 'boolean',
28
+ description: 'Enable AI completions inline within any (Monaco) editor.',
29
+ default: false
30
+ }
31
+ }
32
+ };
@@ -0,0 +1,64 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as monaco from '@theia/monaco-editor-core';
18
+
19
+ import { FrontendApplicationContribution, PreferenceService } from '@theia/core/lib/browser';
20
+ import { inject, injectable } from '@theia/core/shared/inversify';
21
+ import { AIActivationService } from '@theia/ai-core/lib/browser';
22
+ import { Disposable } from '@theia/core';
23
+ import { AICodeInlineCompletionsProvider } from './ai-code-inline-completion-provider';
24
+ import { PREF_AI_INLINE_COMPLETION_ENABLE } from './ai-code-completion-preference';
25
+
26
+ @injectable()
27
+ export class AIFrontendApplicationContribution implements FrontendApplicationContribution {
28
+ @inject(AICodeInlineCompletionsProvider)
29
+ private inlineCodeCompletionProvider: AICodeInlineCompletionsProvider;
30
+
31
+ @inject(PreferenceService)
32
+ protected readonly preferenceService: PreferenceService;
33
+
34
+ @inject(AIActivationService)
35
+ protected readonly activationService: AIActivationService;
36
+
37
+ private toDispose = new Map<string, Disposable>();
38
+
39
+ onDidInitializeLayout(): void {
40
+ this.preferenceService.ready.then(() => {
41
+ this.handlePreference(PREF_AI_INLINE_COMPLETION_ENABLE, enable => this.handleInlineCompletions(enable));
42
+ });
43
+ }
44
+
45
+ protected handlePreference(name: string, handler: (enable: boolean) => Disposable): void {
46
+ const enable = this.preferenceService.get<boolean>(name, false) && this.activationService.isActive;
47
+ this.toDispose.set(name, handler(enable));
48
+
49
+ this.preferenceService.onPreferenceChanged(event => {
50
+ if (event.preferenceName === name) {
51
+ this.toDispose.get(name)?.dispose();
52
+ this.toDispose.set(name, handler(event.newValue && this.activationService.isActive));
53
+ }
54
+ });
55
+ this.activationService.onDidChangeActiveStatus(change => {
56
+ this.toDispose.get(name)?.dispose();
57
+ this.toDispose.set(name, handler(this.preferenceService.get<boolean>(name, false) && change));
58
+ });
59
+ }
60
+
61
+ protected handleInlineCompletions(enable: boolean): Disposable {
62
+ return enable ? monaco.languages.registerInlineCompletionsProvider({ scheme: 'file' }, this.inlineCodeCompletionProvider) : Disposable.NULL;
63
+ }
64
+ }
@@ -0,0 +1,53 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as monaco from '@theia/monaco-editor-core';
18
+
19
+ import { inject, injectable } from '@theia/core/shared/inversify';
20
+ import { CodeCompletionAgent } from '../common/code-completion-agent';
21
+ import { AgentService } from '@theia/ai-core';
22
+
23
+ @injectable()
24
+ export class AICodeInlineCompletionsProvider
25
+ implements monaco.languages.InlineCompletionsProvider {
26
+ @inject(CodeCompletionAgent)
27
+ protected readonly agent: CodeCompletionAgent;
28
+ @inject(AgentService)
29
+ private readonly agentService: AgentService;
30
+
31
+ async provideInlineCompletions(
32
+ model: monaco.editor.ITextModel,
33
+ position: monaco.Position,
34
+ context: monaco.languages.InlineCompletionContext,
35
+ token: monaco.CancellationToken
36
+ ): Promise<monaco.languages.InlineCompletions | undefined> {
37
+ if (!this.agentService.isEnabled(this.agent.id)) {
38
+ return undefined;
39
+ }
40
+ return this.agent.provideInlineCompletions(
41
+ model,
42
+ position,
43
+ context,
44
+ token
45
+ );
46
+ }
47
+
48
+ freeInlineCompletions(
49
+ completions: monaco.languages.InlineCompletions<monaco.languages.InlineCompletion>
50
+ ): void {
51
+ // nothing to do
52
+ }
53
+ }
@@ -0,0 +1,164 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import {
18
+ Agent, AgentSpecificVariables, CommunicationHistoryEntry, CommunicationRecordingService, getTextOfResponse,
19
+ LanguageModelRegistry, LanguageModelRequest, LanguageModelRequirement, PromptService, PromptTemplate
20
+ } from '@theia/ai-core/lib/common';
21
+ import { generateUuid, ILogger } from '@theia/core';
22
+ import { inject, injectable, named } from '@theia/core/shared/inversify';
23
+ import * as monaco from '@theia/monaco-editor-core';
24
+
25
+ export const CodeCompletionAgent = Symbol('CodeCompletionAgent');
26
+ export interface CodeCompletionAgent extends Agent {
27
+ provideInlineCompletions(model: monaco.editor.ITextModel, position: monaco.Position,
28
+ context: monaco.languages.InlineCompletionContext, token: monaco.CancellationToken): Promise<monaco.languages.InlineCompletions | undefined>
29
+ }
30
+
31
+ @injectable()
32
+ export class CodeCompletionAgentImpl implements CodeCompletionAgent {
33
+ async provideInlineCompletions(
34
+ model: monaco.editor.ITextModel,
35
+ position: monaco.Position,
36
+ context: monaco.languages.InlineCompletionContext,
37
+ token: monaco.CancellationToken
38
+ ): Promise<monaco.languages.InlineCompletions | undefined> {
39
+ const languageModel =
40
+ await this.languageModelRegistry.selectLanguageModel({
41
+ agent: this.id,
42
+ ...this.languageModelRequirements[0],
43
+ });
44
+ if (!languageModel) {
45
+ this.logger.error(
46
+ 'No language model found for code-completion-agent'
47
+ );
48
+ return undefined;
49
+ }
50
+
51
+ // Get text until the given position
52
+ const textUntilCurrentPosition = model.getValueInRange({
53
+ startLineNumber: 1,
54
+ startColumn: 1,
55
+ endLineNumber: position.lineNumber,
56
+ endColumn: position.column,
57
+ });
58
+
59
+ // Get text after the given position
60
+ const textAfterCurrentPosition = model.getValueInRange({
61
+ startLineNumber: position.lineNumber,
62
+ startColumn: position.column,
63
+ endLineNumber: model.getLineCount(),
64
+ endColumn: model.getLineMaxColumn(model.getLineCount()),
65
+ });
66
+
67
+ const file = model.uri.toString(false);
68
+ const language = model.getLanguageId();
69
+
70
+ if (token.isCancellationRequested) {
71
+ return undefined;
72
+ }
73
+ const prompt = await this.promptService
74
+ .getPrompt('code-completion-prompt', { textUntilCurrentPosition, textAfterCurrentPosition, file, language })
75
+ .then(p => p?.text);
76
+ if (!prompt) {
77
+ this.logger.error('No prompt found for code-completion-agent');
78
+ return undefined;
79
+ }
80
+
81
+ // since we do not actually hold complete conversions, the request/response pair is considered a session
82
+ const sessionId = generateUuid();
83
+ const requestId = generateUuid();
84
+ const request: LanguageModelRequest = {
85
+ messages: [{ type: 'text', actor: 'user', query: prompt }],
86
+ };
87
+ const requestEntry: CommunicationHistoryEntry = {
88
+ agentId: this.id,
89
+ sessionId,
90
+ timestamp: Date.now(),
91
+ requestId,
92
+ request: prompt,
93
+ };
94
+ if (token.isCancellationRequested) {
95
+ return undefined;
96
+ }
97
+ this.recordingService.recordRequest(requestEntry);
98
+ const response = await languageModel.request(request, token);
99
+ if (token.isCancellationRequested) {
100
+ return undefined;
101
+ }
102
+ const completionText = await getTextOfResponse(response);
103
+ if (token.isCancellationRequested) {
104
+ return undefined;
105
+ }
106
+ this.recordingService.recordResponse({
107
+ agentId: this.id,
108
+ sessionId,
109
+ timestamp: Date.now(),
110
+ requestId,
111
+ response: completionText,
112
+ });
113
+
114
+ return {
115
+ items: [{ insertText: completionText }],
116
+ enableForwardStability: true,
117
+ };
118
+ }
119
+
120
+ @inject(ILogger)
121
+ @named('code-completion-agent')
122
+ protected logger: ILogger;
123
+
124
+ @inject(LanguageModelRegistry)
125
+ protected languageModelRegistry: LanguageModelRegistry;
126
+
127
+ @inject(PromptService)
128
+ protected promptService: PromptService;
129
+
130
+ @inject(CommunicationRecordingService)
131
+ protected recordingService: CommunicationRecordingService;
132
+
133
+ id = 'Code Completion';
134
+ name = 'Code Completion';
135
+ description =
136
+ 'This agent provides inline code completion in the code editor in the Theia IDE.';
137
+ promptTemplates: PromptTemplate[] = [
138
+ {
139
+ id: 'code-completion-prompt',
140
+ template: `You are a code completion agent. The current file you have to complete is named {{file}}.
141
+ The language of the file is {{language}}. Return your result as plain text without markdown formatting.
142
+ Finish the following code snippet.
143
+
144
+ {{textUntilCurrentPosition}}[[MARKER]]{{textAfterCurrentPosition}}
145
+
146
+ Only return the exact replacement for [[MARKER]] to complete the snippet.`,
147
+ },
148
+ ];
149
+ languageModelRequirements: LanguageModelRequirement[] = [
150
+ {
151
+ purpose: 'code-completion',
152
+ identifier: 'openai/gpt-4o',
153
+ },
154
+ ];
155
+ readonly variables: string[] = [];
156
+ readonly functions: string[] = [];
157
+ readonly agentSpecificVariables: AgentSpecificVariables[] = [
158
+ { name: 'file', usedInPrompt: true, description: 'The uri of the file being edited.' },
159
+ { name: 'language', usedInPrompt: true, description: 'The languageId of the file being edited.' },
160
+ { name: 'textUntilCurrentPosition', usedInPrompt: true, description: 'The code before the current position of the cursor.' },
161
+ { name: 'textAfterCurrentPosition', usedInPrompt: true, description: 'The code after the current position of the cursor.' }
162
+ ];
163
+ readonly tags?: String[] | undefined;
164
+ }
@@ -0,0 +1,28 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ /* note: this bogus test file is required so that
18
+ we are able to run mocha unit tests on this
19
+ package, without having any actual unit tests in it.
20
+ This way a coverage report will be generated,
21
+ showing 0% coverage, instead of no report.
22
+ This file can be removed once we have real unit
23
+ tests in place. */
24
+
25
+ describe('ai-code-completion package', () => {
26
+
27
+ it('support code coverage statistics', () => true);
28
+ });