@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,48 @@
1
+ import { AiConfigurationService } from '@theia/ai-core';
2
+ import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, PreferenceScope } from '@theia/core';
3
+ import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
4
+ import { interfaces } from '@theia/core/shared/inversify';
5
+ /** Context-menu path for the AI Configuration setting-row gear. */
6
+ export declare const AI_CONFIGURATION_SETTING_CONTEXT_MENU: string[];
7
+ /**
8
+ * Arguments carried by the gear menu's commands. A preference-backed row supplies `id`/`value`/`scope`
9
+ * (Reset writes `undefined` to that scope; Copy uses `id`/`value`). A row backed by non-preference data
10
+ * (e.g. per-agent settings) instead supplies a `reset` callback, so it gets the same gear/Reset affordance
11
+ * without a preference id.
12
+ */
13
+ export interface AiConfigurationSettingCommandArgs {
14
+ readonly id?: string;
15
+ readonly value?: unknown;
16
+ readonly scope?: PreferenceScope;
17
+ readonly resourceUri?: string;
18
+ readonly reset?: () => void;
19
+ }
20
+ export declare namespace AiConfigurationSettingCommandArgs {
21
+ /** Preference-backed args: `id` + `scope` present (enables Copy and preference reset). */
22
+ function isPreference(arg: unknown): arg is AiConfigurationSettingCommandArgs & {
23
+ id: string;
24
+ scope: PreferenceScope;
25
+ };
26
+ /** Resettable args: either preference-backed or carrying a `reset` callback. */
27
+ function isResettable(arg: unknown): arg is AiConfigurationSettingCommandArgs;
28
+ }
29
+ export declare namespace AiConfigurationSettingCommands {
30
+ const RESET: Command;
31
+ const COPY_ID: Command;
32
+ const COPY_JSON: Command;
33
+ }
34
+ /**
35
+ * Commands + menu for the AI Configuration setting-row gear, mirroring the Settings UI's preference
36
+ * context menu (Reset / Copy Setting ID / Copy as JSON) but backed by {@link AiConfigurationService} and
37
+ * acting in the row's own scope. Kept self-contained here rather than reusing the Settings UI's
38
+ * `RESET_PREFERENCE` command, which is bound to the Preferences editor widget (its scope tracker) and
39
+ * misbehaves when invoked from this view.
40
+ */
41
+ export declare class AiConfigurationSettingCommandContribution implements CommandContribution, MenuContribution {
42
+ protected readonly aiConfigurationService: AiConfigurationService;
43
+ protected readonly clipboardService: ClipboardService;
44
+ registerCommands(commands: CommandRegistry): void;
45
+ registerMenus(menus: MenuModelRegistry): void;
46
+ }
47
+ export declare function bindAiConfigurationSettingCommands(bind: interfaces.Bind): void;
48
+ //# sourceMappingURL=ai-configuration-setting-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-configuration-setting-commands.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-setting-commands.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAO,eAAe,EAAE,MAAM,aAAa,CAAC;AACvI,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAsB,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE9E,mEAAmE;AACnE,eAAO,MAAM,qCAAqC,UAA4C,CAAC;AAE/F;;;;;GAKG;AACH,MAAM,WAAW,iCAAiC;IAC9C,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AACD,yBAAiB,iCAAiC,CAAC;IAC/C,0FAA0F;IAC1F,SAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iCAAiC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,eAAe,CAAA;KAAE,CAI5H;IACD,gFAAgF;IAChF,SAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iCAAiC,CAEnF;CACJ;AAED,yBAAiB,8BAA8B,CAAC;IACrC,MAAM,KAAK,EAAE,OAAiG,CAAC;IAC/G,MAAM,OAAO,EAAE,OAAoG,CAAC;IACpH,MAAM,SAAS,EAAE,OAA2G,CAAC;CACvI;AAED;;;;;;GAMG;AACH,qBACa,yCAA0C,YAAW,mBAAmB,EAAE,gBAAgB;IAGnG,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAGlE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAoBjD,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;CAKhD;AAED,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAI9E"}
@@ -0,0 +1,98 @@
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.AiConfigurationSettingCommandContribution = exports.AiConfigurationSettingCommands = exports.AiConfigurationSettingCommandArgs = exports.AI_CONFIGURATION_SETTING_CONTEXT_MENU = void 0;
19
+ exports.bindAiConfigurationSettingCommands = bindAiConfigurationSettingCommands;
20
+ const tslib_1 = require("tslib");
21
+ const ai_core_1 = require("@theia/ai-core");
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");
25
+ /** Context-menu path for the AI Configuration setting-row gear. */
26
+ exports.AI_CONFIGURATION_SETTING_CONTEXT_MENU = ['ai-configuration-setting-context-menu'];
27
+ var AiConfigurationSettingCommandArgs;
28
+ (function (AiConfigurationSettingCommandArgs) {
29
+ /** Preference-backed args: `id` + `scope` present (enables Copy and preference reset). */
30
+ function isPreference(arg) {
31
+ return typeof arg === 'object' && arg !== undefined
32
+ && typeof arg.id === 'string'
33
+ && typeof arg.scope === 'number';
34
+ }
35
+ AiConfigurationSettingCommandArgs.isPreference = isPreference;
36
+ /** Resettable args: either preference-backed or carrying a `reset` callback. */
37
+ function isResettable(arg) {
38
+ return isPreference(arg) || (typeof arg === 'object' && arg !== undefined && typeof arg.reset === 'function');
39
+ }
40
+ AiConfigurationSettingCommandArgs.isResettable = isResettable;
41
+ })(AiConfigurationSettingCommandArgs || (exports.AiConfigurationSettingCommandArgs = AiConfigurationSettingCommandArgs = {}));
42
+ var AiConfigurationSettingCommands;
43
+ (function (AiConfigurationSettingCommands) {
44
+ AiConfigurationSettingCommands.RESET = { id: 'ai-configuration.setting.reset', label: core_1.nls.localizeByDefault('Reset Setting') };
45
+ AiConfigurationSettingCommands.COPY_ID = { id: 'ai-configuration.setting.copyId', label: core_1.nls.localizeByDefault('Copy Setting ID') };
46
+ AiConfigurationSettingCommands.COPY_JSON = { id: 'ai-configuration.setting.copyJson', label: core_1.nls.localizeByDefault('Copy Setting as JSON') };
47
+ })(AiConfigurationSettingCommands || (exports.AiConfigurationSettingCommands = AiConfigurationSettingCommands = {}));
48
+ /**
49
+ * Commands + menu for the AI Configuration setting-row gear, mirroring the Settings UI's preference
50
+ * context menu (Reset / Copy Setting ID / Copy as JSON) but backed by {@link AiConfigurationService} and
51
+ * acting in the row's own scope. Kept self-contained here rather than reusing the Settings UI's
52
+ * `RESET_PREFERENCE` command, which is bound to the Preferences editor widget (its scope tracker) and
53
+ * misbehaves when invoked from this view.
54
+ */
55
+ let AiConfigurationSettingCommandContribution = class AiConfigurationSettingCommandContribution {
56
+ registerCommands(commands) {
57
+ commands.registerCommand(AiConfigurationSettingCommands.RESET, {
58
+ isEnabled: AiConfigurationSettingCommandArgs.isResettable,
59
+ isVisible: AiConfigurationSettingCommandArgs.isResettable,
60
+ execute: (args) => args.reset
61
+ ? args.reset()
62
+ : this.aiConfigurationService.set(args.id, undefined, args.scope, args.resourceUri)
63
+ });
64
+ commands.registerCommand(AiConfigurationSettingCommands.COPY_ID, {
65
+ isEnabled: AiConfigurationSettingCommandArgs.isPreference,
66
+ isVisible: AiConfigurationSettingCommandArgs.isPreference,
67
+ execute: (args) => this.clipboardService.writeText(args.id)
68
+ });
69
+ commands.registerCommand(AiConfigurationSettingCommands.COPY_JSON, {
70
+ isEnabled: AiConfigurationSettingCommandArgs.isPreference,
71
+ isVisible: AiConfigurationSettingCommandArgs.isPreference,
72
+ execute: (args) => this.clipboardService.writeText(`"${args.id}": ${JSON.stringify(args.value)}`)
73
+ });
74
+ }
75
+ registerMenus(menus) {
76
+ menus.registerMenuAction(exports.AI_CONFIGURATION_SETTING_CONTEXT_MENU, { commandId: AiConfigurationSettingCommands.RESET.id, order: 'a' });
77
+ menus.registerMenuAction(exports.AI_CONFIGURATION_SETTING_CONTEXT_MENU, { commandId: AiConfigurationSettingCommands.COPY_ID.id, order: 'b' });
78
+ menus.registerMenuAction(exports.AI_CONFIGURATION_SETTING_CONTEXT_MENU, { commandId: AiConfigurationSettingCommands.COPY_JSON.id, order: 'c' });
79
+ }
80
+ };
81
+ exports.AiConfigurationSettingCommandContribution = AiConfigurationSettingCommandContribution;
82
+ tslib_1.__decorate([
83
+ (0, inversify_1.inject)(ai_core_1.AiConfigurationService),
84
+ tslib_1.__metadata("design:type", Object)
85
+ ], AiConfigurationSettingCommandContribution.prototype, "aiConfigurationService", void 0);
86
+ tslib_1.__decorate([
87
+ (0, inversify_1.inject)(clipboard_service_1.ClipboardService),
88
+ tslib_1.__metadata("design:type", Object)
89
+ ], AiConfigurationSettingCommandContribution.prototype, "clipboardService", void 0);
90
+ exports.AiConfigurationSettingCommandContribution = AiConfigurationSettingCommandContribution = tslib_1.__decorate([
91
+ (0, inversify_1.injectable)()
92
+ ], AiConfigurationSettingCommandContribution);
93
+ function bindAiConfigurationSettingCommands(bind) {
94
+ bind(AiConfigurationSettingCommandContribution).toSelf().inSingletonScope();
95
+ bind(core_1.CommandContribution).toService(AiConfigurationSettingCommandContribution);
96
+ bind(core_1.MenuContribution).toService(AiConfigurationSettingCommandContribution);
97
+ }
98
+ //# sourceMappingURL=ai-configuration-setting-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-configuration-setting-commands.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-setting-commands.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EA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,EAAE,SAAS,EAAE,8BAA8B,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACpI,KAAK,CAAC,kBAAkB,CAAC,6CAAqC,EAAE,EAAE,SAAS,EAAE,8BAA8B,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACtI,KAAK,CAAC,kBAAkB,CAAC,6CAAqC,EAAE,EAAE,SAAS,EAAE,8BAA8B,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5I,CAAC;CACJ,CAAA;AAjCY,8FAAyC;AAG/B;IADlB,IAAA,kBAAM,EAAC,gCAAsB,CAAC;;yFACmC;AAG/C;IADlB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;mFAC6B;oDAN7C,yCAAyC;IADrD,IAAA,sBAAU,GAAE;GACA,yCAAyC,CAiCrD;AAED,SAAgB,kCAAkC,CAAC,IAAqB;IACpE,IAAI,CAAC,yCAAyC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5E,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,yCAAyC,CAAC,CAAC;IAC/E,IAAI,CAAC,uBAAgB,CAAC,CAAC,SAAS,CAAC,yCAAyC,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ai-configuration-setting-commands.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-configuration-setting-commands.spec.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-setting-commands.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,70 @@
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 chai_1 = require("chai");
19
+ const core_1 = require("@theia/core");
20
+ const ai_configuration_setting_commands_1 = require("./ai-configuration-setting-commands");
21
+ function setup() {
22
+ const setCalls = [];
23
+ const copied = [];
24
+ const contribution = new ai_configuration_setting_commands_1.AiConfigurationSettingCommandContribution();
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ contribution.aiConfigurationService = {
27
+ set: (id, value, scope, resourceUri) => { setCalls.push([id, value, scope, resourceUri]); return Promise.resolve(); }
28
+ };
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ contribution.clipboardService = { writeText: (text) => { copied.push(text); } };
31
+ const handlers = new Map();
32
+ contribution.registerCommands({ registerCommand: (command, handler) => handlers.set(command.id, handler) });
33
+ return { handlers, setCalls, copied };
34
+ }
35
+ const args = { id: 'ai-features.chat.foo', value: true, scope: core_1.PreferenceScope.User };
36
+ describe('AiConfigurationSettingCommandContribution', () => {
37
+ it('resets a setting in the row scope via AiConfigurationService (not the Settings widget)', () => {
38
+ const { handlers, setCalls } = setup();
39
+ handlers.get(ai_configuration_setting_commands_1.AiConfigurationSettingCommands.RESET.id).execute({ ...args, scope: core_1.PreferenceScope.Workspace, resourceUri: 'file:///ws' });
40
+ (0, chai_1.expect)(setCalls).to.deep.equal([['ai-features.chat.foo', undefined, core_1.PreferenceScope.Workspace, 'file:///ws']]);
41
+ });
42
+ it('resets via the supplied callback for non-preference (e.g. per-agent) rows, without touching AiConfigurationService', () => {
43
+ const { handlers, setCalls } = setup();
44
+ let called = 0;
45
+ const reset = handlers.get(ai_configuration_setting_commands_1.AiConfigurationSettingCommands.RESET.id);
46
+ (0, chai_1.expect)(reset.isVisible({ reset: () => called++ })).to.equal(true);
47
+ reset.execute({ reset: () => called++ });
48
+ (0, chai_1.expect)(called).to.equal(1);
49
+ (0, chai_1.expect)(setCalls).to.be.empty;
50
+ });
51
+ it('hides the copy commands for non-preference (callback-only) rows', () => {
52
+ const { handlers } = setup();
53
+ (0, chai_1.expect)(handlers.get(ai_configuration_setting_commands_1.AiConfigurationSettingCommands.COPY_ID.id).isVisible({ reset: () => undefined })).to.equal(false);
54
+ (0, chai_1.expect)(handlers.get(ai_configuration_setting_commands_1.AiConfigurationSettingCommands.COPY_JSON.id).isVisible({ reset: () => undefined })).to.equal(false);
55
+ });
56
+ it('copies the setting id and the JSON entry', () => {
57
+ const { handlers, copied } = setup();
58
+ handlers.get(ai_configuration_setting_commands_1.AiConfigurationSettingCommands.COPY_ID.id).execute(args);
59
+ handlers.get(ai_configuration_setting_commands_1.AiConfigurationSettingCommands.COPY_JSON.id).execute(args);
60
+ (0, chai_1.expect)(copied).to.deep.equal(['ai-features.chat.foo', '"ai-features.chat.foo": true']);
61
+ });
62
+ it('guards the commands against malformed arguments', () => {
63
+ const { handlers } = setup();
64
+ const reset = handlers.get(ai_configuration_setting_commands_1.AiConfigurationSettingCommands.RESET.id);
65
+ (0, chai_1.expect)(reset.isVisible(args)).to.equal(true);
66
+ (0, chai_1.expect)(reset.isVisible({ id: 'x' })).to.equal(false); // missing scope
67
+ (0, chai_1.expect)(reset.isVisible(undefined)).to.equal(false);
68
+ });
69
+ });
70
+ //# sourceMappingURL=ai-configuration-setting-commands.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-configuration-setting-commands.spec.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-setting-commands.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2E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C;QACrE,IAAA,aAAM,EAAC,KAAK,CAAC,SAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAA,aAAM,EAAC,KAAK,CAAC,SAAU,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB;QACvE,IAAA,aAAM,EAAC,KAAK,CAAC,SAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ai-configuration-components.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-configuration-components.spec.d.ts","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/components/ai-configuration-components.spec.ts"],"names":[],"mappings":""}