@theia/ai-code-completion 1.67.0-next.56 → 1.67.0-next.59

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 (65) hide show
  1. package/lib/browser/ai-code-completion-frontend-module.d.ts +4 -0
  2. package/lib/browser/ai-code-completion-frontend-module.d.ts.map +1 -0
  3. package/lib/browser/ai-code-completion-frontend-module.js +40 -0
  4. package/lib/browser/ai-code-completion-frontend-module.js.map +1 -0
  5. package/lib/browser/ai-code-frontend-application-contribution.d.ts +17 -0
  6. package/lib/browser/ai-code-frontend-application-contribution.d.ts.map +1 -0
  7. package/lib/browser/ai-code-frontend-application-contribution.js +135 -0
  8. package/lib/browser/ai-code-frontend-application-contribution.js.map +1 -0
  9. package/lib/browser/ai-code-inline-completion-provider.d.ts +9 -0
  10. package/lib/browser/ai-code-inline-completion-provider.d.ts.map +1 -0
  11. package/lib/browser/ai-code-inline-completion-provider.js +46 -0
  12. package/lib/browser/ai-code-inline-completion-provider.js.map +1 -0
  13. package/lib/browser/code-completion-agent.d.ts +27 -0
  14. package/lib/browser/code-completion-agent.d.ts.map +1 -0
  15. package/lib/browser/code-completion-agent.js +148 -0
  16. package/lib/browser/code-completion-agent.js.map +1 -0
  17. package/lib/browser/code-completion-cache.d.ts +49 -0
  18. package/lib/browser/code-completion-cache.d.ts.map +1 -0
  19. package/lib/browser/code-completion-cache.js +135 -0
  20. package/lib/browser/code-completion-cache.js.map +1 -0
  21. package/lib/browser/code-completion-debouncer.d.ts +5 -0
  22. package/lib/browser/code-completion-debouncer.d.ts.map +1 -0
  23. package/lib/browser/code-completion-debouncer.js +35 -0
  24. package/lib/browser/code-completion-debouncer.js.map +1 -0
  25. package/lib/browser/code-completion-postprocessor.d.ts +11 -0
  26. package/lib/browser/code-completion-postprocessor.d.ts.map +1 -0
  27. package/lib/browser/code-completion-postprocessor.js +49 -0
  28. package/lib/browser/code-completion-postprocessor.js.map +1 -0
  29. package/lib/browser/code-completion-postprocessor.spec.d.ts +2 -0
  30. package/lib/browser/code-completion-postprocessor.spec.d.ts.map +1 -0
  31. package/lib/browser/code-completion-postprocessor.spec.js +73 -0
  32. package/lib/browser/code-completion-postprocessor.spec.js.map +1 -0
  33. package/lib/browser/code-completion-prompt-template.d.ts +3 -0
  34. package/lib/browser/code-completion-prompt-template.d.ts.map +1 -0
  35. package/lib/browser/code-completion-prompt-template.js +82 -0
  36. package/lib/browser/code-completion-prompt-template.js.map +1 -0
  37. package/lib/browser/code-completion-variable-context.d.ts +11 -0
  38. package/lib/browser/code-completion-variable-context.d.ts.map +1 -0
  39. package/lib/browser/code-completion-variable-context.js +26 -0
  40. package/lib/browser/code-completion-variable-context.js.map +1 -0
  41. package/lib/browser/code-completion-variable-contribution.d.ts +15 -0
  42. package/lib/browser/code-completion-variable-contribution.d.ts.map +1 -0
  43. package/lib/browser/code-completion-variable-contribution.js +127 -0
  44. package/lib/browser/code-completion-variable-contribution.js.map +1 -0
  45. package/lib/browser/code-completion-variable-contribution.spec.d.ts +2 -0
  46. package/lib/browser/code-completion-variable-contribution.spec.d.ts.map +1 -0
  47. package/lib/browser/code-completion-variable-contribution.spec.js +143 -0
  48. package/lib/browser/code-completion-variable-contribution.spec.js.map +1 -0
  49. package/lib/browser/code-completion-variables.d.ts +6 -0
  50. package/lib/browser/code-completion-variables.d.ts.map +1 -0
  51. package/lib/browser/code-completion-variables.js +40 -0
  52. package/lib/browser/code-completion-variables.js.map +1 -0
  53. package/lib/common/ai-code-completion-preference.d.ts +9 -0
  54. package/lib/common/ai-code-completion-preference.d.ts.map +1 -0
  55. package/lib/common/ai-code-completion-preference.js +78 -0
  56. package/lib/common/ai-code-completion-preference.js.map +1 -0
  57. package/lib/node/ai-code-completion-backend-module.d.ts +4 -0
  58. package/lib/node/ai-code-completion-backend-module.d.ts.map +1 -0
  59. package/lib/node/ai-code-completion-backend-module.js +24 -0
  60. package/lib/node/ai-code-completion-backend-module.js.map +1 -0
  61. package/lib/package.spec.d.ts +1 -0
  62. package/lib/package.spec.d.ts.map +1 -0
  63. package/lib/package.spec.js +26 -0
  64. package/lib/package.spec.js.map +1 -0
  65. package/package.json +7 -7
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 Lonti.com Pty Ltd.
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.CodeCompletionVariableContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const core_1 = require("@theia/core");
21
+ const inversify_1 = require("@theia/core/shared/inversify");
22
+ const ai_code_completion_preference_1 = require("../common/ai-code-completion-preference");
23
+ const code_completion_variable_context_1 = require("./code-completion-variable-context");
24
+ const code_completion_variables_1 = require("./code-completion-variables");
25
+ let CodeCompletionVariableContribution = class CodeCompletionVariableContribution {
26
+ registerVariables(service) {
27
+ [
28
+ code_completion_variables_1.FILE,
29
+ code_completion_variables_1.PREFIX,
30
+ code_completion_variables_1.SUFFIX,
31
+ code_completion_variables_1.LANGUAGE
32
+ ].forEach(variable => {
33
+ service.registerResolver(variable, this);
34
+ });
35
+ }
36
+ canResolve(_request, context) {
37
+ return code_completion_variable_context_1.CodeCompletionVariableContext.is(context) ? 1 : 0;
38
+ }
39
+ async resolve(request, context) {
40
+ if (!code_completion_variable_context_1.CodeCompletionVariableContext.is(context)) {
41
+ return Promise.resolve(undefined);
42
+ }
43
+ switch (request.variable.id) {
44
+ case code_completion_variables_1.FILE.id:
45
+ return this.resolveFile(context);
46
+ case code_completion_variables_1.LANGUAGE.id:
47
+ return this.resolveLanguage(context);
48
+ case code_completion_variables_1.PREFIX.id:
49
+ return this.resolvePrefix(context);
50
+ case code_completion_variables_1.SUFFIX.id:
51
+ return this.resolveSuffix(context);
52
+ default:
53
+ return undefined;
54
+ }
55
+ }
56
+ resolvePrefix(context) {
57
+ const position = context.position;
58
+ const model = context.model;
59
+ const maxContextLines = this.preferences.get(ai_code_completion_preference_1.PREF_AI_INLINE_COMPLETION_MAX_CONTEXT_LINES, -1);
60
+ let prefixStartLine = 1;
61
+ if (maxContextLines === 0) {
62
+ // Only the cursor line
63
+ prefixStartLine = position.lineNumber;
64
+ }
65
+ else if (maxContextLines > 0) {
66
+ const linesBeforeCursor = position.lineNumber - 1;
67
+ // Allocate one more line to the prefix in case of an odd maxContextLines
68
+ const prefixLines = Math.min(Math.ceil(maxContextLines / 2), linesBeforeCursor);
69
+ prefixStartLine = Math.max(1, position.lineNumber - prefixLines);
70
+ }
71
+ const prefix = model.getValueInRange({
72
+ startLineNumber: prefixStartLine,
73
+ startColumn: 1,
74
+ endLineNumber: position.lineNumber,
75
+ endColumn: position.column,
76
+ });
77
+ return {
78
+ variable: code_completion_variables_1.PREFIX,
79
+ value: prefix
80
+ };
81
+ }
82
+ resolveSuffix(context) {
83
+ const position = context.position;
84
+ const model = context.model;
85
+ const maxContextLines = this.preferences.get(ai_code_completion_preference_1.PREF_AI_INLINE_COMPLETION_MAX_CONTEXT_LINES, -1);
86
+ let suffixEndLine = model.getLineCount();
87
+ if (maxContextLines === 0) {
88
+ suffixEndLine = position.lineNumber;
89
+ }
90
+ else if (maxContextLines > 0) {
91
+ const linesAfterCursor = model.getLineCount() - position.lineNumber;
92
+ const suffixLines = Math.min(Math.floor(maxContextLines / 2), linesAfterCursor);
93
+ suffixEndLine = Math.min(model.getLineCount(), position.lineNumber + suffixLines);
94
+ }
95
+ const suffix = model.getValueInRange({
96
+ startLineNumber: position.lineNumber,
97
+ startColumn: position.column,
98
+ endLineNumber: suffixEndLine,
99
+ endColumn: model.getLineMaxColumn(suffixEndLine),
100
+ });
101
+ return {
102
+ variable: code_completion_variables_1.SUFFIX,
103
+ value: suffix
104
+ };
105
+ }
106
+ resolveLanguage(context) {
107
+ return {
108
+ variable: code_completion_variables_1.LANGUAGE,
109
+ value: context.model.getLanguageId()
110
+ };
111
+ }
112
+ resolveFile(context) {
113
+ return {
114
+ variable: code_completion_variables_1.FILE,
115
+ value: context.model.uri.toString(false)
116
+ };
117
+ }
118
+ };
119
+ exports.CodeCompletionVariableContribution = CodeCompletionVariableContribution;
120
+ tslib_1.__decorate([
121
+ (0, inversify_1.inject)(core_1.PreferenceService),
122
+ tslib_1.__metadata("design:type", Object)
123
+ ], CodeCompletionVariableContribution.prototype, "preferences", void 0);
124
+ exports.CodeCompletionVariableContribution = CodeCompletionVariableContribution = tslib_1.__decorate([
125
+ (0, inversify_1.injectable)()
126
+ ], CodeCompletionVariableContribution);
127
+ //# sourceMappingURL=code-completion-variable-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-completion-variable-contribution.js","sourceRoot":"","sources":["../../src/browser/code-completion-variable-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,wCAAwC;AACxC,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,sCAA8D;AAC9D,4DAAkE;AAClE,2FAAsG;AACtG,yFAAmF;AACnF,2EAA6E;AAGtE,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAI3C,iBAAiB,CAAC,OAAgC;QAC9C;YACI,gCAAI;YACJ,kCAAM;YACN,kCAAM;YACN,oCAAQ;SACX,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACjB,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eAAe,GAAG,CAAC,CAAC,EAC/B,gBAAgB,CACnB,CAAC;YAEF,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,QAAQ,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC;QACtF,CAAC;QAED,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC;YACjC,eAAe,EAAE,QAAQ,CAAC,UAAU;YACpC,WAAW,EAAE,QAAQ,CAAC,MAAM;YAC5B,aAAa,EAAE,aAAa;YAC5B,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC;SACnD,CAAC,CAAC;QAEH,OAAO;YACH,QAAQ,EAAE,kCAAM;YAChB,KAAK,EAAE,MAAM;SAChB,CAAC;IACN,CAAC;IAES,eAAe,CAAC,OAAsC;QAC5D,OAAO;YACH,QAAQ,EAAE,oCAAQ;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE;SACvC,CAAC;IACN,CAAC;IAES,WAAW,CAAC,OAAsC;QACxD,OAAO;YACH,QAAQ,EAAE,gCAAI;YACd,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;SAC3C,CAAC;IACN,CAAC;CAEJ,CAAA;AAtHY,gFAAkC;AAEjC;IADT,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;uEACe;6CAFhC,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;GACA,kCAAkC,CAsH9C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=code-completion-variable-contribution.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-completion-variable-contribution.spec.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-variable-contribution.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 Lonti.com Pty Ltd.
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 frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
19
+ const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
20
+ let disableJSDOM = (0, jsdom_1.enableJSDOM)();
21
+ frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
22
+ const common_1 = require("@theia/core/lib/common");
23
+ const inversify_1 = require("@theia/core/shared/inversify");
24
+ const editor_api_1 = require("@theia/monaco-editor-core/esm/vs/editor/editor.api");
25
+ const chai_1 = require("chai");
26
+ const sinon = require("sinon");
27
+ const code_completion_variable_contribution_1 = require("./code-completion-variable-contribution");
28
+ const code_completion_variables_1 = require("./code-completion-variables");
29
+ disableJSDOM();
30
+ describe('CodeCompletionVariableContribution', () => {
31
+ let contribution;
32
+ let model;
33
+ before(() => {
34
+ disableJSDOM = (0, jsdom_1.enableJSDOM)();
35
+ const container = new inversify_1.Container();
36
+ container.bind(common_1.PreferenceService).toConstantValue({
37
+ get: () => 1000,
38
+ });
39
+ container.bind(code_completion_variable_contribution_1.CodeCompletionVariableContribution).toSelf().inSingletonScope();
40
+ contribution = container.get(code_completion_variable_contribution_1.CodeCompletionVariableContribution);
41
+ });
42
+ beforeEach(() => {
43
+ model = editor_api_1.editor.createModel('//line 1\nconsole.\n//line 2', 'javascript', editor_api_1.Uri.file('/home/user/workspace/test.js'));
44
+ sinon.stub(model, 'getLanguageId').returns('javascript');
45
+ });
46
+ afterEach(() => {
47
+ model.dispose();
48
+ });
49
+ after(() => {
50
+ // Disable JSDOM after all tests
51
+ disableJSDOM();
52
+ model.dispose();
53
+ });
54
+ describe('canResolve', () => {
55
+ it('should be able to resolve the file from the CodeCompletionVariableContext', () => {
56
+ const context = {
57
+ model,
58
+ position: model.getPositionAt(8),
59
+ context: {
60
+ triggerKind: editor_api_1.languages.InlineCompletionTriggerKind.Automatic,
61
+ selectedSuggestionInfo: undefined,
62
+ includeInlineEdits: false,
63
+ includeInlineCompletions: false
64
+ }
65
+ };
66
+ (0, chai_1.expect)(contribution.canResolve({ variable: code_completion_variables_1.FILE }, context)).to.equal(1);
67
+ });
68
+ it('should not be able to resolve the file from unknown context', () => {
69
+ (0, chai_1.expect)(contribution.canResolve({ variable: code_completion_variables_1.FILE }, {})).to.equal(0);
70
+ });
71
+ });
72
+ describe('resolve', () => {
73
+ it('should resolve the file variable', async () => {
74
+ const context = {
75
+ model,
76
+ position: model.getPositionAt(17),
77
+ context: {
78
+ triggerKind: editor_api_1.languages.InlineCompletionTriggerKind.Automatic,
79
+ selectedSuggestionInfo: undefined,
80
+ includeInlineEdits: false,
81
+ includeInlineCompletions: false
82
+ }
83
+ };
84
+ const resolved = await contribution.resolve({ variable: code_completion_variables_1.FILE }, context);
85
+ (0, chai_1.expect)(resolved).to.deep.equal({
86
+ variable: code_completion_variables_1.FILE,
87
+ value: 'file:///home/user/workspace/test.js'
88
+ });
89
+ });
90
+ it('should resolve the language variable', async () => {
91
+ const context = {
92
+ model,
93
+ position: model.getPositionAt(17),
94
+ context: {
95
+ triggerKind: editor_api_1.languages.InlineCompletionTriggerKind.Automatic,
96
+ selectedSuggestionInfo: undefined,
97
+ includeInlineEdits: false,
98
+ includeInlineCompletions: false
99
+ }
100
+ };
101
+ const resolved = await contribution.resolve({ variable: code_completion_variables_1.LANGUAGE }, context);
102
+ (0, chai_1.expect)(resolved).to.deep.equal({
103
+ variable: code_completion_variables_1.LANGUAGE,
104
+ value: 'javascript'
105
+ });
106
+ });
107
+ it('should resolve the prefix variable', async () => {
108
+ const context = {
109
+ model,
110
+ position: model.getPositionAt(17),
111
+ context: {
112
+ triggerKind: editor_api_1.languages.InlineCompletionTriggerKind.Automatic,
113
+ selectedSuggestionInfo: undefined,
114
+ includeInlineEdits: false,
115
+ includeInlineCompletions: false
116
+ }
117
+ };
118
+ const resolved = await contribution.resolve({ variable: code_completion_variables_1.PREFIX }, context);
119
+ (0, chai_1.expect)(resolved).to.deep.equal({
120
+ variable: code_completion_variables_1.PREFIX,
121
+ value: '//line 1\nconsole.'
122
+ });
123
+ });
124
+ it('should resolve the suffix variable', async () => {
125
+ const context = {
126
+ model,
127
+ position: model.getPositionAt(17),
128
+ context: {
129
+ triggerKind: editor_api_1.languages.InlineCompletionTriggerKind.Automatic,
130
+ selectedSuggestionInfo: undefined,
131
+ includeInlineEdits: false,
132
+ includeInlineCompletions: false
133
+ }
134
+ };
135
+ const resolved = await contribution.resolve({ variable: code_completion_variables_1.SUFFIX }, context);
136
+ (0, chai_1.expect)(resolved).to.deep.equal({
137
+ variable: code_completion_variables_1.SUFFIX,
138
+ value: '\n//line 2'
139
+ });
140
+ });
141
+ });
142
+ });
143
+ //# sourceMappingURL=code-completion-variable-contribution.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-completion-variable-contribution.spec.js","sourceRoot":"","sources":["../../src/browser/code-completion-variable-contribution.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,wCAAwC;AACxC,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,uHAAiH;AACjH,8DAAiE;AACjE,IAAI,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;AACjC,wEAAiC,CAAC,GAAG,CAAC,EA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AAK,CAAC;gBAC3B,QAAQ,EAAE,kCAAM;gBAChB,KAAK,EAAE,oBAAoB;aAC9B,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;YAChD,MAAM,OAAO,GAAkC;gBAC3C,KAAK;gBACL,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;gBACjC,OAAO,EAAE;oBACL,WAAW,EAAE,sBAAS,CAAC,2BAA2B,CAAC,SAAS;oBAC5D,sBAAsB,EAAE,SAAS;oBACjC,kBAAkB,EAAE,KAAK;oBACzB,wBAAwB,EAAE,KAAK;iBAClC;aACJ,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,kCAAM,EAAE,EAAE,OAAO,CAAC,CAAC;YAC3E,IAAA,aAAM,EAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC3B,QAAQ,EAAE,kCAAM;gBAChB,KAAK,EAAE,YAAY;aACtB,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { AIVariable } from '@theia/ai-core/lib/common/variable-service';
2
+ export declare const FILE: AIVariable;
3
+ export declare const PREFIX: AIVariable;
4
+ export declare const SUFFIX: AIVariable;
5
+ export declare const LANGUAGE: AIVariable;
6
+ //# sourceMappingURL=code-completion-variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-completion-variables.d.ts","sourceRoot":"","sources":["../../src/browser/code-completion-variables.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAGxE,eAAO,MAAM,IAAI,EAAE,UAIlB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,UAIpB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,UAIpB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,UAItB,CAAC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 Lonti.com Pty Ltd.
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.LANGUAGE = exports.SUFFIX = exports.PREFIX = exports.FILE = void 0;
19
+ const core_1 = require("@theia/core");
20
+ exports.FILE = {
21
+ id: 'codeCompletionFile',
22
+ name: 'codeCompletionFile',
23
+ description: core_1.nls.localize('theia/ai/completion/fileVariable/description', 'The URI of the file being edited. Only available in code completion context.'),
24
+ };
25
+ exports.PREFIX = {
26
+ id: 'codeCompletionPrefix',
27
+ name: 'codeCompletionPrefix',
28
+ description: core_1.nls.localize('theia/ai/completion/prefixVariable/description', 'The code before the current cursor position. Only available in code completion context.'),
29
+ };
30
+ exports.SUFFIX = {
31
+ id: 'codeCompletionSuffix',
32
+ name: 'codeCompletionSuffix',
33
+ description: core_1.nls.localize('theia/ai/completion/suffixVariable/description', 'The code after the current cursor position. Only available in code completion context.'),
34
+ };
35
+ exports.LANGUAGE = {
36
+ id: 'codeCompletionLanguage',
37
+ name: 'codeCompletionLanguage',
38
+ description: core_1.nls.localize('theia/ai/completion/languageVariable/description', 'The languageId of the file being edited. Only available in code completion context.'),
39
+ };
40
+ //# sourceMappingURL=code-completion-variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-completion-variables.js","sourceRoot":"","sources":["../../src/browser/code-completion-variables.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,wCAAwC;AACxC,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,sCAAkC;AAErB,QAAA,IAAI,GAAe;IAC5B,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,8CAA8C,EAAE,8EAA8E,CAAC;CAC5J,CAAC;AAEW,QAAA,MAAM,GAAe;IAC9B,EAAE,EAAE,sBAAsB;IAC1B,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,gDAAgD,EAAE,yFAAyF,CAAC;CACzK,CAAC;AAEW,QAAA,MAAM,GAAe;IAC9B,EAAE,EAAE,sBAAsB;IAC1B,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,gDAAgD,EAAE,wFAAwF,CAAC;CACxK,CAAC;AAEW,QAAA,QAAQ,GAAe;IAChC,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAAE,qFAAqF,CAAC;CACvK,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { PreferenceSchema } from '@theia/core';
2
+ export declare const PREF_AI_INLINE_COMPLETION_AUTOMATIC_ENABLE = "ai-features.codeCompletion.automaticCodeCompletion";
3
+ export declare const PREF_AI_INLINE_COMPLETION_DEBOUNCE_DELAY = "ai-features.codeCompletion.debounceDelay";
4
+ export declare const PREF_AI_INLINE_COMPLETION_EXCLUDED_EXTENSIONS = "ai-features.codeCompletion.excludedFileExtensions";
5
+ export declare const PREF_AI_INLINE_COMPLETION_MAX_CONTEXT_LINES = "ai-features.codeCompletion.maxContextLines";
6
+ export declare const PREF_AI_INLINE_COMPLETION_STRIP_BACKTICKS = "ai-features.codeCompletion.stripBackticks";
7
+ export declare const PREF_AI_INLINE_COMPLETION_CACHE_CAPACITY = "ai-features.codeCompletion.cacheCapacity";
8
+ export declare const AICodeCompletionPreferencesSchema: PreferenceSchema;
9
+ //# sourceMappingURL=ai-code-completion-preference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-preference.d.ts","sourceRoot":"","sources":["../../src/common/ai-code-completion-preference.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAO,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,0CAA0C,uDAAuD,CAAC;AAC/G,eAAO,MAAM,wCAAwC,6CAA6C,CAAC;AACnG,eAAO,MAAM,6CAA6C,sDAAsD,CAAC;AACjH,eAAO,MAAM,2CAA2C,+CAA+C,CAAC;AACxG,eAAO,MAAM,yCAAyC,8CAA8C,CAAC;AACrG,eAAO,MAAM,wCAAwC,6CAA6C,CAAC;AAEnG,eAAO,MAAM,iCAAiC,EAAE,gBAuD/C,CAAC"}
@@ -0,0 +1,78 @@
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_CACHE_CAPACITY = exports.PREF_AI_INLINE_COMPLETION_STRIP_BACKTICKS = exports.PREF_AI_INLINE_COMPLETION_MAX_CONTEXT_LINES = exports.PREF_AI_INLINE_COMPLETION_EXCLUDED_EXTENSIONS = exports.PREF_AI_INLINE_COMPLETION_DEBOUNCE_DELAY = exports.PREF_AI_INLINE_COMPLETION_AUTOMATIC_ENABLE = void 0;
19
+ const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
20
+ const core_1 = require("@theia/core");
21
+ exports.PREF_AI_INLINE_COMPLETION_AUTOMATIC_ENABLE = 'ai-features.codeCompletion.automaticCodeCompletion';
22
+ exports.PREF_AI_INLINE_COMPLETION_DEBOUNCE_DELAY = 'ai-features.codeCompletion.debounceDelay';
23
+ exports.PREF_AI_INLINE_COMPLETION_EXCLUDED_EXTENSIONS = 'ai-features.codeCompletion.excludedFileExtensions';
24
+ exports.PREF_AI_INLINE_COMPLETION_MAX_CONTEXT_LINES = 'ai-features.codeCompletion.maxContextLines';
25
+ exports.PREF_AI_INLINE_COMPLETION_STRIP_BACKTICKS = 'ai-features.codeCompletion.stripBackticks';
26
+ exports.PREF_AI_INLINE_COMPLETION_CACHE_CAPACITY = 'ai-features.codeCompletion.cacheCapacity';
27
+ exports.AICodeCompletionPreferencesSchema = {
28
+ properties: {
29
+ [exports.PREF_AI_INLINE_COMPLETION_AUTOMATIC_ENABLE]: {
30
+ title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
31
+ type: 'boolean',
32
+ description: core_1.nls.localize('theia/ai/completion/automaticEnable/description', 'Automatically trigger AI completions inline within any (Monaco) editor while editing.\
33
+ \n\
34
+ Alternatively, you can manually trigger the code via the command "Trigger Inline Suggestion" or the default shortcut "Ctrl+Alt+Space".'),
35
+ default: false
36
+ },
37
+ [exports.PREF_AI_INLINE_COMPLETION_DEBOUNCE_DELAY]: {
38
+ title: core_1.nls.localize('theia/ai/completion/debounceDelay/title', 'Debounce Delay'),
39
+ type: 'number',
40
+ description: core_1.nls.localize('theia/ai/completion/debounceDelay/description', 'Controls the delay in milliseconds before triggering AI completions after changes have been detected in the editor.\
41
+ Requires `Automatic Code Completion` to be enabled. Enter 0 to disable the debounce delay.'),
42
+ default: 300
43
+ },
44
+ [exports.PREF_AI_INLINE_COMPLETION_EXCLUDED_EXTENSIONS]: {
45
+ title: core_1.nls.localize('theia/ai/completion/excludedFileExts/title', 'Excluded File Extensions'),
46
+ type: 'array',
47
+ description: core_1.nls.localize('theia/ai/completion/excludedFileExts/description', 'Specify file extensions (e.g., .md, .txt) where AI completions should be disabled.'),
48
+ items: {
49
+ type: 'string'
50
+ },
51
+ default: []
52
+ },
53
+ [exports.PREF_AI_INLINE_COMPLETION_MAX_CONTEXT_LINES]: {
54
+ title: core_1.nls.localize('theia/ai/completion/maxContextLines/title', 'Maximum Context Lines'),
55
+ type: 'number',
56
+ description: core_1.nls.localize('theia/ai/completion/maxContextLines/description', 'The maximum number of lines used as context, distributed among the lines before and after the cursor position (prefix and suffix).\
57
+ Set this to -1 to use the full file as context without any line limit and 0 to only use the current line.'),
58
+ default: -1,
59
+ minimum: -1
60
+ },
61
+ [exports.PREF_AI_INLINE_COMPLETION_STRIP_BACKTICKS]: {
62
+ title: core_1.nls.localize('theia/ai/completion/stripBackticks/title', 'Strip Backticks from Inline Completions'),
63
+ type: 'boolean',
64
+ description: core_1.nls.localize('theia/ai/completion/stripBackticks/description', 'Remove surrounding backticks from the code returned by some LLMs. If a backtick is detected, all content after the closing\
65
+ backtick is stripped as well. This setting helps ensure plain code is returned when language models use markdown-like formatting.'),
66
+ default: true
67
+ },
68
+ [exports.PREF_AI_INLINE_COMPLETION_CACHE_CAPACITY]: {
69
+ title: core_1.nls.localize('theia/ai/completion/cacheCapacity/title', 'Code Completion Cache Capacity'),
70
+ type: 'number',
71
+ description: core_1.nls.localize('theia/ai/completion/cacheCapacity/description', 'Maximum number of code completions to store in the cache. A higher number can improve performance but will consume more memory.\
72
+ Minimum value is 10, recommended range is between 50-200.'),
73
+ default: 100,
74
+ minimum: 10
75
+ }
76
+ }
77
+ };
78
+ //# sourceMappingURL=ai-code-completion-preference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-preference.js","sourceRoot":"","sources":["../../src/common/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;;;AAEhF,uFAA0F;AAC1F,sCAAoD;AAEvC,QAAA,0CAA0C,GAAG,oDAAoD,CAAC;AAClG,QAAA,wCAAwC,GAAG,0CAA0C,CAAC;AACtF,QAAA,6CAA6C,GAAG,mDAAmD,CAAC;AACpG,QAAA,2CAA2C,GAAG,4CAA4C,CAAC;AAC3F,QAAA,yCAAyC,GAAG,2CAA2C,CAAC;AACxF,QAAA,wCAAwC,GAAG,0CAA0C,CAAC;AAEtF,QAAA,iCAAiC,GAAqB;IAC/D,UAAU,EAAE;QACR,CAAC,kDAA0C,CAAC,EAAE;YAC1C,KAAK,EAAE,+CAAyB;YAChC,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,iDAAiD,EACvE;;mJAEmI,CAAC;YACxI,OAAO,EAAE,KAAK;SACjB;QACD,CAAC,gDAAwC,CAAC,EAAE;YACxC,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,yCAAyC,EAAE,gBAAgB,CAAC;YAChF,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,+CAA+C,EACrE;2GAC2F,CAAC;YAChG,OAAO,EAAE,GAAG;SACf;QACD,CAAC,qDAA6C,CAAC,EAAE;YAC7C,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAAE,0BAA0B,CAAC;YAC7F,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAAE,oFAAoF,CAAC;YACnK,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;YACD,OAAO,EAAE,EAAE;SACd;QACD,CAAC,mDAA2C,CAAC,EAAE;YAC3C,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,2CAA2C,EAAE,uBAAuB,CAAC;YACzF,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,iDAAiD,EACvE;sHACsG,CAAC;YAC3G,OAAO,EAAE,CAAC,CAAC;YACX,OAAO,EAAE,CAAC,CAAC;SACd;QACD,CAAC,iDAAyC,CAAC,EAAE;YACzC,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,0CAA0C,EAAE,yCAAyC,CAAC;YAC1G,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,gDAAgD,EACtE;+IAC+H,CAAC;YACpI,OAAO,EAAE,IAAI;SAChB;QACD,CAAC,gDAAwC,CAAC,EAAE;YACxC,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,yCAAyC,EAAE,gCAAgC,CAAC;YAChG,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,+CAA+C,EACrE;0EAC0D,CAAC;YAC/D,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,EAAE;SACd;KACJ;CACJ,CAAC"}
@@ -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-backend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/ai-code-completion-backend-module.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAG/D,wBAEG"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 STMicroelectronics and others.
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 ai_code_completion_preference_1 = require("../common/ai-code-completion-preference");
21
+ exports.default = new inversify_1.ContainerModule(bind => {
22
+ bind(core_1.PreferenceContribution).toConstantValue({ schema: ai_code_completion_preference_1.AICodeCompletionPreferencesSchema });
23
+ });
24
+ //# sourceMappingURL=ai-code-completion-backend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-code-completion-backend-module.js","sourceRoot":"","sources":["../../src/node/ai-code-completion-backend-module.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,sCAAqD;AACrD,4DAA+D;AAC/D,2FAA4F;AAE5F,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6BAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,iEAAiC,EAAE,CAAC,CAAC;AAChG,CAAC,CAAC,CAAC"}
@@ -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 CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@theia/ai-code-completion",
3
- "version": "1.67.0-next.56+d8f18cc386c",
3
+ "version": "1.67.0-next.59+3f14297ea",
4
4
  "description": "Theia - AI Core",
5
5
  "dependencies": {
6
- "@theia/ai-core": "1.67.0-next.56+d8f18cc386c",
7
- "@theia/core": "1.67.0-next.56+d8f18cc386c",
8
- "@theia/filesystem": "1.67.0-next.56+d8f18cc386c",
6
+ "@theia/ai-core": "1.67.0-next.59+3f14297ea",
7
+ "@theia/core": "1.67.0-next.59+3f14297ea",
8
+ "@theia/filesystem": "1.67.0-next.59+3f14297ea",
9
9
  "@theia/monaco-editor-core": "1.96.302",
10
- "@theia/output": "1.67.0-next.56+d8f18cc386c",
11
- "@theia/workspace": "1.67.0-next.56+d8f18cc386c",
10
+ "@theia/output": "1.67.0-next.59+3f14297ea",
11
+ "@theia/workspace": "1.67.0-next.59+3f14297ea",
12
12
  "tslib": "^2.6.2"
13
13
  },
14
14
  "main": "lib/common",
@@ -51,5 +51,5 @@
51
51
  "nyc": {
52
52
  "extends": "../../configs/nyc.json"
53
53
  },
54
- "gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
54
+ "gitHead": "3f14297ea2edcdb1fffd74afee0613e70b43e125"
55
55
  }