@theia/ai-core-ui 1.77.0-next.95 → 1.77.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.
- package/lib/browser/ai-configuration/ai-configuration-category-registry.d.ts +1 -1
- package/lib/browser/ai-configuration/ai-configuration-category-registry.d.ts.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-category-registry.js +11 -15
- package/lib/browser/ai-configuration/ai-configuration-category-registry.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.js +35 -38
- package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-category.d.ts +1 -1
- package/lib/browser/ai-configuration/ai-configuration-category.d.ts.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-category.js +7 -10
- package/lib/browser/ai-configuration/ai-configuration-category.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-selection-model.d.ts +1 -1
- package/lib/browser/ai-configuration/ai-configuration-selection-model.d.ts.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-selection-model.js +7 -10
- package/lib/browser/ai-configuration/ai-configuration-selection-model.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.js +26 -32
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.js +20 -22
- package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-components.spec.js +175 -178
- package/lib/browser/ai-configuration/components/ai-configuration-components.spec.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-controls.js +26 -39
- package/lib/browser/ai-configuration/components/ai-configuration-controls.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.d.ts +2 -2
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.d.ts.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.js +14 -19
- package/lib/browser/ai-configuration/components/ai-configuration-item-row.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.js +18 -23
- package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.d.ts +2 -2
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.d.ts.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.js +23 -38
- package/lib/browser/ai-configuration/components/ai-configuration-primitives.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-configuration-setting-row.js +23 -30
- package/lib/browser/ai-configuration/components/ai-configuration-setting-row.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-settings-row-service.d.ts +2 -2
- package/lib/browser/ai-configuration/components/ai-settings-row-service.d.ts.map +1 -1
- package/lib/browser/ai-configuration/components/ai-settings-row-service.js +38 -46
- package/lib/browser/ai-configuration/components/ai-settings-row-service.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.js +72 -74
- package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.js.map +1 -1
- package/lib/browser/ai-configuration/components/ai-settings-row.d.ts +2 -2
- package/lib/browser/ai-configuration/components/ai-settings-row.d.ts.map +1 -1
- package/lib/browser/ai-configuration/components/ai-settings-row.js +15 -21
- package/lib/browser/ai-configuration/components/ai-settings-row.js.map +1 -1
- package/lib/browser/ai-configuration/components/collapsible-list.d.ts +1 -1
- package/lib/browser/ai-configuration/components/collapsible-list.d.ts.map +1 -1
- package/lib/browser/ai-configuration/components/collapsible-list.js +15 -21
- package/lib/browser/ai-configuration/components/collapsible-list.js.map +1 -1
- package/lib/browser/ai-configuration/components/prompt-customization-dialogs.js +13 -16
- package/lib/browser/ai-configuration/components/prompt-customization-dialogs.js.map +1 -1
- package/lib/browser/ai-configuration/components/variant-set-card.d.ts +1 -1
- package/lib/browser/ai-configuration/components/variant-set-card.d.ts.map +1 -1
- package/lib/browser/ai-configuration/components/variant-set-card.js +29 -34
- package/lib/browser/ai-configuration/components/variant-set-card.js.map +1 -1
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.d.ts +1 -1
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.d.ts.map +1 -1
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.js +13 -17
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.js.map +1 -1
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.js +18 -20
- package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.js.map +1 -1
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.d.ts +1 -1
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.d.ts.map +1 -1
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.js +3 -7
- package/lib/browser/ai-configuration/renderers/single-page-category-renderer.js.map +1 -1
- package/lib/browser/ai-core-ui-frontend-module.js +18 -20
- package/lib/browser/ai-core-ui-frontend-module.js.map +1 -1
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.js +1 -1
- package/lib/package.spec.js.map +1 -1
- package/package.json +14 -6
- package/src/browser/ai-configuration/ai-configuration-category-registry.spec.ts +2 -2
- package/src/browser/ai-configuration/ai-configuration-category-registry.ts +1 -1
- package/src/browser/ai-configuration/ai-configuration-category.ts +1 -1
- package/src/browser/ai-configuration/ai-configuration-selection-model.ts +1 -1
- package/src/browser/ai-configuration/ai-configuration-setting-commands.spec.ts +1 -1
- package/src/browser/ai-configuration/components/ai-configuration-components.spec.ts +9 -9
- package/src/browser/ai-configuration/components/ai-configuration-item-row.tsx +4 -4
- package/src/browser/ai-configuration/components/ai-configuration-primitives.tsx +2 -2
- package/src/browser/ai-configuration/components/ai-configuration-setting-row.tsx +1 -1
- package/src/browser/ai-configuration/components/ai-settings-row-service.spec.ts +1 -1
- package/src/browser/ai-configuration/components/ai-settings-row-service.ts +2 -2
- package/src/browser/ai-configuration/components/ai-settings-row.tsx +4 -4
- package/src/browser/ai-configuration/components/collapsible-list.tsx +2 -2
- package/src/browser/ai-configuration/components/variant-set-card.tsx +5 -5
- package/src/browser/ai-configuration/renderers/collection-category-renderer.spec.ts +2 -2
- package/src/browser/ai-configuration/renderers/collection-category-renderer.tsx +3 -3
- package/src/browser/ai-configuration/renderers/single-page-category-renderer.tsx +1 -1
- package/src/browser/ai-core-ui-frontend-module.ts +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContributionProvider, Emitter, Event } from '@theia/core';
|
|
2
|
-
import { AiConfigurationCategory, AiConfigurationSearchItem } from './ai-configuration-category';
|
|
2
|
+
import { AiConfigurationCategory, AiConfigurationSearchItem } from './ai-configuration-category.js';
|
|
3
3
|
/**
|
|
4
4
|
* Collects all contributed {@link AiConfigurationCategory} instances and exposes
|
|
5
5
|
* them ordered for the AI Configuration view. Refires an aggregated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-category-registry.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category-registry.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ai-configuration-category-registry.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category-registry.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEpG;;;;GAIG;AACH,qBACa,+BAA+B;IAGxC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAEhF,SAAS,CAAC,QAAQ,CAAC,kBAAkB,gBAAuB;IAC5D;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAG/B;IAEF,SAAS,CAAC,KAAK,UAAS;IAExB,0GAA0G;IAC1G,SAAS,CAAC,IAAI,IAAI,IAAI;IAUtB;;;OAGG;IACH,aAAa,IAAI,uBAAuB,EAAE;IAW1C,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAI5D,2EAA2E;IAC3E,cAAc,IAAI,yBAAyB,EAAE;CAGhD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
3
|
//
|
|
@@ -14,12 +13,10 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const ai_configuration_category_1 = require("./ai-configuration-category");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { ContributionProvider, Emitter } from '@theia/core';
|
|
18
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
19
|
+
import { AiConfigurationCategory } from './ai-configuration-category.js';
|
|
23
20
|
/**
|
|
24
21
|
* Collects all contributed {@link AiConfigurationCategory} instances and exposes
|
|
25
22
|
* them ordered for the AI Configuration view. Refires an aggregated
|
|
@@ -27,7 +24,7 @@ const ai_configuration_category_1 = require("./ai-configuration-category");
|
|
|
27
24
|
*/
|
|
28
25
|
let AiConfigurationCategoryRegistry = class AiConfigurationCategoryRegistry {
|
|
29
26
|
constructor() {
|
|
30
|
-
this.onDidChangeEmitter = new
|
|
27
|
+
this.onDidChangeEmitter = new Emitter();
|
|
31
28
|
/**
|
|
32
29
|
* Wires the aggregation lazily on first listen rather than in `@postConstruct`: a category may itself
|
|
33
30
|
* inject this registry (e.g. to navigate across categories), so resolving all contributions during the
|
|
@@ -71,13 +68,12 @@ let AiConfigurationCategoryRegistry = class AiConfigurationCategoryRegistry {
|
|
|
71
68
|
return this.getCategories().flatMap(category => category.search?.getSearchItems() ?? []);
|
|
72
69
|
}
|
|
73
70
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
(
|
|
77
|
-
(0, inversify_1.named)(ai_configuration_category_1.AiConfigurationCategory),
|
|
78
|
-
tslib_1.__metadata("design:type", Object)
|
|
71
|
+
__decorate([
|
|
72
|
+
inject(ContributionProvider),
|
|
73
|
+
named(AiConfigurationCategory)
|
|
79
74
|
], AiConfigurationCategoryRegistry.prototype, "contributions", void 0);
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
AiConfigurationCategoryRegistry = __decorate([
|
|
76
|
+
injectable()
|
|
82
77
|
], AiConfigurationCategoryRegistry);
|
|
78
|
+
export { AiConfigurationCategoryRegistry };
|
|
83
79
|
//# sourceMappingURL=ai-configuration-category-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-category-registry.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-configuration-category-registry.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category-registry.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,8BA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C;YACD,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC;IAED,WAAW,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACtF,CAAC;IAED,2EAA2E;IAC3E,cAAc;QACV,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;CACJ,CAAA;AAjDsB;IADlB,MAAM,CAAC,oBAAoB,CAAC;IAAE,KAAK,CAAC,uBAAuB,CAAC;sEACmB;AAHvE,+BAA+B;IAD3C,UAAU,EAAE;GACA,+BAA+B,CAoD3C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
3
|
//
|
|
@@ -14,15 +13,14 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const ai_configuration_category_registry_1 = require("./ai-configuration-category-registry");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import 'reflect-metadata';
|
|
18
|
+
import { expect } from 'chai';
|
|
19
|
+
import { Emitter } from '@theia/core';
|
|
20
|
+
import { Container, ContainerModule, inject, injectable } from '@theia/core/shared/inversify';
|
|
21
|
+
import { bindContributionProvider } from '@theia/core/lib/common';
|
|
22
|
+
import { AiConfigurationCategory } from './ai-configuration-category.js';
|
|
23
|
+
import { AiConfigurationCategoryRegistry } from './ai-configuration-category-registry.js';
|
|
26
24
|
class DummyCategory {
|
|
27
25
|
constructor(id, order, contributed, searchItems = []) {
|
|
28
26
|
this.id = id;
|
|
@@ -30,7 +28,7 @@ class DummyCategory {
|
|
|
30
28
|
this.contributed = contributed;
|
|
31
29
|
this.searchItems = searchItems;
|
|
32
30
|
this.renderer = {};
|
|
33
|
-
this.onDidChangeEmitter = new
|
|
31
|
+
this.onDidChangeEmitter = new Emitter();
|
|
34
32
|
this.onDidChange = this.onDidChangeEmitter.event;
|
|
35
33
|
this.label = this.id;
|
|
36
34
|
this.iconClass = 'codicon codicon-gear';
|
|
@@ -45,39 +43,39 @@ class DummyCategory {
|
|
|
45
43
|
}
|
|
46
44
|
describe('AiConfigurationCategoryRegistry', () => {
|
|
47
45
|
function createRegistry(...categories) {
|
|
48
|
-
const container = new
|
|
49
|
-
container.load(new
|
|
50
|
-
|
|
51
|
-
categories.forEach(category => bind(
|
|
52
|
-
bind(
|
|
46
|
+
const container = new Container();
|
|
47
|
+
container.load(new ContainerModule(bind => {
|
|
48
|
+
bindContributionProvider(bind, AiConfigurationCategory);
|
|
49
|
+
categories.forEach(category => bind(AiConfigurationCategory).toConstantValue(category));
|
|
50
|
+
bind(AiConfigurationCategoryRegistry).toSelf().inSingletonScope();
|
|
53
51
|
}));
|
|
54
|
-
return container.get(
|
|
52
|
+
return container.get(AiConfigurationCategoryRegistry);
|
|
55
53
|
}
|
|
56
54
|
it('resolves to an empty list when nothing is contributed', () => {
|
|
57
55
|
const registry = createRegistry();
|
|
58
|
-
|
|
56
|
+
expect(registry.getCategories()).to.deep.equal([]);
|
|
59
57
|
});
|
|
60
58
|
it('aggregates an empty search index when nothing is contributed', () => {
|
|
61
59
|
const registry = createRegistry();
|
|
62
|
-
|
|
60
|
+
expect(registry.getSearchItems()).to.deep.equal([]);
|
|
63
61
|
});
|
|
64
62
|
it('orders categories ascending by order', () => {
|
|
65
63
|
const registry = createRegistry(new DummyCategory('c', 300), new DummyCategory('a', 100), new DummyCategory('b', 200));
|
|
66
|
-
|
|
64
|
+
expect(registry.getCategories().map(c => c.id)).to.deep.equal(['a', 'b', 'c']);
|
|
67
65
|
});
|
|
68
66
|
it('sorts contributed categories after all built-ins regardless of order', () => {
|
|
69
67
|
const registry = createRegistry(new DummyCategory('ext', 1, true), new DummyCategory('builtin', 900));
|
|
70
|
-
|
|
68
|
+
expect(registry.getCategories().map(c => c.id)).to.deep.equal(['builtin', 'ext']);
|
|
71
69
|
});
|
|
72
70
|
it('resolves a category by id', () => {
|
|
73
71
|
const registry = createRegistry(new DummyCategory('a', 100), new DummyCategory('b', 200));
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
expect(registry.getCategory('b')?.id).to.equal('b');
|
|
73
|
+
expect(registry.getCategory('missing')).to.equal(undefined);
|
|
76
74
|
});
|
|
77
75
|
it('aggregates the search index across categories that provide one', () => {
|
|
78
76
|
const item = (label, categoryId) => ({ label, typeLabel: 'Setting', categoryId, target: { categoryId } });
|
|
79
77
|
const registry = createRegistry(new DummyCategory('a', 100, false, [item('a1', 'a')]), new DummyCategory('b', 200), new DummyCategory('c', 300, false, [item('c1', 'c'), item('c2', 'c')]));
|
|
80
|
-
|
|
78
|
+
expect(registry.getSearchItems().map(i => i.label)).to.deep.equal(['a1', 'c1', 'c2']);
|
|
81
79
|
});
|
|
82
80
|
it('refires onDidChange when a contributed category changes', () => {
|
|
83
81
|
const category = new DummyCategory('a', 100);
|
|
@@ -85,7 +83,7 @@ describe('AiConfigurationCategoryRegistry', () => {
|
|
|
85
83
|
let fired = 0;
|
|
86
84
|
registry.onDidChange(() => fired++);
|
|
87
85
|
category.fireChange();
|
|
88
|
-
|
|
86
|
+
expect(fired).to.equal(1);
|
|
89
87
|
});
|
|
90
88
|
it('resolves without recursion when a contributed category injects the registry', () => {
|
|
91
89
|
// A category may inject the registry (e.g. to navigate across categories). The registry must not
|
|
@@ -99,24 +97,23 @@ describe('AiConfigurationCategoryRegistry', () => {
|
|
|
99
97
|
this.renderer = {};
|
|
100
98
|
}
|
|
101
99
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
tslib_1.__metadata("design:type", ai_configuration_category_registry_1.AiConfigurationCategoryRegistry)
|
|
100
|
+
__decorate([
|
|
101
|
+
inject(AiConfigurationCategoryRegistry)
|
|
105
102
|
], RegistryInjectingCategory.prototype, "registry", void 0);
|
|
106
|
-
RegistryInjectingCategory =
|
|
107
|
-
|
|
103
|
+
RegistryInjectingCategory = __decorate([
|
|
104
|
+
injectable()
|
|
108
105
|
], RegistryInjectingCategory);
|
|
109
|
-
const container = new
|
|
110
|
-
container.load(new
|
|
111
|
-
|
|
106
|
+
const container = new Container();
|
|
107
|
+
container.load(new ContainerModule(bind => {
|
|
108
|
+
bindContributionProvider(bind, AiConfigurationCategory);
|
|
112
109
|
bind(RegistryInjectingCategory).toSelf().inSingletonScope();
|
|
113
|
-
bind(
|
|
114
|
-
bind(
|
|
110
|
+
bind(AiConfigurationCategory).toService(RegistryInjectingCategory);
|
|
111
|
+
bind(AiConfigurationCategoryRegistry).toSelf().inSingletonScope();
|
|
115
112
|
}));
|
|
116
|
-
const registry = container.get(
|
|
113
|
+
const registry = container.get(AiConfigurationCategoryRegistry);
|
|
117
114
|
// Listening wires the aggregation, which resolves the contribution that injects this very registry.
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
expect(() => registry.onDidChange(() => { })).to.not.throw();
|
|
116
|
+
expect(registry.getCategories().map(category => category.id)).to.deep.equal(['self']);
|
|
120
117
|
});
|
|
121
118
|
});
|
|
122
119
|
//# sourceMappingURL=ai-configuration-category-registry.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-category-registry.spec.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category-registry.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-configuration-category-registry.spec.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category-registry.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAA6B,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAE1F,MAAM,aAAa;IAIf,YACa,EAAU,EACV,KAAc,EACd,WAAqB,EACX,cAA2C,EAAE;QAHvD,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAS;QACd,gBAAW,GAAX,WAAW,CAAU;QACX,gBAAW,GAAX,WAAW,CAAkC;QAP3D,aAAQ,GAAG,EAAE,CAAC;QACJ,uBAAkB,GAAG,IAAI,OAAO,EAAQ,CAAC;QACnD,gBAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;QAO5C,UAAK,GAAG,IAAI,CAAC,EAAE,CAAC;QAChB,cAAS,GAAG,sBAAsB,CAAC;QACnC,SAAI,GAAG,aAAsB,CAAC;IAHnC,CAAC;IAIL,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,C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,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Event } from '@theia/core';
|
|
2
|
-
import type { AiConfigurationOrigin } from './components/ai-configuration-origin-badge';
|
|
2
|
+
import type { AiConfigurationOrigin } from './components/ai-configuration-origin-badge.js';
|
|
3
3
|
/**
|
|
4
4
|
* Contribution point for a category shown in the AI Configuration view.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-category.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ai-configuration-category.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAE3F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG,YAAY,CAAC;AAEvE;;;;;GAKG;AACH,yBAAiB,4BAA4B,CAAC;IACnC,MAAM,OAAO,MAAM,CAAC;IACpB,MAAM,MAAM,MAAM,CAAC;IACnB,MAAM,aAAa,MAAM,CAAC;IAC1B,MAAM,MAAM,MAAM,CAAC;IACnB,MAAM,kBAAkB,MAAM,CAAC;IAC/B,MAAM,eAAe,MAAM,CAAC;IAC5B,MAAM,SAAS,MAAM,CAAC;IACtB,MAAM,WAAW,MAAM,CAA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|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
3
|
//
|
|
@@ -14,8 +13,6 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.AiConfigurationTools = exports.AiConfigurationCategoryId = exports.AiConfigurationCategoryOrder = exports.AiConfigurationCategory = void 0;
|
|
19
16
|
/**
|
|
20
17
|
* Contribution point for a category shown in the AI Configuration view.
|
|
21
18
|
*
|
|
@@ -24,14 +21,14 @@ exports.AiConfigurationTools = exports.AiConfigurationCategoryId = exports.AiCon
|
|
|
24
21
|
* {@link ContributionProvider} and ordered by {@link AiConfigurationCategory.order}
|
|
25
22
|
* by the {@link AiConfigurationCategoryRegistry}.
|
|
26
23
|
*/
|
|
27
|
-
|
|
24
|
+
export const AiConfigurationCategory = Symbol('AiConfigurationCategory');
|
|
28
25
|
/**
|
|
29
26
|
* Spaced ordering scale for the built-in categories, leaving room for
|
|
30
27
|
* future built-ins and extensions to slot in between. Assigned to
|
|
31
28
|
* {@link AiConfigurationCategory.order}. Categories with `contributed: true`
|
|
32
29
|
* always sort after all built-ins, regardless of their `order`.
|
|
33
30
|
*/
|
|
34
|
-
var AiConfigurationCategoryOrder;
|
|
31
|
+
export var AiConfigurationCategoryOrder;
|
|
35
32
|
(function (AiConfigurationCategoryOrder) {
|
|
36
33
|
AiConfigurationCategoryOrder.GENERAL = 100;
|
|
37
34
|
AiConfigurationCategoryOrder.MODELS = 200;
|
|
@@ -43,13 +40,13 @@ var AiConfigurationCategoryOrder;
|
|
|
43
40
|
AiConfigurationCategoryOrder.MCP_SERVERS = 700;
|
|
44
41
|
AiConfigurationCategoryOrder.TOOLS = 800;
|
|
45
42
|
AiConfigurationCategoryOrder.TOKEN_USAGE = 900;
|
|
46
|
-
})(AiConfigurationCategoryOrder || (
|
|
43
|
+
})(AiConfigurationCategoryOrder || (AiConfigurationCategoryOrder = {}));
|
|
47
44
|
/**
|
|
48
45
|
* Canonical ids of the built-in categories. Shared so that the categories
|
|
49
46
|
* (contributed from `ai-ide` and `ai-mcp`), navigation targets, and the legacy
|
|
50
47
|
* `OPEN_AI_CONFIG_VIEW` tab-id mapping all reference the same stable strings.
|
|
51
48
|
*/
|
|
52
|
-
var AiConfigurationCategoryId;
|
|
49
|
+
export var AiConfigurationCategoryId;
|
|
53
50
|
(function (AiConfigurationCategoryId) {
|
|
54
51
|
AiConfigurationCategoryId.GENERAL = 'general';
|
|
55
52
|
AiConfigurationCategoryId.MODELS = 'models';
|
|
@@ -61,13 +58,13 @@ var AiConfigurationCategoryId;
|
|
|
61
58
|
AiConfigurationCategoryId.MCP_SERVERS = 'mcp-servers';
|
|
62
59
|
AiConfigurationCategoryId.TOOLS = 'tools';
|
|
63
60
|
AiConfigurationCategoryId.TOKEN_USAGE = 'token-usage';
|
|
64
|
-
})(AiConfigurationCategoryId || (
|
|
61
|
+
})(AiConfigurationCategoryId || (AiConfigurationCategoryId = {}));
|
|
65
62
|
/**
|
|
66
63
|
* Navigation into the Tools category's per-tool list. Shared here because the lists that link to it are
|
|
67
64
|
* spread across packages (an agent's used tools in `@theia/ai-ide`, a server's tools in `@theia/ai-mcp`)
|
|
68
65
|
* while the page itself lives in `@theia/ai-ide`, which those packages cannot all import.
|
|
69
66
|
*/
|
|
70
|
-
var AiConfigurationTools;
|
|
67
|
+
export var AiConfigurationTools;
|
|
71
68
|
(function (AiConfigurationTools) {
|
|
72
69
|
/**
|
|
73
70
|
* Prefix of the `data-ai-config-row-id` the Tools page puts on each tool row. The tool's registry name
|
|
@@ -82,5 +79,5 @@ var AiConfigurationTools;
|
|
|
82
79
|
};
|
|
83
80
|
}
|
|
84
81
|
AiConfigurationTools.selectionFor = selectionFor;
|
|
85
|
-
})(AiConfigurationTools || (
|
|
82
|
+
})(AiConfigurationTools || (AiConfigurationTools = {}));
|
|
86
83
|
//# sourceMappingURL=ai-configuration-category.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-category.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-configuration-category.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;AAMhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAQzE;;;;;GAKG;AACH,MAAM,KAAW,4BAA4B,CAW5C;AAXD,WAAiB,4BAA4B;IAC5B,oCAAO,GAAG,GAAG,CAAC;IACd,mCAAM,GAAG,GAAG,CAAC;IACb,0CAAa,GAAG,GAAG,CAAC;IACpB,mCAAM,GAAG,GAAG,CAAC;IACb,+CAAkB,GAAG,GAAG,CAAC;IACzB,4CAAe,GAAG,GAAG,CAAC;IACtB,sCAAS,GAAG,GAAG,CAAC;IAChB,wCAAW,GAAG,GAAG,CAAC;IAClB,kCAAK,GAAG,GAAG,CAAC;IACZ,wCAAW,GAAG,GAAG,CAAC;AACnC,CAAC,EAXgB,4BAA4B,KAA5B,4BAA4B,QAW5C;AAED;;;;GAIG;AACH,MAAM,KAAW,yBAAyB,CAWzC;AAXD,WAAiB,yBAAyB;IACzB,iCAAO,GAAG,SAAS,CAAC;IACpB,gCAAM,GAAG,QAAQ,CAAC;IAClB,uCAAa,GAAG,eAAe,CAAC;IAChC,gCAAM,GAAG,QAAQ,CAAC;IAClB,4CAAkB,GAAG,oBAAoB,CAAC;IAC1C,yCAAe,GAAG,iBAAiB,CAAC;IACpC,mCAAS,GAAG,WAAW,CAAC;IACxB,qCAAW,GAAG,aAAa,CAAC;IAC5B,+BAAK,GAAG,OAAO,CAAC;IAChB,qCAAW,GAAG,aAAa,CAAC;AAC7C,CAAC,EAXgB,yBAAyB,KAAzB,yBAAyB,QAWzC;AAED;;;;GAIG;AACH,MAAM,KAAW,oBAAoB,CAcpC;AAdD,WAAiB,oBAAoB;IACjC;;;OAGG;IACU,kCAAa,GAAG,OAAO,CAAC;IAErC,0GAA0G;IAC1G,SAAgB,YAAY,CAAC,QAAgB;QACzC,OAAO;YACH,UAAU,EAAE,yBAAyB,CAAC,KAAK;YAC3C,SAAS,EAAE,EAAE,KAAK,EAAE,qBAAA,aAAa,GAAG,QAAQ,EAAE;SACjD,CAAC;IACN,CAAC;IALe,iCAAY,eAK3B,CAAA;AACL,CAAC,EAdgB,oBAAoB,KAApB,oBAAoB,QAcpC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Emitter, Event } from '@theia/core';
|
|
2
|
-
import { AiConfigurationSelection } from './ai-configuration-category';
|
|
2
|
+
import { AiConfigurationSelection } from './ai-configuration-category.js';
|
|
3
3
|
/**
|
|
4
4
|
* Shared selection bus for the AI Configuration view. The tree, the detail host,
|
|
5
5
|
* and renderers navigate through this single model instead of talking directly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-selection-model.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-selection-model.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ai-configuration-selection-model.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-selection-model.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;;;GAIG;AACH,qBACa,6BAA6B;IAEtC,SAAS,CAAC,SAAS,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAE1D,SAAS,CAAC,QAAQ,CAAC,2BAA2B,gDAAuD;IACrG,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAA0C;IAEpH,YAAY,IAAI,wBAAwB,GAAG,SAAS;IAIpD,MAAM,CAAC,SAAS,EAAE,wBAAwB,GAAG,SAAS,GAAG,IAAI;CAIhE"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
3
|
//
|
|
@@ -14,11 +13,9 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const core_1 = require("@theia/core");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { Emitter } from '@theia/core';
|
|
18
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
22
19
|
/**
|
|
23
20
|
* Shared selection bus for the AI Configuration view. The tree, the detail host,
|
|
24
21
|
* and renderers navigate through this single model instead of talking directly
|
|
@@ -26,7 +23,7 @@ const inversify_1 = require("@theia/core/shared/inversify");
|
|
|
26
23
|
*/
|
|
27
24
|
let AiConfigurationSelectionModel = class AiConfigurationSelectionModel {
|
|
28
25
|
constructor() {
|
|
29
|
-
this.onDidChangeSelectionEmitter = new
|
|
26
|
+
this.onDidChangeSelectionEmitter = new Emitter();
|
|
30
27
|
this.onDidChangeSelection = this.onDidChangeSelectionEmitter.event;
|
|
31
28
|
}
|
|
32
29
|
getSelection() {
|
|
@@ -37,8 +34,8 @@ let AiConfigurationSelectionModel = class AiConfigurationSelectionModel {
|
|
|
37
34
|
this.onDidChangeSelectionEmitter.fire(selection);
|
|
38
35
|
}
|
|
39
36
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
(0, inversify_1.injectable)()
|
|
37
|
+
AiConfigurationSelectionModel = __decorate([
|
|
38
|
+
injectable()
|
|
43
39
|
], AiConfigurationSelectionModel);
|
|
40
|
+
export { AiConfigurationSelectionModel };
|
|
44
41
|
//# sourceMappingURL=ai-configuration-selection-model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-selection-model.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-selection-model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-configuration-selection-model.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-selection-model.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D;;;;GAIG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAAnC;QAIgB,gCAA2B,GAAG,IAAI,OAAO,EAAwC,CAAC;QAC5F,yBAAoB,GAAgD,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC;IAUxH,CAAC;IARG,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,SAA+C;QAClD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACJ,CAAA;AAfY,6BAA6B;IADzC,UAAU,EAAE;GACA,6BAA6B,CAezC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
3
|
//
|
|
@@ -14,17 +13,14 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const core_1 = require("@theia/core");
|
|
23
|
-
const clipboard_service_1 = require("@theia/core/lib/browser/clipboard-service");
|
|
24
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { AiConfigurationService } from '@theia/ai-core';
|
|
18
|
+
import { CommandContribution, MenuContribution, nls } from '@theia/core';
|
|
19
|
+
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
|
|
20
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
25
21
|
/** Context-menu path for the AI Configuration setting-row gear. */
|
|
26
|
-
|
|
27
|
-
var AiConfigurationSettingCommandArgs;
|
|
22
|
+
export const AI_CONFIGURATION_SETTING_CONTEXT_MENU = ['ai-configuration-setting-context-menu'];
|
|
23
|
+
export var AiConfigurationSettingCommandArgs;
|
|
28
24
|
(function (AiConfigurationSettingCommandArgs) {
|
|
29
25
|
/** Preference-backed args: `id` + `scope` present (enables Copy and preference reset). */
|
|
30
26
|
function isPreference(arg) {
|
|
@@ -38,13 +34,13 @@ var AiConfigurationSettingCommandArgs;
|
|
|
38
34
|
return isPreference(arg) || (typeof arg === 'object' && arg !== undefined && typeof arg.reset === 'function');
|
|
39
35
|
}
|
|
40
36
|
AiConfigurationSettingCommandArgs.isResettable = isResettable;
|
|
41
|
-
})(AiConfigurationSettingCommandArgs || (
|
|
42
|
-
var AiConfigurationSettingCommands;
|
|
37
|
+
})(AiConfigurationSettingCommandArgs || (AiConfigurationSettingCommandArgs = {}));
|
|
38
|
+
export var AiConfigurationSettingCommands;
|
|
43
39
|
(function (AiConfigurationSettingCommands) {
|
|
44
|
-
AiConfigurationSettingCommands.RESET = { id: 'ai-configuration.setting.reset', label:
|
|
45
|
-
AiConfigurationSettingCommands.COPY_ID = { id: 'ai-configuration.setting.copyId', label:
|
|
46
|
-
AiConfigurationSettingCommands.COPY_JSON = { id: 'ai-configuration.setting.copyJson', label:
|
|
47
|
-
})(AiConfigurationSettingCommands || (
|
|
40
|
+
AiConfigurationSettingCommands.RESET = { id: 'ai-configuration.setting.reset', label: nls.localizeByDefault('Reset Setting') };
|
|
41
|
+
AiConfigurationSettingCommands.COPY_ID = { id: 'ai-configuration.setting.copyId', label: nls.localizeByDefault('Copy Setting ID') };
|
|
42
|
+
AiConfigurationSettingCommands.COPY_JSON = { id: 'ai-configuration.setting.copyJson', label: nls.localizeByDefault('Copy Setting as JSON') };
|
|
43
|
+
})(AiConfigurationSettingCommands || (AiConfigurationSettingCommands = {}));
|
|
48
44
|
/**
|
|
49
45
|
* Commands + menu for the AI Configuration setting-row gear, mirroring the Settings UI's preference
|
|
50
46
|
* context menu (Reset / Copy Setting ID / Copy as JSON) but backed by {@link AiConfigurationService} and
|
|
@@ -73,26 +69,24 @@ let AiConfigurationSettingCommandContribution = class AiConfigurationSettingComm
|
|
|
73
69
|
});
|
|
74
70
|
}
|
|
75
71
|
registerMenus(menus) {
|
|
76
|
-
menus.registerMenuAction(
|
|
77
|
-
menus.registerMenuAction(
|
|
78
|
-
menus.registerMenuAction(
|
|
72
|
+
menus.registerMenuAction(AI_CONFIGURATION_SETTING_CONTEXT_MENU, { commandId: AiConfigurationSettingCommands.RESET.id, order: 'a' });
|
|
73
|
+
menus.registerMenuAction(AI_CONFIGURATION_SETTING_CONTEXT_MENU, { commandId: AiConfigurationSettingCommands.COPY_ID.id, order: 'b' });
|
|
74
|
+
menus.registerMenuAction(AI_CONFIGURATION_SETTING_CONTEXT_MENU, { commandId: AiConfigurationSettingCommands.COPY_JSON.id, order: 'c' });
|
|
79
75
|
}
|
|
80
76
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(0, inversify_1.inject)(ai_core_1.AiConfigurationService),
|
|
84
|
-
tslib_1.__metadata("design:type", Object)
|
|
77
|
+
__decorate([
|
|
78
|
+
inject(AiConfigurationService)
|
|
85
79
|
], AiConfigurationSettingCommandContribution.prototype, "aiConfigurationService", void 0);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
tslib_1.__metadata("design:type", Object)
|
|
80
|
+
__decorate([
|
|
81
|
+
inject(ClipboardService)
|
|
89
82
|
], AiConfigurationSettingCommandContribution.prototype, "clipboardService", void 0);
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
AiConfigurationSettingCommandContribution = __decorate([
|
|
84
|
+
injectable()
|
|
92
85
|
], AiConfigurationSettingCommandContribution);
|
|
93
|
-
|
|
86
|
+
export { AiConfigurationSettingCommandContribution };
|
|
87
|
+
export function bindAiConfigurationSettingCommands(bind) {
|
|
94
88
|
bind(AiConfigurationSettingCommandContribution).toSelf().inSingletonScope();
|
|
95
|
-
bind(
|
|
96
|
-
bind(
|
|
89
|
+
bind(CommandContribution).toService(AiConfigurationSettingCommandContribution);
|
|
90
|
+
bind(MenuContribution).toService(AiConfigurationSettingCommandContribution);
|
|
97
91
|
}
|
|
98
92
|
//# sourceMappingURL=ai-configuration-setting-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-configuration-setting-commands.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-setting-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-configuration-setting-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
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource and others.
|
|
4
3
|
//
|
|
@@ -14,14 +13,13 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const ai_configuration_setting_commands_1 = require("./ai-configuration-setting-commands");
|
|
16
|
+
import { expect } from 'chai';
|
|
17
|
+
import { PreferenceScope } from '@theia/core';
|
|
18
|
+
import { AiConfigurationSettingCommandContribution, AiConfigurationSettingCommands } from './ai-configuration-setting-commands.js';
|
|
21
19
|
function setup() {
|
|
22
20
|
const setCalls = [];
|
|
23
21
|
const copied = [];
|
|
24
|
-
const contribution = new
|
|
22
|
+
const contribution = new AiConfigurationSettingCommandContribution();
|
|
25
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
24
|
contribution.aiConfigurationService = {
|
|
27
25
|
set: (id, value, scope, resourceUri) => { setCalls.push([id, value, scope, resourceUri]); return Promise.resolve(); }
|
|
@@ -32,39 +30,39 @@ function setup() {
|
|
|
32
30
|
contribution.registerCommands({ registerCommand: (command, handler) => handlers.set(command.id, handler) });
|
|
33
31
|
return { handlers, setCalls, copied };
|
|
34
32
|
}
|
|
35
|
-
const args = { id: 'ai-features.chat.foo', value: true, scope:
|
|
33
|
+
const args = { id: 'ai-features.chat.foo', value: true, scope: PreferenceScope.User };
|
|
36
34
|
describe('AiConfigurationSettingCommandContribution', () => {
|
|
37
35
|
it('resets a setting in the row scope via AiConfigurationService (not the Settings widget)', () => {
|
|
38
36
|
const { handlers, setCalls } = setup();
|
|
39
|
-
handlers.get(
|
|
40
|
-
|
|
37
|
+
handlers.get(AiConfigurationSettingCommands.RESET.id).execute({ ...args, scope: PreferenceScope.Workspace, resourceUri: 'file:///ws' });
|
|
38
|
+
expect(setCalls).to.deep.equal([['ai-features.chat.foo', undefined, PreferenceScope.Workspace, 'file:///ws']]);
|
|
41
39
|
});
|
|
42
40
|
it('resets via the supplied callback for non-preference (e.g. per-agent) rows, without touching AiConfigurationService', () => {
|
|
43
41
|
const { handlers, setCalls } = setup();
|
|
44
42
|
let called = 0;
|
|
45
|
-
const reset = handlers.get(
|
|
46
|
-
|
|
43
|
+
const reset = handlers.get(AiConfigurationSettingCommands.RESET.id);
|
|
44
|
+
expect(reset.isVisible({ reset: () => called++ })).to.equal(true);
|
|
47
45
|
reset.execute({ reset: () => called++ });
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
expect(called).to.equal(1);
|
|
47
|
+
expect(setCalls).to.be.empty;
|
|
50
48
|
});
|
|
51
49
|
it('hides the copy commands for non-preference (callback-only) rows', () => {
|
|
52
50
|
const { handlers } = setup();
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
expect(handlers.get(AiConfigurationSettingCommands.COPY_ID.id).isVisible({ reset: () => undefined })).to.equal(false);
|
|
52
|
+
expect(handlers.get(AiConfigurationSettingCommands.COPY_JSON.id).isVisible({ reset: () => undefined })).to.equal(false);
|
|
55
53
|
});
|
|
56
54
|
it('copies the setting id and the JSON entry', () => {
|
|
57
55
|
const { handlers, copied } = setup();
|
|
58
|
-
handlers.get(
|
|
59
|
-
handlers.get(
|
|
60
|
-
|
|
56
|
+
handlers.get(AiConfigurationSettingCommands.COPY_ID.id).execute(args);
|
|
57
|
+
handlers.get(AiConfigurationSettingCommands.COPY_JSON.id).execute(args);
|
|
58
|
+
expect(copied).to.deep.equal(['ai-features.chat.foo', '"ai-features.chat.foo": true']);
|
|
61
59
|
});
|
|
62
60
|
it('guards the commands against malformed arguments', () => {
|
|
63
61
|
const { handlers } = setup();
|
|
64
|
-
const reset = handlers.get(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
const reset = handlers.get(AiConfigurationSettingCommands.RESET.id);
|
|
63
|
+
expect(reset.isVisible(args)).to.equal(true);
|
|
64
|
+
expect(reset.isVisible({ id: 'x' })).to.equal(false); // missing scope
|
|
65
|
+
expect(reset.isVisible(undefined)).to.equal(false);
|
|
68
66
|
});
|
|
69
67
|
});
|
|
70
68
|
//# sourceMappingURL=ai-configuration-setting-commands.spec.js.map
|