@theia/ai-core-ui 1.75.0-next.8 → 1.75.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 (113) hide show
  1. package/lib/browser/ai-configuration/ai-configuration-category-registry.d.ts +29 -0
  2. package/lib/browser/ai-configuration/ai-configuration-category-registry.d.ts.map +1 -0
  3. package/lib/browser/ai-configuration/ai-configuration-category-registry.js +83 -0
  4. package/lib/browser/ai-configuration/ai-configuration-category-registry.js.map +1 -0
  5. package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.d.ts +2 -0
  6. package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.d.ts.map +1 -0
  7. package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.js +122 -0
  8. package/lib/browser/ai-configuration/ai-configuration-category-registry.spec.js.map +1 -0
  9. package/lib/browser/ai-configuration/ai-configuration-category.d.ts +204 -0
  10. package/lib/browser/ai-configuration/ai-configuration-category.d.ts.map +1 -0
  11. package/lib/browser/ai-configuration/ai-configuration-category.js +86 -0
  12. package/lib/browser/ai-configuration/ai-configuration-category.js.map +1 -0
  13. package/lib/browser/ai-configuration/ai-configuration-selection-model.d.ts +15 -0
  14. package/lib/browser/ai-configuration/ai-configuration-selection-model.d.ts.map +1 -0
  15. package/lib/browser/ai-configuration/ai-configuration-selection-model.js +44 -0
  16. package/lib/browser/ai-configuration/ai-configuration-selection-model.js.map +1 -0
  17. package/lib/browser/ai-configuration/ai-configuration-setting-commands.d.ts +48 -0
  18. package/lib/browser/ai-configuration/ai-configuration-setting-commands.d.ts.map +1 -0
  19. package/lib/browser/ai-configuration/ai-configuration-setting-commands.js +98 -0
  20. package/lib/browser/ai-configuration/ai-configuration-setting-commands.js.map +1 -0
  21. package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.d.ts +2 -0
  22. package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.d.ts.map +1 -0
  23. package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.js +70 -0
  24. package/lib/browser/ai-configuration/ai-configuration-setting-commands.spec.js.map +1 -0
  25. package/lib/browser/ai-configuration/components/ai-configuration-components.spec.d.ts +2 -0
  26. package/lib/browser/ai-configuration/components/ai-configuration-components.spec.d.ts.map +1 -0
  27. package/lib/browser/ai-configuration/components/ai-configuration-components.spec.js +596 -0
  28. package/lib/browser/ai-configuration/components/ai-configuration-components.spec.js.map +1 -0
  29. package/lib/browser/ai-configuration/components/ai-configuration-controls.d.ts +118 -0
  30. package/lib/browser/ai-configuration/components/ai-configuration-controls.d.ts.map +1 -0
  31. package/lib/browser/ai-configuration/components/ai-configuration-controls.js +191 -0
  32. package/lib/browser/ai-configuration/components/ai-configuration-controls.js.map +1 -0
  33. package/lib/browser/ai-configuration/components/ai-configuration-item-row.d.ts +57 -0
  34. package/lib/browser/ai-configuration/components/ai-configuration-item-row.d.ts.map +1 -0
  35. package/lib/browser/ai-configuration/components/ai-configuration-item-row.js +48 -0
  36. package/lib/browser/ai-configuration/components/ai-configuration-item-row.js.map +1 -0
  37. package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.d.ts +49 -0
  38. package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.d.ts.map +1 -0
  39. package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.js +79 -0
  40. package/lib/browser/ai-configuration/components/ai-configuration-origin-badge.js.map +1 -0
  41. package/lib/browser/ai-configuration/components/ai-configuration-primitives.d.ts +161 -0
  42. package/lib/browser/ai-configuration/components/ai-configuration-primitives.d.ts.map +1 -0
  43. package/lib/browser/ai-configuration/components/ai-configuration-primitives.js +131 -0
  44. package/lib/browser/ai-configuration/components/ai-configuration-primitives.js.map +1 -0
  45. package/lib/browser/ai-configuration/components/ai-configuration-setting-row.d.ts +54 -0
  46. package/lib/browser/ai-configuration/components/ai-configuration-setting-row.d.ts.map +1 -0
  47. package/lib/browser/ai-configuration/components/ai-configuration-setting-row.js +77 -0
  48. package/lib/browser/ai-configuration/components/ai-configuration-setting-row.js.map +1 -0
  49. package/lib/browser/ai-configuration/components/ai-settings-row-service.d.ts +194 -0
  50. package/lib/browser/ai-configuration/components/ai-settings-row-service.d.ts.map +1 -0
  51. package/lib/browser/ai-configuration/components/ai-settings-row-service.js +352 -0
  52. package/lib/browser/ai-configuration/components/ai-settings-row-service.js.map +1 -0
  53. package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.d.ts +2 -0
  54. package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.d.ts.map +1 -0
  55. package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.js +233 -0
  56. package/lib/browser/ai-configuration/components/ai-settings-row-service.spec.js.map +1 -0
  57. package/lib/browser/ai-configuration/components/ai-settings-row.d.ts +50 -0
  58. package/lib/browser/ai-configuration/components/ai-settings-row.d.ts.map +1 -0
  59. package/lib/browser/ai-configuration/components/ai-settings-row.js +85 -0
  60. package/lib/browser/ai-configuration/components/ai-settings-row.js.map +1 -0
  61. package/lib/browser/ai-configuration/components/collapsible-list.d.ts +65 -0
  62. package/lib/browser/ai-configuration/components/collapsible-list.d.ts.map +1 -0
  63. package/lib/browser/ai-configuration/components/collapsible-list.js +82 -0
  64. package/lib/browser/ai-configuration/components/collapsible-list.js.map +1 -0
  65. package/lib/browser/ai-configuration/components/prompt-customization-dialogs.d.ts +35 -0
  66. package/lib/browser/ai-configuration/components/prompt-customization-dialogs.d.ts.map +1 -0
  67. package/lib/browser/ai-configuration/components/prompt-customization-dialogs.js +83 -0
  68. package/lib/browser/ai-configuration/components/prompt-customization-dialogs.js.map +1 -0
  69. package/lib/browser/ai-configuration/components/variant-set-card.d.ts +25 -0
  70. package/lib/browser/ai-configuration/components/variant-set-card.d.ts.map +1 -0
  71. package/lib/browser/ai-configuration/components/variant-set-card.js +133 -0
  72. package/lib/browser/ai-configuration/components/variant-set-card.js.map +1 -0
  73. package/lib/browser/ai-configuration/renderers/collection-category-renderer.d.ts +44 -0
  74. package/lib/browser/ai-configuration/renderers/collection-category-renderer.d.ts.map +1 -0
  75. package/lib/browser/ai-configuration/renderers/collection-category-renderer.js +106 -0
  76. package/lib/browser/ai-configuration/renderers/collection-category-renderer.js.map +1 -0
  77. package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.d.ts +2 -0
  78. package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.d.ts.map +1 -0
  79. package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.js +120 -0
  80. package/lib/browser/ai-configuration/renderers/collection-category-renderer.spec.js.map +1 -0
  81. package/lib/browser/ai-configuration/renderers/single-page-category-renderer.d.ts +15 -0
  82. package/lib/browser/ai-configuration/renderers/single-page-category-renderer.d.ts.map +1 -0
  83. package/lib/browser/ai-configuration/renderers/single-page-category-renderer.js +20 -0
  84. package/lib/browser/ai-configuration/renderers/single-page-category-renderer.js.map +1 -0
  85. package/lib/browser/ai-core-ui-frontend-module.d.ts +1 -0
  86. package/lib/browser/ai-core-ui-frontend-module.d.ts.map +1 -1
  87. package/lib/browser/ai-core-ui-frontend-module.js +11 -0
  88. package/lib/browser/ai-core-ui-frontend-module.js.map +1 -1
  89. package/package.json +6 -5
  90. package/src/browser/ai-configuration/ai-configuration-category-registry.spec.ts +137 -0
  91. package/src/browser/ai-configuration/ai-configuration-category-registry.ts +79 -0
  92. package/src/browser/ai-configuration/ai-configuration-category.ts +246 -0
  93. package/src/browser/ai-configuration/ai-configuration-selection-model.ts +42 -0
  94. package/src/browser/ai-configuration/ai-configuration-setting-commands.spec.ts +82 -0
  95. package/src/browser/ai-configuration/ai-configuration-setting-commands.ts +104 -0
  96. package/src/browser/ai-configuration/components/ai-configuration-components.spec.ts +655 -0
  97. package/src/browser/ai-configuration/components/ai-configuration-controls.tsx +382 -0
  98. package/src/browser/ai-configuration/components/ai-configuration-item-row.tsx +127 -0
  99. package/src/browser/ai-configuration/components/ai-configuration-origin-badge.tsx +114 -0
  100. package/src/browser/ai-configuration/components/ai-configuration-primitives.tsx +359 -0
  101. package/src/browser/ai-configuration/components/ai-configuration-setting-row.tsx +154 -0
  102. package/src/browser/ai-configuration/components/ai-settings-row-service.spec.ts +275 -0
  103. package/src/browser/ai-configuration/components/ai-settings-row-service.ts +401 -0
  104. package/src/browser/ai-configuration/components/ai-settings-row.tsx +176 -0
  105. package/src/browser/ai-configuration/components/collapsible-list.tsx +205 -0
  106. package/src/browser/ai-configuration/components/prompt-customization-dialogs.ts +89 -0
  107. package/src/browser/ai-configuration/components/variant-set-card.tsx +200 -0
  108. package/src/browser/ai-configuration/renderers/collection-category-renderer.spec.ts +126 -0
  109. package/src/browser/ai-configuration/renderers/collection-category-renderer.tsx +164 -0
  110. package/src/browser/ai-configuration/renderers/single-page-category-renderer.tsx +41 -0
  111. package/src/browser/ai-core-ui-frontend-module.ts +14 -1
  112. package/src/browser/style/ai-configuration-components.css +1410 -0
  113. package/src/browser/style/index.css +17 -0
@@ -0,0 +1,29 @@
1
+ import { ContributionProvider, Emitter, Event } from '@theia/core';
2
+ import { AiConfigurationCategory, AiConfigurationSearchItem } from './ai-configuration-category';
3
+ /**
4
+ * Collects all contributed {@link AiConfigurationCategory} instances and exposes
5
+ * them ordered for the AI Configuration view. Refires an aggregated
6
+ * {@link onDidChange} whenever any category changes.
7
+ */
8
+ export declare class AiConfigurationCategoryRegistry {
9
+ protected readonly contributions: ContributionProvider<AiConfigurationCategory>;
10
+ protected readonly onDidChangeEmitter: Emitter<void>;
11
+ /**
12
+ * Wires the aggregation lazily on first listen rather than in `@postConstruct`: a category may itself
13
+ * inject this registry (e.g. to navigate across categories), so resolving all contributions during the
14
+ * registry's own construction would create a dependency cycle.
15
+ */
16
+ readonly onDidChange: Event<void>;
17
+ protected wired: boolean;
18
+ /** Subscribes once to every category's own change event so this registry can refire an aggregated one. */
19
+ protected wire(): void;
20
+ /**
21
+ * Returns the categories ordered ascending by {@link AiConfigurationCategory.order}
22
+ * (defaulting to `0`); `contributed` categories always sort after built-ins.
23
+ */
24
+ getCategories(): AiConfigurationCategory[];
25
+ getCategory(id: string): AiConfigurationCategory | undefined;
26
+ /** Aggregated deep-search index across all categories that provide one. */
27
+ getSearchItems(): AiConfigurationSearchItem[];
28
+ }
29
+ //# sourceMappingURL=ai-configuration-category-registry.d.ts.map
@@ -0,0 +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,6BAA6B,CAAC;AAEjG;;;;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"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource 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
+ exports.AiConfigurationCategoryRegistry = 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_configuration_category_1 = require("./ai-configuration-category");
23
+ /**
24
+ * Collects all contributed {@link AiConfigurationCategory} instances and exposes
25
+ * them ordered for the AI Configuration view. Refires an aggregated
26
+ * {@link onDidChange} whenever any category changes.
27
+ */
28
+ let AiConfigurationCategoryRegistry = class AiConfigurationCategoryRegistry {
29
+ constructor() {
30
+ this.onDidChangeEmitter = new core_1.Emitter();
31
+ /**
32
+ * Wires the aggregation lazily on first listen rather than in `@postConstruct`: a category may itself
33
+ * inject this registry (e.g. to navigate across categories), so resolving all contributions during the
34
+ * registry's own construction would create a dependency cycle.
35
+ */
36
+ this.onDidChange = (listener, thisArgs, disposables) => {
37
+ this.wire();
38
+ return this.onDidChangeEmitter.event(listener, thisArgs, disposables);
39
+ };
40
+ this.wired = false;
41
+ }
42
+ /** Subscribes once to every category's own change event so this registry can refire an aggregated one. */
43
+ wire() {
44
+ if (this.wired) {
45
+ return;
46
+ }
47
+ this.wired = true;
48
+ for (const category of this.contributions.getContributions()) {
49
+ category.onDidChange?.(() => this.onDidChangeEmitter.fire());
50
+ }
51
+ }
52
+ /**
53
+ * Returns the categories ordered ascending by {@link AiConfigurationCategory.order}
54
+ * (defaulting to `0`); `contributed` categories always sort after built-ins.
55
+ */
56
+ getCategories() {
57
+ return this.contributions.getContributions().slice().sort((a, b) => {
58
+ const contributedA = a.contributed ? 1 : 0;
59
+ const contributedB = b.contributed ? 1 : 0;
60
+ if (contributedA !== contributedB) {
61
+ return contributedA - contributedB;
62
+ }
63
+ return (a.order ?? 0) - (b.order ?? 0);
64
+ });
65
+ }
66
+ getCategory(id) {
67
+ return this.contributions.getContributions().find(category => category.id === id);
68
+ }
69
+ /** Aggregated deep-search index across all categories that provide one. */
70
+ getSearchItems() {
71
+ return this.getCategories().flatMap(category => category.search?.getSearchItems() ?? []);
72
+ }
73
+ };
74
+ exports.AiConfigurationCategoryRegistry = AiConfigurationCategoryRegistry;
75
+ tslib_1.__decorate([
76
+ (0, inversify_1.inject)(core_1.ContributionProvider),
77
+ (0, inversify_1.named)(ai_configuration_category_1.AiConfigurationCategory),
78
+ tslib_1.__metadata("design:type", Object)
79
+ ], AiConfigurationCategoryRegistry.prototype, "contributions", void 0);
80
+ exports.AiConfigurationCategoryRegistry = AiConfigurationCategoryRegistry = tslib_1.__decorate([
81
+ (0, inversify_1.injectable)()
82
+ ], AiConfigurationCategoryRegistry);
83
+ //# sourceMappingURL=ai-configuration-category-registry.js.map
@@ -0,0 +1 @@
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,sCAAmE;AACnE,4DAAyE;AACzE,2EAAiG;AAEjG;;;;GAIG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAArC;QAKgB,uBAAkB,GAAG,IAAI,cAAO,EAAQ,CAAC;QAC5D;;;;WAIG;QACM,gBAAW,GAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE;YACpE,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC1E,CAAC,CA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,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;CACJ,CAAA;AApDY,0EAA+B;AAGrB;IADlB,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,mDAAuB,CAAC;;sEACmB;0CAHvE,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAoD3C"}
@@ -0,0 +1,2 @@
1
+ import 'reflect-metadata';
2
+ //# sourceMappingURL=ai-configuration-category-registry.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-configuration-category-registry.spec.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-category-registry.spec.ts"],"names":[],"mappings":"AAgBA,OAAO,kBAAkB,CAAC"}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource 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 tslib_1 = require("tslib");
19
+ require("reflect-metadata");
20
+ const chai_1 = require("chai");
21
+ const core_1 = require("@theia/core");
22
+ const inversify_1 = require("@theia/core/shared/inversify");
23
+ const common_1 = require("@theia/core/lib/common");
24
+ const ai_configuration_category_1 = require("./ai-configuration-category");
25
+ const ai_configuration_category_registry_1 = require("./ai-configuration-category-registry");
26
+ class DummyCategory {
27
+ constructor(id, order, contributed, searchItems = []) {
28
+ this.id = id;
29
+ this.order = order;
30
+ this.contributed = contributed;
31
+ this.searchItems = searchItems;
32
+ this.renderer = {};
33
+ this.onDidChangeEmitter = new core_1.Emitter();
34
+ this.onDidChange = this.onDidChangeEmitter.event;
35
+ this.label = this.id;
36
+ this.iconClass = 'codicon codicon-gear';
37
+ this.kind = 'single-page';
38
+ }
39
+ get search() {
40
+ return this.searchItems.length ? { getSearchItems: () => this.searchItems } : undefined;
41
+ }
42
+ fireChange() {
43
+ this.onDidChangeEmitter.fire();
44
+ }
45
+ }
46
+ describe('AiConfigurationCategoryRegistry', () => {
47
+ function createRegistry(...categories) {
48
+ const container = new inversify_1.Container();
49
+ container.load(new inversify_1.ContainerModule(bind => {
50
+ (0, common_1.bindContributionProvider)(bind, ai_configuration_category_1.AiConfigurationCategory);
51
+ categories.forEach(category => bind(ai_configuration_category_1.AiConfigurationCategory).toConstantValue(category));
52
+ bind(ai_configuration_category_registry_1.AiConfigurationCategoryRegistry).toSelf().inSingletonScope();
53
+ }));
54
+ return container.get(ai_configuration_category_registry_1.AiConfigurationCategoryRegistry);
55
+ }
56
+ it('resolves to an empty list when nothing is contributed', () => {
57
+ const registry = createRegistry();
58
+ (0, chai_1.expect)(registry.getCategories()).to.deep.equal([]);
59
+ });
60
+ it('aggregates an empty search index when nothing is contributed', () => {
61
+ const registry = createRegistry();
62
+ (0, chai_1.expect)(registry.getSearchItems()).to.deep.equal([]);
63
+ });
64
+ it('orders categories ascending by order', () => {
65
+ const registry = createRegistry(new DummyCategory('c', 300), new DummyCategory('a', 100), new DummyCategory('b', 200));
66
+ (0, chai_1.expect)(registry.getCategories().map(c => c.id)).to.deep.equal(['a', 'b', 'c']);
67
+ });
68
+ it('sorts contributed categories after all built-ins regardless of order', () => {
69
+ const registry = createRegistry(new DummyCategory('ext', 1, true), new DummyCategory('builtin', 900));
70
+ (0, chai_1.expect)(registry.getCategories().map(c => c.id)).to.deep.equal(['builtin', 'ext']);
71
+ });
72
+ it('resolves a category by id', () => {
73
+ const registry = createRegistry(new DummyCategory('a', 100), new DummyCategory('b', 200));
74
+ (0, chai_1.expect)(registry.getCategory('b')?.id).to.equal('b');
75
+ (0, chai_1.expect)(registry.getCategory('missing')).to.equal(undefined);
76
+ });
77
+ it('aggregates the search index across categories that provide one', () => {
78
+ const item = (label, categoryId) => ({ label, typeLabel: 'Setting', categoryId, target: { categoryId } });
79
+ 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
+ (0, chai_1.expect)(registry.getSearchItems().map(i => i.label)).to.deep.equal(['a1', 'c1', 'c2']);
81
+ });
82
+ it('refires onDidChange when a contributed category changes', () => {
83
+ const category = new DummyCategory('a', 100);
84
+ const registry = createRegistry(category);
85
+ let fired = 0;
86
+ registry.onDidChange(() => fired++);
87
+ category.fireChange();
88
+ (0, chai_1.expect)(fired).to.equal(1);
89
+ });
90
+ it('resolves without recursion when a contributed category injects the registry', () => {
91
+ // A category may inject the registry (e.g. to navigate across categories). The registry must not
92
+ // resolve its contributions during its own construction, or that closes a dependency cycle.
93
+ let RegistryInjectingCategory = class RegistryInjectingCategory {
94
+ constructor() {
95
+ this.id = 'self';
96
+ this.label = 'self';
97
+ this.iconClass = 'codicon codicon-gear';
98
+ this.kind = 'single-page';
99
+ this.renderer = {};
100
+ }
101
+ };
102
+ tslib_1.__decorate([
103
+ (0, inversify_1.inject)(ai_configuration_category_registry_1.AiConfigurationCategoryRegistry),
104
+ tslib_1.__metadata("design:type", ai_configuration_category_registry_1.AiConfigurationCategoryRegistry)
105
+ ], RegistryInjectingCategory.prototype, "registry", void 0);
106
+ RegistryInjectingCategory = tslib_1.__decorate([
107
+ (0, inversify_1.injectable)()
108
+ ], RegistryInjectingCategory);
109
+ const container = new inversify_1.Container();
110
+ container.load(new inversify_1.ContainerModule(bind => {
111
+ (0, common_1.bindContributionProvider)(bind, ai_configuration_category_1.AiConfigurationCategory);
112
+ bind(RegistryInjectingCategory).toSelf().inSingletonScope();
113
+ bind(ai_configuration_category_1.AiConfigurationCategory).toService(RegistryInjectingCategory);
114
+ bind(ai_configuration_category_registry_1.AiConfigurationCategoryRegistry).toSelf().inSingletonScope();
115
+ }));
116
+ const registry = container.get(ai_configuration_category_registry_1.AiConfigurationCategoryRegistry);
117
+ // Listening wires the aggregation, which resolves the contribution that injects this very registry.
118
+ (0, chai_1.expect)(() => registry.onDidChange(() => { })).to.not.throw();
119
+ (0, chai_1.expect)(registry.getCategories().map(category => category.id)).to.deep.equal(['self']);
120
+ });
121
+ });
122
+ //# sourceMappingURL=ai-configuration-category-registry.spec.js.map
@@ -0,0 +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":";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,4BAA0B;AAE1B,+BAA8B;AAC9B,sCAAsC;AACtC,4DAA8F;AAC9F,mDAAkE;AAClE,2EAAiG;AACjG,6FAAuF;AAEvF,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,cAAO,EAAQ,CAAC;QACnD,gBAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;QAO5C,UAAK,GAAG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AAC,CAAC;QAChE,oGAAoG;QACpG,IAAA,aAAM,EAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QAC7D,IAAA,aAAM,EAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,204 @@
1
+ import { Event } from '@theia/core';
2
+ import type { AiConfigurationOrigin } from './components/ai-configuration-origin-badge';
3
+ /**
4
+ * Contribution point for a category shown in the AI Configuration view.
5
+ *
6
+ * Both built-in and externally contributed categories use this identical path;
7
+ * there is no privileged API. Categories are collected via a
8
+ * {@link ContributionProvider} and ordered by {@link AiConfigurationCategory.order}
9
+ * by the {@link AiConfigurationCategoryRegistry}.
10
+ */
11
+ export declare const AiConfigurationCategory: unique symbol;
12
+ /**
13
+ * A `single-page` category renders one detail page; a `collection` category
14
+ * exposes tree children and renders an overview plus (optionally) per-item detail.
15
+ */
16
+ export type AiConfigurationCategoryKind = 'single-page' | 'collection';
17
+ /**
18
+ * Spaced ordering scale for the built-in categories, leaving room for
19
+ * future built-ins and extensions to slot in between. Assigned to
20
+ * {@link AiConfigurationCategory.order}. Categories with `contributed: true`
21
+ * always sort after all built-ins, regardless of their `order`.
22
+ */
23
+ export declare namespace AiConfigurationCategoryOrder {
24
+ const GENERAL = 100;
25
+ const MODELS = 200;
26
+ const MODEL_ALIASES = 300;
27
+ const AGENTS = 400;
28
+ const PROMPTS_AND_SKILLS = 500;
29
+ const PROMPT_SNIPPETS = 550;
30
+ const VARIABLES = 600;
31
+ const MCP_SERVERS = 700;
32
+ const TOOLS = 800;
33
+ const TOKEN_USAGE = 900;
34
+ }
35
+ /**
36
+ * Canonical ids of the built-in categories. Shared so that the categories
37
+ * (contributed from `ai-ide` and `ai-mcp`), navigation targets, and the legacy
38
+ * `OPEN_AI_CONFIG_VIEW` tab-id mapping all reference the same stable strings.
39
+ */
40
+ export declare namespace AiConfigurationCategoryId {
41
+ const GENERAL = "general";
42
+ const MODELS = "models";
43
+ const MODEL_ALIASES = "model-aliases";
44
+ const AGENTS = "agents";
45
+ const PROMPTS_AND_SKILLS = "prompts-and-skills";
46
+ const PROMPT_SNIPPETS = "prompt-snippets";
47
+ const VARIABLES = "variables";
48
+ const MCP_SERVERS = "mcp-servers";
49
+ const TOOLS = "tools";
50
+ const TOKEN_USAGE = "token-usage";
51
+ }
52
+ /**
53
+ * Navigation into the Tools category's per-tool list. Shared here because the lists that link to it are
54
+ * spread across packages (an agent's used tools in `@theia/ai-ide`, a server's tools in `@theia/ai-mcp`)
55
+ * while the page itself lives in `@theia/ai-ide`, which those packages cannot all import.
56
+ */
57
+ export declare namespace AiConfigurationTools {
58
+ /**
59
+ * Prefix of the `data-ai-config-row-id` the Tools page puts on each tool row. The tool's registry name
60
+ * completes it — for an MCP tool that is `mcp_<server>_<tool>`, not the bare name shown per server.
61
+ */
62
+ const ROW_ID_PREFIX = "tool:";
63
+ /** Navigation target that scrolls to and flashes `toolName`'s row, where its confirmation mode is set. */
64
+ function selectionFor(toolName: string): AiConfigurationSelection;
65
+ }
66
+ /**
67
+ * The scope a category's settings are read from and written to.
68
+ *
69
+ * The view currently always renders the `user` scope; selecting a scope is not implemented yet.
70
+ */
71
+ export type AiConfigurationScope = 'user' | 'workspace' | 'folder';
72
+ export interface AiConfigurationCategory {
73
+ /** Stable id; used as the tree-node id and in navigation targets. */
74
+ readonly id: string;
75
+ /** Localized label shown in the tree and breadcrumb. */
76
+ readonly label: string;
77
+ /** Optional one-line description shown under the category name in the detail-page header. */
78
+ readonly description?: string;
79
+ /** `codicon(...)` class shown in the tree, breadcrumb, and cards. */
80
+ readonly iconClass: string;
81
+ /** Ascending sort; defaults to `0`. Built-ins use a spaced scale. */
82
+ readonly order?: number;
83
+ readonly kind: AiConfigurationCategoryKind;
84
+ /** When `true`, grouped under "Contributed by extensions". Built-ins omit or set `false`. */
85
+ readonly contributed?: boolean;
86
+ readonly renderer: AiConfigurationCategoryRenderer;
87
+ /** Optional: items contributed to the tree-level (deep) search index. */
88
+ readonly search?: AiConfigurationSearchProvider;
89
+ /** Fire to refresh tree children/count badge, overview, and search index. */
90
+ readonly onDidChange?: Event<void>;
91
+ dispose?(): void;
92
+ }
93
+ /**
94
+ * Produces the React nodes that drop into the detail-pane primitives.
95
+ *
96
+ * A `single-page` category implements {@link renderPage}; a `collection`
97
+ * category implements {@link getTreeChildren} + {@link renderOverview} and,
98
+ * optionally, {@link renderItemDetail}.
99
+ */
100
+ export interface AiConfigurationCategoryRenderer {
101
+ /** Single-page body (e.g. General, Models, Prompts & Skills, Tools, Token Usage). */
102
+ renderPage?(ctx: AiConfigurationRenderContext): React.ReactNode;
103
+ /**
104
+ * Collection overview (category node selected): category-level settings +
105
+ * filter slot + item card grid + add action + empty state.
106
+ */
107
+ renderOverview?(ctx: AiConfigurationRenderContext): React.ReactNode;
108
+ /**
109
+ * Collection children (items) shown inline in the tree and mirrored as
110
+ * overview cards. Order is preserved.
111
+ */
112
+ getTreeChildren?(): AiConfigurationTreeItem[];
113
+ /**
114
+ * Collection item detail (child selected). `itemId` is a {@link getTreeChildren} id.
115
+ * Optional: e.g. Variables have no editable detail (read-only card only).
116
+ */
117
+ renderItemDetail?(itemId: string, ctx: AiConfigurationRenderContext): React.ReactNode;
118
+ /**
119
+ * The `ai-features.*` preference ids this category surfaces or manages. Used by the catch-all
120
+ * "Advanced" category to render only the preferences no dedicated category already covers, so that
121
+ * every AI preference stays reachable (AI preferences are hidden from the Settings UI) without being
122
+ * shown twice. Best-effort: a missing id merely shows up in the catch-all too, it is never lost.
123
+ */
124
+ getOwnedPreferenceIds?(): string[];
125
+ /**
126
+ * The "create item" action of a `collection` category (e.g. adding a custom agent or an MCP server).
127
+ * Rendered both on the overview and as an inline action on the category's tree node, so it is reachable
128
+ * without opening the page first. Omit it for categories whose items are not user-created.
129
+ */
130
+ getAddAction?(ctx: AiConfigurationRenderContext): AiConfigurationAddDescriptor | undefined;
131
+ }
132
+ /** A category's "create item" action: what to call it, and what to run. */
133
+ export interface AiConfigurationAddDescriptor {
134
+ readonly label: string;
135
+ readonly iconClass?: string;
136
+ run(): void;
137
+ }
138
+ export interface AiConfigurationTreeItem {
139
+ readonly id: string;
140
+ readonly label: string;
141
+ /**
142
+ * Short labels shown as badges next to the item's name, for what it *is* rather than what it is doing
143
+ * (which is {@link status}). Use {@link origins} for where the item came from, which is a badge of its
144
+ * own kind: it carries an icon and leads somewhere.
145
+ */
146
+ readonly tags?: string[];
147
+ /**
148
+ * Where the item came from, when that is not the user - an AI registry entry, an Agent Plugin. Shown
149
+ * next to the item's name on the overview and, unchanged, on the item's detail header, so that
150
+ * provenance reads the same in both places.
151
+ */
152
+ readonly origins?: AiConfigurationOrigin[];
153
+ /** Status badge shown on the overview card and the item detail header. */
154
+ readonly status?: AiConfigurationItemStatus;
155
+ /** Short text for the overview card. */
156
+ readonly description?: string;
157
+ /** Overrides the category icon for this item, e.g. a per-agent icon. */
158
+ readonly iconClass?: string;
159
+ }
160
+ export interface AiConfigurationItemStatus {
161
+ readonly kind: 'on' | 'off' | 'warn' | 'error';
162
+ /** Short, human-readable badge text, e.g. "Enabled", "Ready". */
163
+ readonly label: string;
164
+ /** Optional longer hover detail; falls back to {@link label}. */
165
+ readonly tooltip?: string;
166
+ }
167
+ export interface AiConfigurationSearchProvider {
168
+ /**
169
+ * Called to (re)build this category's slice of the deep-search index.
170
+ * Rebuilt on the category's `onDidChange`.
171
+ */
172
+ getSearchItems(): AiConfigurationSearchItem[];
173
+ }
174
+ export interface AiConfigurationSearchItem {
175
+ readonly label: string;
176
+ /** Small type badge, e.g. "MCP server", "Prompt", "Setting". */
177
+ readonly typeLabel: string;
178
+ readonly categoryId: string;
179
+ /** Where selecting the result navigates. */
180
+ readonly target: AiConfigurationSelection;
181
+ /** Extra text folded into the match key (ids, descriptions). */
182
+ readonly keywords?: string;
183
+ }
184
+ export interface AiConfigurationSelection {
185
+ readonly categoryId: string;
186
+ /** `undefined` => single-page body / collection overview. */
187
+ readonly itemId?: string;
188
+ /**
189
+ * Optional row/setting to scroll-to and flash after navigating. `rowId` is matched against the
190
+ * `data-ai-config-row-id` attribute the shared setting rows carry.
191
+ */
192
+ readonly highlight?: {
193
+ readonly rowId: string;
194
+ };
195
+ }
196
+ export interface AiConfigurationRenderContext {
197
+ /** Scope the rows read from and write to. Always `user` for now; per-scope editing is not wired up yet. */
198
+ readonly scope: AiConfigurationScope;
199
+ /** Select another node (used by cards, links, "used by" chips). */
200
+ navigate(selection: AiConfigurationSelection): void;
201
+ /** Ask the detail host to re-render the current category body. */
202
+ update(): void;
203
+ }
204
+ //# sourceMappingURL=ai-configuration-category.d.ts.map
@@ -0,0 +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,4CAA4C,CAAC;AAExF;;;;;;;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,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 -0,0 +1,86 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource 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
+ exports.AiConfigurationTools = exports.AiConfigurationCategoryId = exports.AiConfigurationCategoryOrder = exports.AiConfigurationCategory = void 0;
19
+ /**
20
+ * Contribution point for a category shown in the AI Configuration view.
21
+ *
22
+ * Both built-in and externally contributed categories use this identical path;
23
+ * there is no privileged API. Categories are collected via a
24
+ * {@link ContributionProvider} and ordered by {@link AiConfigurationCategory.order}
25
+ * by the {@link AiConfigurationCategoryRegistry}.
26
+ */
27
+ exports.AiConfigurationCategory = Symbol('AiConfigurationCategory');
28
+ /**
29
+ * Spaced ordering scale for the built-in categories, leaving room for
30
+ * future built-ins and extensions to slot in between. Assigned to
31
+ * {@link AiConfigurationCategory.order}. Categories with `contributed: true`
32
+ * always sort after all built-ins, regardless of their `order`.
33
+ */
34
+ var AiConfigurationCategoryOrder;
35
+ (function (AiConfigurationCategoryOrder) {
36
+ AiConfigurationCategoryOrder.GENERAL = 100;
37
+ AiConfigurationCategoryOrder.MODELS = 200;
38
+ AiConfigurationCategoryOrder.MODEL_ALIASES = 300;
39
+ AiConfigurationCategoryOrder.AGENTS = 400;
40
+ AiConfigurationCategoryOrder.PROMPTS_AND_SKILLS = 500;
41
+ AiConfigurationCategoryOrder.PROMPT_SNIPPETS = 550;
42
+ AiConfigurationCategoryOrder.VARIABLES = 600;
43
+ AiConfigurationCategoryOrder.MCP_SERVERS = 700;
44
+ AiConfigurationCategoryOrder.TOOLS = 800;
45
+ AiConfigurationCategoryOrder.TOKEN_USAGE = 900;
46
+ })(AiConfigurationCategoryOrder || (exports.AiConfigurationCategoryOrder = AiConfigurationCategoryOrder = {}));
47
+ /**
48
+ * Canonical ids of the built-in categories. Shared so that the categories
49
+ * (contributed from `ai-ide` and `ai-mcp`), navigation targets, and the legacy
50
+ * `OPEN_AI_CONFIG_VIEW` tab-id mapping all reference the same stable strings.
51
+ */
52
+ var AiConfigurationCategoryId;
53
+ (function (AiConfigurationCategoryId) {
54
+ AiConfigurationCategoryId.GENERAL = 'general';
55
+ AiConfigurationCategoryId.MODELS = 'models';
56
+ AiConfigurationCategoryId.MODEL_ALIASES = 'model-aliases';
57
+ AiConfigurationCategoryId.AGENTS = 'agents';
58
+ AiConfigurationCategoryId.PROMPTS_AND_SKILLS = 'prompts-and-skills';
59
+ AiConfigurationCategoryId.PROMPT_SNIPPETS = 'prompt-snippets';
60
+ AiConfigurationCategoryId.VARIABLES = 'variables';
61
+ AiConfigurationCategoryId.MCP_SERVERS = 'mcp-servers';
62
+ AiConfigurationCategoryId.TOOLS = 'tools';
63
+ AiConfigurationCategoryId.TOKEN_USAGE = 'token-usage';
64
+ })(AiConfigurationCategoryId || (exports.AiConfigurationCategoryId = AiConfigurationCategoryId = {}));
65
+ /**
66
+ * Navigation into the Tools category's per-tool list. Shared here because the lists that link to it are
67
+ * spread across packages (an agent's used tools in `@theia/ai-ide`, a server's tools in `@theia/ai-mcp`)
68
+ * while the page itself lives in `@theia/ai-ide`, which those packages cannot all import.
69
+ */
70
+ var AiConfigurationTools;
71
+ (function (AiConfigurationTools) {
72
+ /**
73
+ * Prefix of the `data-ai-config-row-id` the Tools page puts on each tool row. The tool's registry name
74
+ * completes it — for an MCP tool that is `mcp_<server>_<tool>`, not the bare name shown per server.
75
+ */
76
+ AiConfigurationTools.ROW_ID_PREFIX = 'tool:';
77
+ /** Navigation target that scrolls to and flashes `toolName`'s row, where its confirmation mode is set. */
78
+ function selectionFor(toolName) {
79
+ return {
80
+ categoryId: AiConfigurationCategoryId.TOOLS,
81
+ highlight: { rowId: AiConfigurationTools.ROW_ID_PREFIX + toolName }
82
+ };
83
+ }
84
+ AiConfigurationTools.selectionFor = selectionFor;
85
+ })(AiConfigurationTools || (exports.AiConfigurationTools = AiConfigurationTools = {}));
86
+ //# sourceMappingURL=ai-configuration-category.js.map
@@ -0,0 +1 @@
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;AACU,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAQzE;;;;;GAKG;AACH,IAAiB,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,4CAA5B,4BAA4B,QAW5C;AAED;;;;GAIG;AACH,IAAiB,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,yCAAzB,yBAAyB,QAWzC;AAED;;;;GAIG;AACH,IAAiB,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,oCAApB,oBAAoB,QAcpC"}
@@ -0,0 +1,15 @@
1
+ import { Emitter, Event } from '@theia/core';
2
+ import { AiConfigurationSelection } from './ai-configuration-category';
3
+ /**
4
+ * Shared selection bus for the AI Configuration view. The tree, the detail host,
5
+ * and renderers navigate through this single model instead of talking directly
6
+ * to each other.
7
+ */
8
+ export declare class AiConfigurationSelectionModel {
9
+ protected selection: AiConfigurationSelection | undefined;
10
+ protected readonly onDidChangeSelectionEmitter: Emitter<AiConfigurationSelection | undefined>;
11
+ readonly onDidChangeSelection: Event<AiConfigurationSelection | undefined>;
12
+ getSelection(): AiConfigurationSelection | undefined;
13
+ select(selection: AiConfigurationSelection | undefined): void;
14
+ }
15
+ //# sourceMappingURL=ai-configuration-selection-model.d.ts.map
@@ -0,0 +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,6BAA6B,CAAC;AAEvE;;;;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"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource 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
+ exports.AiConfigurationSelectionModel = 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
+ /**
23
+ * Shared selection bus for the AI Configuration view. The tree, the detail host,
24
+ * and renderers navigate through this single model instead of talking directly
25
+ * to each other.
26
+ */
27
+ let AiConfigurationSelectionModel = class AiConfigurationSelectionModel {
28
+ constructor() {
29
+ this.onDidChangeSelectionEmitter = new core_1.Emitter();
30
+ this.onDidChangeSelection = this.onDidChangeSelectionEmitter.event;
31
+ }
32
+ getSelection() {
33
+ return this.selection;
34
+ }
35
+ select(selection) {
36
+ this.selection = selection;
37
+ this.onDidChangeSelectionEmitter.fire(selection);
38
+ }
39
+ };
40
+ exports.AiConfigurationSelectionModel = AiConfigurationSelectionModel;
41
+ exports.AiConfigurationSelectionModel = AiConfigurationSelectionModel = tslib_1.__decorate([
42
+ (0, inversify_1.injectable)()
43
+ ], AiConfigurationSelectionModel);
44
+ //# sourceMappingURL=ai-configuration-selection-model.js.map
@@ -0,0 +1 @@
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,sCAA6C;AAC7C,4DAA0D;AAG1D;;;;GAIG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAAnC;QAIgB,gCAA2B,GAAG,IAAI,cAAO,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,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAezC"}