@theia/ai-core 1.75.0-next.3 → 1.75.0-next.35
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.
- package/lib/browser/ai-settings-service.js +1 -0
- package/lib/browser/ai-settings-service.js.map +1 -1
- package/lib/browser/frontend-language-model-registry.d.ts +2 -0
- package/lib/browser/frontend-language-model-registry.d.ts.map +1 -1
- package/lib/browser/frontend-language-model-registry.js +22 -1
- package/lib/browser/frontend-language-model-registry.js.map +1 -1
- package/lib/browser/prompt-variable-contribution.d.ts +1 -1
- package/lib/browser/prompt-variable-contribution.d.ts.map +1 -1
- package/lib/browser/prompt-variable-contribution.js +1 -0
- package/lib/browser/prompt-variable-contribution.js.map +1 -1
- package/lib/browser/skill-prompt-coordinator.d.ts +3 -1
- package/lib/browser/skill-prompt-coordinator.d.ts.map +1 -1
- package/lib/browser/skill-prompt-coordinator.js +13 -7
- package/lib/browser/skill-prompt-coordinator.js.map +1 -1
- package/lib/browser/skill-service.d.ts.map +1 -1
- package/lib/browser/skill-service.js +1 -1
- package/lib/browser/skill-service.js.map +1 -1
- package/lib/browser/skills-variable-contribution.js +1 -0
- package/lib/browser/skills-variable-contribution.js.map +1 -1
- package/lib/common/ai-variable-resource.d.ts +2 -1
- package/lib/common/ai-variable-resource.d.ts.map +1 -1
- package/lib/common/ai-variable-resource.js +6 -1
- package/lib/common/ai-variable-resource.js.map +1 -1
- package/lib/common/capability-variable-contribution.d.ts +1 -1
- package/lib/common/capability-variable-contribution.d.ts.map +1 -1
- package/lib/common/capability-variable-contribution.js +1 -0
- package/lib/common/capability-variable-contribution.js.map +1 -1
- package/lib/common/language-model.d.ts +1 -1
- package/lib/common/language-model.d.ts.map +1 -1
- package/lib/common/language-model.js +3 -2
- package/lib/common/language-model.js.map +1 -1
- package/lib/common/prompt-service.js +1 -0
- package/lib/common/prompt-service.js.map +1 -1
- package/lib/common/tool-invocation-registry.d.ts +2 -1
- package/lib/common/tool-invocation-registry.d.ts.map +1 -1
- package/lib/common/tool-invocation-registry.js +6 -1
- package/lib/common/tool-invocation-registry.js.map +1 -1
- package/lib/node/language-model-frontend-delegate.d.ts +2 -2
- package/lib/node/language-model-frontend-delegate.d.ts.map +1 -1
- package/lib/node/language-model-frontend-delegate.js +1 -0
- package/lib/node/language-model-frontend-delegate.js.map +1 -1
- package/package.json +11 -11
- package/src/browser/ai-settings-service.ts +2 -2
- package/src/browser/frontend-language-model-registry.ts +6 -2
- package/src/browser/prompt-variable-contribution.ts +3 -3
- package/src/browser/skill-prompt-coordinator.ts +12 -10
- package/src/browser/skill-service.ts +1 -2
- package/src/browser/skills-variable-contribution.ts +2 -2
- package/src/common/ai-variable-resource.ts +6 -3
- package/src/common/capability-variable-contribution.ts +3 -3
- package/src/common/language-model.ts +6 -4
- package/src/common/prompt-service.ts +2 -2
- package/src/common/tool-invocation-registry.ts +5 -2
- package/src/node/language-model-frontend-delegate.ts +3 -3
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
import { ILogger, nls } from '@theia/core';
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import * as monaco from '@theia/monaco-editor-core';
|
|
19
19
|
import {
|
|
20
20
|
AIVariable,
|
|
@@ -49,8 +49,8 @@ export class CapabilityVariableContribution implements AIVariableContribution, A
|
|
|
49
49
|
@inject(PromptService)
|
|
50
50
|
protected readonly promptService: PromptService;
|
|
51
51
|
|
|
52
|
-
@inject(ILogger)
|
|
53
|
-
protected logger: ILogger;
|
|
52
|
+
@inject(ILogger) @named('ai-core:CapabilityVariableContribution')
|
|
53
|
+
protected readonly logger: ILogger;
|
|
54
54
|
|
|
55
55
|
registerVariables(service: AIVariableService): void {
|
|
56
56
|
service.registerResolver(CAPABILITY_VARIABLE, this);
|
|
@@ -703,8 +703,10 @@ export interface FrontendLanguageModelRegistry extends LanguageModelRegistry {
|
|
|
703
703
|
|
|
704
704
|
@injectable()
|
|
705
705
|
export class DefaultLanguageModelRegistryImpl implements LanguageModelRegistry {
|
|
706
|
-
|
|
707
|
-
|
|
706
|
+
|
|
707
|
+
@inject(ILogger) @named('ai-core:DefaultLanguageModelRegistryImpl')
|
|
708
|
+
protected readonly logger: ILogger;
|
|
709
|
+
|
|
708
710
|
@inject(ContributionProvider) @named(LanguageModelProvider)
|
|
709
711
|
protected readonly languageModelContributions: ContributionProvider<LanguageModelProvider>;
|
|
710
712
|
|
|
@@ -735,7 +737,7 @@ export class DefaultLanguageModelRegistryImpl implements LanguageModelRegistry {
|
|
|
735
737
|
addLanguageModels(models: LanguageModel[]): void {
|
|
736
738
|
models.forEach(model => {
|
|
737
739
|
if (this.languageModels.find(lm => lm.id === model.id)) {
|
|
738
|
-
|
|
740
|
+
this.logger.warn(`Tried to add already existing language model with id ${model.id}. The new model will be ignored.`);
|
|
739
741
|
return;
|
|
740
742
|
}
|
|
741
743
|
this.languageModels.push(model);
|
|
@@ -762,7 +764,7 @@ export class DefaultLanguageModelRegistryImpl implements LanguageModelRegistry {
|
|
|
762
764
|
this.languageModels.splice(index, 1);
|
|
763
765
|
this.changeEmitter.fire({ models: this.languageModels });
|
|
764
766
|
} else {
|
|
765
|
-
|
|
767
|
+
this.logger.warn(`Language model with id ${id} was requested to be removed, however it does not exist`);
|
|
766
768
|
}
|
|
767
769
|
});
|
|
768
770
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { Event, Emitter, URI, ILogger, DisposableCollection } from '@theia/core';
|
|
18
|
-
import { inject, injectable, optional, postConstruct } from '@theia/core/shared/inversify';
|
|
18
|
+
import { inject, injectable, optional, postConstruct, named } from '@theia/core/shared/inversify';
|
|
19
19
|
import { AIVariableArg, AIVariableContext, AIVariableService, createAIResolveVariableCache, ResolvedAIVariable } from './variable-service';
|
|
20
20
|
import { ToolInvocationRegistry } from './tool-invocation-registry';
|
|
21
21
|
import { toolRequestToPromptText } from './language-model-util';
|
|
@@ -607,7 +607,7 @@ export interface PromptService {
|
|
|
607
607
|
|
|
608
608
|
@injectable()
|
|
609
609
|
export class PromptServiceImpl implements PromptService {
|
|
610
|
-
@inject(ILogger)
|
|
610
|
+
@inject(ILogger) @named('ai-core:PromptServiceImpl')
|
|
611
611
|
protected readonly logger: ILogger;
|
|
612
612
|
|
|
613
613
|
@inject(AISettingsService) @optional()
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { inject, injectable, named, postConstruct, interfaces } from '@theia/core/shared/inversify';
|
|
18
18
|
import { ToolRequest } from './language-model';
|
|
19
|
-
import { ContributionProvider, Emitter, Event } from '@theia/core';
|
|
19
|
+
import { ContributionProvider, Emitter, Event, ILogger } from '@theia/core';
|
|
20
20
|
|
|
21
21
|
export const ToolInvocationRegistry = Symbol('ToolInvocationRegistry');
|
|
22
22
|
|
|
@@ -99,6 +99,9 @@ export class ToolInvocationRegistryImpl implements ToolInvocationRegistry {
|
|
|
99
99
|
@named(ToolProvider)
|
|
100
100
|
private providers: ContributionProvider<ToolProvider>;
|
|
101
101
|
|
|
102
|
+
@inject(ILogger) @named('ai-core:ToolInvocationRegistryImpl')
|
|
103
|
+
protected readonly logger: ILogger;
|
|
104
|
+
|
|
102
105
|
@postConstruct()
|
|
103
106
|
init(): void {
|
|
104
107
|
this.providers.getContributions().forEach(provider => {
|
|
@@ -135,7 +138,7 @@ export class ToolInvocationRegistryImpl implements ToolInvocationRegistry {
|
|
|
135
138
|
|
|
136
139
|
registerTool(tool: ToolRequest): void {
|
|
137
140
|
if (this.tools.has(tool.id)) {
|
|
138
|
-
|
|
141
|
+
this.logger.warn(`Function with id ${tool.id} is already registered.`);
|
|
139
142
|
} else {
|
|
140
143
|
this.tools.set(tool.id, tool);
|
|
141
144
|
this.onDidChangeEmitter.fire();
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
17
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { CancellationToken, CancellationTokenSource, ILogger, generateUuid } from '@theia/core';
|
|
19
19
|
import {
|
|
20
20
|
LanguageModelMetaData,
|
|
@@ -53,8 +53,8 @@ export class LanguageModelFrontendDelegateImpl implements LanguageModelFrontendD
|
|
|
53
53
|
@inject(LanguageModelRegistry)
|
|
54
54
|
private registry: LanguageModelRegistry;
|
|
55
55
|
|
|
56
|
-
@inject(ILogger)
|
|
57
|
-
|
|
56
|
+
@inject(ILogger) @named('ai-core:LanguageModelFrontendDelegateImpl')
|
|
57
|
+
protected readonly logger: ILogger;
|
|
58
58
|
|
|
59
59
|
private frontendDelegateClient: LanguageModelDelegateClient;
|
|
60
60
|
private requestCancellationTokenMap: Map<string, CancellationTokenSource> = new Map();
|